stopWorkspaces method
Stops the specified WorkSpaces.
You cannot stop a WorkSpace unless it has a running mode of
AutoStop
and a state of AVAILABLE
,
IMPAIRED
, UNHEALTHY
, or ERROR
.
Parameter stopWorkspaceRequests
:
The WorkSpaces to stop. You can specify up to 25 WorkSpaces.
Implementation
Future<StopWorkspacesResult> stopWorkspaces({
required List<StopRequest> stopWorkspaceRequests,
}) async {
ArgumentError.checkNotNull(stopWorkspaceRequests, 'stopWorkspaceRequests');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'WorkspacesService.StopWorkspaces'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'StopWorkspaceRequests': stopWorkspaceRequests,
},
);
return StopWorkspacesResult.fromJson(jsonResponse.body);
}