createApplication method

Future<CreateApplicationResponse> createApplication({
  1. required ApplicationSourceConfig applicationSourceConfig,
  2. required String name,
  3. required String namespace,
  4. ApplicationConfig? applicationConfig,
  5. ApplicationType? applicationType,
  6. String? clientToken,
  7. String? description,
  8. IframeConfig? iframeConfig,
  9. int? initializationTimeout,
  10. bool? isService,
  11. List<String>? permissions,
  12. List<Publication>? publications,
  13. List<Subscription>? subscriptions,
  14. Map<String, String>? tags,
})

Creates and persists an Application resource.

May throw AccessDeniedException. May throw DuplicateResourceException. May throw InternalServiceError. May throw InvalidRequestException. May throw ResourceQuotaExceededException. May throw ThrottlingException. May throw UnsupportedOperationException.

Parameter applicationSourceConfig : The configuration for where the application should be loaded from.

Parameter name : The name of the application.

Parameter namespace : The namespace of the application.

Parameter applicationConfig : The configuration settings for the application.

Parameter applicationType : The type of application.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

Parameter description : The description of the application.

Parameter iframeConfig : The iframe configuration for the application.

Parameter initializationTimeout : The maximum time in milliseconds allowed to establish a connection with the workspace.

Parameter isService : Indicates whether the application is a service.

Parameter permissions : The configuration of events or requests that the application has access to.

Parameter publications : The events that the application publishes.

Parameter subscriptions : The events that the application subscribes.

Parameter tags : The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.

Implementation

Future<CreateApplicationResponse> createApplication({
  required ApplicationSourceConfig applicationSourceConfig,
  required String name,
  required String namespace,
  ApplicationConfig? applicationConfig,
  ApplicationType? applicationType,
  String? clientToken,
  String? description,
  IframeConfig? iframeConfig,
  int? initializationTimeout,
  bool? isService,
  List<String>? permissions,
  List<Publication>? publications,
  List<Subscription>? subscriptions,
  Map<String, String>? tags,
}) async {
  _s.validateNumRange(
    'initializationTimeout',
    initializationTimeout,
    1,
    600000,
  );
  final $payload = <String, dynamic>{
    'ApplicationSourceConfig': applicationSourceConfig,
    'Name': name,
    'Namespace': namespace,
    if (applicationConfig != null) 'ApplicationConfig': applicationConfig,
    if (applicationType != null) 'ApplicationType': applicationType.value,
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'Description': description,
    if (iframeConfig != null) 'IframeConfig': iframeConfig,
    if (initializationTimeout != null)
      'InitializationTimeout': initializationTimeout,
    if (isService != null) 'IsService': isService,
    if (permissions != null) 'Permissions': permissions,
    if (publications != null) 'Publications': publications,
    if (subscriptions != null) 'Subscriptions': subscriptions,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/applications',
    exceptionFnMap: _exceptionFns,
  );
  return CreateApplicationResponse.fromJson(response);
}