Skip to content

put_whats_app_business_public_key

put_whats_app_business_public_key(
    origination_phone_number_id: WhatsAppPhoneNumberId,
    *,
    config_overrides: Optional[SocialMessagingClientConfig] = None,
    business_public_key: Optional[BusinessPublicKeyPem] = None,
    kms_key_arn: Optional[KmsKeyArn] = None,
) -> PutWhatsAppBusinessPublicKeyOutput

Sets the business public key used to encrypt the data exchanged with the endpoint of a data exchange Flow.

Parameters:

  • origination_phone_number_id (WhatsAppPhoneNumberId) –

    The unique identifier of the phone number to associate with the business public key.

  • business_public_key (Optional[BusinessPublicKeyPem], default: None ) –

    The PEM-encoded 2048-bit RSA public key to set. Mutually exclusive with kmsKeyArn.

  • kms_key_arn (Optional[KmsKeyArn], default: None ) –

    The ARN of a customer managed asymmetric RSA key in Amazon Web Services KMS. Mutually exclusive with businessPublicKey.

Raises:

Source code in docs_src/capo_socialmessaging/_services/social_messaging.py
def put_whats_app_business_public_key(
    self,
    origination_phone_number_id: "capo_socialmessaging.types.whats_app_phone_number_id.WhatsAppPhoneNumberId",
    *,
    config_overrides: Optional[SocialMessagingClientConfig] = None,
    business_public_key: Optional[
        "capo_socialmessaging.types.business_public_key_pem.BusinessPublicKeyPem"
    ] = None,
    kms_key_arn: Optional[
        "capo_socialmessaging.types.kms_key_arn.KmsKeyArn"
    ] = None,
) -> "capo_socialmessaging.types.put_whats_app_business_public_key_output.PutWhatsAppBusinessPublicKeyOutput":
    """<p>Sets the business public key used to encrypt the data exchanged with the endpoint of a data exchange Flow.</p>

    Args:
        origination_phone_number_id: <p>The unique identifier of the phone number to associate with the business public key.</p>
        business_public_key: <p>The PEM-encoded 2048-bit RSA public key to set. Mutually exclusive with <code>kmsKeyArn</code>.</p>
        kms_key_arn: <p>The ARN of a customer managed asymmetric RSA key in Amazon Web Services KMS. Mutually exclusive with <code>businessPublicKey</code>.</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.access_denied_by_meta_exception.AccessDeniedByMetaException: <p>You do not have sufficient access to perform this action.</p>
        capo_socialmessaging.errors.dependency_exception.DependencyException: <p>Thrown when performing an action because a dependency would be broken.</p>
        capo_socialmessaging.errors.internal_service_exception.InternalServiceException: <p>The request processing has failed because of an unknown error, exception, or failure.</p>
        capo_socialmessaging.errors.invalid_parameters_exception.InvalidParametersException: <p>One or more parameters provided to the action are not valid.</p>
        capo_socialmessaging.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource was not found.</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.put_whats_app_business_public_key_input.PutWhatsAppBusinessPublicKeyInput]",
    ) -> OperationResponse[
        "capo_socialmessaging.types.put_whats_app_business_public_key_output.PutWhatsAppBusinessPublicKeyOutput"
    ]:
        import capo_socialmessaging._operations.social_messaging.put_whats_app_business_public_key

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutWhatsAppBusinessPublicKey")
    )
    input_: capo_socialmessaging.types.put_whats_app_business_public_key_input.PutWhatsAppBusinessPublicKeyInput = {
        "origination_phone_number_id": origination_phone_number_id
    }
    if business_public_key is not None:
        input_["business_public_key"] = business_public_key
    if kms_key_arn is not None:
        input_["kms_key_arn"] = kms_key_arn

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