Skip to content

create_browser_settings async

create_browser_settings(
    *,
    config_overrides: Optional[AsyncWorkSpacesWebClientConfig] = None,
    tags: Optional[TagList] = None,
    customer_managed_key: Optional[keyArn] = None,
    additional_encryption_context: Optional[EncryptionContextMap] = None,
    browser_policy: Optional[BrowserPolicy] = None,
    client_token: Optional[ClientToken] = None,
    web_content_filtering_policy: Optional[WebContentFilteringPolicy] = None,
) -> CreateBrowserSettingsResponse

Creates a browser settings resource that can be associated with a web portal. Once associated with a web portal, browser settings control how the browser will behave once a user starts a streaming session for the web portal.

Parameters:

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

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

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

    The custom managed key of the browser settings.

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

    Additional encryption context of the browser settings.

  • browser_policy (Optional[BrowserPolicy], default: None ) –

    A JSON string containing Chrome Enterprise policies that will be applied to all streaming 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.

  • web_content_filtering_policy (Optional[WebContentFilteringPolicy], default: None ) –

    The policy that specifies which URLs end users are allowed to access or which URLs or domain categories they are restricted from accessing for enhanced security.

Raises:

Source code in docs_src/capo_workspaces_web/_services/async_work_spaces_web.py
async def create_browser_settings(
    self,
    *,
    config_overrides: Optional[AsyncWorkSpacesWebClientConfig] = 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,
    browser_policy: Optional[
        "capo_workspaces_web.types.browser_policy.BrowserPolicy"
    ] = None,
    client_token: Optional[
        "capo_workspaces_web.types.client_token.ClientToken"
    ] = None,
    web_content_filtering_policy: Optional[
        "capo_workspaces_web.types.web_content_filtering_policy.WebContentFilteringPolicy"
    ] = None,
) -> "capo_workspaces_web.types.create_browser_settings_response.CreateBrowserSettingsResponse":
    """<p>Creates a browser settings resource that can be associated with a web portal. Once associated with a web portal, browser settings control how the browser will behave once a user starts a streaming session for the web portal. </p>

    Args:
        tags: <p>The tags to add to the browser settings resource. A tag is a key-value pair.</p>
        customer_managed_key: <p>The custom managed key of the browser settings.</p>
        additional_encryption_context: <p>Additional encryption context of the browser settings.</p>
        browser_policy: <p>A JSON string containing Chrome Enterprise policies that will be applied to all streaming 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>
        web_content_filtering_policy: <p>The policy that specifies which URLs end users are allowed to access or which URLs or domain categories they are restricted from accessing for enhanced security.</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_browser_settings_request.CreateBrowserSettingsRequest]",
    ) -> AsyncOperationResponse[
        "capo_workspaces_web.types.create_browser_settings_response.CreateBrowserSettingsResponse"
    ]:
        import capo_workspaces_web._operations.aws_ermine_control_plane_service.create_browser_settings

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

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

        return capo_workspaces_web.types.create_browser_settings_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateBrowserSettings", redact_input=_redact_input),
    )
    input_: capo_workspaces_web.types.create_browser_settings_request.CreateBrowserSettingsRequest = {}
    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 browser_policy is not None:
        input_["browser_policy"] = browser_policy
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if web_content_filtering_policy is not None:
        input_["web_content_filtering_policy"] = web_content_filtering_policy

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