Skip to content

update_brand_profile_attribute

update_brand_profile_attribute(
    brand_profile_id: BrandProfileIdOrArn,
    attribute_name: BrandProfileAttributeName,
    *,
    config_overrides: Optional[EndUserMessagingClientConfig] = None,
    attribute_value: Optional[BrandProfileAttributeValue] = None,
    attachment_body: Optional[bytes] = None,
    description: Optional[BrandProfileAttributeDescription] = None,
    category: Optional[BrandProfileAttributeCategory] = None,
) -> UpdateBrandProfileAttributeOutput

Updates the value, description, or category of an existing brand profile attribute.

Parameters:

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.

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

Update a brand profile attribute value

>>> client.update_brand_profile_attribute(brand_profile_id='bp-abc12345678901234', attribute_name='SupportEmail', attribute_value='[email protected]', category='CONTACT')
Source code in docs_src/capo_endusermessaging/_services/end_user_messaging.py
def update_brand_profile_attribute(
    self,
    brand_profile_id: "capo_endusermessaging.types.brand_profile_id_or_arn.BrandProfileIdOrArn",
    attribute_name: "capo_endusermessaging.types.brand_profile_attribute_name.BrandProfileAttributeName",
    *,
    config_overrides: Optional[EndUserMessagingClientConfig] = None,
    attribute_value: Optional[
        "capo_endusermessaging.types.brand_profile_attribute_value.BrandProfileAttributeValue"
    ] = None,
    attachment_body: Optional[bytes] = None,
    description: Optional[
        "capo_endusermessaging.types.brand_profile_attribute_description.BrandProfileAttributeDescription"
    ] = None,
    category: Optional[
        "capo_endusermessaging.types.brand_profile_attribute_category.BrandProfileAttributeCategory"
    ] = None,
) -> "capo_endusermessaging.types.update_brand_profile_attribute_output.UpdateBrandProfileAttributeOutput":
    """<p>Updates the value, description, or category of an existing brand profile attribute.</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>
        attribute_name: <p>The name of the brand profile attribute. The name is unique within a brand profile.</p>
        attribute_value: <p>The text value of the attribute. This value applies to attributes of type TEXT.</p>
        attachment_body: <p>The binary content for an attribute of type IMAGE or DOCUMENT. The content is base64-encoded when it is sent over the wire.</p>
        description: <p>A description of the attribute.</p>
        category: <p>The category of the attribute.</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.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:
        Update a brand profile attribute value

        >>> client.update_brand_profile_attribute(brand_profile_id='bp-abc12345678901234', attribute_name='SupportEmail', attribute_value='[email protected]', category='CONTACT')
    """

    def _handler(
        req: "OperationRequest[capo_endusermessaging.types.update_brand_profile_attribute_input.UpdateBrandProfileAttributeInput]",
    ) -> OperationResponse[
        "capo_endusermessaging.types.update_brand_profile_attribute_output.UpdateBrandProfileAttributeOutput"
    ]:
        import capo_endusermessaging._operations.end_user_messaging.update_brand_profile_attribute

        output, http_response = (
            capo_endusermessaging._operations.end_user_messaging.update_brand_profile_attribute.update_brand_profile_attribute(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

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

        return capo_endusermessaging.types.update_brand_profile_attribute_input.redact_sensitive(
            input_
        )

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

        return capo_endusermessaging.types.update_brand_profile_attribute_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateBrandProfileAttribute",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_endusermessaging.types.update_brand_profile_attribute_input.UpdateBrandProfileAttributeInput = {
        "brand_profile_id": brand_profile_id,
        "attribute_name": attribute_name,
    }
    if attribute_value is not None:
        input_["attribute_value"] = attribute_value
    if attachment_body is not None:
        input_["attachment_body"] = attachment_body
    if description is not None:
        input_["description"] = description
    if category is not None:
        input_["category"] = category

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output