Skip to content

associate_whats_app_business_account

associate_whats_app_business_account(
    *,
    config_overrides: Optional[SocialMessagingClientConfig] = None,
    signup_callback: Optional[WhatsAppSignupCallback] = None,
    setup_finalization: Optional[WhatsAppSetupFinalization] = None,
) -> AssociateWhatsAppBusinessAccountOutput

This is only used through the Amazon Web Services console during sign-up to associate your WhatsApp Business Account to your Amazon Web Services account.

Parameters:

Raises:

Source code in docs_src/capo_socialmessaging/_services/social_messaging.py
def associate_whats_app_business_account(
    self,
    *,
    config_overrides: Optional[SocialMessagingClientConfig] = None,
    signup_callback: Optional[
        "capo_socialmessaging.types.whats_app_signup_callback.WhatsAppSignupCallback"
    ] = None,
    setup_finalization: Optional[
        "capo_socialmessaging.types.whats_app_setup_finalization.WhatsAppSetupFinalization"
    ] = None,
) -> "capo_socialmessaging.types.associate_whats_app_business_account_output.AssociateWhatsAppBusinessAccountOutput":
    """<p>This is only used through the Amazon Web Services console during sign-up to associate your WhatsApp Business Account to your Amazon Web Services account.</p>

    Args:
        signup_callback: <p>Contains the callback access token.</p>
        setup_finalization: <p>A JSON object that contains the phone numbers and WhatsApp Business Account to link to your account.</p>

    Raises:
        capo_socialmessaging.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_socialmessaging.errors.validation_exception.ValidationException: <p>The request contains an invalid parameter value. </p>
        capo_socialmessaging.errors.dependency_exception.DependencyException: <p>Thrown when performing an action because a dependency would be broken.</p>
        capo_socialmessaging.errors.invalid_parameters_exception.InvalidParametersException: <p>One or more parameters provided to the action are not valid.</p>
        capo_socialmessaging.errors.limit_exceeded_exception.LimitExceededException: <p>The request was denied because it would exceed one or more service quotas or limits.</p>
        capo_socialmessaging.errors.throttled_request_exception.ThrottledRequestException: <p>The request was denied due to request throttling.</p>
        capo_socialmessaging.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_socialmessaging.types.associate_whats_app_business_account_input.AssociateWhatsAppBusinessAccountInput]",
    ) -> OperationResponse[
        "capo_socialmessaging.types.associate_whats_app_business_account_output.AssociateWhatsAppBusinessAccountOutput"
    ]:
        import capo_socialmessaging._operations.social_messaging.associate_whats_app_business_account

        output, http_response = (
            capo_socialmessaging._operations.social_messaging.associate_whats_app_business_account.associate_whats_app_business_account(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_socialmessaging.types.associate_whats_app_business_account_input.AssociateWhatsAppBusinessAccountInput",
    ) -> dict[str, Any]:
        import capo_socialmessaging.types.associate_whats_app_business_account_input

        return capo_socialmessaging.types.associate_whats_app_business_account_input.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_socialmessaging.types.associate_whats_app_business_account_output.AssociateWhatsAppBusinessAccountOutput",
    ) -> dict[str, Any]:
        import capo_socialmessaging.types.associate_whats_app_business_account_output

        return capo_socialmessaging.types.associate_whats_app_business_account_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "AssociateWhatsAppBusinessAccount",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_socialmessaging.types.associate_whats_app_business_account_input.AssociateWhatsAppBusinessAccountInput = {}
    if signup_callback is not None:
        input_["signup_callback"] = signup_callback
    if setup_finalization is not None:
        input_["setup_finalization"] = setup_finalization

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