createApplication method
Creates an application.
May throw ApplicationAlreadyExistsException.
May throw ApplicationLimitExceededException.
May throw ApplicationNameRequiredException.
May throw InvalidApplicationNameException.
May throw InvalidComputePlatformException.
May throw InvalidTagsToAddException.
Parameter applicationName :
The name of the application. This name must be unique with the applicable
user or Amazon Web Services account.
Parameter computePlatform :
The destination platform type for the deployment (Lambda,
Server, or ECS).
Parameter tags :
The metadata that you apply to CodeDeploy applications to help you
organize and categorize them. Each tag consists of a key and an optional
value, both of which you define.
Implementation
Future<CreateApplicationOutput> createApplication({
required String applicationName,
ComputePlatform? computePlatform,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'CodeDeploy_20141006.CreateApplication'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'applicationName': applicationName,
if (computePlatform != null) 'computePlatform': computePlatform.value,
if (tags != null) 'tags': tags,
},
);
return CreateApplicationOutput.fromJson(jsonResponse.body);
}