createWorkspace method

Future<CreateWorkspaceResponse> createWorkspace({
  1. required String instanceId,
  2. required String name,
  3. String? description,
  4. Map<String, String>? tags,
  5. WorkspaceTheme? theme,
  6. String? title,
})

Creates a workspace that defines the user experience by mapping views to pages. Workspaces can be assigned to users or routing profiles.

May throw AccessDeniedException. May throw DuplicateResourceException. May throw InternalServiceException. May throw InvalidParameterException. May throw InvalidRequestException. May throw LimitExceededException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException.

Parameter instanceId : The identifier of the Amazon Connect instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

Parameter name : The name of the workspace. Must be unique within the instance and can contain 1-127 characters.

Parameter description : The description of the workspace. Maximum length is 250 characters.

Parameter tags : The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.

Parameter theme : The theme configuration for the workspace, including colors and styling.

Parameter title : The title displayed for the workspace.

Implementation

Future<CreateWorkspaceResponse> createWorkspace({
  required String instanceId,
  required String name,
  String? description,
  Map<String, String>? tags,
  WorkspaceTheme? theme,
  String? title,
}) async {
  final $payload = <String, dynamic>{
    'Name': name,
    if (description != null) 'Description': description,
    if (tags != null) 'Tags': tags,
    if (theme != null) 'Theme': theme,
    if (title != null) 'Title': title,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/workspaces/${Uri.encodeComponent(instanceId)}',
    exceptionFnMap: _exceptionFns,
  );
  return CreateWorkspaceResponse.fromJson(response);
}