createWorkspace method

Future<CreateWorkspaceResponse> createWorkspace({
  1. required String workspaceId,
  2. String? description,
  3. String? role,
  4. String? s3Location,
  5. Map<String, String>? tags,
})

Creates a workplace.

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

Parameter workspaceId : The ID of the workspace.

Parameter description : The description of the workspace.

Parameter role : The ARN of the execution role associated with the workspace.

Parameter s3Location : The ARN of the S3 bucket where resources associated with the workspace are stored.

Parameter tags : Metadata that you can use to manage the workspace

Implementation

Future<CreateWorkspaceResponse> createWorkspace({
  required String workspaceId,
  String? description,
  String? role,
  String? s3Location,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    if (description != null) 'description': description,
    if (role != null) 'role': role,
    if (s3Location != null) 's3Location': s3Location,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/workspaces/${Uri.encodeComponent(workspaceId)}',
    exceptionFnMap: _exceptionFns,
  );
  return CreateWorkspaceResponse.fromJson(response);
}