updateEnvironment method
Updates an environment.
May throw BadRequestException. May throw ResourceNotFoundException. May throw InternalServerException.
Parameter applicationId
:
The application ID.
Parameter environmentId
:
The environment ID.
Parameter description
:
A description of the environment.
Parameter monitors
:
Amazon CloudWatch alarms to monitor during the deployment process.
Parameter name
:
The name of the environment.
Implementation
Future<Environment> updateEnvironment({
required String applicationId,
required String environmentId,
String? description,
List<Monitor>? monitors,
String? name,
}) async {
ArgumentError.checkNotNull(applicationId, 'applicationId');
ArgumentError.checkNotNull(environmentId, 'environmentId');
_s.validateStringLength(
'description',
description,
0,
1024,
);
_s.validateStringLength(
'name',
name,
1,
64,
);
final $payload = <String, dynamic>{
if (description != null) 'Description': description,
if (monitors != null) 'Monitors': monitors,
if (name != null) 'Name': name,
};
final response = await _protocol.send(
payload: $payload,
method: 'PATCH',
requestUri:
'/applications/${Uri.encodeComponent(applicationId)}/environments/${Uri.encodeComponent(environmentId)}',
exceptionFnMap: _exceptionFns,
);
return Environment.fromJson(response);
}