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.ConflictException,
    client.exceptions.IncompatibleApplicationsException,
    client.exceptions.InternalServerException,
    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.ValidationException,
    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#

Accepts the account link invitation.

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

# accept_account_link_invitation method definition

def accept_account_link_invitation(
    self,
    *,
    LinkId: str,
    ClientToken: str = ...,
) -> AcceptAccountLinkInvitationResultTypeDef:  # (1)
    ...
  1. See AcceptAccountLinkInvitationResultTypeDef
# accept_account_link_invitation method usage example with argument unpacking

kwargs: AcceptAccountLinkInvitationRequestRequestTypeDef = {  # (1)
    "LinkId": ...,
}

parent.accept_account_link_invitation(**kwargs)
  1. See AcceptAccountLinkInvitationRequestRequestTypeDef

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: Cop