Skip to content

create_brand_profile_attributes async

create_brand_profile_attributes(
    brand_profile_id: BrandProfileIdOrArn,
    attributes: BrandProfileAttributeInputList,
    *,
    config_overrides: Optional[AsyncEndUserMessagingClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateBrandProfileAttributesOutput

Creates up to 10 attributes for a brand profile in a single request. For attributes of type IMAGE or DOCUMENT, the response includes a presigned Amazon S3 URL that you use to upload the media. This operation is atomic: either all of the attributes are created, or none of them are.

Parameters:

  • brand_profile_id (BrandProfileIdOrArn) –

    The unique identifier of the brand profile. You can specify either the bare ID or the full Amazon Resource Name (ARN).

  • attributes (BrandProfileAttributeInputList) –

    The brand profile attributes.

  • 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.

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.

  • ResourceNotFoundException –

    The request references a resource that does not exist. Verify that the resource identifier is correct and try your request again.

  • 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 text attribute on a brand profile

>>> await client.create_brand_profile_attributes(brand_profile_id='bp-abc12345678901234', attributes=[{'attributeName': 'SupportEmail', 'attributeType': 'TEXT', 'attributeValue': '[email protected]', 'category': 'CONTACT'}])
Source code in docs_src/capo_endusermessaging/_services/async_end_user_messaging.py
async def create_brand_profile_attributes(
    self,
    brand_profile_id: "capo_endusermessaging.types.brand_profile_id_or_arn.BrandProfileIdOrArn",
    attributes: "capo_endusermessaging.types.brand_profile_attribute_input_list.BrandProfileAttributeInputList",
    *,
    config_overrides: Optional[AsyncEndUserMessagingClientConfig] = None,
    client_token: Optional[
        "capo_endusermessaging.types.client_token.ClientToken"
    ] = None,
) -> "capo_endusermessaging.types.create_brand_profile_attributes_output.CreateBrandProfileAttributesOutput":
    """<p>Creates up to 10 attributes for a brand profile in a single request. For attributes of type IMAGE or DOCUMENT, the response includes a presigned Amazon S3 URL that you use to upload the media. This operation is atomic: either all of the attributes are created, or none of them are.</p>

    Args:
        brand_profile_id: <p>The unique identifier of the brand profile. You can specify either the bare ID or the full Amazon Resource Name (ARN).</p>
        attributes: <p>The brand profile attributes.</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>

    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.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource that does not exist. Verify that the resource identifier is correct and try your request again.</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 text attribute on a brand profile

        >>> await client.create_brand_profile_attributes(brand_profile_id='bp-abc12345678901234', attributes=[{'attributeName': 'SupportEmail', 'attributeType': 'TEXT', 'attributeValue': '[email protected]', 'category': 'CONTACT'}])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_endusermessaging.types.create_brand_profile_attributes_input.CreateBrandProfileAttributesInput]",
    ) -> AsyncOperationResponse[
        "capo_endusermessaging.types.create_brand_profile_attributes_output.CreateBrandProfileAttributesOutput"
    ]:
        import capo_endusermessaging._operations.end_user_messaging.create_brand_profile_attributes

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

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

        return capo_endusermessaging.types.create_brand_profile_attributes_input.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_endusermessaging.types.create_brand_profile_attributes_output.CreateBrandProfileAttributesOutput",
    ) -> dict[str, Any]:
        import capo_endusermessaging.types.create_brand_profile_attributes_output

        return capo_endusermessaging.types.create_brand_profile_attributes_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateBrandProfileAttributes",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_endusermessaging.types.create_brand_profile_attributes_input.CreateBrandProfileAttributesInput = {
        "brand_profile_id": brand_profile_id,
        "attributes": attributes,
    }
    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