startWorkspaces method

Future<StartWorkspacesResult> startWorkspaces({
  1. required List<StartRequest> startWorkspaceRequests,
})

Starts the specified WorkSpaces.

You cannot start a WorkSpace unless it has a running mode of AutoStop and a state of STOPPED.

Parameter startWorkspaceRequests : The WorkSpaces to start. You can specify up to 25 WorkSpaces.

Implementation

Future<StartWorkspacesResult> startWorkspaces({
  required List<StartRequest> startWorkspaceRequests,
}) async {
  ArgumentError.checkNotNull(
      startWorkspaceRequests, 'startWorkspaceRequests');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkspacesService.StartWorkspaces'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'StartWorkspaceRequests': startWorkspaceRequests,
    },
  );

  return StartWorkspacesResult.fromJson(jsonResponse.body);
}