Skip to content

create_data_protection_settings async

create_data_protection_settings(
    *,
    config_overrides: Optional[AsyncWorkSpacesWebClientConfig] = None,
    display_name: Optional[DisplayNameSafe] = None,
    description: Optional[DescriptionSafe] = None,
    tags: Optional[TagList] = None,
    customer_managed_key: Optional[keyArn] = None,
    additional_encryption_context: Optional[EncryptionContextMap] = None,
    inline_redaction_configuration: Optional[InlineRedactionConfiguration] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateDataProtectionSettingsResponse

Creates a data protection settings resource that can be associated with a web portal.

Parameters:

  • display_name (Optional[DisplayNameSafe], default: None ) –

    The display name of the data protection settings.

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

    The description of the data protection settings.

  • tags (Optional[TagList], default: None ) –

    The tags to add to the data protection settings resource. A tag is a key-value pair.

  • customer_managed_key (Optional[keyArn], default: None ) –

    The custom managed key of the data protection settings.

  • additional_encryption_context (Optional[EncryptionContextMap], default: None ) –

    Additional encryption context of the data protection settings.

  • inline_redaction_configuration (Optional[InlineRedactionConfiguration], default: None ) –

    The inline redaction configuration of the data protection settings that will be applied to all sessions.

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

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request.

    If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.

Raises:

Source code in docs_src/capo_workspaces_web/_services/async_work_spaces_web.py
async def create_data_protection_settings(
    self,
    *,
    config_overrides: Optional[AsyncWorkSpacesWebClientConfig] = None,
    display_name: Optional[
        "capo_workspaces_web.types.display_name_safe.DisplayNameSafe"
    ] = None,
    description: Optional[
        "capo_workspaces_web.types.description_safe.DescriptionSafe"
    ] = None,
    tags: Optional["capo_workspaces_web.types.tag_list.TagList"] = None,
    customer_managed_key: Optional[
        "capo_workspaces_web.types.key_arn.keyArn"
    ] = None,
    additional_encryption_context: Optional[
        "capo_workspaces_web.types.encryption_context_map.EncryptionContextMap"
    ] = None,
    inline_redaction_configuration: Optional[
        "capo_workspaces_web.types.inline_redaction_configuration.InlineRedactionConfiguration"
    ] = None,
    client_token: Optional[
        "capo_workspaces_web.types.client_token.ClientToken"
    ] = None,
) -> "capo_workspaces_web.types.create_data_protection_settings_response.CreateDataProtectionSettingsResponse":
    """<p>Creates a data protection settings resource that can be associated with a web portal.</p>

    Args:
        display_name: <p>The display name of the data protection settings.</p>
        description: <p>The description of the data protection settings.</p>
        tags: <p>The tags to add to the data protection settings resource. A tag is a key-value pair.</p>
        customer_managed_key: <p>The custom managed key of the data protection settings.</p>
        additional_encryption_context: <p>Additional encryption context of the data protection settings.</p>
        inline_redaction_configuration: <p>The inline redaction configuration of the data protection settings that will be applied to all sessions.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request. </p> <p>If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.</p>

    Raises:
        capo_workspaces_web.errors.access_denied_exception.AccessDeniedException: <p>Access is denied.</p>
        capo_workspaces_web.errors.conflict_exception.ConflictException: <p>There is a conflict.</p>
        capo_workspaces_web.errors.internal_server_exception.InternalServerException: <p>There is an internal server error.</p>
        capo_workspaces_web.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource cannot be found.</p>
        capo_workspaces_web.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota has been exceeded.</p>
        capo_workspaces_web.errors.throttling_exception.ThrottlingException: <p>There is a throttling error.</p>
        capo_workspaces_web.errors.validation_exception.ValidationException: <p>There is a validation error.</p>
        capo_workspaces_web.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_workspaces_web.types.create_data_protection_settings_request.CreateDataProtectionSettingsRequest]",
    ) -> AsyncOperationResponse[
        "capo_workspaces_web.types.create_data_protection_settings_response.CreateDataProtectionSettingsResponse"
    ]:
        import capo_workspaces_web._operations.aws_ermine_control_plane_service.create_data_protection_settings

        (
            output,
            http_response,
        ) = await capo_workspaces_web._operations.aws_ermine_control_plane_service.create_data_protection_settings.async_create_data_protection_settings(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_workspaces_web.types.create_data_protection_settings_request.CreateDataProtectionSettingsRequest",
    ) -> dict[str, Any]:
        import capo_workspaces_web.types.create_data_protection_settings_request

        return capo_workspaces_web.types.create_data_protection_settings_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateDataProtectionSettings", redact_input=_redact_input
        ),
    )
    input_: capo_workspaces_web.types.create_data_protection_settings_request.CreateDataProtectionSettingsRequest = {}
    if display_name is not None:
        input_["display_name"] = display_name
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags
    if customer_managed_key is not None:
        input_["customer_managed_key"] = customer_managed_key
    if additional_encryption_context is not None:
        input_["additional_encryption_context"] = additional_encryption_context
    if inline_redaction_configuration is not None:
        input_["inline_redaction_configuration"] = inline_redaction_configuration
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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