updateEnvironment method
Updates an environment.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter id :
The ID of the environment to update.
Parameter desiredSoftwareSetId :
The ID of the software set to apply.
Parameter desktopArn :
The Amazon Resource Name (ARN) of the desktop to stream from Amazon
WorkSpaces, WorkSpaces Secure Browser, or AppStream 2.0.
Parameter desktopEndpoint :
The URL for the identity provider login (only for environments that use
AppStream 2.0).
Parameter deviceCreationTags :
A map of the key-value pairs of the tag or tags to assign to the newly
created devices for this environment.
Parameter maintenanceWindow :
A specification for a time window to apply software updates.
Parameter name :
The name of the environment to update.
Parameter softwareSetUpdateMode :
An option to define which software updates to apply.
Parameter softwareSetUpdateSchedule :
An option to define if software updates should be applied within a
maintenance window.
Implementation
Future<UpdateEnvironmentResponse> updateEnvironment({
required String id,
String? desiredSoftwareSetId,
String? desktopArn,
String? desktopEndpoint,
Map<String, String>? deviceCreationTags,
MaintenanceWindow? maintenanceWindow,
String? name,
SoftwareSetUpdateMode? softwareSetUpdateMode,
SoftwareSetUpdateSchedule? softwareSetUpdateSchedule,
}) async {
final $payload = <String, dynamic>{
if (desiredSoftwareSetId != null)
'desiredSoftwareSetId': desiredSoftwareSetId,
if (desktopArn != null) 'desktopArn': desktopArn,
if (desktopEndpoint != null) 'desktopEndpoint': desktopEndpoint,
if (deviceCreationTags != null) 'deviceCreationTags': deviceCreationTags,
if (maintenanceWindow != null) 'maintenanceWindow': maintenanceWindow,
if (name != null) 'name': name,
if (softwareSetUpdateMode != null)
'softwareSetUpdateMode': softwareSetUpdateMode.value,
if (softwareSetUpdateSchedule != null)
'softwareSetUpdateSchedule': softwareSetUpdateSchedule.value,
};
final response = await _protocol.send(
payload: $payload,
method: 'PATCH',
requestUri: '/environments/${Uri.encodeComponent(id)}',
exceptionFnMap: _exceptionFns,
);
return UpdateEnvironmentResponse.fromJson(response);
}