Skip to content

deregister_device

deregister_device(
    id: DeviceId,
    *,
    config_overrides: Optional[WorkSpacesThinClientClientConfig] = None,
    target_device_status: Optional[TargetDeviceStatus] = None,
    client_token: Optional[ClientToken] = None,
) -> DeregisterDeviceResponse

Deregisters a thin client device.

Parameters:

  • id (DeviceId) –

    The ID of the device to deregister.

  • target_device_status (Optional[TargetDeviceStatus], default: None ) –

    The desired new status for the device.

  • client_token (Optional[ClientToken], default: None ) –

    Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value.

    If you don't provide this value, then Amazon Web Services generates a random one for you.

    If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an IdempotentParameterMismatch error.

Raises:

Source code in docs_src/capo_workspaces_thin_client/_services/work_spaces_thin_client.py
def deregister_device(
    self,
    id: "capo_workspaces_thin_client.types.device_id.DeviceId",
    *,
    config_overrides: Optional[WorkSpacesThinClientClientConfig] = None,
    target_device_status: Optional[
        "capo_workspaces_thin_client.types.target_device_status.TargetDeviceStatus"
    ] = None,
    client_token: Optional[
        "capo_workspaces_thin_client.types.client_token.ClientToken"
    ] = None,
) -> "capo_workspaces_thin_client.types.deregister_device_response.DeregisterDeviceResponse":
    """<p>Deregisters a thin client device.</p>

    Args:
        id: <p>The ID of the device to deregister.</p>
        target_device_status: <p>The desired new status for the device.</p>
        client_token: <p>Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value</a>.</p> <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p> <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>

    Raises:
        capo_workspaces_thin_client.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_workspaces_thin_client.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.</p>
        capo_workspaces_thin_client.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
        capo_workspaces_thin_client.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request was not found.</p>
        capo_workspaces_thin_client.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_workspaces_thin_client.errors.validation_exception.ValidationException: <p>The input fails to satisfy the specified constraints.</p>
        capo_workspaces_thin_client.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_workspaces_thin_client.types.deregister_device_request.DeregisterDeviceRequest]",
    ) -> OperationResponse[
        "capo_workspaces_thin_client.types.deregister_device_response.DeregisterDeviceResponse"
    ]:
        import capo_workspaces_thin_client._operations.thin_client.deregister_device

        output, http_response = (
            capo_workspaces_thin_client._operations.thin_client.deregister_device.deregister_device(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeregisterDevice")
    )
    input_: capo_workspaces_thin_client.types.deregister_device_request.DeregisterDeviceRequest = {
        "id": id
    }
    if target_device_status is not None:
        input_["target_device_status"] = target_device_status
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output