Skip to content

update_environment async

update_environment(
    id: EnvironmentId,
    *,
    config_overrides: Optional[AsyncWorkSpacesThinClientClientConfig] = None,
    name: Optional[EnvironmentName] = None,
    desktop_arn: Optional[Arn] = None,
    desktop_endpoint: Optional[DesktopEndpoint] = None,
    software_set_update_schedule: Optional[SoftwareSetUpdateSchedule] = None,
    maintenance_window: Optional[MaintenanceWindow] = None,
    software_set_update_mode: Optional[SoftwareSetUpdateMode] = None,
    desired_software_set_id: Optional[SoftwareSetIdOrEmptyString] = None,
    device_creation_tags: Optional[DeviceCreationTagsMap] = None,
) -> UpdateEnvironmentResponse

Updates an environment.

Parameters:

  • id (EnvironmentId) –

    The ID of the environment to update.

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

    The name of the environment to update.

  • desktop_arn (Optional[Arn], default: None ) –

    The Amazon Resource Name (ARN) of the desktop to stream from Amazon WorkSpaces, WorkSpaces Secure Browser, or AppStream 2.0.

  • desktop_endpoint (Optional[DesktopEndpoint], default: None ) –

    The URL for the identity provider login (only for environments that use AppStream 2.0).

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

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

  • maintenance_window (Optional[MaintenanceWindow], default: None ) –

    A specification for a time window to apply software updates.

  • software_set_update_mode (Optional[SoftwareSetUpdateMode], default: None ) –

    An option to define which software updates to apply.

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

    The ID of the software set to apply.

  • device_creation_tags (Optional[DeviceCreationTagsMap], default: None ) –

    A map of the key-value pairs of the tag or tags to assign to the newly created devices for this environment.

Raises:

Source code in docs_src/capo_workspaces_thin_client/_services/async_work_spaces_thin_client.py
async def update_environment(
    self,
    id: "capo_workspaces_thin_client.types.environment_id.EnvironmentId",
    *,
    config_overrides: Optional[AsyncWorkSpacesThinClientClientConfig] = None,
    name: Optional[
        "capo_workspaces_thin_client.types.environment_name.EnvironmentName"
    ] = None,
    desktop_arn: Optional["capo_workspaces_thin_client.types.arn.Arn"] = None,
    desktop_endpoint: Optional[
        "capo_workspaces_thin_client.types.desktop_endpoint.DesktopEndpoint"
    ] = None,
    software_set_update_schedule: Optional[
        "capo_workspaces_thin_client.types.software_set_update_schedule.SoftwareSetUpdateSchedule"
    ] = None,
    maintenance_window: Optional[
        "capo_workspaces_thin_client.types.maintenance_window.MaintenanceWindow"
    ] = None,
    software_set_update_mode: Optional[
        "capo_workspaces_thin_client.types.software_set_update_mode.SoftwareSetUpdateMode"
    ] = None,
    desired_software_set_id: Optional[
        "capo_workspaces_thin_client.types.software_set_id_or_empty_string.SoftwareSetIdOrEmptyString"
    ] = None,
    device_creation_tags: Optional[
        "capo_workspaces_thin_client.types.device_creation_tags_map.DeviceCreationTagsMap"
    ] = None,
) -> "capo_workspaces_thin_client.types.update_environment_response.UpdateEnvironmentResponse":
    """<p>Updates an environment.</p>

    Args:
        id: <p>The ID of the environment to update.</p>
        name: <p>The name of the environment to update.</p>
        desktop_arn: <p>The Amazon Resource Name (ARN) of the desktop to stream from Amazon WorkSpaces, WorkSpaces Secure Browser, or AppStream 2.0.</p>
        desktop_endpoint: <p>The URL for the identity provider login (only for environments that use AppStream 2.0).</p>
        software_set_update_schedule: <p>An option to define if software updates should be applied within a maintenance window.</p>
        maintenance_window: <p>A specification for a time window to apply software updates.</p>
        software_set_update_mode: <p>An option to define which software updates to apply.</p>
        desired_software_set_id: <p>The ID of the software set to apply.</p>
        device_creation_tags: <p>A map of the key-value pairs of the tag or tags to assign to the newly created devices for this environment.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_workspaces_thin_client.types.update_environment_request.UpdateEnvironmentRequest]",
    ) -> AsyncOperationResponse[
        "capo_workspaces_thin_client.types.update_environment_response.UpdateEnvironmentResponse"
    ]:
        import capo_workspaces_thin_client._operations.thin_client.update_environment

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

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

        return capo_workspaces_thin_client.types.update_environment_request.redact_sensitive(
            input_
        )

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

        return capo_workspaces_thin_client.types.update_environment_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateEnvironment",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_workspaces_thin_client.types.update_environment_request.UpdateEnvironmentRequest = {
        "id": id
    }
    if name is not None:
        input_["name"] = name
    if desktop_arn is not None:
        input_["desktop_arn"] = desktop_arn
    if desktop_endpoint is not None:
        input_["desktop_endpoint"] = desktop_endpoint
    if software_set_update_schedule is not None:
        input_["software_set_update_schedule"] = software_set_update_schedule
    if maintenance_window is not None:
        input_["maintenance_window"] = maintenance_window
    if software_set_update_mode is not None:
        input_["software_set_update_mode"] = software_set_update_mode
    if desired_software_set_id is not None:
        input_["desired_software_set_id"] = desired_software_set_id
    if device_creation_tags is not None:
        input_["device_creation_tags"] = device_creation_tags

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