Skip to content

update_device async

update_device(
    id: DeviceId,
    *,
    config_overrides: Optional[AsyncWorkSpacesThinClientClientConfig] = None,
    name: Optional[DeviceName] = None,
    desired_software_set_id: Optional[SoftwareSetId] = None,
    software_set_update_schedule: Optional[SoftwareSetUpdateSchedule] = None,
) -> UpdateDeviceResponse

Updates a thin client device.

Parameters:

  • id (DeviceId) –

    The ID of the device to update.

  • name (Optional[DeviceName], default: None ) –

    The name of the device to update.

  • desired_software_set_id (Optional[SoftwareSetId], default: None ) –

    The ID of the software set to apply.

  • software_set_update_schedule (Optional[SoftwareSetUpdateSchedule], default: None ) –

    An option to define if software updates should be applied within a maintenance window.

Raises:

Source code in docs_src/capo_workspaces_thin_client/_services/async_work_spaces_thin_client.py
async def update_device(
    self,
    id: "capo_workspaces_thin_client.types.device_id.DeviceId",
    *,
    config_overrides: Optional[AsyncWorkSpacesThinClientClientConfig] = None,
    name: Optional[
        "capo_workspaces_thin_client.types.device_name.DeviceName"
    ] = None,
    desired_software_set_id: Optional[
        "capo_workspaces_thin_client.types.software_set_id.SoftwareSetId"
    ] = None,
    software_set_update_schedule: Optional[
        "capo_workspaces_thin_client.types.software_set_update_schedule.SoftwareSetUpdateSchedule"
    ] = None,
) -> (
    "capo_workspaces_thin_client.types.update_device_response.UpdateDeviceResponse"
):
    """<p>Updates a thin client device.</p>

    Args:
        id: <p>The ID of the device to update.</p>
        name: <p>The name of the device to update.</p>
        desired_software_set_id: <p>The ID of the software set to apply.</p>
        software_set_update_schedule: <p>An option to define if software updates should be applied within a maintenance window.</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.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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_workspaces_thin_client.types.update_device_request.UpdateDeviceRequest]",
    ) -> AsyncOperationResponse[
        "capo_workspaces_thin_client.types.update_device_response.UpdateDeviceResponse"
    ]:
        import capo_workspaces_thin_client._operations.thin_client.update_device

        (
            output,
            http_response,
        ) = await capo_workspaces_thin_client._operations.thin_client.update_device.async_update_device(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_workspaces_thin_client.types.update_device_request.UpdateDeviceRequest",
    ) -> dict[str, Any]:
        import capo_workspaces_thin_client.types.update_device_request

        return capo_workspaces_thin_client.types.update_device_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_workspaces_thin_client.types.update_device_response.UpdateDeviceResponse",
    ) -> dict[str, Any]:
        import capo_workspaces_thin_client.types.update_device_response

        return capo_workspaces_thin_client.types.update_device_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateDevice", redact_input=_redact_input, redact_output=_redact_output
        ),
    )
    input_: capo_workspaces_thin_client.types.update_device_request.UpdateDeviceRequest = {
        "id": id
    }
    if name is not None:
        input_["name"] = name
    if desired_software_set_id is not None:
        input_["desired_software_set_id"] = desired_software_set_id
    if software_set_update_schedule is not None:
        input_["software_set_update_schedule"] = software_set_update_schedule

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output