updateServiceTemplateVersion method

Future<UpdateServiceTemplateVersionOutput> updateServiceTemplateVersion({
  1. required String majorVersion,
  2. required String minorVersion,
  3. required String templateName,
  4. List<CompatibleEnvironmentTemplateInput>? compatibleEnvironmentTemplates,
  5. String? description,
  6. TemplateVersionStatus? status,
  7. List<ServiceTemplateSupportedComponentSourceType>? supportedComponentSources,
})

Update a major or minor version of a service template.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter majorVersion : To update a major version of a service template, include major Version.

Parameter minorVersion : To update a minor version of a service template, include minorVersion.

Parameter templateName : The name of the service template.

Parameter compatibleEnvironmentTemplates : An array of environment template objects that are compatible with this service template version. A service instance based on this service template version can run in environments based on compatible templates.

Parameter description : A description of a service template version to update.

Parameter status : The status of the service template minor version to update.

Parameter supportedComponentSources : An array of supported component sources. Components with supported sources can be attached to service instances based on this service template version. For more information about components, see Proton components in the Proton User Guide.

Implementation

Future<UpdateServiceTemplateVersionOutput> updateServiceTemplateVersion({
  required String majorVersion,
  required String minorVersion,
  required String templateName,
  List<CompatibleEnvironmentTemplateInput>? compatibleEnvironmentTemplates,
  String? description,
  TemplateVersionStatus? status,
  List<ServiceTemplateSupportedComponentSourceType>?
      supportedComponentSources,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AwsProton20200720.UpdateServiceTemplateVersion'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'majorVersion': majorVersion,
      'minorVersion': minorVersion,
      'templateName': templateName,
      if (compatibleEnvironmentTemplates != null)
        'compatibleEnvironmentTemplates': compatibleEnvironmentTemplates,
      if (description != null) 'description': description,
      if (status != null) 'status': status.value,
      if (supportedComponentSources != null)
        'supportedComponentSources':
            supportedComponentSources.map((e) => e.value).toList(),
    },
  );

  return UpdateServiceTemplateVersionOutput.fromJson(jsonResponse.body);
}