Skip to content

WorkSpacesClient#

Index > WorkSpaces > WorkSpacesClient

Auto-generated documentation for WorkSpaces type annotations stubs module mypy-boto3-workspaces.

WorkSpacesClient#

Type annotations and code completion for boto3.client("workspaces"). boto3 documentation

# WorkSpacesClient usage example

from boto3.session import Session
from mypy_boto3_workspaces.client import WorkSpacesClient

def get_workspaces_client() -> WorkSpacesClient:
    return Session().client("workspaces")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("workspaces").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("workspaces")

try:
    do_something(client)
except (
    client.exceptions.AccessDeniedException,
    client.exceptions.ApplicationNotSupportedException,
    client.exceptions.ClientError,
    client.exceptions.ComputeNotCompatibleException,
    client.exceptions.IncompatibleApplicationsException,
    client.exceptions.InvalidParameterValuesException,
    client.exceptions.InvalidResourceStateException,
    client.exceptions.OperatingSystemNotCompatibleException,
    client.exceptions.OperationInProgressException,
    client.exceptions.OperationNotSupportedException,
    client.exceptions.ResourceAlreadyExistsException,
    client.exceptions.ResourceAssociatedException,
    client.exceptions.ResourceCreationFailedException,
    client.exceptions.ResourceInUseException,
    client.exceptions.ResourceLimitExceededException,
    client.exceptions.ResourceNotFoundException,
    client.exceptions.ResourceUnavailableException,
    client.exceptions.UnsupportedNetworkConfigurationException,
    client.exceptions.UnsupportedWorkspaceConfigurationException,
    client.exceptions.WorkspacesDefaultRoleNotFoundException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_workspaces.client import Exceptions

def handle_error(exc: Exceptions.AccessDeniedException) -> None:
    ...

Methods#

associate_connection_alias#

Associates the specified connection alias with the specified directory to enable cross-Region redirection.

Type annotations and code completion for boto3.client("workspaces").associate_connection_alias method. boto3 documentation

# associate_connection_alias method definition

def associate_connection_alias(
    self,
    *,
    AliasId: str,
    ResourceId: str,
) -> AssociateConnectionAliasResultTypeDef:  # (1)
    ...
  1. See AssociateConnectionAliasResultTypeDef
# associate_connection_alias method usage example with argument unpacking

kwargs: AssociateConnectionAliasRequestRequestTypeDef = {  # (1)
    "AliasId": ...,
    "ResourceId": ...,
}

parent.associate_connection_alias(**kwargs)
  1. See AssociateConnectionAliasRequestRequestTypeDef

associate_ip_groups#

Associates the specified IP access control group with the specified directory.

Type annotations and code completion for boto3.client("workspaces").associate_ip_groups method. boto3 documentation

# associate_ip_groups method definition

def associate_ip_groups(
    self,
    *,
    DirectoryId: str,
    GroupIds: Sequence[str],
) -> Dict[str, Any]:
    ...
# associate_ip_groups method usage example with argument unpacking

kwargs: AssociateIpGroupsRequestRequestTypeDef = {  # (1)
    "DirectoryId": ...,
    "GroupIds": ...,
}

parent.associate_ip_groups(**kwargs)
  1. See AssociateIpGroupsRequestRequestTypeDef

associate_workspace_application#

Associates the specified application to the specified WorkSpace.

Type annotations and code completion for boto3.client("workspaces").associate_workspace_application method. boto3 documentation

# associate_workspace_application method definition

def associate_workspace_application(
    self,
    *,
    WorkspaceId: str,
    ApplicationId: str,
) -> AssociateWorkspaceApplicationResultTypeDef:  # (1)
    ...
  1. See AssociateWorkspaceApplicationResultTypeDef
# associate_workspace_application method usage example with argument unpacking

kwargs: AssociateWorkspaceApplicationRequestRequestTypeDef = {  # (1)
    "WorkspaceId": ...,
    "ApplicationId": ...,
}

parent.associate_workspace_application(**kwargs)
  1. See AssociateWorkspaceApplicationRequestRequestTypeDef

authorize_ip_rules#

Adds one or more rules to the specified IP access control group.

Type annotations and code completion for boto3.client("workspaces").authorize_ip_rules method. boto3 documentation

# authorize_ip_rules method definition

def authorize_ip_rules(
    self,
    *,
    GroupId: str,
    UserRules: Sequence[IpRuleItemTypeDef],  # (1)
) -> Dict[str, Any]:
    ...
  1. See IpRuleItemTypeDef
# authorize_ip_rules method usage example with argument unpacking

kwargs: AuthorizeIpRulesRequestRequestTypeDef = {  # (1)
    "GroupId": ...,
    "UserRules": ...,
}

parent.authorize_ip_rules(**kwargs)
  1. See AuthorizeIpRulesRequestRequestTypeDef

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("workspaces").can_paginate method. boto3 documentation

# can_paginate method definition

def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

close#

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("workspaces").close method. boto3 documentation

# close method definition

def close(
    self,
) -> None:
    ...

copy_workspace_image#

Copies the specified image from the specified Region to the current Region.

Type annotations and code completion for boto3.client("workspaces").copy_workspace_image method. boto3 documentation

# copy_workspace_image method definition

def copy_workspace_image(
    self,
    *,
    Name: str,
    SourceImageId: str,
    SourceRegion: str,
    Description: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> CopyWorkspaceImageResultTypeDef:  # (2)
    ...
  1. See TagTypeDef
  2. See CopyWorkspaceImageResultTypeDef
# copy_workspace_image method usage example with argument unpacking

kwargs: CopyWorkspaceImageRequestRequestTypeDef = {  # (1)
    "Name": ...,
    "SourceImageId": ...,
    "SourceRegion": ...,
}

parent.copy_workspace_image(**kwargs)
  1. See CopyWorkspaceImageRequestRequestTypeDef

create_connect_client_add_in#

Creates a client-add-in for Amazon Connect within a directory.

Type annotations and code completion for boto3.client("workspaces").create_connect_client_add_in method. boto3 documentation

# create_connect_client_add_in method definition

def create_connect_client_add_in(
    self,
    *,
    ResourceId: str,
    Name: str,
    URL: str,
) -> CreateConnectClientAddInResultTypeDef:  # (1)
    ...
  1. See CreateConnectClientAddInResultTypeDef
# create_connect_client_add_in method usage example with argument unpacking

kwargs: CreateConnectClientAddInRequestRequestTypeDef = {  # (1)
    "ResourceId": ...,
    "Name": ...,
    "URL": ...,
}

parent.create_connect_client_add_in(**kwargs)
  1. See CreateConnectClientAddInRequestRequestTypeDef

create_connection_alias#

Creates the specified connection alias for use with cross-Region redirection.

Type annotations and code completion for boto3.client("workspaces").create_connection_alias method. boto3 documentation

# create_connection_alias method definition

def create_connection_alias(
    self,
    *,
    ConnectionString: str,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> CreateConnectionAliasResultTypeDef:  # (2)
    ...
  1. See TagTypeDef
  2. See CreateConnectionAliasResultTypeDef
# create_connection_alias method usage example with argument unpacking

kwargs: CreateConnectionAliasRequestRequestTypeDef = {  # (1)
    "ConnectionString": ...,
}

parent.create_connection_alias(**kwargs)
  1. See CreateConnectionAliasRequestRequestTypeDef

create_ip_group#

Creates an IP access control group.

Type annotations and code completion for boto3.client("workspaces").create_ip_group method. boto3 documentation

# create_ip_group method definition

def create_ip_group(
    self,
    *,
    GroupName: str,
    GroupDesc: str = ...,
    UserRules: Sequence[IpRuleItemTypeDef] = ...,  # (1)
    Tags: Sequence[TagTypeDef] = ...,  # (2)
) -> CreateIpGroupResultTypeDef:  # (3)
    ...
  1. See IpRuleItemTypeDef
  2. See TagTypeDef
  3. See CreateIpGroupResultTypeDef
# create_ip_group method usage example with argument unpacking

kwargs: CreateIpGroupRequestRequestTypeDef = {  # (1)
    "GroupName": ...,
}

parent.create_ip_group(**kwargs)
  1. See CreateIpGroupRequestRequestTypeDef

create_standby_workspaces#

Creates a standby WorkSpace in a secondary Region.

Type annotations and code completion for boto3.client("workspaces").create_standby_workspaces method. boto3 documentation

# create_standby_workspaces method definition

def create_standby_workspaces(
    self,
    *,
    PrimaryRegion: str,
    StandbyWorkspaces: Sequence[StandbyWorkspaceTypeDef],  # (1)
) -> CreateStandbyWorkspacesResultTypeDef:  # (2)
    ...
  1. See StandbyWorkspaceTypeDef
  2. See CreateStandbyWorkspacesResultTypeDef
# create_standby_workspaces method usage example with argument unpacking

kwargs: CreateStandbyWorkspacesRequestRequestTypeDef = {  # (1)
    "PrimaryRegion": ...,
    "StandbyWorkspaces": ...,
}

parent.create_standby_workspaces(**kwargs)
  1. See CreateStandbyWorkspacesRequestRequestTypeDef

create_tags#

Creates the specified tags for the specified WorkSpaces resource.

Type annotations and code completion for boto3.client("workspaces").create_tags method. boto3 documentation

# create_tags method definition

def create_tags(
    self,
    *,
    ResourceId: str,
    Tags: Sequence[TagTypeDef],  # (1)
) -> Dict[str, Any]:
    ...
  1. See TagTypeDef
# create_tags method usage example with argument unpacking

kwargs: CreateTagsRequestRequestTypeDef = {  # (1)
    "ResourceId": ...,
    "Tags": ...,
}

parent.create_tags(**kwargs)
  1. See CreateTagsRequestRequestTypeDef

create_updated_workspace_image#

Creates a new updated WorkSpace image based on the specified source image.

Type annotations and code completion for boto3.client("workspaces").create_updated_workspace_image method. boto3 documentation

# create_updated_workspace_image method definition

def create_updated_workspace_image(
    self,
    *,
    Name: str,
    Description: str,
    SourceImageId: str,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> CreateUpdatedWorkspaceImageResultTypeDef:  # (2)
    ...
  1. See TagTypeDef
  2. See CreateUpdatedWorkspaceImageResultTypeDef
# create_updated_workspace_image method usage example with argument unpacking

kwargs: CreateUpdatedWorkspaceImageRequestRequestTypeDef = {  # (1)
    "Name": ...,
    "Description": ...,
    "SourceImageId": ...,
}

parent.create_updated_workspace_image(**kwargs)
  1. See CreateUpdatedWorkspaceImageRequestRequestTypeDef

create_workspace_bundle#

Creates the specified WorkSpace bundle.

Type annotations and code completion for boto3.client("workspaces").create_workspace_bundle method. boto3 documentation

# create_workspace_bundle method definition

def create_workspace_bundle(
    self,
    *,
    BundleName: str,
    BundleDescription: str,
    ImageId: str,
    ComputeType: ComputeTypeTypeDef,  # (1)
    UserStorage: UserStorageTypeDef,  # (2)
    RootStorage: RootStorageTypeDef = ...,  # (3)
    Tags: Sequence[TagTypeDef] = ...,  # (4)
) -> CreateWorkspaceBundleResultTypeDef:  # (5)
    ...
  1. See ComputeTypeTypeDef
  2. See UserStorageTypeDef
  3. See