createApplication method

Future<CreateApplicationResponse> createApplication({
  1. required String name,
  2. String? clientToken,
  3. String? description,
  4. Map<String, String>? tags,
})

Creates a new application that is the top-level node in a hierarchy of related cloud resource abstractions.

May throw ConflictException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter name : The name of the application. The name must be unique in the region in which you are creating the application.

Parameter clientToken : A unique identifier that you provide to ensure idempotency. If you retry a request that completed successfully using the same client token and the same parameters, the retry succeeds without performing any further actions. If you retry a successful request using the same client token, but one or more of the parameters are different, the retry fails.

Parameter description : The description of the application.

Parameter tags : Key-value pairs you can use to associate with the application.

Implementation

Future<CreateApplicationResponse> createApplication({
  required String name,
  String? clientToken,
  String? description,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'name': name,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'description': description,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/applications',
    exceptionFnMap: _exceptionFns,
  );
  return CreateApplicationResponse.fromJson(response);
}