Skip to content

update_environment async

update_environment(
    environment_id: EnvironmentId,
    *,
    config_overrides: Optional[AsyncCloud9ClientConfig] = None,
    name: Optional[EnvironmentName] = None,
    description: Optional[EnvironmentDescription] = None,
    managed_credentials_action: Optional[ManagedCredentialsAction] = None,
) -> UpdateEnvironmentResult

Changes the settings of an existing Cloud9 development environment.

Cloud9 is no longer available to new customers. Existing customers of Cloud9 can continue to use the service as normal. Learn more"

Parameters:

  • environment_id (EnvironmentId) –

    The ID of the environment to change settings.

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

    A replacement name for the environment.

  • description (Optional[EnvironmentDescription], default: None ) –

    Any new or replacement description for the environment.

  • managed_credentials_action (Optional[ManagedCredentialsAction], default: None ) –

    Allows the environment owner to turn on or turn off the Amazon Web Services managed temporary credentials for an Cloud9 environment by using one of the following values:

    • ENABLE

    • DISABLE

    Only the environment owner can change the status of managed temporary credentials. An AccessDeniedException is thrown if an attempt to turn on or turn off managed temporary credentials is made by an account that's not the environment owner.

Raises:

Examples:

UpdateEnvironment

>>> await client.update_environment(environment_id='8d9967e2f0624182b74e7690ad69ebEX', name='my-changed-demo-environment', description='This is my changed demonstration environment.')
Source code in docs_src/capo_cloud9/_services/async_cloud9.py
async def update_environment(
    self,
    environment_id: "capo_cloud9.types.environment_id.EnvironmentId",
    *,
    config_overrides: Optional[AsyncCloud9ClientConfig] = None,
    name: Optional["capo_cloud9.types.environment_name.EnvironmentName"] = None,
    description: Optional[
        "capo_cloud9.types.environment_description.EnvironmentDescription"
    ] = None,
    managed_credentials_action: Optional[
        "capo_cloud9.types.managed_credentials_action.ManagedCredentialsAction"
    ] = None,
) -> "capo_cloud9.types.update_environment_result.UpdateEnvironmentResult":
    """<p>Changes the settings of an existing Cloud9 development environment.</p> <important> <p>Cloud9 is no longer available to new customers. Existing customers of Cloud9 can continue to use the service as normal. <a href="http://aws.amazon.com/blogs/devops/how-to-migrate-from-aws-cloud9-to-aws-ide-toolkits-or-aws-cloudshell/">Learn more"</a> </p> </important>

    Args:
        environment_id: <p>The ID of the environment to change settings.</p>
        name: <p>A replacement name for the environment.</p>
        description: <p>Any new or replacement description for the environment.</p>
        managed_credentials_action: <p>Allows the environment owner to turn on or turn off the Amazon Web Services managed temporary credentials for an Cloud9 environment by using one of the following values:</p> <ul> <li> <p> <code>ENABLE</code> </p> </li> <li> <p> <code>DISABLE</code> </p> </li> </ul> <note> <p>Only the environment owner can change the status of managed temporary credentials. An <code>AccessDeniedException</code> is thrown if an attempt to turn on or turn off managed temporary credentials is made by an account that's not the environment owner.</p> </note>

    Raises:
        capo_cloud9.errors.bad_request_exception.BadRequestException: <p>The target request is invalid.</p>
        capo_cloud9.errors.conflict_exception.ConflictException: <p>A conflict occurred.</p>
        capo_cloud9.errors.forbidden_exception.ForbiddenException: <p>An access permissions issue occurred.</p>
        capo_cloud9.errors.internal_server_error_exception.InternalServerErrorException: <p>An internal server error occurred.</p>
        capo_cloud9.errors.limit_exceeded_exception.LimitExceededException: <p>A service limit was exceeded.</p>
        capo_cloud9.errors.not_found_exception.NotFoundException: <p>The target resource cannot be found.</p>
        capo_cloud9.errors.too_many_requests_exception.TooManyRequestsException: <p>Too many service requests were made over the given time period.</p>
        capo_cloud9.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        UpdateEnvironment

        >>> await client.update_environment(environment_id='8d9967e2f0624182b74e7690ad69ebEX', name='my-changed-demo-environment', description='This is my changed demonstration environment.')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloud9.types.update_environment_request.UpdateEnvironmentRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloud9.types.update_environment_result.UpdateEnvironmentResult"
    ]:
        import capo_cloud9._operations.aws_cloud9_workspace_management_service.update_environment

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

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

        return capo_cloud9.types.update_environment_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateEnvironment", redact_input=_redact_input),
    )
    input_: capo_cloud9.types.update_environment_request.UpdateEnvironmentRequest = {
        "environment_id": environment_id
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if managed_credentials_action is not None:
        input_["managed_credentials_action"] = managed_credentials_action

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