Skip to content

update_linked_whats_app_business_account_phone_number async

update_linked_whats_app_business_account_phone_number(
    id: WhatsAppPhoneNumberId,
    call_settings: WhatsAppCallSettings,
    *,
    config_overrides: Optional[AsyncSocialMessagingClientConfig] = None,
) -> UpdateLinkedWhatsAppBusinessAccountPhoneNumberOutput

Updates the calling settings for a linked WhatsApp business phone number, such as whether calling is enabled and the hours during which the business accepts calls.

Parameters:

  • id (WhatsAppPhoneNumberId) –

    The unique identifier of the phone number to update. The phone number identifiers are formatted as phone-number-id-01234567890123456789012345678901.

  • call_settings (WhatsAppCallSettings) –

    The calling settings to apply to the phone number.

Raises:

Source code in docs_src/capo_socialmessaging/_services/async_social_messaging.py
async def update_linked_whats_app_business_account_phone_number(
    self,
    id: "capo_socialmessaging.types.whats_app_phone_number_id.WhatsAppPhoneNumberId",
    call_settings: "capo_socialmessaging.types.whats_app_call_settings.WhatsAppCallSettings",
    *,
    config_overrides: Optional[AsyncSocialMessagingClientConfig] = None,
) -> "capo_socialmessaging.types.update_linked_whats_app_business_account_phone_number_output.UpdateLinkedWhatsAppBusinessAccountPhoneNumberOutput":
    """<p>Updates the calling settings for a linked WhatsApp business phone number, such as whether calling is enabled and the hours during which the business accepts calls.</p>

    Args:
        id: <p>The unique identifier of the phone number to update. The phone number identifiers are formatted as <code>phone-number-id-01234567890123456789012345678901</code>.</p>
        call_settings: <p>The calling settings to apply to the phone number.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_socialmessaging.types.update_linked_whats_app_business_account_phone_number_input.UpdateLinkedWhatsAppBusinessAccountPhoneNumberInput]",
    ) -> AsyncOperationResponse[
        "capo_socialmessaging.types.update_linked_whats_app_business_account_phone_number_output.UpdateLinkedWhatsAppBusinessAccountPhoneNumberOutput"
    ]:
        import capo_socialmessaging._operations.social_messaging.update_linked_whats_app_business_account_phone_number

        (
            output,
            http_response,
        ) = await capo_socialmessaging._operations.social_messaging.update_linked_whats_app_business_account_phone_number.async_update_linked_whats_app_business_account_phone_number(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateLinkedWhatsAppBusinessAccountPhoneNumber"),
    )
    input_: capo_socialmessaging.types.update_linked_whats_app_business_account_phone_number_input.UpdateLinkedWhatsAppBusinessAccountPhoneNumberInput = {
        "id": id,
        "call_settings": call_settings,
    }

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