Skip to content

create_brand_profile async

create_brand_profile(
    brand_profile_name: BrandProfileName,
    *,
    config_overrides: Optional[AsyncEndUserMessagingClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    deletion_protection_enabled: Optional[bool] = None,
    tags: Optional[TagList] = None,
) -> CreateBrandProfileOutput

Creates a brand profile. A brand profile is a lightweight container that holds your brand identity information as flexible attributes. After you create a brand profile, use the CreateBrandProfileAttributes operation to add company information, addresses, compliance documents, and logos.

Parameters:

  • brand_profile_name (BrandProfileName) –

    The name of the brand profile. The name can contain alphanumeric characters, underscores, hyphens, and spaces.

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

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you do not specify a client token, the AWS SDK automatically generates one.

  • deletion_protection_enabled (Optional[bool], default: None ) –

    Specifies whether deletion protection is enabled. When enabled, the resource cannot be deleted until deletion protection is turned off.

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

    An array of key and value pair tags that are associated with the resource.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • ConflictException –

    The request conflicts with the current state of the resource.

  • InternalServerException –

    An unexpected error occurred during the processing of the request.

  • ServiceQuotaExceededException –

    The request would exceed a service quota for your account.

  • ThrottlingException –

    The request was denied because it exceeded the allowed request rate.

  • ValidationException –

    A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

Create a brand profile

>>> await client.create_brand_profile(brand_profile_name='AcmeCorp', deletion_protection_enabled=True)
Source code in docs_src/capo_endusermessaging/_services/async_end_user_messaging.py
async def create_brand_profile(
    self,
    brand_profile_name: "capo_endusermessaging.types.brand_profile_name.BrandProfileName",
    *,
    config_overrides: Optional[AsyncEndUserMessagingClientConfig] = None,
    client_token: Optional[
        "capo_endusermessaging.types.client_token.ClientToken"
    ] = None,
    deletion_protection_enabled: Optional[bool] = None,
    tags: Optional["capo_endusermessaging.types.tag_list.TagList"] = None,
) -> "capo_endusermessaging.types.create_brand_profile_output.CreateBrandProfileOutput":
    """<p>Creates a brand profile. A brand profile is a lightweight container that holds your brand identity information as flexible attributes. After you create a brand profile, use the CreateBrandProfileAttributes operation to add company information, addresses, compliance documents, and logos.</p>

    Args:
        brand_profile_name: <p>The name of the brand profile. The name can contain alphanumeric characters, underscores, hyphens, and spaces.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you do not specify a client token, the AWS SDK automatically generates one.</p>
        deletion_protection_enabled: <p>Specifies whether deletion protection is enabled. When enabled, the resource cannot be deleted until deletion protection is turned off.</p>
        tags: <p>An array of key and value pair tags that are associated with the resource.</p>

    Raises:
        capo_endusermessaging.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_endusermessaging.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource.</p>
        capo_endusermessaging.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred during the processing of the request.</p>
        capo_endusermessaging.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would exceed a service quota for your account.</p>
        capo_endusermessaging.errors.throttling_exception.ThrottlingException: <p>The request was denied because it exceeded the allowed request rate.</p>
        capo_endusermessaging.errors.validation_exception.ValidationException: A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
        capo_endusermessaging.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Create a brand profile

        >>> await client.create_brand_profile(brand_profile_name='AcmeCorp', deletion_protection_enabled=True)
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_endusermessaging.types.create_brand_profile_input.CreateBrandProfileInput]",
    ) -> AsyncOperationResponse[
        "capo_endusermessaging.types.create_brand_profile_output.CreateBrandProfileOutput"
    ]:
        import capo_endusermessaging._operations.end_user_messaging.create_brand_profile

        (
            output,
            http_response,
        ) = await capo_endusermessaging._operations.end_user_messaging.create_brand_profile.async_create_brand_profile(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_endusermessaging.types.create_brand_profile_input.CreateBrandProfileInput",
    ) -> dict[str, Any]:
        import capo_endusermessaging.types.create_brand_profile_input

        return (
            capo_endusermessaging.types.create_brand_profile_input.redact_sensitive(
                input_
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateBrandProfile", redact_input=_redact_input),
    )
    input_: capo_endusermessaging.types.create_brand_profile_input.CreateBrandProfileInput = {
        "brand_profile_name": brand_profile_name
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if deletion_protection_enabled is not None:
        input_["deletion_protection_enabled"] = deletion_protection_enabled
    if tags is not None:
        input_["tags"] = tags

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