Skip to content

update_phone_number_metadata

update_phone_number_metadata(
    phone_number_id: PhoneNumberId,
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    phone_number_description: Optional[PhoneNumberDescription] = None,
    client_token: Optional[ClientToken] = None,
) -> None

Updates a phone number’s metadata.

To verify the status of a previous UpdatePhoneNumberMetadata operation, call the DescribePhoneNumber API.

Parameters:

  • phone_number_id (PhoneNumberId) –

    The Amazon Resource Name (ARN) or resource ID of the phone number.

  • phone_number_description (Optional[PhoneNumberDescription], default: None ) –

    The description of the phone number.

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

Raises:

Source code in docs_src/capo_connect/_services/connect.py
def update_phone_number_metadata(
    self,
    phone_number_id: "capo_connect.types.phone_number_id.PhoneNumberId",
    *,
    config_overrides: Optional[ConnectClientConfig] = None,
    phone_number_description: Optional[
        "capo_connect.types.phone_number_description.PhoneNumberDescription"
    ] = None,
    client_token: Optional["capo_connect.types.client_token.ClientToken"] = None,
) -> None:
    """<p>Updates a phone number’s metadata.</p> <important> <p>To verify the status of a previous UpdatePhoneNumberMetadata operation, call the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribePhoneNumber.html">DescribePhoneNumber</a> API.</p> </important>

    Args:
        phone_number_id: <p>The Amazon Resource Name (ARN) or resource ID of the phone number.</p>
        phone_number_description: <p>The description of the phone number.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>

    Raises:
        capo_connect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_connect.errors.idempotency_exception.IdempotencyException: <p>An entity with the same name already exists.</p>
        capo_connect.errors.internal_service_exception.InternalServiceException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_connect.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more of the specified parameters are not valid.</p>
        capo_connect.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_connect.errors.resource_in_use_exception.ResourceInUseException: <p>That resource is already in use (for example, you're trying to add a record with the same name as an existing record). If you are trying to delete a resource (for example, DeleteHoursOfOperation or DeletePredefinedAttribute), remove its reference from related resources and then try again.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connect.errors.throttling_exception.ThrottlingException: <p>The throttling limit has been exceeded.</p>
        capo_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_connect.types.update_phone_number_metadata_request.UpdatePhoneNumberMetadataRequest]",
    ) -> OperationResponse[None]:
        import capo_connect._operations.amazon_connect_service.update_phone_number_metadata

        output, http_response = (
            capo_connect._operations.amazon_connect_service.update_phone_number_metadata.update_phone_number_metadata(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdatePhoneNumberMetadata")
    )
    input_: capo_connect.types.update_phone_number_metadata_request.UpdatePhoneNumberMetadataRequest = {
        "phone_number_id": phone_number_id
    }
    if phone_number_description is not None:
        input_["phone_number_description"] = phone_number_description
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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