createApplicationVersion method

Future<CreateApplicationVersionResponse> createApplicationVersion({
  1. required String applicationId,
  2. required String semanticVersion,
  3. String? sourceCodeArchiveUrl,
  4. String? sourceCodeUrl,
  5. String? templateBody,
  6. String? templateUrl,
})

Creates an application version.

May throw TooManyRequestsException. May throw BadRequestException. May throw InternalServerErrorException. May throw ConflictException. May throw ForbiddenException.

Parameter applicationId : The Amazon Resource Name (ARN) of the application.

Parameter semanticVersion : The semantic version of the new version.

Parameter sourceCodeArchiveUrl : A link to the S3 object that contains the ZIP archive of the source code for this version of your application.

Maximum size 50 MB

Parameter sourceCodeUrl : A link to a public repository for the source code of your application, for example the URL of a specific GitHub commit.

Parameter templateBody : The raw packaged AWS SAM template of your application.

Parameter templateUrl : A link to the packaged AWS SAM template of your application.

Implementation

Future<CreateApplicationVersionResponse> createApplicationVersion({
  required String applicationId,
  required String semanticVersion,
  String? sourceCodeArchiveUrl,
  String? sourceCodeUrl,
  String? templateBody,
  String? templateUrl,
}) async {
  ArgumentError.checkNotNull(applicationId, 'applicationId');
  ArgumentError.checkNotNull(semanticVersion, 'semanticVersion');
  final $payload = <String, dynamic>{
    if (sourceCodeArchiveUrl != null)
      'sourceCodeArchiveUrl': sourceCodeArchiveUrl,
    if (sourceCodeUrl != null) 'sourceCodeUrl': sourceCodeUrl,
    if (templateBody != null) 'templateBody': templateBody,
    if (templateUrl != null) 'templateUrl': templateUrl,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/applications/${Uri.encodeComponent(applicationId)}/versions/${Uri.encodeComponent(semanticVersion)}',
    exceptionFnMap: _exceptionFns,
  );
  return CreateApplicationVersionResponse.fromJson(response);
}