From a2e811dc9a6d01ece83b3f9906d121bfb198d9db Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Wed, 10 Feb 2021 12:55:55 -0600 Subject: [PATCH 01/32] Added new pnm redesign code --- .../README.md | 192 --- .../communication/phonenumbers/__init__.py | 87 +- .../phonenumbers/_generated/__init__.py | 4 +- .../phonenumbers/_generated/_configuration.py | 12 +- ...on_service.py => _phone_numbers_client.py} | 22 +- .../phonenumbers/_generated/aio/__init__.py | 4 +- .../_generated/aio/_configuration.py | 12 +- ...on_service.py => _phone_numbers_client.py} | 22 +- .../_generated/aio/operations/__init__.py | 4 +- ..._phone_number_administration_operations.py | 1398 ---------------- .../operations/_phone_numbers_operations.py | 926 +++++++++++ .../_generated/models/__init__.py | 159 +- .../phonenumbers/_generated/models/_models.py | 1111 ++++--------- .../_generated/models/_models_py3.py | 1257 ++++----------- ...one_number_administration_service_enums.py | 148 -- .../models/_phone_numbers_client_enums.py | 75 + .../_generated/operations/__init__.py | 4 +- ..._phone_number_administration_operations.py | 1421 ----------------- .../operations/_phone_numbers_operations.py | 944 +++++++++++ .../phonenumbers/_generated/py.typed | 1 - .../_phone_number_administration_client.py | 598 ------- .../phonenumbers/_phone_numbers_client.py | 250 +++ .../communication/phonenumbers/_polling.py | 92 -- .../phonenumbers/_shared/models.py | 46 +- .../phonenumbers/_shared/utils.py | 2 - .../communication/phonenumbers/_version.py | 2 +- .../phonenumbers/aio/__init__.py | 10 +- ...hone_number_administration_client_async.py | 620 ------- .../aio/_phone_numbers_client_async.py | 250 +++ .../phonenumbers/aio/_polling_async.py | 92 -- .../samples/phone_number_area_codes_sample.py | 45 - .../phone_number_area_codes_sample_async.py | 50 - .../phone_number_capabilities_sample.py | 71 - .../phone_number_capabilities_sample_async.py | 82 - .../phone_number_configuration_sample.py | 58 - ...phone_number_configuration_sample_async.py | 63 - .../samples/phone_number_orders_sample.py | 110 -- .../phone_number_orders_sample_async.py | 132 -- .../samples/phone_number_plans_sample.py | 72 - .../phone_number_plans_sample_async.py | 81 - ...phone_number_supported_countries_sample.py | 39 - ...number_supported_countries_sample_async.py | 43 - .../setup.cfg | 2 +- .../swagger/PHONE_NUMBER_SWAGGER.md | 2 +- .../swagger/examples/CreateReleaseAsync.json | 16 - .../examples/CreateSearchOrderAsync.json | 28 - .../GetAcquiredTelephoneNumbersAsync.json | 39 - .../swagger/examples/GetAreaCodesAsync.json | 22 - .../swagger/examples/GetCountriesAsync.json | 28 - .../examples/GetNumberConfigurationAsync.json | 17 - .../swagger/examples/GetOrdersAsync.json | 13 - .../swagger/examples/GetPlansAsync.json | 145 -- .../swagger/examples/GetReleaseByIdAsync.json | 14 - .../swagger/examples/GetSearchOrderAsync.json | 28 - .../RemoveNumberConfigurationAsync.json | 9 - .../UpdateNumberCapabilitiesAsync.json | 31 - .../UpdateNumberConfigurationAsync.json | 15 - .../examples/UpdateSearchOrderAsync.json | 12 - .../test/_shared/__init__.py | 6 - .../test/_shared/asynctestcase.py | 27 - .../_shared/communication_service_preparer.py | 89 -- .../test/_shared/fake_token_credential.py | 13 - .../test/_shared/helper.py | 19 - .../test/_shared/testcase.py | 16 +- .../test/_shared/{utils.py => utills.py} | 0 .../test/phone_number_helper.py | 2 +- .../test/phone_number_testcase.py | 20 - .../test/phone_number_testcase_async.py | 13 - ...ration_client.test_cancel_reservation.yaml | 36 - ...stration_client.test_configure_number.yaml | 39 - ...inistration_client.test_create_search.yaml | 186 --- ...ration_client.test_get_all_area_codes.yaml | 40 - ...n_client.test_get_capabilities_update.yaml | 36 - ..._client.test_get_number_configuration.yaml | 40 - ...tration_client.test_get_phone_number.yaml} | 17 +- ....test_get_phone_plan_location_options.yaml | 250 --- ...tration_client.test_get_release_by_id.yaml | 37 - ...ion_client.test_get_reservation_by_id.yaml | 39 - ...ient.test_list_acquired_phone_numbers.yaml | 92 ++ ...on_client.test_list_all_phone_numbers.yaml | 35 - ...tration_client.test_list_all_releases.yaml | 35 - ...ent.test_list_all_supported_countries.yaml | 36 - ...on_client.test_list_phone_plan_groups.yaml | 35 - ...stration_client.test_list_phone_plans.yaml | 35 - ...on_client.test_purchase_phone_numbers.yaml | 274 ++++ ...tion_client.test_purchase_reservation.yaml | 73 - ...tion_client.test_release_phone_number.yaml | 38 + ...ion_client.test_release_phone_numbers.yaml | 143 -- ...ion_client.test_reserve_phone_numbers.yaml | 150 -- ...t.test_search_available_phone_numbers.yaml | 121 ++ ...ation_client.test_update_capabilities.yaml | 40 - ...ation_client.test_update_phone_number.yaml | 40 + ...test_update_phone_number_capabilities.yaml | 40 + ..._client_async.test_cancel_reservation.yaml | 25 - ...on_client_async.test_configure_number.yaml | 30 - ..._client_async.test_get_all_area_codes.yaml | 32 - ...nt_async.test_get_capabilities_update.yaml | 28 - ...t_async.test_get_number_configuration.yaml | 32 - ....test_get_phone_plan_location_options.yaml | 242 --- ...n_client_async.test_get_release_by_id.yaml | 29 - ...ient_async.test_get_reservation_by_id.yaml | 31 - ...ent_async.test_list_all_phone_numbers.yaml | 27 - ...l_phone_numbers_from_managed_identity.yaml | 25 - ...n_client_async.test_list_all_releases.yaml | 27 - ...ync.test_list_all_supported_countries.yaml | 28 - ...ent_async.test_list_phone_plan_groups.yaml | 27 - ...on_client_async.test_list_phone_plans.yaml | 27 - ...lient_async.test_purchase_reservation.yaml | 54 - ...ient_async.test_release_phone_numbers.yaml | 111 -- ...ient_async.test_reserve_phone_numbers.yaml | 146 -- ...client_async.test_update_capabilities.yaml | 32 - ...test_phone_number_administration_client.py | 341 +--- ...hone_number_administration_client_async.py | 364 ----- 113 files changed, 3879 insertions(+), 10923 deletions(-) rename sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/{_phone_number_administration_service.py => _phone_numbers_client.py} (65%) rename sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/{_phone_number_administration_service.py => _phone_numbers_client.py} (62%) delete mode 100644 sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_number_administration_operations.py create mode 100644 sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_phone_number_administration_service_enums.py create mode 100644 sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_phone_numbers_client_enums.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_number_administration_operations.py create mode 100644 sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/py.typed delete mode 100644 sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_number_administration_client.py create mode 100644 sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_polling.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_number_administration_client_async.py create mode 100644 sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_polling_async.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/samples/phone_number_area_codes_sample.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/samples/phone_number_area_codes_sample_async.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/samples/phone_number_capabilities_sample.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/samples/phone_number_capabilities_sample_async.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/samples/phone_number_configuration_sample.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/samples/phone_number_configuration_sample_async.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/samples/phone_number_orders_sample.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/samples/phone_number_orders_sample_async.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/samples/phone_number_plans_sample.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/samples/phone_number_plans_sample_async.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/samples/phone_number_supported_countries_sample.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/samples/phone_number_supported_countries_sample_async.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/swagger/examples/CreateReleaseAsync.json delete mode 100644 sdk/communication/azure-communication-phonenumbers/swagger/examples/CreateSearchOrderAsync.json delete mode 100644 sdk/communication/azure-communication-phonenumbers/swagger/examples/GetAcquiredTelephoneNumbersAsync.json delete mode 100644 sdk/communication/azure-communication-phonenumbers/swagger/examples/GetAreaCodesAsync.json delete mode 100644 sdk/communication/azure-communication-phonenumbers/swagger/examples/GetCountriesAsync.json delete mode 100644 sdk/communication/azure-communication-phonenumbers/swagger/examples/GetNumberConfigurationAsync.json delete mode 100644 sdk/communication/azure-communication-phonenumbers/swagger/examples/GetOrdersAsync.json delete mode 100644 sdk/communication/azure-communication-phonenumbers/swagger/examples/GetPlansAsync.json delete mode 100644 sdk/communication/azure-communication-phonenumbers/swagger/examples/GetReleaseByIdAsync.json delete mode 100644 sdk/communication/azure-communication-phonenumbers/swagger/examples/GetSearchOrderAsync.json delete mode 100644 sdk/communication/azure-communication-phonenumbers/swagger/examples/RemoveNumberConfigurationAsync.json delete mode 100644 sdk/communication/azure-communication-phonenumbers/swagger/examples/UpdateNumberCapabilitiesAsync.json delete mode 100644 sdk/communication/azure-communication-phonenumbers/swagger/examples/UpdateNumberConfigurationAsync.json delete mode 100644 sdk/communication/azure-communication-phonenumbers/swagger/examples/UpdateSearchOrderAsync.json delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/_shared/__init__.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/_shared/asynctestcase.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/_shared/communication_service_preparer.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/_shared/fake_token_credential.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/_shared/helper.py rename sdk/communication/azure-communication-phonenumbers/test/_shared/{utils.py => utills.py} (100%) delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/phone_number_testcase.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/phone_number_testcase_async.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_cancel_reservation.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_configure_number.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_create_search.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_all_area_codes.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_capabilities_update.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_number_configuration.yaml rename sdk/communication/azure-communication-phonenumbers/test/recordings/{test_phone_number_administration_client.test_list_all_phone_numbers_from_managed_identity.yaml => test_phone_number_administration_client.test_get_phone_number.yaml} (51%) delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_plan_location_options.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_release_by_id.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_reservation_by_id.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_phone_numbers.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_releases.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_supported_countries.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_phone_plan_groups.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_phone_plans.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_reservation.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_number.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_numbers.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_reserve_phone_numbers.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_capabilities.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_cancel_reservation.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_configure_number.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_all_area_codes.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_capabilities_update.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_number_configuration.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_plan_location_options.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_release_by_id.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_reservation_by_id.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers_from_managed_identity.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_releases.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_supported_countries.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_phone_plan_groups.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_phone_plans.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_reservation.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_numbers.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_reserve_phone_numbers.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_capabilities.yaml diff --git a/sdk/communication/azure-communication-phonenumbers/README.md b/sdk/communication/azure-communication-phonenumbers/README.md index b5b61a40139b..e69de29bb2d1 100644 --- a/sdk/communication/azure-communication-phonenumbers/README.md +++ b/sdk/communication/azure-communication-phonenumbers/README.md @@ -1,192 +0,0 @@ -[![Build Status](https://dev.azure.com/azure-sdk/public/_apis/build/status/azure-sdk-for-python.client?branchName=master)](https://dev.azure.com/azure-sdk/public/_build/latest?definitionId=46?branchName=master) - -# Azure Communication Phone Numbers Package client library for Python - -Azure Communication Phone Numbers client package is used to administer Phone Numbers. - -# Getting started -### Prerequisites -- Python 2.7, or 3.5 or later is required to use this package. -- You must have an [Azure subscription](https://azure.microsoft.com/free/) -- A deployed Communication Services resource. You can use the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up. -### Install the package -Install the Azure Communication Phone Numbers client library for Python with [pip](https://pypi.org/project/pip/): - -```bash -pip install azure-communication-phonenumbers -``` - -# Key concepts - -## CommunicationPhoneNumberClient -### Initializing Phone Numbers Client -```python -# You can find your endpoint and access token from your resource in the Azure Portal -import os -from azure.communication.phonenumbers import PhoneNumbersAdministrationClient -from azure.identity import DefaultAzureCredential - -endpoint = os.getenv('AZURE_COMMUNICATION_SERVICE_ENDPOINT') - -# To use Azure Active Directory Authentication (DefaultAzureCredential) make sure to have your -# AZURE_TENANT_ID, AZURE_CLIENT_ID and AZURE_CLIENT_SECRET as env variables. -phone_number_administration_client = PhoneNumbersAdministrationClient(endpoint, DefaultAzureCredential()) - -``` -### Initializing Phone Numbers Client Using Connection String -Connection string authentication is also available for Phone Numbers Client. - -```python -# You can find your endpoint and access token from your resource in the Azure Portal -import os -from azure.communication.phonenumbers import PhoneNumbersAdministrationClient - -connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) -``` - -### Phone plans overview - -Phone plans come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888. - -All geographic phone plans within the same country are grouped into a phone plan group with a Geographic phone number type. All Toll-Free phone plans within the same country are grouped into a phone plan group. - -### Reserving and Acquiring numbers - -Phone numbers can be reserved through the begin_reserve_phone_numbers API by providing a phone plan id, an area code and quantity of phone numbers. The provided quantity of phone numbers will be reserved for ten minutes. This reservation of phone numbers can either be cancelled or purchased. If the reservation is cancelled, then the phone numbers will become available to others. If the reservation is purchased, then the phone numbers are acquired for the Azure resources. - -### Configuring / Assigning numbers - -Phone numbers can be assigned to a callback URL via the configure number API. As part of the configuration, you will need an acquired phone number, callback URL and application id. - -# Examples -The following section provides several code snippets covering some of the most common Azure Communication Services tasks, including: - -## Communication Phone number -### Get Countries - -```python -phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - -supported_countries = phone_number_administration_client.list_all_supported_countries() -for supported_country in supported_countries: - print(supported_country) -``` - -### Get Phone Plan Groups - -Phone plan groups come in two types, Geographic and Toll-Free. - -```python -phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - -phone_plan_groups_response = phone_number_administration_client.list_phone_plan_groups( - country_code='' -) -for phone_plan_group in phone_plan_groups_response: - print(phone_plan_group) -``` - -### Get Phone Plans - -Unlike Toll-Free phone plans, area codes for Geographic Phone Plans are empty. Area codes are found in the Area Codes API. - -```python -phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - -phone_plans_response = phone_number_administration_client.list_phone_plans( - country_code='', - phone_plan_group_id='' -) -for phone_plan in phone_plans_response: - print(phone_plan) -``` - -### Get Location Options - -For Geographic phone plans, you can query the available geographic locations. The locations options are structured like the geographic hierarchy of a country. For example, the US has states and within each state are cities. - -```python -phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - -location_options_response = phone_number_administration_client.get_phone_plan_location_options( - country_code='', - phone_plan_group_id='', - phone_plan_id='' -) -print(location_options_response) -``` - -### Get Area Codes - -Fetching area codes for geographic phone plans will require the the location options queries set. You must include the chain of geographic locations traversing down the location options object returned by the GetLocationOptions API. - -```python -phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - -all_area_codes = phone_number_administration_client.get_all_area_codes( - location_type="NotRequired", - country_code='', - phone_plan_id='' -) -print(all_area_codes) -``` - -### Create Reservation - -```python -phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - -poller = phone_number_administration_client.begin_reserve_phone_numbers( - area_code='', - description="testreservation20200014", - display_name="testreservation20200014", - phone_plan_ids=[''], - quantity=1 -) -``` - -### Get Reservation By Id -```python -phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - -phone_number_reservation_response = phone_number_administration_client.get_reservation_by_id( - reservation_id='' -) -print(reservation_id) -``` - -### Purchase Reservation - -```python -phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - -poller = phone_number_administration_client.begin_purchase_reservation( - reservation_id='' -) -``` - -# Troubleshooting -The Phone Numbers Administration client will raise exceptions defined in [Azure Core][azure_core]. - -# Next steps -## More sample code - -Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/communication/azure-communication-phonenumbers/samples) directory for detailed examples of how to use this library. - -## Provide Feedback - -If you encounter any bugs or have suggestions, please file an issue in the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project - -# Contributing -This project welcomes contributions and suggestions. Most contributions require you to agree to a -Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. - -When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the -PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - - -[azure_core]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/README.md diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py index 6916913f8dcd..51832fded5b3 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py @@ -4,66 +4,47 @@ # license information. # -------------------------------------------------------------------------- -from ._phone_number_administration_client import PhoneNumbersAdministrationClient -from ._polling import ReservePhoneNumberPolling, PurchaseReservationPolling, ReleasePhoneNumberPolling +from ._phone_numbers_client import PhoneNumbersClient from ._generated.models import ( AcquiredPhoneNumber, AcquiredPhoneNumbers, - AreaCodes, - CreateSearchOptions, - CreateSearchResponse, - LocationOptionsQuery, - LocationOptionsResponse, - NumberConfigurationResponse, - NumberUpdateCapabilities, - PhoneNumberCountries, - PhoneNumberEntities, - PhoneNumberRelease, - PhoneNumberReservation, - PhonePlanGroups, - PhonePlansResponse, - PstnConfiguration, - ReleaseResponse, - UpdateNumberCapabilitiesResponse, - UpdatePhoneNumberCapabilitiesResponse -) - -from ._shared.models import ( - CommunicationUserIdentifier, - PhoneNumberIdentifier, - UnknownIdentifier + CommunicationError, + CommunicationErrorResponse, + PhoneNumberCapabilities, + PhoneNumberCapabilitiesRequest, + PhoneNumberCost, + PhoneNumberOperation, + PhoneNumberPurchaseRequest, + PhoneNumberSearchRequest, + PhoneNumberSearchResult, + PhoneNumberUpdateRequest, + BillingFrequency, + PhoneNumberAssignmentType, + PhoneNumberCapabilityValue, + PhoneNumberOperationStatus, + PhoneNumberOperationType, + PhoneNumberType, ) __all__ = [ - 'PhoneNumbersAdministrationClient', - 'ReservePhoneNumberPolling', - 'PurchaseReservationPolling', - 'ReleasePhoneNumberPolling', - - # from _phonenumber 'AcquiredPhoneNumber', 'AcquiredPhoneNumbers', - 'AreaCodes', - 'CreateSearchOptions', - 'CreateSearchResponse', - 'LocationOptionsQuery', - 'LocationOptionsResponse', - 'NumberConfigurationResponse', - 'NumberUpdateCapabilities', - 'PhoneNumberCountries', - 'PhoneNumberEntities', - 'PhoneNumberRelease', - 'PhoneNumberReservation', - 'PhonePlanGroups', - 'PhonePlansResponse', - 'PstnConfiguration', - 'ReleaseResponse', - 'UpdateNumberCapabilitiesResponse', - 'UpdatePhoneNumberCapabilitiesResponse', - - # from _shared - 'CommunicationUserIdentifier', - 'PhoneNumberIdentifier', - 'UnknownIdentifier' + 'CommunicationError', + 'CommunicationErrorResponse', + 'PhoneNumberCapabilities', + 'PhoneNumberCapabilitiesRequest', + 'PhoneNumberCost', + 'PhoneNumberOperation', + 'PhoneNumberPurchaseRequest', + 'PhoneNumberSearchRequest', + 'PhoneNumberSearchResult', + 'PhoneNumberUpdateRequest', + 'BillingFrequency', + 'PhoneNumberAssignmentType', + 'PhoneNumberCapabilityValue', + 'PhoneNumberOperationStatus', + 'PhoneNumberOperationType', + 'PhoneNumberType', + 'PhoneNumbersClient' ] diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/__init__.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/__init__.py index 13fcd7af35ce..abbd9c6a0b97 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/__init__.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._phone_number_administration_service import PhoneNumberAdministrationService -__all__ = ['PhoneNumberAdministrationService'] +from ._phone_numbers_client import PhoneNumbersClient +__all__ = ['PhoneNumbersClient'] try: from ._patch import patch_sdk # type: ignore diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/_configuration.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/_configuration.py index 2043f061b4f2..6905dc676488 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/_configuration.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/_configuration.py @@ -17,13 +17,13 @@ VERSION = "unknown" -class PhoneNumberAdministrationServiceConfiguration(Configuration): - """Configuration for PhoneNumberAdministrationService. +class PhoneNumbersClientConfiguration(Configuration): + """Configuration for PhoneNumbersClient. Note that all parameters used to create this instance are saved as instance attributes. - :param endpoint: The endpoint of the Azure Communication resource. + :param endpoint: The communication resource, for example https://resourcename.communication.azure.com. :type endpoint: str """ @@ -35,11 +35,11 @@ def __init__( # type: (...) -> None if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") - super(PhoneNumberAdministrationServiceConfiguration, self).__init__(**kwargs) + super(PhoneNumbersClientConfiguration, self).__init__(**kwargs) self.endpoint = endpoint - self.api_version = "2020-07-20-preview1" - kwargs.setdefault('sdk_moniker', 'phonenumberadministrationservice/{}'.format(VERSION)) + self.api_version = "2021-03-07" + kwargs.setdefault('sdk_moniker', 'phonenumbersclient/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/_phone_number_administration_service.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/_phone_numbers_client.py similarity index 65% rename from sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/_phone_number_administration_service.py rename to sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/_phone_numbers_client.py index 3afc61f3ec81..2795b08204be 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/_phone_number_administration_service.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/_phone_numbers_client.py @@ -15,18 +15,19 @@ # pylint: disable=unused-import,ungrouped-imports from typing import Any -from ._configuration import PhoneNumberAdministrationServiceConfiguration -from .operations import PhoneNumberAdministrationOperations +from ._configuration import PhoneNumbersClientConfiguration +from .operations import PhoneNumbersOperations from . import models -class PhoneNumberAdministrationService(object): - """Phone Number Administration Service. +class PhoneNumbersClient(object): + """The phone numbers client uses Azure Communication Services to acquire and manage phone numbers. - :ivar phone_number_administration: PhoneNumberAdministrationOperations operations - :vartype phone_number_administration: azure.communication.phonenumbers.operations.PhoneNumberAdministrationOperations - :param endpoint: The endpoint of the Azure Communication resource. + :ivar phone_numbers: PhoneNumbersOperations operations + :vartype phone_numbers: azure.communication.phonenumbers.operations.PhoneNumbersOperations + :param endpoint: The communication resource, for example https://resourcename.communication.azure.com. :type endpoint: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -36,15 +37,14 @@ def __init__( ): # type: (...) -> None base_url = '{endpoint}' - self._config = PhoneNumberAdministrationServiceConfiguration(endpoint, **kwargs) + self._config = PhoneNumbersClientConfiguration(endpoint, **kwargs) self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) - self.phone_number_administration = PhoneNumberAdministrationOperations( + self.phone_numbers = PhoneNumbersOperations( self._client, self._config, self._serialize, self._deserialize) def close(self): @@ -52,7 +52,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> PhoneNumberAdministrationService + # type: () -> PhoneNumbersClient self._client.__enter__() return self diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/__init__.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/__init__.py index 385f28a2876a..0f7fab5f7e31 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/__init__.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._phone_number_administration_service import PhoneNumberAdministrationService -__all__ = ['PhoneNumberAdministrationService'] +from ._phone_numbers_client import PhoneNumbersClient +__all__ = ['PhoneNumbersClient'] diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/_configuration.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/_configuration.py index 7a46556ea91d..92da00d6b71e 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/_configuration.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/_configuration.py @@ -13,13 +13,13 @@ VERSION = "unknown" -class PhoneNumberAdministrationServiceConfiguration(Configuration): - """Configuration for PhoneNumberAdministrationService. +class PhoneNumbersClientConfiguration(Configuration): + """Configuration for PhoneNumbersClient. Note that all parameters used to create this instance are saved as instance attributes. - :param endpoint: The endpoint of the Azure Communication resource. + :param endpoint: The communication resource, for example https://resourcename.communication.azure.com. :type endpoint: str """ @@ -30,11 +30,11 @@ def __init__( ) -> None: if endpoint is None: raise ValueError("Parameter 'endpoint' must not be None.") - super(PhoneNumberAdministrationServiceConfiguration, self).__init__(**kwargs) + super(PhoneNumbersClientConfiguration, self).__init__(**kwargs) self.endpoint = endpoint - self.api_version = "2020-07-20-preview1" - kwargs.setdefault('sdk_moniker', 'phonenumberadministrationservice/{}'.format(VERSION)) + self.api_version = "2021-03-07" + kwargs.setdefault('sdk_moniker', 'phonenumbersclient/{}'.format(VERSION)) self._configure(**kwargs) def _configure( diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/_phone_number_administration_service.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/_phone_numbers_client.py similarity index 62% rename from sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/_phone_number_administration_service.py rename to sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/_phone_numbers_client.py index f737f6de296a..61d925e71895 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/_phone_number_administration_service.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/_phone_numbers_client.py @@ -11,18 +11,19 @@ from azure.core import AsyncPipelineClient from msrest import Deserializer, Serializer -from ._configuration import PhoneNumberAdministrationServiceConfiguration -from .operations import PhoneNumberAdministrationOperations +from ._configuration import PhoneNumbersClientConfiguration +from .operations import PhoneNumbersOperations from .. import models -class PhoneNumberAdministrationService(object): - """Phone Number Administration Service. +class PhoneNumbersClient(object): + """The phone numbers client uses Azure Communication Services to acquire and manage phone numbers. - :ivar phone_number_administration: PhoneNumberAdministrationOperations operations - :vartype phone_number_administration: azure.communication.phonenumbers.aio.operations.PhoneNumberAdministrationOperations - :param endpoint: The endpoint of the Azure Communication resource. + :ivar phone_numbers: PhoneNumbersOperations operations + :vartype phone_numbers: azure.communication.phonenumbers.aio.operations.PhoneNumbersOperations + :param endpoint: The communication resource, for example https://resourcename.communication.azure.com. :type endpoint: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -31,21 +32,20 @@ def __init__( **kwargs: Any ) -> None: base_url = '{endpoint}' - self._config = PhoneNumberAdministrationServiceConfiguration(endpoint, **kwargs) + self._config = PhoneNumbersClientConfiguration(endpoint, **kwargs) self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) - self.phone_number_administration = PhoneNumberAdministrationOperations( + self.phone_numbers = PhoneNumbersOperations( self._client, self._config, self._serialize, self._deserialize) async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "PhoneNumberAdministrationService": + async def __aenter__(self) -> "PhoneNumbersClient": await self._client.__aenter__() return self diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/__init__.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/__init__.py index 50478d62d8d6..3da9bcb904f3 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/__init__.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._phone_number_administration_operations import PhoneNumberAdministrationOperations +from ._phone_numbers_operations import PhoneNumbersOperations __all__ = [ - 'PhoneNumberAdministrationOperations', + 'PhoneNumbersOperations', ] diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_number_administration_operations.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_number_administration_operations.py deleted file mode 100644 index 60f15bfc4fb5..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_number_administration_operations.py +++ /dev/null @@ -1,1398 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, List, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PhoneNumberAdministrationOperations: - """PhoneNumberAdministrationOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.communication.phonenumbers.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def get_all_phone_numbers( - self, - locale: Optional[str] = "en-US", - skip: Optional[int] = 0, - take: Optional[int] = 100, - **kwargs - ) -> AsyncIterable["_models.AcquiredPhoneNumbers"]: - """Gets the list of the acquired phone numbers. - - Gets the list of the acquired phone numbers. - - :param locale: A language-locale pairing which will be used to localize the names of countries. - :type locale: str - :param skip: An optional parameter for how many entries to skip, for pagination purposes. - :type skip: int - :param take: An optional parameter for how many entries to return, for pagination purposes. - :type take: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AcquiredPhoneNumbers or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.phonenumbers.models.AcquiredPhoneNumbers] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AcquiredPhoneNumbers"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.get_all_phone_numbers.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if locale is not None: - query_parameters['locale'] = self._serialize.query("locale", locale, 'str') - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int') - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('AcquiredPhoneNumbers', pipeline_response) - list_of_elem = deserialized.phone_numbers - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - get_all_phone_numbers.metadata = {'url': '/administration/phonenumbers/phonenumbers'} # type: ignore - - async def get_all_area_codes( - self, - location_type: str, - country_code: str, - phone_plan_id: str, - location_options: Optional[List["_models.LocationOptionsQuery"]] = None, - **kwargs - ) -> "_models.AreaCodes": - """Gets a list of the supported area codes. - - Gets a list of the supported area codes. - - :param location_type: The type of location information required by the plan. - :type location_type: str - :param country_code: The ISO 3166-2 country code. - :type country_code: str - :param phone_plan_id: The plan id from which to search area codes. - :type phone_plan_id: str - :param location_options: Represents the underlying list of countries. - :type location_options: list[~azure.communication.phonenumbers.models.LocationOptionsQuery] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AreaCodes, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.AreaCodes - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AreaCodes"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _body = _models.LocationOptionsQueries(location_options=location_options) - api_version = "2020-07-20-preview1" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.get_all_area_codes.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'countryCode': self._serialize.url("country_code", country_code, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['locationType'] = self._serialize.query("location_type", location_type, 'str') - query_parameters['phonePlanId'] = self._serialize.query("phone_plan_id", phone_plan_id, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if _body is not None: - body_content = self._serialize.body(_body, 'LocationOptionsQueries') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('AreaCodes', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_all_area_codes.metadata = {'url': '/administration/phonenumbers/countries/{countryCode}/areacodes'} # type: ignore - - async def get_capabilities_update( - self, - capabilities_update_id: str, - **kwargs - ) -> "_models.UpdatePhoneNumberCapabilitiesResponse": - """Get capabilities by capabilities update id. - - Get capabilities by capabilities update id. - - :param capabilities_update_id: - :type capabilities_update_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: UpdatePhoneNumberCapabilitiesResponse, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.UpdatePhoneNumberCapabilitiesResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdatePhoneNumberCapabilitiesResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - # Construct URL - url = self.get_capabilities_update.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'capabilitiesUpdateId': self._serialize.url("capabilities_update_id", capabilities_update_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('UpdatePhoneNumberCapabilitiesResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_capabilities_update.metadata = {'url': '/administration/phonenumbers/capabilities/{capabilitiesUpdateId}'} # type: ignore - - async def update_capabilities( - self, - phone_number_capabilities_update: Dict[str, "_models.NumberUpdateCapabilities"], - **kwargs - ) -> "_models.UpdateNumberCapabilitiesResponse": - """Adds or removes phone number capabilities. - - Adds or removes phone number capabilities. - - :param phone_number_capabilities_update: The map of phone numbers to the capabilities update - applied to the phone number. - :type phone_number_capabilities_update: dict[str, ~azure.communication.phonenumbers.models.NumberUpdateCapabilities] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: UpdateNumberCapabilitiesResponse, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.UpdateNumberCapabilitiesResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateNumberCapabilitiesResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _body = _models.UpdateNumberCapabilitiesRequest(phone_number_capabilities_update=phone_number_capabilities_update) - api_version = "2020-07-20-preview1" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update_capabilities.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if _body is not None: - body_content = self._serialize.body(_body, 'UpdateNumberCapabilitiesRequest') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('UpdateNumberCapabilitiesResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update_capabilities.metadata = {'url': '/administration/phonenumbers/capabilities'} # type: ignore - - def get_all_supported_countries( - self, - locale: Optional[str] = "en-US", - skip: Optional[int] = 0, - take: Optional[int] = 100, - **kwargs - ) -> AsyncIterable["_models.PhoneNumberCountries"]: - """Gets a list of supported countries. - - Gets a list of supported countries. - - :param locale: A language-locale pairing which will be used to localize the names of countries. - :type locale: str - :param skip: An optional parameter for how many entries to skip, for pagination purposes. - :type skip: int - :param take: An optional parameter for how many entries to return, for pagination purposes. - :type take: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PhoneNumberCountries or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.phonenumbers.models.PhoneNumberCountries] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberCountries"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.get_all_supported_countries.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if locale is not None: - query_parameters['locale'] = self._serialize.query("locale", locale, 'str') - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int') - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('PhoneNumberCountries', pipeline_response) - list_of_elem = deserialized.countries - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - get_all_supported_countries.metadata = {'url': '/administration/phonenumbers/countries'} # type: ignore - - async def get_number_configuration( - self, - phone_number: str, - **kwargs - ) -> "_models.NumberConfigurationResponse": - """Endpoint for getting number configurations. - - Endpoint for getting number configurations. - - :param phone_number: The phone number in the E.164 format. - :type phone_number: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NumberConfigurationResponse, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.NumberConfigurationResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NumberConfigurationResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _body = _models.NumberConfigurationPhoneNumber(phone_number=phone_number) - api_version = "2020-07-20-preview1" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.get_number_configuration.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if _body is not None: - body_content = self._serialize.body(_body, 'NumberConfigurationPhoneNumber') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('NumberConfigurationResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_number_configuration.metadata = {'url': '/administration/phonenumbers/numberconfiguration'} # type: ignore - - async def configure_number( - self, - pstn_configuration: "_models.PstnConfiguration", - phone_number: str, - **kwargs - ) -> None: - """Endpoint for configuring a pstn number. - - Endpoint for configuring a pstn number. - - :param pstn_configuration: Definition for pstn number configuration. - :type pstn_configuration: ~azure.communication.phonenumbers.models.PstnConfiguration - :param phone_number: The phone number to configure. - :type phone_number: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _body = _models.NumberConfiguration(pstn_configuration=pstn_configuration, phone_number=phone_number) - api_version = "2020-07-20-preview1" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.configure_number.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if _body is not None: - body_content = self._serialize.body(_body, 'NumberConfiguration') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - configure_number.metadata = {'url': '/administration/phonenumbers/numberconfiguration/configure'} # type: ignore - - async def unconfigure_number( - self, - phone_number: str, - **kwargs - ) -> None: - """Endpoint for unconfiguring a pstn number by removing the configuration. - - Endpoint for unconfiguring a pstn number by removing the configuration. - - :param phone_number: The phone number in the E.164 format. - :type phone_number: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _body = _models.NumberConfigurationPhoneNumber(phone_number=phone_number) - api_version = "2020-07-20-preview1" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.unconfigure_number.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if _body is not None: - body_content = self._serialize.body(_body, 'NumberConfigurationPhoneNumber') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - unconfigure_number.metadata = {'url': '/administration/phonenumbers/numberconfiguration/unconfigure'} # type: ignore - - def get_phone_plan_groups( - self, - country_code: str, - locale: Optional[str] = "en-US", - include_rate_information: Optional[bool] = False, - skip: Optional[int] = 0, - take: Optional[int] = 100, - **kwargs - ) -> AsyncIterable["_models.PhonePlanGroups"]: - """Gets a list of phone plan groups for the given country. - - Gets a list of phone plan groups for the given country. - - :param country_code: The ISO 3166-2 country code. - :type country_code: str - :param locale: A language-locale pairing which will be used to localize the names of countries. - :type locale: str - :param include_rate_information: - :type include_rate_information: bool - :param skip: An optional parameter for how many entries to skip, for pagination purposes. - :type skip: int - :param take: An optional parameter for how many entries to return, for pagination purposes. - :type take: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PhonePlanGroups or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.phonenumbers.models.PhonePlanGroups] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PhonePlanGroups"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.get_phone_plan_groups.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'countryCode': self._serialize.url("country_code", country_code, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if locale is not None: - query_parameters['locale'] = self._serialize.query("locale", locale, 'str') - if include_rate_information is not None: - query_parameters['includeRateInformation'] = self._serialize.query("include_rate_information", include_rate_information, 'bool') - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int') - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'countryCode': self._serialize.url("country_code", country_code, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('PhonePlanGroups', pipeline_response) - list_of_elem = deserialized.phone_plan_groups - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - get_phone_plan_groups.metadata = {'url': '/administration/phonenumbers/countries/{countryCode}/phoneplangroups'} # type: ignore - - def get_phone_plans( - self, - country_code: str, - phone_plan_group_id: str, - locale: Optional[str] = "en-US", - skip: Optional[int] = 0, - take: Optional[int] = 100, - **kwargs - ) -> AsyncIterable["_models.PhonePlansResponse"]: - """Gets a list of phone plans for a phone plan group. - - Gets a list of phone plans for a phone plan group. - - :param country_code: The ISO 3166-2 country code. - :type country_code: str - :param phone_plan_group_id: - :type phone_plan_group_id: str - :param locale: A language-locale pairing which will be used to localize the names of countries. - :type locale: str - :param skip: An optional parameter for how many entries to skip, for pagination purposes. - :type skip: int - :param take: An optional parameter for how many entries to return, for pagination purposes. - :type take: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PhonePlansResponse or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.phonenumbers.models.PhonePlansResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PhonePlansResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.get_phone_plans.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'countryCode': self._serialize.url("country_code", country_code, 'str'), - 'phonePlanGroupId': self._serialize.url("phone_plan_group_id", phone_plan_group_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if locale is not None: - query_parameters['locale'] = self._serialize.query("locale", locale, 'str') - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int') - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'countryCode': self._serialize.url("country_code", country_code, 'str'), - 'phonePlanGroupId': self._serialize.url("phone_plan_group_id", phone_plan_group_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('PhonePlansResponse', pipeline_response) - list_of_elem = deserialized.phone_plans - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - get_phone_plans.metadata = {'url': '/administration/phonenumbers/countries/{countryCode}/phoneplangroups/{phonePlanGroupId}/phoneplans'} # type: ignore - - async def get_phone_plan_location_options( - self, - country_code: str, - phone_plan_group_id: str, - phone_plan_id: str, - locale: Optional[str] = "en-US", - **kwargs - ) -> "_models.LocationOptionsResponse": - """Gets a list of location options for a phone plan. - - Gets a list of location options for a phone plan. - - :param country_code: The ISO 3166-2 country code. - :type country_code: str - :param phone_plan_group_id: - :type phone_plan_group_id: str - :param phone_plan_id: - :type phone_plan_id: str - :param locale: A language-locale pairing which will be used to localize the names of countries. - :type locale: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LocationOptionsResponse, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.LocationOptionsResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LocationOptionsResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - # Construct URL - url = self.get_phone_plan_location_options.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'countryCode': self._serialize.url("country_code", country_code, 'str'), - 'phonePlanGroupId': self._serialize.url("phone_plan_group_id", phone_plan_group_id, 'str'), - 'phonePlanId': self._serialize.url("phone_plan_id", phone_plan_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if locale is not None: - query_parameters['locale'] = self._serialize.query("locale", locale, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('LocationOptionsResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_phone_plan_location_options.metadata = {'url': '/administration/phonenumbers/countries/{countryCode}/phoneplangroups/{phonePlanGroupId}/phoneplans/{phonePlanId}/locationoptions'} # type: ignore - - async def get_release_by_id( - self, - release_id: str, - **kwargs - ) -> "_models.PhoneNumberRelease": - """Gets a release by a release id. - - Gets a release by a release id. - - :param release_id: Represents the release id. - :type release_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PhoneNumberRelease, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.PhoneNumberRelease - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberRelease"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - # Construct URL - url = self.get_release_by_id.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'releaseId': self._serialize.url("release_id", release_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('PhoneNumberRelease', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_release_by_id.metadata = {'url': '/administration/phonenumbers/releases/{releaseId}'} # type: ignore - - async def release_phone_numbers( - self, - phone_numbers: List[str], - **kwargs - ) -> "_models.ReleaseResponse": - """Creates a release for the given phone numbers. - - Creates a release for the given phone numbers. - - :param phone_numbers: The list of phone numbers in the release request. - :type phone_numbers: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ReleaseResponse, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.ReleaseResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ReleaseResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _body = _models.ReleaseRequest(phone_numbers=phone_numbers) - api_version = "2020-07-20-preview1" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.release_phone_numbers.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if _body is not None: - body_content = self._serialize.body(_body, 'ReleaseRequest') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('ReleaseResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - release_phone_numbers.metadata = {'url': '/administration/phonenumbers/releases'} # type: ignore - - def get_all_releases( - self, - skip: Optional[int] = 0, - take: Optional[int] = 100, - **kwargs - ) -> AsyncIterable["_models.PhoneNumberEntities"]: - """Gets a list of all releases. - - Gets a list of all releases. - - :param skip: An optional parameter for how many entries to skip, for pagination purposes. - :type skip: int - :param take: An optional parameter for how many entries to return, for pagination purposes. - :type take: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PhoneNumberEntities or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.phonenumbers.models.PhoneNumberEntities] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberEntities"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.get_all_releases.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int') - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('PhoneNumberEntities', pipeline_response) - list_of_elem = deserialized.entities - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - get_all_releases.metadata = {'url': '/administration/phonenumbers/releases'} # type: ignore - - async def get_search_by_id( - self, - search_id: str, - **kwargs - ) -> "_models.PhoneNumberReservation": - """Get search by search id. - - Get search by search id. - - :param search_id: The search id to be searched for. - :type search_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PhoneNumberReservation, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.PhoneNumberReservation - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberReservation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - # Construct URL - url = self.get_search_by_id.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'searchId': self._serialize.url("search_id", search_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('PhoneNumberReservation', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_search_by_id.metadata = {'url': '/administration/phonenumbers/searches/{searchId}'} # type: ignore - - async def create_search( - self, - body: Optional["_models.CreateSearchOptions"] = None, - **kwargs - ) -> "_models.CreateSearchResponse": - """Creates a phone number search. - - Creates a phone number search. - - :param body: Defines the search options. - :type body: ~azure.communication.phonenumbers.models.CreateSearchOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CreateSearchResponse, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.CreateSearchResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CreateSearchResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_search.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if body is not None: - body_content = self._serialize.body(body, 'CreateSearchOptions') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('CreateSearchResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_search.metadata = {'url': '/administration/phonenumbers/searches'} # type: ignore - - def get_all_searches( - self, - skip: Optional[int] = 0, - take: Optional[int] = 100, - **kwargs - ) -> AsyncIterable["_models.PhoneNumberEntities"]: - """Gets a list of all searches. - - Gets a list of all searches. - - :param skip: An optional parameter for how many entries to skip, for pagination purposes. - :type skip: int - :param take: An optional parameter for how many entries to return, for pagination purposes. - :type take: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PhoneNumberEntities or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.phonenumbers.models.PhoneNumberEntities] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberEntities"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.get_all_searches.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int') - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('PhoneNumberEntities', pipeline_response) - list_of_elem = deserialized.entities - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - get_all_searches.metadata = {'url': '/administration/phonenumbers/searches'} # type: ignore - - async def cancel_search( - self, - search_id: str, - **kwargs - ) -> None: - """Cancels the search. This means existing numbers in the search will be made available. - - Cancels the search. This means existing numbers in the search will be made available. - - :param search_id: The search id to be canceled. - :type search_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - # Construct URL - url = self.cancel_search.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'searchId': self._serialize.url("search_id", search_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - cancel_search.metadata = {'url': '/administration/phonenumbers/searches/{searchId}/cancel'} # type: ignore - - async def purchase_search( - self, - search_id: str, - **kwargs - ) -> None: - """Purchases the phone number search. - - Purchases the phone number search. - - :param search_id: The search id to be purchased. - :type search_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - # Construct URL - url = self.purchase_search.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'searchId': self._serialize.url("search_id", search_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - purchase_search.metadata = {'url': '/administration/phonenumbers/searches/{searchId}/purchase'} # type: ignore diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py new file mode 100644 index 000000000000..82175b90addc --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py @@ -0,0 +1,926 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.polling.async_base_polling import AsyncLROBasePolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PhoneNumbersOperations: + """PhoneNumbersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.communication.phonenumbers.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _search_available_phone_numbers_initial( + self, + country_code: str, + body: "_models.PhoneNumberSearchRequest", + **kwargs + ) -> "_models.PhoneNumberSearchResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberSearchResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-07" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._search_available_phone_numbers_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'countryCode': self._serialize.url("country_code", country_code, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(body, 'PhoneNumberSearchRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _search_available_phone_numbers_initial.metadata = {'url': '/availablePhoneNumbers/countries/{countryCode}/:search'} # type: ignore + + async def begin_search_available_phone_numbers( + self, + country_code: str, + body: "_models.PhoneNumberSearchRequest", + **kwargs + ) -> AsyncLROPoller["_models.PhoneNumberSearchResult"]: + """Search for available phone numbers to purchase. + + Search for available phone numbers to purchase. + + :param country_code: The ISO 3166-2 country code, e.g. US. + :type country_code: str + :param body: The phone number search request. + :type body: ~azure.communication.phonenumbers.models.PhoneNumberSearchRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PhoneNumberSearchResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.communication.phonenumbers.models.PhoneNumberSearchResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberSearchResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._search_available_phone_numbers_initial( + country_code=country_code, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'countryCode': self._serialize.url("country_code", country_code, 'str'), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_search_available_phone_numbers.metadata = {'url': '/availablePhoneNumbers/countries/{countryCode}/:search'} # type: ignore + + async def get_search_result( + self, + search_id: str, + **kwargs + ) -> "_models.PhoneNumberSearchResult": + """Gets a phone number search result by search id. + + Gets a phone number search result by search id. + + :param search_id: The search Id. + :type search_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PhoneNumberSearchResult, or the result of cls(response) + :rtype: ~azure.communication.phonenumbers.models.PhoneNumberSearchResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberSearchResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-07" + accept = "application/json" + + # Construct URL + url = self.get_search_result.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'searchId': self._serialize.url("search_id", search_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_result.metadata = {'url': '/availablePhoneNumbers/searchResults/{searchId}'} # type: ignore + + async def _purchase_phone_numbers_initial( + self, + search_id: Optional[str] = None, + **kwargs + ) -> "_models.PhoneNumberSearchResult": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberSearchResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _body = _models.PhoneNumberPurchaseRequest(search_id=search_id) + api_version = "2021-03-07" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._purchase_phone_numbers_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_body, 'PhoneNumberPurchaseRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _purchase_phone_numbers_initial.metadata = {'url': '/availablePhoneNumbers/:purchase'} # type: ignore + + async def begin_purchase_phone_numbers( + self, + search_id: Optional[str] = None, + **kwargs + ) -> AsyncLROPoller["_models.PhoneNumberSearchResult"]: + """Purchases phone numbers. + + Purchases phone numbers. + + :param search_id: The search id. + :type search_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PhoneNumberSearchResult or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.communication.phonenumbers.models.PhoneNumberSearchResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberSearchResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._purchase_phone_numbers_initial( + search_id=search_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_purchase_phone_numbers.metadata = {'url': '/availablePhoneNumbers/:purchase'} # type: ignore + + async def get_operation( + self, + operation_id: str, + **kwargs + ) -> "_models.PhoneNumberOperation": + """Gets an operation by its id. + + Gets an operation by its id. + + :param operation_id: The id of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PhoneNumberOperation, or the result of cls(response) + :rtype: ~azure.communication.phonenumbers.models.PhoneNumberOperation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberOperation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-07" + accept = "application/json" + + # Construct URL + url = self.get_operation.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('PhoneNumberOperation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_operation.metadata = {'url': '/phoneNumbers/operations/{operationId}'} # type: ignore + + async def cancel_operation( + self, + operation_id: str, + **kwargs + ) -> None: + """Cancels an operation by its id. + + Cancels an operation by its id. + + :param operation_id: The id of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-07" + accept = "application/json" + + # Construct URL + url = self.cancel_operation.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + cancel_operation.metadata = {'url': '/phoneNumbers/operations/{operationId}'} # type: ignore + + async def get_by_number( + self, + phone_number: str, + **kwargs + ) -> "_models.AcquiredPhoneNumber": + """Gets the details of the given acquired phone number. + + Gets the details of the given acquired phone number. + + :param phone_number: The acquired phone number whose details are to be fetched in E.164 format, + e.g. +11234567890. + :type phone_number: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AcquiredPhoneNumber, or the result of cls(response) + :rtype: ~azure.communication.phonenumbers.models.AcquiredPhoneNumber + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AcquiredPhoneNumber"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-07" + accept = "application/json" + + # Construct URL + url = self.get_by_number.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'phoneNumber': self._serialize.url("phone_number", phone_number, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_number.metadata = {'url': '/phoneNumbers/{phoneNumber}'} # type: ignore + + async def _release_phone_number_initial( + self, + phone_number: str, + **kwargs + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-07" + accept = "application/json" + + # Construct URL + url = self._release_phone_number_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'phoneNumber': self._serialize.url("phone_number", phone_number, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _release_phone_number_initial.metadata = {'url': '/phoneNumbers/{phoneNumber}'} # type: ignore + + async def begin_release_phone_number( + self, + phone_number: str, + **kwargs + ) -> AsyncLROPoller[None]: + """Releases an acquired phone number. + + Releases an acquired phone number. + + :param phone_number: Phone number to be released, e.g. +11234567890. + :type phone_number: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._release_phone_number_initial( + phone_number=phone_number, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'phoneNumber': self._serialize.url("phone_number", phone_number, 'str'), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_release_phone_number.metadata = {'url': '/phoneNumbers/{phoneNumber}'} # type: ignore + + async def update( + self, + phone_number: str, + callback_uri: Optional[str] = None, + application_id: Optional[str] = None, + **kwargs + ) -> "_models.AcquiredPhoneNumber": + """Updates the configuration of a phone number. + + Updates the configuration of a phone number. + + :param phone_number: Phone number to be updated, e.g. +11234567890. + :type phone_number: str + :param callback_uri: The webhook for receiving incoming events. + e.g. "https://{{site-name}}.azurewebsites.net/api/updates". + Please read https://docs.microsoft.com/en-us/azure/communication-services/concepts/event- + handling + for integration with Azure Event Grid to deliver real-time event notifications. + :type callback_uri: str + :param application_id: The application id of the application to which to configure. + :type application_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AcquiredPhoneNumber, or the result of cls(response) + :rtype: ~azure.communication.phonenumbers.models.AcquiredPhoneNumber + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AcquiredPhoneNumber"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _body = _models.PhoneNumberUpdateRequest(callback_uri=callback_uri, application_id=application_id) + api_version = "2021-03-07" + content_type = kwargs.pop("content_type", "application/merge-patch+json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'phoneNumber': self._serialize.url("phone_number", phone_number, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if _body is not None: + body_content = self._serialize.body(_body, 'PhoneNumberUpdateRequest') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/phoneNumbers/{phoneNumber}'} # type: ignore + + def list_phone_numbers( + self, + skip: Optional[int] = 0, + top: Optional[int] = 100, + **kwargs + ) -> AsyncIterable["_models.AcquiredPhoneNumbers"]: + """Gets the list of all acquired phone numbers. + + Gets the list of all acquired phone numbers. + + :param skip: An optional parameter for how many entries to skip, for pagination purposes. The + default value is 0. + :type skip: int + :param top: An optional parameter for how many entries to return, for pagination purposes. The + default value is 100. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AcquiredPhoneNumbers or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.phonenumbers.models.AcquiredPhoneNumbers] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AcquiredPhoneNumbers"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-07" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_phone_numbers.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int') + if top is not None: + query_parameters['top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AcquiredPhoneNumbers', pipeline_response) + list_of_elem = deserialized.phone_numbers + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_phone_numbers.metadata = {'url': '/phoneNumbers'} # type: ignore + + async def _update_capabilities_initial( + self, + phone_number: str, + calling: Optional[Union[str, "_models.PhoneNumberCapabilityValue"]] = None, + sms: Optional[Union[str, "_models.PhoneNumberCapabilityValue"]] = None, + **kwargs + ) -> "_models.AcquiredPhoneNumber": + cls = kwargs.pop('cls', None) # type: ClsType["_models.AcquiredPhoneNumber"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _body = _models.PhoneNumberCapabilitiesRequest(calling=calling, sms=sms) + api_version = "2021-03-07" + content_type = kwargs.pop("content_type", "application/merge-patch+json") + accept = "application/json" + + # Construct URL + url = self._update_capabilities_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'phoneNumber': self._serialize.url("phone_number", phone_number, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if _body is not None: + body_content = self._serialize.body(_body, 'PhoneNumberCapabilitiesRequest') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _update_capabilities_initial.metadata = {'url': '/phoneNumbers/{phoneNumber}/capabilities'} # type: ignore + + async def begin_update_capabilities( + self, + phone_number: str, + calling: Optional[Union[str, "_models.PhoneNumberCapabilityValue"]] = None, + sms: Optional[Union[str, "_models.PhoneNumberCapabilityValue"]] = None, + **kwargs + ) -> AsyncLROPoller["_models.AcquiredPhoneNumber"]: + """Updates the capabilities of a phone number. + + Updates the capabilities of a phone number. + + :param phone_number: The phone number id in E.164 format. The leading plus can be either + or + encoded as %2B, e.g. +11234567890. + :type phone_number: str + :param calling: Capability value for calling. + :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :param sms: Capability value for SMS. + :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AcquiredPhoneNumber or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.communication.phonenumbers.models.AcquiredPhoneNumber] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AcquiredPhoneNumber"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_capabilities_initial( + phone_number=phone_number, + calling=calling, + sms=sms, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'phoneNumber': self._serialize.url("phone_number", phone_number, 'str'), + } + + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_capabilities.metadata = {'url': '/phoneNumbers/{phoneNumber}/capabilities'} # type: ignore diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/__init__.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/__init__.py index 0548f7b51a32..2d27cfa59478 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/__init__.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/__init__.py @@ -9,133 +9,56 @@ try: from ._models_py3 import AcquiredPhoneNumber from ._models_py3 import AcquiredPhoneNumbers - from ._models_py3 import AreaCodes - from ._models_py3 import CarrierDetails - from ._models_py3 import CreateSearchOptions - from ._models_py3 import CreateSearchResponse - from ._models_py3 import ErrorBody - from ._models_py3 import ErrorResponse - from ._models_py3 import LocationOptions - from ._models_py3 import LocationOptionsDetails - from ._models_py3 import LocationOptionsQueries - from ._models_py3 import LocationOptionsQuery - from ._models_py3 import LocationOptionsResponse - from ._models_py3 import NumberConfiguration - from ._models_py3 import NumberConfigurationPhoneNumber - from ._models_py3 import NumberConfigurationResponse - from ._models_py3 import NumberUpdateCapabilities - from ._models_py3 import PhoneNumberCountries - from ._models_py3 import PhoneNumberCountry - from ._models_py3 import PhoneNumberEntities - from ._models_py3 import PhoneNumberEntity - from ._models_py3 import PhoneNumberRelease - from ._models_py3 import PhoneNumberReleaseDetails - from ._models_py3 import PhoneNumberReservation - from ._models_py3 import PhonePlan - from ._models_py3 import PhonePlanGroup - from ._models_py3 import PhonePlanGroups - from ._models_py3 import PhonePlansResponse - from ._models_py3 import PstnConfiguration - from ._models_py3 import RateInformation - from ._models_py3 import ReleaseRequest - from ._models_py3 import ReleaseResponse - from ._models_py3 import UpdateNumberCapabilitiesRequest - from ._models_py3 import UpdateNumberCapabilitiesResponse - from ._models_py3 import UpdatePhoneNumberCapabilitiesResponse + from ._models_py3 import CommunicationError + from ._models_py3 import CommunicationErrorResponse + from ._models_py3 import PhoneNumberCapabilities + from ._models_py3 import PhoneNumberCapabilitiesRequest + from ._models_py3 import PhoneNumberCost + from ._models_py3 import PhoneNumberOperation + from ._models_py3 import PhoneNumberPurchaseRequest + from ._models_py3 import PhoneNumberSearchRequest + from ._models_py3 import PhoneNumberSearchResult + from ._models_py3 import PhoneNumberUpdateRequest except (SyntaxError, ImportError): from ._models import AcquiredPhoneNumber # type: ignore from ._models import AcquiredPhoneNumbers # type: ignore - from ._models import AreaCodes # type: ignore - from ._models import CarrierDetails # type: ignore - from ._models import CreateSearchOptions # type: ignore - from ._models import CreateSearchResponse # type: ignore - from ._models import ErrorBody # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import LocationOptions # type: ignore - from ._models import LocationOptionsDetails # type: ignore - from ._models import LocationOptionsQueries # type: ignore - from ._models import LocationOptionsQuery # type: ignore - from ._models import LocationOptionsResponse # type: ignore - from ._models import NumberConfiguration # type: ignore - from ._models import NumberConfigurationPhoneNumber # type: ignore - from ._models import NumberConfigurationResponse # type: ignore - from ._models import NumberUpdateCapabilities # type: ignore - from ._models import PhoneNumberCountries # type: ignore - from ._models import PhoneNumberCountry # type: ignore - from ._models import PhoneNumberEntities # type: ignore - from ._models import PhoneNumberEntity # type: ignore - from ._models import PhoneNumberRelease # type: ignore - from ._models import PhoneNumberReleaseDetails # type: ignore - from ._models import PhoneNumberReservation # type: ignore - from ._models import PhonePlan # type: ignore - from ._models import PhonePlanGroup # type: ignore - from ._models import PhonePlanGroups # type: ignore - from ._models import PhonePlansResponse # type: ignore - from ._models import PstnConfiguration # type: ignore - from ._models import RateInformation # type: ignore - from ._models import ReleaseRequest # type: ignore - from ._models import ReleaseResponse # type: ignore - from ._models import UpdateNumberCapabilitiesRequest # type: ignore - from ._models import UpdateNumberCapabilitiesResponse # type: ignore - from ._models import UpdatePhoneNumberCapabilitiesResponse # type: ignore + from ._models import CommunicationError # type: ignore + from ._models import CommunicationErrorResponse # type: ignore + from ._models import PhoneNumberCapabilities # type: ignore + from ._models import PhoneNumberCapabilitiesRequest # type: ignore + from ._models import PhoneNumberCost # type: ignore + from ._models import PhoneNumberOperation # type: ignore + from ._models import PhoneNumberPurchaseRequest # type: ignore + from ._models import PhoneNumberSearchRequest # type: ignore + from ._models import PhoneNumberSearchResult # type: ignore + from ._models import PhoneNumberUpdateRequest # type: ignore -from ._phone_number_administration_service_enums import ( - ActivationState, - AssignmentStatus, - CapabilitiesUpdateStatus, - Capability, - CurrencyType, - LocationType, - PhoneNumberReleaseStatus, +from ._phone_numbers_client_enums import ( + BillingFrequency, + PhoneNumberAssignmentType, + PhoneNumberCapabilityValue, + PhoneNumberOperationStatus, + PhoneNumberOperationType, PhoneNumberType, - ReleaseStatus, - SearchStatus, ) __all__ = [ 'AcquiredPhoneNumber', 'AcquiredPhoneNumbers', - 'AreaCodes', - 'CarrierDetails', - 'CreateSearchOptions', - 'CreateSearchResponse', - 'ErrorBody', - 'ErrorResponse', - 'LocationOptions', - 'LocationOptionsDetails', - 'LocationOptionsQueries', - 'LocationOptionsQuery', - 'LocationOptionsResponse', - 'NumberConfiguration', - 'NumberConfigurationPhoneNumber', - 'NumberConfigurationResponse', - 'NumberUpdateCapabilities', - 'PhoneNumberCountries', - 'PhoneNumberCountry', - 'PhoneNumberEntities', - 'PhoneNumberEntity', - 'PhoneNumberRelease', - 'PhoneNumberReleaseDetails', - 'PhoneNumberReservation', - 'PhonePlan', - 'PhonePlanGroup', - 'PhonePlanGroups', - 'PhonePlansResponse', - 'PstnConfiguration', - 'RateInformation', - 'ReleaseRequest', - 'ReleaseResponse', - 'UpdateNumberCapabilitiesRequest', - 'UpdateNumberCapabilitiesResponse', - 'UpdatePhoneNumberCapabilitiesResponse', - 'ActivationState', - 'AssignmentStatus', - 'CapabilitiesUpdateStatus', - 'Capability', - 'CurrencyType', - 'LocationType', - 'PhoneNumberReleaseStatus', + 'CommunicationError', + 'CommunicationErrorResponse', + 'PhoneNumberCapabilities', + 'PhoneNumberCapabilitiesRequest', + 'PhoneNumberCost', + 'PhoneNumberOperation', + 'PhoneNumberPurchaseRequest', + 'PhoneNumberSearchRequest', + 'PhoneNumberSearchResult', + 'PhoneNumberUpdateRequest', + 'BillingFrequency', + 'PhoneNumberAssignmentType', + 'PhoneNumberCapabilityValue', + 'PhoneNumberOperationStatus', + 'PhoneNumberOperationType', 'PhoneNumberType', - 'ReleaseStatus', - 'SearchStatus', ] diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py index 743ffbf17273..9b5ea66156e1 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py @@ -15,39 +15,54 @@ class AcquiredPhoneNumber(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param phone_number: Required. String of the E.164 format of the phone number. + :param id: Required. The id of the phone number, e.g. 11234567890. + :type id: str + :param phone_number: Required. String of the E.164 format of the phone number, e.g. + +11234567890. :type phone_number: str - :param acquired_capabilities: Required. The set of all acquired capabilities of the phone - number. - :type acquired_capabilities: list[str or ~azure.communication.phonenumbers.models.Capability] - :param available_capabilities: Required. The set of all available capabilities that can be - acquired for this phone number. - :type available_capabilities: list[str or ~azure.communication.phonenumbers.models.Capability] - :param assignment_status: The assignment status of the phone number. Conveys what type of - entity the number is assigned to. Possible values include: "Unassigned", "Unknown", - "UserAssigned", "ConferenceAssigned", "FirstPartyAppAssigned", "ThirdPartyAppAssigned". - :type assignment_status: str or ~azure.communication.phonenumbers.models.AssignmentStatus - :param place_name: The name of the place of the phone number. - :type place_name: str - :param activation_state: The activation state of the phone number. Can be "Activated", - "AssignmentPending", "AssignmentFailed", "UpdatePending", "UpdateFailed". Possible values - include: "Activated", "AssignmentPending", "AssignmentFailed", "UpdatePending", "UpdateFailed". - :type activation_state: str or ~azure.communication.phonenumbers.models.ActivationState + :param country_code: Required. The ISO 3166-2 code of the phone number's country, e.g. US. + :type country_code: str + :param phone_number_type: Required. The phone number's type, e.g. Geographic, TollFree. + Possible values include: "geographic", "tollFree". + :type phone_number_type: str or ~azure.communication.phonenumbers.models.PhoneNumberType + :param capabilities: Required. Capabilities of a phone number. + :type capabilities: ~azure.communication.phonenumbers.models.PhoneNumberCapabilities + :param assignment_type: Required. The assignment type of the phone number. A phone number can + be assigned to a person, or to an application. Possible values include: "user", "application". + :type assignment_type: str or + ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType + :param purchase_date: The date and time that the phone number was purchased. + :type purchase_date: ~datetime.datetime + :param callback_uri: The webhook for receiving incoming events, e.g. https://{{site- + name}}.azurewebsites.net/api/updates. + :type callback_uri: str + :param application_id: The application id of the server application the phone number is + assigned to. The property is empty if the phone number is assigned to a person. + :type application_id: str + :param cost: The incurred cost for a single phone number. + :type cost: ~azure.communication.phonenumbers.models.PhoneNumberCost """ _validation = { + 'id': {'required': True}, 'phone_number': {'required': True}, - 'acquired_capabilities': {'required': True}, - 'available_capabilities': {'required': True}, + 'country_code': {'required': True}, + 'phone_number_type': {'required': True}, + 'capabilities': {'required': True}, + 'assignment_type': {'required': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'phone_number': {'key': 'phoneNumber', 'type': 'str'}, - 'acquired_capabilities': {'key': 'acquiredCapabilities', 'type': '[str]'}, - 'available_capabilities': {'key': 'availableCapabilities', 'type': '[str]'}, - 'assignment_status': {'key': 'assignmentStatus', 'type': 'str'}, - 'place_name': {'key': 'placeName', 'type': 'str'}, - 'activation_state': {'key': 'activationState', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'phone_number_type': {'key': 'phoneNumberType', 'type': 'str'}, + 'capabilities': {'key': 'capabilities', 'type': 'PhoneNumberCapabilities'}, + 'assignment_type': {'key': 'assignmentType', 'type': 'str'}, + 'purchase_date': {'key': 'purchaseDate', 'type': 'iso-8601'}, + 'callback_uri': {'key': 'callbackUri', 'type': 'str'}, + 'application_id': {'key': 'applicationId', 'type': 'str'}, + 'cost': {'key': 'cost', 'type': 'PhoneNumberCost'}, } def __init__( @@ -55,51 +70,35 @@ def __init__( **kwargs ): super(AcquiredPhoneNumber, self).__init__(**kwargs) + self.id = kwargs['id'] self.phone_number = kwargs['phone_number'] - self.acquired_capabilities = kwargs['acquired_capabilities'] - self.available_capabilities = kwargs['available_capabilities'] - self.assignment_status = kwargs.get('assignment_status', None) - self.place_name = kwargs.get('place_name', None) - self.activation_state = kwargs.get('activation_state', None) + self.country_code = kwargs['country_code'] + self.phone_number_type = kwargs['phone_number_type'] + self.capabilities = kwargs['capabilities'] + self.assignment_type = kwargs['assignment_type'] + self.purchase_date = kwargs.get('purchase_date', None) + self.callback_uri = kwargs.get('callback_uri', None) + self.application_id = kwargs.get('application_id', None) + self.cost = kwargs.get('cost', None) class AcquiredPhoneNumbers(msrest.serialization.Model): - """A wrapper of list of phone numbers. + """The list of acquired phone numbers. + + All required parameters must be populated in order to send to Azure. - :param phone_numbers: Represents a list of phone numbers. + :param phone_numbers: Required. Represents a list of phone numbers. :type phone_numbers: list[~azure.communication.phonenumbers.models.AcquiredPhoneNumber] - :param next_link: Represents the URL link to the next page. + :param next_link: Represents the URL link to the next page of phone number results. :type next_link: str """ - _attribute_map = { - 'phone_numbers': {'key': 'phoneNumbers', 'type': '[AcquiredPhoneNumber]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + _validation = { + 'phone_numbers': {'required': True}, } - def __init__( - self, - **kwargs - ): - super(AcquiredPhoneNumbers, self).__init__(**kwargs) - self.phone_numbers = kwargs.get('phone_numbers', None) - self.next_link = kwargs.get('next_link', None) - - -class AreaCodes(msrest.serialization.Model): - """Represents a list of area codes. - - :param primary_area_codes: Represents the list of primary area codes. - :type primary_area_codes: list[str] - :param secondary_area_codes: Represents the list of secondary area codes. - :type secondary_area_codes: list[str] - :param next_link: Represents the URL link to the next page. - :type next_link: str - """ - _attribute_map = { - 'primary_area_codes': {'key': 'primaryAreaCodes', 'type': '[str]'}, - 'secondary_area_codes': {'key': 'secondaryAreaCodes', 'type': '[str]'}, + 'phone_numbers': {'key': 'phoneNumbers', 'type': '[AcquiredPhoneNumber]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -107,950 +106,380 @@ def __init__( self, **kwargs ): - super(AreaCodes, self).__init__(**kwargs) - self.primary_area_codes = kwargs.get('primary_area_codes', None) - self.secondary_area_codes = kwargs.get('secondary_area_codes', None) + super(AcquiredPhoneNumbers, self).__init__(**kwargs) + self.phone_numbers = kwargs['phone_numbers'] self.next_link = kwargs.get('next_link', None) -class CarrierDetails(msrest.serialization.Model): - """Represents carrier details. - - :param name: Name of carrier details. - :type name: str - :param localized_name: Display name of carrier details. - :type localized_name: str - """ +class CommunicationError(msrest.serialization.Model): + """The Communication Services error. - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'localized_name': {'key': 'localizedName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CarrierDetails, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.localized_name = kwargs.get('localized_name', None) - - -class CreateSearchOptions(msrest.serialization.Model): - """Represents a search creation option. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param display_name: Required. Display name of the search. - :type display_name: str - :param description: Required. Description of the search. - :type description: str - :param phone_plan_ids: Required. The plan subtype ids from which to create the search. - :type phone_plan_ids: list[str] - :param area_code: Required. The area code from which to create the search. - :type area_code: str - :param quantity: The quantity of phone numbers to request. - :type quantity: int - :param location_options: The location options of the search. - :type location_options: list[~azure.communication.phonenumbers.models.LocationOptionsDetails] - """ - - _validation = { - 'display_name': {'required': True, 'max_length': 255, 'min_length': 0}, - 'description': {'required': True, 'max_length': 255, 'min_length': 0}, - 'phone_plan_ids': {'required': True}, - 'area_code': {'required': True}, - 'quantity': {'maximum': 2147483647, 'minimum': 1}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'phone_plan_ids': {'key': 'phonePlanIds', 'type': '[str]'}, - 'area_code': {'key': 'areaCode', 'type': 'str'}, - 'quantity': {'key': 'quantity', 'type': 'int'}, - 'location_options': {'key': 'locationOptions', 'type': '[LocationOptionsDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateSearchOptions, self).__init__(**kwargs) - self.display_name = kwargs['display_name'] - self.description = kwargs['description'] - self.phone_plan_ids = kwargs['phone_plan_ids'] - self.area_code = kwargs['area_code'] - self.quantity = kwargs.get('quantity', None) - self.location_options = kwargs.get('location_options', None) - - -class CreateSearchResponse(msrest.serialization.Model): - """Represents a search creation response. - - All required parameters must be populated in order to send to Azure. - - :param search_id: Required. The search id of the search that was created. - :type search_id: str - """ - - _validation = { - 'search_id': {'required': True}, - } - - _attribute_map = { - 'search_id': {'key': 'searchId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CreateSearchResponse, self).__init__(**kwargs) - self.search_id = kwargs['search_id'] - - -class ErrorBody(msrest.serialization.Model): - """Represents a service error response body. - - :param code: The error code in the error response. + :param code: Required. The error code. :type code: str - :param message: The error message in the error response. + :param message: Required. The error message. :type message: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorBody, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - - -class ErrorResponse(msrest.serialization.Model): - """Represents a service error response. - - :param error: Represents a service error response body. - :type error: ~azure.communication.phonenumbers.models.ErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorBody'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class LocationOptions(msrest.serialization.Model): - """Represents a location options. - - :param label_id: The label id of the location. - :type label_id: str - :param label_name: The display name of the location. - :type label_name: str - :param options: The underlying location option details. - :type options: list[~azure.communication.phonenumbers.models.LocationOptionsDetails] - """ - - _attribute_map = { - 'label_id': {'key': 'labelId', 'type': 'str'}, - 'label_name': {'key': 'labelName', 'type': 'str'}, - 'options': {'key': 'options', 'type': '[LocationOptionsDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(LocationOptions, self).__init__(**kwargs) - self.label_id = kwargs.get('label_id', None) - self.label_name = kwargs.get('label_name', None) - self.options = kwargs.get('options', None) - - -class LocationOptionsDetails(msrest.serialization.Model): - """Represents location options details. - - :param name: The name of the location options. - :type name: str - :param value: The abbreviated name of the location options. - :type value: str - :param location_options: The underlying location options. - :type location_options: list[~azure.communication.phonenumbers.models.LocationOptions] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'location_options': {'key': 'locationOptions', 'type': '[LocationOptions]'}, - } - - def __init__( - self, - **kwargs - ): - super(LocationOptionsDetails, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.value = kwargs.get('value', None) - self.location_options = kwargs.get('location_options', None) - - -class LocationOptionsQueries(msrest.serialization.Model): - """Represents a list of location option queries, used for fetching area codes. - - :param location_options: Represents the underlying list of countries. - :type location_options: list[~azure.communication.phonenumbers.models.LocationOptionsQuery] - """ - - _attribute_map = { - 'location_options': {'key': 'locationOptions', 'type': '[LocationOptionsQuery]'}, - } - - def __init__( - self, - **kwargs - ): - super(LocationOptionsQueries, self).__init__(**kwargs) - self.location_options = kwargs.get('location_options', None) - - -class LocationOptionsQuery(msrest.serialization.Model): - """Represents a location options parameter, used for fetching area codes. - - :param label_id: Represents the location option label id, returned from the GetLocationOptions - API. - :type label_id: str - :param options_value: Represents the location options value, returned from the - GetLocationOptions API. - :type options_value: str - """ - - _attribute_map = { - 'label_id': {'key': 'labelId', 'type': 'str'}, - 'options_value': {'key': 'optionsValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LocationOptionsQuery, self).__init__(**kwargs) - self.label_id = kwargs.get('label_id', None) - self.options_value = kwargs.get('options_value', None) - - -class LocationOptionsResponse(msrest.serialization.Model): - """Represents a wrapper around a list of location options. - - :param location_options: Represents a location options. - :type location_options: ~azure.communication.phonenumbers.models.LocationOptions - """ - - _attribute_map = { - 'location_options': {'key': 'locationOptions', 'type': 'LocationOptions'}, - } - - def __init__( - self, - **kwargs - ): - super(LocationOptionsResponse, self).__init__(**kwargs) - self.location_options = kwargs.get('location_options', None) - - -class NumberConfiguration(msrest.serialization.Model): - """Definition for number configuration. - - All required parameters must be populated in order to send to Azure. - - :param pstn_configuration: Required. Definition for pstn number configuration. - :type pstn_configuration: ~azure.communication.phonenumbers.models.PstnConfiguration - :param phone_number: Required. The phone number to configure. - :type phone_number: str + :ivar target: The error target. + :vartype target: str + :ivar details: Further details about specific errors that led to this error. + :vartype details: list[~azure.communication.phonenumbers.models.CommunicationError] + :ivar inner_error: The inner error if any. + :vartype inner_error: ~azure.communication.phonenumbers.models.CommunicationError """ _validation = { - 'pstn_configuration': {'required': True}, - 'phone_number': {'required': True}, + 'code': {'required': True}, + 'message': {'required': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'inner_error': {'readonly': True}, } _attribute_map = { - 'pstn_configuration': {'key': 'pstnConfiguration', 'type': 'PstnConfiguration'}, - 'phone_number': {'key': 'phoneNumber', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CommunicationError]'}, + 'inner_error': {'key': 'innererror', 'type': 'CommunicationError'}, } def __init__( self, **kwargs ): - super(NumberConfiguration, self).__init__(**kwargs) - self.pstn_configuration = kwargs['pstn_configuration'] - self.phone_number = kwargs['phone_number'] + super(CommunicationError, self).__init__(**kwargs) + self.code = kwargs['code'] + self.message = kwargs['message'] + self.target = None + self.details = None + self.inner_error = None -class NumberConfigurationPhoneNumber(msrest.serialization.Model): - """The phone number wrapper representing a number configuration request. +class CommunicationErrorResponse(msrest.serialization.Model): + """The Communication Services error. All required parameters must be populated in order to send to Azure. - :param phone_number: Required. The phone number in the E.164 format. - :type phone_number: str + :param error: Required. The Communication Services error. + :type error: ~azure.communication.phonenumbers.models.CommunicationError """ _validation = { - 'phone_number': {'required': True}, + 'error': {'required': True}, } _attribute_map = { - 'phone_number': {'key': 'phoneNumber', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CommunicationError'}, } def __init__( self, **kwargs ): - super(NumberConfigurationPhoneNumber, self).__init__(**kwargs) - self.phone_number = kwargs['phone_number'] + super(CommunicationErrorResponse, self).__init__(**kwargs) + self.error = kwargs['error'] -class NumberConfigurationResponse(msrest.serialization.Model): - """Definition for number configuration. +class PhoneNumberCapabilities(msrest.serialization.Model): + """Capabilities of a phone number. All required parameters must be populated in order to send to Azure. - :param pstn_configuration: Required. Definition for pstn number configuration. - :type pstn_configuration: ~azure.communication.phonenumbers.models.PstnConfiguration + :param calling: Required. Capability value for calling. Possible values include: "none", + "inbound", "outbound", "inbound+outbound". + :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :param sms: Required. Capability value for SMS. Possible values include: "none", "inbound", + "outbound", "inbound+outbound". + :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue """ _validation = { - 'pstn_configuration': {'required': True}, + 'calling': {'required': True}, + 'sms': {'required': True}, } _attribute_map = { - 'pstn_configuration': {'key': 'pstnConfiguration', 'type': 'PstnConfiguration'}, + 'calling': {'key': 'calling', 'type': 'str'}, + 'sms': {'key': 'sms', 'type': 'str'}, } def __init__( self, **kwargs ): - super(NumberConfigurationResponse, self).__init__(**kwargs) - self.pstn_configuration = kwargs['pstn_configuration'] + super(PhoneNumberCapabilities, self).__init__(**kwargs) + self.calling = kwargs['calling'] + self.sms = kwargs['sms'] -class NumberUpdateCapabilities(msrest.serialization.Model): - """Represents an individual number capabilities update request. +class PhoneNumberCapabilitiesRequest(msrest.serialization.Model): + """Capabilities of a phone number. - :param add: Capabilities to be added to a phone number. - :type add: list[str or ~azure.communication.phonenumbers.models.Capability] - :param remove: Capabilities to be removed from a phone number. - :type remove: list[str or ~azure.communication.phonenumbers.models.Capability] + :param calling: Capability value for calling. Possible values include: "none", "inbound", + "outbound", "inbound+outbound". + :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :param sms: Capability value for SMS. Possible values include: "none", "inbound", "outbound", + "inbound+outbound". + :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue """ _attribute_map = { - 'add': {'key': 'add', 'type': '[str]'}, - 'remove': {'key': 'remove', 'type': '[str]'}, + 'calling': {'key': 'calling', 'type': 'str'}, + 'sms': {'key': 'sms', 'type': 'str'}, } def __init__( self, **kwargs ): - super(NumberUpdateCapabilities, self).__init__(**kwargs) - self.add = kwargs.get('add', None) - self.remove = kwargs.get('remove', None) - - -class PhoneNumberCountries(msrest.serialization.Model): - """Represents a wrapper around a list of countries. + super(PhoneNumberCapabilitiesRequest, self).__init__(**kwargs) + self.calling = kwargs.get('calling', None) + self.sms = kwargs.get('sms', None) - :param countries: Represents the underlying list of countries. - :type countries: list[~azure.communication.phonenumbers.models.PhoneNumberCountry] - :param next_link: Represents the URL link to the next page. - :type next_link: str - """ - - _attribute_map = { - 'countries': {'key': 'countries', 'type': '[PhoneNumberCountry]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PhoneNumberCountries, self).__init__(**kwargs) - self.countries = kwargs.get('countries', None) - self.next_link = kwargs.get('next_link', None) - -class PhoneNumberCountry(msrest.serialization.Model): - """Represents a country. +class PhoneNumberCost(msrest.serialization.Model): + """The incurred cost for a single phone number. All required parameters must be populated in order to send to Azure. - :param localized_name: Required. Represents the name of the country. - :type localized_name: str - :param country_code: Required. Represents the abbreviated name of the country. - :type country_code: str + :param amount: Required. The cost amount. + :type amount: float + :param currency_code: Required. The ISO 4217 currency code for the cost amount, e.g. USD. + :type currency_code: str + :param billing_frequency: Required. The frequency with which the cost gets billed. Possible + values include: "monthly". + :type billing_frequency: str or ~azure.communication.phonenumbers.models.BillingFrequency """ _validation = { - 'localized_name': {'required': True}, - 'country_code': {'required': True}, + 'amount': {'required': True}, + 'currency_code': {'required': True}, + 'billing_frequency': {'required': True}, } _attribute_map = { - 'localized_name': {'key': 'localizedName', 'type': 'str'}, - 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'amount': {'key': 'amount', 'type': 'float'}, + 'currency_code': {'key': 'currencyCode', 'type': 'str'}, + 'billing_frequency': {'key': 'billingFrequency', 'type': 'str'}, } def __init__( self, **kwargs ): - super(PhoneNumberCountry, self).__init__(**kwargs) - self.localized_name = kwargs['localized_name'] - self.country_code = kwargs['country_code'] + super(PhoneNumberCost, self).__init__(**kwargs) + self.amount = kwargs['amount'] + self.currency_code = kwargs['currency_code'] + self.billing_frequency = kwargs['billing_frequency'] -class PhoneNumberEntities(msrest.serialization.Model): - """Represents a list of searches or releases, as part of the response when fetching all searches or releases. +class PhoneNumberOperation(msrest.serialization.Model): + """Long running operation. - :param entities: The underlying list of entities. - :type entities: list[~azure.communication.phonenumbers.models.PhoneNumberEntity] - :param next_link: Represents the URL link to the next page. - :type next_link: str - """ + Variables are only populated by the server, and will be ignored when sending a request. - _attribute_map = { - 'entities': {'key': 'entities', 'type': '[PhoneNumberEntity]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PhoneNumberEntities, self).__init__(**kwargs) - self.entities = kwargs.get('entities', None) - self.next_link = kwargs.get('next_link', None) - - -class PhoneNumberEntity(msrest.serialization.Model): - """Represents a phone number entity, as part of the response when calling get all searches or releases. + All required parameters must be populated in order to send to Azure. - :param id: The id of the entity. It is the search id of a search. It is the release id of a - release. + :param status: Required. Status of operation. Possible values include: "notStarted", "running", + "succeeded", "failed". + :type status: str or ~azure.communication.phonenumbers.models.PhoneNumberOperationStatus + :param resource_location: URL for retrieving the result of the operation, if any. + :type resource_location: str + :param created_date_time: Required. The date that the operation was created. + :type created_date_time: ~datetime.datetime + :param error: The Communication Services error. + :type error: ~azure.communication.phonenumbers.models.CommunicationError + :param id: Required. Id of operation. :type id: str - :param created_at: Date and time the entity is created. - :type created_at: ~datetime.datetime - :param display_name: Name of the entity. - :type display_name: str - :param quantity: Quantity of requested phone numbers in the entity. - :type quantity: int - :param quantity_obtained: Quantity of acquired phone numbers in the entity. - :type quantity_obtained: int - :param status: Status of the entity. - :type status: str - :param foc_date: The Firm Order Confirmation date of the phone number entity. - :type foc_date: ~datetime.datetime - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'quantity': {'key': 'quantity', 'type': 'int'}, - 'quantity_obtained': {'key': 'quantityObtained', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, - 'foc_date': {'key': 'focDate', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(PhoneNumberEntity, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.created_at = kwargs.get('created_at', None) - self.display_name = kwargs.get('display_name', None) - self.quantity = kwargs.get('quantity', None) - self.quantity_obtained = kwargs.get('quantity_obtained', None) - self.status = kwargs.get('status', None) - self.foc_date = kwargs.get('foc_date', None) - - -class PhoneNumberRelease(msrest.serialization.Model): - """Represents a release. - - :param release_id: The id of the release. - :type release_id: str - :param created_at: The creation time of the release. - :type created_at: ~datetime.datetime - :param status: The release status. Possible values include: "Pending", "InProgress", - "Complete", "Failed", "Expired". - :type status: str or ~azure.communication.phonenumbers.models.ReleaseStatus - :param error_message: The underlying error message of a release. - :type error_message: str - :param phone_number_release_status_details: The list of phone numbers in the release, mapped to - its individual statuses. - :type phone_number_release_status_details: dict[str, - ~azure.communication.phonenumbers.models.PhoneNumberReleaseDetails] + :param operation_type: Required. The type of operation, e.g. Search. Possible values include: + "purchase", "releasePhoneNumber", "search", "updatePhoneNumberCapabilities". + :type operation_type: str or ~azure.communication.phonenumbers.models.PhoneNumberOperationType + :ivar last_action_date_time: The most recent date that the operation was changed. + :vartype last_action_date_time: ~datetime.datetime """ - _attribute_map = { - 'release_id': {'key': 'releaseId', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'status': {'key': 'status', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'phone_number_release_status_details': {'key': 'phoneNumberReleaseStatusDetails', 'type': '{PhoneNumberReleaseDetails}'}, + _validation = { + 'status': {'required': True}, + 'created_date_time': {'required': True}, + 'id': {'required': True}, + 'operation_type': {'required': True}, + 'last_action_date_time': {'readonly': True}, } - def __init__( - self, - **kwargs - ): - super(PhoneNumberRelease, self).__init__(**kwargs) - self.release_id = kwargs.get('release_id', None) - self.created_at = kwargs.get('created_at', None) - self.status = kwargs.get('status', None) - self.error_message = kwargs.get('error_message', None) - self.phone_number_release_status_details = kwargs.get('phone_number_release_status_details', None) - - -class PhoneNumberReleaseDetails(msrest.serialization.Model): - """PhoneNumberReleaseDetails. - - :param status: The release status of a phone number. Possible values include: "Pending", - "Success", "Error", "InProgress". - :type status: str or ~azure.communication.phonenumbers.models.PhoneNumberReleaseStatus - :param error_code: The error code in the case the status is error. - :type error_code: int - """ - _attribute_map = { 'status': {'key': 'status', 'type': 'str'}, - 'error_code': {'key': 'errorCode', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(PhoneNumberReleaseDetails, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.error_code = kwargs.get('error_code', None) - - -class PhoneNumberReservation(msrest.serialization.Model): - """Represents a phone number search. - - :param reservation_id: The id of the search. - :type reservation_id: str - :param display_name: The name of the search. - :type display_name: str - :param created_at: The creation time of the search. - :type created_at: ~datetime.datetime - :param description: The description of the search. - :type description: str - :param phone_plan_ids: The phone plan ids of the search. - :type phone_plan_ids: list[str] - :param area_code: The area code of the search. - :type area_code: str - :param quantity: The quantity of phone numbers in the search. - :type quantity: int - :param location_options: The location options of the search. - :type location_options: list[~azure.communication.phonenumbers.models.LocationOptionsDetails] - :param status: The status of the search. Possible values include: "Pending", "InProgress", - "Reserved", "Expired", "Expiring", "Completing", "Refreshing", "Success", "Manual", - "Cancelled", "Cancelling", "Error", "PurchasePending". - :type status: str or ~azure.communication.phonenumbers.models.SearchStatus - :param phone_numbers: The list of phone numbers in the search, in the case the status is - reserved or success. - :type phone_numbers: list[str] - :param reservation_expiry_date: The date that search expires and the numbers become available. - :type reservation_expiry_date: ~datetime.datetime - :param error_code: The error code of the search. - :type error_code: int - """ - - _attribute_map = { - 'reservation_id': {'key': 'searchId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'description': {'key': 'description', 'type': 'str'}, - 'phone_plan_ids': {'key': 'phonePlanIds', 'type': '[str]'}, - 'area_code': {'key': 'areaCode', 'type': 'str'}, - 'quantity': {'key': 'quantity', 'type': 'int'}, - 'location_options': {'key': 'locationOptions', 'type': '[LocationOptionsDetails]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'phone_numbers': {'key': 'phoneNumbers', 'type': '[str]'}, - 'reservation_expiry_date': {'key': 'reservationExpiryDate', 'type': 'iso-8601'}, - 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'resource_location': {'key': 'resourceLocation', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'CommunicationError'}, + 'id': {'key': 'id', 'type': 'str'}, + 'operation_type': {'key': 'operationType', 'type': 'str'}, + 'last_action_date_time': {'key': 'lastActionDateTime', 'type': 'iso-8601'}, } def __init__( self, **kwargs ): - super(PhoneNumberReservation, self).__init__(**kwargs) - self.reservation_id = kwargs.get('reservation_id', None) - self.display_name = kwargs.get('display_name', None) - self.created_at = kwargs.get('created_at', None) - self.description = kwargs.get('description', None) - self.phone_plan_ids = kwargs.get('phone_plan_ids', None) - self.area_code = kwargs.get('area_code', None) - self.quantity = kwargs.get('quantity', None) - self.location_options = kwargs.get('location_options', None) - self.status = kwargs.get('status', None) - self.phone_numbers = kwargs.get('phone_numbers', None) - self.reservation_expiry_date = kwargs.get('reservation_expiry_date', None) - self.error_code = kwargs.get('error_code', None) - + super(PhoneNumberOperation, self).__init__(**kwargs) + self.status = kwargs['status'] + self.resource_location = kwargs.get('resource_location', None) + self.created_date_time = kwargs['created_date_time'] + self.error = kwargs.get('error', None) + self.id = kwargs['id'] + self.operation_type = kwargs['operation_type'] + self.last_action_date_time = None -class PhonePlan(msrest.serialization.Model): - """Represents a phone plan. - All required parameters must be populated in order to send to Azure. +class PhoneNumberPurchaseRequest(msrest.serialization.Model): + """The phone number search purchase request. - :param phone_plan_id: Required. The phone plan id. - :type phone_plan_id: str - :param localized_name: Required. The name of the phone plan. - :type localized_name: str - :param location_type: Required. The location type of the phone plan. Possible values include: - "CivicAddress", "NotRequired", "Selection". - :type location_type: str or ~azure.communication.phonenumbers.models.LocationType - :param area_codes: The list of available area codes in the phone plan. - :type area_codes: list[str] - :param capabilities: Capabilities of the phone plan. - :type capabilities: list[str or ~azure.communication.phonenumbers.models.Capability] - :param maximum_search_size: The maximum number of phone numbers one can acquire in a search in - this phone plan. - :type maximum_search_size: int + :param search_id: The search id. + :type search_id: str """ - _validation = { - 'phone_plan_id': {'required': True}, - 'localized_name': {'required': True}, - 'location_type': {'required': True}, - } - _attribute_map = { - 'phone_plan_id': {'key': 'phonePlanId', 'type': 'str'}, - 'localized_name': {'key': 'localizedName', 'type': 'str'}, - 'location_type': {'key': 'locationType', 'type': 'str'}, - 'area_codes': {'key': 'areaCodes', 'type': '[str]'}, - 'capabilities': {'key': 'capabilities', 'type': '[str]'}, - 'maximum_search_size': {'key': 'maximumSearchSize', 'type': 'int'}, + 'search_id': {'key': 'searchId', 'type': 'str'}, } def __init__( self, **kwargs ): - super(PhonePlan, self).__init__(**kwargs) - self.phone_plan_id = kwargs['phone_plan_id'] - self.localized_name = kwargs['localized_name'] - self.location_type = kwargs['location_type'] - self.area_codes = kwargs.get('area_codes', None) - self.capabilities = kwargs.get('capabilities', None) - self.maximum_search_size = kwargs.get('maximum_search_size', None) + super(PhoneNumberPurchaseRequest, self).__init__(**kwargs) + self.search_id = kwargs.get('search_id', None) -class PhonePlanGroup(msrest.serialization.Model): - """Represents a plan group. +class PhoneNumberSearchRequest(msrest.serialization.Model): + """Represents a phone number search request to find phone numbers. Found phone numbers are temporarily held for a following purchase. All required parameters must be populated in order to send to Azure. - :param phone_plan_group_id: Required. The id of the plan group. - :type phone_plan_group_id: str - :param phone_number_type: The phone number type of the plan group. Possible values include: - "Unknown", "Geographic", "TollFree", "Indirect". + :param phone_number_type: Required. The type of phone numbers to search for, e.g. geographic, + or tollFree. Possible values include: "geographic", "tollFree". :type phone_number_type: str or ~azure.communication.phonenumbers.models.PhoneNumberType - :param localized_name: Required. The name of the plan group. - :type localized_name: str - :param localized_description: Required. The description of the plan group. - :type localized_description: str - :param carrier_details: Represents carrier details. - :type carrier_details: ~azure.communication.phonenumbers.models.CarrierDetails - :param rate_information: Represents a wrapper of rate information. - :type rate_information: ~azure.communication.phonenumbers.models.RateInformation + :param assignment_type: Required. The assignment type of the phone numbers to search for. A + phone number can be assigned to a person, or to an application. Possible values include: + "user", "application". + :type assignment_type: str or + ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType + :param capabilities: Required. Capabilities of a phone number. + :type capabilities: ~azure.communication.phonenumbers.models.PhoneNumberCapabilities + :param area_code: The area code of the desired phone number, e.g. 425. + :type area_code: str + :param quantity: The quantity of desired phone numbers. The default value is 1. + :type quantity: int """ _validation = { - 'phone_plan_group_id': {'required': True}, - 'localized_name': {'required': True}, - 'localized_description': {'required': True}, + 'phone_number_type': {'required': True}, + 'assignment_type': {'required': True}, + 'capabilities': {'required': True}, + 'quantity': {'maximum': 2147483647, 'minimum': 1}, } _attribute_map = { - 'phone_plan_group_id': {'key': 'phonePlanGroupId', 'type': 'str'}, 'phone_number_type': {'key': 'phoneNumberType', 'type': 'str'}, - 'localized_name': {'key': 'localizedName', 'type': 'str'}, - 'localized_description': {'key': 'localizedDescription', 'type': 'str'}, - 'carrier_details': {'key': 'carrierDetails', 'type': 'CarrierDetails'}, - 'rate_information': {'key': 'rateInformation', 'type': 'RateInformation'}, - } - - def __init__( - self, - **kwargs - ): - super(PhonePlanGroup, self).__init__(**kwargs) - self.phone_plan_group_id = kwargs['phone_plan_group_id'] - self.phone_number_type = kwargs.get('phone_number_type', None) - self.localized_name = kwargs['localized_name'] - self.localized_description = kwargs['localized_description'] - self.carrier_details = kwargs.get('carrier_details', None) - self.rate_information = kwargs.get('rate_information', None) - - -class PhonePlanGroups(msrest.serialization.Model): - """Represents a wrapper of list of plan groups. - - :param phone_plan_groups: The underlying list of phone plan groups. - :type phone_plan_groups: list[~azure.communication.phonenumbers.models.PhonePlanGroup] - :param next_link: Represents the URL link to the next page. - :type next_link: str - """ - - _attribute_map = { - 'phone_plan_groups': {'key': 'phonePlanGroups', 'type': '[PhonePlanGroup]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PhonePlanGroups, self).__init__(**kwargs) - self.phone_plan_groups = kwargs.get('phone_plan_groups', None) - self.next_link = kwargs.get('next_link', None) - - -class PhonePlansResponse(msrest.serialization.Model): - """Represents a wrapper around a list of countries. - - :param phone_plans: Represents the underlying list of phone plans. - :type phone_plans: list[~azure.communication.phonenumbers.models.PhonePlan] - :param next_link: Represents the URL link to the next page. - :type next_link: str - """ - - _attribute_map = { - 'phone_plans': {'key': 'phonePlans', 'type': '[PhonePlan]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PhonePlansResponse, self).__init__(**kwargs) - self.phone_plans = kwargs.get('phone_plans', None) - self.next_link = kwargs.get('next_link', None) - - -class PstnConfiguration(msrest.serialization.Model): - """Definition for pstn number configuration. - - All required parameters must be populated in order to send to Azure. - - :param callback_url: Required. The webhook URL on the phone number configuration. - :type callback_url: str - :param application_id: The application id of the application to which to configure. - :type application_id: str - """ - - _validation = { - 'callback_url': {'required': True}, - } - - _attribute_map = { - 'callback_url': {'key': 'callbackUrl', 'type': 'str'}, - 'application_id': {'key': 'applicationId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PstnConfiguration, self).__init__(**kwargs) - self.callback_url = kwargs['callback_url'] - self.application_id = kwargs.get('application_id', None) - - -class RateInformation(msrest.serialization.Model): - """Represents a wrapper of rate information. - - :param monthly_rate: The monthly rate of a phone plan group. - :type monthly_rate: float - :param currency_type: The currency of a phone plan group. Possible values include: "USD". - :type currency_type: str or ~azure.communication.phonenumbers.models.CurrencyType - :param rate_error_message: The error code of a phone plan group. - :type rate_error_message: str - """ - - _attribute_map = { - 'monthly_rate': {'key': 'monthlyRate', 'type': 'float'}, - 'currency_type': {'key': 'currencyType', 'type': 'str'}, - 'rate_error_message': {'key': 'rateErrorMessage', 'type': 'str'}, + 'assignment_type': {'key': 'assignmentType', 'type': 'str'}, + 'capabilities': {'key': 'capabilities', 'type': 'PhoneNumberCapabilities'}, + 'area_code': {'key': 'areaCode', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'int'}, } def __init__( self, **kwargs ): - super(RateInformation, self).__init__(**kwargs) - self.monthly_rate = kwargs.get('monthly_rate', None) - self.currency_type = kwargs.get('currency_type', None) - self.rate_error_message = kwargs.get('rate_error_message', None) + super(PhoneNumberSearchRequest, self).__init__(**kwargs) + self.phone_number_type = kwargs['phone_number_type'] + self.assignment_type = kwargs['assignment_type'] + self.capabilities = kwargs['capabilities'] + self.area_code = kwargs.get('area_code', None) + self.quantity = kwargs.get('quantity', 1) -class ReleaseRequest(msrest.serialization.Model): - """Represents a release request. +class PhoneNumberSearchResult(msrest.serialization.Model): + """The result of a phone number search operation. All required parameters must be populated in order to send to Azure. - :param phone_numbers: Required. The list of phone numbers in the release request. + :param search_id: Required. The search id. + :type search_id: str + :param phone_numbers: Required. The phone numbers that are available. Can be fewer than the + desired search quantity. :type phone_numbers: list[str] + :param phone_number_type: Required. The phone number's type, e.g. geographic, or tollFree. + Possible values include: "geographic", "tollFree". + :type phone_number_type: str or ~azure.communication.phonenumbers.models.PhoneNumberType + :param assignment_type: Required. Phone number's assignment type. Possible values include: + "user", "application". + :type assignment_type: str or + ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType + :param capabilities: Required. Capabilities of a phone number. + :type capabilities: ~azure.communication.phonenumbers.models.PhoneNumberCapabilities + :param cost: The incurred cost for a single phone number. + :type cost: ~azure.communication.phonenumbers.models.PhoneNumberCost + :param search_expires_by: The date that this search result expires and phone numbers are no + longer on hold. A search result expires in less than 15min, e.g. 2020-11-19T16:31:49.048Z. + :type search_expires_by: ~datetime.datetime """ _validation = { + 'search_id': {'required': True}, 'phone_numbers': {'required': True}, + 'phone_number_type': {'required': True}, + 'assignment_type': {'required': True}, + 'capabilities': {'required': True}, } _attribute_map = { + 'search_id': {'key': 'searchId', 'type': 'str'}, 'phone_numbers': {'key': 'phoneNumbers', 'type': '[str]'}, + 'phone_number_type': {'key': 'phoneNumberType', 'type': 'str'}, + 'assignment_type': {'key': 'assignmentType', 'type': 'str'}, + 'capabilities': {'key': 'capabilities', 'type': 'PhoneNumberCapabilities'}, + 'cost': {'key': 'cost', 'type': 'PhoneNumberCost'}, + 'search_expires_by': {'key': 'searchExpiresBy', 'type': 'iso-8601'}, } def __init__( self, **kwargs ): - super(ReleaseRequest, self).__init__(**kwargs) + super(PhoneNumberSearchResult, self).__init__(**kwargs) + self.search_id = kwargs['search_id'] self.phone_numbers = kwargs['phone_numbers'] - - -class ReleaseResponse(msrest.serialization.Model): - """Represents a release response. - - All required parameters must be populated in order to send to Azure. - - :param release_id: Required. The release id of a created release. - :type release_id: str - """ - - _validation = { - 'release_id': {'required': True}, - } - - _attribute_map = { - 'release_id': {'key': 'releaseId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ReleaseResponse, self).__init__(**kwargs) - self.release_id = kwargs['release_id'] - - -class UpdateNumberCapabilitiesRequest(msrest.serialization.Model): - """Represents a numbers capabilities update request. - - All required parameters must be populated in order to send to Azure. - - :param phone_number_capabilities_update: Required. The map of phone numbers to the capabilities - update applied to the phone number. - :type phone_number_capabilities_update: dict[str, - ~azure.communication.phonenumbers.models.NumberUpdateCapabilities] - """ - - _validation = { - 'phone_number_capabilities_update': {'required': True}, - } - - _attribute_map = { - 'phone_number_capabilities_update': {'key': 'phoneNumberCapabilitiesUpdate', 'type': '{NumberUpdateCapabilities}'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateNumberCapabilitiesRequest, self).__init__(**kwargs) - self.phone_number_capabilities_update = kwargs['phone_number_capabilities_update'] - - -class UpdateNumberCapabilitiesResponse(msrest.serialization.Model): - """Represents a number capability update response. - - All required parameters must be populated in order to send to Azure. - - :param capabilities_update_id: Required. The capabilities id. - :type capabilities_update_id: str - """ - - _validation = { - 'capabilities_update_id': {'required': True}, - } - - _attribute_map = { - 'capabilities_update_id': {'key': 'capabilitiesUpdateId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UpdateNumberCapabilitiesResponse, self).__init__(**kwargs) - self.capabilities_update_id = kwargs['capabilities_update_id'] - - -class UpdatePhoneNumberCapabilitiesResponse(msrest.serialization.Model): - """Response for getting a phone number update capabilities. - - :param capabilities_update_id: The id of the phone number capabilities update. - :type capabilities_update_id: str - :param created_at: The time the capabilities update was created. - :type created_at: ~datetime.datetime - :param capabilities_update_status: Status of the capabilities update. Possible values include: - "Pending", "InProgress", "Complete", "Error". - :type capabilities_update_status: str or - ~azure.communication.phonenumbers.models.CapabilitiesUpdateStatus - :param phone_number_capabilities_updates: The capabilities update for each of a set of phone - numbers. - :type phone_number_capabilities_updates: dict[str, - ~azure.communication.phonenumbers.models.NumberUpdateCapabilities] + self.phone_number_type = kwargs['phone_number_type'] + self.assignment_type = kwargs['assignment_type'] + self.capabilities = kwargs['capabilities'] + self.cost = kwargs.get('cost', None) + self.search_expires_by = kwargs.get('search_expires_by', None) + + +class PhoneNumberUpdateRequest(msrest.serialization.Model): + """Property updates for a phone number. + + :param callback_uri: The webhook for receiving incoming events. + e.g. "https://{{site-name}}.azurewebsites.net/api/updates". + Please read https://docs.microsoft.com/en-us/azure/communication-services/concepts/event- + handling + for integration with Azure Event Grid to deliver real-time event notifications. + :type callback_uri: str + :param application_id: The application id of the application to which to configure. + :type application_id: str """ _attribute_map = { - 'capabilities_update_id': {'key': 'capabilitiesUpdateId', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'capabilities_update_status': {'key': 'capabilitiesUpdateStatus', 'type': 'str'}, - 'phone_number_capabilities_updates': {'key': 'phoneNumberCapabilitiesUpdates', 'type': '{NumberUpdateCapabilities}'}, + 'callback_uri': {'key': 'callbackUri', 'type': 'str'}, + 'application_id': {'key': 'applicationId', 'type': 'str'}, } def __init__( self, **kwargs ): - super(UpdatePhoneNumberCapabilitiesResponse, self).__init__(**kwargs) - self.capabilities_update_id = kwargs.get('capabilities_update_id', None) - self.created_at = kwargs.get('created_at', None) - self.capabilities_update_status = kwargs.get('capabilities_update_status', None) - self.phone_number_capabilities_updates = kwargs.get('phone_number_capabilities_updates', None) + super(PhoneNumberUpdateRequest, self).__init__(**kwargs) + self.callback_uri = kwargs.get('callback_uri', None) + self.application_id = kwargs.get('application_id', None) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py index f9c9a56de98d..5d7471897454 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py @@ -7,12 +7,12 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._phone_number_administration_service_enums import * +from ._phone_numbers_client_enums import * class AcquiredPhoneNumber(msrest.serialization.Model): @@ -20,70 +20,99 @@ class AcquiredPhoneNumber(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param phone_number: Required. String of the E.164 format of the phone number. + :param id: Required. The id of the phone number, e.g. 11234567890. + :type id: str + :param phone_number: Required. String of the E.164 format of the phone number, e.g. + +11234567890. :type phone_number: str - :param acquired_capabilities: Required. The set of all acquired capabilities of the phone - number. - :type acquired_capabilities: list[str or ~azure.communication.phonenumbers.models.Capability] - :param available_capabilities: Required. The set of all available capabilities that can be - acquired for this phone number. - :type available_capabilities: list[str or ~azure.communication.phonenumbers.models.Capability] - :param assignment_status: The assignment status of the phone number. Conveys what type of - entity the number is assigned to. Possible values include: "Unassigned", "Unknown", - "UserAssigned", "ConferenceAssigned", "FirstPartyAppAssigned", "ThirdPartyAppAssigned". - :type assignment_status: str or ~azure.communication.phonenumbers.models.AssignmentStatus - :param place_name: The name of the place of the phone number. - :type place_name: str - :param activation_state: The activation state of the phone number. Can be "Activated", - "AssignmentPending", "AssignmentFailed", "UpdatePending", "UpdateFailed". Possible values - include: "Activated", "AssignmentPending", "AssignmentFailed", "UpdatePending", "UpdateFailed". - :type activation_state: str or ~azure.communication.phonenumbers.models.ActivationState + :param country_code: Required. The ISO 3166-2 code of the phone number's country, e.g. US. + :type country_code: str + :param phone_number_type: Required. The phone number's type, e.g. Geographic, TollFree. + Possible values include: "geographic", "tollFree". + :type phone_number_type: str or ~azure.communication.phonenumbers.models.PhoneNumberType + :param capabilities: Required. Capabilities of a phone number. + :type capabilities: ~azure.communication.phonenumbers.models.PhoneNumberCapabilities + :param assignment_type: Required. The assignment type of the phone number. A phone number can + be assigned to a person, or to an application. Possible values include: "user", "application". + :type assignment_type: str or + ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType + :param purchase_date: The date and time that the phone number was purchased. + :type purchase_date: ~datetime.datetime + :param callback_uri: The webhook for receiving incoming events, e.g. https://{{site- + name}}.azurewebsites.net/api/updates. + :type callback_uri: str + :param application_id: The application id of the server application the phone number is + assigned to. The property is empty if the phone number is assigned to a person. + :type application_id: str + :param cost: The incurred cost for a single phone number. + :type cost: ~azure.communication.phonenumbers.models.PhoneNumberCost """ _validation = { + 'id': {'required': True}, 'phone_number': {'required': True}, - 'acquired_capabilities': {'required': True}, - 'available_capabilities': {'required': True}, + 'country_code': {'required': True}, + 'phone_number_type': {'required': True}, + 'capabilities': {'required': True}, + 'assignment_type': {'required': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'phone_number': {'key': 'phoneNumber', 'type': 'str'}, - 'acquired_capabilities': {'key': 'acquiredCapabilities', 'type': '[str]'}, - 'available_capabilities': {'key': 'availableCapabilities', 'type': '[str]'}, - 'assignment_status': {'key': 'assignmentStatus', 'type': 'str'}, - 'place_name': {'key': 'placeName', 'type': 'str'}, - 'activation_state': {'key': 'activationState', 'type': 'str'}, + 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'phone_number_type': {'key': 'phoneNumberType', 'type': 'str'}, + 'capabilities': {'key': 'capabilities', 'type': 'PhoneNumberCapabilities'}, + 'assignment_type': {'key': 'assignmentType', 'type': 'str'}, + 'purchase_date': {'key': 'purchaseDate', 'type': 'iso-8601'}, + 'callback_uri': {'key': 'callbackUri', 'type': 'str'}, + 'application_id': {'key': 'applicationId', 'type': 'str'}, + 'cost': {'key': 'cost', 'type': 'PhoneNumberCost'}, } def __init__( self, *, + id: str, phone_number: str, - acquired_capabilities: List[Union[str, "Capability"]], - available_capabilities: List[Union[str, "Capability"]], - assignment_status: Optional[Union[str, "AssignmentStatus"]] = None, - place_name: Optional[str] = None, - activation_state: Optional[Union[str, "ActivationState"]] = None, + country_code: str, + phone_number_type: Union[str, "PhoneNumberType"], + capabilities: "PhoneNumberCapabilities", + assignment_type: Union[str, "PhoneNumberAssignmentType"], + purchase_date: Optional[datetime.datetime] = None, + callback_uri: Optional[str] = None, + application_id: Optional[str] = None, + cost: Optional["PhoneNumberCost"] = None, **kwargs ): super(AcquiredPhoneNumber, self).__init__(**kwargs) + self.id = id self.phone_number = phone_number - self.acquired_capabilities = acquired_capabilities - self.available_capabilities = available_capabilities - self.assignment_status = assignment_status - self.place_name = place_name - self.activation_state = activation_state + self.country_code = country_code + self.phone_number_type = phone_number_type + self.capabilities = capabilities + self.assignment_type = assignment_type + self.purchase_date = purchase_date + self.callback_uri = callback_uri + self.application_id = application_id + self.cost = cost class AcquiredPhoneNumbers(msrest.serialization.Model): - """A wrapper of list of phone numbers. + """The list of acquired phone numbers. + + All required parameters must be populated in order to send to Azure. - :param phone_numbers: Represents a list of phone numbers. + :param phone_numbers: Required. Represents a list of phone numbers. :type phone_numbers: list[~azure.communication.phonenumbers.models.AcquiredPhoneNumber] - :param next_link: Represents the URL link to the next page. + :param next_link: Represents the URL link to the next page of phone number results. :type next_link: str """ + _validation = { + 'phone_numbers': {'required': True}, + } + _attribute_map = { 'phone_numbers': {'key': 'phoneNumbers', 'type': '[AcquiredPhoneNumber]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, @@ -92,7 +121,7 @@ class AcquiredPhoneNumbers(msrest.serialization.Model): def __init__( self, *, - phone_numbers: Optional[List["AcquiredPhoneNumber"]] = None, + phone_numbers: List["AcquiredPhoneNumber"], next_link: Optional[str] = None, **kwargs ): @@ -101,1096 +130,416 @@ def __init__( self.next_link = next_link -class AreaCodes(msrest.serialization.Model): - """Represents a list of area codes. +class CommunicationError(msrest.serialization.Model): + """The Communication Services error. - :param primary_area_codes: Represents the list of primary area codes. - :type primary_area_codes: list[str] - :param secondary_area_codes: Represents the list of secondary area codes. - :type secondary_area_codes: list[str] - :param next_link: Represents the URL link to the next page. - :type next_link: str - """ - - _attribute_map = { - 'primary_area_codes': {'key': 'primaryAreaCodes', 'type': '[str]'}, - 'secondary_area_codes': {'key': 'secondaryAreaCodes', 'type': '[str]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - primary_area_codes: Optional[List[str]] = None, - secondary_area_codes: Optional[List[str]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(AreaCodes, self).__init__(**kwargs) - self.primary_area_codes = primary_area_codes - self.secondary_area_codes = secondary_area_codes - self.next_link = next_link - - -class CarrierDetails(msrest.serialization.Model): - """Represents carrier details. - - :param name: Name of carrier details. - :type name: str - :param localized_name: Display name of carrier details. - :type localized_name: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'localized_name': {'key': 'localizedName', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - localized_name: Optional[str] = None, - **kwargs - ): - super(CarrierDetails, self).__init__(**kwargs) - self.name = name - self.localized_name = localized_name - - -class CreateSearchOptions(msrest.serialization.Model): - """Represents a search creation option. + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :param display_name: Required. Display name of the search. - :type display_name: str - :param description: Required. Description of the search. - :type description: str - :param phone_plan_ids: Required. The plan subtype ids from which to create the search. - :type phone_plan_ids: list[str] - :param area_code: Required. The area code from which to create the search. - :type area_code: str - :param quantity: The quantity of phone numbers to request. - :type quantity: int - :param location_options: The location options of the search. - :type location_options: list[~azure.communication.phonenumbers.models.LocationOptionsDetails] - """ - - _validation = { - 'display_name': {'required': True, 'max_length': 255, 'min_length': 0}, - 'description': {'required': True, 'max_length': 255, 'min_length': 0}, - 'phone_plan_ids': {'required': True}, - 'area_code': {'required': True}, - 'quantity': {'maximum': 2147483647, 'minimum': 1}, - } - - _attribute_map = { - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'phone_plan_ids': {'key': 'phonePlanIds', 'type': '[str]'}, - 'area_code': {'key': 'areaCode', 'type': 'str'}, - 'quantity': {'key': 'quantity', 'type': 'int'}, - 'location_options': {'key': 'locationOptions', 'type': '[LocationOptionsDetails]'}, - } - - def __init__( - self, - *, - display_name: str, - description: str, - phone_plan_ids: List[str], - area_code: str, - quantity: Optional[int] = None, - location_options: Optional[List["LocationOptionsDetails"]] = None, - **kwargs - ): - super(CreateSearchOptions, self).__init__(**kwargs) - self.display_name = display_name - self.description = description - self.phone_plan_ids = phone_plan_ids - self.area_code = area_code - self.quantity = quantity - self.location_options = location_options - - -class CreateSearchResponse(msrest.serialization.Model): - """Represents a search creation response. - - All required parameters must be populated in order to send to Azure. - - :param search_id: Required. The search id of the search that was created. - :type search_id: str + :param code: Required. The error code. + :type code: str + :param message: Required. The error message. + :type message: str + :ivar target: The error target. + :vartype target: str + :ivar details: Further details about specific errors that led to this error. + :vartype details: list[~azure.communication.phonenumbers.models.CommunicationError] + :ivar inner_error: The inner error if any. + :vartype inner_error: ~azure.communication.phonenumbers.models.CommunicationError """ _validation = { - 'search_id': {'required': True}, + 'code': {'required': True}, + 'message': {'required': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'inner_error': {'readonly': True}, } - _attribute_map = { - 'search_id': {'key': 'searchId', 'type': 'str'}, - } - - def __init__( - self, - *, - search_id: str, - **kwargs - ): - super(CreateSearchResponse, self).__init__(**kwargs) - self.search_id = search_id - - -class ErrorBody(msrest.serialization.Model): - """Represents a service error response body. - - :param code: The error code in the error response. - :type code: str - :param message: The error message in the error response. - :type message: str - """ - _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CommunicationError]'}, + 'inner_error': {'key': 'innererror', 'type': 'CommunicationError'}, } def __init__( self, *, - code: Optional[str] = None, - message: Optional[str] = None, + code: str, + message: str, **kwargs ): - super(ErrorBody, self).__init__(**kwargs) + super(CommunicationError, self).__init__(**kwargs) self.code = code self.message = message + self.target = None + self.details = None + self.inner_error = None -class ErrorResponse(msrest.serialization.Model): - """Represents a service error response. - - :param error: Represents a service error response body. - :type error: ~azure.communication.phonenumbers.models.ErrorBody - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorBody'}, - } - - def __init__( - self, - *, - error: Optional["ErrorBody"] = None, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class LocationOptions(msrest.serialization.Model): - """Represents a location options. - - :param label_id: The label id of the location. - :type label_id: str - :param label_name: The display name of the location. - :type label_name: str - :param options: The underlying location option details. - :type options: list[~azure.communication.phonenumbers.models.LocationOptionsDetails] - """ - - _attribute_map = { - 'label_id': {'key': 'labelId', 'type': 'str'}, - 'label_name': {'key': 'labelName', 'type': 'str'}, - 'options': {'key': 'options', 'type': '[LocationOptionsDetails]'}, - } - - def __init__( - self, - *, - label_id: Optional[str] = None, - label_name: Optional[str] = None, - options: Optional[List["LocationOptionsDetails"]] = None, - **kwargs - ): - super(LocationOptions, self).__init__(**kwargs) - self.label_id = label_id - self.label_name = label_name - self.options = options - - -class LocationOptionsDetails(msrest.serialization.Model): - """Represents location options details. - - :param name: The name of the location options. - :type name: str - :param value: The abbreviated name of the location options. - :type value: str - :param location_options: The underlying location options. - :type location_options: list[~azure.communication.phonenumbers.models.LocationOptions] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'location_options': {'key': 'locationOptions', 'type': '[LocationOptions]'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - value: Optional[str] = None, - location_options: Optional[List["LocationOptions"]] = None, - **kwargs - ): - super(LocationOptionsDetails, self).__init__(**kwargs) - self.name = name - self.value = value - self.location_options = location_options - - -class LocationOptionsQueries(msrest.serialization.Model): - """Represents a list of location option queries, used for fetching area codes. - - :param location_options: Represents the underlying list of countries. - :type location_options: list[~azure.communication.phonenumbers.models.LocationOptionsQuery] - """ - - _attribute_map = { - 'location_options': {'key': 'locationOptions', 'type': '[LocationOptionsQuery]'}, - } - - def __init__( - self, - *, - location_options: Optional[List["LocationOptionsQuery"]] = None, - **kwargs - ): - super(LocationOptionsQueries, self).__init__(**kwargs) - self.location_options = location_options - - -class LocationOptionsQuery(msrest.serialization.Model): - """Represents a location options parameter, used for fetching area codes. - - :param label_id: Represents the location option label id, returned from the GetLocationOptions - API. - :type label_id: str - :param options_value: Represents the location options value, returned from the - GetLocationOptions API. - :type options_value: str - """ - - _attribute_map = { - 'label_id': {'key': 'labelId', 'type': 'str'}, - 'options_value': {'key': 'optionsValue', 'type': 'str'}, - } - - def __init__( - self, - *, - label_id: Optional[str] = None, - options_value: Optional[str] = None, - **kwargs - ): - super(LocationOptionsQuery, self).__init__(**kwargs) - self.label_id = label_id - self.options_value = options_value - - -class LocationOptionsResponse(msrest.serialization.Model): - """Represents a wrapper around a list of location options. - - :param location_options: Represents a location options. - :type location_options: ~azure.communication.phonenumbers.models.LocationOptions - """ - - _attribute_map = { - 'location_options': {'key': 'locationOptions', 'type': 'LocationOptions'}, - } - - def __init__( - self, - *, - location_options: Optional["LocationOptions"] = None, - **kwargs - ): - super(LocationOptionsResponse, self).__init__(**kwargs) - self.location_options = location_options - - -class NumberConfiguration(msrest.serialization.Model): - """Definition for number configuration. - - All required parameters must be populated in order to send to Azure. - - :param pstn_configuration: Required. Definition for pstn number configuration. - :type pstn_configuration: ~azure.communication.phonenumbers.models.PstnConfiguration - :param phone_number: Required. The phone number to configure. - :type phone_number: str - """ - - _validation = { - 'pstn_configuration': {'required': True}, - 'phone_number': {'required': True}, - } - - _attribute_map = { - 'pstn_configuration': {'key': 'pstnConfiguration', 'type': 'PstnConfiguration'}, - 'phone_number': {'key': 'phoneNumber', 'type': 'str'}, - } - - def __init__( - self, - *, - pstn_configuration: "PstnConfiguration", - phone_number: str, - **kwargs - ): - super(NumberConfiguration, self).__init__(**kwargs) - self.pstn_configuration = pstn_configuration - self.phone_number = phone_number - - -class NumberConfigurationPhoneNumber(msrest.serialization.Model): - """The phone number wrapper representing a number configuration request. +class CommunicationErrorResponse(msrest.serialization.Model): + """The Communication Services error. All required parameters must be populated in order to send to Azure. - :param phone_number: Required. The phone number in the E.164 format. - :type phone_number: str + :param error: Required. The Communication Services error. + :type error: ~azure.communication.phonenumbers.models.CommunicationError """ _validation = { - 'phone_number': {'required': True}, + 'error': {'required': True}, } _attribute_map = { - 'phone_number': {'key': 'phoneNumber', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'CommunicationError'}, } def __init__( self, *, - phone_number: str, + error: "CommunicationError", **kwargs ): - super(NumberConfigurationPhoneNumber, self).__init__(**kwargs) - self.phone_number = phone_number + super(CommunicationErrorResponse, self).__init__(**kwargs) + self.error = error -class NumberConfigurationResponse(msrest.serialization.Model): - """Definition for number configuration. +class PhoneNumberCapabilities(msrest.serialization.Model): + """Capabilities of a phone number. All required parameters must be populated in order to send to Azure. - :param pstn_configuration: Required. Definition for pstn number configuration. - :type pstn_configuration: ~azure.communication.phonenumbers.models.PstnConfiguration + :param calling: Required. Capability value for calling. Possible values include: "none", + "inbound", "outbound", "inbound+outbound". + :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :param sms: Required. Capability value for SMS. Possible values include: "none", "inbound", + "outbound", "inbound+outbound". + :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue """ _validation = { - 'pstn_configuration': {'required': True}, - } - - _attribute_map = { - 'pstn_configuration': {'key': 'pstnConfiguration', 'type': 'PstnConfiguration'}, + 'calling': {'required': True}, + 'sms': {'required': True}, } - def __init__( - self, - *, - pstn_configuration: "PstnConfiguration", - **kwargs - ): - super(NumberConfigurationResponse, self).__init__(**kwargs) - self.pstn_configuration = pstn_configuration - - -class NumberUpdateCapabilities(msrest.serialization.Model): - """Represents an individual number capabilities update request. - - :param add: Capabilities to be added to a phone number. - :type add: list[str or ~azure.communication.phonenumbers.models.Capability] - :param remove: Capabilities to be removed from a phone number. - :type remove: list[str or ~azure.communication.phonenumbers.models.Capability] - """ - _attribute_map = { - 'add': {'key': 'add', 'type': '[str]'}, - 'remove': {'key': 'remove', 'type': '[str]'}, + 'calling': {'key': 'calling', 'type': 'str'}, + 'sms': {'key': 'sms', 'type': 'str'}, } def __init__( self, *, - add: Optional[List[Union[str, "Capability"]]] = None, - remove: Optional[List[Union[str, "Capability"]]] = None, + calling: Union[str, "PhoneNumberCapabilityValue"], + sms: Union[str, "PhoneNumberCapabilityValue"], **kwargs ): - super(NumberUpdateCapabilities, self).__init__(**kwargs) - self.add = add - self.remove = remove + super(PhoneNumberCapabilities, self).__init__(**kwargs) + self.calling = calling + self.sms = sms -class PhoneNumberCountries(msrest.serialization.Model): - """Represents a wrapper around a list of countries. +class PhoneNumberCapabilitiesRequest(msrest.serialization.Model): + """Capabilities of a phone number. - :param countries: Represents the underlying list of countries. - :type countries: list[~azure.communication.phonenumbers.models.PhoneNumberCountry] - :param next_link: Represents the URL link to the next page. - :type next_link: str + :param calling: Capability value for calling. Possible values include: "none", "inbound", + "outbound", "inbound+outbound". + :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :param sms: Capability value for SMS. Possible values include: "none", "inbound", "outbound", + "inbound+outbound". + :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue """ _attribute_map = { - 'countries': {'key': 'countries', 'type': '[PhoneNumberCountry]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'calling': {'key': 'calling', 'type': 'str'}, + 'sms': {'key': 'sms', 'type': 'str'}, } def __init__( self, *, - countries: Optional[List["PhoneNumberCountry"]] = None, - next_link: Optional[str] = None, + calling: Optional[Union[str, "PhoneNumberCapabilityValue"]] = None, + sms: Optional[Union[str, "PhoneNumberCapabilityValue"]] = None, **kwargs ): - super(PhoneNumberCountries, self).__init__(**kwargs) - self.countries = countries - self.next_link = next_link + super(PhoneNumberCapabilitiesRequest, self).__init__(**kwargs) + self.calling = calling + self.sms = sms -class PhoneNumberCountry(msrest.serialization.Model): - """Represents a country. +class PhoneNumberCost(msrest.serialization.Model): + """The incurred cost for a single phone number. All required parameters must be populated in order to send to Azure. - :param localized_name: Required. Represents the name of the country. - :type localized_name: str - :param country_code: Required. Represents the abbreviated name of the country. - :type country_code: str + :param amount: Required. The cost amount. + :type amount: float + :param currency_code: Required. The ISO 4217 currency code for the cost amount, e.g. USD. + :type currency_code: str + :param billing_frequency: Required. The frequency with which the cost gets billed. Possible + values include: "monthly". + :type billing_frequency: str or ~azure.communication.phonenumbers.models.BillingFrequency """ _validation = { - 'localized_name': {'required': True}, - 'country_code': {'required': True}, + 'amount': {'required': True}, + 'currency_code': {'required': True}, + 'billing_frequency': {'required': True}, } _attribute_map = { - 'localized_name': {'key': 'localizedName', 'type': 'str'}, - 'country_code': {'key': 'countryCode', 'type': 'str'}, + 'amount': {'key': 'amount', 'type': 'float'}, + 'currency_code': {'key': 'currencyCode', 'type': 'str'}, + 'billing_frequency': {'key': 'billingFrequency', 'type': 'str'}, } def __init__( self, *, - localized_name: str, - country_code: str, + amount: float, + currency_code: str, + billing_frequency: Union[str, "BillingFrequency"], **kwargs ): - super(PhoneNumberCountry, self).__init__(**kwargs) - self.localized_name = localized_name - self.country_code = country_code + super(PhoneNumberCost, self).__init__(**kwargs) + self.amount = amount + self.currency_code = currency_code + self.billing_frequency = billing_frequency -class PhoneNumberEntities(msrest.serialization.Model): - """Represents a list of searches or releases, as part of the response when fetching all searches or releases. - - :param entities: The underlying list of entities. - :type entities: list[~azure.communication.phonenumbers.models.PhoneNumberEntity] - :param next_link: Represents the URL link to the next page. - :type next_link: str - """ +class PhoneNumberOperation(msrest.serialization.Model): + """Long running operation. - _attribute_map = { - 'entities': {'key': 'entities', 'type': '[PhoneNumberEntity]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } + Variables are only populated by the server, and will be ignored when sending a request. - def __init__( - self, - *, - entities: Optional[List["PhoneNumberEntity"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(PhoneNumberEntities, self).__init__(**kwargs) - self.entities = entities - self.next_link = next_link - - -class PhoneNumberEntity(msrest.serialization.Model): - """Represents a phone number entity, as part of the response when calling get all searches or releases. + All required parameters must be populated in order to send to Azure. - :param id: The id of the entity. It is the search id of a search. It is the release id of a - release. + :param status: Required. Status of operation. Possible values include: "notStarted", "running", + "succeeded", "failed". + :type status: str or ~azure.communication.phonenumbers.models.PhoneNumberOperationStatus + :param resource_location: URL for retrieving the result of the operation, if any. + :type resource_location: str + :param created_date_time: Required. The date that the operation was created. + :type created_date_time: ~datetime.datetime + :param error: The Communication Services error. + :type error: ~azure.communication.phonenumbers.models.CommunicationError + :param id: Required. Id of operation. :type id: str - :param created_at: Date and time the entity is created. - :type created_at: ~datetime.datetime - :param display_name: Name of the entity. - :type display_name: str - :param quantity: Quantity of requested phone numbers in the entity. - :type quantity: int - :param quantity_obtained: Quantity of acquired phone numbers in the entity. - :type quantity_obtained: int - :param status: Status of the entity. - :type status: str - :param foc_date: The Firm Order Confirmation date of the phone number entity. - :type foc_date: ~datetime.datetime + :param operation_type: Required. The type of operation, e.g. Search. Possible values include: + "purchase", "releasePhoneNumber", "search", "updatePhoneNumberCapabilities". + :type operation_type: str or ~azure.communication.phonenumbers.models.PhoneNumberOperationType + :ivar last_action_date_time: The most recent date that the operation was changed. + :vartype last_action_date_time: ~datetime.datetime """ - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'quantity': {'key': 'quantity', 'type': 'int'}, - 'quantity_obtained': {'key': 'quantityObtained', 'type': 'int'}, - 'status': {'key': 'status', 'type': 'str'}, - 'foc_date': {'key': 'focDate', 'type': 'iso-8601'}, + _validation = { + 'status': {'required': True}, + 'created_date_time': {'required': True}, + 'id': {'required': True}, + 'operation_type': {'required': True}, + 'last_action_date_time': {'readonly': True}, } - def __init__( - self, - *, - id: Optional[str] = None, - created_at: Optional[datetime.datetime] = None, - display_name: Optional[str] = None, - quantity: Optional[int] = None, - quantity_obtained: Optional[int] = None, - status: Optional[str] = None, - foc_date: Optional[datetime.datetime] = None, - **kwargs - ): - super(PhoneNumberEntity, self).__init__(**kwargs) - self.id = id - self.created_at = created_at - self.display_name = display_name - self.quantity = quantity - self.quantity_obtained = quantity_obtained - self.status = status - self.foc_date = foc_date - - -class PhoneNumberRelease(msrest.serialization.Model): - """Represents a release. - - :param release_id: The id of the release. - :type release_id: str - :param created_at: The creation time of the release. - :type created_at: ~datetime.datetime - :param status: The release status. Possible values include: "Pending", "InProgress", - "Complete", "Failed", "Expired". - :type status: str or ~azure.communication.phonenumbers.models.ReleaseStatus - :param error_message: The underlying error message of a release. - :type error_message: str - :param phone_number_release_status_details: The list of phone numbers in the release, mapped to - its individual statuses. - :type phone_number_release_status_details: dict[str, - ~azure.communication.phonenumbers.models.PhoneNumberReleaseDetails] - """ - _attribute_map = { - 'release_id': {'key': 'releaseId', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'str'}, - 'error_message': {'key': 'errorMessage', 'type': 'str'}, - 'phone_number_release_status_details': {'key': 'phoneNumberReleaseStatusDetails', 'type': '{PhoneNumberReleaseDetails}'}, + 'resource_location': {'key': 'resourceLocation', 'type': 'str'}, + 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, + 'error': {'key': 'error', 'type': 'CommunicationError'}, + 'id': {'key': 'id', 'type': 'str'}, + 'operation_type': {'key': 'operationType', 'type': 'str'}, + 'last_action_date_time': {'key': 'lastActionDateTime', 'type': 'iso-8601'}, } def __init__( self, *, - release_id: Optional[str] = None, - created_at: Optional[datetime.datetime] = None, - status: Optional[Union[str, "ReleaseStatus"]] = None, - error_message: Optional[str] = None, - phone_number_release_status_details: Optional[Dict[str, "PhoneNumberReleaseDetails"]] = None, + status: Union[str, "PhoneNumberOperationStatus"], + created_date_time: datetime.datetime, + id: str, + operation_type: Union[str, "PhoneNumberOperationType"], + resource_location: Optional[str] = None, + error: Optional["CommunicationError"] = None, **kwargs ): - super(PhoneNumberRelease, self).__init__(**kwargs) - self.release_id = release_id - self.created_at = created_at + super(PhoneNumberOperation, self).__init__(**kwargs) self.status = status - self.error_message = error_message - self.phone_number_release_status_details = phone_number_release_status_details - - -class PhoneNumberReleaseDetails(msrest.serialization.Model): - """PhoneNumberReleaseDetails. + self.resource_location = resource_location + self.created_date_time = created_date_time + self.error = error + self.id = id + self.operation_type = operation_type + self.last_action_date_time = None - :param status: The release status of a phone number. Possible values include: "Pending", - "Success", "Error", "InProgress". - :type status: str or ~azure.communication.phonenumbers.models.PhoneNumberReleaseStatus - :param error_code: The error code in the case the status is error. - :type error_code: int - """ - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'error_code': {'key': 'errorCode', 'type': 'int'}, - } +class PhoneNumberPurchaseRequest(msrest.serialization.Model): + """The phone number search purchase request. - def __init__( - self, - *, - status: Optional[Union[str, "PhoneNumberReleaseStatus"]] = None, - error_code: Optional[int] = None, - **kwargs - ): - super(PhoneNumberReleaseDetails, self).__init__(**kwargs) - self.status = status - self.error_code = error_code - - -class PhoneNumberReservation(msrest.serialization.Model): - """Represents a phone number search. - - :param reservation_id: The id of the search. - :type reservation_id: str - :param display_name: The name of the search. - :type display_name: str - :param created_at: The creation time of the search. - :type created_at: ~datetime.datetime - :param description: The description of the search. - :type description: str - :param phone_plan_ids: The phone plan ids of the search. - :type phone_plan_ids: list[str] - :param area_code: The area code of the search. - :type area_code: str - :param quantity: The quantity of phone numbers in the search. - :type quantity: int - :param location_options: The location options of the search. - :type location_options: list[~azure.communication.phonenumbers.models.LocationOptionsDetails] - :param status: The status of the search. Possible values include: "Pending", "InProgress", - "Reserved", "Expired", "Expiring", "Completing", "Refreshing", "Success", "Manual", - "Cancelled", "Cancelling", "Error", "PurchasePending". - :type status: str or ~azure.communication.phonenumbers.models.SearchStatus - :param phone_numbers: The list of phone numbers in the search, in the case the status is - reserved or success. - :type phone_numbers: list[str] - :param reservation_expiry_date: The date that search expires and the numbers become available. - :type reservation_expiry_date: ~datetime.datetime - :param error_code: The error code of the search. - :type error_code: int + :param search_id: The search id. + :type search_id: str """ _attribute_map = { - 'reservation_id': {'key': 'searchId', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'description': {'key': 'description', 'type': 'str'}, - 'phone_plan_ids': {'key': 'phonePlanIds', 'type': '[str]'}, - 'area_code': {'key': 'areaCode', 'type': 'str'}, - 'quantity': {'key': 'quantity', 'type': 'int'}, - 'location_options': {'key': 'locationOptions', 'type': '[LocationOptionsDetails]'}, - 'status': {'key': 'status', 'type': 'str'}, - 'phone_numbers': {'key': 'phoneNumbers', 'type': '[str]'}, - 'reservation_expiry_date': {'key': 'reservationExpiryDate', 'type': 'iso-8601'}, - 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'search_id': {'key': 'searchId', 'type': 'str'}, } def __init__( self, *, - reservation_id: Optional[str] = None, - display_name: Optional[str] = None, - created_at: Optional[datetime.datetime] = None, - description: Optional[str] = None, - phone_plan_ids: Optional[List[str]] = None, - area_code: Optional[str] = None, - quantity: Optional[int] = None, - location_options: Optional[List["LocationOptionsDetails"]] = None, - status: Optional[Union[str, "SearchStatus"]] = None, - phone_numbers: Optional[List[str]] = None, - reservation_expiry_date: Optional[datetime.datetime] = None, - error_code: Optional[int] = None, + search_id: Optional[str] = None, **kwargs ): - super(PhoneNumberReservation, self).__init__(**kwargs) - self.reservation_id = reservation_id - self.display_name = display_name - self.created_at = created_at - self.description = description - self.phone_plan_ids = phone_plan_ids - self.area_code = area_code - self.quantity = quantity - self.location_options = location_options - self.status = status - self.phone_numbers = phone_numbers - self.reservation_expiry_date = reservation_expiry_date - self.error_code = error_code + super(PhoneNumberPurchaseRequest, self).__init__(**kwargs) + self.search_id = search_id -class PhonePlan(msrest.serialization.Model): - """Represents a phone plan. +class PhoneNumberSearchRequest(msrest.serialization.Model): + """Represents a phone number search request to find phone numbers. Found phone numbers are temporarily held for a following purchase. All required parameters must be populated in order to send to Azure. - :param phone_plan_id: Required. The phone plan id. - :type phone_plan_id: str - :param localized_name: Required. The name of the phone plan. - :type localized_name: str - :param location_type: Required. The location type of the phone plan. Possible values include: - "CivicAddress", "NotRequired", "Selection". - :type location_type: str or ~azure.communication.phonenumbers.models.LocationType - :param area_codes: The list of available area codes in the phone plan. - :type area_codes: list[str] - :param capabilities: Capabilities of the phone plan. - :type capabilities: list[str or ~azure.communication.phonenumbers.models.Capability] - :param maximum_search_size: The maximum number of phone numbers one can acquire in a search in - this phone plan. - :type maximum_search_size: int + :param phone_number_type: Required. The type of phone numbers to search for, e.g. geographic, + or tollFree. Possible values include: "geographic", "tollFree". + :type phone_number_type: str or ~azure.communication.phonenumbers.models.PhoneNumberType + :param assignment_type: Required. The assignment type of the phone numbers to search for. A + phone number can be assigned to a person, or to an application. Possible values include: + "user", "application". + :type assignment_type: str or + ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType + :param capabilities: Required. Capabilities of a phone number. + :type capabilities: ~azure.communication.phonenumbers.models.PhoneNumberCapabilities + :param area_code: The area code of the desired phone number, e.g. 425. + :type area_code: str + :param quantity: The quantity of desired phone numbers. The default value is 1. + :type quantity: int """ _validation = { - 'phone_plan_id': {'required': True}, - 'localized_name': {'required': True}, - 'location_type': {'required': True}, + 'phone_number_type': {'required': True}, + 'assignment_type': {'required': True}, + 'capabilities': {'required': True}, + 'quantity': {'maximum': 2147483647, 'minimum': 1}, } _attribute_map = { - 'phone_plan_id': {'key': 'phonePlanId', 'type': 'str'}, - 'localized_name': {'key': 'localizedName', 'type': 'str'}, - 'location_type': {'key': 'locationType', 'type': 'str'}, - 'area_codes': {'key': 'areaCodes', 'type': '[str]'}, - 'capabilities': {'key': 'capabilities', 'type': '[str]'}, - 'maximum_search_size': {'key': 'maximumSearchSize', 'type': 'int'}, + 'phone_number_type': {'key': 'phoneNumberType', 'type': 'str'}, + 'assignment_type': {'key': 'assignmentType', 'type': 'str'}, + 'capabilities': {'key': 'capabilities', 'type': 'PhoneNumberCapabilities'}, + 'area_code': {'key': 'areaCode', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'int'}, } def __init__( self, *, - phone_plan_id: str, - localized_name: str, - location_type: Union[str, "LocationType"], - area_codes: Optional[List[str]] = None, - capabilities: Optional[List[Union[str, "Capability"]]] = None, - maximum_search_size: Optional[int] = None, + phone_number_type: Union[str, "PhoneNumberType"], + assignment_type: Union[str, "PhoneNumberAssignmentType"], + capabilities: "PhoneNumberCapabilities", + area_code: Optional[str] = None, + quantity: Optional[int] = 1, **kwargs ): - super(PhonePlan, self).__init__(**kwargs) - self.phone_plan_id = phone_plan_id - self.localized_name = localized_name - self.location_type = location_type - self.area_codes = area_codes + super(PhoneNumberSearchRequest, self).__init__(**kwargs) + self.phone_number_type = phone_number_type + self.assignment_type = assignment_type self.capabilities = capabilities - self.maximum_search_size = maximum_search_size + self.area_code = area_code + self.quantity = quantity -class PhonePlanGroup(msrest.serialization.Model): - """Represents a plan group. +class PhoneNumberSearchResult(msrest.serialization.Model): + """The result of a phone number search operation. All required parameters must be populated in order to send to Azure. - :param phone_plan_group_id: Required. The id of the plan group. - :type phone_plan_group_id: str - :param phone_number_type: The phone number type of the plan group. Possible values include: - "Unknown", "Geographic", "TollFree", "Indirect". + :param search_id: Required. The search id. + :type search_id: str + :param phone_numbers: Required. The phone numbers that are available. Can be fewer than the + desired search quantity. + :type phone_numbers: list[str] + :param phone_number_type: Required. The phone number's type, e.g. geographic, or tollFree. + Possible values include: "geographic", "tollFree". :type phone_number_type: str or ~azure.communication.phonenumbers.models.PhoneNumberType - :param localized_name: Required. The name of the plan group. - :type localized_name: str - :param localized_description: Required. The description of the plan group. - :type localized_description: str - :param carrier_details: Represents carrier details. - :type carrier_details: ~azure.communication.phonenumbers.models.CarrierDetails - :param rate_information: Represents a wrapper of rate information. - :type rate_information: ~azure.communication.phonenumbers.models.RateInformation + :param assignment_type: Required. Phone number's assignment type. Possible values include: + "user", "application". + :type assignment_type: str or + ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType + :param capabilities: Required. Capabilities of a phone number. + :type capabilities: ~azure.communication.phonenumbers.models.PhoneNumberCapabilities + :param cost: The incurred cost for a single phone number. + :type cost: ~azure.communication.phonenumbers.models.PhoneNumberCost + :param search_expires_by: The date that this search result expires and phone numbers are no + longer on hold. A search result expires in less than 15min, e.g. 2020-11-19T16:31:49.048Z. + :type search_expires_by: ~datetime.datetime """ _validation = { - 'phone_plan_group_id': {'required': True}, - 'localized_name': {'required': True}, - 'localized_description': {'required': True}, + 'search_id': {'required': True}, + 'phone_numbers': {'required': True}, + 'phone_number_type': {'required': True}, + 'assignment_type': {'required': True}, + 'capabilities': {'required': True}, } _attribute_map = { - 'phone_plan_group_id': {'key': 'phonePlanGroupId', 'type': 'str'}, + 'search_id': {'key': 'searchId', 'type': 'str'}, + 'phone_numbers': {'key': 'phoneNumbers', 'type': '[str]'}, 'phone_number_type': {'key': 'phoneNumberType', 'type': 'str'}, - 'localized_name': {'key': 'localizedName', 'type': 'str'}, - 'localized_description': {'key': 'localizedDescription', 'type': 'str'}, - 'carrier_details': {'key': 'carrierDetails', 'type': 'CarrierDetails'}, - 'rate_information': {'key': 'rateInformation', 'type': 'RateInformation'}, + 'assignment_type': {'key': 'assignmentType', 'type': 'str'}, + 'capabilities': {'key': 'capabilities', 'type': 'PhoneNumberCapabilities'}, + 'cost': {'key': 'cost', 'type': 'PhoneNumberCost'}, + 'search_expires_by': {'key': 'searchExpiresBy', 'type': 'iso-8601'}, } def __init__( self, *, - phone_plan_group_id: str, - localized_name: str, - localized_description: str, - phone_number_type: Optional[Union[str, "PhoneNumberType"]] = None, - carrier_details: Optional["CarrierDetails"] = None, - rate_information: Optional["RateInformation"] = None, + search_id: str, + phone_numbers: List[str], + phone_number_type: Union[str, "PhoneNumberType"], + assignment_type: Union[str, "PhoneNumberAssignmentType"], + capabilities: "PhoneNumberCapabilities", + cost: Optional["PhoneNumberCost"] = None, + search_expires_by: Optional[datetime.datetime] = None, **kwargs ): - super(PhonePlanGroup, self).__init__(**kwargs) - self.phone_plan_group_id = phone_plan_group_id + super(PhoneNumberSearchResult, self).__init__(**kwargs) + self.search_id = search_id + self.phone_numbers = phone_numbers self.phone_number_type = phone_number_type - self.localized_name = localized_name - self.localized_description = localized_description - self.carrier_details = carrier_details - self.rate_information = rate_information - - -class PhonePlanGroups(msrest.serialization.Model): - """Represents a wrapper of list of plan groups. - - :param phone_plan_groups: The underlying list of phone plan groups. - :type phone_plan_groups: list[~azure.communication.phonenumbers.models.PhonePlanGroup] - :param next_link: Represents the URL link to the next page. - :type next_link: str - """ - - _attribute_map = { - 'phone_plan_groups': {'key': 'phonePlanGroups', 'type': '[PhonePlanGroup]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - phone_plan_groups: Optional[List["PhonePlanGroup"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(PhonePlanGroups, self).__init__(**kwargs) - self.phone_plan_groups = phone_plan_groups - self.next_link = next_link - - -class PhonePlansResponse(msrest.serialization.Model): - """Represents a wrapper around a list of countries. - - :param phone_plans: Represents the underlying list of phone plans. - :type phone_plans: list[~azure.communication.phonenumbers.models.PhonePlan] - :param next_link: Represents the URL link to the next page. - :type next_link: str - """ - - _attribute_map = { - 'phone_plans': {'key': 'phonePlans', 'type': '[PhonePlan]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - phone_plans: Optional[List["PhonePlan"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(PhonePlansResponse, self).__init__(**kwargs) - self.phone_plans = phone_plans - self.next_link = next_link - + self.assignment_type = assignment_type + self.capabilities = capabilities + self.cost = cost + self.search_expires_by = search_expires_by -class PstnConfiguration(msrest.serialization.Model): - """Definition for pstn number configuration. - All required parameters must be populated in order to send to Azure. +class PhoneNumberUpdateRequest(msrest.serialization.Model): + """Property updates for a phone number. - :param callback_url: Required. The webhook URL on the phone number configuration. - :type callback_url: str + :param callback_uri: The webhook for receiving incoming events. + e.g. "https://{{site-name}}.azurewebsites.net/api/updates". + Please read https://docs.microsoft.com/en-us/azure/communication-services/concepts/event- + handling + for integration with Azure Event Grid to deliver real-time event notifications. + :type callback_uri: str :param application_id: The application id of the application to which to configure. :type application_id: str """ - _validation = { - 'callback_url': {'required': True}, - } - _attribute_map = { - 'callback_url': {'key': 'callbackUrl', 'type': 'str'}, + 'callback_uri': {'key': 'callbackUri', 'type': 'str'}, 'application_id': {'key': 'applicationId', 'type': 'str'}, } def __init__( self, *, - callback_url: str, + callback_uri: Optional[str] = None, application_id: Optional[str] = None, **kwargs ): - super(PstnConfiguration, self).__init__(**kwargs) - self.callback_url = callback_url + super(PhoneNumberUpdateRequest, self).__init__(**kwargs) + self.callback_uri = callback_uri self.application_id = application_id - - -class RateInformation(msrest.serialization.Model): - """Represents a wrapper of rate information. - - :param monthly_rate: The monthly rate of a phone plan group. - :type monthly_rate: float - :param currency_type: The currency of a phone plan group. Possible values include: "USD". - :type currency_type: str or ~azure.communication.phonenumbers.models.CurrencyType - :param rate_error_message: The error code of a phone plan group. - :type rate_error_message: str - """ - - _attribute_map = { - 'monthly_rate': {'key': 'monthlyRate', 'type': 'float'}, - 'currency_type': {'key': 'currencyType', 'type': 'str'}, - 'rate_error_message': {'key': 'rateErrorMessage', 'type': 'str'}, - } - - def __init__( - self, - *, - monthly_rate: Optional[float] = None, - currency_type: Optional[Union[str, "CurrencyType"]] = None, - rate_error_message: Optional[str] = None, - **kwargs - ): - super(RateInformation, self).__init__(**kwargs) - self.monthly_rate = monthly_rate - self.currency_type = currency_type - self.rate_error_message = rate_error_message - - -class ReleaseRequest(msrest.serialization.Model): - """Represents a release request. - - All required parameters must be populated in order to send to Azure. - - :param phone_numbers: Required. The list of phone numbers in the release request. - :type phone_numbers: list[str] - """ - - _validation = { - 'phone_numbers': {'required': True}, - } - - _attribute_map = { - 'phone_numbers': {'key': 'phoneNumbers', 'type': '[str]'}, - } - - def __init__( - self, - *, - phone_numbers: List[str], - **kwargs - ): - super(ReleaseRequest, self).__init__(**kwargs) - self.phone_numbers = phone_numbers - - -class ReleaseResponse(msrest.serialization.Model): - """Represents a release response. - - All required parameters must be populated in order to send to Azure. - - :param release_id: Required. The release id of a created release. - :type release_id: str - """ - - _validation = { - 'release_id': {'required': True}, - } - - _attribute_map = { - 'release_id': {'key': 'releaseId', 'type': 'str'}, - } - - def __init__( - self, - *, - release_id: str, - **kwargs - ): - super(ReleaseResponse, self).__init__(**kwargs) - self.release_id = release_id - - -class UpdateNumberCapabilitiesRequest(msrest.serialization.Model): - """Represents a numbers capabilities update request. - - All required parameters must be populated in order to send to Azure. - - :param phone_number_capabilities_update: Required. The map of phone numbers to the capabilities - update applied to the phone number. - :type phone_number_capabilities_update: dict[str, - ~azure.communication.phonenumbers.models.NumberUpdateCapabilities] - """ - - _validation = { - 'phone_number_capabilities_update': {'required': True}, - } - - _attribute_map = { - 'phone_number_capabilities_update': {'key': 'phoneNumberCapabilitiesUpdate', 'type': '{NumberUpdateCapabilities}'}, - } - - def __init__( - self, - *, - phone_number_capabilities_update: Dict[str, "NumberUpdateCapabilities"], - **kwargs - ): - super(UpdateNumberCapabilitiesRequest, self).__init__(**kwargs) - self.phone_number_capabilities_update = phone_number_capabilities_update - - -class UpdateNumberCapabilitiesResponse(msrest.serialization.Model): - """Represents a number capability update response. - - All required parameters must be populated in order to send to Azure. - - :param capabilities_update_id: Required. The capabilities id. - :type capabilities_update_id: str - """ - - _validation = { - 'capabilities_update_id': {'required': True}, - } - - _attribute_map = { - 'capabilities_update_id': {'key': 'capabilitiesUpdateId', 'type': 'str'}, - } - - def __init__( - self, - *, - capabilities_update_id: str, - **kwargs - ): - super(UpdateNumberCapabilitiesResponse, self).__init__(**kwargs) - self.capabilities_update_id = capabilities_update_id - - -class UpdatePhoneNumberCapabilitiesResponse(msrest.serialization.Model): - """Response for getting a phone number update capabilities. - - :param capabilities_update_id: The id of the phone number capabilities update. - :type capabilities_update_id: str - :param created_at: The time the capabilities update was created. - :type created_at: ~datetime.datetime - :param capabilities_update_status: Status of the capabilities update. Possible values include: - "Pending", "InProgress", "Complete", "Error". - :type capabilities_update_status: str or - ~azure.communication.phonenumbers.models.CapabilitiesUpdateStatus - :param phone_number_capabilities_updates: The capabilities update for each of a set of phone - numbers. - :type phone_number_capabilities_updates: dict[str, - ~azure.communication.phonenumbers.models.NumberUpdateCapabilities] - """ - - _attribute_map = { - 'capabilities_update_id': {'key': 'capabilitiesUpdateId', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'capabilities_update_status': {'key': 'capabilitiesUpdateStatus', 'type': 'str'}, - 'phone_number_capabilities_updates': {'key': 'phoneNumberCapabilitiesUpdates', 'type': '{NumberUpdateCapabilities}'}, - } - - def __init__( - self, - *, - capabilities_update_id: Optional[str] = None, - created_at: Optional[datetime.datetime] = None, - capabilities_update_status: Optional[Union[str, "CapabilitiesUpdateStatus"]] = None, - phone_number_capabilities_updates: Optional[Dict[str, "NumberUpdateCapabilities"]] = None, - **kwargs - ): - super(UpdatePhoneNumberCapabilitiesResponse, self).__init__(**kwargs) - self.capabilities_update_id = capabilities_update_id - self.created_at = created_at - self.capabilities_update_status = capabilities_update_status - self.phone_number_capabilities_updates = phone_number_capabilities_updates diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_phone_number_administration_service_enums.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_phone_number_administration_service_enums.py deleted file mode 100644 index 5b53cc8756be..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_phone_number_administration_service_enums.py +++ /dev/null @@ -1,148 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum, EnumMeta -from six import with_metaclass - -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class ActivationState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The activation state of the phone number. Can be "Activated", "AssignmentPending", - "AssignmentFailed", "UpdatePending", "UpdateFailed" - """ - - ACTIVATED = "Activated" - ASSIGNMENT_PENDING = "AssignmentPending" - ASSIGNMENT_FAILED = "AssignmentFailed" - UPDATE_PENDING = "UpdatePending" - UPDATE_FAILED = "UpdateFailed" - -class AssignmentStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The assignment status of the phone number. Conveys what type of entity the number is assigned - to. - """ - - UNASSIGNED = "Unassigned" - UNKNOWN = "Unknown" - USER_ASSIGNED = "UserAssigned" - CONFERENCE_ASSIGNED = "ConferenceAssigned" - FIRST_PARTY_APP_ASSIGNED = "FirstPartyAppAssigned" - THIRD_PARTY_APP_ASSIGNED = "ThirdPartyAppAssigned" - -class CapabilitiesUpdateStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Status of the capabilities update. - """ - - PENDING = "Pending" - IN_PROGRESS = "InProgress" - COMPLETE = "Complete" - ERROR = "Error" - -class Capability(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Represents the capabilities of a phone number. - """ - - USER_ASSIGNMENT = "UserAssignment" - FIRST_PARTY_VOICE_APP_ASSIGNMENT = "FirstPartyVoiceAppAssignment" - CONFERENCE_ASSIGNMENT = "ConferenceAssignment" - P2_P_SMS_ENABLED = "P2PSmsEnabled" - GEOGRAPHIC = "Geographic" - NON_GEOGRAPHIC = "NonGeographic" - TOLL_CALLING = "TollCalling" - TOLL_FREE_CALLING = "TollFreeCalling" - PREMIUM = "Premium" - P2_P_SMS_CAPABLE = "P2PSmsCapable" - A2_P_SMS_CAPABLE = "A2PSmsCapable" - A2_P_SMS_ENABLED = "A2PSmsEnabled" - CALLING = "Calling" - TOLL_FREE = "TollFree" - FIRST_PARTY_APP_ASSIGNMENT = "FirstPartyAppAssignment" - THIRD_PARTY_APP_ASSIGNMENT = "ThirdPartyAppAssignment" - AZURE = "Azure" - OFFICE365 = "Office365" - INBOUND_CALLING = "InboundCalling" - OUTBOUND_CALLING = "OutboundCalling" - INBOUND_A2_P_SMS = "InboundA2PSms" - OUTBOUND_A2_P_SMS = "OutboundA2PSms" - INBOUND_P2_P_SMS = "InboundP2PSms" - OUTBOUND_P2_P_SMS = "OutboundP2PSms" - -class CurrencyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The currency of a phone plan group - """ - - USD = "USD" - -class LocationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The location type of the phone plan. - """ - - CIVIC_ADDRESS = "CivicAddress" - NOT_REQUIRED = "NotRequired" - SELECTION = "Selection" - -class PhoneNumberReleaseStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The release status of a phone number. - """ - - PENDING = "Pending" - SUCCESS = "Success" - ERROR = "Error" - IN_PROGRESS = "InProgress" - -class PhoneNumberType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The phone number type of the plan group - """ - - UNKNOWN = "Unknown" - GEOGRAPHIC = "Geographic" - TOLL_FREE = "TollFree" - INDIRECT = "Indirect" - -class ReleaseStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The release status. - """ - - PENDING = "Pending" - IN_PROGRESS = "InProgress" - COMPLETE = "Complete" - FAILED = "Failed" - EXPIRED = "Expired" - -class SearchStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The status of the search. - """ - - PENDING = "Pending" - IN_PROGRESS = "InProgress" - RESERVED = "Reserved" - EXPIRED = "Expired" - EXPIRING = "Expiring" - COMPLETING = "Completing" - REFRESHING = "Refreshing" - SUCCESS = "Success" - MANUAL = "Manual" - CANCELLED = "Cancelled" - CANCELLING = "Cancelling" - ERROR = "Error" - PURCHASE_PENDING = "PurchasePending" diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_phone_numbers_client_enums.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_phone_numbers_client_enums.py new file mode 100644 index 000000000000..f80e09733e3d --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_phone_numbers_client_enums.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class BillingFrequency(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The frequency with which the cost gets billed. + """ + + MONTHLY = "monthly" + +class PhoneNumberAssignmentType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The assignment type of the phone numbers to search for. A phone number can be assigned to a + person, or to an application. + """ + + USER = "user" + APPLICATION = "application" + +class PhoneNumberCapabilityValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Capability value for calling. + """ + + NONE = "none" + INBOUND = "inbound" + OUTBOUND = "outbound" + INBOUND_OUTBOUND = "inbound+outbound" + +class PhoneNumberOperationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Status of operation. + """ + + NOT_STARTED = "notStarted" + RUNNING = "running" + SUCCEEDED = "succeeded" + FAILED = "failed" + +class PhoneNumberOperationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of operation, e.g. Search + """ + + PURCHASE = "purchase" + RELEASE_PHONE_NUMBER = "releasePhoneNumber" + SEARCH = "search" + UPDATE_PHONE_NUMBER_CAPABILITIES = "updatePhoneNumberCapabilities" + +class PhoneNumberType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of phone numbers to search for, e.g. geographic, or tollFree. + """ + + GEOGRAPHIC = "geographic" + TOLL_FREE = "tollFree" diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/__init__.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/__init__.py index 50478d62d8d6..3da9bcb904f3 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/__init__.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._phone_number_administration_operations import PhoneNumberAdministrationOperations +from ._phone_numbers_operations import PhoneNumbersOperations __all__ = [ - 'PhoneNumberAdministrationOperations', + 'PhoneNumbersOperations', ] diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_number_administration_operations.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_number_administration_operations.py deleted file mode 100644 index 261f60112300..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_number_administration_operations.py +++ /dev/null @@ -1,1421 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class PhoneNumberAdministrationOperations(object): - """PhoneNumberAdministrationOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.communication.phonenumbers.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def get_all_phone_numbers( - self, - locale="en-US", # type: Optional[str] - skip=0, # type: Optional[int] - take=100, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AcquiredPhoneNumbers"] - """Gets the list of the acquired phone numbers. - - Gets the list of the acquired phone numbers. - - :param locale: A language-locale pairing which will be used to localize the names of countries. - :type locale: str - :param skip: An optional parameter for how many entries to skip, for pagination purposes. - :type skip: int - :param take: An optional parameter for how many entries to return, for pagination purposes. - :type take: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AcquiredPhoneNumbers or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.models.AcquiredPhoneNumbers] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AcquiredPhoneNumbers"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.get_all_phone_numbers.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if locale is not None: - query_parameters['locale'] = self._serialize.query("locale", locale, 'str') - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int') - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('AcquiredPhoneNumbers', pipeline_response) - list_of_elem = deserialized.phone_numbers - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - get_all_phone_numbers.metadata = {'url': '/administration/phonenumbers/phonenumbers'} # type: ignore - - def get_all_area_codes( - self, - location_type, # type: str - country_code, # type: str - phone_plan_id, # type: str - location_options=None, # type: Optional[List["_models.LocationOptionsQuery"]] - **kwargs # type: Any - ): - # type: (...) -> "_models.AreaCodes" - """Gets a list of the supported area codes. - - Gets a list of the supported area codes. - - :param location_type: The type of location information required by the plan. - :type location_type: str - :param country_code: The ISO 3166-2 country code. - :type country_code: str - :param phone_plan_id: The plan id from which to search area codes. - :type phone_plan_id: str - :param location_options: Represents the underlying list of countries. - :type location_options: list[~azure.communication.phonenumbers.models.LocationOptionsQuery] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AreaCodes, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.AreaCodes - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AreaCodes"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _body = _models.LocationOptionsQueries(location_options=location_options) - api_version = "2020-07-20-preview1" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.get_all_area_codes.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'countryCode': self._serialize.url("country_code", country_code, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['locationType'] = self._serialize.query("location_type", location_type, 'str') - query_parameters['phonePlanId'] = self._serialize.query("phone_plan_id", phone_plan_id, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if _body is not None: - body_content = self._serialize.body(_body, 'LocationOptionsQueries') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('AreaCodes', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_all_area_codes.metadata = {'url': '/administration/phonenumbers/countries/{countryCode}/areacodes'} # type: ignore - - def get_capabilities_update( - self, - capabilities_update_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.UpdatePhoneNumberCapabilitiesResponse" - """Get capabilities by capabilities update id. - - Get capabilities by capabilities update id. - - :param capabilities_update_id: - :type capabilities_update_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: UpdatePhoneNumberCapabilitiesResponse, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.UpdatePhoneNumberCapabilitiesResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdatePhoneNumberCapabilitiesResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - # Construct URL - url = self.get_capabilities_update.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'capabilitiesUpdateId': self._serialize.url("capabilities_update_id", capabilities_update_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('UpdatePhoneNumberCapabilitiesResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_capabilities_update.metadata = {'url': '/administration/phonenumbers/capabilities/{capabilitiesUpdateId}'} # type: ignore - - def update_capabilities( - self, - phone_number_capabilities_update, # type: Dict[str, "_models.NumberUpdateCapabilities"] - **kwargs # type: Any - ): - # type: (...) -> "_models.UpdateNumberCapabilitiesResponse" - """Adds or removes phone number capabilities. - - Adds or removes phone number capabilities. - - :param phone_number_capabilities_update: The map of phone numbers to the capabilities update - applied to the phone number. - :type phone_number_capabilities_update: dict[str, ~azure.communication.phonenumbers.models.NumberUpdateCapabilities] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: UpdateNumberCapabilitiesResponse, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.UpdateNumberCapabilitiesResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UpdateNumberCapabilitiesResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _body = _models.UpdateNumberCapabilitiesRequest(phone_number_capabilities_update=phone_number_capabilities_update) - api_version = "2020-07-20-preview1" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update_capabilities.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if _body is not None: - body_content = self._serialize.body(_body, 'UpdateNumberCapabilitiesRequest') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('UpdateNumberCapabilitiesResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update_capabilities.metadata = {'url': '/administration/phonenumbers/capabilities'} # type: ignore - - def get_all_supported_countries( - self, - locale="en-US", # type: Optional[str] - skip=0, # type: Optional[int] - take=100, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PhoneNumberCountries"] - """Gets a list of supported countries. - - Gets a list of supported countries. - - :param locale: A language-locale pairing which will be used to localize the names of countries. - :type locale: str - :param skip: An optional parameter for how many entries to skip, for pagination purposes. - :type skip: int - :param take: An optional parameter for how many entries to return, for pagination purposes. - :type take: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PhoneNumberCountries or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.models.PhoneNumberCountries] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberCountries"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.get_all_supported_countries.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if locale is not None: - query_parameters['locale'] = self._serialize.query("locale", locale, 'str') - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int') - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('PhoneNumberCountries', pipeline_response) - list_of_elem = deserialized.countries - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - get_all_supported_countries.metadata = {'url': '/administration/phonenumbers/countries'} # type: ignore - - def get_number_configuration( - self, - phone_number, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NumberConfigurationResponse" - """Endpoint for getting number configurations. - - Endpoint for getting number configurations. - - :param phone_number: The phone number in the E.164 format. - :type phone_number: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NumberConfigurationResponse, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.NumberConfigurationResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NumberConfigurationResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _body = _models.NumberConfigurationPhoneNumber(phone_number=phone_number) - api_version = "2020-07-20-preview1" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.get_number_configuration.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if _body is not None: - body_content = self._serialize.body(_body, 'NumberConfigurationPhoneNumber') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('NumberConfigurationResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_number_configuration.metadata = {'url': '/administration/phonenumbers/numberconfiguration'} # type: ignore - - def configure_number( - self, - pstn_configuration, # type: "_models.PstnConfiguration" - phone_number, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Endpoint for configuring a pstn number. - - Endpoint for configuring a pstn number. - - :param pstn_configuration: Definition for pstn number configuration. - :type pstn_configuration: ~azure.communication.phonenumbers.models.PstnConfiguration - :param phone_number: The phone number to configure. - :type phone_number: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _body = _models.NumberConfiguration(pstn_configuration=pstn_configuration, phone_number=phone_number) - api_version = "2020-07-20-preview1" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.configure_number.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if _body is not None: - body_content = self._serialize.body(_body, 'NumberConfiguration') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - configure_number.metadata = {'url': '/administration/phonenumbers/numberconfiguration/configure'} # type: ignore - - def unconfigure_number( - self, - phone_number, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Endpoint for unconfiguring a pstn number by removing the configuration. - - Endpoint for unconfiguring a pstn number by removing the configuration. - - :param phone_number: The phone number in the E.164 format. - :type phone_number: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _body = _models.NumberConfigurationPhoneNumber(phone_number=phone_number) - api_version = "2020-07-20-preview1" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.unconfigure_number.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if _body is not None: - body_content = self._serialize.body(_body, 'NumberConfigurationPhoneNumber') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - unconfigure_number.metadata = {'url': '/administration/phonenumbers/numberconfiguration/unconfigure'} # type: ignore - - def get_phone_plan_groups( - self, - country_code, # type: str - locale="en-US", # type: Optional[str] - include_rate_information=False, # type: Optional[bool] - skip=0, # type: Optional[int] - take=100, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PhonePlanGroups"] - """Gets a list of phone plan groups for the given country. - - Gets a list of phone plan groups for the given country. - - :param country_code: The ISO 3166-2 country code. - :type country_code: str - :param locale: A language-locale pairing which will be used to localize the names of countries. - :type locale: str - :param include_rate_information: - :type include_rate_information: bool - :param skip: An optional parameter for how many entries to skip, for pagination purposes. - :type skip: int - :param take: An optional parameter for how many entries to return, for pagination purposes. - :type take: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PhonePlanGroups or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.models.PhonePlanGroups] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PhonePlanGroups"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.get_phone_plan_groups.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'countryCode': self._serialize.url("country_code", country_code, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if locale is not None: - query_parameters['locale'] = self._serialize.query("locale", locale, 'str') - if include_rate_information is not None: - query_parameters['includeRateInformation'] = self._serialize.query("include_rate_information", include_rate_information, 'bool') - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int') - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'countryCode': self._serialize.url("country_code", country_code, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('PhonePlanGroups', pipeline_response) - list_of_elem = deserialized.phone_plan_groups - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - get_phone_plan_groups.metadata = {'url': '/administration/phonenumbers/countries/{countryCode}/phoneplangroups'} # type: ignore - - def get_phone_plans( - self, - country_code, # type: str - phone_plan_group_id, # type: str - locale="en-US", # type: Optional[str] - skip=0, # type: Optional[int] - take=100, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PhonePlansResponse"] - """Gets a list of phone plans for a phone plan group. - - Gets a list of phone plans for a phone plan group. - - :param country_code: The ISO 3166-2 country code. - :type country_code: str - :param phone_plan_group_id: - :type phone_plan_group_id: str - :param locale: A language-locale pairing which will be used to localize the names of countries. - :type locale: str - :param skip: An optional parameter for how many entries to skip, for pagination purposes. - :type skip: int - :param take: An optional parameter for how many entries to return, for pagination purposes. - :type take: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PhonePlansResponse or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.models.PhonePlansResponse] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PhonePlansResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.get_phone_plans.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'countryCode': self._serialize.url("country_code", country_code, 'str'), - 'phonePlanGroupId': self._serialize.url("phone_plan_group_id", phone_plan_group_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if locale is not None: - query_parameters['locale'] = self._serialize.query("locale", locale, 'str') - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int') - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'countryCode': self._serialize.url("country_code", country_code, 'str'), - 'phonePlanGroupId': self._serialize.url("phone_plan_group_id", phone_plan_group_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('PhonePlansResponse', pipeline_response) - list_of_elem = deserialized.phone_plans - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - get_phone_plans.metadata = {'url': '/administration/phonenumbers/countries/{countryCode}/phoneplangroups/{phonePlanGroupId}/phoneplans'} # type: ignore - - def get_phone_plan_location_options( - self, - country_code, # type: str - phone_plan_group_id, # type: str - phone_plan_id, # type: str - locale="en-US", # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.LocationOptionsResponse" - """Gets a list of location options for a phone plan. - - Gets a list of location options for a phone plan. - - :param country_code: The ISO 3166-2 country code. - :type country_code: str - :param phone_plan_group_id: - :type phone_plan_group_id: str - :param phone_plan_id: - :type phone_plan_id: str - :param locale: A language-locale pairing which will be used to localize the names of countries. - :type locale: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LocationOptionsResponse, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.LocationOptionsResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LocationOptionsResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - # Construct URL - url = self.get_phone_plan_location_options.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'countryCode': self._serialize.url("country_code", country_code, 'str'), - 'phonePlanGroupId': self._serialize.url("phone_plan_group_id", phone_plan_group_id, 'str'), - 'phonePlanId': self._serialize.url("phone_plan_id", phone_plan_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if locale is not None: - query_parameters['locale'] = self._serialize.query("locale", locale, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('LocationOptionsResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_phone_plan_location_options.metadata = {'url': '/administration/phonenumbers/countries/{countryCode}/phoneplangroups/{phonePlanGroupId}/phoneplans/{phonePlanId}/locationoptions'} # type: ignore - - def get_release_by_id( - self, - release_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PhoneNumberRelease" - """Gets a release by a release id. - - Gets a release by a release id. - - :param release_id: Represents the release id. - :type release_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PhoneNumberRelease, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.PhoneNumberRelease - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberRelease"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - # Construct URL - url = self.get_release_by_id.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'releaseId': self._serialize.url("release_id", release_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('PhoneNumberRelease', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_release_by_id.metadata = {'url': '/administration/phonenumbers/releases/{releaseId}'} # type: ignore - - def release_phone_numbers( - self, - phone_numbers, # type: List[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.ReleaseResponse" - """Creates a release for the given phone numbers. - - Creates a release for the given phone numbers. - - :param phone_numbers: The list of phone numbers in the release request. - :type phone_numbers: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ReleaseResponse, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.ReleaseResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ReleaseResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _body = _models.ReleaseRequest(phone_numbers=phone_numbers) - api_version = "2020-07-20-preview1" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.release_phone_numbers.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if _body is not None: - body_content = self._serialize.body(_body, 'ReleaseRequest') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('ReleaseResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - release_phone_numbers.metadata = {'url': '/administration/phonenumbers/releases'} # type: ignore - - def get_all_releases( - self, - skip=0, # type: Optional[int] - take=100, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PhoneNumberEntities"] - """Gets a list of all releases. - - Gets a list of all releases. - - :param skip: An optional parameter for how many entries to skip, for pagination purposes. - :type skip: int - :param take: An optional parameter for how many entries to return, for pagination purposes. - :type take: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PhoneNumberEntities or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.models.PhoneNumberEntities] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberEntities"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.get_all_releases.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int') - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('PhoneNumberEntities', pipeline_response) - list_of_elem = deserialized.entities - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - get_all_releases.metadata = {'url': '/administration/phonenumbers/releases'} # type: ignore - - def get_search_by_id( - self, - search_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PhoneNumberReservation" - """Get search by search id. - - Get search by search id. - - :param search_id: The search id to be searched for. - :type search_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PhoneNumberReservation, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.PhoneNumberReservation - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberReservation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - # Construct URL - url = self.get_search_by_id.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'searchId': self._serialize.url("search_id", search_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('PhoneNumberReservation', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_search_by_id.metadata = {'url': '/administration/phonenumbers/searches/{searchId}'} # type: ignore - - def create_search( - self, - body=None, # type: Optional["_models.CreateSearchOptions"] - **kwargs # type: Any - ): - # type: (...) -> "_models.CreateSearchResponse" - """Creates a phone number search. - - Creates a phone number search. - - :param body: Defines the search options. - :type body: ~azure.communication.phonenumbers.models.CreateSearchOptions - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CreateSearchResponse, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.CreateSearchResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CreateSearchResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_search.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if body is not None: - body_content = self._serialize.body(body, 'CreateSearchOptions') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('CreateSearchResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_search.metadata = {'url': '/administration/phonenumbers/searches'} # type: ignore - - def get_all_searches( - self, - skip=0, # type: Optional[int] - take=100, # type: Optional[int] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PhoneNumberEntities"] - """Gets a list of all searches. - - Gets a list of all searches. - - :param skip: An optional parameter for how many entries to skip, for pagination purposes. - :type skip: int - :param take: An optional parameter for how many entries to return, for pagination purposes. - :type take: int - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PhoneNumberEntities or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.models.PhoneNumberEntities] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberEntities"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.get_all_searches.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if skip is not None: - query_parameters['skip'] = self._serialize.query("skip", skip, 'int') - if take is not None: - query_parameters['take'] = self._serialize.query("take", take, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('PhoneNumberEntities', pipeline_response) - list_of_elem = deserialized.entities - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - get_all_searches.metadata = {'url': '/administration/phonenumbers/searches'} # type: ignore - - def cancel_search( - self, - search_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Cancels the search. This means existing numbers in the search will be made available. - - Cancels the search. This means existing numbers in the search will be made available. - - :param search_id: The search id to be canceled. - :type search_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - # Construct URL - url = self.cancel_search.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'searchId': self._serialize.url("search_id", search_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - cancel_search.metadata = {'url': '/administration/phonenumbers/searches/{searchId}/cancel'} # type: ignore - - def purchase_search( - self, - search_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Purchases the phone number search. - - Purchases the phone number search. - - :param search_id: The search id to be purchased. - :type search_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-07-20-preview1" - accept = "application/json" - - # Construct URL - url = self.purchase_search.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'searchId': self._serialize.url("search_id", search_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) - - purchase_search.metadata = {'url': '/administration/phonenumbers/searches/{searchId}/purchase'} # type: ignore diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py new file mode 100644 index 000000000000..0d12e3a4fbbb --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py @@ -0,0 +1,944 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.polling.base_polling import LROBasePolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PhoneNumbersOperations(object): + """PhoneNumbersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.communication.phonenumbers.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _search_available_phone_numbers_initial( + self, + country_code, # type: str + body, # type: "_models.PhoneNumberSearchRequest" + **kwargs # type: Any + ): + # type: (...) -> "_models.PhoneNumberSearchResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberSearchResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-07" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._search_available_phone_numbers_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'countryCode': self._serialize.url("country_code", country_code, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(body, 'PhoneNumberSearchRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _search_available_phone_numbers_initial.metadata = {'url': '/availablePhoneNumbers/countries/{countryCode}/:search'} # type: ignore + + def begin_search_available_phone_numbers( + self, + country_code, # type: str + body, # type: "_models.PhoneNumberSearchRequest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PhoneNumberSearchResult"] + """Search for available phone numbers to purchase. + + Search for available phone numbers to purchase. + + :param country_code: The ISO 3166-2 country code, e.g. US. + :type country_code: str + :param body: The phone number search request. + :type body: ~azure.communication.phonenumbers.models.PhoneNumberSearchRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the LROBasePolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PhoneNumberSearchResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.communication.phonenumbers.models.PhoneNumberSearchResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberSearchResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._search_available_phone_numbers_initial( + country_code=country_code, + body=body, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'countryCode': self._serialize.url("country_code", country_code, 'str'), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_search_available_phone_numbers.metadata = {'url': '/availablePhoneNumbers/countries/{countryCode}/:search'} # type: ignore + + def get_search_result( + self, + search_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PhoneNumberSearchResult" + """Gets a phone number search result by search id. + + Gets a phone number search result by search id. + + :param search_id: The search Id. + :type search_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PhoneNumberSearchResult, or the result of cls(response) + :rtype: ~azure.communication.phonenumbers.models.PhoneNumberSearchResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberSearchResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-07" + accept = "application/json" + + # Construct URL + url = self.get_search_result.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'searchId': self._serialize.url("search_id", search_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_search_result.metadata = {'url': '/availablePhoneNumbers/searchResults/{searchId}'} # type: ignore + + def _purchase_phone_numbers_initial( + self, + search_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.PhoneNumberSearchResult" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberSearchResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _body = _models.PhoneNumberPurchaseRequest(search_id=search_id) + api_version = "2021-03-07" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._purchase_phone_numbers_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(_body, 'PhoneNumberPurchaseRequest') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _purchase_phone_numbers_initial.metadata = {'url': '/availablePhoneNumbers/:purchase'} # type: ignore + + def begin_purchase_phone_numbers( + self, + search_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PhoneNumberSearchResult"] + """Purchases phone numbers. + + Purchases phone numbers. + + :param search_id: The search id. + :type search_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the LROBasePolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either PhoneNumberSearchResult or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.communication.phonenumbers.models.PhoneNumberSearchResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberSearchResult"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._purchase_phone_numbers_initial( + search_id=search_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_purchase_phone_numbers.metadata = {'url': '/availablePhoneNumbers/:purchase'} # type: ignore + + def get_operation( + self, + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PhoneNumberOperation" + """Gets an operation by its id. + + Gets an operation by its id. + + :param operation_id: The id of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PhoneNumberOperation, or the result of cls(response) + :rtype: ~azure.communication.phonenumbers.models.PhoneNumberOperation + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberOperation"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-07" + accept = "application/json" + + # Construct URL + url = self.get_operation.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('PhoneNumberOperation', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_operation.metadata = {'url': '/phoneNumbers/operations/{operationId}'} # type: ignore + + def cancel_operation( + self, + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Cancels an operation by its id. + + Cancels an operation by its id. + + :param operation_id: The id of the operation. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-07" + accept = "application/json" + + # Construct URL + url = self.cancel_operation.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + cancel_operation.metadata = {'url': '/phoneNumbers/operations/{operationId}'} # type: ignore + + def get_by_number( + self, + phone_number, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.AcquiredPhoneNumber" + """Gets the details of the given acquired phone number. + + Gets the details of the given acquired phone number. + + :param phone_number: The acquired phone number whose details are to be fetched in E.164 format, + e.g. +11234567890. + :type phone_number: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AcquiredPhoneNumber, or the result of cls(response) + :rtype: ~azure.communication.phonenumbers.models.AcquiredPhoneNumber + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AcquiredPhoneNumber"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-07" + accept = "application/json" + + # Construct URL + url = self.get_by_number.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'phoneNumber': self._serialize.url("phone_number", phone_number, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_by_number.metadata = {'url': '/phoneNumbers/{phoneNumber}'} # type: ignore + + def _release_phone_number_initial( + self, + phone_number, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-07" + accept = "application/json" + + # Construct URL + url = self._release_phone_number_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'phoneNumber': self._serialize.url("phone_number", phone_number, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + + if cls: + return cls(pipeline_response, None, response_headers) + + _release_phone_number_initial.metadata = {'url': '/phoneNumbers/{phoneNumber}'} # type: ignore + + def begin_release_phone_number( + self, + phone_number, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Releases an acquired phone number. + + Releases an acquired phone number. + + :param phone_number: Phone number to be released, e.g. +11234567890. + :type phone_number: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the LROBasePolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._release_phone_number_initial( + phone_number=phone_number, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'phoneNumber': self._serialize.url("phone_number", phone_number, 'str'), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_release_phone_number.metadata = {'url': '/phoneNumbers/{phoneNumber}'} # type: ignore + + def update( + self, + phone_number, # type: str + callback_uri=None, # type: Optional[str] + application_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.AcquiredPhoneNumber" + """Updates the configuration of a phone number. + + Updates the configuration of a phone number. + + :param phone_number: Phone number to be updated, e.g. +11234567890. + :type phone_number: str + :param callback_uri: The webhook for receiving incoming events. + e.g. "https://{{site-name}}.azurewebsites.net/api/updates". + Please read https://docs.microsoft.com/en-us/azure/communication-services/concepts/event- + handling + for integration with Azure Event Grid to deliver real-time event notifications. + :type callback_uri: str + :param application_id: The application id of the application to which to configure. + :type application_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AcquiredPhoneNumber, or the result of cls(response) + :rtype: ~azure.communication.phonenumbers.models.AcquiredPhoneNumber + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AcquiredPhoneNumber"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _body = _models.PhoneNumberUpdateRequest(callback_uri=callback_uri, application_id=application_id) + api_version = "2021-03-07" + content_type = kwargs.pop("content_type", "application/merge-patch+json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'phoneNumber': self._serialize.url("phone_number", phone_number, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if _body is not None: + body_content = self._serialize.body(_body, 'PhoneNumberUpdateRequest') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/phoneNumbers/{phoneNumber}'} # type: ignore + + def list_phone_numbers( + self, + skip=0, # type: Optional[int] + top=100, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AcquiredPhoneNumbers"] + """Gets the list of all acquired phone numbers. + + Gets the list of all acquired phone numbers. + + :param skip: An optional parameter for how many entries to skip, for pagination purposes. The + default value is 0. + :type skip: int + :param top: An optional parameter for how many entries to return, for pagination purposes. The + default value is 100. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AcquiredPhoneNumbers or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.models.AcquiredPhoneNumbers] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AcquiredPhoneNumbers"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-07" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_phone_numbers.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if skip is not None: + query_parameters['skip'] = self._serialize.query("skip", skip, 'int') + if top is not None: + query_parameters['top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AcquiredPhoneNumbers', pipeline_response) + list_of_elem = deserialized.phone_numbers + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_phone_numbers.metadata = {'url': '/phoneNumbers'} # type: ignore + + def _update_capabilities_initial( + self, + phone_number, # type: str + calling=None, # type: Optional[Union[str, "_models.PhoneNumberCapabilityValue"]] + sms=None, # type: Optional[Union[str, "_models.PhoneNumberCapabilityValue"]] + **kwargs # type: Any + ): + # type: (...) -> "_models.AcquiredPhoneNumber" + cls = kwargs.pop('cls', None) # type: ClsType["_models.AcquiredPhoneNumber"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + _body = _models.PhoneNumberCapabilitiesRequest(calling=calling, sms=sms) + api_version = "2021-03-07" + content_type = kwargs.pop("content_type", "application/merge-patch+json") + accept = "application/json" + + # Construct URL + url = self._update_capabilities_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'phoneNumber': self._serialize.url("phone_number", phone_number, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + if _body is not None: + body_content = self._serialize.body(_body, 'PhoneNumberCapabilitiesRequest') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) + raise HttpResponseError(response=response, model=error) + + response_headers = {} + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _update_capabilities_initial.metadata = {'url': '/phoneNumbers/{phoneNumber}/capabilities'} # type: ignore + + def begin_update_capabilities( + self, + phone_number, # type: str + calling=None, # type: Optional[Union[str, "_models.PhoneNumberCapabilityValue"]] + sms=None, # type: Optional[Union[str, "_models.PhoneNumberCapabilityValue"]] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.AcquiredPhoneNumber"] + """Updates the capabilities of a phone number. + + Updates the capabilities of a phone number. + + :param phone_number: The phone number id in E.164 format. The leading plus can be either + or + encoded as %2B, e.g. +11234567890. + :type phone_number: str + :param calling: Capability value for calling. + :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :param sms: Capability value for SMS. + :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the LROBasePolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either AcquiredPhoneNumber or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.communication.phonenumbers.models.AcquiredPhoneNumber] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AcquiredPhoneNumber"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_capabilities_initial( + phone_number=phone_number, + calling=calling, + sms=sms, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + 'phoneNumber': self._serialize.url("phone_number", phone_number, 'str'), + } + + if polling is True: polling_method = LROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_capabilities.metadata = {'url': '/phoneNumbers/{phoneNumber}/capabilities'} # type: ignore diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/py.typed b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_number_administration_client.py deleted file mode 100644 index c2cc15d43596..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_number_administration_client.py +++ /dev/null @@ -1,598 +0,0 @@ -# pylint: disable=R0904 -# coding=utf-8 -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -from azure.communication.phonenumbers._generated.models import ReleaseStatus, CreateSearchOptions -from azure.core.tracing.decorator import distributed_trace -from azure.core.paging import ItemPaged -from azure.core.polling import LROPoller -from ._polling import ReleasePhoneNumberPolling, ReservePhoneNumberPolling, PurchaseReservationPolling - -from ._generated._phone_number_administration_service\ - import PhoneNumberAdministrationService as PhoneNumbersAdministrationClientGen - -from ._generated.models import ( - AcquiredPhoneNumbers, - AreaCodes, - LocationOptionsResponse, - NumberConfigurationResponse, - NumberUpdateCapabilities, - PhoneNumberCountries, - PhoneNumberEntities, - PhoneNumberRelease, - PhoneNumberReservation, - PhonePlanGroups, - PhonePlansResponse, - PstnConfiguration, - SearchStatus, - UpdateNumberCapabilitiesResponse, - UpdatePhoneNumberCapabilitiesResponse -) - -from ._shared.utils import parse_connection_str, get_authentication_policy -from ._version import SDK_MONIKER - -class PhoneNumbersAdministrationClient(object): - """Azure Communication Services Phone Numbers Management client. - - :param str endpoint: - The endpoint url for Azure Communication Service resource. - :param credential: - The credentials with which to authenticate. The value is an account - shared access key - """ - def __init__( - self, - endpoint, # type: str - credential, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - try: - if not endpoint.lower().startswith('http'): - endpoint = "https://" + endpoint - except AttributeError: - raise ValueError("Account URL must be a string.") - - if not credential: - raise ValueError( - "You need to provide account shared key to authenticate.") - - self._endpoint = endpoint - self._phone_number_administration_client = PhoneNumbersAdministrationClientGen( - self._endpoint, - authentication_policy=get_authentication_policy(endpoint, credential), - sdk_moniker=SDK_MONIKER, - **kwargs) - - @classmethod - def from_connection_string( - cls, conn_str, # type: str - **kwargs # type: Any - ): - # type: (...) -> PhoneNumbersAdministrationClient - """Create PhoneNumbersAdministrationClient from a Connection String. - :param str conn_str: - A connection string to an Azure Communication Service resource. - :returns: Instance of PhoneNumbersAdministrationClient. - :rtype: ~azure.communication.PhoneNumbersAdministrationClient - """ - endpoint, access_key = parse_connection_str(conn_str) - - return cls(endpoint, access_key, **kwargs) - - @distributed_trace - def list_all_phone_numbers( - self, - **kwargs # type: Any - ): - # type: (...) -> ItemPaged[AcquiredPhoneNumbers] - """Gets the list of the acquired phone numbers. - - :keyword str locale: A language-locale pairing which will be used to localise the names of countries. - The default is "en-US". - :keyword int skip: An optional parameter for how many entries to skip, for pagination purposes. - The default is 0. - :keyword int take: An optional parameter for how many entries to return, for pagination purposes. - The default is 100. - :rtype: ~azure.core.paging.ItemPaged[~azure.communication.administration.AcquiredPhoneNumbers] - """ - return self._phone_number_administration_client.phone_number_administration.get_all_phone_numbers( - **kwargs - ) - - @distributed_trace - def get_all_area_codes( - self, - location_type, # type: str - country_code, # type: str - phone_plan_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> AreaCodes - """Gets a list of the supported area codes. - - :param location_type: The type of location information required by the plan. - :type location_type: str - :param country_code: The ISO 3166-2 country code. - :type country_code: str - :param phone_plan_id: The plan id from which to search area codes. - :type phone_plan_id: str - :keyword List["LocationOptionsQuery"] location_options: - Represents the underlying list of countries. - :rtype: ~azure.communication.administration.AreaCodes - """ - return self._phone_number_administration_client.phone_number_administration.get_all_area_codes( - location_type=location_type, - country_code=country_code, - phone_plan_id=phone_plan_id, - **kwargs - ) - - @distributed_trace - def get_capabilities_update( - self, - capabilities_update_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> UpdatePhoneNumberCapabilitiesResponse - """Get capabilities by capabilities update id. - - :param capabilities_update_id: - :type capabilities_update_id: str - :rtype: ~azure.communication.administration.UpdatePhoneNumberCapabilitiesResponse - """ - return self._phone_number_administration_client.phone_number_administration.get_capabilities_update( - capabilities_update_id, - **kwargs - ) - - @distributed_trace - def update_capabilities( - self, - phone_number_capabilities_update, # type: Dict[str, NumberUpdateCapabilities] - **kwargs # type: Any - ): - # type: (...) -> UpdateNumberCapabilitiesResponse - """Adds or removes phone number capabilities. - - :param phone_number_capabilities_update: The map of phone numbers to the capabilities update - applied to the phone number. - :type phone_number_capabilities_update: - dict[str, ~azure.communication.administration.NumberUpdateCapabilities] - :rtype: ~azure.communication.administration.UpdateNumberCapabilitiesResponse - """ - return self._phone_number_administration_client.phone_number_administration.update_capabilities( - phone_number_capabilities_update, - **kwargs - ) - - @distributed_trace - def list_all_supported_countries( - self, - **kwargs # type: Any - ): - # type: (...) -> ItemPaged[PhoneNumberCountries] - """Gets a list of supported countries. - - :keyword str locale: A language-locale pairing which will be used to localise the names of countries. - The default is "en-US". - :keyword int skip: An optional parameter for how many entries to skip, for pagination purposes. - The default is 0. - :keyword int take: An optional parameter for how many entries to return, for pagination purposes. - The default is 100. - :rtype: ~azure.core.paging.ItemPaged[~azure.communication.administration.PhoneNumberCountries] - """ - return self._phone_number_administration_client.phone_number_administration.get_all_supported_countries( - **kwargs - ) - - @distributed_trace - def get_number_configuration( - self, - phone_number, # type: str - **kwargs # type: Any - ): - # type: (...) -> NumberConfigurationResponse - """Endpoint for getting number configurations. - - :param phone_number: The phone number in the E.164 format. - :type phone_number: str - :rtype: ~azure.communication.administration.NumberConfigurationResponse - """ - return self._phone_number_administration_client.phone_number_administration.get_number_configuration( - phone_number, - **kwargs - ) - - @distributed_trace - def configure_number( - self, - pstn_configuration, # type: PstnConfiguration - phone_number, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Endpoint for configuring a pstn number. - - :param pstn_configuration: Definition for pstn number configuration. - :type pstn_configuration: ~azure.communication.administration.PstnConfiguration - :param phone_number: The phone number to configure. - :type phone_number: str - :rtype: None - """ - return self._phone_number_administration_client.phone_number_administration.configure_number( - pstn_configuration, - phone_number, - **kwargs - ) - - @distributed_trace - def unconfigure_number( - self, - phone_number, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Endpoint for unconfiguring a pstn number by removing the configuration. - - :param phone_number: The phone number in the E.164 format. - :type phone_number: str - :rtype: None - """ - return self._phone_number_administration_client.phone_number_administration.unconfigure_number( - phone_number, - **kwargs - ) - - @distributed_trace - def list_phone_plan_groups( - self, - country_code, # type: str - **kwargs # type: Any - ): - # type: (...) -> ItemPaged[PhonePlanGroups] - """Gets a list of phone plan groups for the given country. - - :param country_code: The ISO 3166-2 country code. - :type country_code: str - :keyword str locale: A language-locale pairing which will be used to localise the names of countries. - The default is "en-US". - :keyword include_rate_information bool: An optional boolean parameter for including rate information in result. - The default is False". - :keyword int skip: An optional parameter for how many entries to skip, for pagination purposes. - The default is 0. - :keyword int take: An optional parameter for how many entries to return, for pagination purposes. - The default is 100. - :rtype: ~azure.core.paging.ItemPaged[~azure.communication.administration.PhonePlanGroups] - """ - return self._phone_number_administration_client.phone_number_administration.get_phone_plan_groups( - country_code, - **kwargs - ) - - @distributed_trace - def list_phone_plans( - self, - country_code, # type: str - phone_plan_group_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> ItemPaged[PhonePlansResponse] - """Gets a list of phone plans for a phone plan group. - - :param country_code: The ISO 3166-2 country code. - :type country_code: str - :param phone_plan_group_id: - :type phone_plan_group_id: str - :keyword str locale: A language-locale pairing which will be used to localise the names of countries. - The default is "en-US". - :keyword int skip: An optional parameter for how many entries to skip, for pagination purposes. - The default is 0. - :keyword int take: An optional parameter for how many entries to return, for pagination purposes. - The default is 100. - :rtype: ~azure.core.paging.ItemPaged[~azure.communication.administration.PhonePlansResponse] - """ - return self._phone_number_administration_client.phone_number_administration.get_phone_plans( - country_code, - phone_plan_group_id, - **kwargs - ) - - @distributed_trace - def get_phone_plan_location_options( - self, - country_code, # type: str - phone_plan_group_id, # type: str - phone_plan_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LocationOptionsResponse - """Gets a list of location options for a phone plan. - - :param country_code: The ISO 3166-2 country code. - :type country_code: str - :param phone_plan_group_id: - :type phone_plan_group_id: str - :param phone_plan_id: - :type phone_plan_id: str - :keyword str locale: A language-locale pairing which will be used to localise the names of countries. - The default is "en-US". - :keyword int skip: An optional parameter for how many entries to skip, for pagination purposes. - The default is 0. - :keyword int take: An optional parameter for how many entries to return, for pagination purposes. - The default is 100. - :rtype: ~azure.communication.administration.LocationOptionsResponse - """ - return self._phone_number_administration_client.phone_number_administration.get_phone_plan_location_options( - country_code=country_code, - phone_plan_group_id=phone_plan_group_id, - phone_plan_id=phone_plan_id, - **kwargs - ) - - @distributed_trace - def get_release_by_id( - self, - release_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> PhoneNumberRelease - """Gets a release by a release id. - - :param release_id: Represents the release id. - :type release_id: str - :rtype: ~azure.communication.administration.PhoneNumberRelease - """ - return self._phone_number_administration_client.phone_number_administration.get_release_by_id( - release_id, - **kwargs - ) - - @distributed_trace - def begin_release_phone_numbers( - self, - **kwargs # type: Any - ): - # type: (...) -> LROPoller[PhoneNumberRelease] - """Begins creating a release for the given phone numbers. - Caller must provide either phone_numbers, or continuation_token keywords to use the method. - If both phone_numbers and continuation_token are specified, only continuation_token will be used to - restart a poller from a saved state, and keyword phone_numbers will be ignored. - - :keyword list[str] phone_numbers: The list of phone numbers in the release request. - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :rtype: ~azure.core.polling.LROPoller[~azure.communication.administration.PhoneNumberRelease] - """ - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - - release_polling = ReleasePhoneNumberPolling( - is_terminated=lambda status: status in [ - ReleaseStatus.Complete, - ReleaseStatus.Failed, - ReleaseStatus.Expired - ] - ) - - if cont_token is not None: - return LROPoller.from_continuation_token( - polling_method=release_polling, - continuation_token=cont_token, - client=self._phone_number_administration_client.phone_number_administration - ) - - if "phone_numbers" not in kwargs: - raise ValueError("Either kwarg 'phone_numbers' or 'continuation_token' needs to be specified") - - create_release_response = self._phone_number_administration_client.\ - phone_number_administration.release_phone_numbers( - **kwargs - ) - - initial_state = self._phone_number_administration_client.phone_number_administration.get_release_by_id( - release_id=create_release_response.release_id - ) - - return LROPoller(client=self._phone_number_administration_client.phone_number_administration, - initial_response=initial_state, - deserialization_callback=None, - polling_method=release_polling) - - @distributed_trace - def list_all_releases( - self, - **kwargs # type: Any - ): - # type: (...) -> ItemPaged[PhoneNumberEntities] - """Gets a list of all releases. - - :keyword int skip: An optional parameter for how many entries to skip, for pagination purposes. - The default is 0. - :keyword int take: An optional parameter for how many entries to return, for pagination purposes. - The default is 100. - :rtype: ~azure.core.paging.ItemPaged[~azure.communication.administration.PhoneNumberEntities] - """ - return self._phone_number_administration_client.phone_number_administration.get_all_releases( - **kwargs - ) - - @distributed_trace - def get_reservation_by_id( - self, - reservation_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> PhoneNumberReservation - """Get reservation by reservation id. - - :param reservation_id: The reservation id to get reservation. - :type reservation_id: str - :rtype: ~azure.communication.administration.PhoneNumberReservation - """ - return self._phone_number_administration_client.phone_number_administration.get_search_by_id( - search_id=reservation_id, - **kwargs - ) - - @distributed_trace - def begin_reserve_phone_numbers( - self, - **kwargs # type: Any - ): - # type: (...) -> LROPoller[PhoneNumberReservation] - """Begins creating a phone number search to reserve phone numbers. - Caller must provide one of the following: - (1) all of keywords display_name, description, phone_plan_ids, area_code, quantity if all the phone plans - to reserve are toll-free plans. - (2) all of keywords display_name, description, phone_plan_ids, area_code, quantity, location_options - if at least one phone plan to reserve is not toll-free plans. - (3) only keyword continuation_token to restart a poller from a saved state. - If both continuation_token and other keywords are specified, only continuation_token will be used to - restart a poller from a saved state, and other keywords will be ignored. - :keyword str display_name: display name of the search. - :keyword str description: description of the search. - :keyword list[str] phone_plan_ids: the plan subtype ids from which to create the search. - :keyword str area_code: the area code from which to create the search. - :keyword int quantity: the quantity of phone numbers to request. - :keyword list[~azure.communication.administration.models.LocationOptionsDetails] location_options: - the location options of the search. - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :rtype: ~azure.core.polling.LROPoller[~azure.communication.administration.PhoneNumberReservation] - """ - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - - reservation_polling = ReservePhoneNumberPolling( - is_terminated=lambda status: status in [ - SearchStatus.Reserved, - SearchStatus.Expired, - SearchStatus.Success, - SearchStatus.Cancelled, - SearchStatus.Error - ] - ) - - if cont_token is not None: - return LROPoller.from_continuation_token( - polling_method=reservation_polling, - continuation_token=cont_token, - client=self._phone_number_administration_client.phone_number_administration - ) - - required_kwargs = ['display_name', 'description', 'phone_plan_ids', 'area_code', 'quantity'] - for required_kwarg in required_kwargs: - if required_kwarg not in kwargs: - raise ValueError("Either kwarg 'continuation_token', or a set of kwargs " + - "'display_name', 'description', 'phone_plan_ids', " - "'area_code', 'quantity' needs to be specified") - - reservation_options = CreateSearchOptions( - display_name=kwargs.pop('display_name'), - description=kwargs.pop('description'), - phone_plan_ids=kwargs.pop('phone_plan_ids'), - area_code=kwargs.pop('area_code'), - quantity=kwargs.pop('quantity') - ) - - if 'location_options' in kwargs: - reservation_options.location_options = kwargs.pop('location_options') - - create_reservation_response = self._phone_number_administration_client.\ - phone_number_administration.create_search( - body=reservation_options, - **kwargs - ) - - initial_state = self._phone_number_administration_client.phone_number_administration.get_search_by_id( - search_id=create_reservation_response.search_id - ) - return LROPoller(client=self._phone_number_administration_client.phone_number_administration, - initial_response=initial_state, - deserialization_callback=None, - polling_method=reservation_polling) - - @distributed_trace - def list_all_reservations( - self, - **kwargs # type: Any - ): - # type: (...) -> ItemPaged[PhoneNumberEntities] - """Gets a list of all reservations. - - :keyword int skip: An optional parameter for how many entries to skip, for pagination purposes. - The default is 0. - :keyword int take: An optional parameter for how many entries to return, for pagination purposes. - The default is 100. - :rtype: ~azure.core.paging.ItemPaged[~azure.communication.administration.PhoneNumberEntities] - """ - return self._phone_number_administration_client.phone_number_administration.get_all_searches( - **kwargs - ) - - @distributed_trace - def cancel_reservation( - self, - reservation_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Cancels the reservation. This means existing numbers in the reservation will be made available. - - :param reservation_id: The reservation id to be canceled. - :type reservation_id: str - :rtype: None - """ - return self._phone_number_administration_client.phone_number_administration.cancel_search( - search_id=reservation_id, - **kwargs - ) - - @distributed_trace - def begin_purchase_reservation( - self, - **kwargs # type: Any - ): - # type: (...) -> LROPoller[PhoneNumberReservation] - """Begins purchase the reserved phone numbers of a phone number search. - Caller must provide either reservation_id, or continuation_token keywords to use the method. - If both reservation_id and continuation_token are specified, only continuation_token will be used to - restart a poller from a saved state, and keyword reservation_id will be ignored. - :keyword str reservation_id: The reservation id to be purchased. - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :rtype: ~azure.core.polling.LROPoller[~azure.communication.administration.PhoneNumberReservation] - """ - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - - reservation_polling = PurchaseReservationPolling( - is_terminated=lambda status: status in [ - SearchStatus.Success, - SearchStatus.Expired, - SearchStatus.Cancelled, - SearchStatus.Error - ] - ) - - if cont_token is not None: - return LROPoller.from_continuation_token( - polling_method=reservation_polling, - continuation_token=cont_token, - client=self._phone_number_administration_client.phone_number_administration - ) - - if "reservation_id" not in kwargs: - raise ValueError("Either kwarg 'reservation_id' or 'continuation_token' needs to be specified") - - reservation_id = kwargs.pop('reservation_id') # type: str - - self._phone_number_administration_client.phone_number_administration.purchase_search( - search_id=reservation_id, - **kwargs - ) - initial_state = self._phone_number_administration_client.phone_number_administration.get_search_by_id( - search_id=reservation_id - ) - return LROPoller(client=self._phone_number_administration_client.phone_number_administration, - initial_response=initial_state, - deserialization_callback=None, - polling_method=reservation_polling) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py new file mode 100644 index 000000000000..c3085e1b8b1e --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py @@ -0,0 +1,250 @@ +from azure.core.tracing.decorator import distributed_trace +from azure.core.paging import ItemPaged +from azure.core.polling import LROPoller +from ._generated._phone_numbers_client import PhoneNumbersClient as PhoneNumbersClientGen +from ._generated.models import PhoneNumberSearchRequest +from ._shared.utils import parse_connection_str, get_authentication_policy +from ._version import SDK_MONIKER +import pytest + + +class PhoneNumbersClient(object): + def __init__( + self, + endpoint, # type: str + credential, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + try: + if not endpoint.lower().startswith('http'): + endpoint = "https://" + endpoint + except AttributeError: + raise ValueError("Account URL must be a string.") + + if not credential: + raise ValueError( + "You need to provide account shared key to authenticate.") + + self._endpoint = endpoint + self._phone_number_client = PhoneNumbersClientGen( + self._endpoint, + authentication_policy=get_authentication_policy(endpoint, credential), + sdk_moniker=SDK_MONIKER, + **kwargs) + + @classmethod + def from_connection_string( + cls, conn_str, # type: str + **kwargs # type: Any + ): + # type: (...) -> PhoneNumbersClient + """Create PhoneNumbersClient from a Connection String. + :param str conn_str: + A connection string to an Azure Communication Service resource. + :returns: Instance of PhoneNumbersClient. + :rtype: ~azure.communication.PhoneNumbersClient + """ + endpoint, access_key = parse_connection_str(conn_str) + + return cls(endpoint, access_key, **kwargs) + + + @distributed_trace + def begin_purchase_phone_numbers( + self, + search_id, + **kwargs + ): + # type: (...) -> LROPoller[None] + """Purchases phone numbers. + + :param search_id: The search id. + :type search_id: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the LROBasePolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :rtype: ~azure.core.polling.LROPoller[~azure.communication.phonenumbers.models.PhoneNumberSearchResult] + """ + return self._phone_number_client.phone_numbers.begin_purchase_phone_numbers( + search_id, + **kwargs + ) + + @distributed_trace + def begin_release_phone_number( + self, + phone_number, + **kwargs + ): + # type: (...) -> LROPoller[None] + """Releases an acquired phone number. + + :param phone_number: Phone number to be released, e.g. +11234567890. + :type phone_number: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the LROBasePolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :rtype: ~azure.core.polling.LROPoller[None] + """ + return self._phone_number_client.phone_numbers.begin_release_phone_number( + phone_number, + **kwargs + ) + + @distributed_trace + def begin_search_available_phone_numbers( + self, + country_code, + phone_number_type, + assignment_type, + capabilities, + area_code, + quantity = 1, + **kwargs + ): + # type: (...) -> LROPoller[PhoneNumberSearchResult] + """Search for available phone numbers to purchase. + + :param country_code: The ISO 3166-2 country code, e.g. US. + :type country_code: str + :param phone_number_type: Required. The type of phone numbers to search for, e.g. geographic, + or tollFree. Possible values include: "geographic", "tollFree". + :type phone_number_type: str or ~azure.communication.phonenumbers.models.PhoneNumberType + :param assignment_type: Required. The assignment type of the phone numbers to search for. A + phone number can be assigned to a person, or to an application. Possible values include: + "user", "application". + :type assignment_type: str or + ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType + :param capabilities: Required. Capabilities of a phone number. + :type capabilities: ~azure.communication.phonenumbers.models.PhoneNumberCapabilities + :param area_code: The area code of the desired phone number, e.g. 425. + :type area_code: str + :param quantity: The quantity of phone numbers in the search. Should be at least 1. + :type quantity: int + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the LROBasePolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :rtype: ~azure.core.polling.LROPoller[~azure.communication.phonenumbers.models.PhoneNumberSearchResult] + """ + search_request = PhoneNumberSearchRequest( + phone_number_type = phone_number_type, + assignment_type = assignment_type, + capabilities = capabilities, + area_code = area_code, + quantity = quantity + ) + return self._phone_number_client.phone_numbers.begin_search_available_phone_numbers( + country_code, + search_request, + **kwargs + ) + + def begin_update_phone_number_capabilities( + self, + phone_number, + sms, + calling, + **kwargs + ): + # type: (...) -> LROPoller["_models.AcquiredPhoneNumber"] + """Updates the capabilities of a phone number. + + :param phone_number: The phone number id in E.164 format. The leading plus can be either + or + encoded as %2B, e.g. +11234567890. + :type phone_number: str + :param calling: Capability value for calling. + :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :param sms: Capability value for SMS. + :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the LROBasePolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :rtype: ~azure.core.polling.LROPoller[AcquiredPhoneNumber] + """ + return self._phone_number_client.phone_numbers.begin_update_capabilities( + phone_number, + calling, + sms, + **kwargs + ) + + @distributed_trace + def get_phone_number( + self, + phone_number, + **kwargs + ): + # type: (...) -> AcquiredPhoneNumber + """Gets the details of the given acquired phone number. + + :param phone_number: The acquired phone number whose details are to be fetched in E.164 format, + e.g. +11234567890. + :type phone_number: str + :keyword callable cls: A custom type or function that will be passed the direct response + :rtype: ~azure.communication.phonenumbers.models.AcquiredPhoneNumber + """ + return self._phone_number_client.phone_numbers.get_by_number( + phone_number, + **kwargs + ) + + @distributed_trace + def list_acquired_phone_numbers( + self, + **kwargs + ): + # type: (...) -> ItemPaged[AcquiredPhoneNumbers] + """Gets the list of all acquired phone numbers. + + :param skip: An optional parameter for how many entries to skip, for pagination purposes. The + default value is 0. + :type skip: int + :param top: An optional parameter for how many entries to return, for pagination purposes. The + default value is 100. + :type top: int + :rtype: ~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.models.AcquiredPhoneNumbers] + """ + return self._phone_number_client.phone_numbers.list_phone_numbers( + **kwargs + ) + + @distributed_trace + def update_phone_number( + self, + phone_number, + callback_uri, + application_id, + **kwargs + ): + # type: (...) -> AcquiredPhoneNumber + """Updates the configuration of a phone number. + + :param phone_number: Phone number to be updated, e.g. +11234567890. + :type phone_number: str + :param callback_uri: The webhook for receiving incoming events. + e.g. "https://{{site-name}}.azurewebsites.net/api/updates". + Please read https://docs.microsoft.com/en-us/azure/communication-services/concepts/event- + handling + for integration with Azure Event Grid to deliver real-time event notifications. + :type callback_uri: str + :param application_id: The application id of the application to which to configure. + :type application_id: str + :rtype: ~azure.communication.phonenumbers.models.AcquiredPhoneNumber + """ + return self._phone_number_client.phone_numbers.update( + phone_number, + callback_uri, + application_id, + **kwargs + ) \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_polling.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_polling.py deleted file mode 100644 index 8521c4cef85c..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_polling.py +++ /dev/null @@ -1,92 +0,0 @@ -# pylint: disable=W0231 -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- -import base64 -import time -from typing import Union -from functools import partial -import pickle - -from azure.core.polling import ( - PollingMethod -) -from ._generated.models import ( - PhoneNumberReservation, - PhoneNumberRelease -) - -class PhoneNumberBasePolling(PollingMethod): - """ABC class for reserve/purchase/release phone number related polling. - """ - def __init__(self, is_terminated, polling_interval=5): - # type: (bool, int) -> None - self._response = None - self._client = None - self._query_status = None - self._is_terminated = is_terminated - self._polling_interval = polling_interval - - def _update_status(self): - # type: () -> None - if self._query_status is None: - raise Exception("this poller has not been initialized") - self._response = self._query_status() # pylint: disable=E1102 - - def initialize(self, client, initial_response, deserialization_callback): - # type: (Any, Any, Callable) -> None - self._client = client - self._response = initial_response - - def run(self): - # type: () -> None - while not self.finished(): - self._update_status() - if not self.finished(): - time.sleep(self._polling_interval) - - def finished(self): - # type: () -> bool - if self._response.status is None: - return False - return self._is_terminated(self._response.status) - - def resource(self): - # type: () -> Union[PhoneNumberReservation, PhoneNumberRelease] - if not self.finished(): - return None - return self._response - - def status(self): - # type: () -> str - return self._response.status - - def get_continuation_token(self): - # type() -> str - return base64.b64encode(pickle.dumps(self._response)).decode('ascii') - - @classmethod - def from_continuation_token(cls, continuation_token, client, **kwargs): # pylint: disable=W0221 - # type(str, PhoneNumbersAdministrationClient, Any) -> Tuple - initial_response = pickle.loads(base64.b64decode(continuation_token)) # nosec - return client, initial_response, None - -class ReservePhoneNumberPolling(PhoneNumberBasePolling): - def initialize(self, client, initial_response, deserialization_callback): - # type: (Any, Any, Callable) -> None - super().initialize(client, initial_response, deserialization_callback) - self._query_status = partial(self._client.get_search_by_id, search_id=initial_response.reservation_id) - -class PurchaseReservationPolling(PhoneNumberBasePolling): - def initialize(self, client, initial_response, deserialization_callback): - # type: (Any, Any, Callable) -> None - super().initialize(client, initial_response, deserialization_callback) - self._query_status = partial(self._client.get_search_by_id, search_id=initial_response.reservation_id) - -class ReleasePhoneNumberPolling(PhoneNumberBasePolling): - def initialize(self, client, initial_response, deserialization_callback): - # type: (Any, Any, Callable) -> None - super().initialize(client, initial_response, deserialization_callback) - self._query_status = partial(self._client.get_release_by_id, release_id=initial_response.release_id) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_shared/models.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_shared/models.py index 67e0a1ff6e2b..07b45cf9275e 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_shared/models.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_shared/models.py @@ -43,7 +43,49 @@ class UnknownIdentifier(object): :type identifier: str """ def __init__(self, identifier): - self.raw_id = identifier + self.identifier = identifier + +class CommunicationIdentifierModel(msrest.serialization.Model): + """Communication Identifier Model. + All required parameters must be populated in order to send to Azure. + :param kind: Required. Kind of Communication Identifier. + :type kind: CommunicationIdentifierKind + :param id: Full id of the identifier. + :type id: str + :param phone_number: phone number in case the identifier is a phone number. + :type phone_number: str + :param is_anonymous: True if the identifier is anonymous. + :type is_anonymous: bool + :param microsoft_teams_user_id: Microsoft Teams user id. + :type microsoft_teams_user_id: str + :param communication_cloud_environment: Cloud environment that the user belongs to. + :type communication_cloud_environment: CommunicationCloudEnvironment + """ + + _validation = { + 'kind': {'required': True}, + } + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'phone_number': {'key': 'phoneNumber', 'type': 'str'}, + 'is_anonymous': {'key': 'isAnonymous', 'type': 'bool'}, + 'microsoft_teams_user_id': {'key': 'microsoftTeamsUserId', 'type': 'str'}, + 'communication_cloud_environment': {'key': 'communicationCloudEnvironment', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CommunicationIdentifierModel, self).__init__(**kwargs) + self.kind = kwargs['kind'] + self.id = kwargs.get('id', None) + self.phone_number = kwargs.get('phone_number', None) + self.is_anonymous = kwargs.get('is_anonymous', None) + self.microsoft_teams_user_id = kwargs.get('microsoft_teams_user_id', None) + self.communication_cloud_environment = kwargs.get('communication_cloud_environment', None) class _CaseInsensitiveEnumMeta(EnumMeta): def __getitem__(cls, name): @@ -74,7 +116,7 @@ class CommunicationCloudEnvironment(with_metaclass(_CaseInsensitiveEnumMeta, str """ The cloud enviornment that the identifier belongs to """ - + Public = "PUBLIC" Dod = "DOD" Gcch = "GCCH" diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_shared/utils.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_shared/utils.py index 18da505150ba..e01f5291ba5e 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_shared/utils.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_shared/utils.py @@ -77,14 +77,12 @@ def get_authentication_policy( # type: (...) -> BearerTokenCredentialPolicy or HMACCredentialPolicy """Returns the correct authentication policy based on which credential is being passed. - :param endpoint: The endpoint to which we are authenticating to. :type endpoint: str :param credential: The credential we use to authenticate to the service :type credential: TokenCredential or str :param isAsync: For async clients there is a need to decode the url :type bool: isAsync or str - :rtype: ~azure.core.pipeline.policies.BearerTokenCredentialPolicy ~HMACCredentialsPolicy """ diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_version.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_version.py index a01196623d45..a7bc8e8c9303 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_version.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_version.py @@ -6,4 +6,4 @@ VERSION = "1.0.0b4" -SDK_MONIKER = "communication-administration/{}".format(VERSION) # type: str +SDK_MONIKER = "communication-administration/{}".format(VERSION) # type: str \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/__init__.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/__init__.py index 2970318067d2..6c133642985f 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/__init__.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/__init__.py @@ -1,11 +1,5 @@ -from ._phone_number_administration_client_async import PhoneNumbersAdministrationClient -from ._polling_async import ReservePhoneNumberPollingAsync, \ - PurchaseReservationPollingAsync, \ - ReleasePhoneNumberPollingAsync +from ._phone_numbers_client_async import PhoneNumbersClient __all__ = [ - 'PhoneNumbersAdministrationClient', - 'ReservePhoneNumberPollingAsync', - 'PurchaseReservationPollingAsync', - 'ReleasePhoneNumberPollingAsync' + 'PhoneNumbersClient', ] diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_number_administration_client_async.py deleted file mode 100644 index 9564b866fd41..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_number_administration_client_async.py +++ /dev/null @@ -1,620 +0,0 @@ -# pylint: disable=R0904 -# coding=utf-8 -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ -from typing import Dict - -from azure.communication.phonenumbers._generated.models import ReleaseStatus, CreateSearchOptions -from azure.core.async_paging import AsyncItemPaged -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.polling import AsyncLROPoller - -from .._version import SDK_MONIKER -from ._polling_async import ReleasePhoneNumberPollingAsync, \ - ReservePhoneNumberPollingAsync, \ - PurchaseReservationPollingAsync - -from .._generated.aio._phone_number_administration_service \ - import PhoneNumberAdministrationService as PhoneNumbersAdministrationClientGen - -from .._generated.models import ( - AcquiredPhoneNumbers, - AreaCodes, - LocationOptionsResponse, - NumberConfigurationResponse, - NumberUpdateCapabilities, - PhoneNumberCountries, - PhoneNumberEntities, - PhoneNumberRelease, - PhoneNumberReservation, - PhonePlanGroups, - PhonePlansResponse, - PstnConfiguration, - SearchStatus, - UpdateNumberCapabilitiesResponse, - UpdatePhoneNumberCapabilitiesResponse -) - -from .._shared.utils import parse_connection_str, get_authentication_policy - -class PhoneNumbersAdministrationClient(object): - """Azure Communication Services Phone Numbers Management client. - - :param str endpoint: - The endpoint url for Azure Communication Service resource. - :param credential: - The credentials with which to authenticate. The value is an account - shared access key - """ - def __init__( - self, - endpoint, # type: str - credential, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - try: - if not endpoint.lower().startswith('http'): - endpoint = "https://" + endpoint - except AttributeError: - raise ValueError("Account URL must be a string.") - - if not credential: - raise ValueError( - "You need to provide account shared key to authenticate.") - - self._endpoint = endpoint - self._phone_number_administration_client = PhoneNumbersAdministrationClientGen( - self._endpoint, - authentication_policy=get_authentication_policy(endpoint, credential, is_async=True), - sdk_moniker=SDK_MONIKER, - **kwargs) - - @classmethod - def from_connection_string( - cls, conn_str, # type: str - **kwargs # type: Any - ): # type: (...) -> PhoneNumbersAdministrationClient - """Create PhoneNumbersAdministrationClient from a Connection String. - - :param str conn_str: - A connection string to an Azure Communication Service resource. - :returns: Instance of PhoneNumbersAdministrationClient. - :rtype: ~azure.communication.PhoneNumbersAdministrationClient - """ - endpoint, access_key = parse_connection_str(conn_str) - - return cls(endpoint, access_key, **kwargs) - - @distributed_trace - def list_all_phone_numbers( - self, - **kwargs # type: Any - ): - # type: (...) -> AsyncItemPaged[AcquiredPhoneNumbers] - """Gets the list of the acquired phone numbers. - - :keyword str locale: A language-locale pairing which will be used to localise the names of countries. - The default is "en-US". - :keyword int skip: An optional parameter for how many entries to skip, for pagination purposes. - The default is 0. - :keyword int take: An optional parameter for how many entries to return, for pagination purposes. - The default is 100. - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.administration.AcquiredPhoneNumbers] - """ - return self._phone_number_administration_client.phone_number_administration.get_all_phone_numbers( - **kwargs - ) - - @distributed_trace_async - async def get_all_area_codes( - self, - location_type, # type: str - country_code, # type: str - phone_plan_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> AreaCodes - """Gets a list of the supported area codes. - - :param location_type: The type of location information required by the plan. - :type location_type: str - :param country_code: The ISO 3166-2 country code. - :type country_code: str - :param phone_plan_id: The plan id from which to search area codes. - :type phone_plan_id: str - :keyword List["LocationOptionsQuery"] location_options: - Represents the underlying list of countries. - :rtype: ~azure.communication.administration.AreaCodes - """ - return await self._phone_number_administration_client.phone_number_administration.get_all_area_codes( - location_type, - country_code, - phone_plan_id, - **kwargs - ) - - @distributed_trace_async - async def get_capabilities_update( - self, - capabilities_update_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> UpdatePhoneNumberCapabilitiesResponse - """Get capabilities by capabilities update id. - - :param capabilities_update_id: - :type capabilities_update_id: str - :rtype: ~azure.communication.administration.UpdatePhoneNumberCapabilitiesResponse - """ - return await self._phone_number_administration_client.phone_number_administration.get_capabilities_update( - capabilities_update_id, - **kwargs - ) - - @distributed_trace_async - async def update_capabilities( - self, - phone_number_capabilities_update, # type: Dict[str, NumberUpdateCapabilities] - **kwargs # type: Any - ): - # type: (...) -> UpdateNumberCapabilitiesResponse - """Adds or removes phone number capabilities. - - :param phone_number_capabilities_update: The map of phone numbers to the capabilities update - applied to the phone number. - :type phone_number_capabilities_update: - dict[str, ~azure.communication.administration.NumberUpdateCapabilities] - :rtype: ~azure.communication.administration.UpdateNumberCapabilitiesResponse - """ - return await self._phone_number_administration_client.phone_number_administration.update_capabilities( - phone_number_capabilities_update, - **kwargs - ) - - @distributed_trace - def list_all_supported_countries( - self, - **kwargs # type: Any - ): - # type: (...) -> AsyncItemPaged[PhoneNumberCountries] - """Gets a list of supported countries. - - Gets a list of supported countries. - - :keyword str locale: A language-locale pairing which will be used to localise the names of countries. - The default is "en-US". - :keyword int skip: An optional parameter for how many entries to skip, for pagination purposes. - The default is 0. - :keyword int take: An optional parameter for how many entries to return, for pagination purposes. - The default is 100. - :return: An iterator like instance of either PhoneNumberCountries or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.administration.PhoneNumberCountries] - """ - return self._phone_number_administration_client.phone_number_administration.get_all_supported_countries( - **kwargs - ) - - @distributed_trace_async - async def get_number_configuration( - self, - phone_number, # type: str - **kwargs # type: Any - ): - # type: (...) -> NumberConfigurationResponse - """Endpoint for getting number configurations. - - :param phone_number: The phone number in the E.164 format. - :type phone_number: str - :rtype: ~azure.communication.administration.NumberConfigurationResponse - """ - return await self._phone_number_administration_client.phone_number_administration.get_number_configuration( - phone_number, - **kwargs - ) - - @distributed_trace_async - async def configure_number( - self, - pstn_configuration, # type: PstnConfiguration - phone_number, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Endpoint for configuring a pstn number. - - :param pstn_configuration: Definition for pstn number configuration. - :type pstn_configuration: ~azure.communication.administration.PstnConfiguration - :param phone_number: The phone number to configure. - :type phone_number: str - :rtype: None - """ - return await self._phone_number_administration_client.phone_number_administration.configure_number( - pstn_configuration, - phone_number, - **kwargs - ) - - @distributed_trace_async - async def unconfigure_number( - self, - phone_number, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Endpoint for unconfiguring a pstn number by removing the configuration. - - :param phone_number: The phone number in the E.164 format. - :type phone_number: str - :rtype: None - """ - return await self._phone_number_administration_client.phone_number_administration.unconfigure_number( - phone_number, - **kwargs - ) - - @distributed_trace - def list_phone_plan_groups( - self, - country_code, # type: str - **kwargs # type: Any - ): - # type: (...) -> AsyncItemPaged[PhonePlanGroups] - """Gets a list of phone plan groups for the given country. - - :param country_code: The ISO 3166-2 country code. - :type country_code: str - :keyword str locale: A language-locale pairing which will be used to localise the names of countries. - The default is "en-US". - :keyword include_rate_information bool: An optional boolean parameter for including rate information in result. - The default is False". - :keyword int skip: An optional parameter for how many entries to skip, for pagination purposes. - The default is 0. - :keyword int take: An optional parameter for how many entries to return, for pagination purposes. - The default is 100. - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.administration.PhonePlanGroups] - """ - return self._phone_number_administration_client.phone_number_administration.get_phone_plan_groups( - country_code, - **kwargs - ) - - @distributed_trace - def list_phone_plans( - self, - country_code, # type: str - phone_plan_group_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> AsyncItemPaged[PhonePlansResponse] - """Gets a list of phone plans for a phone plan group. - - :param country_code: The ISO 3166-2 country code. - :type country_code: str - :param phone_plan_group_id: - :type phone_plan_group_id: str - :keyword str locale: A language-locale pairing which will be used to localise the names of countries. - The default is "en-US". - :keyword int skip: An optional parameter for how many entries to skip, for pagination purposes. - The default is 0. - :keyword int take: An optional parameter for how many entries to return, for pagination purposes. - The default is 100. - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.administration.PhonePlansResponse] - """ - return self._phone_number_administration_client.phone_number_administration.get_phone_plans( - country_code, - phone_plan_group_id, - **kwargs - ) - - @distributed_trace_async - async def get_phone_plan_location_options( - self, - country_code, # type: str - phone_plan_group_id, # type: str - phone_plan_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> LocationOptionsResponse - """Gets a list of location options for a phone plan. - - :param country_code: The ISO 3166-2 country code. - :type country_code: str - :param phone_plan_group_id: - :type phone_plan_group_id: str - :param phone_plan_id: - :type phone_plan_id: str - :keyword str locale: A language-locale pairing which will be used to localise the names of countries. - The default is "en-US". - :keyword int skip: An optional parameter for how many entries to skip, for pagination purposes. - The default is 0. - :keyword int take: An optional parameter for how many entries to return, for pagination purposes. - The default is 100. - :rtype: - ~azure.communication.administration.LocationOptionsResponse - """ - return await self._phone_number_administration_client.\ - phone_number_administration.get_phone_plan_location_options( - country_code, - phone_plan_group_id, - phone_plan_id, - **kwargs - ) - - @distributed_trace_async - async def get_release_by_id( - self, - release_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> PhoneNumberRelease - """Gets a release by a release id. - - :param release_id: Represents the release id. - :type release_id: str - :rtype: ~azure.communication.administration.PhoneNumberRelease - """ - return await self._phone_number_administration_client.phone_number_administration.get_release_by_id( - release_id, - **kwargs - ) - - @distributed_trace_async - async def begin_release_phone_numbers( - self, - **kwargs # type: Any - ): - # type: (...) -> AsyncLROPoller[PhoneNumberRelease] - """Begins creating a release for the given phone numbers. - Caller must provide either phone_numbers, or continuation_token keywords to use the method. - If both phone_numbers and continuation_token are specified, only continuation_token will be used to - restart a poller from a saved state, and keyword phone_numbers will be ignored. - - :keyword list[str] phone_numbers: The list of phone numbers in the release request. - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.communication.administration.PhoneNumberRelease] - """ - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - - release_polling = ReleasePhoneNumberPollingAsync( - is_terminated=lambda status: status in [ - ReleaseStatus.Complete, - ReleaseStatus.Failed, - ReleaseStatus.Expired - ] - ) - - if cont_token is not None: - return AsyncLROPoller.from_continuation_token( - polling_method=release_polling, - continuation_token=cont_token, - client=self._phone_number_administration_client.phone_number_administration - ) - - if "phone_numbers" not in kwargs: - raise ValueError("Either kwarg 'phone_numbers' or 'continuation_token' needs to be specified") - - create_release_response = await self._phone_number_administration_client.\ - phone_number_administration.release_phone_numbers( - **kwargs - ) - initial_state = await self._phone_number_administration_client.phone_number_administration.get_release_by_id( - release_id=create_release_response.release_id - ) - return AsyncLROPoller(client=self._phone_number_administration_client.phone_number_administration, - initial_response=initial_state, - deserialization_callback=None, - polling_method=release_polling) - - @distributed_trace - def list_all_releases( - self, - **kwargs # type: Any - ): - # type: (...) -> AsyncItemPaged[PhoneNumberEntities] - """Gets a list of all releases. - - :keyword int skip: An optional parameter for how many entries to skip, for pagination purposes. - The default is 0. - :keyword int take: An optional parameter for how many entries to return, for pagination purposes. - The default is 100. - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.administration.PhoneNumberEntities] - """ - return self._phone_number_administration_client.phone_number_administration.get_all_releases( - **kwargs - ) - - @distributed_trace_async - async def get_reservation_by_id( - self, - reservation_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> PhoneNumberReservation - """Get reservation by reservation id. - - :param reservation_id: The reservation id to get reservation. - :type reservation_id: str - :rtype: ~azure.communication.administration.PhoneNumberReservation - """ - return await self._phone_number_administration_client.phone_number_administration.get_search_by_id( - search_id=reservation_id, - **kwargs - ) - - - @distributed_trace_async - async def begin_reserve_phone_numbers( - self, - **kwargs # type: Any - ): - # type: (...) -> AsyncLROPoller[PhoneNumberReservation] - """Begins creating a phone number search to reserve phone numbers. - Caller must provide one of the following: - (1) all of keywords display_name, description, phone_plan_ids, area_code, quantity if all the phone plans - to reserve are toll-free plans. - (2) all of keywords display_name, description, phone_plan_ids, area_code, quantity, location_options - if at least one phone plan to reserve is not toll-free plans. - (3) only keyword continuation_token to restart a poller from a saved state. - If both continuation_token and other keywords are specified, only continuation_token will be used to - restart a poller from a saved state, and other keywords will be ignored. - :keyword str display_name: display name of the search. - :keyword str description: description of the search. - :keyword list[str] phone_plan_ids: the plan subtype ids from which to create the search. - :keyword str area_code: the area code from which to create the search. - :keyword int quantity: the quantity of phone numbers to request. - :keyword list[~azure.communication.administration.models.LocationOptionsDetails] location_options: - the location options of the search. - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.communication.administration.PhoneNumberReservation] - """ - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - - reservation_polling = ReservePhoneNumberPollingAsync( - is_terminated=lambda status: status in [ - SearchStatus.Reserved, - SearchStatus.Expired, - SearchStatus.Success, - SearchStatus.Cancelled, - SearchStatus.Error - ] - ) - - if cont_token is not None: - return AsyncLROPoller.from_continuation_token( - polling_method=reservation_polling, - continuation_token=cont_token, - client=self._phone_number_administration_client.phone_number_administration - ) - - required_kwargs = ['display_name', 'description', 'phone_plan_ids', 'area_code', 'quantity'] - for required_kwarg in required_kwargs: - if required_kwarg not in kwargs: - raise ValueError("Either kwarg 'continuation_token', or a set of kwargs " + - "'display_name', 'description', 'phone_plan_ids', " - "'area_code', 'quantity' needs to be specified") - - reservation_options = CreateSearchOptions( - display_name=kwargs.pop('display_name'), - description=kwargs.pop('description'), - phone_plan_ids=kwargs.pop('phone_plan_ids'), - area_code=kwargs.pop('area_code'), - quantity=kwargs.pop('quantity') - ) - - if 'location_options' in kwargs: - reservation_options.location_options = kwargs.pop('location_options') - - create_reservation_response = await self._phone_number_administration_client.\ - phone_number_administration.create_search( - body=reservation_options, - **kwargs - ) - initial_state = await self._phone_number_administration_client.phone_number_administration.get_search_by_id( - search_id=create_reservation_response.search_id - ) - return AsyncLROPoller(client=self._phone_number_administration_client.phone_number_administration, - initial_response=initial_state, - deserialization_callback=None, - polling_method=reservation_polling) - - @distributed_trace - def list_all_reservations( - self, - **kwargs # type: Any - ): - # type: (...) -> AsyncItemPaged[PhoneNumberEntities] - """Gets a list of all reservations. - - :keyword int skip: An optional parameter for how many entries to skip, for pagination purposes. - The default is 0. - :keyword int take: An optional parameter for how many entries to return, for pagination purposes. - The default is 100. - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.communication.administration.PhoneNumberEntities] - """ - return self._phone_number_administration_client.phone_number_administration.get_all_searches( - **kwargs - ) - - @distributed_trace_async - async def cancel_reservation( - self, - reservation_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Cancels the reservation. This means existing numbers in the reservation will be made available. - - :param reservation_id: The reservation id to be canceled. - :type reservation_id: str - :rtype: None - """ - return await self._phone_number_administration_client.phone_number_administration.cancel_search( - search_id=reservation_id, - **kwargs - ) - - @distributed_trace_async - async def begin_purchase_reservation( - self, - **kwargs # type: Any - ): - - # type: (...) -> AsyncLROPoller[PhoneNumberReservation] - """Begins purchase the reserved phone numbers of a phone number search. - Caller must provide either reservation_id, or continuation_token keywords to use the method. - If both reservation_id and continuation_token are specified, only continuation_token will be used to - restart a poller from a saved state, and keyword reservation_id will be ignored. - :keyword str reservation_id: The reservation id to be purchased. - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.communication.administration.PhoneNumberReservation] - """ - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - - reservation_polling = PurchaseReservationPollingAsync( - is_terminated=lambda status: status in [ - SearchStatus.Success, - SearchStatus.Expired, - SearchStatus.Cancelled, - SearchStatus.Error - ] - ) - - if cont_token is not None: - return AsyncLROPoller.from_continuation_token( - polling_method=reservation_polling, - continuation_token=cont_token, - client=self._phone_number_administration_client.phone_number_administration - ) - - reservation_id = kwargs.pop('reservation_id', None) # type: str - if reservation_id is None: - raise ValueError("Either kwarg 'reservation_id' or 'continuation_token' needs to be specified") - - await self._phone_number_administration_client.phone_number_administration.purchase_search( - reservation_id, - **kwargs - ) - initial_state = await self._phone_number_administration_client.phone_number_administration.get_search_by_id( - search_id=reservation_id - ) - return AsyncLROPoller(client=self._phone_number_administration_client.phone_number_administration, - initial_response=initial_state, - deserialization_callback=None, - polling_method=reservation_polling) - - async def __aenter__(self) -> "PhoneNumbersAdministrationClient": - await self._phone_number_administration_client.__aenter__() - return self - - async def __aexit__(self, *args: "Any") -> None: - await self.close() - - async def close(self) -> None: - """Close the :class: - `~azure.communication.administration.aio.PhoneNumbersAdministrationClient` session. - """ - await self._phone_number_administration_client.__aexit__() diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py new file mode 100644 index 000000000000..04eb62437ba6 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py @@ -0,0 +1,250 @@ +from azure.core.tracing.decorator import distributed_trace +from azure.core.paging import ItemPaged +from azure.core.polling import LROPoller +from .._generated._phone_numbers_client import PhoneNumbersClient as PhoneNumbersClientGen +from .._generated.models import PhoneNumberSearchRequest +from .._shared.utils import parse_connection_str, get_authentication_policy +from .._version import SDK_MONIKER +import pytest + + +class PhoneNumbersClient(object): + def __init__( + self, + endpoint, # type: str + credential, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + try: + if not endpoint.lower().startswith('http'): + endpoint = "https://" + endpoint + except AttributeError: + raise ValueError("Account URL must be a string.") + + if not credential: + raise ValueError( + "You need to provide account shared key to authenticate.") + + self._endpoint = endpoint + self._phone_number_client = PhoneNumbersClientGen( + self._endpoint, + authentication_policy=get_authentication_policy(endpoint, credential), + sdk_moniker=SDK_MONIKER, + **kwargs) + + @classmethod + def from_connection_string( + cls, conn_str, # type: str + **kwargs # type: Any + ): + # type: (...) -> PhoneNumbersClient + """Create PhoneNumbersClient from a Connection String. + :param str conn_str: + A connection string to an Azure Communication Service resource. + :returns: Instance of PhoneNumbersClient. + :rtype: ~azure.communication.PhoneNumbersClient + """ + endpoint, access_key = parse_connection_str(conn_str) + + return cls(endpoint, access_key, **kwargs) + + + @distributed_trace + async def begin_purchase_phone_numbers( + self, + search_id, + **kwargs + ): + # type: (...) -> AsyncLROPollerLROPoller[PhoneNumberSearchResult] + """Purchases phone numbers. + + :param search_id: The search id. + :type search_id: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the LROBasePolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.communication.phonenumbers.models.PhoneNumberSearchResult] + """ + return await self._phone_number_client.phone_numbers.begin_purchase_phone_numbers( + search_id, + **kwargs + ) + + @distributed_trace + async def begin_release_phone_number( + self, + phone_number, + **kwargs + ): + # type: (...) -> AsyncLROPoller[None] + """Releases an acquired phone number. + + :param phone_number: Phone number to be released, e.g. +11234567890. + :type phone_number: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the LROBasePolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :rtype: ~azure.core.polling.AsyncLROPoller[None] + """ + return await self._phone_number_client.phone_numbers.begin_release_phone_number( + phone_number, + **kwargs + ) + + @distributed_trace + async def begin_search_available_phone_numbers( + self, + country_code, + phone_number_type, + assignment_type, + capabilities, + area_code, + quantity = 1, + **kwargs + ): + # type: (...) -> AsyncLROPoller[PhoneNumberSearchResult] + """Search for available phone numbers to purchase. + + :param country_code: The ISO 3166-2 country code, e.g. US. + :type country_code: str + :param phone_number_type: Required. The type of phone numbers to search for, e.g. geographic, + or tollFree. Possible values include: "geographic", "tollFree". + :type phone_number_type: str or ~azure.communication.phonenumbers.models.PhoneNumberType + :param assignment_type: Required. The assignment type of the phone numbers to search for. A + phone number can be assigned to a person, or to an application. Possible values include: + "user", "application". + :type assignment_type: str or + ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType + :param capabilities: Required. Capabilities of a phone number. + :type capabilities: ~azure.communication.phonenumbers.models.PhoneNumberCapabilities + :param area_code: The area code of the desired phone number, e.g. 425. + :type area_code: str + :param quantity: The quantity of phone numbers in the search. Should be at least 1. + :type quantity: int + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the LROBasePolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.communication.phonenumbers.models.PhoneNumberSearchResult] + """ + search_request = PhoneNumberSearchRequest( + phone_number_type = phone_number_type, + assignment_type = assignment_type, + capabilities = capabilities, + area_code = area_code, + quantity = quantity + ) + return await self._phone_number_client.phone_numbers.begin_search_available_phone_numbers( + country_code, + search_request, + **kwargs + ) + + async def begin_update_phone_number_capabilities( + self, + phone_number, + sms, + calling, + **kwargs + ): + # type: (...) -> AsyncLROPoller["_models.AcquiredPhoneNumber"] + """Updates the capabilities of a phone number. + + :param phone_number: The phone number id in E.164 format. The leading plus can be either + or + encoded as %2B, e.g. +11234567890. + :type phone_number: str + :param calling: Capability value for calling. + :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :param sms: Capability value for SMS. + :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: Pass in True if you'd like the LROBasePolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :rtype: ~azure.core.polling.AsyncLROPoller[AcquiredPhoneNumber] + """ + return await self._phone_number_client.phone_numbers.begin_update_capabilities( + phone_number, + calling, + sms, + **kwargs + ) + + @distributed_trace + async def get_phone_number( + self, + phone_number, + **kwargs + ): + # type: (...) -> AcquiredPhoneNumber + """Gets the details of the given acquired phone number. + + :param phone_number: The acquired phone number whose details are to be fetched in E.164 format, + e.g. +11234567890. + :type phone_number: str + :keyword callable cls: A custom type or function that will be passed the direct response + :rtype: ~azure.communication.phonenumbers.models.AcquiredPhoneNumber + """ + return await self._phone_number_client.phone_numbers.get_by_number( + phone_number, + **kwargs + ) + + @distributed_trace + async def list_acquired_phone_numbers( + self, + **kwargs + ): + # type: (...) -> AsyncItemPaged[AcquiredPhoneNumbers] + """Gets the list of all acquired phone numbers. + + :param skip: An optional parameter for how many entries to skip, for pagination purposes. The + default value is 0. + :type skip: int + :param top: An optional parameter for how many entries to return, for pagination purposes. The + default value is 100. + :type top: int + :rtype: ~azure.core.paging.AsyncItemPaged[~azure.communication.phonenumbers.models.AcquiredPhoneNumbers] + """ + return await self._phone_number_client.phone_numbers.list_phone_numbers( + **kwargs + ) + + @distributed_trace + async def update_phone_number( + self, + phone_number, + callback_uri, + application_id, + **kwargs + ): + # type: (...) -> AcquiredPhoneNumber + """Updates the configuration of a phone number. + + :param phone_number: Phone number to be updated, e.g. +11234567890. + :type phone_number: str + :param callback_uri: The webhook for receiving incoming events. + e.g. "https://{{site-name}}.azurewebsites.net/api/updates". + Please read https://docs.microsoft.com/en-us/azure/communication-services/concepts/event- + handling + for integration with Azure Event Grid to deliver real-time event notifications. + :type callback_uri: str + :param application_id: The application id of the application to which to configure. + :type application_id: str + :rtype: ~azure.communication.phonenumbers.models.AcquiredPhoneNumber + """ + return await self._phone_number_client.phone_numbers.update( + phone_number, + callback_uri, + application_id, + **kwargs + ) \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_polling_async.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_polling_async.py deleted file mode 100644 index ef22bbcdd74a..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_polling_async.py +++ /dev/null @@ -1,92 +0,0 @@ -# pylint: disable=W0231 -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- -import asyncio -from typing import Union -import base64 -from functools import partial - -from azure.core.polling import AsyncPollingMethod - -from .._generated.models import ( - PhoneNumberReservation, - PhoneNumberRelease -) - -class PhoneNumberBasePollingAsync(AsyncPollingMethod): - """ABC class for reserve/purchase/release phone number related polling. - """ - def __init__(self, is_terminated, polling_interval=5): - # type: (bool, int) -> None - self._response = None - self._client = None - self._query_status = None - self._is_terminated = is_terminated - self._polling_interval = polling_interval - - async def _update_status(self): - # type: () -> None - if self._query_status is None: - raise Exception("this poller has not been initialized") - self._response = await self._query_status() # pylint: disable=E1102 - - def initialize(self, client, initial_response, deserialization_callback): - # type: (Any, Any, Callable) -> None - self._client = client - self._response = initial_response - - async def run(self): - # type: () -> None - while not self.finished(): - await self._update_status() - if not self.finished(): - await asyncio.sleep(self._polling_interval) - - def finished(self): - # type: () -> bool - if self._response.status is None: - return False - return self._is_terminated(self._response.status) - - def resource(self): - # type: () -> Union[PhoneNumberReservation, PhoneNumberRelease] - if not self.finished(): - return None - return self._response - - def status(self): - # type: () -> str - return self._response.status - - def get_continuation_token(self): - # type() -> str - import pickle - return base64.b64encode(pickle.dumps(self._response)).decode('ascii') - - @classmethod - def from_continuation_token(cls, continuation_token, client, **kwargs): # pylint: disable=W0221 - # type(str, PhoneNumbersAdministrationClient, Any) -> Tuple - import pickle - initial_response = pickle.loads(base64.b64decode(continuation_token)) # nosec - return client, initial_response, None - -class ReservePhoneNumberPollingAsync(PhoneNumberBasePollingAsync): - def initialize(self, client, initial_response, deserialization_callback): - # type: (Any, Any, Callable) -> None - super().initialize(client, initial_response, deserialization_callback) - self._query_status = partial(self._client.get_search_by_id, search_id=initial_response.reservation_id) - -class PurchaseReservationPollingAsync(PhoneNumberBasePollingAsync): - def initialize(self, client, initial_response, deserialization_callback): - # type: (Any, Any, Callable) -> None - super().initialize(client, initial_response, deserialization_callback) - self._query_status = partial(self._client.get_search_by_id, search_id=initial_response.reservation_id) - -class ReleasePhoneNumberPollingAsync(PhoneNumberBasePollingAsync): - def initialize(self, client, initial_response, deserialization_callback): - # type: (Any, Any, Callable) -> None - super().initialize(client, initial_response, deserialization_callback) - self._query_status = partial(self._client.get_release_by_id, release_id=initial_response.release_id) diff --git a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_area_codes_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/phone_number_area_codes_sample.py deleted file mode 100644 index ef576e784c81..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_area_codes_sample.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -""" -FILE: phone_number_area_codes_sample.py -DESCRIPTION: - This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. -USAGE: - python phone_number_area_codes_sample.py - Set the environment variables with your own values before running the sample: - 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service - 2) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_COUNTRY_CODE - The country code you want to get area codes from - 3) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_ID_AREA_CODES - The phone plan id you want to get area codes from -""" - -import os -from azure.communication.phonenumbers import ( - PhoneNumbersAdministrationClient -) - -connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) -country_code = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_COUNTRY_CODE', "US") -phone_plan_id_area_codes = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_ID_AREA_CODES', "phone-plan-id") - - -def get_all_area_codes(): - # [START get_all_area_codes] - all_area_codes = phone_number_administration_client.get_all_area_codes( - location_type="NotRequired", - country_code=country_code, - phone_plan_id=phone_plan_id_area_codes - ) - # [END get_all_area_codes] - print('all_area_codes:') - print(all_area_codes) - - -if __name__ == '__main__': - get_all_area_codes() diff --git a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_area_codes_sample_async.py b/sdk/communication/azure-communication-phonenumbers/samples/phone_number_area_codes_sample_async.py deleted file mode 100644 index 6280bd576776..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_area_codes_sample_async.py +++ /dev/null @@ -1,50 +0,0 @@ -# coding: utf-8 - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -""" -FILE: phone_number_area_codes_sample_async.py -DESCRIPTION: - This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. -USAGE: - python phone_number_area_codes_sample_async.py - Set the environment variables with your own values before running the sample: - 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service - 2) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_COUNTRY_CODE - The country code you want to get area codes from - 3) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_ID_AREA_CODES - The phone plan id you want to get area codes from -""" - -import os -import asyncio -from azure.communication.phonenumbers.aio import PhoneNumbersAdministrationClient - -connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -country_code = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_COUNTRY_CODE', "US") -phone_plan_id_area_codes = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_ID_AREA_CODES', "phone-plan-id") - - -async def get_all_area_codes(): - # [START get_all_area_codes] - phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string( - connection_str) - async with phone_number_administration_client: - all_area_codes = await phone_number_administration_client.get_all_area_codes( - location_type="NotRequired", - country_code=country_code, - phone_plan_id=phone_plan_id_area_codes - ) - # [END get_all_area_codes] - print('all_area_codes:') - print(all_area_codes) - - -async def main(): - await get_all_area_codes() - -if __name__ == '__main__': - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) diff --git a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_capabilities_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/phone_number_capabilities_sample.py deleted file mode 100644 index ef4e0a7af6ee..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_capabilities_sample.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding: utf-8 - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -""" -FILE: phone_number_capabilities_sample.py -DESCRIPTION: - This sample demonstrates how to get number capabilities via a connection string, capabilities update id and phone number for capabilities. -USAGE: - python phone_number_capabilities_sample.py - Set the environment variables with your own values before running the sample: - 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service - 2) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_CAPABILITIES_ID - The capabilities id you want to get - 3) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONENUMBER_FOR_CAPABILITIES - The phone number you want to update capabilities to -""" - -import os -from azure.communication.phonenumbers import ( - PhoneNumbersAdministrationClient, - NumberUpdateCapabilities -) - -connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) -capabilities_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_CAPABILITIES_ID', "capabilities-id") -phonenumber_for_capabilities = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONENUMBER_FOR_CAPABILITIES', "+17771234567") - - -def list_all_phone_numbers(): - # [START list_all_phone_numbers] - list_all_phone_numbers_response = phone_number_administration_client.list_all_phone_numbers() - # [END list_all_phone_numbers] - print('list_all_phone_numbers_response:') - for phone_number in list_all_phone_numbers_response: - print(phone_number) - - -def get_capabilities_update(): - # [START get_capabilities_update] - capabilities_response = phone_number_administration_client.get_capabilities_update( - capabilities_update_id=capabilities_id - ) - # [END get_capabilities_update] - print('capabilities_response:') - print(capabilities_response) - - -def update_capabilities(): - # [START update_capabilities] - update = NumberUpdateCapabilities(add=iter(["InboundCalling"])) - - phone_number_capabilities_update = { - phonenumber_for_capabilities: update - } - - capabilities_response = phone_number_administration_client.update_capabilities( - phone_number_capabilities_update=phone_number_capabilities_update - ) - # [END update_capabilities] - print('capabilities_response:') - print(capabilities_response) - - -if __name__ == '__main__': - list_all_phone_numbers() - get_capabilities_update() - update_capabilities() diff --git a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_capabilities_sample_async.py b/sdk/communication/azure-communication-phonenumbers/samples/phone_number_capabilities_sample_async.py deleted file mode 100644 index 9934680d9c6f..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_capabilities_sample_async.py +++ /dev/null @@ -1,82 +0,0 @@ -# coding: utf-8 - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -""" -FILE: phone_number_capabilities_sample_async.py -DESCRIPTION: - This sample demonstrates how to get number capabilities via a connection string, capabilities update id and phone number for capabilities. -USAGE: - python phone_number_capabilities_sample_async.py - Set the environment variables with your own values before running the sample: - 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service - 2) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_CAPABILITIES_ID - The capabilities id you want to get - 3) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONENUMBER_FOR_CAPABILITIES - The phone number you want to update capabilities to -""" - -import asyncio -import os -from azure.communication.phonenumbers.aio import PhoneNumbersAdministrationClient -from azure.communication.phonenumbers import NumberUpdateCapabilities - - -connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -capabilities_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_CAPABILITIES_ID', "capabilities-id") -phonenumber_for_capabilities = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONENUMBER_FOR_CAPABILITIES', - "phone-number-for-capabilities") - - -async def list_all_phone_numbers(): - # [START list_all_phone_numbers] - phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - async with phone_number_administration_client: - list_all_phone_numbers_response = phone_number_administration_client.list_all_phone_numbers() - print('list_all_phone_numbers_response:') - async for phone_number in list_all_phone_numbers_response: - print(phone_number) - # [END list_all_phone_numbers] - - -async def get_capabilities_update(): - # [START get_capabilities_update] - phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - async with phone_number_administration_client: - capabilities_response = await phone_number_administration_client.get_capabilities_update( - capabilities_update_id=capabilities_id - ) - print('capabilities_response:') - print(capabilities_response) - # [END get_capabilities_update] - - -async def update_capabilities(): - # [START update_capabilities] - phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - update = NumberUpdateCapabilities(add=iter(["InboundCalling"])) - - phone_number_capabilities_update = { - phonenumber_for_capabilities: update - } - - async with phone_number_administration_client: - capabilities_response = await phone_number_administration_client.update_capabilities( - phone_number_capabilities_update=phone_number_capabilities_update - ) - print('capabilities_response:') - print(capabilities_response) - # [END update_capabilities] - - -async def main(): - await list_all_phone_numbers() - await get_capabilities_update() - await update_capabilities() - - -if __name__ == '__main__': - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) diff --git a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_configuration_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/phone_number_configuration_sample.py deleted file mode 100644 index fac5b8bdf11a..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_configuration_sample.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -""" -FILE: phone_number_configuration_sample.py -DESCRIPTION: - This sample demonstrates how to configure phone numbers and get phone number configuration via a connection string and phone number to configure -USAGE: - python phone_number_configuration_sample.py - Set the environment variables with your own values before running the sample: - 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service - 2) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONENUMBER_TO_CONFIGURE - The phone number you want to configure -""" - - -import os -from azure.communication.phonenumbers import ( - PhoneNumbersAdministrationClient, - PstnConfiguration -) - -connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) -phonenumber_to_configure = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONENUMBER_TO_CONFIGURE', - "phonenumber_to_configure") - - -def get_number_configuration(): - # [START get_number_configuration] - phone_number_configuration_response = phone_number_administration_client.get_number_configuration( - phone_number=phonenumber_to_configure - ) - # [END get_number_configuration] - print('phone_number_configuration_response:') - print(phone_number_configuration_response) - - -def configure_number(): - # [START configure_number] - pstn_config = PstnConfiguration( - callback_url="https://callbackurl", - application_id="ApplicationId" - ) - phone_number_administration_client.configure_number( - pstn_configuration=pstn_config, - phone_number=phonenumber_to_configure - ) - # [END configure_number] - - -if __name__ == '__main__': - get_number_configuration() - configure_number() diff --git a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_configuration_sample_async.py b/sdk/communication/azure-communication-phonenumbers/samples/phone_number_configuration_sample_async.py deleted file mode 100644 index 824f981c53f0..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_configuration_sample_async.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding: utf-8 - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -""" -FILE: phone_number_configuration_sample_async.py -DESCRIPTION: - This sample demonstrates how to configure phone numbers and get phone number configuration via a connection string and phone number to configure -USAGE: - python phone_number_configuration_sample_async.py - Set the environment variables with your own values before running the sample: - 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service - 2) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONENUMBER_TO_CONFIGURE - The phone number you want to configure -""" - -import os -import asyncio -from azure.communication.phonenumbers.aio import PhoneNumbersAdministrationClient -from azure.communication.phonenumbers import PstnConfiguration - -connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -phonenumber_to_configure = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONENUMBER_TO_CONFIGURE', - "phonenumber_to_configure") - - -async def get_number_configuration(): - # [START get_number_configuration] - phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - async with phone_number_administration_client: - phone_number_configuration_response = await phone_number_administration_client.get_number_configuration( - phone_number=phonenumber_to_configure - ) - print('phone_number_configuration_response:') - print(phone_number_configuration_response) - # [END get_number_configuration] - - -async def configure_number(): - # [START configure_number] - phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - pstn_config = PstnConfiguration( - callback_url="https://callbackurl", - application_id="ApplicationId" - ) - async with phone_number_administration_client: - await phone_number_administration_client.configure_number( - pstn_configuration=pstn_config, - phone_number=phonenumber_to_configure - ) - # [END configure_number] - - -async def main(): - await get_number_configuration() - await configure_number() - -if __name__ == '__main__': - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) diff --git a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_orders_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/phone_number_orders_sample.py deleted file mode 100644 index c60c2663e574..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_orders_sample.py +++ /dev/null @@ -1,110 +0,0 @@ -# coding: utf-8 - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -""" -FILE: phone_number_orders_sample.py -DESCRIPTION: - This sample demonstrates how to list, acquire and cancel phone number orders via a connection string, - reservation id, phone plan id and and area code. -USAGE: - python phone_number_orders_sample.py - Set the environment variables with your own values before running the sample: - 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service - 2) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RELEASE_ID - The release id you want to get info from - 3) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RESERVATION_ID - The reservation id you want to get info from - 4) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_AREA_CODE_FOR_RESERVATION - The area code to create reservation - 5) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_ID - The phone plan id - 6) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RESERVATION_ID_TO_PURCHASE - The reservation id you want to purchase - 7) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RESERVATION_ID_TO_CANCEL - The reservation id you want to cancel -""" - - -import os -from azure.communication.phonenumbers import ( - PhoneNumbersAdministrationClient, - CreateSearchOptions -) - -connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) -release_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RELEASE_ID', "release-id") -reservation_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RESERVATION_ID', "reservation-id") -area_code_for_reservation = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_AREA_CODE_FOR_RESERVATION', "area-code") -phone_plan_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_ID', "phone-plan-id") -reservation_id_to_purchase = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RESERVATION_ID_TO_PURCHASE', - "reservation-id") -reservation_id_to_cancel = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RESERVATION_ID_TO_CANCEL', - "reservation-id") - - -def get_release_by_id(): - # [START get_release_by_id] - phone_number_release_response = phone_number_administration_client.get_release_by_id( - release_id=release_id - ) - # [END get_release_by_id] - print('phone_number_release_response:') - print(phone_number_release_response) - - -def list_all_releases(): - # [START get_release_by_id] - releases_response = phone_number_administration_client.list_all_releases() - # [END get_release_by_id] - print('releases_response:') - for release in releases_response: - print(release) - - -def get_reservation_by_id(): - # [START get_reservation_by_id] - phone_number_reservation_response = phone_number_administration_client.get_reservation_by_id( - reservation_id=reservation_id - ) - # [END get_reservation_by_id] - print('phone_number_reservation_response:') - print(phone_number_reservation_response) - - -def begin_reserve_phone_numbers(): - # [START begin_reserve_phone_numbers] - reserve_phone_numbers_poller = phone_number_administration_client.begin_reserve_phone_numbers( - area_code=area_code_for_reservation, - description="testreservation20200014", - display_name="testreservation20200014", - phone_plan_ids=[phone_plan_id], - quantity=1 - ) - # [END begin_reserve_phone_numbers] - print('reserve phone numbers status:') - print(reserve_phone_numbers_poller.status()) - - -def cancel_reservation(): - # [START cancel_reservation] - phone_number_administration_client.cancel_reservation( - reservation_id=reservation_id_to_cancel - ) - # [START cancel_reservation] - - -def begin_purchase_reservation(): - # [START begin_purchase_reservation] - phone_number_administration_client.begin_purchase_reservation( - reservation_id=reservation_id_to_purchase - ) - # [END begin_purchase_reservation] - - -if __name__ == '__main__': - get_release_by_id() - list_all_releases() - get_reservation_by_id() - begin_reserve_phone_numbers() - cancel_reservation() - # begin_purchase_reservation() #currently throws error if purchase an already purchased number diff --git a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_orders_sample_async.py b/sdk/communication/azure-communication-phonenumbers/samples/phone_number_orders_sample_async.py deleted file mode 100644 index 063ccd27cc6c..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_orders_sample_async.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding: utf-8 - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -""" -FILE: phone_number_orders_sample_async.py -DESCRIPTION: - This sample demonstrates how to list, acquire and cancel phone number orders via a connection string, - reservation id, phone plan id and and area code. -USAGE: - python phone_number_orders_sample.py - Set the environment variables with your own values before running the sample: - 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service - 2) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RELEASE_ID - The release id you want to get info from - 3) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RESERVATION_ID - The reservation id you want to get info from - 4) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_AREA_CODE_FOR_RESERVATION - The area code to create reservation - 5) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_ID - The phone plan id - 6) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RESERVATION_ID_TO_PURCHASE - The reservation id you want to purchase - 7) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RESERVATION_ID_TO_CANCEL - The reservation id you want to cancel -""" - -import os -import asyncio -from azure.communication.phonenumbers.aio import PhoneNumbersAdministrationClient -from azure.communication.phonenumbers import CreateSearchOptions - -connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) -release_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RELEASE_ID', "release-id") -reservation_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RESERVATION_ID', "reservation-id") -area_code_for_reservation = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_AREA_CODE_FOR_RESERVATION', "area-code") -phone_plan_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_ID', "phone-plan-id") -reservation_id_to_purchase = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RESERVATION_ID_TO_PURCHASE', - "reservation-id") -reservation_id_to_cancel = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RESERVATION_ID_TO_CANCEL', - "reservation-id") - - -async def get_release_by_id(): - # [START get_release_by_id] - phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - async with phone_number_administration_client: - phone_number_release_response = await phone_number_administration_client.get_release_by_id( - release_id=release_id - ) - print('phone_number_release_response:') - print(phone_number_release_response) - # [END get_release_by_id] - - -async def list_all_releases(): - # [START list_all_releases] - phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - async with phone_number_administration_client: - releases_response = phone_number_administration_client.list_all_releases() - print('releases_response:') - async for release in releases_response: - print(release) - # [END list_all_releases] - - -async def get_reservation_by_id(): - # [START get_reservation_by_id] - phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - async with phone_number_administration_client: - phone_number_reservation_response = await phone_number_administration_client.get_reservation_by_id( - reservation_id=reservation_id - ) - print('phone_number_reservation_response:') - print(phone_number_reservation_response) - await phone_number_administration_client.close() - # [END get_reservation_by_id] - - -async def begin_reserve_phone_numbers(): - # [START begin_reserve_phone_numbers] - phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - reservationOptions = CreateSearchOptions( - area_code=area_code_for_reservation, - description="testreservation20200014", - display_name="testreservation20200014", - phone_plan_ids=[phone_plan_id], - quantity=1 - ) - async with phone_number_administration_client: - reserve_phone_numbers_poller = await phone_number_administration_client.begin_reserve_phone_numbers( - area_code=area_code_for_reservation, - description="testreservation20200014", - display_name="testreservation20200014", - phone_plan_ids=[phone_plan_id], - quantity=1 - ) - print('reserve phone numbers status:') - print(reserve_phone_numbers_poller.status()) - # [END begin_reserve_phone_numbers] - - -async def cancel_reservation(): - # [START cancel_reservation] - phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - async with phone_number_administration_client: - await phone_number_administration_client.cancel_reservation( - reservation_id=reservation_id_to_cancel - ) - # [END cancel_reservation] - - -async def begin_purchase_reservation(): - # [START begin_purchase_reservation] - phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - async with phone_number_administration_client: - await phone_number_administration_client.begin_purchase_reservation( - reservation_id=reservation_id_to_purchase - ) - # [END begin_purchase_reservation] - - -async def main(): - await get_release_by_id() - await list_all_releases() - await get_reservation_by_id() - await begin_reserve_phone_numbers() - await cancel_reservation() - # await begin_purchase_reservation() #currently throws error if purchase an already purchased number - -if __name__ == '__main__': - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) diff --git a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_plans_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/phone_number_plans_sample.py deleted file mode 100644 index cbf0229ea18e..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_plans_sample.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding: utf-8 - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -""" -FILE: phone_number_plans_sample.py -DESCRIPTION: - This sample demonstrates how to list phone plans via a connection string, country code, phone plan id and phone plan group id -USAGE: - python phone_number_plans_sample.py - Set the environment variables with your own values before running the sample: - 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service - 2) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_COUNTRY_CODE - The country code - 3) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_GROUP_ID - The phone plan group id you want to use to list phone plans - 4) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_ID - The phone plan id you want to use to get location options -""" - -import os -from azure.communication.phonenumbers import ( - PhoneNumbersAdministrationClient -) - -connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) -country_code = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_COUNTRY_CODE', "US") -phone_plan_group_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_GROUP_ID', "phone-plan-group-id") -phone_plan_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_ID', "phone-plan-id") - - -def list_phone_plan_groups(): - # [START list_phone_plan_groups] - phone_plan_groups_response = phone_number_administration_client.list_phone_plan_groups( - country_code=country_code - ) - # [END list_phone_plan_groups] - print('list_phone_plan_groups:') - for phone_plan_group in phone_plan_groups_response: - print(phone_plan_group) - - -def list_phone_plans(): - # [START list_phone_plans] - phone_plans_response = phone_number_administration_client.list_phone_plans( - country_code=country_code, - phone_plan_group_id=phone_plan_group_id - ) - # [END list_phone_plans] - print('list_phone_plans:') - for phone_plan in phone_plans_response: - print(phone_plan) - - -def get_phone_plan_location_options(): - # [START get_phone_plan_location_options] - location_options_response = phone_number_administration_client.get_phone_plan_location_options( - country_code=country_code, - phone_plan_group_id=phone_plan_group_id, - phone_plan_id=phone_plan_id - ) - # [END get_phone_plan_location_options] - print('get_phone_plan_location_options:') - print(location_options_response) - - -if __name__ == '__main__': - list_phone_plan_groups() - list_phone_plans() - get_phone_plan_location_options() diff --git a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_plans_sample_async.py b/sdk/communication/azure-communication-phonenumbers/samples/phone_number_plans_sample_async.py deleted file mode 100644 index ea08bd6f3d00..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_plans_sample_async.py +++ /dev/null @@ -1,81 +0,0 @@ -# coding: utf-8 - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -""" -FILE: phone_number_plans_sample_async.py -DESCRIPTION: - This sample demonstrates how to list phone plans via a connection string, country code, phone plan id and phone plan group id -USAGE: - python phone_number_plans_sample_async.py - Set the environment variables with your own values before running the sample: - 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service - 2) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_COUNTRY_CODE - The country code - 3) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_GROUP_ID - The phone plan group id you want to use to list phone plans - 4) AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_ID - The phone plan id you want to use to get location options -""" - - -import os -import asyncio -from azure.communication.phonenumbers.aio import PhoneNumbersAdministrationClient - -connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -country_code = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_COUNTRY_CODE', "US") -phone_plan_group_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_GROUP_ID', "phone-plan-group-id") -phone_plan_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_ID', "phone-plan-id") - - -async def list_phone_plan_groups(): - # [START list_phone_plan_groups] - phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - async with phone_number_administration_client: - phone_plan_groups_response = phone_number_administration_client.list_phone_plan_groups( - country_code=country_code - ) - print('list_phone_plan_groups:') - async for phone_plan_group in phone_plan_groups_response: - print(phone_plan_group) - # [END list_phone_plan_groups] - - -async def list_phone_plans(): - # [START list_phone_plans] - phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - async with phone_number_administration_client: - phone_plans_response = phone_number_administration_client.list_phone_plans( - country_code=country_code, - phone_plan_group_id=phone_plan_group_id - ) - print('list_phone_plans:') - async for phone_plan in phone_plans_response: - print(phone_plan) - # [END list_phone_plans] - - -async def get_phone_plan_location_options(): - # [START get_phone_plan_location_options] - phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - async with phone_number_administration_client: - location_options_response = await phone_number_administration_client.get_phone_plan_location_options( - country_code=country_code, - phone_plan_group_id=phone_plan_group_id, - phone_plan_id=phone_plan_id - ) - print('get_phone_plan_location_options:') - print(location_options_response) - # [START get_phone_plan_location_options] - - -async def main(): - await list_phone_plan_groups() - await list_phone_plans() - await get_phone_plan_location_options() - -if __name__ == '__main__': - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) diff --git a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_supported_countries_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/phone_number_supported_countries_sample.py deleted file mode 100644 index e2510c3329a0..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_supported_countries_sample.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -""" -FILE: phone_number_supported_countries_sample.py -DESCRIPTION: - This sample demonstrates how to get supported countries via a connection string -USAGE: - python phone_number_supported_countries_sample.py - Set the environment variables with your own values before running the sample: - 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service -""" - - -import os -from azure.communication.phonenumbers import ( - PhoneNumbersAdministrationClient -) - -connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - - -def list_all_supported_countries(): - # [START list_all_supported_countries] - supported_countries = phone_number_administration_client.list_all_supported_countries() - # [END list_all_supported_countries] - print('supported_countries:') - for supported_country in supported_countries: - print(supported_country) - - -if __name__ == '__main__': - list_all_supported_countries() diff --git a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_supported_countries_sample_async.py b/sdk/communication/azure-communication-phonenumbers/samples/phone_number_supported_countries_sample_async.py deleted file mode 100644 index 755e84d05a2c..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/samples/phone_number_supported_countries_sample_async.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -""" -FILE: phone_number_supported_countries_sample.py -DESCRIPTION: - This sample demonstrates how to get supported countries via a connection string -USAGE: - python phone_number_supported_countries_sample.py - Set the environment variables with your own values before running the sample: - 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service -""" - - -import os -import asyncio -from azure.communication.phonenumbers.aio import PhoneNumbersAdministrationClient - -connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') - - -async def list_all_supported_countries(): - # [START list_all_supported_countries] - phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) - async with phone_number_administration_client: - supported_countries = phone_number_administration_client.list_all_supported_countries() - print('supported_countries:') - async for supported_country in supported_countries: - print(supported_country) - # [END list_all_supported_countries] - - -async def main(): - await list_all_supported_countries() - -if __name__ == '__main__': - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) diff --git a/sdk/communication/azure-communication-phonenumbers/setup.cfg b/sdk/communication/azure-communication-phonenumbers/setup.cfg index 3480374bc2f2..1d45b470b8ab 100644 --- a/sdk/communication/azure-communication-phonenumbers/setup.cfg +++ b/sdk/communication/azure-communication-phonenumbers/setup.cfg @@ -1,2 +1,2 @@ [bdist_wheel] -universal=1 \ No newline at end of file +universal=1 \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md b/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md index cda635961f5b..271a47186c1c 100644 --- a/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md +++ b/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md @@ -10,7 +10,7 @@ autorest ./PHONE_NUMBER_SWAGGER.md ### Settings ``` yaml -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/257f060be8b60d8468584682aa2d71b1faa5f82c/specification/communication/data-plane/Microsoft.CommunicationServicesAdministration/preview/2020-07-20-preview1/communicationservicesadministration.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/f20d92b324842b407e0dcce36ad0e67bd9bb66cf/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json output-folder: ../azure/communication/phonenumbers/_generated namespace: azure.communication.phonenumbers license-header: MICROSOFT_MIT_NO_VERSION diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/examples/CreateReleaseAsync.json b/sdk/communication/azure-communication-phonenumbers/swagger/examples/CreateReleaseAsync.json deleted file mode 100644 index 063a85f5aeac..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/swagger/examples/CreateReleaseAsync.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "parameters": { - "api-version": "2020-07-20-preview1", - "body": { - "telephoneNumbers": [ "+11234567890" ] - } - }, - "responses": { - "200": { - "headers": {}, - "body": { - "id": "0cc077cd-333a-39fd-90f7-560b1e06c63e" - } - } - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/examples/CreateSearchOrderAsync.json b/sdk/communication/azure-communication-phonenumbers/swagger/examples/CreateSearchOrderAsync.json deleted file mode 100644 index 7242d8403f3d..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/swagger/examples/CreateSearchOrderAsync.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "parameters": { - "api-version": "2020-07-20-preview1", - "body": { - "name": "Name", - "description": "Search Order Description", - "planSubTypeIds": ["0cc077cd-333a-39fd-90f7-560b1e06c63e"], - "areaCode": "604", - "quantity": 2, - "civicAddressId": "0cc077cd-333a-39fd-90f7-560b1e06c63e", - "requestingUser": { - "firstName": "John", - "lastName": "Smith", - "emailAddress": "johnsmith@contoso.com", - "phoneNumber": "12345", - "displayName": "John Smith" - } - } - }, - "responses": { - "201": { - "headers": {}, - "body": { - "id": "0cc077cd-5337-7msf-964e-560b1e06c63e" - } - } - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetAcquiredTelephoneNumbersAsync.json b/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetAcquiredTelephoneNumbersAsync.json deleted file mode 100644 index 48b4666c6e38..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetAcquiredTelephoneNumbersAsync.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "parameters": { - "api-version": "2020-07-20-preview1", - "locale": "en-us" - }, - "responses": { - "200": { - "headers": {}, - "body": { - "items": [ - { - "telephoneNumber": "+11234567890", - "numberType": "Cloud", - "civicAddressId": null, - "acquiredCapabilities": null, - "availableCapabilities": null, - "blockId": null, - "rangeId": null, - "assignmentStatus": "Unassigned", - "placeName": "Toll-Free, United States", - "activationState": "Activated" - }, - { - "telephoneNumber": "+10123456789", - "numberType": "Cloud", - "civicAddressId": null, - "acquiredCapabilities": null, - "availableCapabilities": null, - "blockId": null, - "rangeId": null, - "assignmentStatus": "Unassigned", - "placeName": "Toll-Free, United States", - "activationState": "Activated" - } - ] - } - } - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetAreaCodesAsync.json b/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetAreaCodesAsync.json deleted file mode 100644 index 0cc7ce546ca0..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetAreaCodesAsync.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "parameters": { - "api-version": "2020-07-20-preview1", - "addressId": "0cc077cd-333a-39fd-90f7-560b1e06c63e", - "locationType": "CivicAddress", - "country": "CA", - "planSubTypeId": "0cc077cd-333a-39fd-90f7-560b1e06c63e" - }, - "responses": { - "200": { - "headers": {}, - "body": { - "primaryAreaCodes": [ - "236", - "604", - "778" - ], - "secondaryAreaCodes": [] - } - } - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetCountriesAsync.json b/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetCountriesAsync.json deleted file mode 100644 index eee04b0bd0c8..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetCountriesAsync.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "parameters": { - "api-version": "2020-07-20-preview1", - "locale": "en-us" - }, - "responses": { - "200": { - "headers": {}, - "body": { - "items": [ - { - "name": "Australia", - "value": "AU" - }, - { - "name": "Japan", - "value": "JP" - }, - { - "name": "United States", - "value": "US" - } - ] - } - - } - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetNumberConfigurationAsync.json b/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetNumberConfigurationAsync.json deleted file mode 100644 index 3cfd910129cb..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetNumberConfigurationAsync.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "parameters": { - "api-version": "2020-07-20-preview1", - "phoneNumber": "+11234567890" - }, - "responses": { - "200": { - "headers": {}, - "body": { - "pstnConfiguration": { - "callbackUrl": "www.callback.com", - "applicationId": "abc123" - } - } - } - } - } diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetOrdersAsync.json b/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetOrdersAsync.json deleted file mode 100644 index 4ef8ad59fc4d..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetOrdersAsync.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "parameters": { - "api-version": "2020-07-20-preview1" - }, - "responses": { - "200": { - "headers": {}, - "body": { - "items": [] - } - } - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetPlansAsync.json b/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetPlansAsync.json deleted file mode 100644 index a6b541386b08..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetPlansAsync.json +++ /dev/null @@ -1,145 +0,0 @@ -{ - "parameters": { - "api-version": "2020-07-20-preview1", - "country": "US", - "locale": "en-us" - }, - "responses": { - "200": { - "headers": {}, - "body": { - "items": [ - { - "id": "671ee064-662f-4c3b-82a9-af2ab200dd5c", - "type": "Direct", - "name": "Geographic", - "description": "These are inbound and outbound numbers.", - "subTypes": [ - { - "id": "27b53eec-8ff4-4070-8900-fbeaabfd158a", - "name": "Outbound Only PSTN - Geographic", - "locationType": "CivicAddress", - "areaCodes": null, - "locationOptions": null, - "requiresCivicAddress": false, - "blockSizes": [ 1 ], - "capabilities": [ "Azure", "OutboundCalling", "ThirdPartyAppAssignment", "Geographic" ], - "maximumSearchSize": 100 - }, - { - "id": "d0d438e7-923f-4210-8e05-365979e30414", - "name": "Inbound Only PSTN - Geographic", - "locationType": "CivicAddress", - "areaCodes": null, - "locationOptions": null, - "requiresCivicAddress": false, - "blockSizes": [ 1 ], - "capabilities": [ "Azure", "InboundCalling", "ThirdPartyAppAssignment", "Geographic" ], - "maximumSearchSize": 100 - } - ], - "carrierDetails": null - }, - { - "id": "d47a0cdc-8dc1-4e82-a29b-39067f7fc317", - "type": "Direct", - "name": "Toll Free", - "description": "These are toll free numbers.", - "subTypes": [ - { - "id": "0fad67fb-b455-439b-9f1c-3f22bb1ea350", - "name": "2-way SMS (A2P) & Outbound Only PSTN - Toll Free", - "locationType": "NotRequired", - "areaCodes": [ "888", "877", "866", "855", "844", "800", "833" ], - "locationOptions": null, - "requiresCivicAddress": false, - "blockSizes": [ 1 ], - "capabilities": [ "OutboundCalling", "ThirdPartyAppAssignment", "InboundA2PSms", "OutboundA2PSms", "TollFree" ], - "maximumSearchSize": 100 - }, - { - "id": "a06000d2-6ec2-4202-b9ce-e6963bed12f5", - "name": "2-way SMS (A2P) & Inbound Only PSTN - Toll Free", - "locationType": "NotRequired", - "areaCodes": [ "888", "877", "866", "855", "844", "800", "833" ], - "locationOptions": null, - "requiresCivicAddress": false, - "blockSizes": [ 1 ], - "capabilities": [ "InboundCalling", "ThirdPartyAppAssignment", "InboundA2PSms", "OutboundA2PSms", "TollFree" ], - "maximumSearchSize": 100 - }, - { - "id": "3865f174-c45b-4854-a04f-90ad5c8393ed", - "name": "2-way SMS (A2P) & 2-way PSTN - Toll Free", - "locationType": "NotRequired", - "areaCodes": [ "888", "877", "866", "855", "844", "800", "833" ], - "locationOptions": null, - "requiresCivicAddress": false, - "blockSizes": [ 1 ], - "capabilities": [ "InboundCalling", "OutboundCalling", "ThirdPartyAppAssignment", "InboundA2PSms", "OutboundA2PSms", "TollFree" ], - "maximumSearchSize": 100 - }, - { - "id": "4b6d0bbb-ce5e-4937-b8c4-f04a6d74822b", - "name": "Outbound Only SMS (A2P) & Outbound Only PSTN - Toll Free", - "locationType": "NotRequired", - "areaCodes": [ "888", "877", "866", "855", "844", "800", "833" ], - "locationOptions": null, - "requiresCivicAddress": false, - "blockSizes": [ 1 ], - "capabilities": [ "OutboundCalling", "ThirdPartyAppAssignment", "OutboundA2PSms", "TollFree" ], - "maximumSearchSize": 100 - }, - { - "id": "2eb579fc-0c41-46f4-a2cc-8c550b581b7b", - "name": "Outbound Only SMS (A2P) & Inbound Only PSTN - Toll Free", - "locationType": "NotRequired", - "areaCodes": [ "888", "877", "866", "855", "844", "800", "833" ], - "locationOptions": null, - "requiresCivicAddress": false, - "blockSizes": [ 1 ], - "capabilities": [ "InboundCalling", "ThirdPartyAppAssignment", "OutboundA2PSms", "TollFree" ], - "maximumSearchSize": 100 - }, - { - "id": "0ff321c3-7320-4f64-b3db-5b5c1a363d35", - "name": "2-way SMS (A2P) - Toll Free", - "locationType": "NotRequired", - "areaCodes": [ "888", "877", "866", "855", "844", "800", "833" ], - "locationOptions": null, - "requiresCivicAddress": false, - "blockSizes": [ 1 ], - "capabilities": [ "ThirdPartyAppAssignment", "InboundA2PSms", "OutboundA2PSms", "TollFree" ], - "maximumSearchSize": 100 - }, - { - "id": "fff1fa3a-e10c-40ee-9db4-178d43336757", - "name": "Outbound Only PSTN - Toll Free", - "locationType": "NotRequired", - "areaCodes": [ "888", "877", "866", "855", "844", "800", "833" ], - "locationOptions": null, - "requiresCivicAddress": false, - "blockSizes": [ 1 ], - "capabilities": [ "ThirdPartyAppAssignment", "OutboundCalling", "TollFree" ], - "maximumSearchSize": 100 - }, - { - "id": "7c618af1-60f1-4285-ba7e-aca89a5922a5", - "name": "Inbound Only PSTN - Toll Free", - "locationType": "NotRequired", - "areaCodes": [ "888", "877", "866", "855", "844", "800", "833" ], - "locationOptions": null, - "requiresCivicAddress": false, - "blockSizes": [ 1 ], - "capabilities": [ "ThirdPartyAppAssignment", "InboundCalling", "TollFree" ], - "maximumSearchSize": 100 - } - ], - "carrierDetails": null - } - ] - } - } - } -} - diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetReleaseByIdAsync.json b/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetReleaseByIdAsync.json deleted file mode 100644 index 8e2d80f841a1..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetReleaseByIdAsync.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "parameters": { - "api-version": "2020-07-20-preview1", - "orderId": "0cc077cd-333a-39fd-90f7-560b1e06c63e" - }, - "responses": { - "200": { - "headers": {}, - "body": { - "id": "0cc077cd-333a-39fd-90f7-560b1e06c63e" - } - } - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetSearchOrderAsync.json b/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetSearchOrderAsync.json deleted file mode 100644 index 97976bfaad90..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/swagger/examples/GetSearchOrderAsync.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "parameters": { - "api-version": "2020-07-20-preview1", - "orderId": "0cc077cd-333a-39fd-90f7-560b1e06c63e" - }, - "responses": { - "200": { - "headers": {}, - "body": { - "id": "0cc077cd-333a-39fd-90f7-560b1e06c63e", - "name": "Numbers for Vancouver Office", - "createdAt": "2020-06-18T17:11:52.5005818+00:00", - "createdBy": "sfbmra-dev.mtls-client.skype.net", - "description": "Get some new numbers for our office in Vancouver", - "planSubTypeId": "0cc077cd-333a-39fd-90f7-560b1e06c63e", - "areaCode": "604", - "quantity": 1, - "civicAddressId": "0cc077cd-333a-39fd-90f7-560b1e06c63e", - "locationOptions": [], - "status": "Manual", - "telephoneNumbers": [], - "reservationExpiryDate": null, - "errorCode": null, - "jobIds": [ "0cc077cd-333a-39fd-90f7-560b1e06c63e" ] - } - } - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/examples/RemoveNumberConfigurationAsync.json b/sdk/communication/azure-communication-phonenumbers/swagger/examples/RemoveNumberConfigurationAsync.json deleted file mode 100644 index 44e7c2e8e6c2..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/swagger/examples/RemoveNumberConfigurationAsync.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "parameters": { - "api-version": "2020-07-20-preview1", - "phoneNumber": "+11234567890", - }, - "responses": { - "204": {} - } - } diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/examples/UpdateNumberCapabilitiesAsync.json b/sdk/communication/azure-communication-phonenumbers/swagger/examples/UpdateNumberCapabilitiesAsync.json deleted file mode 100644 index 502bb6e5a1cb..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/swagger/examples/UpdateNumberCapabilitiesAsync.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "parameters": { - "api-version": "2020-07-20-preview1", - "body": { - "phoneNumbers": { - "12345878981": { - "add": [ - "InboundA2PSms", - "OutboundA2PSms" - ], - "remove": [] - }, - "12345878991": { - "add": [], - "remove": [ - "InboundA2PSms", - "OutboundA2PSms" - ] - } - } - } - }, - "responses": { - "200": { - "headers": {}, - "body": { - "id": "0cc077cd-5337-7msf-964e-560b1e06c63e" - } - } - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/examples/UpdateNumberConfigurationAsync.json b/sdk/communication/azure-communication-phonenumbers/swagger/examples/UpdateNumberConfigurationAsync.json deleted file mode 100644 index 9e0a34149e23..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/swagger/examples/UpdateNumberConfigurationAsync.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "parameters": { - "api-version": "2020-07-20-preview1", - "phoneNumber": "+11234567890", - "body": { - "pstnConfiguration": { - "callbackUrl": "www.callback.com", - "applicationId": "abc123" - } - } - }, - "responses": { - "204": {} - } - } diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/examples/UpdateSearchOrderAsync.json b/sdk/communication/azure-communication-phonenumbers/swagger/examples/UpdateSearchOrderAsync.json deleted file mode 100644 index 139fb9ee0b1f..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/swagger/examples/UpdateSearchOrderAsync.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "parameters": { - "api-version": "2020-07-20-preview1", - "orderId": "0cc077cd-333a-39fd-90f7-560b1e06c63e", - "body": { - "action": 2 - } - }, - "responses": { - "204": {} - } -} diff --git a/sdk/communication/azure-communication-phonenumbers/test/_shared/__init__.py b/sdk/communication/azure-communication-phonenumbers/test/_shared/__init__.py deleted file mode 100644 index 841b812e10ba..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/_shared/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# coding: utf-8 -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/test/_shared/asynctestcase.py b/sdk/communication/azure-communication-phonenumbers/test/_shared/asynctestcase.py deleted file mode 100644 index 197c48e0079b..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/_shared/asynctestcase.py +++ /dev/null @@ -1,27 +0,0 @@ - -# coding: utf-8 -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- -import functools -import asyncio -from azure_devtools.scenario_tests.utilities import trim_kwargs_from_test_function -from .testcase import CommunicationTestCase - -class AsyncCommunicationTestCase(CommunicationTestCase): - - @staticmethod - def await_prepared_test(test_fn): - """Synchronous wrapper for async test methods. Used to avoid making changes - upstream to AbstractPreparer (which doesn't await the functions it wraps) - """ - - @functools.wraps(test_fn) - def run(test_class_instance, *args, **kwargs): - trim_kwargs_from_test_function(test_fn, kwargs) - loop = asyncio.get_event_loop() - return loop.run_until_complete(test_fn(test_class_instance, **kwargs)) - - return run diff --git a/sdk/communication/azure-communication-phonenumbers/test/_shared/communication_service_preparer.py b/sdk/communication/azure-communication-phonenumbers/test/_shared/communication_service_preparer.py deleted file mode 100644 index e3907ff011e0..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/_shared/communication_service_preparer.py +++ /dev/null @@ -1,89 +0,0 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ - -import datetime - -from azure.mgmt.communication import CommunicationServiceManagementClient -from azure.mgmt.communication.models import CommunicationServiceResource -from devtools_testutils import( - AzureMgmtPreparer, - ResourceGroupPreparer, - FakeResource -) -from devtools_testutils.resource_testcase import RESOURCE_GROUP_PARAM -from azure_devtools.scenario_tests.exceptions import AzureTestError - -class CommunicationServicePreparer(AzureMgmtPreparer): - """Communication Service Preparer. - Creating and destroying test resources on demand - """ - def __init__( - self, - name_prefix="communication", - resource_group_parameter_name=RESOURCE_GROUP_PARAM, - disable_recording=True, - use_cache=False, - playback_fake_resource=None, - client_kwargs=None, - ): - super(CommunicationServicePreparer, self).__init__( - name_prefix, - random_name_length=24, - disable_recording=disable_recording, - playback_fake_resource=playback_fake_resource, - client_kwargs=client_kwargs, - ) - self.resource_group_parameter_name = resource_group_parameter_name - self.random_name_enabled = True - self.service_name = "TEST-SERVICE-NAME" - self.mgmt_client = None - self.set_cache(use_cache) - self.scrubbed_resource_name = "communicationegrcrs" - - def _get_resource_group(self, **kwargs): - try: - return kwargs[self.resource_group_parameter_name] - except KeyError: - template = ( - "To create a communication service a resource group is required. Please add " - "decorator @{} in front of this preparer." - ) - raise AzureTestError(template.format(ResourceGroupPreparer.__name__)) - - def create_resource(self, name, **kwargs): - if not self.is_live: - self.resource = FakeResource(name=self.scrubbed_resource_name, id=name) - - return { - "connection_string": "endpoint=https://{}.communication.azure.com/;accesskey=fake===".format(self.resource.name), - } - - self.test_class_instance.scrubber.register_name_pair(name, self.scrubbed_resource_name) - group_name = self._get_resource_group(**kwargs).name - - self.client = self.create_mgmt_client(CommunicationServiceManagementClient, polling_interval=30) - - self.resource = self.client.communication_service.begin_create_or_update( - group_name, - name, - CommunicationServiceResource(location="global", data_location="UnitedStates") - ).result() - - self.service_name = self.resource.name - - primary_connection_string = self.client.communication_service.list_keys( - group_name, - self.resource.name).primary_connection_string - - return { - "connection_string": primary_connection_string, - } - - def remove_resource(self, name, **kwargs): - if not self.is_live: - return - - group_name = self._get_resource_group(**kwargs).name - self.client.communication_service.begin_delete(group_name, self.service_name).wait() diff --git a/sdk/communication/azure-communication-phonenumbers/test/_shared/fake_token_credential.py b/sdk/communication/azure-communication-phonenumbers/test/_shared/fake_token_credential.py deleted file mode 100644 index b4fc2e6eaccf..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/_shared/fake_token_credential.py +++ /dev/null @@ -1,13 +0,0 @@ -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- -from azure.core.credentials import AccessToken - -class FakeTokenCredential(object): - def __init__(self): - self.token = AccessToken("Fake Token", 0) - - def get_token(self, *args): - return self.token \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/test/_shared/helper.py b/sdk/communication/azure-communication-phonenumbers/test/_shared/helper.py deleted file mode 100644 index 7338f10940a0..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/_shared/helper.py +++ /dev/null @@ -1,19 +0,0 @@ -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- -from azure_devtools.scenario_tests import RecordingProcessor - -class URIIdentityReplacer(RecordingProcessor): - """Replace the identity in request uri""" - def process_request(self, request): - import re - request.uri = re.sub('/identities/([^/?]+)', '/identities/sanitized', request.uri) - return request - - def process_response(self, response): - import re - if 'url' in response: - response['url'] = re.sub('/identities/([^/?]+)', '/identities/sanitized', response['url']) - return response \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py b/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py index f56f17e56a46..bda0dbdb7bdf 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py +++ b/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py @@ -5,9 +5,11 @@ # license information. # -------------------------------------------------------------------------- import re +import os from devtools_testutils import AzureTestCase from azure_devtools.scenario_tests import RecordingProcessor, ReplayableTest from azure_devtools.scenario_tests.utilities import is_text_payload +from azure.communication.administration._shared.utils import parse_connection_str class ResponseReplacerProcessor(RecordingProcessor): def __init__(self, keys=None, replacement="sanitized"): @@ -64,6 +66,16 @@ def _replace_keys(self, body): class CommunicationTestCase(AzureTestCase): FILTER_HEADERS = ReplayableTest.FILTER_HEADERS + ['x-azure-ref', 'x-ms-content-sha256', 'location'] - def __init__(self, method_name, *args, **kwargs): - super(CommunicationTestCase, self).__init__(method_name, *args, **kwargs) \ No newline at end of file + super(CommunicationTestCase, self).__init__(method_name, *args, **kwargs) + + def setUp(self): + super(CommunicationTestCase, self).setUp() + + if self.is_playback(): + self.connection_str = "endpoint=https://sanitized/;accesskey=fake===" + else: + self.connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') + endpoint, _ = parse_connection_str(self.connection_str) + self._resource_name = endpoint.split(".")[0] + self.scrubber.register_name_pair(self._resource_name, "sanitized") \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/test/_shared/utils.py b/sdk/communication/azure-communication-phonenumbers/test/_shared/utills.py similarity index 100% rename from sdk/communication/azure-communication-phonenumbers/test/_shared/utils.py rename to sdk/communication/azure-communication-phonenumbers/test/_shared/utills.py diff --git a/sdk/communication/azure-communication-phonenumbers/test/phone_number_helper.py b/sdk/communication/azure-communication-phonenumbers/test/phone_number_helper.py index 445632f40c97..fc84aeb70d23 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/phone_number_helper.py +++ b/sdk/communication/azure-communication-phonenumbers/test/phone_number_helper.py @@ -23,4 +23,4 @@ def process_response(self, response): response['url'] = re.sub('phoneplans/([^/?&]+)', 'phoneplans/sanitized', response['url']) response['url'] = re.sub('releases/([^/?&]+)', 'releases/sanitized', response['url']) response['url'] = re.sub('searches/([^/?&]+)', 'searches/sanitized', response['url']) - return response \ No newline at end of file + return response \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/test/phone_number_testcase.py b/sdk/communication/azure-communication-phonenumbers/test/phone_number_testcase.py deleted file mode 100644 index 29fc052e3764..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/phone_number_testcase.py +++ /dev/null @@ -1,20 +0,0 @@ -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- -import os -from azure.communication.phonenumbers._shared.utils import parse_connection_str -from _shared.testcase import CommunicationTestCase - -class PhoneNumberCommunicationTestCase(CommunicationTestCase): - def setUp(self): - super(PhoneNumberCommunicationTestCase, self).setUp() - - if self.is_playback(): - self.connection_str = "endpoint=https://sanitized/;accesskey=fake===" - else: - self.connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') - endpoint, _ = parse_connection_str(self.connection_str) - self._resource_name = endpoint.split(".")[0] - self.scrubber.register_name_pair(self._resource_name, "sanitized") diff --git a/sdk/communication/azure-communication-phonenumbers/test/phone_number_testcase_async.py b/sdk/communication/azure-communication-phonenumbers/test/phone_number_testcase_async.py deleted file mode 100644 index b6354fcfa35c..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/phone_number_testcase_async.py +++ /dev/null @@ -1,13 +0,0 @@ -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- -import os -from azure.communication.phonenumbers._shared.utils import parse_connection_str -from phone_number_testcase import PhoneNumberCommunicationTestCase -from _shared.asynctestcase import AsyncCommunicationTestCase - -class AsyncPhoneNumberCommunicationTestCase(PhoneNumberCommunicationTestCase, AsyncCommunicationTestCase): - def setUp(self): - super(AsyncPhoneNumberCommunicationTestCase, self).setUp() diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_cancel_reservation.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_cancel_reservation.yaml deleted file mode 100644 index cd8e3ca107b6..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_cancel_reservation.yaml +++ /dev/null @@ -1,36 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Date: - - Mon, 23 Nov 2020 22:11:17 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches/reservation_id_to_cancel/cancel?api-version=2020-07-20-preview1 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Mon, 23 Nov 2020 22:11:17 GMT - ms-cv: - - mbCpJZCKiUK4caapFCbzQg.0 - x-processing-time: - - 258ms - status: - code: 202 - message: Accepted -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_configure_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_configure_number.yaml deleted file mode 100644 index 86df837dc773..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_configure_number.yaml +++ /dev/null @@ -1,39 +0,0 @@ -interactions: -- request: - body: 'b''{"pstnConfiguration": {"callbackUrl": "https://callbackurl", "applicationId": - "ApplicationId"}, "phoneNumber": "+1area_code_for_reservation4501240"}''' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '126' - Content-Type: - - application/json - Date: - - Mon, 23 Nov 2020 22:11:17 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: PATCH - uri: https://sanitized.communication.azure.com/administration/phonenumbers/numberconfiguration/configure?api-version=2020-07-20-preview1 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Mon, 23 Nov 2020 22:11:18 GMT - ms-cv: - - G9imTJyYkkSUmuTD6LmwNg.0 - x-processing-time: - - 886ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_create_search.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_create_search.yaml deleted file mode 100644 index a2e75ba52d07..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_create_search.yaml +++ /dev/null @@ -1,186 +0,0 @@ -interactions: -- request: - body: 'b''b\''{"displayName": "testreservation20200014", "description": "testreservation20200014", - "phonePlanIds": ["phone_plan_id"], "areaCode": "area_code_for_reservation", - "quantity": 1}\''''' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '176' - Content-Type: - - application/json - Date: - - Mon, 23 Nov 2020 22:08:38 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches?api-version=2020-07-20-preview1 - response: - body: '{"searchId": "sanitized"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:08:39 GMT - ms-cv: - - HTqHTEW+FESz3w+S699+5g.0 - transfer-encoding: - - chunked - x-processing-time: - - 771ms - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:08:39 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches/1aa3199c-2448-4734-8f8e-96330c8f6caa?api-version=2020-07-20-preview1 - response: - body: '{"searchId": "sanitized", "displayName": "testreservation20200014", "createdAt": - "2020-11-23T22:08:38.6944708+00:00", "description": "testreservation20200014", - "phonePlanIds": "sanitized", "areaCode": "area_code_for_reservation", "quantity": - 1, "locationOptions": [], "status": "Pending", "phoneNumbers": "sanitized"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:08:39 GMT - ms-cv: - - lbxsJisVC0CUsQNU7JT2Eg.0 - transfer-encoding: - - chunked - x-processing-time: - - 293ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:08:39 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches/1aa3199c-2448-4734-8f8e-96330c8f6caa?api-version=2020-07-20-preview1 - response: - body: '{"searchId": "sanitized", "displayName": "testreservation20200014", "createdAt": - "2020-11-23T22:08:38.6944708+00:00", "description": "testreservation20200014", - "phonePlanIds": "sanitized", "areaCode": "area_code_for_reservation", "quantity": - 1, "locationOptions": [], "status": "Pending", "phoneNumbers": "sanitized"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:08:39 GMT - ms-cv: - - R0qCoiwGdEu/iH8sS5ViZw.0 - transfer-encoding: - - chunked - x-processing-time: - - 408ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:08:45 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches/1aa3199c-2448-4734-8f8e-96330c8f6caa?api-version=2020-07-20-preview1 - response: - body: '{"searchId": "sanitized", "displayName": "testreservation20200014", "createdAt": - "2020-11-23T22:08:38.6944708+00:00", "description": "testreservation20200014", - "phonePlanIds": "sanitized", "areaCode": "area_code_for_reservation", "quantity": - 1, "locationOptions": [], "status": "Pending", "phoneNumbers": "sanitized"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:08:45 GMT - ms-cv: - - cx/vg1Ggike+C0L6hX+BEg.0 - transfer-encoding: - - chunked - x-processing-time: - - 263ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:08:50 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches/1aa3199c-2448-4734-8f8e-96330c8f6caa?api-version=2020-07-20-preview1 - response: - body: '{"searchId": "sanitized", "displayName": "testreservation20200014", "createdAt": - "2020-11-23T22:08:38.6944708+00:00", "description": "testreservation20200014", - "phonePlanIds": "sanitized", "areaCode": "area_code_for_reservation", "quantity": - 1, "locationOptions": [], "status": "Error", "phoneNumbers": "sanitized", "errorCode": - 1000}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:08:50 GMT - ms-cv: - - jHWx/MVzNUudhIJdiQMyWg.0 - transfer-encoding: - - chunked - x-processing-time: - - 266ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_all_area_codes.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_all_area_codes.yaml deleted file mode 100644 index cfcf405f1688..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_all_area_codes.yaml +++ /dev/null @@ -1,40 +0,0 @@ -interactions: -- request: - body: '{}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '2' - Content-Type: - - application/json - Date: - - Mon, 23 Nov 2020 22:11:18 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/administration/phonenumbers/countries/US/areacodes?locationType=NotRequired&phonePlanId=phone_plan_id_area_codes&api-version=2020-07-20-preview1 - response: - body: '{"primaryAreaCodes": ["area_code_for_reservation"], "secondaryAreaCodes": - [], "nextLink": null}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:18 GMT - ms-cv: - - 7EdJRpBmQkyxpwPMjLC0aA.0 - transfer-encoding: - - chunked - x-processing-time: - - 262ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_capabilities_update.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_capabilities_update.yaml deleted file mode 100644 index 38b88c38b27e..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_capabilities_update.yaml +++ /dev/null @@ -1,36 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:11:19 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/capabilities/capabilities_id?api-version=2020-07-20-preview1 - response: - body: '{"capabilitiesUpdateId": "sanitized", "createdAt": "2020-09-28T17:49:13.2696607+00:00", - "capabilitiesUpdateStatus": "Complete", "phoneNumberCapabilitiesUpdates": "sanitized"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:18 GMT - ms-cv: - - EzXo3vmXrkGjsGovhnBqPw.0 - transfer-encoding: - - chunked - x-processing-time: - - 266ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_number_configuration.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_number_configuration.yaml deleted file mode 100644 index b2b568fe6fbb..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_number_configuration.yaml +++ /dev/null @@ -1,40 +0,0 @@ -interactions: -- request: - body: 'b''{"phoneNumber": "+1area_code_for_reservation4501240"}''' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '31' - Content-Type: - - application/json - Date: - - Mon, 23 Nov 2020 22:11:19 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/administration/phonenumbers/numberconfiguration?api-version=2020-07-20-preview1 - response: - body: '{"pstnConfiguration": {"callbackUrl": "https://callbackurl", "applicationId": - "ApplicationId", "azurePstnTargetId": "85c9239f-0b81-47e6-b25e-95ccaf48581f"}}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:19 GMT - ms-cv: - - B7d4g2aBsEy/41s1bLygcA.0 - transfer-encoding: - - chunked - x-processing-time: - - 327ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_phone_numbers_from_managed_identity.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml similarity index 51% rename from sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_phone_numbers_from_managed_identity.yaml rename to sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml index fbfeb1fcc4de..4dc86c3c7c68 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_phone_numbers_from_managed_identity.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml @@ -8,26 +8,33 @@ interactions: - gzip, deflate Connection: - keep-alive + Date: + - Wed, 10 Feb 2021 19:32:33 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/phonenumbers?locale=en-US&skip=0&take=100&api-version=2020-07-20-preview1 + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 response: body: - string: '{"phoneNumbers": "sanitized", "nextLink": null}' + string: '{"id": "16194895875", "phoneNumber": "+16194895875", "countryCode": + "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", + "sms": "none"}, "assignmentType": "User", "callbackUri": null, "applicationId": + null}' headers: content-type: - application/json; charset=utf-8 date: - - Thu, 28 Jan 2021 18:48:48 GMT + - Wed, 10 Feb 2021 19:32:33 GMT ms-cv: - - /rMw3sZH40i74G71li+lDA.0 + - Y6DU+yoXtk+lfRS/sfS0AA.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 1124ms + - 756ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_plan_location_options.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_plan_location_options.yaml deleted file mode 100644 index 85fdb9178888..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_plan_location_options.yaml +++ /dev/null @@ -1,250 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:11:20 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/countries/US/phoneplangroups/phone_plan_group_id/phoneplans/phone_plan_id/locationoptions?locale=en-US&api-version=2020-07-20-preview1 - response: - body: '{"locationOptions": {"labelId": "state", "labelName": "State", "options": - [{"name": "AK", "value": "AK", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Anchorage", "value": "NOAM-US-AK-AN", "locationOptions": - []}]}]}, {"name": "AL", "value": "AL", "locationOptions": [{"labelId": "city", - "labelName": "City", "options": [{"name": "Birmingham", "value": "NOAM-US-AL-BI", - "locationOptions": []}, {"name": "Huntsville", "value": "NOAM-US-AL-HN", "locationOptions": - []}, {"name": "Mobile", "value": "NOAM-US-AL-MO", "locationOptions": []}, {"name": - "Montgomery", "value": "NOAM-US-AL-MN", "locationOptions": []}]}]}, {"name": - "AR", "value": "AR", "locationOptions": [{"labelId": "city", "labelName": "City", - "options": [{"name": "Fort Smith", "value": "NOAM-US-AR-FS", "locationOptions": - []}, {"name": "Jonesboro", "value": "NOAM-US-AR-JO", "locationOptions": []}, - {"name": "Little Rock", "value": "NOAM-US-AR-LR", "locationOptions": []}]}]}, - {"name": "AZ", "value": "AZ", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Phoenix", "value": "NOAM-US-AZ-PH", "locationOptions": - []}]}]}, {"name": "CA", "value": "CA", "locationOptions": [{"labelId": "city", - "labelName": "City", "options": [{"name": "Anaheim", "value": "NOAM-US-CA-AN", - "locationOptions": []}, {"name": "Burbank", "value": "NOAM-US-CA-BU", "locationOptions": - []}, {"name": "Fresno", "value": "NOAM-US-CA-FR", "locationOptions": []}, {"name": - "Irvine", "value": "NOAM-US-CA-IR", "locationOptions": []}, {"name": "Los Angeles", - "value": "NOAM-US-CA-LA", "locationOptions": []}, {"name": "Riverside", "value": - "NOAM-US-CA-RI", "locationOptions": []}, {"name": "Sacramento", "value": "NOAM-US-CA-SA", - "locationOptions": []}, {"name": "Salinas", "value": "NOAM-US-CA-SL", "locationOptions": - []}, {"name": "San Diego", "value": "NOAM-US-CA-SD", "locationOptions": []}, - {"name": "San Jose", "value": "NOAM-US-CA-SJ", "locationOptions": []}, {"name": - "Santa Barbara", "value": "NOAM-US-CA-SB", "locationOptions": []}, {"name": - "Santa Clarita", "value": "NOAM-US-CA-SC", "locationOptions": []}, {"name": - "Santa Rosa", "value": "NOAM-US-CA-SR", "locationOptions": []}, {"name": "Stockton", - "value": "NOAM-US-CA-ST", "locationOptions": []}]}]}, {"name": "CL", "value": - "CL", "locationOptions": [{"labelId": "city", "labelName": "City", "options": - [{"name": "Washington DC", "value": "NOAM-US-CL-DC", "locationOptions": []}]}]}, - {"name": "CO", "value": "CO", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Denver", "value": "NOAM-US-CO-DE", "locationOptions": - []}, {"name": "Grand Junction", "value": "NOAM-US-CO-GJ", "locationOptions": - []}, {"name": "Pueblo", "value": "NOAM-US-CO-PU", "locationOptions": []}]}]}, - {"name": "CT", "value": "CT", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Bridgeport", "value": "NOAM-US-CT-BR", "locationOptions": - []}]}]}, {"name": "DE", "value": "DE", "locationOptions": [{"labelId": "city", - "labelName": "City", "options": [{"name": "Wilmington", "value": "NOAM-US-DE-WI", - "locationOptions": []}]}]}, {"name": "FL", "value": "FL", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Cape Coral", - "value": "NOAM-US-FL-CC", "locationOptions": []}, {"name": "Daytona Beach", - "value": "NOAM-US-FL-DB", "locationOptions": []}, {"name": "Fort Lauderdale", - "value": "NOAM-US-FL-FL", "locationOptions": []}, {"name": "Gainesville", "value": - "NOAM-US-FL-GA", "locationOptions": []}, {"name": "Jacksonville", "value": "NOAM-US-FL-JA", - "locationOptions": []}, {"name": "Lakeland", "value": "NOAM-US-FL-LA", "locationOptions": - []}, {"name": "Miami", "value": "NOAM-US-FL-MI", "locationOptions": []}, {"name": - "Orlando", "value": "NOAM-US-FL-OR", "locationOptions": []}, {"name": "Port - St Lucie", "value": "NOAM-US-FL-PS", "locationOptions": []}, {"name": "Sarasota", - "value": "NOAM-US-FL-SA", "locationOptions": []}, {"name": "Tallahassee", "value": - "NOAM-US-FL-TA", "locationOptions": []}, {"name": "West Palm Beach", "value": - "NOAM-US-FL-WP", "locationOptions": []}]}]}, {"name": "GA", "value": "GA", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Albany", "value": - "NOAM-US-GA-AL", "locationOptions": []}, {"name": "Atlanta", "value": "NOAM-US-GA-AT", - "locationOptions": []}, {"name": "Augusta", "value": "NOAM-US-GA-AU", "locationOptions": - []}, {"name": "Macon", "value": "NOAM-US-GA-MA", "locationOptions": []}, {"name": - "Savannah", "value": "NOAM-US-GA-SA", "locationOptions": []}]}]}, {"name": "HI", - "value": "HI", "locationOptions": [{"labelId": "city", "labelName": "City", - "options": [{"name": "Honolulu", "value": "NOAM-US-HI-HO", "locationOptions": - []}]}]}, {"name": "IA", "value": "IA", "locationOptions": [{"labelId": "city", - "labelName": "City", "options": [{"name": "Cedar Rapids", "value": "NOAM-US-IA-CR", - "locationOptions": []}, {"name": "Davenport", "value": "NOAM-US-IA-DA", "locationOptions": - []}, {"name": "Mason City", "value": "NOAM-US-IA-MC", "locationOptions": []}]}]}, - {"name": "ID", "value": "ID", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Boise", "value": "NOAM-US-ID-BO", "locationOptions": - []}]}]}, {"name": "IL", "value": "IL", "locationOptions": [{"labelId": "city", - "labelName": "City", "options": [{"name": "Alton", "value": "NOAM-US-IL-AL", - "locationOptions": []}, {"name": "Aurora", "value": "NOAM-US-IL-AU", "locationOptions": - []}, {"name": "Big Rock", "value": "NOAM-US-IL-BK", "locationOptions": []}, - {"name": "Champaign", "value": "NOAM-US-IL-CA", "locationOptions": []}, {"name": - "Chicago", "value": "NOAM-US-IL-CH", "locationOptions": []}, {"name": "Cicero", - "value": "NOAM-US-IL-CI", "locationOptions": []}, {"name": "Rock Island", "value": - "NOAM-US-IL-RI", "locationOptions": []}, {"name": "Waukegan", "value": "NOAM-US-IL-WK", - "locationOptions": []}]}]}, {"name": "IN", "value": "IN", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Evansville", - "value": "NOAM-US-IN-EV", "locationOptions": []}, {"name": "Fort Wayne", "value": - "NOAM-US-IN-FW", "locationOptions": []}, {"name": "Gary", "value": "NOAM-US-IN-GA", - "locationOptions": []}, {"name": "Indianapolis", "value": "NOAM-US-IN-IN", "locationOptions": - []}, {"name": "South Bend", "value": "NOAM-US-IN-SB", "locationOptions": []}]}]}, - {"name": "KS", "value": "KS", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Dodge City", "value": "NOAM-US-KS-DC", "locationOptions": - []}, {"name": "Kansas City", "value": "NOAM-US-KS-KS", "locationOptions": []}, - {"name": "Topeka", "value": "NOAM-US-KS-TO", "locationOptions": []}, {"name": - "Wichita", "value": "NOAM-US-KS-WI", "locationOptions": []}]}]}, {"name": "KY", - "value": "KY", "locationOptions": [{"labelId": "city", "labelName": "City", - "options": [{"name": "Ashland", "value": "NOAM-US-KY-AS", "locationOptions": - []}, {"name": "Lexington", "value": "NOAM-US-KY-LE", "locationOptions": []}, - {"name": "Louisville", "value": "NOAM-US-KY-LO", "locationOptions": []}]}]}, - {"name": "LA", "value": "LA", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Baton Rouge", "value": "NOAM-US-LA-BR", "locationOptions": - []}, {"name": "Lafayette", "value": "NOAM-US-LA-LA", "locationOptions": []}, - {"name": "New Orleans", "value": "NOAM-US-LA-NO", "locationOptions": []}, {"name": - "Shreveport", "value": "NOAM-US-LA-SH", "locationOptions": []}]}]}, {"name": - "MA", "value": "MA", "locationOptions": [{"labelId": "city", "labelName": "City", - "options": [{"name": "Boston", "value": "NOAM-US-MA-BO", "locationOptions": - []}, {"name": "Chicopee", "value": "NOAM-US-MA-CH", "locationOptions": []}]}]}, - {"name": "MD", "value": "MD", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Baltimore", "value": "NOAM-US-MD-BA", "locationOptions": - []}]}]}, {"name": "ME", "value": "ME", "locationOptions": [{"labelId": "city", - "labelName": "City", "options": [{"name": "Portland", "value": "NOAM-US-ME-PO", - "locationOptions": []}]}]}, {"name": "MI", "value": "MI", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Detroit", "value": - "NOAM-US-MI-DE", "locationOptions": []}, {"name": "Flint", "value": "NOAM-US-MI-FL", - "locationOptions": []}, {"name": "Grand Rapids", "value": "NOAM-US-MI-GP", "locationOptions": - []}, {"name": "Grant", "value": "NOAM-US-MI-GR", "locationOptions": []}, {"name": - "Lansing", "value": "NOAM-US-MI-LA", "locationOptions": []}, {"name": "Saginaw", - "value": "NOAM-US-MI-SA", "locationOptions": []}, {"name": "Sault Ste Marie", - "value": "NOAM-US-MI-SS", "locationOptions": []}, {"name": "Troy", "value": - "NOAM-US-MI-TR", "locationOptions": []}]}]}, {"name": "MN", "value": "MN", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Duluth", "value": - "NOAM-US-MN-DU", "locationOptions": []}, {"name": "Minneapolis", "value": "NOAM-US-MN-MI", - "locationOptions": []}]}]}, {"name": "MO", "value": "MO", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Kansas City", - "value": "NOAM-US-MO-KS", "locationOptions": []}, {"name": "Marshall", "value": - "NOAM-US-MO-MA", "locationOptions": []}, {"name": "Springfield", "value": "NOAM-US-MO-SP", - "locationOptions": []}, {"name": "St. Charles", "value": "NOAM-US-MO-SC", "locationOptions": - []}, {"name": "St. Louis", "value": "NOAM-US-MO-SL", "locationOptions": []}]}]}, - {"name": "MS", "value": "MS", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Biloxi", "value": "NOAM-US-MS-BI", "locationOptions": - []}, {"name": "Jackson", "value": "NOAM-US-MS-JA", "locationOptions": []}, {"name": - "Starkville", "value": "NOAM-US-MS-ST", "locationOptions": []}]}]}, {"name": - "MT", "value": "MT", "locationOptions": [{"labelId": "city", "labelName": "City", - "options": [{"name": "Billings", "value": "NOAM-US-MT-BI", "locationOptions": - []}]}]}, {"name": "NC", "value": "NC", "locationOptions": [{"labelId": "city", - "labelName": "City", "options": [{"name": "Charlotte", "value": "NOAM-US-NC-CH", - "locationOptions": []}, {"name": "Fayetteville", "value": "NOAM-US-NC-FA", "locationOptions": - []}, {"name": "Greensboro", "value": "NOAM-US-NC-GR", "locationOptions": []}, - {"name": "Raleigh", "value": "NOAM-US-NC-RA", "locationOptions": []}]}]}, {"name": - "NE", "value": "NE", "locationOptions": [{"labelId": "city", "labelName": "City", - "options": [{"name": "Kearney", "value": "NOAM-US-NE-KE", "locationOptions": - []}, {"name": "Omaha", "value": "NOAM-US-NE-OM", "locationOptions": []}]}]}, - {"name": "NJ", "value": "NJ", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Atlantic City", "value": "NOAM-US-NJ-AC", "locationOptions": - []}, {"name": "Camden", "value": "NOAM-US-NJ-CA", "locationOptions": []}, {"name": - "Elizabeth", "value": "NOAM-US-NJ-EL", "locationOptions": []}, {"name": "Jersey - City", "value": "NOAM-US-NJ-JC", "locationOptions": []}, {"name": "Newark", - "value": "NOAM-US-NJ-NE", "locationOptions": []}]}]}, {"name": "NM", "value": - "NM", "locationOptions": [{"labelId": "city", "labelName": "City", "options": - [{"name": "Las Cruces", "value": "NOAM-US-NM-LC", "locationOptions": []}]}]}, - {"name": "NV", "value": "NV", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Las Vegas", "value": "NOAM-US-NV-LV", "locationOptions": - []}, {"name": "Reno", "value": "NOAM-US-NV-RE", "locationOptions": []}]}]}, - {"name": "NY", "value": "NY", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Albany", "value": "NOAM-US-NY-AL", "locationOptions": - []}, {"name": "Elmira", "value": "NOAM-US-NY-EL", "locationOptions": []}, {"name": - "Kingston", "value": "NOAM-US-NY-KI", "locationOptions": []}, {"name": "New - York City", "value": "NOAM-US-NY-NY", "locationOptions": []}, {"name": "Niagara - Falls", "value": "NOAM-US-NY-NF", "locationOptions": []}, {"name": "Rochester", - "value": "NOAM-US-NY-RO", "locationOptions": []}, {"name": "Syracuse", "value": - "NOAM-US-NY-SY", "locationOptions": []}]}]}, {"name": "OH", "value": "OH", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Akron", "value": - "NOAM-US-OH-AK", "locationOptions": []}, {"name": "Cincinnati", "value": "NOAM-US-OH-CI", - "locationOptions": []}, {"name": "Cleveland", "value": "NOAM-US-OH-CL", "locationOptions": - []}, {"name": "Columbus", "value": "NOAM-US-OH-CO", "locationOptions": []}, - {"name": "Dayton", "value": "NOAM-US-OH-DA", "locationOptions": []}, {"name": - "Toledo", "value": "NOAM-US-OH-TO", "locationOptions": []}]}]}, {"name": "OK", - "value": "OK", "locationOptions": [{"labelId": "city", "labelName": "City", - "options": [{"name": "Lawton", "value": "NOAM-US-OK-LA", "locationOptions": - []}, {"name": "Oklahoma City", "value": "NOAM-US-OK-OC", "locationOptions": - []}, {"name": "Tulsa", "value": "NOAM-US-OK-TU", "locationOptions": []}]}]}, - {"name": "PA", "value": "PA", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Erie", "value": "NOAM-US-PA-ER", "locationOptions": - []}, {"name": "Lancaster", "value": "NOAM-US-PA-LA", "locationOptions": []}, - {"name": "New Castle", "value": "NOAM-US-PA-NC", "locationOptions": []}, {"name": - "Philadelphia", "value": "NOAM-US-PA-PI", "locationOptions": []}, {"name": "Pittsburgh", - "value": "NOAM-US-PA-PT", "locationOptions": []}, {"name": "Scranton", "value": - "NOAM-US-PA-SC", "locationOptions": []}]}]}, {"name": "RI", "value": "RI", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Providence", - "value": "NOAM-US-RI-PR", "locationOptions": []}]}]}, {"name": "SC", "value": - "SC", "locationOptions": [{"labelId": "city", "labelName": "City", "options": - [{"name": "Charleston", "value": "NOAM-US-SC-CH", "locationOptions": []}, {"name": - "Columbia", "value": "NOAM-US-SC-CO", "locationOptions": []}, {"name": "Greenville", - "value": "NOAM-US-SC-GR", "locationOptions": []}]}]}, {"name": "SD", "value": - "SD", "locationOptions": [{"labelId": "city", "labelName": "City", "options": - [{"name": "Sioux Falls", "value": "NOAM-US-SD-SF", "locationOptions": []}]}]}, - {"name": "TN", "value": "TN", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Chattanooga", "value": "NOAM-US-TN-CH", "locationOptions": - []}, {"name": "Clarksville", "value": "NOAM-US-TN-CL", "locationOptions": []}, - {"name": "Jackson", "value": "NOAM-US-TN-JA", "locationOptions": []}, {"name": - "Knoxville", "value": "NOAM-US-TN-KN", "locationOptions": []}, {"name": "Memphis", - "value": "NOAM-US-TN-ME", "locationOptions": []}, {"name": "Nashville", "value": - "NOAM-US-TN-NA", "locationOptions": []}]}]}, {"name": "TX", "value": "TX", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Abilene", "value": - "NOAM-US-TX-AB", "locationOptions": []}, {"name": "Austin", "value": "NOAM-US-TX-AU", - "locationOptions": []}, {"name": "Bryan", "value": "NOAM-US-TX-BR", "locationOptions": - []}, {"name": "Corpus Christi", "value": "NOAM-US-TX-CC", "locationOptions": - []}, {"name": "Dallas", "value": "NOAM-US-TX-DA", "locationOptions": []}, {"name": - "Denton", "value": "NOAM-US-TX-DE", "locationOptions": []}, {"name": "El Paso", - "value": "NOAM-US-TX-EP", "locationOptions": []}, {"name": "Fort Worth", "value": - "NOAM-US-TX-FW", "locationOptions": []}, {"name": "Galveston", "value": "NOAM-US-TX-GA", - "locationOptions": []}, {"name": "Houston", "value": "NOAM-US-TX-HO", "locationOptions": - []}, {"name": "Huntsville", "value": "NOAM-US-TX-HU", "locationOptions": []}, - {"name": "Lubbock", "value": "NOAM-US-TX-LU", "locationOptions": []}, {"name": - "Tyler", "value": "NOAM-US-TX-TY", "locationOptions": []}]}]}, {"name": "UT", - "value": "UT", "locationOptions": [{"labelId": "city", "labelName": "City", - "options": [{"name": "Salt Lake City", "value": "NOAM-US-UT-SL", "locationOptions": - []}, {"name": "St. George", "value": "NOAM-US-UT-SG", "locationOptions": []}]}]}, - {"name": "VA", "value": "VA", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Lynchburg", "value": "NOAM-US-VA-LY", "locationOptions": - []}, {"name": "Richmond", "value": "NOAM-US-VA-RI", "locationOptions": []}, - {"name": "Virginia Beach", "value": "NOAM-US-VA-VB", "locationOptions": []}]}]}, - {"name": "VT", "value": "VT", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Bennington", "value": "NOAM-US-VT-BE", "locationOptions": - []}, {"name": "Brattleboro", "value": "NOAM-US-VT-BR", "locationOptions": []}, - {"name": "Burlington", "value": "NOAM-US-VT-BU", "locationOptions": []}, {"name": - "Middlebury", "value": "NOAM-US-VT-MB", "locationOptions": []}, {"name": "Montpelier", - "value": "NOAM-US-VT-MP", "locationOptions": []}, {"name": "Newport", "value": - "NOAM-US-VT-NE", "locationOptions": []}]}]}, {"name": "WI", "value": "WI", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Green Bay", - "value": "NOAM-US-WI-GB", "locationOptions": []}, {"name": "Kenosha", "value": - "NOAM-US-WI-KE", "locationOptions": []}, {"name": "Madison", "value": "NOAM-US-WI-MA", - "locationOptions": []}, {"name": "Milwaukee", "value": "NOAM-US-WI-MI", "locationOptions": - []}]}]}, {"name": "WV", "value": "WV", "locationOptions": [{"labelId": "city", - "labelName": "City", "options": [{"name": "Charleston", "value": "NOAM-US-WV-CH", - "locationOptions": []}]}]}, {"name": "WY", "value": "WY", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Laramie", "value": - "NOAM-US-WY-LA", "locationOptions": []}]}]}]}}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:20 GMT - ms-cv: - - dFVVFMtfcEKwq/v6c+upYg.0 - transfer-encoding: - - chunked - x-processing-time: - - 634ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_release_by_id.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_release_by_id.yaml deleted file mode 100644 index dcc2f789fdd5..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_release_by_id.yaml +++ /dev/null @@ -1,37 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:11:21 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/releases/release_id?api-version=2020-07-20-preview1 - response: - body: '{"releaseId": "sanitized", "createdAt": "2020-09-28T20:09:36.2701214+00:00", - "status": "Failed", "errorMessage": "All numbers in Failed state after BVD call", - "phoneNumberReleaseStatusDetails": "sanitized"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:20 GMT - ms-cv: - - iHfbGOpIvUmr6FaCORS7IA.0 - transfer-encoding: - - chunked - x-processing-time: - - 189ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_reservation_by_id.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_reservation_by_id.yaml deleted file mode 100644 index 79ac4a5380ed..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_reservation_by_id.yaml +++ /dev/null @@ -1,39 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:11:21 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches/reservation_id?api-version=2020-07-20-preview1 - response: - body: '{"searchId": "sanitized", "displayName": "mysearch20200928", "createdAt": - "2020-10-02T21:39:32.6878583+00:00", "description": "mydescription", "phonePlanIds": - "sanitized", "areaCode": "area_code_for_reservation", "quantity": 1, "locationOptions": - [], "status": "Success", "phoneNumbers": "sanitized", "reservationExpiryDate": - "2020-10-02T21:55:47.9734151+00:00"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:20 GMT - ms-cv: - - GEcLTOZhcE+beY8tntswXQ.0 - transfer-encoding: - - chunked - x-processing-time: - - 273ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml new file mode 100644 index 000000000000..07086c0f987c --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml @@ -0,0 +1,92 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Wed, 10 Feb 2021 19:32:35 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 + response: + body: + string: '{"phoneNumbers": [{"id": "16194895875", "phoneNumber": "+16194895875", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, + "applicationId": null}, {"id": "16194895877", "phoneNumber": "+16194895877", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, + "applicationId": null}, {"id": "16194895878", "phoneNumber": "+16194895878", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, + "applicationId": null}, {"id": "16194895879", "phoneNumber": "+16194895879", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, + "applicationId": null}, {"id": "16194895880", "phoneNumber": "+16194895880", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, + "applicationId": null}, {"id": "16194895882", "phoneNumber": "+16194895882", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, + "applicationId": null}, {"id": "16194895885", "phoneNumber": "+16194895885", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, + "applicationId": null}, {"id": "16194895887", "phoneNumber": "+16194895887", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, + "applicationId": null}, {"id": "16194895889", "phoneNumber": "+16194895889", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, + "applicationId": null}, {"id": "18332271680", "phoneNumber": "+18332271680", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "none", "sms": "outbound"}, "assignmentType": "Application", "callbackUri": + null, "applicationId": null}, {"id": "18332272412", "phoneNumber": "+18332272412", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": + null, "applicationId": null}, {"id": "18332272430", "phoneNumber": "+18332272430", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": + null, "applicationId": null}, {"id": "18332272445", "phoneNumber": "+18332272445", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": + null, "applicationId": null}, {"id": "18332321209", "phoneNumber": "+18332321209", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "none", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": + null, "applicationId": null}, {"id": "18332321221", "phoneNumber": "+18332321221", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "none", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": + null, "applicationId": null}, {"id": "18332321226", "phoneNumber": "+18332321226", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "none", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": + null, "applicationId": null}, {"id": "18335260208", "phoneNumber": "+18335260208", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": + null, "applicationId": null}, {"id": "18336369501", "phoneNumber": "+18336369501", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "inbound+outbound", "sms": "none"}, "assignmentType": "Application", "callbackUri": + null, "applicationId": null}]}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Feb 2021 19:32:35 GMT + ms-cv: + - xp5wSjznyUuxsog/ctcTNg.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 1460ms + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_phone_numbers.yaml deleted file mode 100644 index cafe58c71c37..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_phone_numbers.yaml +++ /dev/null @@ -1,35 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:11:21 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/phonenumbers?locale=en-US&skip=0&take=100&api-version=2020-07-20-preview1 - response: - body: '{"phoneNumbers": "sanitized", "nextLink": null}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:21 GMT - ms-cv: - - GdjTF54N3EGXupN74+JPoA.0 - transfer-encoding: - - chunked - x-processing-time: - - 381ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_releases.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_releases.yaml deleted file mode 100644 index 3758a111fc3f..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_releases.yaml +++ /dev/null @@ -1,35 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:11:22 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/releases?skip=0&take=100&api-version=2020-07-20-preview1 - response: - body: '{"entities": "sanitized", "nextLink": null}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:21 GMT - ms-cv: - - jlH34pUZ8EmaRUyZ8PdkUA.0 - transfer-encoding: - - chunked - x-processing-time: - - 284ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_supported_countries.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_supported_countries.yaml deleted file mode 100644 index 21acc8e670dd..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_supported_countries.yaml +++ /dev/null @@ -1,36 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:11:22 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/countries?locale=en-US&skip=0&take=100&api-version=2020-07-20-preview1 - response: - body: '{"countries": [{"localizedName": "Canada", "countryCode": "CA"}, {"localizedName": - "United States", "countryCode": "US"}], "nextLink": null}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:22 GMT - ms-cv: - - S3uepNKcDU+QjHoOeHSwvw.0 - transfer-encoding: - - chunked - x-processing-time: - - 470ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_phone_plan_groups.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_phone_plan_groups.yaml deleted file mode 100644 index 7c3a63e7043e..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_phone_plan_groups.yaml +++ /dev/null @@ -1,35 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:11:23 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/countries/US/phoneplangroups?locale=en-US&includeRateInformation=false&skip=0&take=100&api-version=2020-07-20-preview1 - response: - body: '{"phonePlanGroups": "sanitized", "nextLink": null}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:22 GMT - ms-cv: - - GoJpZDxc60iIeEWJCxLbwQ.0 - transfer-encoding: - - chunked - x-processing-time: - - 275ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_phone_plans.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_phone_plans.yaml deleted file mode 100644 index e48e9bfb60e4..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_phone_plans.yaml +++ /dev/null @@ -1,35 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:11:23 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/countries/US/phoneplangroups/phone_plan_group_id/phoneplans?locale=en-US&skip=0&take=100&api-version=2020-07-20-preview1 - response: - body: '{"phonePlans": "sanitized", "nextLink": null}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:23 GMT - ms-cv: - - PZtnMx1DpEyQdC4vCh0ghA.0 - transfer-encoding: - - chunked - x-processing-time: - - 240ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml new file mode 100644 index 000000000000..23009e4d88e3 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml @@ -0,0 +1,274 @@ +interactions: +- request: + body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": + {"calling": "inbound", "sms": "inbound+outbound"}, "areaCode": "833", "quantity": + 1}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '165' + Content-Type: + - application/json + Date: + - Tue, 09 Feb 2021 23:12:39 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 09 Feb 2021 23:12:41 GMT + ms-cv: + - Lu6bTIinOkK+347LEclljw.0 + operation-location: + - /phoneNumbers/operations/search_b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 + request-context: + - appId= + x-processing-time: + - 1604ms + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 09 Feb 2021 23:13:11 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 + response: + body: + string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": + "2021-02-09T23:12:41.0837738+00:00", "id": "search_b8db86ec-476d-44c4-811d-303928c645bc", + "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Tue, 09 Feb 2021 23:13:11 GMT + ms-cv: + - /KWc7Qzt2kKhdoBoDp6rQQ.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 581ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 09 Feb 2021 23:13:12 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 + response: + body: + string: '{"searchId": "b8db86ec-476d-44c4-811d-303928c645bc", "phoneNumbers": + ["+18332272459"], "phoneNumberType": "TollFree", "assignmentType": "Application", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": + null, "searchExpiresBy": "2021-02-09T23:28:47.6393852+00:00"}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Tue, 09 Feb 2021 23:13:12 GMT + ms-cv: + - d5MuV8GE6EKfkM/IvIv7+g.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 615ms + status: + code: 200 + message: OK +- request: + body: '{"searchId": "b8db86ec-476d-44c4-811d-303928c645bc"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '52' + Content-Type: + - application/json + Date: + - Tue, 09 Feb 2021 23:13:13 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/:purchase?api-version=2021-03-07 + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 09 Feb 2021 23:13:13 GMT + ms-cv: + - gufZmnAYNkSNr+ILi5p8cQ.0 + operation-location: + - /phoneNumbers/operations/purchase_b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 + request-context: + - appId= + x-processing-time: + - 1144ms + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 09 Feb 2021 23:13:44 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 + response: + body: + string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": + "2021-02-09T23:12:41.0837738+00:00", "id": "purchase_b8db86ec-476d-44c4-811d-303928c645bc", + "operationType": "Purchase", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Tue, 09 Feb 2021 23:13:44 GMT + ms-cv: + - IWRiRm4RlUCGbZ7P/XSAkQ.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 588ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 09 Feb 2021 23:13:45 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 + response: + body: + string: '{"searchId": "b8db86ec-476d-44c4-811d-303928c645bc", "phoneNumbers": + ["+18332272459"], "phoneNumberType": "TollFree", "assignmentType": "Application", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": + null, "searchExpiresBy": "2021-02-09T23:28:47.6393852+00:00"}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Tue, 09 Feb 2021 23:13:45 GMT + ms-cv: + - qhtPHCmiP0iv/dhdk+EVsw.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 586ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Tue, 09 Feb 2021 23:13:45 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272459?api-version=2021-03-07 + response: + body: + string: '' + headers: + date: + - Tue, 09 Feb 2021 23:13:46 GMT + ms-cv: + - svrQMbXLTkq4w+Knna/Hog.0 + operation-location: + - /phoneNumbers/operations/release_5e40cad0-cbab-451b-9aab-08f0b81fb814?api-version=2021-03-07 + request-context: + - appId= + x-processing-time: + - 934ms + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_reservation.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_reservation.yaml deleted file mode 100644 index 35f93df0f022..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_reservation.yaml +++ /dev/null @@ -1,73 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Date: - - Mon, 23 Nov 2020 22:11:24 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches/reservation_id/purchase?api-version=2020-07-20-preview1 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Mon, 23 Nov 2020 22:11:23 GMT - ms-cv: - - fPAQ8fmvQU6WIzTu7zXQfw.0 - x-processing-time: - - 308ms - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:11:24 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches/reservation_id?api-version=2020-07-20-preview1 - response: - body: '{"searchId": "sanitized", "displayName": "mysearch20200928", "createdAt": - "2020-10-02T21:39:32.6878583+00:00", "description": "mydescription", "phonePlanIds": - "sanitized", "areaCode": "area_code_for_reservation", "quantity": 1, "locationOptions": - [], "status": "Success", "phoneNumbers": "sanitized", "reservationExpiryDate": - "2020-10-02T21:55:47.9734151+00:00"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:24 GMT - ms-cv: - - SjlnGOq18E2MQ7uNxBB0fQ.0 - transfer-encoding: - - chunked - x-processing-time: - - 263ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_number.yaml new file mode 100644 index 000000000000..c8cb46b97265 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_number.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Tue, 09 Feb 2021 23:10:08 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272441?api-version=2021-03-07 + response: + body: + string: '' + headers: + date: + - Tue, 09 Feb 2021 23:10:09 GMT + ms-cv: + - zTSfQ5gkkkyKQCTsCcVa7A.0 + operation-location: + - /phoneNumbers/operations/release_601597ca-7e59-4433-ae4f-da83aef7da98?api-version=2021-03-07 + request-context: + - appId= + x-processing-time: + - 1236ms + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_numbers.yaml deleted file mode 100644 index 18fa6791abfd..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_numbers.yaml +++ /dev/null @@ -1,143 +0,0 @@ -interactions: -- request: - body: 'b''{"phoneNumbers": ["+1area_code_for_reservation7840394"]}''' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '34' - Content-Type: - - application/json - Date: - - Mon, 23 Nov 2020 22:11:25 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/administration/phonenumbers/releases?api-version=2020-07-20-preview1 - response: - body: '{"releaseId": "sanitized"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:25 GMT - ms-cv: - - BgfaXNx4rkexq6yjjBA3Qw.0 - transfer-encoding: - - chunked - x-processing-time: - - 602ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:11:25 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/releases/d9c3f4a8-3352-45f0-ad74-52b04698d78d?api-version=2020-07-20-preview1 - response: - body: '{"releaseId": "sanitized", "createdAt": "2020-11-23T22:11:25.2859582+00:00", - "status": "Pending", "phoneNumberReleaseStatusDetails": "sanitized"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:25 GMT - ms-cv: - - qvL3hMhQlUmS92HYE/uBFQ.0 - transfer-encoding: - - chunked - x-processing-time: - - 179ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:11:26 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/releases/d9c3f4a8-3352-45f0-ad74-52b04698d78d?api-version=2020-07-20-preview1 - response: - body: '{"releaseId": "sanitized", "createdAt": "2020-11-23T22:11:25.2859582+00:00", - "status": "Pending", "phoneNumberReleaseStatusDetails": "sanitized"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:25 GMT - ms-cv: - - FRleW4iP7Ue74EGn6NV4lw.0 - transfer-encoding: - - chunked - x-processing-time: - - 178ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:11:31 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/releases/d9c3f4a8-3352-45f0-ad74-52b04698d78d?api-version=2020-07-20-preview1 - response: - body: '{"releaseId": "sanitized", "createdAt": "2020-11-23T22:11:25.2859582+00:00", - "status": "Failed", "errorMessage": "Unknown exception in BeginReleaseQueueProcessor - : Cannot Process Order since phone number(s) do not belong to tenant:ec53533e-7d3b-4ad0-bf10-7222b049eb8e", - "phoneNumberReleaseStatusDetails": "sanitized"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:31 GMT - ms-cv: - - IHoEJYxmyUqqT8V6isY9cQ.0 - transfer-encoding: - - chunked - x-processing-time: - - 181ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_reserve_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_reserve_phone_numbers.yaml deleted file mode 100644 index c2ec6d187f53..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_reserve_phone_numbers.yaml +++ /dev/null @@ -1,150 +0,0 @@ -interactions: -- request: - body: 'b''b\''{"displayName": "testreservation20200014", "description": "testreservation20200014", - "phonePlanIds": ["phone_plan_id"], "areaCode": "area_code_for_reservation", - "quantity": 1}\''''' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '176' - Content-Type: - - application/json - Date: - - Mon, 23 Nov 2020 22:11:31 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches?api-version=2020-07-20-preview1 - response: - body: '{"searchId": "sanitized"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:31 GMT - ms-cv: - - 3zxwvfI1D0WBkknksFDVVg.0 - transfer-encoding: - - chunked - x-processing-time: - - 1082ms - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:11:32 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches/ae359f26-6a39-4d83-a4ea-612d6e851f15?api-version=2020-07-20-preview1 - response: - body: '{"searchId": "sanitized", "displayName": "testreservation20200014", "createdAt": - "2020-11-23T22:11:32.1671461+00:00", "description": "testreservation20200014", - "phonePlanIds": "sanitized", "areaCode": "area_code_for_reservation", "quantity": - 1, "locationOptions": [], "status": "Pending", "phoneNumbers": "sanitized"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:32 GMT - ms-cv: - - N6cJ9bQtd0mIRCtv2YiCQg.0 - transfer-encoding: - - chunked - x-processing-time: - - 328ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:11:33 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches/ae359f26-6a39-4d83-a4ea-612d6e851f15?api-version=2020-07-20-preview1 - response: - body: '{"searchId": "sanitized", "displayName": "testreservation20200014", "createdAt": - "2020-11-23T22:11:32.1671461+00:00", "description": "testreservation20200014", - "phonePlanIds": "sanitized", "areaCode": "area_code_for_reservation", "quantity": - 1, "locationOptions": [], "status": "Pending", "phoneNumbers": "sanitized"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:32 GMT - ms-cv: - - v+24/t7ilUqlQQS8d9BDNA.0 - transfer-encoding: - - chunked - x-processing-time: - - 257ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Mon, 23 Nov 2020 22:11:38 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches/ae359f26-6a39-4d83-a4ea-612d6e851f15?api-version=2020-07-20-preview1 - response: - body: '{"searchId": "sanitized", "displayName": "testreservation20200014", "createdAt": - "2020-11-23T22:11:32.1671461+00:00", "description": "testreservation20200014", - "phonePlanIds": "sanitized", "areaCode": "area_code_for_reservation", "quantity": - 1, "locationOptions": [], "status": "Error", "phoneNumbers": "sanitized", "errorCode": - 1000}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:37 GMT - ms-cv: - - En3nEYmrU0i9swm5SyH7qg.0 - transfer-encoding: - - chunked - x-processing-time: - - 261ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml new file mode 100644 index 000000000000..803d7b8d6315 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml @@ -0,0 +1,121 @@ +interactions: +- request: + body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": + {"calling": "inbound", "sms": "inbound+outbound"}, "areaCode": "833", "quantity": + 1}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '165' + Content-Type: + - application/json + Date: + - Tue, 09 Feb 2021 21:34:00 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 09 Feb 2021 21:34:01 GMT + ms-cv: + - MUBwFiR9OUuS3RxM/xaO4g.0 + operation-location: + - /phoneNumbers/operations/search_0789a1f2-43ac-4d59-a6e0-14676d6272c1?api-version=2021-03-07 + request-context: + - appId= + x-processing-time: + - 1393ms + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 09 Feb 2021 21:34:31 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_0789a1f2-43ac-4d59-a6e0-14676d6272c1?api-version=2021-03-07 + response: + body: + string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": + "2021-02-09T21:34:00.9651939+00:00", "id": "search_0789a1f2-43ac-4d59-a6e0-14676d6272c1", + "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Tue, 09 Feb 2021 21:34:31 GMT + ms-cv: + - muk7q9bGH0mzZX+8LQ+89g.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 609ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 09 Feb 2021 21:34:32 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/0789a1f2-43ac-4d59-a6e0-14676d6272c1?api-version=2021-03-07 + response: + body: + string: '{"searchId": "0789a1f2-43ac-4d59-a6e0-14676d6272c1", "phoneNumbers": + ["+18332271691"], "phoneNumberType": "TollFree", "assignmentType": "Application", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": + null, "searchExpiresBy": "2021-02-09T21:50:07.3556271+00:00"}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Tue, 09 Feb 2021 21:34:32 GMT + ms-cv: + - TTqVpiD+IkO2IxCSRtVS8Q.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 542ms + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_capabilities.yaml deleted file mode 100644 index d975594f14dd..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_capabilities.yaml +++ /dev/null @@ -1,40 +0,0 @@ -interactions: -- request: - body: 'b''{"phoneNumberCapabilitiesUpdate": {"+1area_code_for_reservation4501240": - {"add": []}}}''' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '64' - Content-Type: - - application/json - Date: - - Mon, 23 Nov 2020 22:11:38 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/administration/phonenumbers/capabilities?api-version=2020-07-20-preview1 - response: - body: '{"capabilitiesUpdateId": "sanitized"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Mon, 23 Nov 2020 22:11:39 GMT - ms-cv: - - duZmwAa0FEKqQcP3eY0Z1w.0 - transfer-encoding: - - chunked - x-processing-time: - - 860ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number.yaml new file mode 100644 index 000000000000..1e21a73687b1 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{"callbackUri": "", "applicationId": ""}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '40' + Content-Type: + - application/merge-patch+json + Date: + - Wed, 10 Feb 2021 15:47:47 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: PATCH + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895842?api-version=2021-03-07 + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Wed, 10 Feb 2021 15:47:48 GMT + ms-cv: + - ci1ZpvX4cUSbfe/jkmyjZw.0 + request-context: + - appId= + x-processing-time: + - 772ms + status: + code: 404 + message: Not Found +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml new file mode 100644 index 000000000000..a01aee2b17d0 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{"calling": "outbound", "sms": "outbound"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '42' + Content-Type: + - application/merge-patch+json + Date: + - Tue, 09 Feb 2021 23:06:25 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: PATCH + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895842/capabilities?api-version=2021-03-07 + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 09 Feb 2021 23:06:25 GMT + ms-cv: + - Xo9exfZlHEeJKpYR3Wu//w.0 + request-context: + - appId= + x-processing-time: + - 177ms + status: + code: 404 + message: Not Found +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_cancel_reservation.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_cancel_reservation.yaml deleted file mode 100644 index 93db36adc237..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_cancel_reservation.yaml +++ /dev/null @@ -1,25 +0,0 @@ -interactions: -- request: - body: '' - headers: - Date: - - Mon, 23 Nov 2020 22:14:46 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches/reservation_id_to_cancel/cancel?api-version=2020-07-20-preview1 - response: - body: - string: '' - headers: - content-length: '0' - date: Mon, 23 Nov 2020 22:14:46 GMT - ms-cv: HI79prVtXkW5jqOrJGJWRw.0 - x-processing-time: 521ms - status: - code: 202 - message: Accepted - url: https://sanitized.communication.azure.com/administration/phonenumbers/searches/sanitized/cancel?api-version=2020-07-20-preview1 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_configure_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_configure_number.yaml deleted file mode 100644 index 7a2dc2423a82..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_configure_number.yaml +++ /dev/null @@ -1,30 +0,0 @@ -interactions: -- request: - body: 'b''{"pstnConfiguration": {"callbackUrl": "https://callbackurl", "applicationId": - "ApplicationId"}, "phoneNumber": "+1area_code_for_reservation4501240"}''' - headers: - Content-Length: - - '126' - Content-Type: - - application/json - Date: - - Mon, 23 Nov 2020 22:14:47 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: PATCH - uri: https://sanitized.communication.azure.com/administration/phonenumbers/numberconfiguration/configure?api-version=2020-07-20-preview1 - response: - body: - string: '' - headers: - content-length: '0' - date: Mon, 23 Nov 2020 22:14:48 GMT - ms-cv: gkH/fRlDTkKsBLC5WTNKFg.0 - x-processing-time: 953ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/numberconfiguration/configure?api-version=2020-07-20-preview1 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_all_area_codes.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_all_area_codes.yaml deleted file mode 100644 index 4fe7e57101c2..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_all_area_codes.yaml +++ /dev/null @@ -1,32 +0,0 @@ -interactions: -- request: - body: '{}' - headers: - Accept: - - application/json - Content-Length: - - '2' - Content-Type: - - application/json - Date: - - Mon, 23 Nov 2020 22:14:48 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/administration/phonenumbers/countries/US/areacodes?locationType=NotRequired&phonePlanId=phone_plan_id_area_codes&api-version=2020-07-20-preview1 - response: - body: '{"primaryAreaCodes": ["area_code_for_reservation"], "secondaryAreaCodes": - [], "nextLink": null}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:14:48 GMT - ms-cv: t5ZSuiiwCEe0L7XH6nksWA.0 - transfer-encoding: chunked - x-processing-time: 347ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/countries/US/areacodes?locationType=NotRequired&phonePlanId=sanitized&api-version=2020-07-20-preview1 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_capabilities_update.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_capabilities_update.yaml deleted file mode 100644 index 9cea23a757ed..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_capabilities_update.yaml +++ /dev/null @@ -1,28 +0,0 @@ -interactions: -- request: - body: '' - headers: - Accept: - - application/json - Date: - - Mon, 23 Nov 2020 22:14:49 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/capabilities/capabilities_id?api-version=2020-07-20-preview1 - response: - body: '{"capabilitiesUpdateId": "sanitized", "createdAt": "2020-09-28T17:49:13.2696607+00:00", - "capabilitiesUpdateStatus": "Complete", "phoneNumberCapabilitiesUpdates": "sanitized"}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:14:53 GMT - ms-cv: 9Nc5gaDqzkWSizDfDt3f3A.0 - transfer-encoding: chunked - x-processing-time: 607ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/capabilities/sanitized?api-version=2020-07-20-preview1 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_number_configuration.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_number_configuration.yaml deleted file mode 100644 index 679d691bfb23..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_number_configuration.yaml +++ /dev/null @@ -1,32 +0,0 @@ -interactions: -- request: - body: 'b''{"phoneNumber": "+1area_code_for_reservation4501240"}''' - headers: - Accept: - - application/json - Content-Length: - - '31' - Content-Type: - - application/json - Date: - - Mon, 23 Nov 2020 22:14:53 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/administration/phonenumbers/numberconfiguration?api-version=2020-07-20-preview1 - response: - body: '{"pstnConfiguration": {"callbackUrl": "https://callbackurl", "applicationId": - "ApplicationId", "azurePstnTargetId": "85c9239f-0b81-47e6-b25e-95ccaf48581f"}}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:14:54 GMT - ms-cv: FuDCzDwaikSDMeCKWEIxeQ.0 - transfer-encoding: chunked - x-processing-time: 343ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/numberconfiguration?api-version=2020-07-20-preview1 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_plan_location_options.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_plan_location_options.yaml deleted file mode 100644 index de690eaa2551..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_plan_location_options.yaml +++ /dev/null @@ -1,242 +0,0 @@ -interactions: -- request: - body: '' - headers: - Accept: - - application/json - Date: - - Mon, 23 Nov 2020 22:14:54 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/countries/US/phoneplangroups/phone_plan_group_id/phoneplans/phone_plan_id/locationoptions?locale=en-US&api-version=2020-07-20-preview1 - response: - body: '{"locationOptions": {"labelId": "state", "labelName": "State", "options": - [{"name": "AK", "value": "AK", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Anchorage", "value": "NOAM-US-AK-AN", "locationOptions": - []}]}]}, {"name": "AL", "value": "AL", "locationOptions": [{"labelId": "city", - "labelName": "City", "options": [{"name": "Birmingham", "value": "NOAM-US-AL-BI", - "locationOptions": []}, {"name": "Huntsville", "value": "NOAM-US-AL-HN", "locationOptions": - []}, {"name": "Mobile", "value": "NOAM-US-AL-MO", "locationOptions": []}, {"name": - "Montgomery", "value": "NOAM-US-AL-MN", "locationOptions": []}]}]}, {"name": - "AR", "value": "AR", "locationOptions": [{"labelId": "city", "labelName": "City", - "options": [{"name": "Fort Smith", "value": "NOAM-US-AR-FS", "locationOptions": - []}, {"name": "Jonesboro", "value": "NOAM-US-AR-JO", "locationOptions": []}, - {"name": "Little Rock", "value": "NOAM-US-AR-LR", "locationOptions": []}]}]}, - {"name": "AZ", "value": "AZ", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Phoenix", "value": "NOAM-US-AZ-PH", "locationOptions": - []}]}]}, {"name": "CA", "value": "CA", "locationOptions": [{"labelId": "city", - "labelName": "City", "options": [{"name": "Anaheim", "value": "NOAM-US-CA-AN", - "locationOptions": []}, {"name": "Burbank", "value": "NOAM-US-CA-BU", "locationOptions": - []}, {"name": "Fresno", "value": "NOAM-US-CA-FR", "locationOptions": []}, {"name": - "Irvine", "value": "NOAM-US-CA-IR", "locationOptions": []}, {"name": "Los Angeles", - "value": "NOAM-US-CA-LA", "locationOptions": []}, {"name": "Riverside", "value": - "NOAM-US-CA-RI", "locationOptions": []}, {"name": "Sacramento", "value": "NOAM-US-CA-SA", - "locationOptions": []}, {"name": "Salinas", "value": "NOAM-US-CA-SL", "locationOptions": - []}, {"name": "San Diego", "value": "NOAM-US-CA-SD", "locationOptions": []}, - {"name": "San Jose", "value": "NOAM-US-CA-SJ", "locationOptions": []}, {"name": - "Santa Barbara", "value": "NOAM-US-CA-SB", "locationOptions": []}, {"name": - "Santa Clarita", "value": "NOAM-US-CA-SC", "locationOptions": []}, {"name": - "Santa Rosa", "value": "NOAM-US-CA-SR", "locationOptions": []}, {"name": "Stockton", - "value": "NOAM-US-CA-ST", "locationOptions": []}]}]}, {"name": "CL", "value": - "CL", "locationOptions": [{"labelId": "city", "labelName": "City", "options": - [{"name": "Washington DC", "value": "NOAM-US-CL-DC", "locationOptions": []}]}]}, - {"name": "CO", "value": "CO", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Denver", "value": "NOAM-US-CO-DE", "locationOptions": - []}, {"name": "Grand Junction", "value": "NOAM-US-CO-GJ", "locationOptions": - []}, {"name": "Pueblo", "value": "NOAM-US-CO-PU", "locationOptions": []}]}]}, - {"name": "CT", "value": "CT", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Bridgeport", "value": "NOAM-US-CT-BR", "locationOptions": - []}]}]}, {"name": "DE", "value": "DE", "locationOptions": [{"labelId": "city", - "labelName": "City", "options": [{"name": "Wilmington", "value": "NOAM-US-DE-WI", - "locationOptions": []}]}]}, {"name": "FL", "value": "FL", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Cape Coral", - "value": "NOAM-US-FL-CC", "locationOptions": []}, {"name": "Daytona Beach", - "value": "NOAM-US-FL-DB", "locationOptions": []}, {"name": "Fort Lauderdale", - "value": "NOAM-US-FL-FL", "locationOptions": []}, {"name": "Gainesville", "value": - "NOAM-US-FL-GA", "locationOptions": []}, {"name": "Jacksonville", "value": "NOAM-US-FL-JA", - "locationOptions": []}, {"name": "Lakeland", "value": "NOAM-US-FL-LA", "locationOptions": - []}, {"name": "Miami", "value": "NOAM-US-FL-MI", "locationOptions": []}, {"name": - "Orlando", "value": "NOAM-US-FL-OR", "locationOptions": []}, {"name": "Port - St Lucie", "value": "NOAM-US-FL-PS", "locationOptions": []}, {"name": "Sarasota", - "value": "NOAM-US-FL-SA", "locationOptions": []}, {"name": "Tallahassee", "value": - "NOAM-US-FL-TA", "locationOptions": []}, {"name": "West Palm Beach", "value": - "NOAM-US-FL-WP", "locationOptions": []}]}]}, {"name": "GA", "value": "GA", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Albany", "value": - "NOAM-US-GA-AL", "locationOptions": []}, {"name": "Atlanta", "value": "NOAM-US-GA-AT", - "locationOptions": []}, {"name": "Augusta", "value": "NOAM-US-GA-AU", "locationOptions": - []}, {"name": "Macon", "value": "NOAM-US-GA-MA", "locationOptions": []}, {"name": - "Savannah", "value": "NOAM-US-GA-SA", "locationOptions": []}]}]}, {"name": "HI", - "value": "HI", "locationOptions": [{"labelId": "city", "labelName": "City", - "options": [{"name": "Honolulu", "value": "NOAM-US-HI-HO", "locationOptions": - []}]}]}, {"name": "IA", "value": "IA", "locationOptions": [{"labelId": "city", - "labelName": "City", "options": [{"name": "Cedar Rapids", "value": "NOAM-US-IA-CR", - "locationOptions": []}, {"name": "Davenport", "value": "NOAM-US-IA-DA", "locationOptions": - []}, {"name": "Mason City", "value": "NOAM-US-IA-MC", "locationOptions": []}]}]}, - {"name": "ID", "value": "ID", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Boise", "value": "NOAM-US-ID-BO", "locationOptions": - []}]}]}, {"name": "IL", "value": "IL", "locationOptions": [{"labelId": "city", - "labelName": "City", "options": [{"name": "Alton", "value": "NOAM-US-IL-AL", - "locationOptions": []}, {"name": "Aurora", "value": "NOAM-US-IL-AU", "locationOptions": - []}, {"name": "Big Rock", "value": "NOAM-US-IL-BK", "locationOptions": []}, - {"name": "Champaign", "value": "NOAM-US-IL-CA", "locationOptions": []}, {"name": - "Chicago", "value": "NOAM-US-IL-CH", "locationOptions": []}, {"name": "Cicero", - "value": "NOAM-US-IL-CI", "locationOptions": []}, {"name": "Rock Island", "value": - "NOAM-US-IL-RI", "locationOptions": []}, {"name": "Waukegan", "value": "NOAM-US-IL-WK", - "locationOptions": []}]}]}, {"name": "IN", "value": "IN", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Evansville", - "value": "NOAM-US-IN-EV", "locationOptions": []}, {"name": "Fort Wayne", "value": - "NOAM-US-IN-FW", "locationOptions": []}, {"name": "Gary", "value": "NOAM-US-IN-GA", - "locationOptions": []}, {"name": "Indianapolis", "value": "NOAM-US-IN-IN", "locationOptions": - []}, {"name": "South Bend", "value": "NOAM-US-IN-SB", "locationOptions": []}]}]}, - {"name": "KS", "value": "KS", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Dodge City", "value": "NOAM-US-KS-DC", "locationOptions": - []}, {"name": "Kansas City", "value": "NOAM-US-KS-KS", "locationOptions": []}, - {"name": "Topeka", "value": "NOAM-US-KS-TO", "locationOptions": []}, {"name": - "Wichita", "value": "NOAM-US-KS-WI", "locationOptions": []}]}]}, {"name": "KY", - "value": "KY", "locationOptions": [{"labelId": "city", "labelName": "City", - "options": [{"name": "Ashland", "value": "NOAM-US-KY-AS", "locationOptions": - []}, {"name": "Lexington", "value": "NOAM-US-KY-LE", "locationOptions": []}, - {"name": "Louisville", "value": "NOAM-US-KY-LO", "locationOptions": []}]}]}, - {"name": "LA", "value": "LA", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Baton Rouge", "value": "NOAM-US-LA-BR", "locationOptions": - []}, {"name": "Lafayette", "value": "NOAM-US-LA-LA", "locationOptions": []}, - {"name": "New Orleans", "value": "NOAM-US-LA-NO", "locationOptions": []}, {"name": - "Shreveport", "value": "NOAM-US-LA-SH", "locationOptions": []}]}]}, {"name": - "MA", "value": "MA", "locationOptions": [{"labelId": "city", "labelName": "City", - "options": [{"name": "Boston", "value": "NOAM-US-MA-BO", "locationOptions": - []}, {"name": "Chicopee", "value": "NOAM-US-MA-CH", "locationOptions": []}]}]}, - {"name": "MD", "value": "MD", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Baltimore", "value": "NOAM-US-MD-BA", "locationOptions": - []}]}]}, {"name": "ME", "value": "ME", "locationOptions": [{"labelId": "city", - "labelName": "City", "options": [{"name": "Portland", "value": "NOAM-US-ME-PO", - "locationOptions": []}]}]}, {"name": "MI", "value": "MI", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Detroit", "value": - "NOAM-US-MI-DE", "locationOptions": []}, {"name": "Flint", "value": "NOAM-US-MI-FL", - "locationOptions": []}, {"name": "Grand Rapids", "value": "NOAM-US-MI-GP", "locationOptions": - []}, {"name": "Grant", "value": "NOAM-US-MI-GR", "locationOptions": []}, {"name": - "Lansing", "value": "NOAM-US-MI-LA", "locationOptions": []}, {"name": "Saginaw", - "value": "NOAM-US-MI-SA", "locationOptions": []}, {"name": "Sault Ste Marie", - "value": "NOAM-US-MI-SS", "locationOptions": []}, {"name": "Troy", "value": - "NOAM-US-MI-TR", "locationOptions": []}]}]}, {"name": "MN", "value": "MN", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Duluth", "value": - "NOAM-US-MN-DU", "locationOptions": []}, {"name": "Minneapolis", "value": "NOAM-US-MN-MI", - "locationOptions": []}]}]}, {"name": "MO", "value": "MO", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Kansas City", - "value": "NOAM-US-MO-KS", "locationOptions": []}, {"name": "Marshall", "value": - "NOAM-US-MO-MA", "locationOptions": []}, {"name": "Springfield", "value": "NOAM-US-MO-SP", - "locationOptions": []}, {"name": "St. Charles", "value": "NOAM-US-MO-SC", "locationOptions": - []}, {"name": "St. Louis", "value": "NOAM-US-MO-SL", "locationOptions": []}]}]}, - {"name": "MS", "value": "MS", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Biloxi", "value": "NOAM-US-MS-BI", "locationOptions": - []}, {"name": "Jackson", "value": "NOAM-US-MS-JA", "locationOptions": []}, {"name": - "Starkville", "value": "NOAM-US-MS-ST", "locationOptions": []}]}]}, {"name": - "MT", "value": "MT", "locationOptions": [{"labelId": "city", "labelName": "City", - "options": [{"name": "Billings", "value": "NOAM-US-MT-BI", "locationOptions": - []}]}]}, {"name": "NC", "value": "NC", "locationOptions": [{"labelId": "city", - "labelName": "City", "options": [{"name": "Charlotte", "value": "NOAM-US-NC-CH", - "locationOptions": []}, {"name": "Fayetteville", "value": "NOAM-US-NC-FA", "locationOptions": - []}, {"name": "Greensboro", "value": "NOAM-US-NC-GR", "locationOptions": []}, - {"name": "Raleigh", "value": "NOAM-US-NC-RA", "locationOptions": []}]}]}, {"name": - "NE", "value": "NE", "locationOptions": [{"labelId": "city", "labelName": "City", - "options": [{"name": "Kearney", "value": "NOAM-US-NE-KE", "locationOptions": - []}, {"name": "Omaha", "value": "NOAM-US-NE-OM", "locationOptions": []}]}]}, - {"name": "NJ", "value": "NJ", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Atlantic City", "value": "NOAM-US-NJ-AC", "locationOptions": - []}, {"name": "Camden", "value": "NOAM-US-NJ-CA", "locationOptions": []}, {"name": - "Elizabeth", "value": "NOAM-US-NJ-EL", "locationOptions": []}, {"name": "Jersey - City", "value": "NOAM-US-NJ-JC", "locationOptions": []}, {"name": "Newark", - "value": "NOAM-US-NJ-NE", "locationOptions": []}]}]}, {"name": "NM", "value": - "NM", "locationOptions": [{"labelId": "city", "labelName": "City", "options": - [{"name": "Las Cruces", "value": "NOAM-US-NM-LC", "locationOptions": []}]}]}, - {"name": "NV", "value": "NV", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Las Vegas", "value": "NOAM-US-NV-LV", "locationOptions": - []}, {"name": "Reno", "value": "NOAM-US-NV-RE", "locationOptions": []}]}]}, - {"name": "NY", "value": "NY", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Albany", "value": "NOAM-US-NY-AL", "locationOptions": - []}, {"name": "Elmira", "value": "NOAM-US-NY-EL", "locationOptions": []}, {"name": - "Kingston", "value": "NOAM-US-NY-KI", "locationOptions": []}, {"name": "New - York City", "value": "NOAM-US-NY-NY", "locationOptions": []}, {"name": "Niagara - Falls", "value": "NOAM-US-NY-NF", "locationOptions": []}, {"name": "Rochester", - "value": "NOAM-US-NY-RO", "locationOptions": []}, {"name": "Syracuse", "value": - "NOAM-US-NY-SY", "locationOptions": []}]}]}, {"name": "OH", "value": "OH", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Akron", "value": - "NOAM-US-OH-AK", "locationOptions": []}, {"name": "Cincinnati", "value": "NOAM-US-OH-CI", - "locationOptions": []}, {"name": "Cleveland", "value": "NOAM-US-OH-CL", "locationOptions": - []}, {"name": "Columbus", "value": "NOAM-US-OH-CO", "locationOptions": []}, - {"name": "Dayton", "value": "NOAM-US-OH-DA", "locationOptions": []}, {"name": - "Toledo", "value": "NOAM-US-OH-TO", "locationOptions": []}]}]}, {"name": "OK", - "value": "OK", "locationOptions": [{"labelId": "city", "labelName": "City", - "options": [{"name": "Lawton", "value": "NOAM-US-OK-LA", "locationOptions": - []}, {"name": "Oklahoma City", "value": "NOAM-US-OK-OC", "locationOptions": - []}, {"name": "Tulsa", "value": "NOAM-US-OK-TU", "locationOptions": []}]}]}, - {"name": "PA", "value": "PA", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Erie", "value": "NOAM-US-PA-ER", "locationOptions": - []}, {"name": "Lancaster", "value": "NOAM-US-PA-LA", "locationOptions": []}, - {"name": "New Castle", "value": "NOAM-US-PA-NC", "locationOptions": []}, {"name": - "Philadelphia", "value": "NOAM-US-PA-PI", "locationOptions": []}, {"name": "Pittsburgh", - "value": "NOAM-US-PA-PT", "locationOptions": []}, {"name": "Scranton", "value": - "NOAM-US-PA-SC", "locationOptions": []}]}]}, {"name": "RI", "value": "RI", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Providence", - "value": "NOAM-US-RI-PR", "locationOptions": []}]}]}, {"name": "SC", "value": - "SC", "locationOptions": [{"labelId": "city", "labelName": "City", "options": - [{"name": "Charleston", "value": "NOAM-US-SC-CH", "locationOptions": []}, {"name": - "Columbia", "value": "NOAM-US-SC-CO", "locationOptions": []}, {"name": "Greenville", - "value": "NOAM-US-SC-GR", "locationOptions": []}]}]}, {"name": "SD", "value": - "SD", "locationOptions": [{"labelId": "city", "labelName": "City", "options": - [{"name": "Sioux Falls", "value": "NOAM-US-SD-SF", "locationOptions": []}]}]}, - {"name": "TN", "value": "TN", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Chattanooga", "value": "NOAM-US-TN-CH", "locationOptions": - []}, {"name": "Clarksville", "value": "NOAM-US-TN-CL", "locationOptions": []}, - {"name": "Jackson", "value": "NOAM-US-TN-JA", "locationOptions": []}, {"name": - "Knoxville", "value": "NOAM-US-TN-KN", "locationOptions": []}, {"name": "Memphis", - "value": "NOAM-US-TN-ME", "locationOptions": []}, {"name": "Nashville", "value": - "NOAM-US-TN-NA", "locationOptions": []}]}]}, {"name": "TX", "value": "TX", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Abilene", "value": - "NOAM-US-TX-AB", "locationOptions": []}, {"name": "Austin", "value": "NOAM-US-TX-AU", - "locationOptions": []}, {"name": "Bryan", "value": "NOAM-US-TX-BR", "locationOptions": - []}, {"name": "Corpus Christi", "value": "NOAM-US-TX-CC", "locationOptions": - []}, {"name": "Dallas", "value": "NOAM-US-TX-DA", "locationOptions": []}, {"name": - "Denton", "value": "NOAM-US-TX-DE", "locationOptions": []}, {"name": "El Paso", - "value": "NOAM-US-TX-EP", "locationOptions": []}, {"name": "Fort Worth", "value": - "NOAM-US-TX-FW", "locationOptions": []}, {"name": "Galveston", "value": "NOAM-US-TX-GA", - "locationOptions": []}, {"name": "Houston", "value": "NOAM-US-TX-HO", "locationOptions": - []}, {"name": "Huntsville", "value": "NOAM-US-TX-HU", "locationOptions": []}, - {"name": "Lubbock", "value": "NOAM-US-TX-LU", "locationOptions": []}, {"name": - "Tyler", "value": "NOAM-US-TX-TY", "locationOptions": []}]}]}, {"name": "UT", - "value": "UT", "locationOptions": [{"labelId": "city", "labelName": "City", - "options": [{"name": "Salt Lake City", "value": "NOAM-US-UT-SL", "locationOptions": - []}, {"name": "St. George", "value": "NOAM-US-UT-SG", "locationOptions": []}]}]}, - {"name": "VA", "value": "VA", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Lynchburg", "value": "NOAM-US-VA-LY", "locationOptions": - []}, {"name": "Richmond", "value": "NOAM-US-VA-RI", "locationOptions": []}, - {"name": "Virginia Beach", "value": "NOAM-US-VA-VB", "locationOptions": []}]}]}, - {"name": "VT", "value": "VT", "locationOptions": [{"labelId": "city", "labelName": - "City", "options": [{"name": "Bennington", "value": "NOAM-US-VT-BE", "locationOptions": - []}, {"name": "Brattleboro", "value": "NOAM-US-VT-BR", "locationOptions": []}, - {"name": "Burlington", "value": "NOAM-US-VT-BU", "locationOptions": []}, {"name": - "Middlebury", "value": "NOAM-US-VT-MB", "locationOptions": []}, {"name": "Montpelier", - "value": "NOAM-US-VT-MP", "locationOptions": []}, {"name": "Newport", "value": - "NOAM-US-VT-NE", "locationOptions": []}]}]}, {"name": "WI", "value": "WI", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Green Bay", - "value": "NOAM-US-WI-GB", "locationOptions": []}, {"name": "Kenosha", "value": - "NOAM-US-WI-KE", "locationOptions": []}, {"name": "Madison", "value": "NOAM-US-WI-MA", - "locationOptions": []}, {"name": "Milwaukee", "value": "NOAM-US-WI-MI", "locationOptions": - []}]}]}, {"name": "WV", "value": "WV", "locationOptions": [{"labelId": "city", - "labelName": "City", "options": [{"name": "Charleston", "value": "NOAM-US-WV-CH", - "locationOptions": []}]}]}, {"name": "WY", "value": "WY", "locationOptions": - [{"labelId": "city", "labelName": "City", "options": [{"name": "Laramie", "value": - "NOAM-US-WY-LA", "locationOptions": []}]}]}]}}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:14:56 GMT - ms-cv: kJvwrGRCM0e2ipPNM0gSVg.0 - transfer-encoding: chunked - x-processing-time: 371ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/countries/US/phoneplangroups/sanitized/phoneplans/sanitized/locationoptions?locale=en-US&api-version=2020-07-20-preview1 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_release_by_id.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_release_by_id.yaml deleted file mode 100644 index 353177013bea..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_release_by_id.yaml +++ /dev/null @@ -1,29 +0,0 @@ -interactions: -- request: - body: '' - headers: - Accept: - - application/json - Date: - - Mon, 23 Nov 2020 22:14:57 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/releases/release_id?api-version=2020-07-20-preview1 - response: - body: '{"releaseId": "sanitized", "createdAt": "2020-09-28T20:09:36.2701214+00:00", - "status": "Failed", "errorMessage": "All numbers in Failed state after BVD call", - "phoneNumberReleaseStatusDetails": "sanitized"}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:14:57 GMT - ms-cv: thMMTFXbZEKNJWphHbZokg.0 - transfer-encoding: chunked - x-processing-time: 469ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/releases/sanitized?api-version=2020-07-20-preview1 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_reservation_by_id.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_reservation_by_id.yaml deleted file mode 100644 index f2a79cb410b8..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_reservation_by_id.yaml +++ /dev/null @@ -1,31 +0,0 @@ -interactions: -- request: - body: '' - headers: - Accept: - - application/json - Date: - - Mon, 23 Nov 2020 22:14:58 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches/reservation_id?api-version=2020-07-20-preview1 - response: - body: '{"searchId": "sanitized", "displayName": "mysearch20200928", "createdAt": - "2020-10-02T21:39:32.6878583+00:00", "description": "mydescription", "phonePlanIds": - "sanitized", "areaCode": "area_code_for_reservation", "quantity": 1, "locationOptions": - [], "status": "Success", "phoneNumbers": "sanitized", "reservationExpiryDate": - "2020-10-02T21:55:47.9734151+00:00"}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:14:57 GMT - ms-cv: BG/74cPPNUGIVKPwJs2gKw.0 - transfer-encoding: chunked - x-processing-time: 310ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/searches/sanitized?api-version=2020-07-20-preview1 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers.yaml deleted file mode 100644 index 37e61c8e4e32..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers.yaml +++ /dev/null @@ -1,27 +0,0 @@ -interactions: -- request: - body: '' - headers: - Accept: - - application/json - Date: - - Mon, 23 Nov 2020 22:14:58 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/phonenumbers?locale=en-US&skip=0&take=100&api-version=2020-07-20-preview1 - response: - body: '{"phoneNumbers": "sanitized", "nextLink": null}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:14:59 GMT - ms-cv: Du1G8mMBDEyacpYn33iUJg.0 - transfer-encoding: chunked - x-processing-time: 649ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/phonenumbers?locale=en-US&skip=0&take=100&api-version=2020-07-20-preview1 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers_from_managed_identity.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers_from_managed_identity.yaml deleted file mode 100644 index 4ad1a112d86c..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers_from_managed_identity.yaml +++ /dev/null @@ -1,25 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/phonenumbers?locale=en-US&skip=0&take=100&api-version=2020-07-20-preview1 - response: - body: - string: '{"phoneNumbers": "sanitized", "nextLink": null}' - headers: - content-type: application/json; charset=utf-8 - date: Thu, 28 Jan 2021 18:49:47 GMT - ms-cv: jqpEP/JsFUKDau9Y0tMhbw.0 - request-context: appId= - transfer-encoding: chunked - x-processing-time: 765ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/phonenumbers?locale=en-US&skip=0&take=100&api-version=2020-07-20-preview1 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_releases.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_releases.yaml deleted file mode 100644 index d7cb62a5676a..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_releases.yaml +++ /dev/null @@ -1,27 +0,0 @@ -interactions: -- request: - body: '' - headers: - Accept: - - application/json - Date: - - Mon, 23 Nov 2020 22:14:59 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/releases?skip=0&take=100&api-version=2020-07-20-preview1 - response: - body: '{"entities": "sanitized", "nextLink": null}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:14:59 GMT - ms-cv: 4PD9pQr43kKolsoYwM2Bgw.0 - transfer-encoding: chunked - x-processing-time: 357ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/releases?skip=0&take=100&api-version=2020-07-20-preview1 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_supported_countries.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_supported_countries.yaml deleted file mode 100644 index 1f2143ae8e33..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_supported_countries.yaml +++ /dev/null @@ -1,28 +0,0 @@ -interactions: -- request: - body: '' - headers: - Accept: - - application/json - Date: - - Mon, 23 Nov 2020 22:15:00 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/countries?locale=en-US&skip=0&take=100&api-version=2020-07-20-preview1 - response: - body: '{"countries": [{"localizedName": "Canada", "countryCode": "CA"}, {"localizedName": - "United States", "countryCode": "US"}], "nextLink": null}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:14:59 GMT - ms-cv: 7tEvn8UWqEiFscQy1auozg.0 - transfer-encoding: chunked - x-processing-time: 488ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/countries?locale=en-US&skip=0&take=100&api-version=2020-07-20-preview1 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_phone_plan_groups.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_phone_plan_groups.yaml deleted file mode 100644 index d6424d373b40..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_phone_plan_groups.yaml +++ /dev/null @@ -1,27 +0,0 @@ -interactions: -- request: - body: '' - headers: - Accept: - - application/json - Date: - - Mon, 23 Nov 2020 22:15:00 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/countries/US/phoneplangroups?locale=en-US&includeRateInformation=false&skip=0&take=100&api-version=2020-07-20-preview1 - response: - body: '{"phonePlanGroups": "sanitized", "nextLink": null}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:15:01 GMT - ms-cv: fl11HT80PkG+GKZqDsSbfQ.0 - transfer-encoding: chunked - x-processing-time: 762ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/countries/US/phoneplangroups?locale=en-US&includeRateInformation=false&skip=0&take=100&api-version=2020-07-20-preview1 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_phone_plans.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_phone_plans.yaml deleted file mode 100644 index b9bbb45f59bb..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_phone_plans.yaml +++ /dev/null @@ -1,27 +0,0 @@ -interactions: -- request: - body: '' - headers: - Accept: - - application/json - Date: - - Mon, 23 Nov 2020 22:15:01 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/countries/US/phoneplangroups/phone_plan_group_id/phoneplans?locale=en-US&skip=0&take=100&api-version=2020-07-20-preview1 - response: - body: '{"phonePlans": "sanitized", "nextLink": null}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:15:01 GMT - ms-cv: anGjQcg2C0WcRKun92ShUw.0 - transfer-encoding: chunked - x-processing-time: 354ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/countries/US/phoneplangroups/sanitized/phoneplans?locale=en-US&skip=0&take=100&api-version=2020-07-20-preview1 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_reservation.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_reservation.yaml deleted file mode 100644 index 0cccf09cbf02..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_reservation.yaml +++ /dev/null @@ -1,54 +0,0 @@ -interactions: -- request: - body: '' - headers: - Date: - - Mon, 23 Nov 2020 22:15:02 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches/reservation_id/purchase?api-version=2020-07-20-preview1 - response: - body: - string: '' - headers: - content-length: '0' - date: Mon, 23 Nov 2020 22:15:02 GMT - ms-cv: bHM865RpP0SiUNt4qxdlDw.0 - x-processing-time: 529ms - status: - code: 202 - message: Accepted - url: https://sanitized.communication.azure.com/administration/phonenumbers/searches/sanitized/purchase?api-version=2020-07-20-preview1 -- request: - body: '' - headers: - Accept: - - application/json - Date: - - Mon, 23 Nov 2020 22:15:02 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches/reservation_id?api-version=2020-07-20-preview1 - response: - body: '{"searchId": "sanitized", "displayName": "mysearch20200928", "createdAt": - "2020-10-02T21:39:32.6878583+00:00", "description": "mydescription", "phonePlanIds": - "sanitized", "areaCode": "area_code_for_reservation", "quantity": 1, "locationOptions": - [], "status": "Success", "phoneNumbers": "sanitized", "reservationExpiryDate": - "2020-10-02T21:55:47.9734151+00:00"}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:15:02 GMT - ms-cv: yPreFWnm30S6Zotx337N/Q.0 - transfer-encoding: chunked - x-processing-time: 563ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/searches/sanitized?api-version=2020-07-20-preview1 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_numbers.yaml deleted file mode 100644 index 8ddf05ce5f35..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_numbers.yaml +++ /dev/null @@ -1,111 +0,0 @@ -interactions: -- request: - body: 'b''{"phoneNumbers": ["+1area_code_for_reservation7840394"]}''' - headers: - Accept: - - application/json - Content-Length: - - '34' - Content-Type: - - application/json - Date: - - Mon, 23 Nov 2020 22:15:03 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/administration/phonenumbers/releases?api-version=2020-07-20-preview1 - response: - body: '{"releaseId": "sanitized"}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:15:03 GMT - ms-cv: C+e6Bsl04EOYzASUKe+jWA.0 - transfer-encoding: chunked - x-processing-time: 719ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/releases?api-version=2020-07-20-preview1 -- request: - body: '' - headers: - Accept: - - application/json - Date: - - Mon, 23 Nov 2020 22:15:04 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/releases/ffff1f34-bcdd-42c3-8281-d7dc9b79264d?api-version=2020-07-20-preview1 - response: - body: '{"releaseId": "sanitized", "createdAt": "2020-11-23T22:15:03.8078455+00:00", - "status": "Pending", "phoneNumberReleaseStatusDetails": "sanitized"}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:15:03 GMT - ms-cv: v8ERLmL2JUqitcrp28xrxg.0 - transfer-encoding: chunked - x-processing-time: 191ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/releases/sanitized?api-version=2020-07-20-preview1 -- request: - body: '' - headers: - Accept: - - application/json - Date: - - Mon, 23 Nov 2020 22:15:04 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/releases/ffff1f34-bcdd-42c3-8281-d7dc9b79264d?api-version=2020-07-20-preview1 - response: - body: '{"releaseId": "sanitized", "createdAt": "2020-11-23T22:15:03.8078455+00:00", - "status": "Pending", "phoneNumberReleaseStatusDetails": "sanitized"}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:15:04 GMT - ms-cv: nFuzE/NYDEOntsaMNmdJSw.0 - transfer-encoding: chunked - x-processing-time: 288ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/releases/sanitized?api-version=2020-07-20-preview1 -- request: - body: '' - headers: - Accept: - - application/json - Date: - - Mon, 23 Nov 2020 22:15:10 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/releases/ffff1f34-bcdd-42c3-8281-d7dc9b79264d?api-version=2020-07-20-preview1 - response: - body: '{"releaseId": "sanitized", "createdAt": "2020-11-23T22:15:03.8078455+00:00", - "status": "Failed", "errorMessage": "Unknown exception in BeginReleaseQueueProcessor - : Cannot Process Order since phone number(s) do not belong to tenant:ec53533e-7d3b-4ad0-bf10-7222b049eb8e", - "phoneNumberReleaseStatusDetails": "sanitized"}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:15:09 GMT - ms-cv: qpn1QSP33kO2OqJnvbwHew.0 - transfer-encoding: chunked - x-processing-time: 195ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/releases/sanitized?api-version=2020-07-20-preview1 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_reserve_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_reserve_phone_numbers.yaml deleted file mode 100644 index 2b53d7788bc6..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_reserve_phone_numbers.yaml +++ /dev/null @@ -1,146 +0,0 @@ -interactions: -- request: - body: 'b''b\''{"displayName": "testreservation20200014", "description": "testreservation20200014", - "phonePlanIds": ["phone_plan_id"], "areaCode": "area_code_for_reservation", - "quantity": 1}\''''' - headers: - Accept: - - application/json - Content-Length: - - '176' - Content-Type: - - application/json - Date: - - Mon, 23 Nov 2020 22:15:10 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches?api-version=2020-07-20-preview1 - response: - body: '{"searchId": "sanitized"}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:15:11 GMT - ms-cv: wHNKvhhrIEmoyxIvpQtpVQ.0 - transfer-encoding: chunked - x-processing-time: 1050ms - status: - code: 201 - message: Created - url: https://sanitized.communication.azure.com/administration/phonenumbers/searches?api-version=2020-07-20-preview1 -- request: - body: '' - headers: - Accept: - - application/json - Date: - - Mon, 23 Nov 2020 22:15:11 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches/6ec3963c-33a1-4d99-ad49-8f455205bf24?api-version=2020-07-20-preview1 - response: - body: '{"searchId": "sanitized", "displayName": "testreservation20200014", "createdAt": - "2020-11-23T22:15:10.79994+00:00", "description": "testreservation20200014", - "phonePlanIds": "sanitized", "areaCode": "area_code_for_reservation", "quantity": - 1, "locationOptions": [], "status": "Pending", "phoneNumbers": "sanitized"}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:15:11 GMT - ms-cv: 1uEUtAIVP0ixbJJ6at1t6w.0 - transfer-encoding: chunked - x-processing-time: 353ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/searches/sanitized?api-version=2020-07-20-preview1 -- request: - body: '' - headers: - Accept: - - application/json - Date: - - Mon, 23 Nov 2020 22:15:11 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches/6ec3963c-33a1-4d99-ad49-8f455205bf24?api-version=2020-07-20-preview1 - response: - body: '{"searchId": "sanitized", "displayName": "testreservation20200014", "createdAt": - "2020-11-23T22:15:10.79994+00:00", "description": "testreservation20200014", - "phonePlanIds": "sanitized", "areaCode": "area_code_for_reservation", "quantity": - 1, "locationOptions": [], "status": "Pending", "phoneNumbers": "sanitized"}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:15:12 GMT - ms-cv: ahwC8rgZdEODKQ3PFclPiA.0 - transfer-encoding: chunked - x-processing-time: 268ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/searches/sanitized?api-version=2020-07-20-preview1 -- request: - body: '' - headers: - Accept: - - application/json - Date: - - Mon, 23 Nov 2020 22:15:17 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches/6ec3963c-33a1-4d99-ad49-8f455205bf24?api-version=2020-07-20-preview1 - response: - body: '{"searchId": "sanitized", "displayName": "testreservation20200014", "createdAt": - "2020-11-23T22:15:10.79994+00:00", "description": "testreservation20200014", - "phonePlanIds": "sanitized", "areaCode": "area_code_for_reservation", "quantity": - 1, "locationOptions": [], "status": "InProgress", "phoneNumbers": "sanitized"}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:15:17 GMT - ms-cv: cy0GEqT0NUewZf2v3XLVcw.0 - transfer-encoding: chunked - x-processing-time: 271ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/searches/sanitized?api-version=2020-07-20-preview1 -- request: - body: '' - headers: - Accept: - - application/json - Date: - - Mon, 23 Nov 2020 22:15:22 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/administration/phonenumbers/searches/6ec3963c-33a1-4d99-ad49-8f455205bf24?api-version=2020-07-20-preview1 - response: - body: '{"searchId": "sanitized", "displayName": "testreservation20200014", "createdAt": - "2020-11-23T22:15:10.79994+00:00", "description": "testreservation20200014", - "phonePlanIds": "sanitized", "areaCode": "area_code_for_reservation", "quantity": - 1, "locationOptions": [], "status": "Error", "phoneNumbers": "sanitized", "errorCode": - 1000}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:15:22 GMT - ms-cv: ormTTpdelUe7v7WzL6x7mw.0 - transfer-encoding: chunked - x-processing-time: 265ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/searches/sanitized?api-version=2020-07-20-preview1 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_capabilities.yaml deleted file mode 100644 index 0f12b8d77b9e..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_capabilities.yaml +++ /dev/null @@ -1,32 +0,0 @@ -interactions: -- request: - body: 'b''{"phoneNumberCapabilitiesUpdate": {"+1area_code_for_reservation4501240": - {"add": []}}}''' - headers: - Accept: - - application/json - Content-Length: - - '64' - Content-Type: - - application/json - Date: - - Mon, 23 Nov 2020 22:15:22 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b2 Python/3.6.9 (Linux-5.4.0-48-generic-x86_64-with-Ubuntu-18.04-bionic) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/administration/phonenumbers/capabilities?api-version=2020-07-20-preview1 - response: - body: '{"capabilitiesUpdateId": "sanitized"}' - headers: - content-type: application/json; charset=utf-8 - date: Mon, 23 Nov 2020 22:15:23 GMT - ms-cv: lCj9rXv4rkWJUHX1XbaQog.0 - transfer-encoding: chunked - x-processing-time: 1068ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/administration/phonenumbers/capabilities?api-version=2020-07-20-preview1 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index 4823221226d8..c85491db760e 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -1,293 +1,78 @@ -# coding: utf-8 -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- import pytest -import os -from azure.communication.phonenumbers import ( - PhoneNumbersAdministrationClient, - PstnConfiguration, - NumberUpdateCapabilities, - CreateSearchOptions -) -from azure.core.credentials import AccessToken -from phone_number_helper import PhoneNumberUriReplacer -from phone_number_testcase import PhoneNumberCommunicationTestCase -from _shared.testcase import BodyReplacerProcessor -from _shared.utils import create_token_credential -from azure.communication.phonenumbers._shared.utils import parse_connection_str +from azure.communication.phonenumbers import PhoneNumbersClient +from _shared.testcase import CommunicationTestCase, ResponseReplacerProcessor, BodyReplacerProcessor +from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType -SKIP_PHONE_NUMBER_TESTS = True -PHONE_NUMBER_TEST_SKIP_REASON= "Phone Numbers Administration live tests infra not ready yet" - -class PhoneNumbersAdministrationClientTest(PhoneNumberCommunicationTestCase): +class NewTests(CommunicationTestCase): def setUp(self): - super(PhoneNumbersAdministrationClientTest, self).setUp() + super(NewTests, self).setUp() + self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ - BodyReplacerProcessor( - keys=["id", "token", "capabilitiesUpdateId", "phoneNumber", "phonePlanIds", - "phoneNumberCapabilitiesUpdates", "releaseId", - "phoneNumberReleaseStatusDetails", "searchId", "phoneNumbers", - "entities", "phonePlanGroups", "phonePlans", "phoneNumberCapabilitiesUpdate"] - ), - PhoneNumberUriReplacer()]) - self._phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string( - self.connection_str) - if self.is_live: - self.country_code = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_COUNTRY_CODE') - self.locale = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_LOCALE') - self.phone_plan_group_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_GROUP_ID') - self.phone_plan_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_ID') - self.phone_plan_id_area_codes = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_ID_AREA_CODES') - self.area_code_for_reservation = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_AREA_CODE_FOR_RESERVATION') - self.reservation_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RESERVATION_ID') - self.reservation_id_to_purchase = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RESERVATION_ID_TO_PURCHASE') - self.reservation_id_to_cancel = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RESERVATION_ID_TO_CANCEL') - self.phonenumber_to_configure = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONENUMBER_TO_CONFIGURE') - self.phonenumber_to_get_config = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONENUMBER_TO_GET_CONFIG') - self.phonenumber_to_unconfigure = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONENUMBER_TO_UNCONFIGURE') - self.phonenumber_for_capabilities = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONENUMBER_FOR_CAPABILITIES') - self.phonenumber_to_release = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONENUMBER_TO_RELEASE') - self.capabilities_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_CAPABILITIES_ID') - self.release_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RELEASE_ID') - self.scrubber.register_name_pair( - self.phone_plan_group_id, - "phone_plan_group_id" - ) - self.scrubber.register_name_pair( - self.phone_plan_id, - "phone_plan_id" - ) - self.scrubber.register_name_pair( - self.phone_plan_id_area_codes, - "phone_plan_id_area_codes" - ) - self.scrubber.register_name_pair( - self.area_code_for_reservation, - "area_code_for_reservation" - ) - self.scrubber.register_name_pair( - self.reservation_id, - "reservation_id" - ) - self.scrubber.register_name_pair( - self.reservation_id_to_purchase, - "reservation_id_to_purchase" - ) - self.scrubber.register_name_pair( - self.reservation_id_to_cancel, - "reservation_id_to_cancel" - ) - self.scrubber.register_name_pair( - self.phonenumber_to_configure, - "phonenumber_to_configure" - ) - self.scrubber.register_name_pair( - self.phonenumber_to_get_config, - "phonenumber_to_get_config" - ) - self.scrubber.register_name_pair( - self.phonenumber_to_unconfigure, - "phonenumber_to_unconfigure" - ) - self.scrubber.register_name_pair( - self.phonenumber_for_capabilities, - "phonenumber_for_capabilities" - ) - self.scrubber.register_name_pair( - self.phonenumber_to_release, - "phonenumber_to_release" - ) - self.scrubber.register_name_pair( - self.capabilities_id, - "capabilities_id" - ) - self.scrubber.register_name_pair( - self.release_id, - "release_id" - ) - else: - self.connection_str = "endpoint=https://sanitized.communication.azure.com/;accesskey=fake===" - self.country_code = "US" - self.locale = "en-us" - self.phone_plan_group_id = "phone_plan_group_id" - self.phone_plan_id = "phone_plan_id" - self.phone_plan_id_area_codes = "phone_plan_id_area_codes" - self.area_code_for_reservation = "area_code_for_reservation" - self.reservation_id = "reservation_id" - self.reservation_id_to_purchase = "reservation_id_to_purchase" - self.reservation_id_to_cancel = "reservation_id_to_cancel" - self.phonenumber_to_configure = "phonenumber_to_configure" - self.phonenumber_to_get_config = "phonenumber_to_get_config" - self.phonenumber_to_unconfigure = "phonenumber_to_unconfigure" - self.phonenumber_for_capabilities = "phonenumber_for_capabilities" - self.phonenumber_to_release = "phonenumber_to_release" - self.capabilities_id = "capabilities_id" - self.release_id = "release_id" - - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - def test_list_all_phone_numbers_from_managed_identity(self): - endpoint, access_key = parse_connection_str(self.connection_str) - credential = create_token_credential() - phone_number_client = PhoneNumbersAdministrationClient(endpoint, credential) - pages = phone_number_client.list_all_phone_numbers() - assert pages.next() - - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - def test_list_all_phone_numbers(self): - pages = self._phone_number_administration_client.list_all_phone_numbers() - assert pages.next() - - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - def test_get_all_area_codes(self): - area_codes = self._phone_number_administration_client.get_all_area_codes( - location_type="NotRequired", - country_code=self.country_code, - phone_plan_id=self.phone_plan_id_area_codes + BodyReplacerProcessor(), + ResponseReplacerProcessor(keys=[self._resource_name])]) + + def test_list_acquired_phone_numbers(self): + phone_numbers = self.phone_number_client.list_acquired_phone_numbers() + assert phone_numbers.next() + + def test_get_phone_number(self): + phone_number = self.phone_number_client.get_phone_number("+16194895875") + assert phone_number.phone_number == "+16194895875" + + def test_update_phone_number(self): + updated_phone_number = self.phone_number_client.update_phone_number( + "+16194895842", + "", + "" ) - assert area_codes.primary_area_codes + assert updated_phone_number.application_id == "" - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - def test_get_capabilities_update(self): - capability_response = self._phone_number_administration_client.get_capabilities_update( - capabilities_update_id=self.capabilities_id - ) - assert capability_response.capabilities_update_id - - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - def test_update_capabilities(self): - update = NumberUpdateCapabilities(add=iter(["InboundCalling"])) + def test_release_phone_number(self): + poller = self.phone_number_client.begin_release_phone_number("+16194895886") + assert poller.status() == 'succeeded' + - phone_number_capabilities_update = { - self.phonenumber_for_capabilities: update - } - - capability_response = self._phone_number_administration_client.update_capabilities( - phone_number_capabilities_update=phone_number_capabilities_update + def test_search_available_phone_numbers(self): + capabilities = PhoneNumberCapabilities( + calling = PhoneNumberCapabilityValue.INBOUND, + sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND ) - assert capability_response.capabilities_update_id - - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - def test_list_all_supported_countries(self): - countries = self._phone_number_administration_client.list_all_supported_countries() - assert countries.next().localized_name - - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - def test_get_number_configuration(self): - phone_number_response = self._phone_number_administration_client.get_number_configuration( - phone_number=self.phonenumber_to_get_config - ) - assert phone_number_response.pstn_configuration - - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - def test_configure_number(self): - pstnConfig = PstnConfiguration( - callback_url="https://callbackurl", - application_id="ApplicationId" - ) - configure_number_response = self._phone_number_administration_client.configure_number( - pstn_configuration=pstnConfig, - phone_number=self.phonenumber_to_configure - ) - assert not configure_number_response - - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - def test_list_phone_plan_groups(self): - phone_plan_group_response = self._phone_number_administration_client.list_phone_plan_groups( - country_code=self.country_code - ) - assert phone_plan_group_response.next().phone_plan_group_id - - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - def test_list_phone_plans(self): - phone_plan_response = self._phone_number_administration_client.list_phone_plans( - country_code=self.country_code, - phone_plan_group_id=self.phone_plan_group_id - ) - assert phone_plan_response.next().phone_plan_id - - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - def test_get_phone_plan_location_options(self): - location_options_response = self._phone_number_administration_client.get_phone_plan_location_options( - country_code=self.country_code, - phone_plan_group_id=self.phone_plan_group_id, - phone_plan_id=self.phone_plan_id - ) - assert location_options_response.location_options.label_id - - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - def test_get_release_by_id(self): - phone_number_release_response = self._phone_number_administration_client.get_release_by_id( - release_id=self.release_id - ) - assert phone_number_release_response.release_id - - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - def test_list_all_releases(self): - releases_response = self._phone_number_administration_client.list_all_releases() - assert releases_response.next().id - - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - def test_release_phone_numbers(self): - poller = self._phone_number_administration_client.begin_release_phone_numbers( - phone_numbers=[self.phonenumber_to_release] + poller = self.phone_number_client.begin_search_available_phone_numbers( + "US", + PhoneNumberType.TOLL_FREE, + PhoneNumberAssignmentType.APPLICATION, + capabilities, + "833", + 1, + polling = True ) assert poller.result() - - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - def test_get_reservation_by_id(self): - phone_number_reservation_response = self._phone_number_administration_client.get_reservation_by_id( - reservation_id=self.reservation_id - ) - assert phone_number_reservation_response.reservation_id - - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - def test_reserve_phone_numbers(self): - poller = self._phone_number_administration_client.begin_reserve_phone_numbers( - area_code=self.area_code_for_reservation, - description="testreservation20200014", - display_name="testreservation20200014", - phone_plan_ids=[self.phone_plan_id], - quantity=1 + + def test_update_phone_number_capabilities(self): + poller = self.phone_number_client.begin_update_phone_number_capabilities( + "+16194895842", + PhoneNumberCapabilityValue.OUTBOUND, + PhoneNumberCapabilityValue.OUTBOUND, + polling = True ) assert poller.result() - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - def test_cancel_reservation(self): - cancel_reservation_response = self._phone_number_administration_client.cancel_reservation( - reservation_id=self.reservation_id_to_cancel + def test_purchase_phone_numbers(self): + capabilities = PhoneNumberCapabilities( + calling = PhoneNumberCapabilityValue.INBOUND, + sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND ) - assert not cancel_reservation_response - - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - def test_purchase_reservation(self): - poller = self._phone_number_administration_client.begin_purchase_reservation( - reservation_id=self.reservation_id_to_purchase + search_poller = self.phone_number_client.begin_search_available_phone_numbers( + "US", + PhoneNumberType.TOLL_FREE, + PhoneNumberAssignmentType.APPLICATION, + capabilities, + "833", + 1, + polling = True ) - assert poller.result() - - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - def test_list_reservations(self): - pages = self._phone_number_administration_client.list_all_reservations() - assert pages.next() \ No newline at end of file + phone_number_to_buy = search_poller.result() + purchase_poller = self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) + assert purchase_poller.result() + release_poller = self.phone_number_client.begin_release_phone_number("+") + assert release_poller.status() == 'succeeded' diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index 6c3db58a5a77..e69de29bb2d1 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -1,364 +0,0 @@ -# coding: utf-8 -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- -import pytest -from azure.communication.phonenumbers.aio import PhoneNumbersAdministrationClient -from azure.communication.phonenumbers._shared.utils import parse_connection_str -from azure.communication.phonenumbers import ( - PstnConfiguration, - NumberUpdateCapabilities, - CreateSearchOptions -) -from phone_number_helper import PhoneNumberUriReplacer -from phone_number_testcase_async import AsyncPhoneNumberCommunicationTestCase -from _shared.testcase import BodyReplacerProcessor, ResponseReplacerProcessor -from _shared.utils import create_token_credential -import os - -SKIP_PHONE_NUMBER_TESTS = True -PHONE_NUMBER_TEST_SKIP_REASON= "Phone Numbers Administration live tests infra not ready yet" - -class PhoneNumbersAdministrationClientTestAsync(AsyncPhoneNumberCommunicationTestCase): - - def setUp(self): - super(PhoneNumbersAdministrationClientTestAsync, self).setUp() - self.recording_processors.extend([ - BodyReplacerProcessor( - keys=["id", "token", "capabilitiesUpdateId", "phoneNumber", "phonePlanIds", - "phoneNumberCapabilitiesUpdates", "releaseId", - "phoneNumberReleaseStatusDetails", "searchId", "phoneNumbers", - "entities", "phonePlanGroups", "phonePlans", "phoneNumberCapabilitiesUpdate"] - ), - PhoneNumberUriReplacer(), - ResponseReplacerProcessor(keys=[self._resource_name])]) - self._phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string( - self.connection_str) - if self.is_live: - self.country_code = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_COUNTRY_CODE') - self.locale = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_LOCALE') - self.phone_plan_group_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_GROUP_ID') - self.phone_plan_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_ID') - self.phone_plan_id_area_codes = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONE_PLAN_ID_AREA_CODES') - self.area_code_for_reservation = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_AREA_CODE_FOR_RESERVATION') - self.reservation_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RESERVATION_ID') - self.reservation_id_to_purchase = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RESERVATION_ID_TO_PURCHASE') - self.reservation_id_to_cancel = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RESERVATION_ID_TO_CANCEL') - self.phonenumber_to_configure = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONENUMBER_TO_CONFIGURE') - self.phonenumber_to_get_config = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONENUMBER_TO_GET_CONFIG') - self.phonenumber_to_unconfigure = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONENUMBER_TO_UNCONFIGURE') - self.phonenumber_for_capabilities = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONENUMBER_FOR_CAPABILITIES') - self.phonenumber_to_release = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_PHONENUMBER_TO_RELEASE') - self.capabilities_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_CAPABILITIES_ID') - self.release_id = os.getenv('AZURE_COMMUNICATION_SERVICE_PHONENUMBERS_RELEASE_ID') - self.scrubber.register_name_pair( - self.phone_plan_group_id, - "phone_plan_group_id" - ) - self.scrubber.register_name_pair( - self.phone_plan_id, - "phone_plan_id" - ) - self.scrubber.register_name_pair( - self.phone_plan_id_area_codes, - "phone_plan_id_area_codes" - ) - self.scrubber.register_name_pair( - self.area_code_for_reservation, - "area_code_for_reservation" - ) - self.scrubber.register_name_pair( - self.reservation_id, - "reservation_id" - ) - self.scrubber.register_name_pair( - self.reservation_id_to_purchase, - "reservation_id_to_purchase" - ) - self.scrubber.register_name_pair( - self.reservation_id_to_cancel, - "reservation_id_to_cancel" - ) - self.scrubber.register_name_pair( - self.phonenumber_to_configure, - "phonenumber_to_configure" - ) - self.scrubber.register_name_pair( - self.phonenumber_to_get_config, - "phonenumber_to_get_config" - ) - self.scrubber.register_name_pair( - self.phonenumber_to_unconfigure, - "phonenumber_to_unconfigure" - ) - self.scrubber.register_name_pair( - self.phonenumber_for_capabilities, - "phonenumber_for_capabilities" - ) - self.scrubber.register_name_pair( - self.phonenumber_to_release, - "phonenumber_to_release" - ) - self.scrubber.register_name_pair( - self.capabilities_id, - "capabilities_id" - ) - self.scrubber.register_name_pair( - self.release_id, - "release_id" - ) - else: - self.connection_str = "endpoint=https://sanitized.communication.azure.com/;accesskey=fake===" - self.country_code = "US" - self.locale = "en-us" - self.phone_plan_group_id = "phone_plan_group_id" - self.phone_plan_id = "phone_plan_id" - self.phone_plan_id_area_codes = "phone_plan_id_area_codes" - self.area_code_for_reservation = "area_code_for_reservation" - self.reservation_id = "reservation_id" - self.reservation_id_to_purchase = "reservation_id_to_purchase" - self.reservation_id_to_cancel = "reservation_id_to_cancel" - self.phonenumber_to_configure = "phonenumber_to_configure" - self.phonenumber_to_get_config = "phonenumber_to_get_config" - self.phonenumber_to_unconfigure = "phonenumber_to_unconfigure" - self.phonenumber_for_capabilities = "phonenumber_for_capabilities" - self.phonenumber_to_release = "phonenumber_to_release" - self.capabilities_id = "capabilities_id" - self.release_id = "release_id" - - @AsyncPhoneNumberCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - async def test_list_all_phone_numbers_from_managed_identity(self): - endpoint, access_key = parse_connection_str(self.connection_str) - credential = create_token_credential() - phone_number_client = PhoneNumbersAdministrationClient(endpoint, credential) - async with phone_number_client: - pages = phone_number_client.list_all_phone_numbers() - items = [] - async for item in pages: - items.append(item) - assert len(items) > 0 - - @AsyncPhoneNumberCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - async def test_list_all_phone_numbers(self): - async with self._phone_number_administration_client: - pages = self._phone_number_administration_client.list_all_phone_numbers() - - items = [] - async for item in pages: - items.append(item) - assert len(items) > 0 - - @AsyncPhoneNumberCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - async def test_get_all_area_codes(self): - async with self._phone_number_administration_client: - area_codes = await self._phone_number_administration_client.get_all_area_codes( - location_type="NotRequired", - country_code=self.country_code, - phone_plan_id=self.phone_plan_id_area_codes - ) - assert area_codes.primary_area_codes - - @AsyncPhoneNumberCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - async def test_get_capabilities_update(self): - async with self._phone_number_administration_client: - capability_response = await self._phone_number_administration_client.get_capabilities_update( - capabilities_update_id=self.capabilities_id - ) - assert capability_response.capabilities_update_id - - @AsyncPhoneNumberCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - async def test_update_capabilities(self): - update = NumberUpdateCapabilities(add=iter(["InboundCalling"])) - - phone_number_capabilities_update = { - self.phonenumber_for_capabilities: update - } - - async with self._phone_number_administration_client: - capability_response = await self._phone_number_administration_client.update_capabilities( - phone_number_capabilities_update=phone_number_capabilities_update - ) - assert capability_response.capabilities_update_id - - @AsyncPhoneNumberCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - async def test_list_all_supported_countries(self): - async with self._phone_number_administration_client: - countries = self._phone_number_administration_client.list_all_supported_countries() - items = [] - async for item in countries: - items.append(item) - self.assertGreater(len(items), 0) - assert items[0].localized_name - - @AsyncPhoneNumberCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - async def test_get_number_configuration(self): - async with self._phone_number_administration_client: - phone_number_response = await self._phone_number_administration_client.get_number_configuration( - phone_number=self.phonenumber_to_get_config - ) - assert phone_number_response.pstn_configuration - - @AsyncPhoneNumberCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - async def test_configure_number(self): - pstnConfig = PstnConfiguration( - callback_url="https://callbackurl", - application_id="ApplicationId" - ) - async with self._phone_number_administration_client: - configure_number_response = await self._phone_number_administration_client.configure_number( - pstn_configuration=pstnConfig, - phone_number=self.phonenumber_to_configure - ) - assert not configure_number_response - - @AsyncPhoneNumberCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - async def test_list_phone_plan_groups(self): - async with self._phone_number_administration_client: - phone_plan_group_response = self._phone_number_administration_client.list_phone_plan_groups( - country_code=self.country_code - ) - - items = [] - async for item in phone_plan_group_response: - items.append(item) - assert len(items) > 0 - assert items[0].phone_plan_group_id - - @AsyncPhoneNumberCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - async def test_list_phone_plans(self): - async with self._phone_number_administration_client: - phone_plan_response = self._phone_number_administration_client.list_phone_plans( - country_code=self.country_code, - phone_plan_group_id=self.phone_plan_group_id - ) - - items = [] - async for item in phone_plan_response: - items.append(item) - assert len(items) > 0 - assert items[0].phone_plan_id - - @AsyncPhoneNumberCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - async def test_get_phone_plan_location_options(self): - async with self._phone_number_administration_client: - location_options_response = await self._phone_number_administration_client.get_phone_plan_location_options( - country_code=self.country_code, - phone_plan_group_id=self.phone_plan_group_id, - phone_plan_id=self.phone_plan_id - ) - assert location_options_response.location_options.label_id - - @AsyncPhoneNumberCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - async def test_get_release_by_id(self): - async with self._phone_number_administration_client: - phone_number_release_response = await self._phone_number_administration_client.get_release_by_id( - release_id=self.release_id - ) - assert phone_number_release_response.release_id - - @AsyncPhoneNumberCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - async def test_list_all_releases(self): - async with self._phone_number_administration_client: - releases_response = self._phone_number_administration_client.list_all_releases() - - items = [] - async for item in releases_response: - items.append(item) - self.assertGreater(len(items), 0) - assert items[0].id - - @AsyncPhoneNumberCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - async def test_release_phone_numbers(self): - async with self._phone_number_administration_client: - poller = await self._phone_number_administration_client.begin_release_phone_numbers( - phone_numbers=[self.phonenumber_to_release] - ) - result = await poller.result() - assert result - - @AsyncPhoneNumberCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - async def test_get_reservation_by_id(self): - async with self._phone_number_administration_client: - phone_number_reservation_response = await self._phone_number_administration_client.get_reservation_by_id( - reservation_id=self.reservation_id - ) - assert phone_number_reservation_response.reservation_id - - @AsyncPhoneNumberCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - async def test_reserve_phone_numbers(self): - async with self._phone_number_administration_client: - poller = await self._phone_number_administration_client.begin_reserve_phone_numbers( - area_code=self.area_code_for_reservation, - description="testreservation20200014", - display_name="testreservation20200014", - phone_plan_ids=[self.phone_plan_id], - quantity=1 - ) - result = await poller.result() - assert result - - @AsyncPhoneNumberCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - async def test_cancel_reservation(self): - async with self._phone_number_administration_client: - cancel_reservation_response = await self._phone_number_administration_client.cancel_reservation( - reservation_id=self.reservation_id_to_cancel - ) - assert not cancel_reservation_response - - @AsyncPhoneNumberCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - async def test_purchase_reservation(self): - async with self._phone_number_administration_client: - poller = await self._phone_number_administration_client.begin_purchase_reservation( - reservation_id=self.reservation_id_to_purchase - ) - result = await poller.result() - assert result - - @AsyncPhoneNumberCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - @pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON) - async def test_list_reservations(self): - async with self._phone_number_administration_client: - pages = self._phone_number_administration_client.list_all_reservations() - items = [] - async for item in pages: - items.append(item) - assert len(items) > 0 \ No newline at end of file From f781a83d343b71ed0130217b4f0901ff12dcc975 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Thu, 11 Feb 2021 11:18:59 -0600 Subject: [PATCH 02/32] Added sanitization --- ...ministration_client.test_get_phone_number.yaml | 15 +++++++-------- ...n_client.test_list_acquired_phone_numbers.yaml | 8 ++++---- ...ent.test_update_phone_number_capabilities.yaml | 10 +++++----- .../test_phone_number_administration_client.py | 8 +++++--- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml index 4dc86c3c7c68..a1e3dc9c85a6 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive Date: - - Wed, 10 Feb 2021 19:32:33 GMT + - Wed, 10 Feb 2021 20:42:54 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -18,23 +18,22 @@ interactions: uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 response: body: - string: '{"id": "16194895875", "phoneNumber": "+16194895875", "countryCode": - "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "User", "callbackUri": null, "applicationId": - null}' + string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", + "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", "sms": + "none"}, "assignmentType": "User", "callbackUri": null, "applicationId": null}' headers: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Feb 2021 19:32:33 GMT + - Wed, 10 Feb 2021 20:42:54 GMT ms-cv: - - Y6DU+yoXtk+lfRS/sfS0AA.0 + - NloH7B1nGEu+4ADVEcl9Rw.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 756ms + - 778ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml index 07086c0f987c..c8c70ee1b0d1 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive Date: - - Wed, 10 Feb 2021 19:32:35 GMT + - Wed, 10 Feb 2021 20:42:56 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -77,15 +77,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Feb 2021 19:32:35 GMT + - Wed, 10 Feb 2021 20:42:56 GMT ms-cv: - - xp5wSjznyUuxsog/ctcTNg.0 + - yNG8+L4mgES/2SWSBOrQjQ.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 1460ms + - 903ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml index a01aee2b17d0..c02c41afd7d5 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml @@ -13,13 +13,13 @@ interactions: Content-Type: - application/merge-patch+json Date: - - Tue, 09 Feb 2021 23:06:25 GMT + - Wed, 10 Feb 2021 21:40:14 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: PATCH - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895842/capabilities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875/capabilities?api-version=2021-03-07 response: body: string: '' @@ -27,13 +27,13 @@ interactions: content-length: - '0' date: - - Tue, 09 Feb 2021 23:06:25 GMT + - Wed, 10 Feb 2021 21:40:13 GMT ms-cv: - - Xo9exfZlHEeJKpYR3Wu//w.0 + - ExSKXuXJs0uLTcu8/v7hkQ.0 request-context: - appId= x-processing-time: - - 177ms + - 469ms status: code: 404 message: Not Found diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index c85491db760e..517044d0e714 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -8,7 +8,9 @@ def setUp(self): super(NewTests, self).setUp() self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ - BodyReplacerProcessor(), + BodyReplacerProcessor( + keys=["id", "token", "phoneNumber", "phonenumbers"] + ), ResponseReplacerProcessor(keys=[self._resource_name])]) def test_list_acquired_phone_numbers(self): @@ -50,7 +52,7 @@ def test_search_available_phone_numbers(self): def test_update_phone_number_capabilities(self): poller = self.phone_number_client.begin_update_phone_number_capabilities( - "+16194895842", + "+16194895875", PhoneNumberCapabilityValue.OUTBOUND, PhoneNumberCapabilityValue.OUTBOUND, polling = True @@ -74,5 +76,5 @@ def test_purchase_phone_numbers(self): phone_number_to_buy = search_poller.result() purchase_poller = self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) assert purchase_poller.result() - release_poller = self.phone_number_client.begin_release_phone_number("+") + release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) assert release_poller.status() == 'succeeded' From 0ff036ec7f1571570e22a70a6b9b2fcf3b135106 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Fri, 12 Feb 2021 12:55:21 -0600 Subject: [PATCH 03/32] Regenerated code --- .../communication/phonenumbers/__init__.py | 1 - .../operations/_phone_numbers_operations.py | 95 +++----------- .../_generated/models/__init__.py | 3 - .../phonenumbers/_generated/models/_models.py | 50 ++------ .../_generated/models/_models_py3.py | 55 ++------ .../operations/_phone_numbers_operations.py | 96 +++----------- .../phonenumbers/_generated/py.typed | 1 + .../phonenumbers/_phone_numbers_client.py | 1 + .../aio/_phone_numbers_client_async.py | 90 +++++++------ .../samples/get_phone_number_sample.py | 36 ++++++ .../list_acquired_phone_numbers_sample.py | 34 +++++ .../swagger/PHONE_NUMBER_SWAGGER.md | 2 +- .../test/_shared/asynctestcase.py | 26 ++++ ...stration_client.test_get_phone_number.yaml | 10 +- ...ient.test_list_acquired_phone_numbers.yaml | 104 +++++++-------- ...t.test_search_available_phone_numbers.yaml | 121 ------------------ ...ation_client.test_update_phone_number.yaml | 40 ------ ...test_update_phone_number_capabilities.yaml | 40 ------ ...on_client_async.test_get_phone_number.yaml | 29 +++++ ...sync.test_list_acquired_phone_numbers.yaml | 73 +++++++++++ ...lient_async.test_release_phone_number.yaml | 29 +++++ ...test_phone_number_administration_client.py | 14 +- ...hone_number_administration_client_async.py | 92 +++++++++++++ 23 files changed, 479 insertions(+), 563 deletions(-) create mode 100644 sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/py.typed create mode 100644 sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py create mode 100644 sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py create mode 100644 sdk/communication/azure-communication-phonenumbers/test/_shared/asynctestcase.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_number.yaml diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py index 51832fded5b3..3ee3773620ac 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py @@ -18,7 +18,6 @@ PhoneNumberPurchaseRequest, PhoneNumberSearchRequest, PhoneNumberSearchResult, - PhoneNumberUpdateRequest, BillingFrequency, PhoneNumberAssignmentType, PhoneNumberCapabilityValue, diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py index 82175b90addc..cb1405856cb9 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py @@ -89,6 +89,8 @@ async def _search_available_phone_numbers_initial( response_headers = {} response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) if cls: @@ -144,6 +146,8 @@ def get_long_running_output(pipeline_response): response = pipeline_response.http_response response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) if cls: @@ -273,6 +277,8 @@ async def _purchase_phone_numbers_initial( response_headers = {} response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) if cls: @@ -324,6 +330,8 @@ def get_long_running_output(pipeline_response): response = pipeline_response.http_response response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) if cls: @@ -397,10 +405,12 @@ async def get_operation( error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) raise HttpResponseError(response=response, model=error) + response_headers = {} + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) deserialized = self._deserialize('PhoneNumberOperation', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized get_operation.metadata = {'url': '/phoneNumbers/operations/{operationId}'} # type: ignore @@ -558,6 +568,8 @@ async def _release_phone_number_initial( response_headers = {} response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['release-id']=self._deserialize('str', response.headers.get('release-id')) if cls: return cls(pipeline_response, None, response_headers) @@ -625,83 +637,6 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_release_phone_number.metadata = {'url': '/phoneNumbers/{phoneNumber}'} # type: ignore - async def update( - self, - phone_number: str, - callback_uri: Optional[str] = None, - application_id: Optional[str] = None, - **kwargs - ) -> "_models.AcquiredPhoneNumber": - """Updates the configuration of a phone number. - - Updates the configuration of a phone number. - - :param phone_number: Phone number to be updated, e.g. +11234567890. - :type phone_number: str - :param callback_uri: The webhook for receiving incoming events. - e.g. "https://{{site-name}}.azurewebsites.net/api/updates". - Please read https://docs.microsoft.com/en-us/azure/communication-services/concepts/event- - handling - for integration with Azure Event Grid to deliver real-time event notifications. - :type callback_uri: str - :param application_id: The application id of the application to which to configure. - :type application_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AcquiredPhoneNumber, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.AcquiredPhoneNumber - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AcquiredPhoneNumber"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _body = _models.PhoneNumberUpdateRequest(callback_uri=callback_uri, application_id=application_id) - api_version = "2021-03-07" - content_type = kwargs.pop("content_type", "application/merge-patch+json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'phoneNumber': self._serialize.url("phone_number", phone_number, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if _body is not None: - body_content = self._serialize.body(_body, 'PhoneNumberUpdateRequest') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/phoneNumbers/{phoneNumber}'} # type: ignore - def list_phone_numbers( self, skip: Optional[int] = 0, @@ -840,6 +775,8 @@ async def _update_capabilities_initial( response_headers = {} response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) if cls: @@ -900,6 +837,8 @@ def get_long_running_output(pipeline_response): response = pipeline_response.http_response response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) if cls: diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/__init__.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/__init__.py index 2d27cfa59478..9987d1833c94 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/__init__.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/__init__.py @@ -18,7 +18,6 @@ from ._models_py3 import PhoneNumberPurchaseRequest from ._models_py3 import PhoneNumberSearchRequest from ._models_py3 import PhoneNumberSearchResult - from ._models_py3 import PhoneNumberUpdateRequest except (SyntaxError, ImportError): from ._models import AcquiredPhoneNumber # type: ignore from ._models import AcquiredPhoneNumbers # type: ignore @@ -31,7 +30,6 @@ from ._models import PhoneNumberPurchaseRequest # type: ignore from ._models import PhoneNumberSearchRequest # type: ignore from ._models import PhoneNumberSearchResult # type: ignore - from ._models import PhoneNumberUpdateRequest # type: ignore from ._phone_numbers_client_enums import ( BillingFrequency, @@ -54,7 +52,6 @@ 'PhoneNumberPurchaseRequest', 'PhoneNumberSearchRequest', 'PhoneNumberSearchResult', - 'PhoneNumberUpdateRequest', 'BillingFrequency', 'PhoneNumberAssignmentType', 'PhoneNumberCapabilityValue', diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py index 9b5ea66156e1..93bb3b456280 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py @@ -33,12 +33,6 @@ class AcquiredPhoneNumber(msrest.serialization.Model): ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param purchase_date: The date and time that the phone number was purchased. :type purchase_date: ~datetime.datetime - :param callback_uri: The webhook for receiving incoming events, e.g. https://{{site- - name}}.azurewebsites.net/api/updates. - :type callback_uri: str - :param application_id: The application id of the server application the phone number is - assigned to. The property is empty if the phone number is assigned to a person. - :type application_id: str :param cost: The incurred cost for a single phone number. :type cost: ~azure.communication.phonenumbers.models.PhoneNumberCost """ @@ -60,8 +54,6 @@ class AcquiredPhoneNumber(msrest.serialization.Model): 'capabilities': {'key': 'capabilities', 'type': 'PhoneNumberCapabilities'}, 'assignment_type': {'key': 'assignmentType', 'type': 'str'}, 'purchase_date': {'key': 'purchaseDate', 'type': 'iso-8601'}, - 'callback_uri': {'key': 'callbackUri', 'type': 'str'}, - 'application_id': {'key': 'applicationId', 'type': 'str'}, 'cost': {'key': 'cost', 'type': 'PhoneNumberCost'}, } @@ -77,8 +69,6 @@ def __init__( self.capabilities = kwargs['capabilities'] self.assignment_type = kwargs['assignment_type'] self.purchase_date = kwargs.get('purchase_date', None) - self.callback_uri = kwargs.get('callback_uri', None) - self.application_id = kwargs.get('application_id', None) self.cost = kwargs.get('cost', None) @@ -419,10 +409,11 @@ class PhoneNumberSearchResult(msrest.serialization.Model): ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param capabilities: Required. Capabilities of a phone number. :type capabilities: ~azure.communication.phonenumbers.models.PhoneNumberCapabilities - :param cost: The incurred cost for a single phone number. + :param cost: Required. The incurred cost for a single phone number. :type cost: ~azure.communication.phonenumbers.models.PhoneNumberCost - :param search_expires_by: The date that this search result expires and phone numbers are no - longer on hold. A search result expires in less than 15min, e.g. 2020-11-19T16:31:49.048Z. + :param search_expires_by: Required. The date that this search result expires and phone numbers + are no longer on hold. A search result expires in less than 15min, e.g. + 2020-11-19T16:31:49.048Z. :type search_expires_by: ~datetime.datetime """ @@ -432,6 +423,8 @@ class PhoneNumberSearchResult(msrest.serialization.Model): 'phone_number_type': {'required': True}, 'assignment_type': {'required': True}, 'capabilities': {'required': True}, + 'cost': {'required': True}, + 'search_expires_by': {'required': True}, } _attribute_map = { @@ -454,32 +447,5 @@ def __init__( self.phone_number_type = kwargs['phone_number_type'] self.assignment_type = kwargs['assignment_type'] self.capabilities = kwargs['capabilities'] - self.cost = kwargs.get('cost', None) - self.search_expires_by = kwargs.get('search_expires_by', None) - - -class PhoneNumberUpdateRequest(msrest.serialization.Model): - """Property updates for a phone number. - - :param callback_uri: The webhook for receiving incoming events. - e.g. "https://{{site-name}}.azurewebsites.net/api/updates". - Please read https://docs.microsoft.com/en-us/azure/communication-services/concepts/event- - handling - for integration with Azure Event Grid to deliver real-time event notifications. - :type callback_uri: str - :param application_id: The application id of the application to which to configure. - :type application_id: str - """ - - _attribute_map = { - 'callback_uri': {'key': 'callbackUri', 'type': 'str'}, - 'application_id': {'key': 'applicationId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PhoneNumberUpdateRequest, self).__init__(**kwargs) - self.callback_uri = kwargs.get('callback_uri', None) - self.application_id = kwargs.get('application_id', None) + self.cost = kwargs['cost'] + self.search_expires_by = kwargs['search_expires_by'] diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py index 5d7471897454..e251ee5687fe 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py @@ -38,12 +38,6 @@ class AcquiredPhoneNumber(msrest.serialization.Model): ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param purchase_date: The date and time that the phone number was purchased. :type purchase_date: ~datetime.datetime - :param callback_uri: The webhook for receiving incoming events, e.g. https://{{site- - name}}.azurewebsites.net/api/updates. - :type callback_uri: str - :param application_id: The application id of the server application the phone number is - assigned to. The property is empty if the phone number is assigned to a person. - :type application_id: str :param cost: The incurred cost for a single phone number. :type cost: ~azure.communication.phonenumbers.models.PhoneNumberCost """ @@ -65,8 +59,6 @@ class AcquiredPhoneNumber(msrest.serialization.Model): 'capabilities': {'key': 'capabilities', 'type': 'PhoneNumberCapabilities'}, 'assignment_type': {'key': 'assignmentType', 'type': 'str'}, 'purchase_date': {'key': 'purchaseDate', 'type': 'iso-8601'}, - 'callback_uri': {'key': 'callbackUri', 'type': 'str'}, - 'application_id': {'key': 'applicationId', 'type': 'str'}, 'cost': {'key': 'cost', 'type': 'PhoneNumberCost'}, } @@ -80,8 +72,6 @@ def __init__( capabilities: "PhoneNumberCapabilities", assignment_type: Union[str, "PhoneNumberAssignmentType"], purchase_date: Optional[datetime.datetime] = None, - callback_uri: Optional[str] = None, - application_id: Optional[str] = None, cost: Optional["PhoneNumberCost"] = None, **kwargs ): @@ -93,8 +83,6 @@ def __init__( self.capabilities = capabilities self.assignment_type = assignment_type self.purchase_date = purchase_date - self.callback_uri = callback_uri - self.application_id = application_id self.cost = cost @@ -468,10 +456,11 @@ class PhoneNumberSearchResult(msrest.serialization.Model): ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param capabilities: Required. Capabilities of a phone number. :type capabilities: ~azure.communication.phonenumbers.models.PhoneNumberCapabilities - :param cost: The incurred cost for a single phone number. + :param cost: Required. The incurred cost for a single phone number. :type cost: ~azure.communication.phonenumbers.models.PhoneNumberCost - :param search_expires_by: The date that this search result expires and phone numbers are no - longer on hold. A search result expires in less than 15min, e.g. 2020-11-19T16:31:49.048Z. + :param search_expires_by: Required. The date that this search result expires and phone numbers + are no longer on hold. A search result expires in less than 15min, e.g. + 2020-11-19T16:31:49.048Z. :type search_expires_by: ~datetime.datetime """ @@ -481,6 +470,8 @@ class PhoneNumberSearchResult(msrest.serialization.Model): 'phone_number_type': {'required': True}, 'assignment_type': {'required': True}, 'capabilities': {'required': True}, + 'cost': {'required': True}, + 'search_expires_by': {'required': True}, } _attribute_map = { @@ -501,8 +492,8 @@ def __init__( phone_number_type: Union[str, "PhoneNumberType"], assignment_type: Union[str, "PhoneNumberAssignmentType"], capabilities: "PhoneNumberCapabilities", - cost: Optional["PhoneNumberCost"] = None, - search_expires_by: Optional[datetime.datetime] = None, + cost: "PhoneNumberCost", + search_expires_by: datetime.datetime, **kwargs ): super(PhoneNumberSearchResult, self).__init__(**kwargs) @@ -513,33 +504,3 @@ def __init__( self.capabilities = capabilities self.cost = cost self.search_expires_by = search_expires_by - - -class PhoneNumberUpdateRequest(msrest.serialization.Model): - """Property updates for a phone number. - - :param callback_uri: The webhook for receiving incoming events. - e.g. "https://{{site-name}}.azurewebsites.net/api/updates". - Please read https://docs.microsoft.com/en-us/azure/communication-services/concepts/event- - handling - for integration with Azure Event Grid to deliver real-time event notifications. - :type callback_uri: str - :param application_id: The application id of the application to which to configure. - :type application_id: str - """ - - _attribute_map = { - 'callback_uri': {'key': 'callbackUri', 'type': 'str'}, - 'application_id': {'key': 'applicationId', 'type': 'str'}, - } - - def __init__( - self, - *, - callback_uri: Optional[str] = None, - application_id: Optional[str] = None, - **kwargs - ): - super(PhoneNumberUpdateRequest, self).__init__(**kwargs) - self.callback_uri = callback_uri - self.application_id = application_id diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py index 0d12e3a4fbbb..6c2a2c5e2663 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py @@ -94,6 +94,8 @@ def _search_available_phone_numbers_initial( response_headers = {} response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) if cls: @@ -150,6 +152,8 @@ def get_long_running_output(pipeline_response): response = pipeline_response.http_response response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) if cls: @@ -281,6 +285,8 @@ def _purchase_phone_numbers_initial( response_headers = {} response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) if cls: @@ -333,6 +339,8 @@ def get_long_running_output(pipeline_response): response = pipeline_response.http_response response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) if cls: @@ -407,10 +415,12 @@ def get_operation( error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) raise HttpResponseError(response=response, model=error) + response_headers = {} + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) deserialized = self._deserialize('PhoneNumberOperation', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized get_operation.metadata = {'url': '/phoneNumbers/operations/{operationId}'} # type: ignore @@ -571,6 +581,8 @@ def _release_phone_number_initial( response_headers = {} response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['release-id']=self._deserialize('str', response.headers.get('release-id')) if cls: return cls(pipeline_response, None, response_headers) @@ -639,84 +651,6 @@ def get_long_running_output(pipeline_response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_release_phone_number.metadata = {'url': '/phoneNumbers/{phoneNumber}'} # type: ignore - def update( - self, - phone_number, # type: str - callback_uri=None, # type: Optional[str] - application_id=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.AcquiredPhoneNumber" - """Updates the configuration of a phone number. - - Updates the configuration of a phone number. - - :param phone_number: Phone number to be updated, e.g. +11234567890. - :type phone_number: str - :param callback_uri: The webhook for receiving incoming events. - e.g. "https://{{site-name}}.azurewebsites.net/api/updates". - Please read https://docs.microsoft.com/en-us/azure/communication-services/concepts/event- - handling - for integration with Azure Event Grid to deliver real-time event notifications. - :type callback_uri: str - :param application_id: The application id of the application to which to configure. - :type application_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AcquiredPhoneNumber, or the result of cls(response) - :rtype: ~azure.communication.phonenumbers.models.AcquiredPhoneNumber - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AcquiredPhoneNumber"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - _body = _models.PhoneNumberUpdateRequest(callback_uri=callback_uri, application_id=application_id) - api_version = "2021-03-07" - content_type = kwargs.pop("content_type", "application/merge-patch+json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), - 'phoneNumber': self._serialize.url("phone_number", phone_number, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - if _body is not None: - body_content = self._serialize.body(_body, 'PhoneNumberUpdateRequest') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) - raise HttpResponseError(response=response, model=error) - - deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/phoneNumbers/{phoneNumber}'} # type: ignore - def list_phone_numbers( self, skip=0, # type: Optional[int] @@ -857,6 +791,8 @@ def _update_capabilities_initial( response_headers = {} response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) if cls: @@ -918,6 +854,8 @@ def get_long_running_output(pipeline_response): response = pipeline_response.http_response response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) if cls: diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/py.typed b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py index c3085e1b8b1e..faa5f9963a08 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py @@ -147,6 +147,7 @@ def begin_search_available_phone_numbers( **kwargs ) + @distributed_trace def begin_update_phone_number_capabilities( self, phone_number, diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py index 04eb62437ba6..0dd9c4a71347 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py @@ -1,7 +1,8 @@ from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.paging import ItemPaged from azure.core.polling import LROPoller -from .._generated._phone_numbers_client import PhoneNumbersClient as PhoneNumbersClientGen +from .._generated.aio._phone_numbers_client import PhoneNumbersClient as PhoneNumbersClientGen from .._generated.models import PhoneNumberSearchRequest from .._shared.utils import parse_connection_str, get_authentication_policy from .._version import SDK_MONIKER @@ -10,47 +11,46 @@ class PhoneNumbersClient(object): def __init__( - self, - endpoint, # type: str - credential, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - try: - if not endpoint.lower().startswith('http'): - endpoint = "https://" + endpoint - except AttributeError: - raise ValueError("Account URL must be a string.") - - if not credential: - raise ValueError( - "You need to provide account shared key to authenticate.") - - self._endpoint = endpoint - self._phone_number_client = PhoneNumbersClientGen( - self._endpoint, - authentication_policy=get_authentication_policy(endpoint, credential), - sdk_moniker=SDK_MONIKER, - **kwargs) - + self, + endpoint, # type: str + credential, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + try: + if not endpoint.lower().startswith('http'): + endpoint = "https://" + endpoint + except AttributeError: + raise ValueError("Account URL must be a string.") + + if not credential: + raise ValueError( + "You need to provide account shared key to authenticate.") + + self._endpoint = endpoint + self._phone_number_client = PhoneNumbersClientGen( + self._endpoint, + authentication_policy=get_authentication_policy(endpoint, credential, is_async=True), + sdk_moniker=SDK_MONIKER, + **kwargs) + @classmethod def from_connection_string( cls, conn_str, # type: str **kwargs # type: Any - ): - # type: (...) -> PhoneNumbersClient - """Create PhoneNumbersClient from a Connection String. + ): # type: (...) -> PhoneNumbersAdministrationClient + """Create PhoneNumbersAdministrationClient from a Connection String. :param str conn_str: A connection string to an Azure Communication Service resource. - :returns: Instance of PhoneNumbersClient. - :rtype: ~azure.communication.PhoneNumbersClient + :returns: Instance of PhoneNumbersAdministrationClient. + :rtype: ~azure.communication.PhoneNumbersAdministrationClient """ endpoint, access_key = parse_connection_str(conn_str) return cls(endpoint, access_key, **kwargs) - @distributed_trace + @distributed_trace_async async def begin_purchase_phone_numbers( self, search_id, @@ -73,7 +73,7 @@ async def begin_purchase_phone_numbers( **kwargs ) - @distributed_trace + @distributed_trace_async async def begin_release_phone_number( self, phone_number, @@ -97,7 +97,7 @@ async def begin_release_phone_number( **kwargs ) - @distributed_trace + @distributed_trace_async async def begin_search_available_phone_numbers( self, country_code, @@ -146,7 +146,8 @@ async def begin_search_available_phone_numbers( search_request, **kwargs ) - + + @distributed_trace_async async def begin_update_phone_number_capabilities( self, phone_number, @@ -179,7 +180,7 @@ async def begin_update_phone_number_capabilities( **kwargs ) - @distributed_trace + @distributed_trace_async async def get_phone_number( self, phone_number, @@ -200,7 +201,7 @@ async def get_phone_number( ) @distributed_trace - async def list_acquired_phone_numbers( + def list_acquired_phone_numbers( self, **kwargs ): @@ -215,11 +216,11 @@ async def list_acquired_phone_numbers( :type top: int :rtype: ~azure.core.paging.AsyncItemPaged[~azure.communication.phonenumbers.models.AcquiredPhoneNumbers] """ - return await self._phone_number_client.phone_numbers.list_phone_numbers( + return self._phone_number_client.phone_numbers.list_phone_numbers( **kwargs ) - @distributed_trace + @distributed_trace_async async def update_phone_number( self, phone_number, @@ -247,4 +248,17 @@ async def update_phone_number( callback_uri, application_id, **kwargs - ) \ No newline at end of file + ) + + async def __aenter__(self) -> "PhoneNumbersClient": + await self._phone_number_client.__aenter__() + return self + + async def __aexit__(self, *args: "Any") -> None: + await self.close() + + async def close(self) -> None: + """Close the :class: + `~azure.communication.phonenumbers.aio.PhoneNumbersClient` session. + """ + await self._phone_number_client.__aexit__() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py new file mode 100644 index 000000000000..c465fd27e120 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- + +""" +FILE: phone_number_area_codes_sample.py +DESCRIPTION: + This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. +USAGE: + python list_acquired_phone_numbers_sample.py + Set the environment variables with your own values before running the sample: + 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service + 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER - The phone number you want to get its information +""" + +import os +from azure.communication.phonenumbers import ( + PhoneNumbersClient +) + +connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') +phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") +phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) + +def get_phone_number_information(): + phone_number_information = phone_numbers_client.get_phone_number(phone_number) + print('Phone number information:') + print(phone_number_information) + + +if __name__ == '__main__': + get_phone_number_information() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py new file mode 100644 index 000000000000..700ed9cfafa3 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- + +""" +FILE: phone_number_area_codes_sample.py +DESCRIPTION: + This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. +USAGE: + python list_acquired_phone_numbers_sample.py + Set the environment variables with your own values before running the sample: + 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service +""" + +import os +from azure.communication.phonenumbers import ( + PhoneNumbersClient +) + +connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') +phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) + +def list_acquired_phone_numbers(): + acquired_phone_numbers = phone_numbers_client.list_acquired_phone_numbers() + print('Acquired phone numbers:') + print(acquired_phone_numbers) + + +if __name__ == '__main__': + list_acquired_phone_numbers() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md b/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md index 271a47186c1c..65333287c86a 100644 --- a/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md +++ b/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md @@ -10,7 +10,7 @@ autorest ./PHONE_NUMBER_SWAGGER.md ### Settings ``` yaml -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/f20d92b324842b407e0dcce36ad0e67bd9bb66cf/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/e23190a5bc64cd8526d08b6c2c1d616939bc88b3/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json output-folder: ../azure/communication/phonenumbers/_generated namespace: azure.communication.phonenumbers license-header: MICROSOFT_MIT_NO_VERSION diff --git a/sdk/communication/azure-communication-phonenumbers/test/_shared/asynctestcase.py b/sdk/communication/azure-communication-phonenumbers/test/_shared/asynctestcase.py new file mode 100644 index 000000000000..4c331bb79598 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/_shared/asynctestcase.py @@ -0,0 +1,26 @@ +# coding: utf-8 +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +import functools +import asyncio +from azure_devtools.scenario_tests.utilities import trim_kwargs_from_test_function +from .testcase import CommunicationTestCase + +class AsyncCommunicationTestCase(CommunicationTestCase): + + @staticmethod + def await_prepared_test(test_fn): + """Synchronous wrapper for async test methods. Used to avoid making changes + upstream to AbstractPreparer (which doesn't await the functions it wraps) + """ + + @functools.wraps(test_fn) + def run(test_class_instance, *args, **kwargs): + trim_kwargs_from_test_function(test_fn, kwargs) + loop = asyncio.get_event_loop() + return loop.run_until_complete(test_fn(test_class_instance, **kwargs)) + + return run \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml index a1e3dc9c85a6..fae0fd63698d 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive Date: - - Wed, 10 Feb 2021 20:42:54 GMT + - Thu, 11 Feb 2021 23:15:38 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -20,20 +20,20 @@ interactions: body: string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", "sms": - "none"}, "assignmentType": "User", "callbackUri": null, "applicationId": null}' + "none"}, "assignmentType": "User"}' headers: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Feb 2021 20:42:54 GMT + - Thu, 11 Feb 2021 23:15:39 GMT ms-cv: - - NloH7B1nGEu+4ADVEcl9Rw.0 + - 0Fa+iu/NaEivjqj8QV7AwQ.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 778ms + - 828ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml index c8c70ee1b0d1..e8c067a1c78c 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive Date: - - Wed, 10 Feb 2021 20:42:56 GMT + - Thu, 11 Feb 2021 23:15:40 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -20,72 +20,62 @@ interactions: body: string: '{"phoneNumbers": [{"id": "16194895875", "phoneNumber": "+16194895875", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, - "applicationId": null}, {"id": "16194895877", "phoneNumber": "+16194895877", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, - "applicationId": null}, {"id": "16194895878", "phoneNumber": "+16194895878", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, - "applicationId": null}, {"id": "16194895879", "phoneNumber": "+16194895879", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, - "applicationId": null}, {"id": "16194895880", "phoneNumber": "+16194895880", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, - "applicationId": null}, {"id": "16194895882", "phoneNumber": "+16194895882", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, - "applicationId": null}, {"id": "16194895885", "phoneNumber": "+16194895885", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, - "applicationId": null}, {"id": "16194895887", "phoneNumber": "+16194895887", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, - "applicationId": null}, {"id": "16194895889", "phoneNumber": "+16194895889", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, - "applicationId": null}, {"id": "18332271680", "phoneNumber": "+18332271680", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "none", "sms": "outbound"}, "assignmentType": "Application", "callbackUri": - null, "applicationId": null}, {"id": "18332272412", "phoneNumber": "+18332272412", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": - null, "applicationId": null}, {"id": "18332272430", "phoneNumber": "+18332272430", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": - null, "applicationId": null}, {"id": "18332272445", "phoneNumber": "+18332272445", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": - null, "applicationId": null}, {"id": "18332321209", "phoneNumber": "+18332321209", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "none", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": - null, "applicationId": null}, {"id": "18332321221", "phoneNumber": "+18332321221", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "none", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": - null, "applicationId": null}, {"id": "18332321226", "phoneNumber": "+18332321226", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "none", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": - null, "applicationId": null}, {"id": "18335260208", "phoneNumber": "+18335260208", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": - null, "applicationId": null}, {"id": "18336369501", "phoneNumber": "+18336369501", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "inbound+outbound", "sms": "none"}, "assignmentType": "Application", "callbackUri": - null, "applicationId": null}]}' + "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": "16194895877", + "phoneNumber": "+16194895877", "countryCode": "US", "phoneNumberType": "Geographic", + "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": + "User"}, {"id": "16194895878", "phoneNumber": "+16194895878", "countryCode": + "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", + "sms": "none"}, "assignmentType": "User"}, {"id": "16194895879", "phoneNumber": + "+16194895879", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": + {"calling": "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": + "16194895880", "phoneNumber": "+16194895880", "countryCode": "US", "phoneNumberType": + "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": + "User"}, {"id": "16194895882", "phoneNumber": "+16194895882", "countryCode": + "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", + "sms": "none"}, "assignmentType": "User"}, {"id": "16194895885", "phoneNumber": + "+16194895885", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": + {"calling": "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": + "16194895887", "phoneNumber": "+16194895887", "countryCode": "US", "phoneNumberType": + "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": + "User"}, {"id": "16194895889", "phoneNumber": "+16194895889", "countryCode": + "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", + "sms": "none"}, "assignmentType": "User"}, {"id": "18332271680", "phoneNumber": + "+18332271680", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": + {"calling": "none", "sms": "outbound"}, "assignmentType": "Application"}, + {"id": "18332272412", "phoneNumber": "+18332272412", "countryCode": "US", + "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": + "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332272430", + "phoneNumber": "+18332272430", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": + "Application"}, {"id": "18332272445", "phoneNumber": "+18332272445", "countryCode": + "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", + "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332321209", + "phoneNumber": "+18332321209", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "none", "sms": "inbound+outbound"}, "assignmentType": + "Application"}, {"id": "18332321221", "phoneNumber": "+18332321221", "countryCode": + "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "none", "sms": + "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332321226", + "phoneNumber": "+18332321226", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "none", "sms": "inbound+outbound"}, "assignmentType": + "Application"}, {"id": "18335260208", "phoneNumber": "+18335260208", "countryCode": + "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", + "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18336369501", + "phoneNumber": "+18336369501", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "inbound+outbound", "sms": "none"}, "assignmentType": + "Application"}]}' headers: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Feb 2021 20:42:56 GMT + - Thu, 11 Feb 2021 23:15:40 GMT ms-cv: - - yNG8+L4mgES/2SWSBOrQjQ.0 + - 0k/4PQ1Ca0WmrSBuPE9Svg.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 903ms + - 815ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml deleted file mode 100644 index 803d7b8d6315..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml +++ /dev/null @@ -1,121 +0,0 @@ -interactions: -- request: - body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": - {"calling": "inbound", "sms": "inbound+outbound"}, "areaCode": "833", "quantity": - 1}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '165' - Content-Type: - - application/json - Date: - - Tue, 09 Feb 2021 21:34:00 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Tue, 09 Feb 2021 21:34:01 GMT - ms-cv: - - MUBwFiR9OUuS3RxM/xaO4g.0 - operation-location: - - /phoneNumbers/operations/search_0789a1f2-43ac-4d59-a6e0-14676d6272c1?api-version=2021-03-07 - request-context: - - appId= - x-processing-time: - - 1393ms - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Tue, 09 Feb 2021 21:34:31 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_0789a1f2-43ac-4d59-a6e0-14676d6272c1?api-version=2021-03-07 - response: - body: - string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": - "2021-02-09T21:34:00.9651939+00:00", "id": "search_0789a1f2-43ac-4d59-a6e0-14676d6272c1", - "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Tue, 09 Feb 2021 21:34:31 GMT - ms-cv: - - muk7q9bGH0mzZX+8LQ+89g.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 609ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Tue, 09 Feb 2021 21:34:32 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/0789a1f2-43ac-4d59-a6e0-14676d6272c1?api-version=2021-03-07 - response: - body: - string: '{"searchId": "0789a1f2-43ac-4d59-a6e0-14676d6272c1", "phoneNumbers": - ["+18332271691"], "phoneNumberType": "TollFree", "assignmentType": "Application", - "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": - null, "searchExpiresBy": "2021-02-09T21:50:07.3556271+00:00"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Tue, 09 Feb 2021 21:34:32 GMT - ms-cv: - - TTqVpiD+IkO2IxCSRtVS8Q.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 542ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number.yaml deleted file mode 100644 index 1e21a73687b1..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number.yaml +++ /dev/null @@ -1,40 +0,0 @@ -interactions: -- request: - body: '{"callbackUri": "", "applicationId": ""}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '40' - Content-Type: - - application/merge-patch+json - Date: - - Wed, 10 Feb 2021 15:47:47 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: PATCH - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895842?api-version=2021-03-07 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Wed, 10 Feb 2021 15:47:48 GMT - ms-cv: - - ci1ZpvX4cUSbfe/jkmyjZw.0 - request-context: - - appId= - x-processing-time: - - 772ms - status: - code: 404 - message: Not Found -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml deleted file mode 100644 index c02c41afd7d5..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml +++ /dev/null @@ -1,40 +0,0 @@ -interactions: -- request: - body: '{"calling": "outbound", "sms": "outbound"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '42' - Content-Type: - - application/merge-patch+json - Date: - - Wed, 10 Feb 2021 21:40:14 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: PATCH - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875/capabilities?api-version=2021-03-07 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Wed, 10 Feb 2021 21:40:13 GMT - ms-cv: - - ExSKXuXJs0uLTcu8/v7hkQ.0 - request-context: - - appId= - x-processing-time: - - 469ms - status: - code: 404 - message: Not Found -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml new file mode 100644 index 000000000000..e8d27b2ac8a8 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml @@ -0,0 +1,29 @@ +interactions: +- request: + body: '' + headers: + Accept: + - application/json + Date: + - Thu, 11 Feb 2021 20:34:10 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 + response: + body: + string: '{"error": {"code": "Denied", "message": "Denied by the resource provider."}}' + headers: + content-type: application/json + date: Thu, 11 Feb 2021 20:34:11 GMT + ms-cv: 1vN1Av5Jp02JawMoV/kpYQ.0 + request-context: appId= + transfer-encoding: chunked + x-processing-time: 169ms + status: + code: 401 + message: Unauthorized + url: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml new file mode 100644 index 000000000000..c5d5612585d1 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml @@ -0,0 +1,73 @@ +interactions: +- request: + body: '' + headers: + Accept: + - application/json + Date: + - Thu, 11 Feb 2021 20:20:13 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 + response: + body: + string: '{"phoneNumbers": [{"id": "16194895875", "phoneNumber": "+16194895875", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": "16194895877", + "phoneNumber": "+16194895877", "countryCode": "US", "phoneNumberType": "Geographic", + "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": + "User"}, {"id": "16194895878", "phoneNumber": "+16194895878", "countryCode": + "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", + "sms": "none"}, "assignmentType": "User"}, {"id": "16194895879", "phoneNumber": + "+16194895879", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": + {"calling": "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": + "16194895880", "phoneNumber": "+16194895880", "countryCode": "US", "phoneNumberType": + "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": + "User"}, {"id": "16194895882", "phoneNumber": "+16194895882", "countryCode": + "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", + "sms": "none"}, "assignmentType": "User"}, {"id": "16194895885", "phoneNumber": + "+16194895885", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": + {"calling": "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": + "16194895887", "phoneNumber": "+16194895887", "countryCode": "US", "phoneNumberType": + "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": + "User"}, {"id": "16194895889", "phoneNumber": "+16194895889", "countryCode": + "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", + "sms": "none"}, "assignmentType": "User"}, {"id": "18332271680", "phoneNumber": + "+18332271680", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": + {"calling": "none", "sms": "outbound"}, "assignmentType": "Application"}, + {"id": "18332272412", "phoneNumber": "+18332272412", "countryCode": "US", + "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": + "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332272430", + "phoneNumber": "+18332272430", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": + "Application"}, {"id": "18332272445", "phoneNumber": "+18332272445", "countryCode": + "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", + "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332321209", + "phoneNumber": "+18332321209", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "none", "sms": "inbound+outbound"}, "assignmentType": + "Application"}, {"id": "18332321221", "phoneNumber": "+18332321221", "countryCode": + "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "none", "sms": + "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332321226", + "phoneNumber": "+18332321226", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "none", "sms": "inbound+outbound"}, "assignmentType": + "Application"}, {"id": "18335260208", "phoneNumber": "+18335260208", "countryCode": + "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", + "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18336369501", + "phoneNumber": "+18336369501", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "inbound+outbound", "sms": "none"}, "assignmentType": + "Application"}]}' + headers: + content-type: application/json; charset=utf-8 + date: Thu, 11 Feb 2021 20:20:15 GMT + ms-cv: /PDnQzArpkm1GBLVqCNyKg.0 + request-context: appId= + transfer-encoding: chunked + x-processing-time: 2257ms + status: + code: 200 + message: OK + url: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_number.yaml new file mode 100644 index 000000000000..2ebeaaaf4371 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_number.yaml @@ -0,0 +1,29 @@ +interactions: +- request: + body: '' + headers: + Accept: + - application/json + Date: + - Thu, 11 Feb 2021 19:16:56 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 + response: + body: + string: '{"error": {"code": "Denied", "message": "Denied by the resource provider."}}' + headers: + content-type: application/json + date: Thu, 11 Feb 2021 19:16:58 GMT + ms-cv: GAxbDJ8Kuk6pDjdEn5+mxA.0 + request-context: appId= + transfer-encoding: chunked + x-processing-time: 158ms + status: + code: 401 + message: Unauthorized + url: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index 517044d0e714..d10cc2d77654 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -20,19 +20,10 @@ def test_list_acquired_phone_numbers(self): def test_get_phone_number(self): phone_number = self.phone_number_client.get_phone_number("+16194895875") assert phone_number.phone_number == "+16194895875" - - def test_update_phone_number(self): - updated_phone_number = self.phone_number_client.update_phone_number( - "+16194895842", - "", - "" - ) - assert updated_phone_number.application_id == "" def test_release_phone_number(self): poller = self.phone_number_client.begin_release_phone_number("+16194895886") assert poller.status() == 'succeeded' - def test_search_available_phone_numbers(self): capabilities = PhoneNumberCapabilities( @@ -49,7 +40,7 @@ def test_search_available_phone_numbers(self): polling = True ) assert poller.result() - + def test_update_phone_number_capabilities(self): poller = self.phone_number_client.begin_update_phone_number_capabilities( "+16194895875", @@ -59,6 +50,7 @@ def test_update_phone_number_capabilities(self): ) assert poller.result() + def test_purchase_phone_numbers(self): capabilities = PhoneNumberCapabilities( calling = PhoneNumberCapabilityValue.INBOUND, @@ -77,4 +69,4 @@ def test_purchase_phone_numbers(self): purchase_poller = self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) assert purchase_poller.result() release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) - assert release_poller.status() == 'succeeded' + assert release_poller.status() == 'succeeded' \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index e69de29bb2d1..87c0c7d5784b 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -0,0 +1,92 @@ +import pytest +from azure.communication.phonenumbers.aio import PhoneNumbersClient +from _shared.asynctestcase import AsyncCommunicationTestCase +from _shared.testcase import ResponseReplacerProcessor, BodyReplacerProcessor +from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType + +class NewTests(AsyncCommunicationTestCase): + def setUp(self): + super(NewTests, self).setUp() + self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) + self.recording_processors.extend([ + BodyReplacerProcessor( + keys=["id", "token", "phoneNumber", "phonenumbers"] + ), + ResponseReplacerProcessor(keys=[self._resource_name])]) + + @AsyncCommunicationTestCase.await_prepared_test + async def test_list_acquired_phone_numbers(self): + async with self.phone_number_client: + phone_numbers = self.phone_number_client.list_acquired_phone_numbers() + items = [] + async for item in phone_numbers: + items.append(item) + assert len(items) > 0 + + @AsyncCommunicationTestCase.await_prepared_test + async def test_get_phone_number(self): + async with self.phone_number_client: + phone_number = await self.phone_number_client.get_phone_number("+16194895875") + assert phone_number.phone_number == "+16194895875" + + ''' + def test_update_phone_number(self): + updated_phone_number = self.phone_number_client.update_phone_number( + "+16194895842", + "", + "" + ) + assert updated_phone_number.application_id == "" + + @AsyncCommunicationTestCase.await_prepared_test + async def test_release_phone_number(self): + async with self.phone_number_client: + poller = await self.phone_number_client.begin_release_phone_number("+16194895875") + result = await poller.result() + assert result + + def test_search_available_phone_numbers(self): + capabilities = PhoneNumberCapabilities( + calling = PhoneNumberCapabilityValue.INBOUND, + sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + ) + poller = self.phone_number_client.begin_search_available_phone_numbers( + "US", + PhoneNumberType.TOLL_FREE, + PhoneNumberAssignmentType.APPLICATION, + capabilities, + "833", + 1, + polling = True + ) + assert poller.result() + + def test_update_phone_number_capabilities(self): + poller = self.phone_number_client.begin_update_phone_number_capabilities( + "+16194895875", + PhoneNumberCapabilityValue.OUTBOUND, + PhoneNumberCapabilityValue.OUTBOUND, + polling = True + ) + assert poller.result() + + def test_purchase_phone_numbers(self): + capabilities = PhoneNumberCapabilities( + calling = PhoneNumberCapabilityValue.INBOUND, + sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + ) + search_poller = self.phone_number_client.begin_search_available_phone_numbers( + "US", + PhoneNumberType.TOLL_FREE, + PhoneNumberAssignmentType.APPLICATION, + capabilities, + "833", + 1, + polling = True + ) + phone_number_to_buy = search_poller.result() + purchase_poller = self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) + assert purchase_poller.result() + release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) + assert release_poller.status() == 'succeeded' + ''' \ No newline at end of file From d4f316d373a49b3d3554caf4d3208a2d396e8bfd Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Mon, 15 Feb 2021 13:21:49 -0600 Subject: [PATCH 04/32] Added README and samples --- .../README.md | 149 +++++++++++ .../operations/_phone_numbers_operations.py | 19 +- .../phonenumbers/_generated/models/_models.py | 7 +- .../_generated/models/_models_py3.py | 7 +- .../models/_phone_numbers_client_enums.py | 2 +- .../operations/_phone_numbers_operations.py | 19 +- .../samples/get_phone_number_sample.py | 4 +- .../samples/purchase_phone_number_sample.py | 36 +++ .../samples/release_phone_number_sample.py | 37 +++ .../search_available_phone_numbers_sample.py | 52 ++++ .../swagger/PHONE_NUMBER_SWAGGER.md | 22 +- ...stration_client.test_get_phone_number.yaml | 16 +- ...ient.test_list_acquired_phone_numbers.yaml | 82 ------ ...on_client.test_purchase_phone_numbers.yaml | 247 +----------------- ...t.test_search_available_phone_numbers.yaml | 44 ++++ ...test_update_phone_number_capabilities.yaml | 40 +++ ...test_phone_number_administration_client.py | 31 ++- 17 files changed, 422 insertions(+), 392 deletions(-) create mode 100644 sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py create mode 100644 sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py create mode 100644 sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml diff --git a/sdk/communication/azure-communication-phonenumbers/README.md b/sdk/communication/azure-communication-phonenumbers/README.md index e69de29bb2d1..502325d0d4b3 100644 --- a/sdk/communication/azure-communication-phonenumbers/README.md +++ b/sdk/communication/azure-communication-phonenumbers/README.md @@ -0,0 +1,149 @@ +[![Build Status](https://dev.azure.com/azure-sdk/public/_apis/build/status/azure-sdk-for-python.client?branchName=master)](https://dev.azure.com/azure-sdk/public/_build/latest?definitionId=46?branchName=master) + +# Azure Communication Phone Numbers Package client library for Python + +Azure Communication Phone Numbers client package is used to administer Phone Numbers. + +# Getting started +### Prerequisites +- Python 2.7, or 3.5 or later is required to use this package. +- You must have an [Azure subscription](https://azure.microsoft.com/free/) +- A deployed Communication Services resource. You can use the [Azure Portal](https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp) or the [Azure PowerShell](https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice) to set it up. +### Install the package +Install the Azure Communication Phone Numbers client library for Python with [pip](https://pypi.org/project/pip/): + +```bash +pip install azure-communication-phonenumbers +``` + +## Key concepts + +### Initializing Phone Numbers Client +```python +# You can find your connection string from your resource in the Azure Portal +import os +from azure.communication.phonenumbers import PhoneNumbersClient +from azure.identity import DefaultAzureCredential + +endpoint = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') + +# To use Azure Active Directory Authentication (DefaultAzureCredential) make sure to have your +# AZURE_TENANT_ID, AZURE_CLIENT_ID and AZURE_CLIENT_SECRET as env variables. +phone_number_administration_client = PhoneNumbersAdministrationClient(endpoint, DefaultAzureCredential()) + +``` +### Initializing the Client Using Your Connection String +Connection string authentication is also available for Phone Numbers Client. + +```python +# You can find your connection string from your resource in the Azure Portal +import os +from azure.communication.phonenumbers import PhoneNumbersClient + +connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') +phone_number_administration_client = PhoneNumbersAdministrationClient.from_connection_string(connection_str) +``` + +### Phone Number Types overview + +Phone numbers come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888. + +### Searching and Purchasing and Releasing numbers + +Phone numbers can be searched through the search creation API by providing an area code, quantity of phone numbers, application type, phone number type, and capabilities. The provided quantity of phone numbers will be reserved for ten minutes and can be purchased within this time. If the search is not purchased, the phone numbers will become available to others after ten minutes. If the search is purchased, then the phone numbers are acquired for the Azure resources. + +Phone numbers can also be released using the release API. + +## Examples + +### Get All Phone Numbers + +Lists all of your acquired phone numbers + +```python +acquired_phone_numbers = phone_numbers_client.list_acquired_phone_numbers() +acquired_phone_number = acquired_phone_numbers.next() +print(acquired_phone_number.phone_number) +``` + +### Get Phone Number + +Gets the information from the specified phone number + +```python +result = phone_numbers_client.get_phone_number("+18001234567") +print(result.country_code) +print(result.phone_number) +``` + +## Long Running Operations + +The Phone Number Client supports a variety of long running operations that allow indefinite polling time to the functions listed down below. + +### Search for Available Phone Number + +You can search for available phone numbers by providing the capabilities of the phone you want to acquire, the phone number type, the assignment type, and the country code. It's worth mentioning that for the toll-free phone number type, proving the area code is optional. +The result of the search can then be used to purchase the number in the corresponding API. + +```python +capabilities = PhoneNumberCapabilities( + calling = PhoneNumberCapabilityValue.INBOUND, + sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + ) +poller = phone_numbers_client.begin_search_available_phone_numbers( + "US", + PhoneNumberType.TOLL_FREE, + PhoneNumberAssignmentType.APPLICATION, + capabilities, + "833", # Area code is optional for toll-free numbers + 1, # Quantity is optional, default is 1 + polling = True +) +search_result = poller.result() +``` + +### Purchase Phone Numbers + +The result of your search can be used to purchase the specificied phone numbers. This can be done by passing the `search_id` from the search response to the purchase phone number API. + +```python +purchase_poller = phone_numbers_client.begin_purchase_phone_numbers( + search_result.search_id, + polling=True +) +``` + +### Release Phone Number + +Releases an acquired phone number. + +```python +poller = self.phone_number_client.begin_release_phone_number( + "+18001234567", + polling = True +) +``` +# Troubleshooting +The Phone Numbers Administration client will raise exceptions defined in [Azure Core][azure_core]. + +# Next steps +## More sample code + +Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/communication/azure-communication-phonenumbers/samples) directory for detailed examples of how to use this library. + +## Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project + +# Contributing +This project welcomes contributions and suggestions. Most contributions require you to agree to a +Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the +PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + + +[azure_core]: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/README.md diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py index cb1405856cb9..beda99f1524d 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py @@ -87,8 +87,8 @@ async def _search_available_phone_numbers_initial( raise HttpResponseError(response=response, model=error) response_headers = {} - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -144,8 +144,8 @@ async def begin_search_available_phone_numbers( def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -275,8 +275,8 @@ async def _purchase_phone_numbers_initial( raise HttpResponseError(response=response, model=error) response_headers = {} - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -328,8 +328,8 @@ async def begin_purchase_phone_numbers( def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -459,7 +459,7 @@ async def cancel_operation( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) raise HttpResponseError(response=response, model=error) @@ -560,14 +560,13 @@ async def _release_phone_number_initial( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [204]: + if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) raise HttpResponseError(response=response, model=error) response_headers = {} response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['release-id']=self._deserialize('str', response.headers.get('release-id')) @@ -767,14 +766,14 @@ async def _update_capabilities_initial( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) raise HttpResponseError(response=response, model=error) response_headers = {} - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) @@ -835,8 +834,8 @@ async def begin_update_capabilities( def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py index 93bb3b456280..53369550c4ea 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py @@ -28,7 +28,8 @@ class AcquiredPhoneNumber(msrest.serialization.Model): :param capabilities: Required. Capabilities of a phone number. :type capabilities: ~azure.communication.phonenumbers.models.PhoneNumberCapabilities :param assignment_type: Required. The assignment type of the phone number. A phone number can - be assigned to a person, or to an application. Possible values include: "user", "application". + be assigned to a person, or to an application. Possible values include: "person", + "application". :type assignment_type: str or ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param purchase_date: The date and time that the phone number was purchased. @@ -352,7 +353,7 @@ class PhoneNumberSearchRequest(msrest.serialization.Model): :type phone_number_type: str or ~azure.communication.phonenumbers.models.PhoneNumberType :param assignment_type: Required. The assignment type of the phone numbers to search for. A phone number can be assigned to a person, or to an application. Possible values include: - "user", "application". + "person", "application". :type assignment_type: str or ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param capabilities: Required. Capabilities of a phone number. @@ -404,7 +405,7 @@ class PhoneNumberSearchResult(msrest.serialization.Model): Possible values include: "geographic", "tollFree". :type phone_number_type: str or ~azure.communication.phonenumbers.models.PhoneNumberType :param assignment_type: Required. Phone number's assignment type. Possible values include: - "user", "application". + "person", "application". :type assignment_type: str or ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param capabilities: Required. Capabilities of a phone number. diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py index e251ee5687fe..3e9b269dce59 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py @@ -33,7 +33,8 @@ class AcquiredPhoneNumber(msrest.serialization.Model): :param capabilities: Required. Capabilities of a phone number. :type capabilities: ~azure.communication.phonenumbers.models.PhoneNumberCapabilities :param assignment_type: Required. The assignment type of the phone number. A phone number can - be assigned to a person, or to an application. Possible values include: "user", "application". + be assigned to a person, or to an application. Possible values include: "person", + "application". :type assignment_type: str or ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param purchase_date: The date and time that the phone number was purchased. @@ -393,7 +394,7 @@ class PhoneNumberSearchRequest(msrest.serialization.Model): :type phone_number_type: str or ~azure.communication.phonenumbers.models.PhoneNumberType :param assignment_type: Required. The assignment type of the phone numbers to search for. A phone number can be assigned to a person, or to an application. Possible values include: - "user", "application". + "person", "application". :type assignment_type: str or ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param capabilities: Required. Capabilities of a phone number. @@ -451,7 +452,7 @@ class PhoneNumberSearchResult(msrest.serialization.Model): Possible values include: "geographic", "tollFree". :type phone_number_type: str or ~azure.communication.phonenumbers.models.PhoneNumberType :param assignment_type: Required. Phone number's assignment type. Possible values include: - "user", "application". + "person", "application". :type assignment_type: str or ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param capabilities: Required. Capabilities of a phone number. diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_phone_numbers_client_enums.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_phone_numbers_client_enums.py index f80e09733e3d..3b41401e911c 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_phone_numbers_client_enums.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_phone_numbers_client_enums.py @@ -37,7 +37,7 @@ class PhoneNumberAssignmentType(with_metaclass(_CaseInsensitiveEnumMeta, str, En person, or to an application. """ - USER = "user" + PERSON = "person" APPLICATION = "application" class PhoneNumberCapabilityValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py index 6c2a2c5e2663..e7fc51ae0c84 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py @@ -92,8 +92,8 @@ def _search_available_phone_numbers_initial( raise HttpResponseError(response=response, model=error) response_headers = {} - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -150,8 +150,8 @@ def begin_search_available_phone_numbers( def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -283,8 +283,8 @@ def _purchase_phone_numbers_initial( raise HttpResponseError(response=response, model=error) response_headers = {} - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -337,8 +337,8 @@ def begin_purchase_phone_numbers( def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -470,7 +470,7 @@ def cancel_operation( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) raise HttpResponseError(response=response, model=error) @@ -573,14 +573,13 @@ def _release_phone_number_initial( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [204]: + if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) raise HttpResponseError(response=response, model=error) response_headers = {} response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['release-id']=self._deserialize('str', response.headers.get('release-id')) @@ -783,14 +782,14 @@ def _update_capabilities_initial( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.CommunicationErrorResponse, response) raise HttpResponseError(response=response, model=error) response_headers = {} - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) @@ -852,8 +851,8 @@ def begin_update_capabilities( def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) diff --git a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py index c465fd27e120..f7dc56a4f6d1 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py @@ -14,7 +14,7 @@ python list_acquired_phone_numbers_sample.py Set the environment variables with your own values before running the sample: 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service - 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER - The phone number you want to get its information + 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_INFORMATION - The phone number you want to get its information """ import os @@ -23,7 +23,7 @@ ) connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") +phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_INFORMATION") phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) def get_phone_number_information(): diff --git a/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py new file mode 100644 index 000000000000..8d9493e5ae9f --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- + +""" +FILE: phone_number_area_codes_sample.py +DESCRIPTION: + This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. +USAGE: + python list_acquired_phone_numbers_sample.py + Set the environment variables with your own values before running the sample: + 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service + 2) AZURE_COMMUNICATION_SERVICE_SEARCH_ID_TO_PURCHASE - The search id for the phone number you reserved and want to purchase +""" + +import os +from azure.communication.phonenumbers import ( + PhoneNumbersClient +) + +connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') +phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_INFORMATION") +phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) + +def get_phone_number_information(): + phone_number_information = phone_numbers_client.get_phone_number(phone_number) + print('Phone number information:') + print(phone_number_information) + + +if __name__ == '__main__': + get_phone_number_information() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py new file mode 100644 index 000000000000..514b1480be67 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- + +""" +FILE: phone_number_area_codes_sample.py +DESCRIPTION: + This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. +USAGE: + python list_acquired_phone_numbers_sample.py + Set the environment variables with your own values before running the sample: + 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service + 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_RELEASE - The phone number you want to release +""" + +import os +from azure.communication.phonenumbers import ( + PhoneNumbersClient +) + +connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') +phone_number_to_release = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_RELEASE") +phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) + +def release_phone_number(): + poller = phone_numbers_client.begin_release_phone_number(phone_number_to_release) + poller.result() + print('Status of the operation:') + print(poller.status()) + + +if __name__ == '__main__': + release_phone_number() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py new file mode 100644 index 000000000000..cf4a580cb1c3 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- + +""" +FILE: phone_number_area_codes_sample.py +DESCRIPTION: + This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. +USAGE: + python list_acquired_phone_numbers_sample.py + Set the environment variables with your own values before running the sample: + 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service + 2) AZURE_COMMUNICATION_SERVICE_AREA_CODE - The area code you want the number to be in +""" + +import os +from azure.communication.phonenumbers import ( + PhoneNumbersClient, + PhoneNumberType, + PhoneNumberAssignmentType, + PhoneNumberCapabilities, + PhoneNumberCapabilityValue +) + +connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') +area_code = os.getenv('AZURE_COMMUNICATION_SERVICE_AREA_CODE') +phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) + +def search_available_phone_numbers(): + capabilities = PhoneNumberCapabilities( + calling = PhoneNumberCapabilityValue.INBOUND, + sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + ) + poller = phone_numbers_client.begin_search_available_phone_numbers( + "US", + PhoneNumberType.TOLL_FREE, + PhoneNumberAssignmentType.APPLICATION, + capabilities, + area_code, + 1, + polling = True + ) + print('Acquired phone numbers:') + print(poller.result) + + +if __name__ == '__main__': + list_acquired_phone_numbers() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md b/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md index 65333287c86a..8e7042749cd3 100644 --- a/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md +++ b/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md @@ -10,7 +10,7 @@ autorest ./PHONE_NUMBER_SWAGGER.md ### Settings ``` yaml -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/e23190a5bc64cd8526d08b6c2c1d616939bc88b3/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/967da531665d4b51a7a5599324e5edd95489cc3d/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json output-folder: ../azure/communication/phonenumbers/_generated namespace: azure.communication.phonenumbers license-header: MICROSOFT_MIT_NO_VERSION @@ -20,23 +20,3 @@ clear-output-folder: true v3: true python: true ``` - -### Rename searchId to reservationId -```yaml -directive: - - from: swagger-document - where: $.definitions.PhoneNumberSearch.properties.searchId - transform: > - $["x-ms-client-name"] = "reservationId"; -``` - -### Rename PhoneNumberSearch to PhoneNumberReservation -```yaml -custom-types-subpackage: models -custom-types: PhoneNumberReservation -required-fields-as-ctor-args: true -directive: - - rename-model: - from: PhoneNumberSearch - to: PhoneNumberReservation -``` \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml index fae0fd63698d..6c30d00b2c67 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml @@ -9,31 +9,31 @@ interactions: Connection: - keep-alive Date: - - Thu, 11 Feb 2021 23:15:38 GMT + - Mon, 15 Feb 2021 17:03:10 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272412?api-version=2021-03-07 response: body: - string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", - "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", "sms": - "none"}, "assignmentType": "User"}' + string: '{"id": "18332272412", "phoneNumber": "+18332272412", "countryCode": + "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", + "sms": "inbound+outbound"}, "assignmentType": "Application"}' headers: content-type: - application/json; charset=utf-8 date: - - Thu, 11 Feb 2021 23:15:39 GMT + - Mon, 15 Feb 2021 17:03:08 GMT ms-cv: - - 0Fa+iu/NaEivjqj8QV7AwQ.0 + - Sz35r6+6dUyc5CXXRpte2A.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 828ms + - 970ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml deleted file mode 100644 index e8c067a1c78c..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml +++ /dev/null @@ -1,82 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Thu, 11 Feb 2021 23:15:40 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 - response: - body: - string: '{"phoneNumbers": [{"id": "16194895875", "phoneNumber": "+16194895875", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": "16194895877", - "phoneNumber": "+16194895877", "countryCode": "US", "phoneNumberType": "Geographic", - "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": - "User"}, {"id": "16194895878", "phoneNumber": "+16194895878", "countryCode": - "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "User"}, {"id": "16194895879", "phoneNumber": - "+16194895879", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": - {"calling": "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": - "16194895880", "phoneNumber": "+16194895880", "countryCode": "US", "phoneNumberType": - "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": - "User"}, {"id": "16194895882", "phoneNumber": "+16194895882", "countryCode": - "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "User"}, {"id": "16194895885", "phoneNumber": - "+16194895885", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": - {"calling": "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": - "16194895887", "phoneNumber": "+16194895887", "countryCode": "US", "phoneNumberType": - "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": - "User"}, {"id": "16194895889", "phoneNumber": "+16194895889", "countryCode": - "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "User"}, {"id": "18332271680", "phoneNumber": - "+18332271680", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": - {"calling": "none", "sms": "outbound"}, "assignmentType": "Application"}, - {"id": "18332272412", "phoneNumber": "+18332272412", "countryCode": "US", - "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": - "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332272430", - "phoneNumber": "+18332272430", "countryCode": "US", "phoneNumberType": "TollFree", - "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": - "Application"}, {"id": "18332272445", "phoneNumber": "+18332272445", "countryCode": - "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", - "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332321209", - "phoneNumber": "+18332321209", "countryCode": "US", "phoneNumberType": "TollFree", - "capabilities": {"calling": "none", "sms": "inbound+outbound"}, "assignmentType": - "Application"}, {"id": "18332321221", "phoneNumber": "+18332321221", "countryCode": - "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "none", "sms": - "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332321226", - "phoneNumber": "+18332321226", "countryCode": "US", "phoneNumberType": "TollFree", - "capabilities": {"calling": "none", "sms": "inbound+outbound"}, "assignmentType": - "Application"}, {"id": "18335260208", "phoneNumber": "+18335260208", "countryCode": - "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", - "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18336369501", - "phoneNumber": "+18336369501", "countryCode": "US", "phoneNumberType": "TollFree", - "capabilities": {"calling": "inbound+outbound", "sms": "none"}, "assignmentType": - "Application"}]}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Thu, 11 Feb 2021 23:15:40 GMT - ms-cv: - - 0k/4PQ1Ca0WmrSBuPE9Svg.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 815ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml index 23009e4d88e3..21449229dadc 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml @@ -1,7 +1,7 @@ interactions: - request: body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": - {"calling": "inbound", "sms": "inbound+outbound"}, "areaCode": "833", "quantity": + {"calling": "inbound", "sms": "inbound+outbound"}, "areaCode": "844", "quantity": 1}' headers: Accept: @@ -15,7 +15,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 09 Feb 2021 23:12:39 GMT + - Mon, 15 Feb 2021 16:48:55 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -24,251 +24,22 @@ interactions: uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 response: body: - string: '' - headers: - content-length: - - '0' - date: - - Tue, 09 Feb 2021 23:12:41 GMT - ms-cv: - - Lu6bTIinOkK+347LEclljw.0 - operation-location: - - /phoneNumbers/operations/search_b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 - request-context: - - appId= - x-processing-time: - - 1604ms - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Tue, 09 Feb 2021 23:13:11 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 - response: - body: - string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": - "2021-02-09T23:12:41.0837738+00:00", "id": "search_b8db86ec-476d-44c4-811d-303928c645bc", - "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' + string: '{"error": {"code": "InvalidInput", "message": "We are unable to find + phone plans to match your requested capabilities.", "target": "areacode"}}' headers: content-type: - - application/json; charset=utf-8 - date: - - Tue, 09 Feb 2021 23:13:11 GMT - ms-cv: - - /KWc7Qzt2kKhdoBoDp6rQQ.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 581ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Tue, 09 Feb 2021 23:13:12 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 - response: - body: - string: '{"searchId": "b8db86ec-476d-44c4-811d-303928c645bc", "phoneNumbers": - ["+18332272459"], "phoneNumberType": "TollFree", "assignmentType": "Application", - "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": - null, "searchExpiresBy": "2021-02-09T23:28:47.6393852+00:00"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Tue, 09 Feb 2021 23:13:12 GMT - ms-cv: - - d5MuV8GE6EKfkM/IvIv7+g.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 615ms - status: - code: 200 - message: OK -- request: - body: '{"searchId": "b8db86ec-476d-44c4-811d-303928c645bc"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '52' - Content-Type: - application/json - Date: - - Tue, 09 Feb 2021 23:13:13 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/:purchase?api-version=2021-03-07 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Tue, 09 Feb 2021 23:13:13 GMT - ms-cv: - - gufZmnAYNkSNr+ILi5p8cQ.0 - operation-location: - - /phoneNumbers/operations/purchase_b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 - request-context: - - appId= - x-processing-time: - - 1144ms - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Tue, 09 Feb 2021 23:13:44 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 - response: - body: - string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": - "2021-02-09T23:12:41.0837738+00:00", "id": "purchase_b8db86ec-476d-44c4-811d-303928c645bc", - "operationType": "Purchase", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Tue, 09 Feb 2021 23:13:44 GMT - ms-cv: - - IWRiRm4RlUCGbZ7P/XSAkQ.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 588ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Tue, 09 Feb 2021 23:13:45 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 - response: - body: - string: '{"searchId": "b8db86ec-476d-44c4-811d-303928c645bc", "phoneNumbers": - ["+18332272459"], "phoneNumberType": "TollFree", "assignmentType": "Application", - "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": - null, "searchExpiresBy": "2021-02-09T23:28:47.6393852+00:00"}' - headers: - content-type: - - application/json; charset=utf-8 date: - - Tue, 09 Feb 2021 23:13:45 GMT + - Mon, 15 Feb 2021 16:48:53 GMT ms-cv: - - qhtPHCmiP0iv/dhdk+EVsw.0 + - 2YSqApoKaEOE7TviEFBpMA.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 586ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Date: - - Tue, 09 Feb 2021 23:13:45 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: DELETE - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272459?api-version=2021-03-07 - response: - body: - string: '' - headers: - date: - - Tue, 09 Feb 2021 23:13:46 GMT - ms-cv: - - svrQMbXLTkq4w+Knna/Hog.0 - operation-location: - - /phoneNumbers/operations/release_5e40cad0-cbab-451b-9aab-08f0b81fb814?api-version=2021-03-07 - request-context: - - appId= - x-processing-time: - - 934ms + - 777ms status: - code: 204 - message: No Content + code: 400 + message: Bad Request version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml new file mode 100644 index 000000000000..d7ca5e5c97a1 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml @@ -0,0 +1,44 @@ +interactions: +- request: + body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": + {"calling": "inbound", "sms": "inbound+outbound"}, "quantity": 1}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '146' + Content-Type: + - application/json + Date: + - Mon, 15 Feb 2021 18:57:45 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 + response: + body: + string: '{"error": {"code": "InvalidInput", "message": "We are unable to find + phone plans to match your requested capabilities.", "target": "areacode"}}' + headers: + content-type: + - application/json + date: + - Mon, 15 Feb 2021 18:57:46 GMT + ms-cv: + - e7d7aFdMpkmwL0Jwb7LJuQ.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 720ms + status: + code: 400 + message: Bad Request +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml new file mode 100644 index 000000000000..6e41a0e870ec --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{"calling": "inbound+outbound", "sms": "outbound"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '50' + Content-Type: + - application/merge-patch+json + Date: + - Fri, 12 Feb 2021 20:30:01 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: PATCH + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875/capabilities?api-version=2021-03-07 + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Fri, 12 Feb 2021 20:30:01 GMT + ms-cv: + - xXho9u+Ns0WcHR62IoSwNA.0 + request-context: + - appId= + x-processing-time: + - 412ms + status: + code: 404 + message: Not Found +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index d10cc2d77654..0819e4d56759 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -9,22 +9,26 @@ def setUp(self): self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ BodyReplacerProcessor( - keys=["id", "token", "phoneNumber", "phonenumbers"] + keys=[] ), ResponseReplacerProcessor(keys=[self._resource_name])]) + @pytest.mark.live_test_only def test_list_acquired_phone_numbers(self): phone_numbers = self.phone_number_client.list_acquired_phone_numbers() assert phone_numbers.next() - + + @pytest.mark.live_test_only def test_get_phone_number(self): - phone_number = self.phone_number_client.get_phone_number("+16194895875") - assert phone_number.phone_number == "+16194895875" - + phone_number = self.phone_number_client.get_phone_number("+18332272412") + assert phone_number.phone_number == "+18332272412" + + @pytest.mark.live_test_only def test_release_phone_number(self): poller = self.phone_number_client.begin_release_phone_number("+16194895886") assert poller.status() == 'succeeded' + @pytest.mark.live_test_only def test_search_available_phone_numbers(self): capabilities = PhoneNumberCapabilities( calling = PhoneNumberCapabilityValue.INBOUND, @@ -35,22 +39,21 @@ def test_search_available_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - "833", - 1, + None, polling = True ) assert poller.result() - + @pytest.mark.live_test_only def test_update_phone_number_capabilities(self): poller = self.phone_number_client.begin_update_phone_number_capabilities( "+16194895875", PhoneNumberCapabilityValue.OUTBOUND, - PhoneNumberCapabilityValue.OUTBOUND, + PhoneNumberCapabilityValue.INBOUND_OUTBOUND, polling = True ) assert poller.result() - - + + @pytest.mark.live_test_only def test_purchase_phone_numbers(self): capabilities = PhoneNumberCapabilities( calling = PhoneNumberCapabilityValue.INBOUND, @@ -61,12 +64,12 @@ def test_purchase_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - "833", + "844", 1, polling = True ) phone_number_to_buy = search_poller.result() purchase_poller = self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) assert purchase_poller.result() - release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) - assert release_poller.status() == 'succeeded' \ No newline at end of file + ##release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) + ##assert release_poller.status() == 'succeeded' From 0133451fd84af7852ca78d762014210c080c4bd0 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Tue, 16 Feb 2021 13:34:41 -0600 Subject: [PATCH 05/32] Tests work with new area code --- ...t.test_search_available_phone_numbers.yaml | 65 +++++++++-- ...test_update_phone_number_capabilities.yaml | 104 ++++++++++++++++-- ...on_client_async.test_get_phone_number.yaml | 8 +- ...test_phone_number_administration_client.py | 5 +- 4 files changed, 155 insertions(+), 27 deletions(-) diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml index d7ca5e5c97a1..c0e337ffded5 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml @@ -1,7 +1,8 @@ interactions: - request: body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": - {"calling": "inbound", "sms": "inbound+outbound"}, "quantity": 1}' + {"calling": "inbound", "sms": "inbound+outbound"}, "areaCode": "844", "quantity": + 1}' headers: Accept: - application/json @@ -10,11 +11,11 @@ interactions: Connection: - keep-alive Content-Length: - - '146' + - '165' Content-Type: - application/json Date: - - Mon, 15 Feb 2021 18:57:45 GMT + - Tue, 16 Feb 2021 18:40:28 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -23,22 +24,64 @@ interactions: uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 response: body: - string: '{"error": {"code": "InvalidInput", "message": "We are unable to find - phone plans to match your requested capabilities.", "target": "areacode"}}' + string: '' + headers: + content-length: + - '0' + date: + - Tue, 16 Feb 2021 18:40:27 GMT + ms-cv: + - m3sIDXIbBkWugK33dLdtTQ.0 + operation-id: + - search_6e059e43-dded-43ca-9740-65ec3047e551 + operation-location: + - /phoneNumbers/operations/search_6e059e43-dded-43ca-9740-65ec3047e551?api-version=2021-03-07 + request-context: + - appId= + search-id: + - 6e059e43-dded-43ca-9740-65ec3047e551 + x-processing-time: + - 1563ms + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 16 Feb 2021 18:41:00 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_6e059e43-dded-43ca-9740-65ec3047e551?api-version=2021-03-07 + response: + body: + string: '{"status": "Failed", "resourceLocation": null, "createdDateTime": "2021-02-16T18:40:27.7542139+00:00", + "error": {"code": "OutOfStock", "message": "Error 1000: Not enough stock to + fulfill search request."}, "id": "search_6e059e43-dded-43ca-9740-65ec3047e551", + "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: content-type: - - application/json + - application/json; charset=utf-8 date: - - Mon, 15 Feb 2021 18:57:46 GMT + - Tue, 16 Feb 2021 18:41:00 GMT ms-cv: - - e7d7aFdMpkmwL0Jwb7LJuQ.0 + - sfe/kkZvskqwyUmS3r7wxw.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 720ms + - 2654ms status: - code: 400 - message: Bad Request + code: 200 + message: OK version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml index 6e41a0e870ec..e855d7af1d31 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml @@ -13,28 +13,112 @@ interactions: Content-Type: - application/merge-patch+json Date: - - Fri, 12 Feb 2021 20:30:01 GMT + - Tue, 16 Feb 2021 19:21:29 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: PATCH - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875/capabilities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18335260208/capabilities?api-version=2021-03-07 response: body: - string: '' + string: '{"capabilitiesUpdateId": "404951bf-440b-4ff3-938c-43cbcdc62f91"}' headers: - content-length: - - '0' + capabilities-id: + - 404951bf-440b-4ff3-938c-43cbcdc62f91 + content-type: + - application/json; charset=utf-8 date: - - Fri, 12 Feb 2021 20:30:01 GMT + - Tue, 16 Feb 2021 19:21:31 GMT ms-cv: - - xXho9u+Ns0WcHR62IoSwNA.0 + - dBNwCvx0C0Cx7bVqcZdyZQ.0 + operation-id: + - capabilities_404951bf-440b-4ff3-938c-43cbcdc62f91 + operation-location: + - /phoneNumbers/operations/capabilities_404951bf-440b-4ff3-938c-43cbcdc62f91?api-version=2021-03-07 request-context: - appId= + transfer-encoding: + - chunked x-processing-time: - - 412ms + - 1267ms status: - code: 404 - message: Not Found + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 16 Feb 2021 19:22:01 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/capabilities_404951bf-440b-4ff3-938c-43cbcdc62f91?api-version=2021-03-07 + response: + body: + string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": + "2021-02-16T19:21:30.6218852+00:00", "id": "capabilities_404951bf-440b-4ff3-938c-43cbcdc62f91", + "operationType": "UpdatePhoneNumberCapabilities", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Tue, 16 Feb 2021 19:22:01 GMT + ms-cv: + - 9I1ueyxoaUaH5olBCjvHnQ.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 642ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 16 Feb 2021 19:22:02 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18335260208/capabilities?api-version=2021-03-07 + response: + body: + string: '{"error": {"code": "UnsupportedApiVersion", "message": "The HTTP resource + that matches the request URI ''https://sanitized.communication.azure.com/phoneNumbers/+18335260208/capabilities'' + does not support the API version ''2021-03-07''.", "innerError": null}}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Tue, 16 Feb 2021 19:22:01 GMT + ms-cv: + - mUgwWEP7I0SD1ghOfm4l4g.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 10ms + status: + code: 400 + message: Bad Request version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml index e8d27b2ac8a8..57574029f648 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml @@ -5,7 +5,7 @@ interactions: Accept: - application/json Date: - - Thu, 11 Feb 2021 20:34:10 GMT + - Tue, 16 Feb 2021 19:28:29 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -17,11 +17,11 @@ interactions: string: '{"error": {"code": "Denied", "message": "Denied by the resource provider."}}' headers: content-type: application/json - date: Thu, 11 Feb 2021 20:34:11 GMT - ms-cv: 1vN1Av5Jp02JawMoV/kpYQ.0 + date: Tue, 16 Feb 2021 19:28:29 GMT + ms-cv: t32QEy5Lvky+yflBUjWr8w.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 169ms + x-processing-time: 152ms status: code: 401 message: Unauthorized diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index 0819e4d56759..5ba53c04693f 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -39,14 +39,15 @@ def test_search_available_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - None, + "844", polling = True ) assert poller.result() + @pytest.mark.live_test_only def test_update_phone_number_capabilities(self): poller = self.phone_number_client.begin_update_phone_number_capabilities( - "+16194895875", + "+18335260208", PhoneNumberCapabilityValue.OUTBOUND, PhoneNumberCapabilityValue.INBOUND_OUTBOUND, polling = True From 5ad4bfab53d7bf9fe365c6b72d9ad023449e8639 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Tue, 16 Feb 2021 18:07:46 -0600 Subject: [PATCH 06/32] Addresses comments --- .../README.md | 19 ++ .../communication/phonenumbers/__init__.py | 1 - .../phonenumbers/_phone_numbers_client.py | 129 ++++++------- .../communication/phonenumbers/_version.py | 2 +- .../aio/_phone_numbers_client_async.py | 170 ++++++++---------- ...stration_client.test_get_phone_number.yaml | 8 +- ...on_client_async.test_get_phone_number.yaml | 22 +-- ...sync.test_list_acquired_phone_numbers.yaml | 30 ++-- ...hone_number_administration_client_async.py | 4 +- 9 files changed, 180 insertions(+), 205 deletions(-) diff --git a/sdk/communication/azure-communication-phonenumbers/README.md b/sdk/communication/azure-communication-phonenumbers/README.md index 502325d0d4b3..6a28ebb57a68 100644 --- a/sdk/communication/azure-communication-phonenumbers/README.md +++ b/sdk/communication/azure-communication-phonenumbers/README.md @@ -123,6 +123,25 @@ poller = self.phone_number_client.begin_release_phone_number( polling = True ) ``` + +### Updating Phone Number Capabilities + +Updates the specified phone number capabilities for Calling and SMS to one of: + +- `PhoneNumberCapabilityValue.NONE` +- `PhoneNumberCapabilityValue.INBOUND` +- `PhoneNumberCapabilityValue.OUTBOUND` +- `PhoneNumberCapabilityValue.INBOUND_OUTBOUND` + +```python +poller = self.phone_number_client.begin_update_phone_number_capabilities( + "+18335260208", + PhoneNumberCapabilityValue.OUTBOUND, + PhoneNumberCapabilityValue.INBOUND_OUTBOUND, + polling = True +) +``` + # Troubleshooting The Phone Numbers Administration client will raise exceptions defined in [Azure Core][azure_core]. diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py index 3ee3773620ac..95f8f2d9d12a 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py @@ -38,7 +38,6 @@ 'PhoneNumberPurchaseRequest', 'PhoneNumberSearchRequest', 'PhoneNumberSearchResult', - 'PhoneNumberUpdateRequest', 'BillingFrequency', 'PhoneNumberAssignmentType', 'PhoneNumberCapabilityValue', diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py index faa5f9963a08..4dc0494b26b7 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py @@ -1,3 +1,9 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- + from azure.core.tracing.decorator import distributed_trace from azure.core.paging import ItemPaged from azure.core.polling import LROPoller @@ -5,8 +11,6 @@ from ._generated.models import PhoneNumberSearchRequest from ._shared.utils import parse_connection_str, get_authentication_policy from ._version import SDK_MONIKER -import pytest - class PhoneNumbersClient(object): def __init__( @@ -32,11 +36,11 @@ def __init__( authentication_policy=get_authentication_policy(endpoint, credential), sdk_moniker=SDK_MONIKER, **kwargs) - + @classmethod def from_connection_string( - cls, conn_str, # type: str - **kwargs # type: Any + cls, conn_str, # type: str + **kwargs # type: Any ): # type: (...) -> PhoneNumbersClient """Create PhoneNumbersClient from a Connection String. @@ -48,15 +52,14 @@ def from_connection_string( endpoint, access_key = parse_connection_str(conn_str) return cls(endpoint, access_key, **kwargs) - - + @distributed_trace def begin_purchase_phone_numbers( - self, - search_id, - **kwargs + self, + search_id, # type: str + **kwargs # type: Any ): - # type: (...) -> LROPoller[None] + # type: (...) -> LROPoller[None] """Purchases phone numbers. :param search_id: The search id. @@ -65,19 +68,20 @@ def begin_purchase_phone_numbers( :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls + for LRO operations if no Retry-After header is present. :rtype: ~azure.core.polling.LROPoller[~azure.communication.phonenumbers.models.PhoneNumberSearchResult] """ return self._phone_number_client.phone_numbers.begin_purchase_phone_numbers( search_id, **kwargs ) - + @distributed_trace def begin_release_phone_number( - self, - phone_number, - **kwargs + self, + phone_number, # type: str + **kwargs # type: Any ): # type: (...) -> LROPoller[None] """Releases an acquired phone number. @@ -89,7 +93,8 @@ def begin_release_phone_number( :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls + for LRO operations if no Retry-After header is present. :rtype: ~azure.core.polling.LROPoller[None] """ return self._phone_number_client.phone_numbers.begin_release_phone_number( @@ -99,14 +104,14 @@ def begin_release_phone_number( @distributed_trace def begin_search_available_phone_numbers( - self, - country_code, - phone_number_type, - assignment_type, - capabilities, - area_code, - quantity = 1, - **kwargs + self, + country_code, # type: str + phone_number_type, # type: str + assignment_type, # type: str + capabilities, # type: PhoneNumberCapabilities + area_code, # type: str + quantity=1, # type: int + **kwargs # type: Any ): # type: (...) -> LROPoller[PhoneNumberSearchResult] """Search for available phone numbers to purchase. @@ -131,29 +136,30 @@ def begin_search_available_phone_numbers( :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls + for LRO operations if no Retry-After header is present. :rtype: ~azure.core.polling.LROPoller[~azure.communication.phonenumbers.models.PhoneNumberSearchResult] """ search_request = PhoneNumberSearchRequest( - phone_number_type = phone_number_type, - assignment_type = assignment_type, - capabilities = capabilities, - area_code = area_code, - quantity = quantity + phone_number_type=phone_number_type, + assignment_type=assignment_type, + capabilities=capabilities, + area_code=area_code, + quantity=quantity ) return self._phone_number_client.phone_numbers.begin_search_available_phone_numbers( country_code, search_request, **kwargs ) - + @distributed_trace def begin_update_phone_number_capabilities( - self, - phone_number, - sms, - calling, - **kwargs + self, + phone_number, # type: str + sms, #type: str or PhoneNumberCapabilityValue + calling, #type: str or PhoneNumberCapabilityValue + **kwargs # type: Any ): # type: (...) -> LROPoller["_models.AcquiredPhoneNumber"] """Updates the capabilities of a phone number. @@ -170,7 +176,8 @@ def begin_update_phone_number_capabilities( :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls + for LRO operations if no Retry-After header is present. :rtype: ~azure.core.polling.LROPoller[AcquiredPhoneNumber] """ return self._phone_number_client.phone_numbers.begin_update_capabilities( @@ -178,13 +185,13 @@ def begin_update_phone_number_capabilities( calling, sms, **kwargs - ) + ) @distributed_trace def get_phone_number( - self, - phone_number, - **kwargs + self, + phone_number, # type: str + **kwargs # type: Any ): # type: (...) -> AcquiredPhoneNumber """Gets the details of the given acquired phone number. @@ -202,10 +209,10 @@ def get_phone_number( @distributed_trace def list_acquired_phone_numbers( - self, - **kwargs + self, + **kwargs # type: Any ): - # type: (...) -> ItemPaged[AcquiredPhoneNumbers] + # type: (...) -> ItemPaged[AcquiredPhoneNumber] """Gets the list of all acquired phone numbers. :param skip: An optional parameter for how many entries to skip, for pagination purposes. The @@ -214,38 +221,8 @@ def list_acquired_phone_numbers( :param top: An optional parameter for how many entries to return, for pagination purposes. The default value is 100. :type top: int - :rtype: ~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.models.AcquiredPhoneNumbers] + :rtype: ~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.models.AcquiredPhoneNumber] """ return self._phone_number_client.phone_numbers.list_phone_numbers( **kwargs ) - - @distributed_trace - def update_phone_number( - self, - phone_number, - callback_uri, - application_id, - **kwargs - ): - # type: (...) -> AcquiredPhoneNumber - """Updates the configuration of a phone number. - - :param phone_number: Phone number to be updated, e.g. +11234567890. - :type phone_number: str - :param callback_uri: The webhook for receiving incoming events. - e.g. "https://{{site-name}}.azurewebsites.net/api/updates". - Please read https://docs.microsoft.com/en-us/azure/communication-services/concepts/event- - handling - for integration with Azure Event Grid to deliver real-time event notifications. - :type callback_uri: str - :param application_id: The application id of the application to which to configure. - :type application_id: str - :rtype: ~azure.communication.phonenumbers.models.AcquiredPhoneNumber - """ - return self._phone_number_client.phone_numbers.update( - phone_number, - callback_uri, - application_id, - **kwargs - ) \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_version.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_version.py index a7bc8e8c9303..a01196623d45 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_version.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_version.py @@ -6,4 +6,4 @@ VERSION = "1.0.0b4" -SDK_MONIKER = "communication-administration/{}".format(VERSION) # type: str \ No newline at end of file +SDK_MONIKER = "communication-administration/{}".format(VERSION) # type: str diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py index 0dd9c4a71347..9074fbcf86a1 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py @@ -1,3 +1,9 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- + from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.paging import ItemPaged @@ -6,39 +12,38 @@ from .._generated.models import PhoneNumberSearchRequest from .._shared.utils import parse_connection_str, get_authentication_policy from .._version import SDK_MONIKER -import pytest - class PhoneNumbersClient(object): def __init__( self, - endpoint, # type: str - credential, # type: str - **kwargs # type: Any + endpoint, # type: str + credential, # type: str + **kwargs # type: Any ): - # type: (...) -> None - try: - if not endpoint.lower().startswith('http'): - endpoint = "https://" + endpoint - except AttributeError: - raise ValueError("Account URL must be a string.") - - if not credential: - raise ValueError( - "You need to provide account shared key to authenticate.") - - self._endpoint = endpoint - self._phone_number_client = PhoneNumbersClientGen( - self._endpoint, - authentication_policy=get_authentication_policy(endpoint, credential, is_async=True), - sdk_moniker=SDK_MONIKER, - **kwargs) + # type: (...) -> None + try: + if not endpoint.lower().startswith('http'): + endpoint = "https://" + endpoint + except AttributeError: + raise ValueError("Account URL must be a string.") + + if not credential: + raise ValueError( + "You need to provide account shared key to authenticate.") + + self._endpoint = endpoint + self._phone_number_client = PhoneNumbersClientGen( + self._endpoint, + authentication_policy=get_authentication_policy(endpoint, credential), + sdk_moniker=SDK_MONIKER, + **kwargs) @classmethod def from_connection_string( - cls, conn_str, # type: str - **kwargs # type: Any - ): # type: (...) -> PhoneNumbersAdministrationClient + cls, conn_str, # type: str + **kwargs # type: Any + ): + # type: (...) -> PhoneNumbersAdministrationClient """Create PhoneNumbersAdministrationClient from a Connection String. :param str conn_str: A connection string to an Azure Communication Service resource. @@ -48,15 +53,14 @@ def from_connection_string( endpoint, access_key = parse_connection_str(conn_str) return cls(endpoint, access_key, **kwargs) - - + @distributed_trace_async async def begin_purchase_phone_numbers( - self, - search_id, - **kwargs + self, + search_id, # type: str + **kwargs # type: Any ): - # type: (...) -> AsyncLROPollerLROPoller[PhoneNumberSearchResult] + # type: (...) -> AsyncLROPoller[PhoneNumberSearchResult] """Purchases phone numbers. :param search_id: The search id. @@ -65,19 +69,20 @@ async def begin_purchase_phone_numbers( :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls + for LRO operations if no Retry-After header is present. :rtype: ~azure.core.polling.AsyncLROPoller[~azure.communication.phonenumbers.models.PhoneNumberSearchResult] """ return await self._phone_number_client.phone_numbers.begin_purchase_phone_numbers( search_id, **kwargs ) - + @distributed_trace_async async def begin_release_phone_number( - self, - phone_number, - **kwargs + self, + phone_number, # type: str + **kwargs # type: Any ): # type: (...) -> AsyncLROPoller[None] """Releases an acquired phone number. @@ -89,7 +94,8 @@ async def begin_release_phone_number( :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls + for LRO operations if no Retry-After header is present. :rtype: ~azure.core.polling.AsyncLROPoller[None] """ return await self._phone_number_client.phone_numbers.begin_release_phone_number( @@ -99,13 +105,13 @@ async def begin_release_phone_number( @distributed_trace_async async def begin_search_available_phone_numbers( - self, - country_code, - phone_number_type, - assignment_type, - capabilities, - area_code, - quantity = 1, + self, + country_code, # type: str + phone_number_type, # type: str + assignment_type, # type: str + capabilities, + area_code, # type: str + quantity=1, # type: int **kwargs ): # type: (...) -> AsyncLROPoller[PhoneNumberSearchResult] @@ -131,15 +137,16 @@ async def begin_search_available_phone_numbers( :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls + for LRO operations if no Retry-After header is present. :rtype: ~azure.core.polling.AsyncLROPoller[~azure.communication.phonenumbers.models.PhoneNumberSearchResult] """ search_request = PhoneNumberSearchRequest( - phone_number_type = phone_number_type, - assignment_type = assignment_type, - capabilities = capabilities, - area_code = area_code, - quantity = quantity + phone_number_type=phone_number_type, + assignment_type=assignment_type, + capabilities=capabilities, + area_code=area_code, + quantity=quantity ) return await self._phone_number_client.phone_numbers.begin_search_available_phone_numbers( country_code, @@ -149,11 +156,11 @@ async def begin_search_available_phone_numbers( @distributed_trace_async async def begin_update_phone_number_capabilities( - self, - phone_number, - sms, - calling, - **kwargs + self, + phone_number, # type: str + sms, # type: str + calling, # type: str + **kwargs # type: Any ): # type: (...) -> AsyncLROPoller["_models.AcquiredPhoneNumber"] """Updates the capabilities of a phone number. @@ -170,7 +177,8 @@ async def begin_update_phone_number_capabilities( :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :keyword int polling_interval: Default waiting time between two polls + for LRO operations if no Retry-After header is present. :rtype: ~azure.core.polling.AsyncLROPoller[AcquiredPhoneNumber] """ return await self._phone_number_client.phone_numbers.begin_update_capabilities( @@ -178,13 +186,13 @@ async def begin_update_phone_number_capabilities( calling, sms, **kwargs - ) + ) @distributed_trace_async async def get_phone_number( - self, - phone_number, - **kwargs + self, + phone_number, # type: str + **kwargs # type: Any ): # type: (...) -> AcquiredPhoneNumber """Gets the details of the given acquired phone number. @@ -202,53 +210,23 @@ async def get_phone_number( @distributed_trace def list_acquired_phone_numbers( - self, - **kwargs + self, + **kwargs # type: Any ): - # type: (...) -> AsyncItemPaged[AcquiredPhoneNumbers] + # type: (...) -> AsyncItemPaged[AcquiredPhoneNumbers] """Gets the list of all acquired phone numbers. :param skip: An optional parameter for how many entries to skip, for pagination purposes. The - default value is 0. + default value is 0. :type skip: int :param top: An optional parameter for how many entries to return, for pagination purposes. The - default value is 100. + default value is 100. :type top: int :rtype: ~azure.core.paging.AsyncItemPaged[~azure.communication.phonenumbers.models.AcquiredPhoneNumbers] """ return self._phone_number_client.phone_numbers.list_phone_numbers( **kwargs ) - - @distributed_trace_async - async def update_phone_number( - self, - phone_number, - callback_uri, - application_id, - **kwargs - ): - # type: (...) -> AcquiredPhoneNumber - """Updates the configuration of a phone number. - - :param phone_number: Phone number to be updated, e.g. +11234567890. - :type phone_number: str - :param callback_uri: The webhook for receiving incoming events. - e.g. "https://{{site-name}}.azurewebsites.net/api/updates". - Please read https://docs.microsoft.com/en-us/azure/communication-services/concepts/event- - handling - for integration with Azure Event Grid to deliver real-time event notifications. - :type callback_uri: str - :param application_id: The application id of the application to which to configure. - :type application_id: str - :rtype: ~azure.communication.phonenumbers.models.AcquiredPhoneNumber - """ - return await self._phone_number_client.phone_numbers.update( - phone_number, - callback_uri, - application_id, - **kwargs - ) async def __aenter__(self) -> "PhoneNumbersClient": await self._phone_number_client.__aenter__() @@ -261,4 +239,4 @@ async def close(self) -> None: """Close the :class: `~azure.communication.phonenumbers.aio.PhoneNumbersClient` session. """ - await self._phone_number_client.__aexit__() \ No newline at end of file + await self._phone_number_client.__aexit__() diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml index 6c30d00b2c67..c97ebaeea9e7 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive Date: - - Mon, 15 Feb 2021 17:03:10 GMT + - Tue, 16 Feb 2021 19:42:45 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -25,15 +25,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 15 Feb 2021 17:03:08 GMT + - Tue, 16 Feb 2021 19:42:46 GMT ms-cv: - - Sz35r6+6dUyc5CXXRpte2A.0 + - Npb2F6HCHUCS3PCMa+LVKA.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 970ms + - 810ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml index 57574029f648..f52367daa393 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml @@ -5,25 +5,27 @@ interactions: Accept: - application/json Date: - - Tue, 16 Feb 2021 19:28:29 GMT + - Tue, 16 Feb 2021 19:45:38 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272412?api-version=2021-03-07 response: body: - string: '{"error": {"code": "Denied", "message": "Denied by the resource provider."}}' + string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", + "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": + "inbound+outbound"}, "assignmentType": "Application"}' headers: - content-type: application/json - date: Tue, 16 Feb 2021 19:28:29 GMT - ms-cv: t32QEy5Lvky+yflBUjWr8w.0 + content-type: application/json; charset=utf-8 + date: Tue, 16 Feb 2021 19:45:39 GMT + ms-cv: pDmuqc/E1EGttt2gQZMupQ.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 152ms + x-processing-time: 960ms status: - code: 401 - message: Unauthorized - url: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 + code: 200 + message: OK + url: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272412?api-version=2021-03-07 version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml index c5d5612585d1..a9fd1c3502b3 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml @@ -5,7 +5,7 @@ interactions: Accept: - application/json Date: - - Thu, 11 Feb 2021 20:20:13 GMT + - Tue, 16 Feb 2021 19:45:32 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -16,26 +16,26 @@ interactions: body: string: '{"phoneNumbers": [{"id": "16194895875", "phoneNumber": "+16194895875", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": "16194895877", + "outbound", "sms": "none"}, "assignmentType": "Person"}, {"id": "16194895877", "phoneNumber": "+16194895877", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": - "User"}, {"id": "16194895878", "phoneNumber": "+16194895878", "countryCode": + "Person"}, {"id": "16194895878", "phoneNumber": "+16194895878", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "User"}, {"id": "16194895879", "phoneNumber": + "sms": "none"}, "assignmentType": "Person"}, {"id": "16194895879", "phoneNumber": "+16194895879", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": - {"calling": "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": + {"calling": "outbound", "sms": "none"}, "assignmentType": "Person"}, {"id": "16194895880", "phoneNumber": "+16194895880", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": - "User"}, {"id": "16194895882", "phoneNumber": "+16194895882", "countryCode": + "Person"}, {"id": "16194895882", "phoneNumber": "+16194895882", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "User"}, {"id": "16194895885", "phoneNumber": + "sms": "none"}, "assignmentType": "Person"}, {"id": "16194895885", "phoneNumber": "+16194895885", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": - {"calling": "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": + {"calling": "outbound", "sms": "none"}, "assignmentType": "Person"}, {"id": "16194895887", "phoneNumber": "+16194895887", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": - "User"}, {"id": "16194895889", "phoneNumber": "+16194895889", "countryCode": + "Person"}, {"id": "16194895889", "phoneNumber": "+16194895889", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "User"}, {"id": "18332271680", "phoneNumber": + "sms": "none"}, "assignmentType": "Person"}, {"id": "18332271680", "phoneNumber": "+18332271680", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "none", "sms": "outbound"}, "assignmentType": "Application"}, {"id": "18332272412", "phoneNumber": "+18332272412", "countryCode": "US", @@ -54,18 +54,18 @@ interactions: "phoneNumber": "+18332321226", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18335260208", "phoneNumber": "+18335260208", "countryCode": - "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", - "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18336369501", + "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound+outbound", + "sms": "outbound"}, "assignmentType": "Application"}, {"id": "18336369501", "phoneNumber": "+18336369501", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound+outbound", "sms": "none"}, "assignmentType": "Application"}]}' headers: content-type: application/json; charset=utf-8 - date: Thu, 11 Feb 2021 20:20:15 GMT - ms-cv: /PDnQzArpkm1GBLVqCNyKg.0 + date: Tue, 16 Feb 2021 19:45:33 GMT + ms-cv: 64fjFm+18EKAQ/UkeQyQuQ.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 2257ms + x-processing-time: 908ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index 87c0c7d5784b..ca806e6bd46f 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -26,8 +26,8 @@ async def test_list_acquired_phone_numbers(self): @AsyncCommunicationTestCase.await_prepared_test async def test_get_phone_number(self): async with self.phone_number_client: - phone_number = await self.phone_number_client.get_phone_number("+16194895875") - assert phone_number.phone_number == "+16194895875" + phone_number = await self.phone_number_client.get_phone_number("+18332272412") + assert phone_number.phone_number == "+18332272412" ''' def test_update_phone_number(self): From 3fda514a9e1640114305567c079a488dd3bf3728 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Wed, 17 Feb 2021 11:21:55 -0600 Subject: [PATCH 07/32] Corrected samples --- ...cation_identity-1.0.0b4-py2.py3-none-any.whl | Bin 0 -> 33505 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 sdk/communication/azure-communication-identity/azure_communication_identity-1.0.0b4-py2.py3-none-any.whl diff --git a/sdk/communication/azure-communication-identity/azure_communication_identity-1.0.0b4-py2.py3-none-any.whl b/sdk/communication/azure-communication-identity/azure_communication_identity-1.0.0b4-py2.py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..03a4726a88bd3cb10e5ee02b06f46861bc739722 GIT binary patch literal 33505 zcmeFYV~}Ry(xzLsyKLL8F59+k+qP}nc9&h%W!tu`>HfZ%*?UjK#6J6+zvtH*vEu!+ z?)7Bmm3ikQCkYIK3;+NC0T2->s4&s=YY-d|0H6v80D%0@Q+*F-2V*)zTWf1)8*@W_ zCv#gHI&&jq8z*xocRF2Na~pFfU0qr`_iDK=ivfCsEl`h8V0f9lM=U4ubfC#3Cn#a` zSM17Ur=y~vqf4q)X^X@e3N~@P?QLzq=~zq(C^dOs6UP%m>IWoN5hhRz!~S-%nnD8I zzRG6$I3RkkgCDHQs680bJbJ*Q+xUVP2(0Iupf!4tZl8nK5X10UIj29IK}aKJkW8sK z=a5JMZ6+pP22!NgC1x2p%92QrW42BRMAE^$nQyC_SWZEQizn|vNsAuoOj+beRlpz8 zrjp?H%J{Kp&w`QTOiUUI=^iwtxh3ke+=6P3umaQXxN*FzW-t$^l`C3QDBS!%)0DpE zTfKfKOi=2Lc3yeOzN_A=u&H#FW~fpZzr^i<%l&ULYeM7|_|sUhPe1_xz%c;;c>b-J z|01&P{}Nf((8~Oe+^ZzhG021!Y886>M3d1vqTl0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G~>!w(r@?qVRj86~8SMhcmo}LpcfI!Fq$j>+TzwQD1{KX%ydheefzuOV^SF3;3 z4D}y20RZZ~C7=(*_$i|Jx{2Bg0PAxfr{4znJEQdz_I0zU7ude%MgMQW{(FyxU$5@x zkMg>G%?nH_!tcYpItu<3QvCzwRP@5w*4 z!(RGVzs7m3XZnJ}`tI-J{D&)jrEdD#hu2z^FFpW}{e2()#S(rE^ICxI1;+N7g8aMl z_Mb!gkIz5l*nWljc?`seF;4S3#j{VvqY1o>}s_O%qw3)bi7ea!y_>p%R8 zFYdgWuRpK&HAVf!i?Zhd`0rl)S)}_P7L325i@#X+p9Fdj6Um_+tA=@HcJ$ ziz@hf9=s+Sz1aRP`kS`@f9la|kk|Z&7mz{8{~O4^*buLwUKd}#KsCw!9jO0Qiv1ez zbeuV}t0V9i z)DfLOQGY+n^UHzwYn<2TkuNw!&uOJU0{!=K{&_n28sv47>ILMx<=+PRBW3j(;dMgk y1);*~ZzKF$dg(RN>%`JOk!k@Etp7IBKhjJx;vhd0VF0+#fBny_Cm_e4|NTEERmhG2 literal 0 HcmV?d00001 From d11dabe27a2515ae50e5fd783fe4ea6172f937d6 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Wed, 17 Feb 2021 11:22:09 -0600 Subject: [PATCH 08/32] Corrected samples --- .../azure/communication/phonenumbers/_phone_numbers_client.py | 3 --- .../samples/get_phone_number_sample.py | 2 +- .../samples/list_acquired_phone_numbers_sample.py | 3 ++- .../samples/release_phone_number_sample.py | 4 +++- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py index 4dc0494b26b7..2b21a7c873c8 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py @@ -218,9 +218,6 @@ def list_acquired_phone_numbers( :param skip: An optional parameter for how many entries to skip, for pagination purposes. The default value is 0. :type skip: int - :param top: An optional parameter for how many entries to return, for pagination purposes. The - default value is 100. - :type top: int :rtype: ~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.models.AcquiredPhoneNumber] """ return self._phone_number_client.phone_numbers.list_phone_numbers( diff --git a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py index f7dc56a4f6d1..821ef846bbd3 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py @@ -23,7 +23,7 @@ ) connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_INFORMATION") +phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) def get_phone_number_information(): diff --git a/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py index 700ed9cfafa3..67095761c9a6 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py @@ -27,7 +27,8 @@ def list_acquired_phone_numbers(): acquired_phone_numbers = phone_numbers_client.list_acquired_phone_numbers() print('Acquired phone numbers:') - print(acquired_phone_numbers) + for acquired_phone_number in acquired_phone_numbers: + print(acquired_phone_number) if __name__ == '__main__': diff --git a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py index 514b1480be67..caa8b2bd6c55 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py @@ -23,7 +23,9 @@ ) connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -phone_number_to_release = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_RELEASE") +phone_number_to_release = os.getenv( + "AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE" # e.g. "+18001234567" +) phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) def release_phone_number(): From bf22dddae3b1287cb8ba59c6d82f5b6e704cfaba Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Wed, 17 Feb 2021 17:37:54 -0600 Subject: [PATCH 09/32] Added fixed samples --- .../communication/phonenumbers/__init__.py | 8 -- .../samples/get_phone_number_sample.py | 10 +-- .../list_acquired_phone_numbers_sample.py | 4 +- .../samples/purchase_phone_number_sample.py | 22 +++-- .../samples/release_phone_number_sample.py | 8 +- .../search_available_phone_numbers_sample.py | 8 +- ...update_phone_number_capabilities_sample.py | 44 ++++++++++ ...hone_number_administration_client_async.py | 85 ++++++++++--------- 8 files changed, 116 insertions(+), 73 deletions(-) create mode 100644 sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py index 95f8f2d9d12a..793bdafb5af1 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py @@ -10,13 +10,9 @@ AcquiredPhoneNumber, AcquiredPhoneNumbers, CommunicationError, - CommunicationErrorResponse, PhoneNumberCapabilities, - PhoneNumberCapabilitiesRequest, PhoneNumberCost, PhoneNumberOperation, - PhoneNumberPurchaseRequest, - PhoneNumberSearchRequest, PhoneNumberSearchResult, BillingFrequency, PhoneNumberAssignmentType, @@ -30,13 +26,9 @@ 'AcquiredPhoneNumber', 'AcquiredPhoneNumbers', 'CommunicationError', - 'CommunicationErrorResponse', 'PhoneNumberCapabilities', - 'PhoneNumberCapabilitiesRequest', 'PhoneNumberCost', 'PhoneNumberOperation', - 'PhoneNumberPurchaseRequest', - 'PhoneNumberSearchRequest', 'PhoneNumberSearchResult', 'BillingFrequency', 'PhoneNumberAssignmentType', diff --git a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py index 821ef846bbd3..6383d237e393 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py @@ -7,14 +7,14 @@ # -------------------------------------------------------------------------- """ -FILE: phone_number_area_codes_sample.py +FILE:get_phone_number_sample.py DESCRIPTION: - This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. + This sample demonstrates how to get the information from an acquired phone number using your connection string USAGE: - python list_acquired_phone_numbers_sample.py + python get_phone_number_sample.py Set the environment variables with your own values before running the sample: 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service - 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_INFORMATION - The phone number you want to get its information + 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER - The phone number you want to get its information """ import os @@ -23,7 +23,7 @@ ) connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") +phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") # e.g. "+18001234567" phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) def get_phone_number_information(): diff --git a/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py index 67095761c9a6..8e109c5bd074 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py @@ -7,9 +7,9 @@ # -------------------------------------------------------------------------- """ -FILE: phone_number_area_codes_sample.py +FILE: list_acquired_phone_numbers_sample.py DESCRIPTION: - This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. + This sample demonstrates how to get all off you acquired phone numbers using your connection string USAGE: python list_acquired_phone_numbers_sample.py Set the environment variables with your own values before running the sample: diff --git a/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py index 8d9493e5ae9f..874a14ef77f0 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py @@ -7,11 +7,11 @@ # -------------------------------------------------------------------------- """ -FILE: phone_number_area_codes_sample.py +FILE: purchase_phone_number_sample.py DESCRIPTION: - This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. + This sample demonstrates how to purchase a phone number using the search id you got from the search_available_phone_number API USAGE: - python list_acquired_phone_numbers_sample.py + python purchase_phone_number_sample.py Set the environment variables with your own values before running the sample: 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service 2) AZURE_COMMUNICATION_SERVICE_SEARCH_ID_TO_PURCHASE - The search id for the phone number you reserved and want to purchase @@ -23,14 +23,18 @@ ) connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_INFORMATION") +search_id = os.getenv("AZURE_COMMUNICATION_SERVICE_SEARCH_ID_TO_PURCHASE") phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) -def get_phone_number_information(): - phone_number_information = phone_numbers_client.get_phone_number(phone_number) - print('Phone number information:') - print(phone_number_information) +def purchase_phone_number(): + poller = phone_numbers_client.begin_purchase_phone_numbers( + search_id, + polling = True + ) + poller.result() + print("Result from the purchase operation: ") + print(poller.status) if __name__ == '__main__': - get_phone_number_information() \ No newline at end of file + purchase_phone_number() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py index caa8b2bd6c55..394807c8f55c 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py @@ -7,14 +7,14 @@ # -------------------------------------------------------------------------- """ -FILE: phone_number_area_codes_sample.py +FILE: release_phone_number_sample.py DESCRIPTION: - This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. + This sample demonstrates how to release a previously acquired phone number using your connection string. USAGE: - python list_acquired_phone_numbers_sample.py + python release_phone_number_sample.py Set the environment variables with your own values before running the sample: 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service - 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_RELEASE - The phone number you want to release + 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE - The phone number you want to release """ import os diff --git a/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py index cf4a580cb1c3..fa2375dd1f98 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py @@ -7,11 +7,11 @@ # -------------------------------------------------------------------------- """ -FILE: phone_number_area_codes_sample.py +FILE: search_available_phone_numbers_sample.py DESCRIPTION: - This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. + This sample demonstrates how to search for available numbers you can buy with the respective API. USAGE: - python list_acquired_phone_numbers_sample.py + python search_available_phone_numbers_sample.py Set the environment variables with your own values before running the sample: 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service 2) AZURE_COMMUNICATION_SERVICE_AREA_CODE - The area code you want the number to be in @@ -49,4 +49,4 @@ def search_available_phone_numbers(): if __name__ == '__main__': - list_acquired_phone_numbers() \ No newline at end of file + search_available_phone_numbers() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py new file mode 100644 index 000000000000..42e405e0fbd1 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- + +""" +FILE: update_phone_number_capabilities_sample.py +DESCRIPTION: + This sample demonstrates how to updtae the capabilities of a phone number using your connection string. +USAGE: + python update_phone_number_capabilities_sample.py + Set the environment variables with your own values before running the sample: + 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service + 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_UPDATE - The phone number you want to update +""" + +import os +from azure.communication.phonenumbers import ( + PhoneNumbersClient, + PhoneNumberCapabilityValue +) + +connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') +phone_number_to_release = os.getenv( + "AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_UPDATE" # e.g. "+18001234567" +) +phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) + +def update_phone_number_capabilities(): + poller = phone_numbers_client.begin_update_phone_number_capabilities( + "+18335260208", + PhoneNumberCapabilityValue.OUTBOUND, + PhoneNumberCapabilityValue.INBOUND_OUTBOUND, + polling = True + ) + poller.result() + print('Status of the operation:') + print(poller.status()) + +if __name__ == '__main__': + update_phone_number_capabilities() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index ca806e6bd46f..70678bfb02b5 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -15,6 +15,7 @@ def setUp(self): ResponseReplacerProcessor(keys=[self._resource_name])]) @AsyncCommunicationTestCase.await_prepared_test + @pytest.mark.live_test_only async def test_list_acquired_phone_numbers(self): async with self.phone_number_client: phone_numbers = self.phone_number_client.list_acquired_phone_numbers() @@ -24,69 +25,71 @@ async def test_list_acquired_phone_numbers(self): assert len(items) > 0 @AsyncCommunicationTestCase.await_prepared_test + @pytest.mark.live_test_only async def test_get_phone_number(self): async with self.phone_number_client: phone_number = await self.phone_number_client.get_phone_number("+18332272412") assert phone_number.phone_number == "+18332272412" - ''' - def test_update_phone_number(self): - updated_phone_number = self.phone_number_client.update_phone_number( - "+16194895842", - "", - "" - ) - assert updated_phone_number.application_id == "" @AsyncCommunicationTestCase.await_prepared_test + @pytest.mark.live_test_only async def test_release_phone_number(self): async with self.phone_number_client: poller = await self.phone_number_client.begin_release_phone_number("+16194895875") result = await poller.result() assert result - - def test_search_available_phone_numbers(self): + + @AsyncCommunicationTestCase.await_prepared_test + @pytest.mark.live_test_only + async def test_search_available_phone_numbers(self): capabilities = PhoneNumberCapabilities( calling = PhoneNumberCapabilityValue.INBOUND, sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND ) - poller = self.phone_number_client.begin_search_available_phone_numbers( - "US", - PhoneNumberType.TOLL_FREE, - PhoneNumberAssignmentType.APPLICATION, - capabilities, - "833", - 1, - polling = True - ) + async with self.phone_number_client: + poller = await self.phone_number_client.begin_search_available_phone_numbers( + "US", + PhoneNumberType.TOLL_FREE, + PhoneNumberAssignmentType.APPLICATION, + capabilities, + "833", + 1, + polling = True + ) assert poller.result() - def test_update_phone_number_capabilities(self): - poller = self.phone_number_client.begin_update_phone_number_capabilities( - "+16194895875", - PhoneNumberCapabilityValue.OUTBOUND, - PhoneNumberCapabilityValue.OUTBOUND, - polling = True - ) + @AsyncCommunicationTestCase.await_prepared_test + @pytest.mark.live_test_only + async def test_update_phone_number_capabilities(self): + async with self.phone_number_client: + poller = self.phone_number_client.begin_update_phone_number_capabilities( + "+16194895875", + PhoneNumberCapabilityValue.OUTBOUND, + PhoneNumberCapabilityValue.OUTBOUND, + polling = True + ) assert poller.result() - def test_purchase_phone_numbers(self): + @AsyncCommunicationTestCase.await_prepared_test + @pytest.mark.live_test_only + async def test_purchase_phone_numbers(self): capabilities = PhoneNumberCapabilities( calling = PhoneNumberCapabilityValue.INBOUND, sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND ) - search_poller = self.phone_number_client.begin_search_available_phone_numbers( - "US", - PhoneNumberType.TOLL_FREE, - PhoneNumberAssignmentType.APPLICATION, - capabilities, - "833", - 1, - polling = True - ) - phone_number_to_buy = search_poller.result() - purchase_poller = self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) - assert purchase_poller.result() - release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) + async with self.phone_number_client: + search_poller = await self.phone_number_client.begin_search_available_phone_numbers( + "US", + PhoneNumberType.TOLL_FREE, + PhoneNumberAssignmentType.APPLICATION, + capabilities, + "833", + 1, + polling = True + ) + phone_number_to_buy = search_poller.result() + purchase_poller = await self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) + assert purchase_poller.result() + release_poller = await self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) assert release_poller.status() == 'succeeded' - ''' \ No newline at end of file From d3f4e367b2f367d6e371c4ab3793a6f9f476583f Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Thu, 18 Feb 2021 11:46:31 -0600 Subject: [PATCH 10/32] Removed hardcoded info from tests --- ...test_phone_number_administration_client.py | 31 +++++++++++++------ ...hone_number_administration_client_async.py | 28 ++++++++++++----- 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index 5ba53c04693f..8dae36896b72 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -1,3 +1,4 @@ +import os import pytest from azure.communication.phonenumbers import PhoneNumbersClient from _shared.testcase import CommunicationTestCase, ResponseReplacerProcessor, BodyReplacerProcessor @@ -6,6 +7,16 @@ class NewTests(CommunicationTestCase): def setUp(self): super(NewTests, self).setUp() + if self.is_playback(): + self.phone_number = "+18000005555" + self.phone_number_to_release = "+18000005556" + self.country_code = "US" + self.area_code = "833" + else: + self.phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") + self.phone_number_to_release = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE") + self.country_code = os.getenv("AZURE_COMMUNICATION_SERVICE_COUNTRY_CODE") + self.area_code = os.getenv("AZURE_COMMUNICATION_SERIVCE_AREA_CODE") self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ BodyReplacerProcessor( @@ -20,12 +31,12 @@ def test_list_acquired_phone_numbers(self): @pytest.mark.live_test_only def test_get_phone_number(self): - phone_number = self.phone_number_client.get_phone_number("+18332272412") - assert phone_number.phone_number == "+18332272412" + phone_number = self.phone_number_client.get_phone_number(self.phone_number) + assert phone_number.phone_number == self.phone_number @pytest.mark.live_test_only def test_release_phone_number(self): - poller = self.phone_number_client.begin_release_phone_number("+16194895886") + poller = self.phone_number_client.begin_release_phone_number(self.phone_number_to_release) assert poller.status() == 'succeeded' @pytest.mark.live_test_only @@ -35,11 +46,11 @@ def test_search_available_phone_numbers(self): sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND ) poller = self.phone_number_client.begin_search_available_phone_numbers( - "US", + self.country_code, PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - "844", + self.area_code, polling = True ) assert poller.result() @@ -47,7 +58,7 @@ def test_search_available_phone_numbers(self): @pytest.mark.live_test_only def test_update_phone_number_capabilities(self): poller = self.phone_number_client.begin_update_phone_number_capabilities( - "+18335260208", + self.phone_number, PhoneNumberCapabilityValue.OUTBOUND, PhoneNumberCapabilityValue.INBOUND_OUTBOUND, polling = True @@ -61,16 +72,16 @@ def test_purchase_phone_numbers(self): sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND ) search_poller = self.phone_number_client.begin_search_available_phone_numbers( - "US", + self.country_code, PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - "844", + self.area_code, 1, polling = True ) phone_number_to_buy = search_poller.result() purchase_poller = self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) assert purchase_poller.result() - ##release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) - ##assert release_poller.status() == 'succeeded' + release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) + assert release_poller.status() == 'succeeded' diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index 70678bfb02b5..e9fbc6265524 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -1,3 +1,4 @@ +import os import pytest from azure.communication.phonenumbers.aio import PhoneNumbersClient from _shared.asynctestcase import AsyncCommunicationTestCase @@ -7,6 +8,17 @@ class NewTests(AsyncCommunicationTestCase): def setUp(self): super(NewTests, self).setUp() + if self.is_playback(): + self.phone_number = "+18000005555" + self.phone_number_to_release = "+18000005556" + self.country_code = "US" + self.area_code = "833" + else: + self.phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") + self.phone_number_to_release = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE") + self.country_code = os.getenv("AZURE_COMMUNICATION_SERVICE_COUNTRY_CODE") + self.area_code = os.getenv("AZURE_COMMUNICATION_SERIVCE_AREA_CODE") + self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ BodyReplacerProcessor( @@ -28,15 +40,15 @@ async def test_list_acquired_phone_numbers(self): @pytest.mark.live_test_only async def test_get_phone_number(self): async with self.phone_number_client: - phone_number = await self.phone_number_client.get_phone_number("+18332272412") - assert phone_number.phone_number == "+18332272412" + phone_number = await self.phone_number_client.get_phone_number(self.phone_number) + assert phone_number.phone_number == self.phone_number @AsyncCommunicationTestCase.await_prepared_test @pytest.mark.live_test_only async def test_release_phone_number(self): async with self.phone_number_client: - poller = await self.phone_number_client.begin_release_phone_number("+16194895875") + poller = await self.phone_number_client.begin_release_phone_number(self.phone_number_to_release) result = await poller.result() assert result @@ -49,11 +61,11 @@ async def test_search_available_phone_numbers(self): ) async with self.phone_number_client: poller = await self.phone_number_client.begin_search_available_phone_numbers( - "US", + self.country_code, PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - "833", + self.area_code, 1, polling = True ) @@ -64,7 +76,7 @@ async def test_search_available_phone_numbers(self): async def test_update_phone_number_capabilities(self): async with self.phone_number_client: poller = self.phone_number_client.begin_update_phone_number_capabilities( - "+16194895875", + self.phone_number, PhoneNumberCapabilityValue.OUTBOUND, PhoneNumberCapabilityValue.OUTBOUND, polling = True @@ -80,11 +92,11 @@ async def test_purchase_phone_numbers(self): ) async with self.phone_number_client: search_poller = await self.phone_number_client.begin_search_available_phone_numbers( - "US", + self.country_code, PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - "833", + self.area_code, 1, polling = True ) From 64adb443f76ddc2c3015bf53e56edb7538b24aa8 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Mon, 22 Feb 2021 13:35:01 -0600 Subject: [PATCH 11/32] Added managed identity tests and addressed apiview comments --- .../phonenumbers/_phone_numbers_client.py | 13 ++++++------- .../aio/_phone_numbers_client_async.py | 19 +++++++++---------- .../test/_shared/fake_token_credential.py | 14 ++++++++++++++ ...test_phone_number_administration_client.py | 12 +++++++++++- ...hone_number_administration_client_async.py | 18 ++++++++++++++++-- 5 files changed, 56 insertions(+), 20 deletions(-) create mode 100644 sdk/communication/azure-communication-phonenumbers/test/_shared/fake_token_credential.py diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py index 2b21a7c873c8..6d940af25a50 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py @@ -47,7 +47,7 @@ def from_connection_string( :param str conn_str: A connection string to an Azure Communication Service resource. :returns: Instance of PhoneNumbersClient. - :rtype: ~azure.communication.PhoneNumbersClient + :rtype: ~azure.communication.phonenumbers.PhoneNumbersClient """ endpoint, access_key = parse_connection_str(conn_str) @@ -109,8 +109,7 @@ def begin_search_available_phone_numbers( phone_number_type, # type: str assignment_type, # type: str capabilities, # type: PhoneNumberCapabilities - area_code, # type: str - quantity=1, # type: int + quantity=None, # type: int **kwargs # type: Any ): # type: (...) -> LROPoller[PhoneNumberSearchResult] @@ -128,10 +127,10 @@ def begin_search_available_phone_numbers( ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param capabilities: Required. Capabilities of a phone number. :type capabilities: ~azure.communication.phonenumbers.models.PhoneNumberCapabilities - :param area_code: The area code of the desired phone number, e.g. 425. - :type area_code: str :param quantity: The quantity of phone numbers in the search. Should be at least 1. :type quantity: int + :keyword str area_code: The area code of the desired phone number, e.g. 425. If not set, + any area code could be used in the final search. :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. @@ -144,8 +143,8 @@ def begin_search_available_phone_numbers( phone_number_type=phone_number_type, assignment_type=assignment_type, capabilities=capabilities, - area_code=area_code, - quantity=quantity + quantity=quantity, + area_code=kwargs.pop('area_code', None) ) return self._phone_number_client.phone_numbers.begin_search_available_phone_numbers( country_code, diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py index 9074fbcf86a1..3fcabfa58022 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py @@ -43,12 +43,12 @@ def from_connection_string( cls, conn_str, # type: str **kwargs # type: Any ): - # type: (...) -> PhoneNumbersAdministrationClient - """Create PhoneNumbersAdministrationClient from a Connection String. + # type: (...) -> PhoneNumbersClient + """Create PhoneNumbersClient from a Connection String. :param str conn_str: A connection string to an Azure Communication Service resource. - :returns: Instance of PhoneNumbersAdministrationClient. - :rtype: ~azure.communication.PhoneNumbersAdministrationClient + :returns: Instance of PhoneNumbersClient. + :rtype: ~azure.communication.phonenumbers.aio.PhoneNumbersClient """ endpoint, access_key = parse_connection_str(conn_str) @@ -110,8 +110,7 @@ async def begin_search_available_phone_numbers( phone_number_type, # type: str assignment_type, # type: str capabilities, - area_code, # type: str - quantity=1, # type: int + quantity=None, # type: int **kwargs ): # type: (...) -> AsyncLROPoller[PhoneNumberSearchResult] @@ -129,10 +128,10 @@ async def begin_search_available_phone_numbers( ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param capabilities: Required. Capabilities of a phone number. :type capabilities: ~azure.communication.phonenumbers.models.PhoneNumberCapabilities - :param area_code: The area code of the desired phone number, e.g. 425. - :type area_code: str :param quantity: The quantity of phone numbers in the search. Should be at least 1. :type quantity: int + :keyword str area_code: The area code of the desired phone number, e.g. 425. If not set, + any area code could be used in the final search. :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. @@ -145,8 +144,8 @@ async def begin_search_available_phone_numbers( phone_number_type=phone_number_type, assignment_type=assignment_type, capabilities=capabilities, - area_code=area_code, - quantity=quantity + quantity=quantity, + area_code=kwargs.pop('area_code', None) ) return await self._phone_number_client.phone_numbers.begin_search_available_phone_numbers( country_code, diff --git a/sdk/communication/azure-communication-phonenumbers/test/_shared/fake_token_credential.py b/sdk/communication/azure-communication-phonenumbers/test/_shared/fake_token_credential.py new file mode 100644 index 000000000000..eac266e8ed5c --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/_shared/fake_token_credential.py @@ -0,0 +1,14 @@ + +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +from azure.core.credentials import AccessToken + +class FakeTokenCredential(object): + def __init__(self): + self.token = AccessToken("Fake Token", 0) + + def get_token(self, *args): + return self.token diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index 8dae36896b72..9c06964efc8f 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -2,7 +2,9 @@ import pytest from azure.communication.phonenumbers import PhoneNumbersClient from _shared.testcase import CommunicationTestCase, ResponseReplacerProcessor, BodyReplacerProcessor +from _shared.utils import create_token_credential from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType +from azure.communication.phonenumbers._shared.utils import parse_connection_str class NewTests(CommunicationTestCase): def setUp(self): @@ -24,6 +26,14 @@ def setUp(self): ), ResponseReplacerProcessor(keys=[self._resource_name])]) + @pytest.mark.live_test_only + def test_list_all_phone_numbers_from_managed_identity(self): + endpoint, access_key = parse_connection_str(self.connection_str) + credential = create_token_credential() + phone_number_client = PhoneNumbersClient(endpoint, credential) + phone_numbers = phone_number_client.list_all_phone_numbers() + assert phone_numbers.next() + @pytest.mark.live_test_only def test_list_acquired_phone_numbers(self): phone_numbers = self.phone_number_client.list_acquired_phone_numbers() @@ -50,7 +60,7 @@ def test_search_available_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - self.area_code, + area_code=self.area_code, polling = True ) assert poller.result() diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index e9fbc6265524..be52dfa93774 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -3,7 +3,9 @@ from azure.communication.phonenumbers.aio import PhoneNumbersClient from _shared.asynctestcase import AsyncCommunicationTestCase from _shared.testcase import ResponseReplacerProcessor, BodyReplacerProcessor +from _shared.utils import create_token_credential from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType +from azure.communication.phonenumbers._shared.utils import parse_connection_str class NewTests(AsyncCommunicationTestCase): def setUp(self): @@ -26,6 +28,19 @@ def setUp(self): ), ResponseReplacerProcessor(keys=[self._resource_name])]) + @AsyncCommunicationTestCase.await_prepared_test + @pytest.mark.live_test_only + def test_list_all_phone_numbers_from_managed_identity(self): + endpoint, access_key = parse_connection_str(self.connection_str) + credential = create_token_credential() + phone_number_client = PhoneNumbersClient(endpoint, credential) + async with self.phone_number_client: + phone_numbers = phone_number_client.list_acquired_phone_numbers() + items = [] + async for item in phone_numbers: + items.append(item) + assert len(items) > 0 + @AsyncCommunicationTestCase.await_prepared_test @pytest.mark.live_test_only async def test_list_acquired_phone_numbers(self): @@ -65,8 +80,7 @@ async def test_search_available_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - self.area_code, - 1, + area_code=self.area_code, polling = True ) assert poller.result() From b4591fb7777771d1ad187459a436e2ac8c0bb5a6 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Mon, 22 Feb 2021 13:55:49 -0600 Subject: [PATCH 12/32] Addressed comments --- .../samples/get_phone_number_sample.py | 4 +- .../samples/purchase_phone_number_sample.py | 3 +- .../samples/release_phone_number_sample.py | 2 +- .../search_available_phone_numbers_sample.py | 3 +- ...update_phone_number_capabilities_sample.py | 3 +- .../setup.cfg | 2 +- .../test/_shared/{utills.py => utils.py} | 0 ...stration_client.test_get_phone_number.yaml | 16 +-- ...on_client.test_purchase_phone_numbers.yaml | 45 ------- ...t.test_search_available_phone_numbers.yaml | 87 ------------ ...test_update_phone_number_capabilities.yaml | 124 ------------------ ...sync.test_list_acquired_phone_numbers.yaml | 74 ++++------- ...lient_async.test_release_phone_number.yaml | 29 ---- ...test_phone_number_administration_client.py | 2 +- ...hone_number_administration_client_async.py | 2 +- 15 files changed, 41 insertions(+), 355 deletions(-) rename sdk/communication/azure-communication-phonenumbers/test/_shared/{utills.py => utils.py} (100%) delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_number.yaml diff --git a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py index 6383d237e393..5493fce13d1b 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py @@ -28,9 +28,7 @@ def get_phone_number_information(): phone_number_information = phone_numbers_client.get_phone_number(phone_number) - print('Phone number information:') - print(phone_number_information) - + print('Phone number information: ' + phone_number_information) if __name__ == '__main__': get_phone_number_information() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py index 874a14ef77f0..4dd31c67bda4 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py @@ -32,8 +32,7 @@ def purchase_phone_number(): polling = True ) poller.result() - print("Result from the purchase operation: ") - print(poller.status) + print("Result from the purchase operation: " + poller.status) if __name__ == '__main__': diff --git a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py index 394807c8f55c..82fb122548df 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py @@ -31,7 +31,7 @@ def release_phone_number(): poller = phone_numbers_client.begin_release_phone_number(phone_number_to_release) poller.result() - print('Status of the operation:') + print('Status of the operation: ' + poller.status) print(poller.status()) diff --git a/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py index fa2375dd1f98..91291cf7e4cb 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py @@ -44,8 +44,7 @@ def search_available_phone_numbers(): 1, polling = True ) - print('Acquired phone numbers:') - print(poller.result) + print('Acquired phone numbers: ' + poller.result) if __name__ == '__main__': diff --git a/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py index 42e405e0fbd1..c6a7a5259743 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py @@ -37,8 +37,7 @@ def update_phone_number_capabilities(): polling = True ) poller.result() - print('Status of the operation:') - print(poller.status()) + print('Status of the operation: ' + poller.status()) if __name__ == '__main__': update_phone_number_capabilities() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/setup.cfg b/sdk/communication/azure-communication-phonenumbers/setup.cfg index 1d45b470b8ab..3480374bc2f2 100644 --- a/sdk/communication/azure-communication-phonenumbers/setup.cfg +++ b/sdk/communication/azure-communication-phonenumbers/setup.cfg @@ -1,2 +1,2 @@ [bdist_wheel] -universal=1 \ No newline at end of file +universal=1 \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/test/_shared/utills.py b/sdk/communication/azure-communication-phonenumbers/test/_shared/utils.py similarity index 100% rename from sdk/communication/azure-communication-phonenumbers/test/_shared/utills.py rename to sdk/communication/azure-communication-phonenumbers/test/_shared/utils.py diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml index c97ebaeea9e7..8133e743555a 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml @@ -9,31 +9,31 @@ interactions: Connection: - keep-alive Date: - - Tue, 16 Feb 2021 19:42:45 GMT + - Mon, 22 Feb 2021 19:48:24 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272412?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18335260208?api-version=2021-03-07 response: body: - string: '{"id": "18332272412", "phoneNumber": "+18332272412", "countryCode": - "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", - "sms": "inbound+outbound"}, "assignmentType": "Application"}' + string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", + "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound+outbound", + "sms": "outbound"}, "assignmentType": "Application"}' headers: content-type: - application/json; charset=utf-8 date: - - Tue, 16 Feb 2021 19:42:46 GMT + - Mon, 22 Feb 2021 19:48:23 GMT ms-cv: - - Npb2F6HCHUCS3PCMa+LVKA.0 + - KQDB5Gt5/EiYmdjzTHoodQ.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 810ms + - 847ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml deleted file mode 100644 index 21449229dadc..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml +++ /dev/null @@ -1,45 +0,0 @@ -interactions: -- request: - body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": - {"calling": "inbound", "sms": "inbound+outbound"}, "areaCode": "844", "quantity": - 1}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '165' - Content-Type: - - application/json - Date: - - Mon, 15 Feb 2021 16:48:55 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 - response: - body: - string: '{"error": {"code": "InvalidInput", "message": "We are unable to find - phone plans to match your requested capabilities.", "target": "areacode"}}' - headers: - content-type: - - application/json - date: - - Mon, 15 Feb 2021 16:48:53 GMT - ms-cv: - - 2YSqApoKaEOE7TviEFBpMA.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 777ms - status: - code: 400 - message: Bad Request -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml deleted file mode 100644 index c0e337ffded5..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml +++ /dev/null @@ -1,87 +0,0 @@ -interactions: -- request: - body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": - {"calling": "inbound", "sms": "inbound+outbound"}, "areaCode": "844", "quantity": - 1}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '165' - Content-Type: - - application/json - Date: - - Tue, 16 Feb 2021 18:40:28 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Tue, 16 Feb 2021 18:40:27 GMT - ms-cv: - - m3sIDXIbBkWugK33dLdtTQ.0 - operation-id: - - search_6e059e43-dded-43ca-9740-65ec3047e551 - operation-location: - - /phoneNumbers/operations/search_6e059e43-dded-43ca-9740-65ec3047e551?api-version=2021-03-07 - request-context: - - appId= - search-id: - - 6e059e43-dded-43ca-9740-65ec3047e551 - x-processing-time: - - 1563ms - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Tue, 16 Feb 2021 18:41:00 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_6e059e43-dded-43ca-9740-65ec3047e551?api-version=2021-03-07 - response: - body: - string: '{"status": "Failed", "resourceLocation": null, "createdDateTime": "2021-02-16T18:40:27.7542139+00:00", - "error": {"code": "OutOfStock", "message": "Error 1000: Not enough stock to - fulfill search request."}, "id": "search_6e059e43-dded-43ca-9740-65ec3047e551", - "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Tue, 16 Feb 2021 18:41:00 GMT - ms-cv: - - sfe/kkZvskqwyUmS3r7wxw.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 2654ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml deleted file mode 100644 index e855d7af1d31..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml +++ /dev/null @@ -1,124 +0,0 @@ -interactions: -- request: - body: '{"calling": "inbound+outbound", "sms": "outbound"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '50' - Content-Type: - - application/merge-patch+json - Date: - - Tue, 16 Feb 2021 19:21:29 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: PATCH - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18335260208/capabilities?api-version=2021-03-07 - response: - body: - string: '{"capabilitiesUpdateId": "404951bf-440b-4ff3-938c-43cbcdc62f91"}' - headers: - capabilities-id: - - 404951bf-440b-4ff3-938c-43cbcdc62f91 - content-type: - - application/json; charset=utf-8 - date: - - Tue, 16 Feb 2021 19:21:31 GMT - ms-cv: - - dBNwCvx0C0Cx7bVqcZdyZQ.0 - operation-id: - - capabilities_404951bf-440b-4ff3-938c-43cbcdc62f91 - operation-location: - - /phoneNumbers/operations/capabilities_404951bf-440b-4ff3-938c-43cbcdc62f91?api-version=2021-03-07 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 1267ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Tue, 16 Feb 2021 19:22:01 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/capabilities_404951bf-440b-4ff3-938c-43cbcdc62f91?api-version=2021-03-07 - response: - body: - string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": - "2021-02-16T19:21:30.6218852+00:00", "id": "capabilities_404951bf-440b-4ff3-938c-43cbcdc62f91", - "operationType": "UpdatePhoneNumberCapabilities", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Tue, 16 Feb 2021 19:22:01 GMT - ms-cv: - - 9I1ueyxoaUaH5olBCjvHnQ.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 642ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Tue, 16 Feb 2021 19:22:02 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18335260208/capabilities?api-version=2021-03-07 - response: - body: - string: '{"error": {"code": "UnsupportedApiVersion", "message": "The HTTP resource - that matches the request URI ''https://sanitized.communication.azure.com/phoneNumbers/+18335260208/capabilities'' - does not support the API version ''2021-03-07''.", "innerError": null}}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Tue, 16 Feb 2021 19:22:01 GMT - ms-cv: - - mUgwWEP7I0SD1ghOfm4l4g.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 10ms - status: - code: 400 - message: Bad Request -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml index a9fd1c3502b3..c0d7daac80a7 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml @@ -5,7 +5,7 @@ interactions: Accept: - application/json Date: - - Tue, 16 Feb 2021 19:45:32 GMT + - Mon, 22 Feb 2021 19:49:31 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -14,58 +14,34 @@ interactions: uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 response: body: - string: '{"phoneNumbers": [{"id": "16194895875", "phoneNumber": "+16194895875", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "Person"}, {"id": "16194895877", - "phoneNumber": "+16194895877", "countryCode": "US", "phoneNumberType": "Geographic", - "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": - "Person"}, {"id": "16194895878", "phoneNumber": "+16194895878", "countryCode": - "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "Person"}, {"id": "16194895879", "phoneNumber": - "+16194895879", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": - {"calling": "outbound", "sms": "none"}, "assignmentType": "Person"}, {"id": - "16194895880", "phoneNumber": "+16194895880", "countryCode": "US", "phoneNumberType": - "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": - "Person"}, {"id": "16194895882", "phoneNumber": "+16194895882", "countryCode": - "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "Person"}, {"id": "16194895885", "phoneNumber": - "+16194895885", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": - {"calling": "outbound", "sms": "none"}, "assignmentType": "Person"}, {"id": - "16194895887", "phoneNumber": "+16194895887", "countryCode": "US", "phoneNumberType": - "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": - "Person"}, {"id": "16194895889", "phoneNumber": "+16194895889", "countryCode": - "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "Person"}, {"id": "18332271680", "phoneNumber": - "+18332271680", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": - {"calling": "none", "sms": "outbound"}, "assignmentType": "Application"}, - {"id": "18332272412", "phoneNumber": "+18332272412", "countryCode": "US", - "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": - "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332272430", - "phoneNumber": "+18332272430", "countryCode": "US", "phoneNumberType": "TollFree", - "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": - "Application"}, {"id": "18332272445", "phoneNumber": "+18332272445", "countryCode": - "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", - "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332321209", - "phoneNumber": "+18332321209", "countryCode": "US", "phoneNumberType": "TollFree", - "capabilities": {"calling": "none", "sms": "inbound+outbound"}, "assignmentType": - "Application"}, {"id": "18332321221", "phoneNumber": "+18332321221", "countryCode": - "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "none", "sms": - "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332321226", - "phoneNumber": "+18332321226", "countryCode": "US", "phoneNumberType": "TollFree", - "capabilities": {"calling": "none", "sms": "inbound+outbound"}, "assignmentType": - "Application"}, {"id": "18335260208", "phoneNumber": "+18335260208", "countryCode": - "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound+outbound", - "sms": "outbound"}, "assignmentType": "Application"}, {"id": "18336369501", - "phoneNumber": "+18336369501", "countryCode": "US", "phoneNumberType": "TollFree", - "capabilities": {"calling": "inbound+outbound", "sms": "none"}, "assignmentType": - "Application"}]}' + string: '{"phoneNumbers": [{"id": "18332272412", "phoneNumber": "+18332272412", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": + "18332272430", "phoneNumber": "+18332272430", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, + "assignmentType": "Application"}, {"id": "18332272445", "phoneNumber": "+18332272445", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": + "18332321209", "phoneNumber": "+18332321209", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "assignmentType": "Application"}, {"id": "18332321221", "phoneNumber": "+18332321221", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "none", "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": + "18332321226", "phoneNumber": "+18332321226", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "assignmentType": "Application"}, {"id": "18335260208", "phoneNumber": "+18335260208", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "inbound+outbound", "sms": "outbound"}, "assignmentType": "Application"}, + {"id": "18336369501", "phoneNumber": "+18336369501", "countryCode": "US", + "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound+outbound", + "sms": "none"}, "assignmentType": "Application"}]}' headers: content-type: application/json; charset=utf-8 - date: Tue, 16 Feb 2021 19:45:33 GMT - ms-cv: 64fjFm+18EKAQ/UkeQyQuQ.0 + date: Mon, 22 Feb 2021 19:49:29 GMT + ms-cv: gR+k7FVMNkWEuGWjsZ5mUg.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 908ms + x-processing-time: 930ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_number.yaml deleted file mode 100644 index 2ebeaaaf4371..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_number.yaml +++ /dev/null @@ -1,29 +0,0 @@ -interactions: -- request: - body: '' - headers: - Accept: - - application/json - Date: - - Thu, 11 Feb 2021 19:16:56 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: DELETE - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 - response: - body: - string: '{"error": {"code": "Denied", "message": "Denied by the resource provider."}}' - headers: - content-type: application/json - date: Thu, 11 Feb 2021 19:16:58 GMT - ms-cv: GAxbDJ8Kuk6pDjdEn5+mxA.0 - request-context: appId= - transfer-encoding: chunked - x-processing-time: 158ms - status: - code: 401 - message: Unauthorized - url: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index 9c06964efc8f..f1ef28edc973 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -22,7 +22,7 @@ def setUp(self): self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ BodyReplacerProcessor( - keys=[] + keys=["id", "token", "phoneNumber", "phonenumbers"] ), ResponseReplacerProcessor(keys=[self._resource_name])]) diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index be52dfa93774..a602a2c118f8 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -30,7 +30,7 @@ def setUp(self): @AsyncCommunicationTestCase.await_prepared_test @pytest.mark.live_test_only - def test_list_all_phone_numbers_from_managed_identity(self): + async def test_list_all_phone_numbers_from_managed_identity(self): endpoint, access_key = parse_connection_str(self.connection_str) credential = create_token_credential() phone_number_client = PhoneNumbersClient(endpoint, credential) From 0bc5cd27477802a6d1f2858601c343d700a80b2d Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Thu, 25 Feb 2021 13:55:20 -0600 Subject: [PATCH 13/32] Regenerated code and addressed comments --- .../operations/_phone_numbers_operations.py | 44 +++++++------------ .../_generated/models/__init__.py | 4 +- .../phonenumbers/_generated/models/_models.py | 18 ++++---- .../_generated/models/_models_py3.py | 26 ++++++----- .../models/_phone_numbers_client_enums.py | 2 +- .../operations/_phone_numbers_operations.py | 44 +++++++------------ .../list_acquired_phone_numbers_sample.py | 2 +- .../samples/purchase_phone_number_sample.py | 2 +- .../samples/release_phone_number_sample.py | 4 +- .../search_available_phone_numbers_sample.py | 8 ++-- ...update_phone_number_capabilities_sample.py | 6 +-- .../swagger/PHONE_NUMBER_SWAGGER.md | 2 +- ...test_phone_number_administration_client.py | 14 +++--- ...hone_number_administration_client_async.py | 14 +++--- 14 files changed, 84 insertions(+), 106 deletions(-) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py index beda99f1524d..8bcfc898be2c 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py @@ -234,8 +234,8 @@ async def _purchase_phone_numbers_initial( self, search_id: Optional[str] = None, **kwargs - ) -> "_models.PhoneNumberSearchResult": - cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberSearchResult"] + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -275,23 +275,20 @@ async def _purchase_phone_numbers_initial( raise HttpResponseError(response=response, model=error) response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) - deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, None, response_headers) - return deserialized _purchase_phone_numbers_initial.metadata = {'url': '/availablePhoneNumbers/:purchase'} # type: ignore async def begin_purchase_phone_numbers( self, search_id: Optional[str] = None, **kwargs - ) -> AsyncLROPoller["_models.PhoneNumberSearchResult"]: + ) -> AsyncLROPoller[None]: """Purchases phone numbers. Purchases phone numbers. @@ -304,12 +301,12 @@ async def begin_purchase_phone_numbers( False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PhoneNumberSearchResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.communication.phonenumbers.models.PhoneNumberSearchResult] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', False) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberSearchResult"] + cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -326,23 +323,14 @@ async def begin_purchase_phone_numbers( kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) - response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) - response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) - deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, response_headers) - return deserialized + return cls(pipeline_response, None, {}) path_format_arguments = { 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - if polling is True: polling_method = AsyncLROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -622,7 +610,7 @@ def get_long_running_output(pipeline_response): 'phoneNumber': self._serialize.url("phone_number", phone_number, 'str'), } - if polling is True: polling_method = AsyncLROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = AsyncLROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -724,8 +712,8 @@ async def get_next(next_link=None): async def _update_capabilities_initial( self, phone_number: str, - calling: Optional[Union[str, "_models.PhoneNumberCapabilityValue"]] = None, - sms: Optional[Union[str, "_models.PhoneNumberCapabilityValue"]] = None, + calling: Optional[Union[str, "_models.PhoneNumberCapabilityType"]] = None, + sms: Optional[Union[str, "_models.PhoneNumberCapabilityType"]] = None, **kwargs ) -> "_models.AcquiredPhoneNumber": cls = kwargs.pop('cls', None) # type: ClsType["_models.AcquiredPhoneNumber"] @@ -787,8 +775,8 @@ async def _update_capabilities_initial( async def begin_update_capabilities( self, phone_number: str, - calling: Optional[Union[str, "_models.PhoneNumberCapabilityValue"]] = None, - sms: Optional[Union[str, "_models.PhoneNumberCapabilityValue"]] = None, + calling: Optional[Union[str, "_models.PhoneNumberCapabilityType"]] = None, + sms: Optional[Union[str, "_models.PhoneNumberCapabilityType"]] = None, **kwargs ) -> AsyncLROPoller["_models.AcquiredPhoneNumber"]: """Updates the capabilities of a phone number. @@ -799,9 +787,9 @@ async def begin_update_capabilities( encoded as %2B, e.g. +11234567890. :type phone_number: str :param calling: Capability value for calling. - :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType :param sms: Capability value for SMS. - :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the AsyncLROBasePolling polling method, diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/__init__.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/__init__.py index 9987d1833c94..8884e4f716cc 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/__init__.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/__init__.py @@ -34,7 +34,7 @@ from ._phone_numbers_client_enums import ( BillingFrequency, PhoneNumberAssignmentType, - PhoneNumberCapabilityValue, + PhoneNumberCapabilityType, PhoneNumberOperationStatus, PhoneNumberOperationType, PhoneNumberType, @@ -54,7 +54,7 @@ 'PhoneNumberSearchResult', 'BillingFrequency', 'PhoneNumberAssignmentType', - 'PhoneNumberCapabilityValue', + 'PhoneNumberCapabilityType', 'PhoneNumberOperationStatus', 'PhoneNumberOperationType', 'PhoneNumberType', diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py index 53369550c4ea..2f56422efbef 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py @@ -32,9 +32,9 @@ class AcquiredPhoneNumber(msrest.serialization.Model): "application". :type assignment_type: str or ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType - :param purchase_date: The date and time that the phone number was purchased. + :param purchase_date: Required. The date and time that the phone number was purchased. :type purchase_date: ~datetime.datetime - :param cost: The incurred cost for a single phone number. + :param cost: Required. The incurred cost for a single phone number. :type cost: ~azure.communication.phonenumbers.models.PhoneNumberCost """ @@ -45,6 +45,8 @@ class AcquiredPhoneNumber(msrest.serialization.Model): 'phone_number_type': {'required': True}, 'capabilities': {'required': True}, 'assignment_type': {'required': True}, + 'purchase_date': {'required': True}, + 'cost': {'required': True}, } _attribute_map = { @@ -69,8 +71,8 @@ def __init__( self.phone_number_type = kwargs['phone_number_type'] self.capabilities = kwargs['capabilities'] self.assignment_type = kwargs['assignment_type'] - self.purchase_date = kwargs.get('purchase_date', None) - self.cost = kwargs.get('cost', None) + self.purchase_date = kwargs['purchase_date'] + self.cost = kwargs['cost'] class AcquiredPhoneNumbers(msrest.serialization.Model): @@ -181,10 +183,10 @@ class PhoneNumberCapabilities(msrest.serialization.Model): :param calling: Required. Capability value for calling. Possible values include: "none", "inbound", "outbound", "inbound+outbound". - :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType :param sms: Required. Capability value for SMS. Possible values include: "none", "inbound", "outbound", "inbound+outbound". - :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType """ _validation = { @@ -211,10 +213,10 @@ class PhoneNumberCapabilitiesRequest(msrest.serialization.Model): :param calling: Capability value for calling. Possible values include: "none", "inbound", "outbound", "inbound+outbound". - :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType :param sms: Capability value for SMS. Possible values include: "none", "inbound", "outbound", "inbound+outbound". - :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType """ _attribute_map = { diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py index 3e9b269dce59..7c9e3386983b 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py @@ -37,9 +37,9 @@ class AcquiredPhoneNumber(msrest.serialization.Model): "application". :type assignment_type: str or ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType - :param purchase_date: The date and time that the phone number was purchased. + :param purchase_date: Required. The date and time that the phone number was purchased. :type purchase_date: ~datetime.datetime - :param cost: The incurred cost for a single phone number. + :param cost: Required. The incurred cost for a single phone number. :type cost: ~azure.communication.phonenumbers.models.PhoneNumberCost """ @@ -50,6 +50,8 @@ class AcquiredPhoneNumber(msrest.serialization.Model): 'phone_number_type': {'required': True}, 'capabilities': {'required': True}, 'assignment_type': {'required': True}, + 'purchase_date': {'required': True}, + 'cost': {'required': True}, } _attribute_map = { @@ -72,8 +74,8 @@ def __init__( phone_number_type: Union[str, "PhoneNumberType"], capabilities: "PhoneNumberCapabilities", assignment_type: Union[str, "PhoneNumberAssignmentType"], - purchase_date: Optional[datetime.datetime] = None, - cost: Optional["PhoneNumberCost"] = None, + purchase_date: datetime.datetime, + cost: "PhoneNumberCost", **kwargs ): super(AcquiredPhoneNumber, self).__init__(**kwargs) @@ -203,10 +205,10 @@ class PhoneNumberCapabilities(msrest.serialization.Model): :param calling: Required. Capability value for calling. Possible values include: "none", "inbound", "outbound", "inbound+outbound". - :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType :param sms: Required. Capability value for SMS. Possible values include: "none", "inbound", "outbound", "inbound+outbound". - :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType """ _validation = { @@ -222,8 +224,8 @@ class PhoneNumberCapabilities(msrest.serialization.Model): def __init__( self, *, - calling: Union[str, "PhoneNumberCapabilityValue"], - sms: Union[str, "PhoneNumberCapabilityValue"], + calling: Union[str, "PhoneNumberCapabilityType"], + sms: Union[str, "PhoneNumberCapabilityType"], **kwargs ): super(PhoneNumberCapabilities, self).__init__(**kwargs) @@ -236,10 +238,10 @@ class PhoneNumberCapabilitiesRequest(msrest.serialization.Model): :param calling: Capability value for calling. Possible values include: "none", "inbound", "outbound", "inbound+outbound". - :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType :param sms: Capability value for SMS. Possible values include: "none", "inbound", "outbound", "inbound+outbound". - :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType """ _attribute_map = { @@ -250,8 +252,8 @@ class PhoneNumberCapabilitiesRequest(msrest.serialization.Model): def __init__( self, *, - calling: Optional[Union[str, "PhoneNumberCapabilityValue"]] = None, - sms: Optional[Union[str, "PhoneNumberCapabilityValue"]] = None, + calling: Optional[Union[str, "PhoneNumberCapabilityType"]] = None, + sms: Optional[Union[str, "PhoneNumberCapabilityType"]] = None, **kwargs ): super(PhoneNumberCapabilitiesRequest, self).__init__(**kwargs) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_phone_numbers_client_enums.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_phone_numbers_client_enums.py index 3b41401e911c..3e1c41cf5626 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_phone_numbers_client_enums.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_phone_numbers_client_enums.py @@ -40,7 +40,7 @@ class PhoneNumberAssignmentType(with_metaclass(_CaseInsensitiveEnumMeta, str, En PERSON = "person" APPLICATION = "application" -class PhoneNumberCapabilityValue(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class PhoneNumberCapabilityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Capability value for calling. """ diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py index e7fc51ae0c84..9c38f1c39bf1 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py @@ -242,8 +242,8 @@ def _purchase_phone_numbers_initial( search_id=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> "_models.PhoneNumberSearchResult" - cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberSearchResult"] + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -283,16 +283,13 @@ def _purchase_phone_numbers_initial( raise HttpResponseError(response=response, model=error) response_headers = {} - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) - deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) if cls: - return cls(pipeline_response, deserialized, response_headers) + return cls(pipeline_response, None, response_headers) - return deserialized _purchase_phone_numbers_initial.metadata = {'url': '/availablePhoneNumbers/:purchase'} # type: ignore def begin_purchase_phone_numbers( @@ -300,7 +297,7 @@ def begin_purchase_phone_numbers( search_id=None, # type: Optional[str] **kwargs # type: Any ): - # type: (...) -> LROPoller["_models.PhoneNumberSearchResult"] + # type: (...) -> LROPoller[None] """Purchases phone numbers. Purchases phone numbers. @@ -313,12 +310,12 @@ def begin_purchase_phone_numbers( False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either PhoneNumberSearchResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.communication.phonenumbers.models.PhoneNumberSearchResult] + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', False) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PhoneNumberSearchResult"] + cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -335,23 +332,14 @@ def begin_purchase_phone_numbers( kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) - response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) - response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) - deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, response_headers) - return deserialized + return cls(pipeline_response, None, {}) path_format_arguments = { 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), } - if polling is True: polling_method = LROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -636,7 +624,7 @@ def get_long_running_output(pipeline_response): 'phoneNumber': self._serialize.url("phone_number", phone_number, 'str'), } - if polling is True: polling_method = LROBasePolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) + if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -739,8 +727,8 @@ def get_next(next_link=None): def _update_capabilities_initial( self, phone_number, # type: str - calling=None, # type: Optional[Union[str, "_models.PhoneNumberCapabilityValue"]] - sms=None, # type: Optional[Union[str, "_models.PhoneNumberCapabilityValue"]] + calling=None, # type: Optional[Union[str, "_models.PhoneNumberCapabilityType"]] + sms=None, # type: Optional[Union[str, "_models.PhoneNumberCapabilityType"]] **kwargs # type: Any ): # type: (...) -> "_models.AcquiredPhoneNumber" @@ -803,8 +791,8 @@ def _update_capabilities_initial( def begin_update_capabilities( self, phone_number, # type: str - calling=None, # type: Optional[Union[str, "_models.PhoneNumberCapabilityValue"]] - sms=None, # type: Optional[Union[str, "_models.PhoneNumberCapabilityValue"]] + calling=None, # type: Optional[Union[str, "_models.PhoneNumberCapabilityType"]] + sms=None, # type: Optional[Union[str, "_models.PhoneNumberCapabilityType"]] **kwargs # type: Any ): # type: (...) -> LROPoller["_models.AcquiredPhoneNumber"] @@ -816,9 +804,9 @@ def begin_update_capabilities( encoded as %2B, e.g. +11234567890. :type phone_number: str :param calling: Capability value for calling. - :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType :param sms: Capability value for SMS. - :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the LROBasePolling polling method, diff --git a/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py index 8e109c5bd074..34dbfe415cf9 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py @@ -28,7 +28,7 @@ def list_acquired_phone_numbers(): acquired_phone_numbers = phone_numbers_client.list_acquired_phone_numbers() print('Acquired phone numbers:') for acquired_phone_number in acquired_phone_numbers: - print(acquired_phone_number) + print(acquired_phone_number.phone_number) if __name__ == '__main__': diff --git a/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py index 4dd31c67bda4..a52bae6d167b 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py @@ -32,7 +32,7 @@ def purchase_phone_number(): polling = True ) poller.result() - print("Result from the purchase operation: " + poller.status) + print("Result from the purchase operation: " + poller.status()) if __name__ == '__main__': diff --git a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py index 82fb122548df..4f99c63bb6b7 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py @@ -31,9 +31,7 @@ def release_phone_number(): poller = phone_numbers_client.begin_release_phone_number(phone_number_to_release) poller.result() - print('Status of the operation: ' + poller.status) - print(poller.status()) - + print('Status of the operation: ' + poller.status()) if __name__ == '__main__': release_phone_number() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py index 91291cf7e4cb..0731b9e474e0 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py @@ -23,7 +23,7 @@ PhoneNumberType, PhoneNumberAssignmentType, PhoneNumberCapabilities, - PhoneNumberCapabilityValue + PhoneNumberCapabilityType ) connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') @@ -32,8 +32,8 @@ def search_available_phone_numbers(): capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityValue.INBOUND, - sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + calling = PhoneNumberCapabilityType.INBOUND, + sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND ) poller = phone_numbers_client.begin_search_available_phone_numbers( "US", @@ -44,7 +44,7 @@ def search_available_phone_numbers(): 1, polling = True ) - print('Acquired phone numbers: ' + poller.result) + print('Acquired phone numbers: ' + poller.result()) if __name__ == '__main__': diff --git a/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py index c6a7a5259743..1985b1f671b2 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py @@ -20,7 +20,7 @@ import os from azure.communication.phonenumbers import ( PhoneNumbersClient, - PhoneNumberCapabilityValue + PhoneNumberCapabilityType ) connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') @@ -32,8 +32,8 @@ def update_phone_number_capabilities(): poller = phone_numbers_client.begin_update_phone_number_capabilities( "+18335260208", - PhoneNumberCapabilityValue.OUTBOUND, - PhoneNumberCapabilityValue.INBOUND_OUTBOUND, + PhoneNumberCapabilityType.OUTBOUND, + PhoneNumberCapabilityType.INBOUND_OUTBOUND, polling = True ) poller.result() diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md b/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md index 8e7042749cd3..908729754762 100644 --- a/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md +++ b/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md @@ -10,7 +10,7 @@ autorest ./PHONE_NUMBER_SWAGGER.md ### Settings ``` yaml -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/967da531665d4b51a7a5599324e5edd95489cc3d/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a4d1e1516433894fca89f9600a6ac8a5471fc598/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json output-folder: ../azure/communication/phonenumbers/_generated namespace: azure.communication.phonenumbers license-header: MICROSOFT_MIT_NO_VERSION diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index f1ef28edc973..498c121ab7c0 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -3,7 +3,7 @@ from azure.communication.phonenumbers import PhoneNumbersClient from _shared.testcase import CommunicationTestCase, ResponseReplacerProcessor, BodyReplacerProcessor from _shared.utils import create_token_credential -from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType +from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityType, PhoneNumberType from azure.communication.phonenumbers._shared.utils import parse_connection_str class NewTests(CommunicationTestCase): @@ -52,8 +52,8 @@ def test_release_phone_number(self): @pytest.mark.live_test_only def test_search_available_phone_numbers(self): capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityValue.INBOUND, - sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + calling = PhoneNumberCapabilityType.INBOUND, + sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND ) poller = self.phone_number_client.begin_search_available_phone_numbers( self.country_code, @@ -69,8 +69,8 @@ def test_search_available_phone_numbers(self): def test_update_phone_number_capabilities(self): poller = self.phone_number_client.begin_update_phone_number_capabilities( self.phone_number, - PhoneNumberCapabilityValue.OUTBOUND, - PhoneNumberCapabilityValue.INBOUND_OUTBOUND, + PhoneNumberCapabilityType.OUTBOUND, + PhoneNumberCapabilityType.INBOUND_OUTBOUND, polling = True ) assert poller.result() @@ -78,8 +78,8 @@ def test_update_phone_number_capabilities(self): @pytest.mark.live_test_only def test_purchase_phone_numbers(self): capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityValue.INBOUND, - sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + calling = PhoneNumberCapabilityType.INBOUND, + sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND ) search_poller = self.phone_number_client.begin_search_available_phone_numbers( self.country_code, diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index a602a2c118f8..7dc30f0ee7b5 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -4,7 +4,7 @@ from _shared.asynctestcase import AsyncCommunicationTestCase from _shared.testcase import ResponseReplacerProcessor, BodyReplacerProcessor from _shared.utils import create_token_credential -from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType +from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityType, PhoneNumberType from azure.communication.phonenumbers._shared.utils import parse_connection_str class NewTests(AsyncCommunicationTestCase): @@ -71,8 +71,8 @@ async def test_release_phone_number(self): @pytest.mark.live_test_only async def test_search_available_phone_numbers(self): capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityValue.INBOUND, - sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + calling = PhoneNumberCapabilityType.INBOUND, + sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND ) async with self.phone_number_client: poller = await self.phone_number_client.begin_search_available_phone_numbers( @@ -91,8 +91,8 @@ async def test_update_phone_number_capabilities(self): async with self.phone_number_client: poller = self.phone_number_client.begin_update_phone_number_capabilities( self.phone_number, - PhoneNumberCapabilityValue.OUTBOUND, - PhoneNumberCapabilityValue.OUTBOUND, + PhoneNumberCapabilityType.OUTBOUND, + PhoneNumberCapabilityType.OUTBOUND, polling = True ) assert poller.result() @@ -101,8 +101,8 @@ async def test_update_phone_number_capabilities(self): @pytest.mark.live_test_only async def test_purchase_phone_numbers(self): capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityValue.INBOUND, - sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + calling = PhoneNumberCapabilityType.INBOUND, + sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND ) async with self.phone_number_client: search_poller = await self.phone_number_client.begin_search_available_phone_numbers( From d82a9f7eba4e4bbb37569b216cbe3548a071fee9 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Tue, 2 Mar 2021 14:40:59 -0700 Subject: [PATCH 14/32] Addressed APIView comments --- .../azure/communication/phonenumbers/__init__.py | 8 -------- .../phonenumbers/aio/_phone_numbers_client_async.py | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py index 793bdafb5af1..cab6c97d04c4 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py @@ -8,33 +8,25 @@ from ._generated.models import ( AcquiredPhoneNumber, - AcquiredPhoneNumbers, - CommunicationError, PhoneNumberCapabilities, PhoneNumberCost, - PhoneNumberOperation, PhoneNumberSearchResult, BillingFrequency, PhoneNumberAssignmentType, PhoneNumberCapabilityValue, PhoneNumberOperationStatus, - PhoneNumberOperationType, PhoneNumberType, ) __all__ = [ 'AcquiredPhoneNumber', - 'AcquiredPhoneNumbers', - 'CommunicationError', 'PhoneNumberCapabilities', 'PhoneNumberCost', - 'PhoneNumberOperation', 'PhoneNumberSearchResult', 'BillingFrequency', 'PhoneNumberAssignmentType', 'PhoneNumberCapabilityValue', 'PhoneNumberOperationStatus', - 'PhoneNumberOperationType', 'PhoneNumberType', 'PhoneNumbersClient' ] diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py index 3fcabfa58022..b2a15471bb58 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py @@ -157,8 +157,8 @@ async def begin_search_available_phone_numbers( async def begin_update_phone_number_capabilities( self, phone_number, # type: str - sms, # type: str - calling, # type: str + sms = None, # type: str + calling = None, # type: str **kwargs # type: Any ): # type: (...) -> AsyncLROPoller["_models.AcquiredPhoneNumber"] From 5c457fbbaade904812a63a6f38bed7def5372e13 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Wed, 10 Feb 2021 12:55:55 -0600 Subject: [PATCH 15/32] Added new pnm redesign code --- .../phonenumbers/_generated/py.typed | 1 - .../communication/phonenumbers/_version.py | 2 +- ..._phonenumbers-1.0.0b4-py2.py3-none-any.whl | Bin 0 -> 44179 bytes .../setup.cfg | 2 +- .../swagger/PHONE_NUMBER_SWAGGER.md | 4 + .../test/_shared/{utils.py => utills.py} | 0 ...stration_client.test_get_phone_number.yaml | 24 ++ ...ient.test_list_acquired_phone_numbers.yaml | 92 ++++++ ...on_client.test_purchase_phone_numbers.yaml | 274 ++++++++++++++++++ ...t.test_search_available_phone_numbers.yaml | 121 ++++++++ ...ation_client.test_update_phone_number.yaml | 40 +++ ...test_update_phone_number_capabilities.yaml | 40 +++ ...test_phone_number_administration_client.py | 76 +++++ ...hone_number_administration_client_async.py | 3 + 14 files changed, 676 insertions(+), 3 deletions(-) delete mode 100644 sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/py.typed create mode 100644 sdk/communication/azure-communication-phonenumbers/azure_communication_phonenumbers-1.0.0b4-py2.py3-none-any.whl rename sdk/communication/azure-communication-phonenumbers/test/_shared/{utils.py => utills.py} (100%) create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/py.typed b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_version.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_version.py index a01196623d45..a7bc8e8c9303 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_version.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_version.py @@ -6,4 +6,4 @@ VERSION = "1.0.0b4" -SDK_MONIKER = "communication-administration/{}".format(VERSION) # type: str +SDK_MONIKER = "communication-administration/{}".format(VERSION) # type: str \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/azure_communication_phonenumbers-1.0.0b4-py2.py3-none-any.whl b/sdk/communication/azure-communication-phonenumbers/azure_communication_phonenumbers-1.0.0b4-py2.py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..397bc1477bb537efcac5107df8725b9877097939 GIT binary patch literal 44179 zcmbrl1CVTev*z1&_io#^-Mekuwr$(CZQHhOo4eh+t=sR+x%WHYOiaW%b0aFEDk`F) zVr8!9pTB%Emz*Rp2r>Ww00e+?wSfZf-<~;fKmdSQU;qH>pKtX&oE?nm3~jBgoo&nw z^_|RZZRqUGY;BBfoUILv9USR&bD9GR;*91=Z_SF$^n}Cc|E!kDh|(+Bj1f}SM1O#!1|hTl zJK~Y0AsvjOaZI0#=t2k_1a=NS*~P{S9W$W^DU&RwXBjl?G7CB`x`e z)egF_F(9JID*=|C>Xrw2^Yk)3@YZDBK(Ng>v!Ov{G{Is?JlKX@_Tdoy%WA*+R0oJ< zlL6Q;7|NT1$EQ#-=|m5+6!L}XSd$E5vOlV`4<=519@UZ{7{!dRiuDOw+kn5zNA&Q> z-y2y0N|_tM28VJdJF{dYOoD}{zrylvf^b`uKwIc`!{7x_Qd130-G$e6fo({QfW+_? zAeTQ?cw_8|sR7zs$bDA~2G7OeNLDi(gTATxnR_VzD89;o^V$%h}a! zk#BNJJGufnv9m}+7up-F%>af9*5|p1BF=VB!j3mr_?+4HVmP$lBp7O{9>J}E4{E@T zyL+DysLrlM3VP@8xR30Nc~uTsSg)~jnwSzQC`=ajpHikqU=cL>O(zDa6HFtU$+5wM zGrwks;V;5B5=QbfG=jOfcpT$_Un1tc8ThbB8L5z}-tWR=loT;rQJ~Nyvoj#~gO_in z=HN}KH9egt7AH^~_M$)qh#lY+x)C=h!wU+HNDK=_m|&qoTPLX@gB`>L76T$#GUy!)B0DMc?0G`&6Q-7t!nL84TO0p%p`}cK9MDJGk93IB3Y`3F{&N;`U{ zu^Q{qV{Y_UOdvkH3EkJoPT~D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)%jH##3j%=>@VQ&If||%MO)k9dzB_bqUgZ@kgNl^?qHaT=z{~Qm~W$i1L%C>N@SZkLm}l0^aS< bX#et9sVgI2_}1X4U_U4TIJgJt7k~W^QwXV< literal 0 HcmV?d00001 diff --git a/sdk/communication/azure-communication-phonenumbers/setup.cfg b/sdk/communication/azure-communication-phonenumbers/setup.cfg index 3480374bc2f2..1d45b470b8ab 100644 --- a/sdk/communication/azure-communication-phonenumbers/setup.cfg +++ b/sdk/communication/azure-communication-phonenumbers/setup.cfg @@ -1,2 +1,2 @@ [bdist_wheel] -universal=1 \ No newline at end of file +universal=1 \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md b/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md index 908729754762..36867e7aa65e 100644 --- a/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md +++ b/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md @@ -10,7 +10,11 @@ autorest ./PHONE_NUMBER_SWAGGER.md ### Settings ``` yaml +<<<<<<< HEAD input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a4d1e1516433894fca89f9600a6ac8a5471fc598/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json +======= +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/f20d92b324842b407e0dcce36ad0e67bd9bb66cf/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json +>>>>>>> ea76a164a... Added new pnm redesign code output-folder: ../azure/communication/phonenumbers/_generated namespace: azure.communication.phonenumbers license-header: MICROSOFT_MIT_NO_VERSION diff --git a/sdk/communication/azure-communication-phonenumbers/test/_shared/utils.py b/sdk/communication/azure-communication-phonenumbers/test/_shared/utills.py similarity index 100% rename from sdk/communication/azure-communication-phonenumbers/test/_shared/utils.py rename to sdk/communication/azure-communication-phonenumbers/test/_shared/utills.py diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml index 8133e743555a..a1425608061b 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml @@ -9,31 +9,55 @@ interactions: Connection: - keep-alive Date: +<<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - Mon, 22 Feb 2021 19:48:24 GMT +======= + - Wed, 10 Feb 2021 19:32:33 GMT +>>>>>>> ea76a164a... Added new pnm redesign code:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_phone_numbers_from_managed_identity.yaml User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET +<<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18335260208?api-version=2021-03-07 response: body: string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound+outbound", "sms": "outbound"}, "assignmentType": "Application"}' +======= + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 + response: + body: + string: '{"id": "16194895875", "phoneNumber": "+16194895875", "countryCode": + "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", + "sms": "none"}, "assignmentType": "User", "callbackUri": null, "applicationId": + null}' +>>>>>>> ea76a164a... Added new pnm redesign code:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_phone_numbers_from_managed_identity.yaml headers: content-type: - application/json; charset=utf-8 date: +<<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - Mon, 22 Feb 2021 19:48:23 GMT ms-cv: - KQDB5Gt5/EiYmdjzTHoodQ.0 +======= + - Wed, 10 Feb 2021 19:32:33 GMT + ms-cv: + - Y6DU+yoXtk+lfRS/sfS0AA.0 +>>>>>>> ea76a164a... Added new pnm redesign code:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_phone_numbers_from_managed_identity.yaml request-context: - appId= transfer-encoding: - chunked x-processing-time: +<<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - 847ms +======= + - 756ms +>>>>>>> ea76a164a... Added new pnm redesign code:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_phone_numbers_from_managed_identity.yaml status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml new file mode 100644 index 000000000000..07086c0f987c --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml @@ -0,0 +1,92 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Wed, 10 Feb 2021 19:32:35 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 + response: + body: + string: '{"phoneNumbers": [{"id": "16194895875", "phoneNumber": "+16194895875", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, + "applicationId": null}, {"id": "16194895877", "phoneNumber": "+16194895877", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, + "applicationId": null}, {"id": "16194895878", "phoneNumber": "+16194895878", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, + "applicationId": null}, {"id": "16194895879", "phoneNumber": "+16194895879", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, + "applicationId": null}, {"id": "16194895880", "phoneNumber": "+16194895880", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, + "applicationId": null}, {"id": "16194895882", "phoneNumber": "+16194895882", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, + "applicationId": null}, {"id": "16194895885", "phoneNumber": "+16194895885", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, + "applicationId": null}, {"id": "16194895887", "phoneNumber": "+16194895887", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, + "applicationId": null}, {"id": "16194895889", "phoneNumber": "+16194895889", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, + "applicationId": null}, {"id": "18332271680", "phoneNumber": "+18332271680", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "none", "sms": "outbound"}, "assignmentType": "Application", "callbackUri": + null, "applicationId": null}, {"id": "18332272412", "phoneNumber": "+18332272412", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": + null, "applicationId": null}, {"id": "18332272430", "phoneNumber": "+18332272430", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": + null, "applicationId": null}, {"id": "18332272445", "phoneNumber": "+18332272445", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": + null, "applicationId": null}, {"id": "18332321209", "phoneNumber": "+18332321209", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "none", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": + null, "applicationId": null}, {"id": "18332321221", "phoneNumber": "+18332321221", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "none", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": + null, "applicationId": null}, {"id": "18332321226", "phoneNumber": "+18332321226", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "none", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": + null, "applicationId": null}, {"id": "18335260208", "phoneNumber": "+18335260208", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": + null, "applicationId": null}, {"id": "18336369501", "phoneNumber": "+18336369501", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "inbound+outbound", "sms": "none"}, "assignmentType": "Application", "callbackUri": + null, "applicationId": null}]}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Wed, 10 Feb 2021 19:32:35 GMT + ms-cv: + - xp5wSjznyUuxsog/ctcTNg.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 1460ms + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml new file mode 100644 index 000000000000..23009e4d88e3 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml @@ -0,0 +1,274 @@ +interactions: +- request: + body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": + {"calling": "inbound", "sms": "inbound+outbound"}, "areaCode": "833", "quantity": + 1}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '165' + Content-Type: + - application/json + Date: + - Tue, 09 Feb 2021 23:12:39 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 09 Feb 2021 23:12:41 GMT + ms-cv: + - Lu6bTIinOkK+347LEclljw.0 + operation-location: + - /phoneNumbers/operations/search_b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 + request-context: + - appId= + x-processing-time: + - 1604ms + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 09 Feb 2021 23:13:11 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 + response: + body: + string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": + "2021-02-09T23:12:41.0837738+00:00", "id": "search_b8db86ec-476d-44c4-811d-303928c645bc", + "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Tue, 09 Feb 2021 23:13:11 GMT + ms-cv: + - /KWc7Qzt2kKhdoBoDp6rQQ.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 581ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 09 Feb 2021 23:13:12 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 + response: + body: + string: '{"searchId": "b8db86ec-476d-44c4-811d-303928c645bc", "phoneNumbers": + ["+18332272459"], "phoneNumberType": "TollFree", "assignmentType": "Application", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": + null, "searchExpiresBy": "2021-02-09T23:28:47.6393852+00:00"}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Tue, 09 Feb 2021 23:13:12 GMT + ms-cv: + - d5MuV8GE6EKfkM/IvIv7+g.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 615ms + status: + code: 200 + message: OK +- request: + body: '{"searchId": "b8db86ec-476d-44c4-811d-303928c645bc"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '52' + Content-Type: + - application/json + Date: + - Tue, 09 Feb 2021 23:13:13 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/:purchase?api-version=2021-03-07 + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 09 Feb 2021 23:13:13 GMT + ms-cv: + - gufZmnAYNkSNr+ILi5p8cQ.0 + operation-location: + - /phoneNumbers/operations/purchase_b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 + request-context: + - appId= + x-processing-time: + - 1144ms + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 09 Feb 2021 23:13:44 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 + response: + body: + string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": + "2021-02-09T23:12:41.0837738+00:00", "id": "purchase_b8db86ec-476d-44c4-811d-303928c645bc", + "operationType": "Purchase", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Tue, 09 Feb 2021 23:13:44 GMT + ms-cv: + - IWRiRm4RlUCGbZ7P/XSAkQ.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 588ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 09 Feb 2021 23:13:45 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 + response: + body: + string: '{"searchId": "b8db86ec-476d-44c4-811d-303928c645bc", "phoneNumbers": + ["+18332272459"], "phoneNumberType": "TollFree", "assignmentType": "Application", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": + null, "searchExpiresBy": "2021-02-09T23:28:47.6393852+00:00"}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Tue, 09 Feb 2021 23:13:45 GMT + ms-cv: + - qhtPHCmiP0iv/dhdk+EVsw.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 586ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Tue, 09 Feb 2021 23:13:45 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272459?api-version=2021-03-07 + response: + body: + string: '' + headers: + date: + - Tue, 09 Feb 2021 23:13:46 GMT + ms-cv: + - svrQMbXLTkq4w+Knna/Hog.0 + operation-location: + - /phoneNumbers/operations/release_5e40cad0-cbab-451b-9aab-08f0b81fb814?api-version=2021-03-07 + request-context: + - appId= + x-processing-time: + - 934ms + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml new file mode 100644 index 000000000000..803d7b8d6315 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml @@ -0,0 +1,121 @@ +interactions: +- request: + body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": + {"calling": "inbound", "sms": "inbound+outbound"}, "areaCode": "833", "quantity": + 1}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '165' + Content-Type: + - application/json + Date: + - Tue, 09 Feb 2021 21:34:00 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 09 Feb 2021 21:34:01 GMT + ms-cv: + - MUBwFiR9OUuS3RxM/xaO4g.0 + operation-location: + - /phoneNumbers/operations/search_0789a1f2-43ac-4d59-a6e0-14676d6272c1?api-version=2021-03-07 + request-context: + - appId= + x-processing-time: + - 1393ms + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 09 Feb 2021 21:34:31 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_0789a1f2-43ac-4d59-a6e0-14676d6272c1?api-version=2021-03-07 + response: + body: + string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": + "2021-02-09T21:34:00.9651939+00:00", "id": "search_0789a1f2-43ac-4d59-a6e0-14676d6272c1", + "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Tue, 09 Feb 2021 21:34:31 GMT + ms-cv: + - muk7q9bGH0mzZX+8LQ+89g.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 609ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 09 Feb 2021 21:34:32 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/0789a1f2-43ac-4d59-a6e0-14676d6272c1?api-version=2021-03-07 + response: + body: + string: '{"searchId": "0789a1f2-43ac-4d59-a6e0-14676d6272c1", "phoneNumbers": + ["+18332271691"], "phoneNumberType": "TollFree", "assignmentType": "Application", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": + null, "searchExpiresBy": "2021-02-09T21:50:07.3556271+00:00"}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Tue, 09 Feb 2021 21:34:32 GMT + ms-cv: + - TTqVpiD+IkO2IxCSRtVS8Q.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 542ms + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number.yaml new file mode 100644 index 000000000000..1e21a73687b1 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{"callbackUri": "", "applicationId": ""}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '40' + Content-Type: + - application/merge-patch+json + Date: + - Wed, 10 Feb 2021 15:47:47 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: PATCH + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895842?api-version=2021-03-07 + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Wed, 10 Feb 2021 15:47:48 GMT + ms-cv: + - ci1ZpvX4cUSbfe/jkmyjZw.0 + request-context: + - appId= + x-processing-time: + - 772ms + status: + code: 404 + message: Not Found +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml new file mode 100644 index 000000000000..a01aee2b17d0 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{"calling": "outbound", "sms": "outbound"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '42' + Content-Type: + - application/merge-patch+json + Date: + - Tue, 09 Feb 2021 23:06:25 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: PATCH + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895842/capabilities?api-version=2021-03-07 + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 09 Feb 2021 23:06:25 GMT + ms-cv: + - Xo9exfZlHEeJKpYR3Wu//w.0 + request-context: + - appId= + x-processing-time: + - 177ms + status: + code: 404 + message: Not Found +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index 498c121ab7c0..bf341e81286b 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -1,3 +1,4 @@ +<<<<<<< HEAD import os import pytest from azure.communication.phonenumbers import PhoneNumbersClient @@ -5,10 +6,17 @@ from _shared.utils import create_token_credential from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityType, PhoneNumberType from azure.communication.phonenumbers._shared.utils import parse_connection_str +======= +import pytest +from azure.communication.phonenumbers import PhoneNumbersClient +from _shared.testcase import CommunicationTestCase, ResponseReplacerProcessor, BodyReplacerProcessor +from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType +>>>>>>> ea76a164a... Added new pnm redesign code class NewTests(CommunicationTestCase): def setUp(self): super(NewTests, self).setUp() +<<<<<<< HEAD if self.is_playback(): self.phone_number = "+18000005555" self.phone_number_to_release = "+18000005556" @@ -87,11 +95,79 @@ def test_purchase_phone_numbers(self): PhoneNumberAssignmentType.APPLICATION, capabilities, self.area_code, +======= + self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) + self.recording_processors.extend([ + BodyReplacerProcessor(), + ResponseReplacerProcessor(keys=[self._resource_name])]) + + def test_list_acquired_phone_numbers(self): + phone_numbers = self.phone_number_client.list_acquired_phone_numbers() + assert phone_numbers.next() + + def test_get_phone_number(self): + phone_number = self.phone_number_client.get_phone_number("+16194895875") + assert phone_number.phone_number == "+16194895875" + + def test_update_phone_number(self): + updated_phone_number = self.phone_number_client.update_phone_number( + "+16194895842", + "", + "" + ) + assert updated_phone_number.application_id == "" + + def test_release_phone_number(self): + poller = self.phone_number_client.begin_release_phone_number("+16194895886") + assert poller.status() == 'succeeded' + + + def test_search_available_phone_numbers(self): + capabilities = PhoneNumberCapabilities( + calling = PhoneNumberCapabilityValue.INBOUND, + sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + ) + poller = self.phone_number_client.begin_search_available_phone_numbers( + "US", + PhoneNumberType.TOLL_FREE, + PhoneNumberAssignmentType.APPLICATION, + capabilities, + "833", + 1, + polling = True + ) + assert poller.result() + + def test_update_phone_number_capabilities(self): + poller = self.phone_number_client.begin_update_phone_number_capabilities( + "+16194895842", + PhoneNumberCapabilityValue.OUTBOUND, + PhoneNumberCapabilityValue.OUTBOUND, + polling = True + ) + assert poller.result() + + def test_purchase_phone_numbers(self): + capabilities = PhoneNumberCapabilities( + calling = PhoneNumberCapabilityValue.INBOUND, + sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + ) + search_poller = self.phone_number_client.begin_search_available_phone_numbers( + "US", + PhoneNumberType.TOLL_FREE, + PhoneNumberAssignmentType.APPLICATION, + capabilities, + "833", +>>>>>>> ea76a164a... Added new pnm redesign code 1, polling = True ) phone_number_to_buy = search_poller.result() purchase_poller = self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) assert purchase_poller.result() +<<<<<<< HEAD release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) +======= + release_poller = self.phone_number_client.begin_release_phone_number("+") +>>>>>>> ea76a164a... Added new pnm redesign code assert release_poller.status() == 'succeeded' diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index 7dc30f0ee7b5..88604ecbb51c 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -1,3 +1,4 @@ +<<<<<<< HEAD import os import pytest from azure.communication.phonenumbers.aio import PhoneNumbersClient @@ -119,3 +120,5 @@ async def test_purchase_phone_numbers(self): assert purchase_poller.result() release_poller = await self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) assert release_poller.status() == 'succeeded' +======= +>>>>>>> ea76a164a... Added new pnm redesign code From 4684093d9ac9a21e8fc7f519735b1e69276a0840 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Thu, 11 Feb 2021 11:18:59 -0600 Subject: [PATCH 16/32] Added sanitization --- ...stration_client.test_get_phone_number.yaml | 20 +++++++++++++++++++ ...ient.test_list_acquired_phone_numbers.yaml | 8 ++++---- ...test_update_phone_number_capabilities.yaml | 10 +++++----- ...test_phone_number_administration_client.py | 10 ++++++++-- 4 files changed, 37 insertions(+), 11 deletions(-) diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml index a1425608061b..396dd5a0f855 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml @@ -9,11 +9,15 @@ interactions: Connection: - keep-alive Date: +<<<<<<< HEAD <<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - Mon, 22 Feb 2021 19:48:24 GMT ======= - Wed, 10 Feb 2021 19:32:33 GMT >>>>>>> ea76a164a... Added new pnm redesign code:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_phone_numbers_from_managed_identity.yaml +======= + - Wed, 10 Feb 2021 20:42:54 GMT +>>>>>>> 8bb023cc3... Added sanitization User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -30,15 +34,22 @@ interactions: uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 response: body: +<<<<<<< HEAD string: '{"id": "16194895875", "phoneNumber": "+16194895875", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, "applicationId": null}' >>>>>>> ea76a164a... Added new pnm redesign code:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_phone_numbers_from_managed_identity.yaml +======= + string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", + "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", "sms": + "none"}, "assignmentType": "User", "callbackUri": null, "applicationId": null}' +>>>>>>> 8bb023cc3... Added sanitization headers: content-type: - application/json; charset=utf-8 date: +<<<<<<< HEAD <<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - Mon, 22 Feb 2021 19:48:23 GMT ms-cv: @@ -48,16 +59,25 @@ interactions: ms-cv: - Y6DU+yoXtk+lfRS/sfS0AA.0 >>>>>>> ea76a164a... Added new pnm redesign code:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_phone_numbers_from_managed_identity.yaml +======= + - Wed, 10 Feb 2021 20:42:54 GMT + ms-cv: + - NloH7B1nGEu+4ADVEcl9Rw.0 +>>>>>>> 8bb023cc3... Added sanitization request-context: - appId= transfer-encoding: - chunked x-processing-time: +<<<<<<< HEAD <<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - 847ms ======= - 756ms >>>>>>> ea76a164a... Added new pnm redesign code:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_phone_numbers_from_managed_identity.yaml +======= + - 778ms +>>>>>>> 8bb023cc3... Added sanitization status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml index 07086c0f987c..c8c70ee1b0d1 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive Date: - - Wed, 10 Feb 2021 19:32:35 GMT + - Wed, 10 Feb 2021 20:42:56 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -77,15 +77,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Feb 2021 19:32:35 GMT + - Wed, 10 Feb 2021 20:42:56 GMT ms-cv: - - xp5wSjznyUuxsog/ctcTNg.0 + - yNG8+L4mgES/2SWSBOrQjQ.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 1460ms + - 903ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml index a01aee2b17d0..c02c41afd7d5 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml @@ -13,13 +13,13 @@ interactions: Content-Type: - application/merge-patch+json Date: - - Tue, 09 Feb 2021 23:06:25 GMT + - Wed, 10 Feb 2021 21:40:14 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: PATCH - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895842/capabilities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875/capabilities?api-version=2021-03-07 response: body: string: '' @@ -27,13 +27,13 @@ interactions: content-length: - '0' date: - - Tue, 09 Feb 2021 23:06:25 GMT + - Wed, 10 Feb 2021 21:40:13 GMT ms-cv: - - Xo9exfZlHEeJKpYR3Wu//w.0 + - ExSKXuXJs0uLTcu8/v7hkQ.0 request-context: - appId= x-processing-time: - - 177ms + - 469ms status: code: 404 message: Not Found diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index bf341e81286b..b32865af0b31 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -98,7 +98,9 @@ def test_purchase_phone_numbers(self): ======= self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ - BodyReplacerProcessor(), + BodyReplacerProcessor( + keys=["id", "token", "phoneNumber", "phonenumbers"] + ), ResponseReplacerProcessor(keys=[self._resource_name])]) def test_list_acquired_phone_numbers(self): @@ -140,7 +142,7 @@ def test_search_available_phone_numbers(self): def test_update_phone_number_capabilities(self): poller = self.phone_number_client.begin_update_phone_number_capabilities( - "+16194895842", + "+16194895875", PhoneNumberCapabilityValue.OUTBOUND, PhoneNumberCapabilityValue.OUTBOUND, polling = True @@ -165,9 +167,13 @@ def test_purchase_phone_numbers(self): phone_number_to_buy = search_poller.result() purchase_poller = self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) assert purchase_poller.result() +<<<<<<< HEAD <<<<<<< HEAD release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) ======= release_poller = self.phone_number_client.begin_release_phone_number("+") >>>>>>> ea76a164a... Added new pnm redesign code +======= + release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) +>>>>>>> 8bb023cc3... Added sanitization assert release_poller.status() == 'succeeded' From fd45f5a9d9937984fb215f381532035b6232f18f Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Fri, 12 Feb 2021 12:55:21 -0600 Subject: [PATCH 17/32] Regenerated code --- .../operations/_phone_numbers_operations.py | 34 +++++ .../phonenumbers/_generated/models/_models.py | 9 ++ .../_generated/models/_models_py3.py | 9 ++ .../operations/_phone_numbers_operations.py | 34 +++++ .../phonenumbers/_generated/py.typed | 1 + .../phonenumbers/_phone_numbers_client.py | 4 + .../aio/_phone_numbers_client_async.py | 85 ++++++++++++ .../samples/get_phone_number_sample.py | 18 +++ .../list_acquired_phone_numbers_sample.py | 10 ++ .../swagger/PHONE_NUMBER_SWAGGER.md | 4 + ...stration_client.test_get_phone_number.yaml | 18 +++ ...ient.test_list_acquired_phone_numbers.yaml | 104 +++++++-------- ...t.test_search_available_phone_numbers.yaml | 121 ------------------ ...ation_client.test_update_phone_number.yaml | 40 ------ ...test_update_phone_number_capabilities.yaml | 40 ------ ...on_client_async.test_get_phone_number.yaml | 22 ++++ ...sync.test_list_acquired_phone_numbers.yaml | 59 +++++++++ ...lient_async.test_release_phone_number.yaml | 29 +++++ ...test_phone_number_administration_client.py | 16 +-- ...hone_number_administration_client_async.py | 82 ++++++++++++ 20 files changed, 471 insertions(+), 268 deletions(-) create mode 100644 sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/py.typed delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_number.yaml diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py index 8bcfc898be2c..f04d9a7a3763 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py @@ -88,7 +88,10 @@ async def _search_available_phone_numbers_initial( response_headers = {} response_headers['Location']=self._deserialize('str', response.headers.get('Location')) +<<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +======= +>>>>>>> 798b57943... Regenerated code response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -145,7 +148,10 @@ def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response response_headers['Location']=self._deserialize('str', response.headers.get('Location')) +<<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +======= +>>>>>>> 798b57943... Regenerated code response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -276,8 +282,15 @@ async def _purchase_phone_numbers_initial( response_headers = {} response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +<<<<<<< HEAD response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) +======= + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) + deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) +>>>>>>> 798b57943... Regenerated code if cls: return cls(pipeline_response, None, response_headers) @@ -323,6 +336,17 @@ async def begin_purchase_phone_numbers( kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): +<<<<<<< HEAD +======= + response_headers = {} + response = pipeline_response.http_response + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) + deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) + +>>>>>>> 798b57943... Regenerated code if cls: return cls(pipeline_response, None, {}) @@ -555,6 +579,10 @@ async def _release_phone_number_initial( response_headers = {} response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +<<<<<<< HEAD +======= + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) +>>>>>>> 798b57943... Regenerated code response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['release-id']=self._deserialize('str', response.headers.get('release-id')) @@ -761,7 +789,10 @@ async def _update_capabilities_initial( response_headers = {} response_headers['Location']=self._deserialize('str', response.headers.get('Location')) +<<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +======= +>>>>>>> 798b57943... Regenerated code response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) @@ -823,7 +854,10 @@ def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response response_headers['Location']=self._deserialize('str', response.headers.get('Location')) +<<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +======= +>>>>>>> 798b57943... Regenerated code response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py index 2f56422efbef..0aa0d7925687 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py @@ -34,7 +34,11 @@ class AcquiredPhoneNumber(msrest.serialization.Model): ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param purchase_date: Required. The date and time that the phone number was purchased. :type purchase_date: ~datetime.datetime +<<<<<<< HEAD :param cost: Required. The incurred cost for a single phone number. +======= + :param cost: The incurred cost for a single phone number. +>>>>>>> 798b57943... Regenerated code :type cost: ~azure.communication.phonenumbers.models.PhoneNumberCost """ @@ -71,8 +75,13 @@ def __init__( self.phone_number_type = kwargs['phone_number_type'] self.capabilities = kwargs['capabilities'] self.assignment_type = kwargs['assignment_type'] +<<<<<<< HEAD self.purchase_date = kwargs['purchase_date'] self.cost = kwargs['cost'] +======= + self.purchase_date = kwargs.get('purchase_date', None) + self.cost = kwargs.get('cost', None) +>>>>>>> 798b57943... Regenerated code class AcquiredPhoneNumbers(msrest.serialization.Model): diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py index 7c9e3386983b..ccbac0e1918d 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py @@ -39,7 +39,11 @@ class AcquiredPhoneNumber(msrest.serialization.Model): ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param purchase_date: Required. The date and time that the phone number was purchased. :type purchase_date: ~datetime.datetime +<<<<<<< HEAD :param cost: Required. The incurred cost for a single phone number. +======= + :param cost: The incurred cost for a single phone number. +>>>>>>> 798b57943... Regenerated code :type cost: ~azure.communication.phonenumbers.models.PhoneNumberCost """ @@ -74,8 +78,13 @@ def __init__( phone_number_type: Union[str, "PhoneNumberType"], capabilities: "PhoneNumberCapabilities", assignment_type: Union[str, "PhoneNumberAssignmentType"], +<<<<<<< HEAD purchase_date: datetime.datetime, cost: "PhoneNumberCost", +======= + purchase_date: Optional[datetime.datetime] = None, + cost: Optional["PhoneNumberCost"] = None, +>>>>>>> 798b57943... Regenerated code **kwargs ): super(AcquiredPhoneNumber, self).__init__(**kwargs) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py index 9c38f1c39bf1..0e5eec0ec76b 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py @@ -93,7 +93,10 @@ def _search_available_phone_numbers_initial( response_headers = {} response_headers['Location']=self._deserialize('str', response.headers.get('Location')) +<<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +======= +>>>>>>> 798b57943... Regenerated code response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -151,7 +154,10 @@ def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response response_headers['Location']=self._deserialize('str', response.headers.get('Location')) +<<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +======= +>>>>>>> 798b57943... Regenerated code response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -284,8 +290,15 @@ def _purchase_phone_numbers_initial( response_headers = {} response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +<<<<<<< HEAD response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) +======= + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) + deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) +>>>>>>> 798b57943... Regenerated code if cls: return cls(pipeline_response, None, response_headers) @@ -332,6 +345,17 @@ def begin_purchase_phone_numbers( kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): +<<<<<<< HEAD +======= + response_headers = {} + response = pipeline_response.http_response + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) + deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) + +>>>>>>> 798b57943... Regenerated code if cls: return cls(pipeline_response, None, {}) @@ -568,6 +592,10 @@ def _release_phone_number_initial( response_headers = {} response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +<<<<<<< HEAD +======= + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) +>>>>>>> 798b57943... Regenerated code response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['release-id']=self._deserialize('str', response.headers.get('release-id')) @@ -777,7 +805,10 @@ def _update_capabilities_initial( response_headers = {} response_headers['Location']=self._deserialize('str', response.headers.get('Location')) +<<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +======= +>>>>>>> 798b57943... Regenerated code response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) @@ -840,7 +871,10 @@ def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response response_headers['Location']=self._deserialize('str', response.headers.get('Location')) +<<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +======= +>>>>>>> 798b57943... Regenerated code response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/py.typed b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py index 6d940af25a50..9624c476f4e3 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py @@ -151,7 +151,11 @@ def begin_search_available_phone_numbers( search_request, **kwargs ) +<<<<<<< HEAD +======= + +>>>>>>> 798b57943... Regenerated code @distributed_trace def begin_update_phone_number_capabilities( self, diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py index b2a15471bb58..d7d84d74dd61 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py @@ -16,6 +16,7 @@ class PhoneNumbersClient(object): def __init__( self, +<<<<<<< HEAD endpoint, # type: str credential, # type: str **kwargs # type: Any @@ -49,11 +50,50 @@ def from_connection_string( A connection string to an Azure Communication Service resource. :returns: Instance of PhoneNumbersClient. :rtype: ~azure.communication.phonenumbers.aio.PhoneNumbersClient +======= + endpoint, # type: str + credential, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + try: + if not endpoint.lower().startswith('http'): + endpoint = "https://" + endpoint + except AttributeError: + raise ValueError("Account URL must be a string.") + + if not credential: + raise ValueError( + "You need to provide account shared key to authenticate.") + + self._endpoint = endpoint + self._phone_number_client = PhoneNumbersClientGen( + self._endpoint, + authentication_policy=get_authentication_policy(endpoint, credential, is_async=True), + sdk_moniker=SDK_MONIKER, + **kwargs) + + @classmethod + def from_connection_string( + cls, conn_str, # type: str + **kwargs # type: Any + ): # type: (...) -> PhoneNumbersAdministrationClient + """Create PhoneNumbersAdministrationClient from a Connection String. + :param str conn_str: + A connection string to an Azure Communication Service resource. + :returns: Instance of PhoneNumbersAdministrationClient. + :rtype: ~azure.communication.PhoneNumbersAdministrationClient +>>>>>>> 798b57943... Regenerated code """ endpoint, access_key = parse_connection_str(conn_str) return cls(endpoint, access_key, **kwargs) +<<<<<<< HEAD +======= + + +>>>>>>> 798b57943... Regenerated code @distributed_trace_async async def begin_purchase_phone_numbers( self, @@ -77,7 +117,11 @@ async def begin_purchase_phone_numbers( search_id, **kwargs ) +<<<<<<< HEAD +======= + +>>>>>>> 798b57943... Regenerated code @distributed_trace_async async def begin_release_phone_number( self, @@ -209,8 +253,13 @@ async def get_phone_number( @distributed_trace def list_acquired_phone_numbers( +<<<<<<< HEAD self, **kwargs # type: Any +======= + self, + **kwargs +>>>>>>> 798b57943... Regenerated code ): # type: (...) -> AsyncItemPaged[AcquiredPhoneNumbers] """Gets the list of all acquired phone numbers. @@ -226,6 +275,41 @@ def list_acquired_phone_numbers( return self._phone_number_client.phone_numbers.list_phone_numbers( **kwargs ) +<<<<<<< HEAD +======= + + @distributed_trace_async + async def update_phone_number( + self, + phone_number, + callback_uri, + application_id, + **kwargs + ): + # type: (...) -> AcquiredPhoneNumber + """Updates the configuration of a phone number. +>>>>>>> 798b57943... Regenerated code + + async def __aenter__(self) -> "PhoneNumbersClient": + await self._phone_number_client.__aenter__() + return self + + async def __aexit__(self, *args: "Any") -> None: + await self.close() + + async def close(self) -> None: + """Close the :class: + `~azure.communication.phonenumbers.aio.PhoneNumbersClient` session. + """ +<<<<<<< HEAD + await self._phone_number_client.__aexit__() +======= + return await self._phone_number_client.phone_numbers.update( + phone_number, + callback_uri, + application_id, + **kwargs + ) async def __aenter__(self) -> "PhoneNumbersClient": await self._phone_number_client.__aenter__() @@ -239,3 +323,4 @@ async def close(self) -> None: `~azure.communication.phonenumbers.aio.PhoneNumbersClient` session. """ await self._phone_number_client.__aexit__() +>>>>>>> 798b57943... Regenerated code diff --git a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py index 5493fce13d1b..007972868392 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py @@ -7,11 +7,19 @@ # -------------------------------------------------------------------------- """ +<<<<<<< HEAD FILE:get_phone_number_sample.py DESCRIPTION: This sample demonstrates how to get the information from an acquired phone number using your connection string USAGE: python get_phone_number_sample.py +======= +FILE: phone_number_area_codes_sample.py +DESCRIPTION: + This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. +USAGE: + python list_acquired_phone_numbers_sample.py +>>>>>>> 798b57943... Regenerated code Set the environment variables with your own values before running the sample: 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER - The phone number you want to get its information @@ -23,12 +31,22 @@ ) connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') +<<<<<<< HEAD phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") # e.g. "+18001234567" +======= +phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") +>>>>>>> 798b57943... Regenerated code phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) def get_phone_number_information(): phone_number_information = phone_numbers_client.get_phone_number(phone_number) +<<<<<<< HEAD print('Phone number information: ' + phone_number_information) +======= + print('Phone number information:') + print(phone_number_information) + +>>>>>>> 798b57943... Regenerated code if __name__ == '__main__': get_phone_number_information() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py index 34dbfe415cf9..a2cabd95c8d9 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py @@ -7,9 +7,15 @@ # -------------------------------------------------------------------------- """ +<<<<<<< HEAD FILE: list_acquired_phone_numbers_sample.py DESCRIPTION: This sample demonstrates how to get all off you acquired phone numbers using your connection string +======= +FILE: phone_number_area_codes_sample.py +DESCRIPTION: + This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. +>>>>>>> 798b57943... Regenerated code USAGE: python list_acquired_phone_numbers_sample.py Set the environment variables with your own values before running the sample: @@ -27,8 +33,12 @@ def list_acquired_phone_numbers(): acquired_phone_numbers = phone_numbers_client.list_acquired_phone_numbers() print('Acquired phone numbers:') +<<<<<<< HEAD for acquired_phone_number in acquired_phone_numbers: print(acquired_phone_number.phone_number) +======= + print(acquired_phone_numbers) +>>>>>>> 798b57943... Regenerated code if __name__ == '__main__': diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md b/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md index 36867e7aa65e..be070849100c 100644 --- a/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md +++ b/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md @@ -11,10 +11,14 @@ autorest ./PHONE_NUMBER_SWAGGER.md ### Settings ``` yaml <<<<<<< HEAD +<<<<<<< HEAD input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a4d1e1516433894fca89f9600a6ac8a5471fc598/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json ======= input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/f20d92b324842b407e0dcce36ad0e67bd9bb66cf/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json >>>>>>> ea76a164a... Added new pnm redesign code +======= +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/e23190a5bc64cd8526d08b6c2c1d616939bc88b3/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json +>>>>>>> 798b57943... Regenerated code output-folder: ../azure/communication/phonenumbers/_generated namespace: azure.communication.phonenumbers license-header: MICROSOFT_MIT_NO_VERSION diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml index 396dd5a0f855..e22fd396e9fc 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml @@ -10,6 +10,7 @@ interactions: - keep-alive Date: <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - Mon, 22 Feb 2021 19:48:24 GMT ======= @@ -18,6 +19,9 @@ interactions: ======= - Wed, 10 Feb 2021 20:42:54 GMT >>>>>>> 8bb023cc3... Added sanitization +======= + - Thu, 11 Feb 2021 23:15:38 GMT +>>>>>>> 798b57943... Regenerated code User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -43,13 +47,18 @@ interactions: ======= string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", "sms": +<<<<<<< HEAD "none"}, "assignmentType": "User", "callbackUri": null, "applicationId": null}' >>>>>>> 8bb023cc3... Added sanitization +======= + "none"}, "assignmentType": "User"}' +>>>>>>> 798b57943... Regenerated code headers: content-type: - application/json; charset=utf-8 date: <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - Mon, 22 Feb 2021 19:48:23 GMT ms-cv: @@ -64,12 +73,18 @@ interactions: ms-cv: - NloH7B1nGEu+4ADVEcl9Rw.0 >>>>>>> 8bb023cc3... Added sanitization +======= + - Thu, 11 Feb 2021 23:15:39 GMT + ms-cv: + - 0Fa+iu/NaEivjqj8QV7AwQ.0 +>>>>>>> 798b57943... Regenerated code request-context: - appId= transfer-encoding: - chunked x-processing-time: <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - 847ms ======= @@ -78,6 +93,9 @@ interactions: ======= - 778ms >>>>>>> 8bb023cc3... Added sanitization +======= + - 828ms +>>>>>>> 798b57943... Regenerated code status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml index c8c70ee1b0d1..e8c067a1c78c 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive Date: - - Wed, 10 Feb 2021 20:42:56 GMT + - Thu, 11 Feb 2021 23:15:40 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -20,72 +20,62 @@ interactions: body: string: '{"phoneNumbers": [{"id": "16194895875", "phoneNumber": "+16194895875", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, - "applicationId": null}, {"id": "16194895877", "phoneNumber": "+16194895877", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, - "applicationId": null}, {"id": "16194895878", "phoneNumber": "+16194895878", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, - "applicationId": null}, {"id": "16194895879", "phoneNumber": "+16194895879", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, - "applicationId": null}, {"id": "16194895880", "phoneNumber": "+16194895880", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, - "applicationId": null}, {"id": "16194895882", "phoneNumber": "+16194895882", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, - "applicationId": null}, {"id": "16194895885", "phoneNumber": "+16194895885", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, - "applicationId": null}, {"id": "16194895887", "phoneNumber": "+16194895887", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, - "applicationId": null}, {"id": "16194895889", "phoneNumber": "+16194895889", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User", "callbackUri": null, - "applicationId": null}, {"id": "18332271680", "phoneNumber": "+18332271680", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "none", "sms": "outbound"}, "assignmentType": "Application", "callbackUri": - null, "applicationId": null}, {"id": "18332272412", "phoneNumber": "+18332272412", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": - null, "applicationId": null}, {"id": "18332272430", "phoneNumber": "+18332272430", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": - null, "applicationId": null}, {"id": "18332272445", "phoneNumber": "+18332272445", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": - null, "applicationId": null}, {"id": "18332321209", "phoneNumber": "+18332321209", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "none", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": - null, "applicationId": null}, {"id": "18332321221", "phoneNumber": "+18332321221", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "none", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": - null, "applicationId": null}, {"id": "18332321226", "phoneNumber": "+18332321226", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "none", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": - null, "applicationId": null}, {"id": "18335260208", "phoneNumber": "+18335260208", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "callbackUri": - null, "applicationId": null}, {"id": "18336369501", "phoneNumber": "+18336369501", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "inbound+outbound", "sms": "none"}, "assignmentType": "Application", "callbackUri": - null, "applicationId": null}]}' + "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": "16194895877", + "phoneNumber": "+16194895877", "countryCode": "US", "phoneNumberType": "Geographic", + "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": + "User"}, {"id": "16194895878", "phoneNumber": "+16194895878", "countryCode": + "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", + "sms": "none"}, "assignmentType": "User"}, {"id": "16194895879", "phoneNumber": + "+16194895879", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": + {"calling": "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": + "16194895880", "phoneNumber": "+16194895880", "countryCode": "US", "phoneNumberType": + "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": + "User"}, {"id": "16194895882", "phoneNumber": "+16194895882", "countryCode": + "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", + "sms": "none"}, "assignmentType": "User"}, {"id": "16194895885", "phoneNumber": + "+16194895885", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": + {"calling": "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": + "16194895887", "phoneNumber": "+16194895887", "countryCode": "US", "phoneNumberType": + "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": + "User"}, {"id": "16194895889", "phoneNumber": "+16194895889", "countryCode": + "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", + "sms": "none"}, "assignmentType": "User"}, {"id": "18332271680", "phoneNumber": + "+18332271680", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": + {"calling": "none", "sms": "outbound"}, "assignmentType": "Application"}, + {"id": "18332272412", "phoneNumber": "+18332272412", "countryCode": "US", + "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": + "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332272430", + "phoneNumber": "+18332272430", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": + "Application"}, {"id": "18332272445", "phoneNumber": "+18332272445", "countryCode": + "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", + "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332321209", + "phoneNumber": "+18332321209", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "none", "sms": "inbound+outbound"}, "assignmentType": + "Application"}, {"id": "18332321221", "phoneNumber": "+18332321221", "countryCode": + "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "none", "sms": + "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332321226", + "phoneNumber": "+18332321226", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "none", "sms": "inbound+outbound"}, "assignmentType": + "Application"}, {"id": "18335260208", "phoneNumber": "+18335260208", "countryCode": + "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", + "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18336369501", + "phoneNumber": "+18336369501", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "inbound+outbound", "sms": "none"}, "assignmentType": + "Application"}]}' headers: content-type: - application/json; charset=utf-8 date: - - Wed, 10 Feb 2021 20:42:56 GMT + - Thu, 11 Feb 2021 23:15:40 GMT ms-cv: - - yNG8+L4mgES/2SWSBOrQjQ.0 + - 0k/4PQ1Ca0WmrSBuPE9Svg.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 903ms + - 815ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml deleted file mode 100644 index 803d7b8d6315..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml +++ /dev/null @@ -1,121 +0,0 @@ -interactions: -- request: - body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": - {"calling": "inbound", "sms": "inbound+outbound"}, "areaCode": "833", "quantity": - 1}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '165' - Content-Type: - - application/json - Date: - - Tue, 09 Feb 2021 21:34:00 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Tue, 09 Feb 2021 21:34:01 GMT - ms-cv: - - MUBwFiR9OUuS3RxM/xaO4g.0 - operation-location: - - /phoneNumbers/operations/search_0789a1f2-43ac-4d59-a6e0-14676d6272c1?api-version=2021-03-07 - request-context: - - appId= - x-processing-time: - - 1393ms - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Tue, 09 Feb 2021 21:34:31 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_0789a1f2-43ac-4d59-a6e0-14676d6272c1?api-version=2021-03-07 - response: - body: - string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": - "2021-02-09T21:34:00.9651939+00:00", "id": "search_0789a1f2-43ac-4d59-a6e0-14676d6272c1", - "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Tue, 09 Feb 2021 21:34:31 GMT - ms-cv: - - muk7q9bGH0mzZX+8LQ+89g.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 609ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Tue, 09 Feb 2021 21:34:32 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/0789a1f2-43ac-4d59-a6e0-14676d6272c1?api-version=2021-03-07 - response: - body: - string: '{"searchId": "0789a1f2-43ac-4d59-a6e0-14676d6272c1", "phoneNumbers": - ["+18332271691"], "phoneNumberType": "TollFree", "assignmentType": "Application", - "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": - null, "searchExpiresBy": "2021-02-09T21:50:07.3556271+00:00"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Tue, 09 Feb 2021 21:34:32 GMT - ms-cv: - - TTqVpiD+IkO2IxCSRtVS8Q.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 542ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number.yaml deleted file mode 100644 index 1e21a73687b1..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number.yaml +++ /dev/null @@ -1,40 +0,0 @@ -interactions: -- request: - body: '{"callbackUri": "", "applicationId": ""}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '40' - Content-Type: - - application/merge-patch+json - Date: - - Wed, 10 Feb 2021 15:47:47 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: PATCH - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895842?api-version=2021-03-07 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Wed, 10 Feb 2021 15:47:48 GMT - ms-cv: - - ci1ZpvX4cUSbfe/jkmyjZw.0 - request-context: - - appId= - x-processing-time: - - 772ms - status: - code: 404 - message: Not Found -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml deleted file mode 100644 index c02c41afd7d5..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml +++ /dev/null @@ -1,40 +0,0 @@ -interactions: -- request: - body: '{"calling": "outbound", "sms": "outbound"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '42' - Content-Type: - - application/merge-patch+json - Date: - - Wed, 10 Feb 2021 21:40:14 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: PATCH - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875/capabilities?api-version=2021-03-07 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Wed, 10 Feb 2021 21:40:13 GMT - ms-cv: - - ExSKXuXJs0uLTcu8/v7hkQ.0 - request-context: - - appId= - x-processing-time: - - 469ms - status: - code: 404 - message: Not Found -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml index f52367daa393..238a18af7118 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml @@ -5,12 +5,17 @@ interactions: Accept: - application/json Date: +<<<<<<< HEAD - Tue, 16 Feb 2021 19:45:38 GMT +======= + - Thu, 11 Feb 2021 20:34:10 GMT +>>>>>>> 798b57943... Regenerated code User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET +<<<<<<< HEAD uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272412?api-version=2021-03-07 response: body: @@ -28,4 +33,21 @@ interactions: code: 200 message: OK url: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272412?api-version=2021-03-07 +======= + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 + response: + body: + string: '{"error": {"code": "Denied", "message": "Denied by the resource provider."}}' + headers: + content-type: application/json + date: Thu, 11 Feb 2021 20:34:11 GMT + ms-cv: 1vN1Av5Jp02JawMoV/kpYQ.0 + request-context: appId= + transfer-encoding: chunked + x-processing-time: 169ms + status: + code: 401 + message: Unauthorized + url: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 +>>>>>>> 798b57943... Regenerated code version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml index c0d7daac80a7..501b2c6a1dc3 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml @@ -5,7 +5,11 @@ interactions: Accept: - application/json Date: +<<<<<<< HEAD - Mon, 22 Feb 2021 19:49:31 GMT +======= + - Thu, 11 Feb 2021 20:20:13 GMT +>>>>>>> 798b57943... Regenerated code User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -14,6 +18,7 @@ interactions: uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 response: body: +<<<<<<< HEAD string: '{"phoneNumbers": [{"id": "18332272412", "phoneNumber": "+18332272412", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": @@ -42,6 +47,60 @@ interactions: request-context: appId= transfer-encoding: chunked x-processing-time: 930ms +======= + string: '{"phoneNumbers": [{"id": "16194895875", "phoneNumber": "+16194895875", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": "16194895877", + "phoneNumber": "+16194895877", "countryCode": "US", "phoneNumberType": "Geographic", + "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": + "User"}, {"id": "16194895878", "phoneNumber": "+16194895878", "countryCode": + "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", + "sms": "none"}, "assignmentType": "User"}, {"id": "16194895879", "phoneNumber": + "+16194895879", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": + {"calling": "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": + "16194895880", "phoneNumber": "+16194895880", "countryCode": "US", "phoneNumberType": + "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": + "User"}, {"id": "16194895882", "phoneNumber": "+16194895882", "countryCode": + "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", + "sms": "none"}, "assignmentType": "User"}, {"id": "16194895885", "phoneNumber": + "+16194895885", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": + {"calling": "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": + "16194895887", "phoneNumber": "+16194895887", "countryCode": "US", "phoneNumberType": + "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": + "User"}, {"id": "16194895889", "phoneNumber": "+16194895889", "countryCode": + "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", + "sms": "none"}, "assignmentType": "User"}, {"id": "18332271680", "phoneNumber": + "+18332271680", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": + {"calling": "none", "sms": "outbound"}, "assignmentType": "Application"}, + {"id": "18332272412", "phoneNumber": "+18332272412", "countryCode": "US", + "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": + "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332272430", + "phoneNumber": "+18332272430", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": + "Application"}, {"id": "18332272445", "phoneNumber": "+18332272445", "countryCode": + "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", + "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332321209", + "phoneNumber": "+18332321209", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "none", "sms": "inbound+outbound"}, "assignmentType": + "Application"}, {"id": "18332321221", "phoneNumber": "+18332321221", "countryCode": + "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "none", "sms": + "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332321226", + "phoneNumber": "+18332321226", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "none", "sms": "inbound+outbound"}, "assignmentType": + "Application"}, {"id": "18335260208", "phoneNumber": "+18335260208", "countryCode": + "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", + "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18336369501", + "phoneNumber": "+18336369501", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "inbound+outbound", "sms": "none"}, "assignmentType": + "Application"}]}' + headers: + content-type: application/json; charset=utf-8 + date: Thu, 11 Feb 2021 20:20:15 GMT + ms-cv: /PDnQzArpkm1GBLVqCNyKg.0 + request-context: appId= + transfer-encoding: chunked + x-processing-time: 2257ms +>>>>>>> 798b57943... Regenerated code status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_number.yaml new file mode 100644 index 000000000000..2ebeaaaf4371 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_number.yaml @@ -0,0 +1,29 @@ +interactions: +- request: + body: '' + headers: + Accept: + - application/json + Date: + - Thu, 11 Feb 2021 19:16:56 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 + response: + body: + string: '{"error": {"code": "Denied", "message": "Denied by the resource provider."}}' + headers: + content-type: application/json + date: Thu, 11 Feb 2021 19:16:58 GMT + ms-cv: GAxbDJ8Kuk6pDjdEn5+mxA.0 + request-context: appId= + transfer-encoding: chunked + x-processing-time: 158ms + status: + code: 401 + message: Unauthorized + url: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index b32865af0b31..3a8a02e17ef5 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -110,19 +110,10 @@ def test_list_acquired_phone_numbers(self): def test_get_phone_number(self): phone_number = self.phone_number_client.get_phone_number("+16194895875") assert phone_number.phone_number == "+16194895875" - - def test_update_phone_number(self): - updated_phone_number = self.phone_number_client.update_phone_number( - "+16194895842", - "", - "" - ) - assert updated_phone_number.application_id == "" def test_release_phone_number(self): poller = self.phone_number_client.begin_release_phone_number("+16194895886") assert poller.status() == 'succeeded' - def test_search_available_phone_numbers(self): capabilities = PhoneNumberCapabilities( @@ -139,7 +130,7 @@ def test_search_available_phone_numbers(self): polling = True ) assert poller.result() - + def test_update_phone_number_capabilities(self): poller = self.phone_number_client.begin_update_phone_number_capabilities( "+16194895875", @@ -149,6 +140,7 @@ def test_update_phone_number_capabilities(self): ) assert poller.result() + def test_purchase_phone_numbers(self): capabilities = PhoneNumberCapabilities( calling = PhoneNumberCapabilityValue.INBOUND, @@ -175,5 +167,9 @@ def test_purchase_phone_numbers(self): >>>>>>> ea76a164a... Added new pnm redesign code ======= release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) +<<<<<<< HEAD >>>>>>> 8bb023cc3... Added sanitization assert release_poller.status() == 'succeeded' +======= + assert release_poller.status() == 'succeeded' +>>>>>>> 798b57943... Regenerated code diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index 88604ecbb51c..b7df8f968f8e 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -1,16 +1,24 @@ <<<<<<< HEAD +<<<<<<< HEAD import os +======= +>>>>>>> 798b57943... Regenerated code import pytest from azure.communication.phonenumbers.aio import PhoneNumbersClient from _shared.asynctestcase import AsyncCommunicationTestCase from _shared.testcase import ResponseReplacerProcessor, BodyReplacerProcessor +<<<<<<< HEAD from _shared.utils import create_token_credential from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityType, PhoneNumberType from azure.communication.phonenumbers._shared.utils import parse_connection_str +======= +from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType +>>>>>>> 798b57943... Regenerated code class NewTests(AsyncCommunicationTestCase): def setUp(self): super(NewTests, self).setUp() +<<<<<<< HEAD if self.is_playback(): self.phone_number = "+18000005555" self.phone_number_to_release = "+18000005556" @@ -22,6 +30,8 @@ def setUp(self): self.country_code = os.getenv("AZURE_COMMUNICATION_SERVICE_COUNTRY_CODE") self.area_code = os.getenv("AZURE_COMMUNICATION_SERIVCE_AREA_CODE") +======= +>>>>>>> 798b57943... Regenerated code self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ BodyReplacerProcessor( @@ -30,6 +40,7 @@ def setUp(self): ResponseReplacerProcessor(keys=[self._resource_name])]) @AsyncCommunicationTestCase.await_prepared_test +<<<<<<< HEAD @pytest.mark.live_test_only async def test_list_all_phone_numbers_from_managed_identity(self): endpoint, access_key = parse_connection_str(self.connection_str) @@ -44,6 +55,8 @@ async def test_list_all_phone_numbers_from_managed_identity(self): @AsyncCommunicationTestCase.await_prepared_test @pytest.mark.live_test_only +======= +>>>>>>> 798b57943... Regenerated code async def test_list_acquired_phone_numbers(self): async with self.phone_number_client: phone_numbers = self.phone_number_client.list_acquired_phone_numbers() @@ -53,6 +66,7 @@ async def test_list_acquired_phone_numbers(self): assert len(items) > 0 @AsyncCommunicationTestCase.await_prepared_test +<<<<<<< HEAD @pytest.mark.live_test_only async def test_get_phone_number(self): async with self.phone_number_client: @@ -122,3 +136,71 @@ async def test_purchase_phone_numbers(self): assert release_poller.status() == 'succeeded' ======= >>>>>>> ea76a164a... Added new pnm redesign code +======= + async def test_get_phone_number(self): + async with self.phone_number_client: + phone_number = await self.phone_number_client.get_phone_number("+16194895875") + assert phone_number.phone_number == "+16194895875" + + ''' + def test_update_phone_number(self): + updated_phone_number = self.phone_number_client.update_phone_number( + "+16194895842", + "", + "" + ) + assert updated_phone_number.application_id == "" + + @AsyncCommunicationTestCase.await_prepared_test + async def test_release_phone_number(self): + async with self.phone_number_client: + poller = await self.phone_number_client.begin_release_phone_number("+16194895875") + result = await poller.result() + assert result + + def test_search_available_phone_numbers(self): + capabilities = PhoneNumberCapabilities( + calling = PhoneNumberCapabilityValue.INBOUND, + sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + ) + poller = self.phone_number_client.begin_search_available_phone_numbers( + "US", + PhoneNumberType.TOLL_FREE, + PhoneNumberAssignmentType.APPLICATION, + capabilities, + "833", + 1, + polling = True + ) + assert poller.result() + + def test_update_phone_number_capabilities(self): + poller = self.phone_number_client.begin_update_phone_number_capabilities( + "+16194895875", + PhoneNumberCapabilityValue.OUTBOUND, + PhoneNumberCapabilityValue.OUTBOUND, + polling = True + ) + assert poller.result() + + def test_purchase_phone_numbers(self): + capabilities = PhoneNumberCapabilities( + calling = PhoneNumberCapabilityValue.INBOUND, + sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + ) + search_poller = self.phone_number_client.begin_search_available_phone_numbers( + "US", + PhoneNumberType.TOLL_FREE, + PhoneNumberAssignmentType.APPLICATION, + capabilities, + "833", + 1, + polling = True + ) + phone_number_to_buy = search_poller.result() + purchase_poller = self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) + assert purchase_poller.result() + release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) + assert release_poller.status() == 'succeeded' + ''' +>>>>>>> 798b57943... Regenerated code From 61d1936dfb840ad8adc6cfcdbefe041c0f8668d6 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Mon, 15 Feb 2021 13:21:49 -0600 Subject: [PATCH 18/32] Added README and samples --- .../README.md | 3 + .../operations/_phone_numbers_operations.py | 25 +- .../operations/_phone_numbers_operations.py | 25 +- .../samples/get_phone_number_sample.py | 6 +- .../samples/purchase_phone_number_sample.py | 24 +- .../samples/release_phone_number_sample.py | 21 ++ .../search_available_phone_numbers_sample.py | 28 +- .../swagger/PHONE_NUMBER_SWAGGER.md | 4 + ...stration_client.test_get_phone_number.yaml | 23 ++ ...ient.test_list_acquired_phone_numbers.yaml | 82 ------ ...on_client.test_purchase_phone_numbers.yaml | 247 +----------------- ...t.test_search_available_phone_numbers.yaml | 44 ++++ ...test_update_phone_number_capabilities.yaml | 40 +++ ...test_phone_number_administration_client.py | 34 ++- 14 files changed, 270 insertions(+), 336 deletions(-) delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml diff --git a/sdk/communication/azure-communication-phonenumbers/README.md b/sdk/communication/azure-communication-phonenumbers/README.md index 6a28ebb57a68..a8d53f57e526 100644 --- a/sdk/communication/azure-communication-phonenumbers/README.md +++ b/sdk/communication/azure-communication-phonenumbers/README.md @@ -123,6 +123,7 @@ poller = self.phone_number_client.begin_release_phone_number( polling = True ) ``` +<<<<<<< HEAD ### Updating Phone Number Capabilities @@ -142,6 +143,8 @@ poller = self.phone_number_client.begin_update_phone_number_capabilities( ) ``` +======= +>>>>>>> 968de8d7e... Added README and samples # Troubleshooting The Phone Numbers Administration client will raise exceptions defined in [Azure Core][azure_core]. diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py index f04d9a7a3763..623573299826 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py @@ -88,10 +88,14 @@ async def _search_available_phone_numbers_initial( response_headers = {} response_headers['Location']=self._deserialize('str', response.headers.get('Location')) +<<<<<<< HEAD <<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) ======= >>>>>>> 798b57943... Regenerated code +======= + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +>>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -148,10 +152,14 @@ def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response response_headers['Location']=self._deserialize('str', response.headers.get('Location')) +<<<<<<< HEAD <<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) ======= >>>>>>> 798b57943... Regenerated code +======= + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +>>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -281,12 +289,16 @@ async def _purchase_phone_numbers_initial( raise HttpResponseError(response=response, model=error) response_headers = {} +<<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) <<<<<<< HEAD response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) ======= +======= +>>>>>>> 968de8d7e... Added README and samples response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -340,8 +352,8 @@ def get_long_running_output(pipeline_response): ======= response_headers = {} response = pipeline_response.http_response - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -580,9 +592,12 @@ async def _release_phone_number_initial( response_headers = {} response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) <<<<<<< HEAD +<<<<<<< HEAD ======= response_headers['Location']=self._deserialize('str', response.headers.get('Location')) >>>>>>> 798b57943... Regenerated code +======= +>>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['release-id']=self._deserialize('str', response.headers.get('release-id')) @@ -789,10 +804,14 @@ async def _update_capabilities_initial( response_headers = {} response_headers['Location']=self._deserialize('str', response.headers.get('Location')) +<<<<<<< HEAD <<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) ======= >>>>>>> 798b57943... Regenerated code +======= + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +>>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) @@ -854,10 +873,14 @@ def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response response_headers['Location']=self._deserialize('str', response.headers.get('Location')) +<<<<<<< HEAD <<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) ======= >>>>>>> 798b57943... Regenerated code +======= + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +>>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py index 0e5eec0ec76b..b7a92b6310fe 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py @@ -93,10 +93,14 @@ def _search_available_phone_numbers_initial( response_headers = {} response_headers['Location']=self._deserialize('str', response.headers.get('Location')) +<<<<<<< HEAD <<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) ======= >>>>>>> 798b57943... Regenerated code +======= + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +>>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -154,10 +158,14 @@ def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response response_headers['Location']=self._deserialize('str', response.headers.get('Location')) +<<<<<<< HEAD <<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) ======= >>>>>>> 798b57943... Regenerated code +======= + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +>>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -289,12 +297,16 @@ def _purchase_phone_numbers_initial( raise HttpResponseError(response=response, model=error) response_headers = {} +<<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) <<<<<<< HEAD response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) ======= +======= +>>>>>>> 968de8d7e... Added README and samples response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -349,8 +361,8 @@ def get_long_running_output(pipeline_response): ======= response_headers = {} response = pipeline_response.http_response - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -593,9 +605,12 @@ def _release_phone_number_initial( response_headers = {} response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) <<<<<<< HEAD +<<<<<<< HEAD ======= response_headers['Location']=self._deserialize('str', response.headers.get('Location')) >>>>>>> 798b57943... Regenerated code +======= +>>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['release-id']=self._deserialize('str', response.headers.get('release-id')) @@ -805,10 +820,14 @@ def _update_capabilities_initial( response_headers = {} response_headers['Location']=self._deserialize('str', response.headers.get('Location')) +<<<<<<< HEAD <<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) ======= >>>>>>> 798b57943... Regenerated code +======= + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +>>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) @@ -871,10 +890,14 @@ def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response response_headers['Location']=self._deserialize('str', response.headers.get('Location')) +<<<<<<< HEAD <<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) ======= >>>>>>> 798b57943... Regenerated code +======= + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) +>>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) diff --git a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py index 007972868392..fbda399bfaa7 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py @@ -22,7 +22,7 @@ >>>>>>> 798b57943... Regenerated code Set the environment variables with your own values before running the sample: 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service - 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER - The phone number you want to get its information + 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_INFORMATION - The phone number you want to get its information """ import os @@ -32,10 +32,14 @@ connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') <<<<<<< HEAD +<<<<<<< HEAD phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") # e.g. "+18001234567" ======= phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") >>>>>>> 798b57943... Regenerated code +======= +phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_INFORMATION") +>>>>>>> 968de8d7e... Added README and samples phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) def get_phone_number_information(): diff --git a/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py index a52bae6d167b..a5d4e89e1a5f 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py @@ -7,11 +7,19 @@ # -------------------------------------------------------------------------- """ +<<<<<<< HEAD FILE: purchase_phone_number_sample.py DESCRIPTION: This sample demonstrates how to purchase a phone number using the search id you got from the search_available_phone_number API USAGE: python purchase_phone_number_sample.py +======= +FILE: phone_number_area_codes_sample.py +DESCRIPTION: + This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. +USAGE: + python list_acquired_phone_numbers_sample.py +>>>>>>> 968de8d7e... Added README and samples Set the environment variables with your own values before running the sample: 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service 2) AZURE_COMMUNICATION_SERVICE_SEARCH_ID_TO_PURCHASE - The search id for the phone number you reserved and want to purchase @@ -23,6 +31,7 @@ ) connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') +<<<<<<< HEAD search_id = os.getenv("AZURE_COMMUNICATION_SERVICE_SEARCH_ID_TO_PURCHASE") phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) @@ -36,4 +45,17 @@ def purchase_phone_number(): if __name__ == '__main__': - purchase_phone_number() \ No newline at end of file + purchase_phone_number() +======= +phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_INFORMATION") +phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) + +def get_phone_number_information(): + phone_number_information = phone_numbers_client.get_phone_number(phone_number) + print('Phone number information:') + print(phone_number_information) + + +if __name__ == '__main__': + get_phone_number_information() +>>>>>>> 968de8d7e... Added README and samples diff --git a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py index 4f99c63bb6b7..f07ec3898a59 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- """ +<<<<<<< HEAD FILE: release_phone_number_sample.py DESCRIPTION: This sample demonstrates how to release a previously acquired phone number using your connection string. @@ -15,6 +16,16 @@ Set the environment variables with your own values before running the sample: 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE - The phone number you want to release +======= +FILE: phone_number_area_codes_sample.py +DESCRIPTION: + This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. +USAGE: + python list_acquired_phone_numbers_sample.py + Set the environment variables with your own values before running the sample: + 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service + 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_RELEASE - The phone number you want to release +>>>>>>> 968de8d7e... Added README and samples """ import os @@ -23,15 +34,25 @@ ) connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') +<<<<<<< HEAD phone_number_to_release = os.getenv( "AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE" # e.g. "+18001234567" ) +======= +phone_number_to_release = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_RELEASE") +>>>>>>> 968de8d7e... Added README and samples phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) def release_phone_number(): poller = phone_numbers_client.begin_release_phone_number(phone_number_to_release) poller.result() +<<<<<<< HEAD print('Status of the operation: ' + poller.status()) +======= + print('Status of the operation:') + print(poller.status()) + +>>>>>>> 968de8d7e... Added README and samples if __name__ == '__main__': release_phone_number() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py index 0731b9e474e0..5502ba866cbe 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py @@ -7,11 +7,19 @@ # -------------------------------------------------------------------------- """ +<<<<<<< HEAD FILE: search_available_phone_numbers_sample.py DESCRIPTION: This sample demonstrates how to search for available numbers you can buy with the respective API. USAGE: python search_available_phone_numbers_sample.py +======= +FILE: phone_number_area_codes_sample.py +DESCRIPTION: + This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. +USAGE: + python list_acquired_phone_numbers_sample.py +>>>>>>> 968de8d7e... Added README and samples Set the environment variables with your own values before running the sample: 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service 2) AZURE_COMMUNICATION_SERVICE_AREA_CODE - The area code you want the number to be in @@ -23,7 +31,11 @@ PhoneNumberType, PhoneNumberAssignmentType, PhoneNumberCapabilities, +<<<<<<< HEAD PhoneNumberCapabilityType +======= + PhoneNumberCapabilityValue +>>>>>>> 968de8d7e... Added README and samples ) connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') @@ -32,8 +44,13 @@ def search_available_phone_numbers(): capabilities = PhoneNumberCapabilities( +<<<<<<< HEAD calling = PhoneNumberCapabilityType.INBOUND, sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND +======= + calling = PhoneNumberCapabilityValue.INBOUND, + sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND +>>>>>>> 968de8d7e... Added README and samples ) poller = phone_numbers_client.begin_search_available_phone_numbers( "US", @@ -44,8 +61,17 @@ def search_available_phone_numbers(): 1, polling = True ) +<<<<<<< HEAD print('Acquired phone numbers: ' + poller.result()) if __name__ == '__main__': - search_available_phone_numbers() \ No newline at end of file + search_available_phone_numbers() +======= + print('Acquired phone numbers:') + print(poller.result) + + +if __name__ == '__main__': + list_acquired_phone_numbers() +>>>>>>> 968de8d7e... Added README and samples diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md b/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md index be070849100c..62d1d0410482 100644 --- a/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md +++ b/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md @@ -12,6 +12,7 @@ autorest ./PHONE_NUMBER_SWAGGER.md ``` yaml <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a4d1e1516433894fca89f9600a6ac8a5471fc598/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json ======= input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/f20d92b324842b407e0dcce36ad0e67bd9bb66cf/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json @@ -19,6 +20,9 @@ input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/f20d92b ======= input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/e23190a5bc64cd8526d08b6c2c1d616939bc88b3/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json >>>>>>> 798b57943... Regenerated code +======= +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/967da531665d4b51a7a5599324e5edd95489cc3d/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json +>>>>>>> 968de8d7e... Added README and samples output-folder: ../azure/communication/phonenumbers/_generated namespace: azure.communication.phonenumbers license-header: MICROSOFT_MIT_NO_VERSION diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml index e22fd396e9fc..cb85742d2524 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml @@ -11,6 +11,7 @@ interactions: Date: <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - Mon, 22 Feb 2021 19:48:24 GMT ======= @@ -22,11 +23,15 @@ interactions: ======= - Thu, 11 Feb 2021 23:15:38 GMT >>>>>>> 798b57943... Regenerated code +======= + - Mon, 15 Feb 2021 17:03:10 GMT +>>>>>>> 968de8d7e... Added README and samples User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET +<<<<<<< HEAD <<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18335260208?api-version=2021-03-07 response: @@ -53,12 +58,21 @@ interactions: ======= "none"}, "assignmentType": "User"}' >>>>>>> 798b57943... Regenerated code +======= + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272412?api-version=2021-03-07 + response: + body: + string: '{"id": "18332272412", "phoneNumber": "+18332272412", "countryCode": + "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", + "sms": "inbound+outbound"}, "assignmentType": "Application"}' +>>>>>>> 968de8d7e... Added README and samples headers: content-type: - application/json; charset=utf-8 date: <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - Mon, 22 Feb 2021 19:48:23 GMT ms-cv: @@ -78,6 +92,11 @@ interactions: ms-cv: - 0Fa+iu/NaEivjqj8QV7AwQ.0 >>>>>>> 798b57943... Regenerated code +======= + - Mon, 15 Feb 2021 17:03:08 GMT + ms-cv: + - Sz35r6+6dUyc5CXXRpte2A.0 +>>>>>>> 968de8d7e... Added README and samples request-context: - appId= transfer-encoding: @@ -85,6 +104,7 @@ interactions: x-processing-time: <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - 847ms ======= @@ -96,6 +116,9 @@ interactions: ======= - 828ms >>>>>>> 798b57943... Regenerated code +======= + - 970ms +>>>>>>> 968de8d7e... Added README and samples status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml deleted file mode 100644 index e8c067a1c78c..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml +++ /dev/null @@ -1,82 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Thu, 11 Feb 2021 23:15:40 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 - response: - body: - string: '{"phoneNumbers": [{"id": "16194895875", "phoneNumber": "+16194895875", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": "16194895877", - "phoneNumber": "+16194895877", "countryCode": "US", "phoneNumberType": "Geographic", - "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": - "User"}, {"id": "16194895878", "phoneNumber": "+16194895878", "countryCode": - "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "User"}, {"id": "16194895879", "phoneNumber": - "+16194895879", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": - {"calling": "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": - "16194895880", "phoneNumber": "+16194895880", "countryCode": "US", "phoneNumberType": - "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": - "User"}, {"id": "16194895882", "phoneNumber": "+16194895882", "countryCode": - "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "User"}, {"id": "16194895885", "phoneNumber": - "+16194895885", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": - {"calling": "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": - "16194895887", "phoneNumber": "+16194895887", "countryCode": "US", "phoneNumberType": - "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": - "User"}, {"id": "16194895889", "phoneNumber": "+16194895889", "countryCode": - "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "User"}, {"id": "18332271680", "phoneNumber": - "+18332271680", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": - {"calling": "none", "sms": "outbound"}, "assignmentType": "Application"}, - {"id": "18332272412", "phoneNumber": "+18332272412", "countryCode": "US", - "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": - "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332272430", - "phoneNumber": "+18332272430", "countryCode": "US", "phoneNumberType": "TollFree", - "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": - "Application"}, {"id": "18332272445", "phoneNumber": "+18332272445", "countryCode": - "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", - "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332321209", - "phoneNumber": "+18332321209", "countryCode": "US", "phoneNumberType": "TollFree", - "capabilities": {"calling": "none", "sms": "inbound+outbound"}, "assignmentType": - "Application"}, {"id": "18332321221", "phoneNumber": "+18332321221", "countryCode": - "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "none", "sms": - "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332321226", - "phoneNumber": "+18332321226", "countryCode": "US", "phoneNumberType": "TollFree", - "capabilities": {"calling": "none", "sms": "inbound+outbound"}, "assignmentType": - "Application"}, {"id": "18335260208", "phoneNumber": "+18335260208", "countryCode": - "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", - "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18336369501", - "phoneNumber": "+18336369501", "countryCode": "US", "phoneNumberType": "TollFree", - "capabilities": {"calling": "inbound+outbound", "sms": "none"}, "assignmentType": - "Application"}]}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Thu, 11 Feb 2021 23:15:40 GMT - ms-cv: - - 0k/4PQ1Ca0WmrSBuPE9Svg.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 815ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml index 23009e4d88e3..21449229dadc 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml @@ -1,7 +1,7 @@ interactions: - request: body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": - {"calling": "inbound", "sms": "inbound+outbound"}, "areaCode": "833", "quantity": + {"calling": "inbound", "sms": "inbound+outbound"}, "areaCode": "844", "quantity": 1}' headers: Accept: @@ -15,7 +15,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 09 Feb 2021 23:12:39 GMT + - Mon, 15 Feb 2021 16:48:55 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -24,251 +24,22 @@ interactions: uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 response: body: - string: '' - headers: - content-length: - - '0' - date: - - Tue, 09 Feb 2021 23:12:41 GMT - ms-cv: - - Lu6bTIinOkK+347LEclljw.0 - operation-location: - - /phoneNumbers/operations/search_b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 - request-context: - - appId= - x-processing-time: - - 1604ms - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Tue, 09 Feb 2021 23:13:11 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 - response: - body: - string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": - "2021-02-09T23:12:41.0837738+00:00", "id": "search_b8db86ec-476d-44c4-811d-303928c645bc", - "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' + string: '{"error": {"code": "InvalidInput", "message": "We are unable to find + phone plans to match your requested capabilities.", "target": "areacode"}}' headers: content-type: - - application/json; charset=utf-8 - date: - - Tue, 09 Feb 2021 23:13:11 GMT - ms-cv: - - /KWc7Qzt2kKhdoBoDp6rQQ.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 581ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Tue, 09 Feb 2021 23:13:12 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 - response: - body: - string: '{"searchId": "b8db86ec-476d-44c4-811d-303928c645bc", "phoneNumbers": - ["+18332272459"], "phoneNumberType": "TollFree", "assignmentType": "Application", - "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": - null, "searchExpiresBy": "2021-02-09T23:28:47.6393852+00:00"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Tue, 09 Feb 2021 23:13:12 GMT - ms-cv: - - d5MuV8GE6EKfkM/IvIv7+g.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 615ms - status: - code: 200 - message: OK -- request: - body: '{"searchId": "b8db86ec-476d-44c4-811d-303928c645bc"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '52' - Content-Type: - application/json - Date: - - Tue, 09 Feb 2021 23:13:13 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/:purchase?api-version=2021-03-07 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Tue, 09 Feb 2021 23:13:13 GMT - ms-cv: - - gufZmnAYNkSNr+ILi5p8cQ.0 - operation-location: - - /phoneNumbers/operations/purchase_b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 - request-context: - - appId= - x-processing-time: - - 1144ms - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Tue, 09 Feb 2021 23:13:44 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 - response: - body: - string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": - "2021-02-09T23:12:41.0837738+00:00", "id": "purchase_b8db86ec-476d-44c4-811d-303928c645bc", - "operationType": "Purchase", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Tue, 09 Feb 2021 23:13:44 GMT - ms-cv: - - IWRiRm4RlUCGbZ7P/XSAkQ.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 588ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Tue, 09 Feb 2021 23:13:45 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/b8db86ec-476d-44c4-811d-303928c645bc?api-version=2021-03-07 - response: - body: - string: '{"searchId": "b8db86ec-476d-44c4-811d-303928c645bc", "phoneNumbers": - ["+18332272459"], "phoneNumberType": "TollFree", "assignmentType": "Application", - "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": - null, "searchExpiresBy": "2021-02-09T23:28:47.6393852+00:00"}' - headers: - content-type: - - application/json; charset=utf-8 date: - - Tue, 09 Feb 2021 23:13:45 GMT + - Mon, 15 Feb 2021 16:48:53 GMT ms-cv: - - qhtPHCmiP0iv/dhdk+EVsw.0 + - 2YSqApoKaEOE7TviEFBpMA.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 586ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Date: - - Tue, 09 Feb 2021 23:13:45 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: DELETE - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272459?api-version=2021-03-07 - response: - body: - string: '' - headers: - date: - - Tue, 09 Feb 2021 23:13:46 GMT - ms-cv: - - svrQMbXLTkq4w+Knna/Hog.0 - operation-location: - - /phoneNumbers/operations/release_5e40cad0-cbab-451b-9aab-08f0b81fb814?api-version=2021-03-07 - request-context: - - appId= - x-processing-time: - - 934ms + - 777ms status: - code: 204 - message: No Content + code: 400 + message: Bad Request version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml new file mode 100644 index 000000000000..d7ca5e5c97a1 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml @@ -0,0 +1,44 @@ +interactions: +- request: + body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": + {"calling": "inbound", "sms": "inbound+outbound"}, "quantity": 1}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '146' + Content-Type: + - application/json + Date: + - Mon, 15 Feb 2021 18:57:45 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 + response: + body: + string: '{"error": {"code": "InvalidInput", "message": "We are unable to find + phone plans to match your requested capabilities.", "target": "areacode"}}' + headers: + content-type: + - application/json + date: + - Mon, 15 Feb 2021 18:57:46 GMT + ms-cv: + - e7d7aFdMpkmwL0Jwb7LJuQ.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 720ms + status: + code: 400 + message: Bad Request +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml new file mode 100644 index 000000000000..6e41a0e870ec --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml @@ -0,0 +1,40 @@ +interactions: +- request: + body: '{"calling": "inbound+outbound", "sms": "outbound"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '50' + Content-Type: + - application/merge-patch+json + Date: + - Fri, 12 Feb 2021 20:30:01 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: PATCH + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875/capabilities?api-version=2021-03-07 + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Fri, 12 Feb 2021 20:30:01 GMT + ms-cv: + - xXho9u+Ns0WcHR62IoSwNA.0 + request-context: + - appId= + x-processing-time: + - 412ms + status: + code: 404 + message: Not Found +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index 3a8a02e17ef5..8297d1d9281e 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -99,22 +99,26 @@ def test_purchase_phone_numbers(self): self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ BodyReplacerProcessor( - keys=["id", "token", "phoneNumber", "phonenumbers"] + keys=[] ), ResponseReplacerProcessor(keys=[self._resource_name])]) + @pytest.mark.live_test_only def test_list_acquired_phone_numbers(self): phone_numbers = self.phone_number_client.list_acquired_phone_numbers() assert phone_numbers.next() - + + @pytest.mark.live_test_only def test_get_phone_number(self): - phone_number = self.phone_number_client.get_phone_number("+16194895875") - assert phone_number.phone_number == "+16194895875" - + phone_number = self.phone_number_client.get_phone_number("+18332272412") + assert phone_number.phone_number == "+18332272412" + + @pytest.mark.live_test_only def test_release_phone_number(self): poller = self.phone_number_client.begin_release_phone_number("+16194895886") assert poller.status() == 'succeeded' + @pytest.mark.live_test_only def test_search_available_phone_numbers(self): capabilities = PhoneNumberCapabilities( calling = PhoneNumberCapabilityValue.INBOUND, @@ -125,22 +129,21 @@ def test_search_available_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - "833", - 1, + None, polling = True ) assert poller.result() - + @pytest.mark.live_test_only def test_update_phone_number_capabilities(self): poller = self.phone_number_client.begin_update_phone_number_capabilities( "+16194895875", PhoneNumberCapabilityValue.OUTBOUND, - PhoneNumberCapabilityValue.OUTBOUND, + PhoneNumberCapabilityValue.INBOUND_OUTBOUND, polling = True ) assert poller.result() - - + + @pytest.mark.live_test_only def test_purchase_phone_numbers(self): capabilities = PhoneNumberCapabilities( calling = PhoneNumberCapabilityValue.INBOUND, @@ -151,8 +154,12 @@ def test_purchase_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, +<<<<<<< HEAD "833", >>>>>>> ea76a164a... Added new pnm redesign code +======= + "844", +>>>>>>> 968de8d7e... Added README and samples 1, polling = True ) @@ -160,6 +167,7 @@ def test_purchase_phone_numbers(self): purchase_poller = self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) assert purchase_poller.result() <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) ======= @@ -173,3 +181,7 @@ def test_purchase_phone_numbers(self): ======= assert release_poller.status() == 'succeeded' >>>>>>> 798b57943... Regenerated code +======= + ##release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) + ##assert release_poller.status() == 'succeeded' +>>>>>>> 968de8d7e... Added README and samples From 62cda6fd55f1623a7bac48be4a16ca94d70d4328 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Tue, 16 Feb 2021 13:34:41 -0600 Subject: [PATCH 19/32] Tests work with new area code --- ...t.test_search_available_phone_numbers.yaml | 65 +++++++++-- ...test_update_phone_number_capabilities.yaml | 104 ++++++++++++++++-- ...on_client_async.test_get_phone_number.yaml | 10 +- ...test_phone_number_administration_client.py | 5 +- 4 files changed, 158 insertions(+), 26 deletions(-) diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml index d7ca5e5c97a1..c0e337ffded5 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml @@ -1,7 +1,8 @@ interactions: - request: body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": - {"calling": "inbound", "sms": "inbound+outbound"}, "quantity": 1}' + {"calling": "inbound", "sms": "inbound+outbound"}, "areaCode": "844", "quantity": + 1}' headers: Accept: - application/json @@ -10,11 +11,11 @@ interactions: Connection: - keep-alive Content-Length: - - '146' + - '165' Content-Type: - application/json Date: - - Mon, 15 Feb 2021 18:57:45 GMT + - Tue, 16 Feb 2021 18:40:28 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -23,22 +24,64 @@ interactions: uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 response: body: - string: '{"error": {"code": "InvalidInput", "message": "We are unable to find - phone plans to match your requested capabilities.", "target": "areacode"}}' + string: '' + headers: + content-length: + - '0' + date: + - Tue, 16 Feb 2021 18:40:27 GMT + ms-cv: + - m3sIDXIbBkWugK33dLdtTQ.0 + operation-id: + - search_6e059e43-dded-43ca-9740-65ec3047e551 + operation-location: + - /phoneNumbers/operations/search_6e059e43-dded-43ca-9740-65ec3047e551?api-version=2021-03-07 + request-context: + - appId= + search-id: + - 6e059e43-dded-43ca-9740-65ec3047e551 + x-processing-time: + - 1563ms + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 16 Feb 2021 18:41:00 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_6e059e43-dded-43ca-9740-65ec3047e551?api-version=2021-03-07 + response: + body: + string: '{"status": "Failed", "resourceLocation": null, "createdDateTime": "2021-02-16T18:40:27.7542139+00:00", + "error": {"code": "OutOfStock", "message": "Error 1000: Not enough stock to + fulfill search request."}, "id": "search_6e059e43-dded-43ca-9740-65ec3047e551", + "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: content-type: - - application/json + - application/json; charset=utf-8 date: - - Mon, 15 Feb 2021 18:57:46 GMT + - Tue, 16 Feb 2021 18:41:00 GMT ms-cv: - - e7d7aFdMpkmwL0Jwb7LJuQ.0 + - sfe/kkZvskqwyUmS3r7wxw.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 720ms + - 2654ms status: - code: 400 - message: Bad Request + code: 200 + message: OK version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml index 6e41a0e870ec..e855d7af1d31 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml @@ -13,28 +13,112 @@ interactions: Content-Type: - application/merge-patch+json Date: - - Fri, 12 Feb 2021 20:30:01 GMT + - Tue, 16 Feb 2021 19:21:29 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: PATCH - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875/capabilities?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18335260208/capabilities?api-version=2021-03-07 response: body: - string: '' + string: '{"capabilitiesUpdateId": "404951bf-440b-4ff3-938c-43cbcdc62f91"}' headers: - content-length: - - '0' + capabilities-id: + - 404951bf-440b-4ff3-938c-43cbcdc62f91 + content-type: + - application/json; charset=utf-8 date: - - Fri, 12 Feb 2021 20:30:01 GMT + - Tue, 16 Feb 2021 19:21:31 GMT ms-cv: - - xXho9u+Ns0WcHR62IoSwNA.0 + - dBNwCvx0C0Cx7bVqcZdyZQ.0 + operation-id: + - capabilities_404951bf-440b-4ff3-938c-43cbcdc62f91 + operation-location: + - /phoneNumbers/operations/capabilities_404951bf-440b-4ff3-938c-43cbcdc62f91?api-version=2021-03-07 request-context: - appId= + transfer-encoding: + - chunked x-processing-time: - - 412ms + - 1267ms status: - code: 404 - message: Not Found + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 16 Feb 2021 19:22:01 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/capabilities_404951bf-440b-4ff3-938c-43cbcdc62f91?api-version=2021-03-07 + response: + body: + string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": + "2021-02-16T19:21:30.6218852+00:00", "id": "capabilities_404951bf-440b-4ff3-938c-43cbcdc62f91", + "operationType": "UpdatePhoneNumberCapabilities", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Tue, 16 Feb 2021 19:22:01 GMT + ms-cv: + - 9I1ueyxoaUaH5olBCjvHnQ.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 642ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 16 Feb 2021 19:22:02 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18335260208/capabilities?api-version=2021-03-07 + response: + body: + string: '{"error": {"code": "UnsupportedApiVersion", "message": "The HTTP resource + that matches the request URI ''https://sanitized.communication.azure.com/phoneNumbers/+18335260208/capabilities'' + does not support the API version ''2021-03-07''.", "innerError": null}}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Tue, 16 Feb 2021 19:22:01 GMT + ms-cv: + - mUgwWEP7I0SD1ghOfm4l4g.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 10ms + status: + code: 400 + message: Bad Request version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml index 238a18af7118..0fb4612dcc3a 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml @@ -5,11 +5,15 @@ interactions: Accept: - application/json Date: +<<<<<<< HEAD <<<<<<< HEAD - Tue, 16 Feb 2021 19:45:38 GMT ======= - Thu, 11 Feb 2021 20:34:10 GMT >>>>>>> 798b57943... Regenerated code +======= + - Tue, 16 Feb 2021 19:28:29 GMT +>>>>>>> 2deb4f44c... Tests work with new area code User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -40,11 +44,11 @@ interactions: string: '{"error": {"code": "Denied", "message": "Denied by the resource provider."}}' headers: content-type: application/json - date: Thu, 11 Feb 2021 20:34:11 GMT - ms-cv: 1vN1Av5Jp02JawMoV/kpYQ.0 + date: Tue, 16 Feb 2021 19:28:29 GMT + ms-cv: t32QEy5Lvky+yflBUjWr8w.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 169ms + x-processing-time: 152ms status: code: 401 message: Unauthorized diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index 8297d1d9281e..104c1ba49350 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -129,14 +129,15 @@ def test_search_available_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - None, + "844", polling = True ) assert poller.result() + @pytest.mark.live_test_only def test_update_phone_number_capabilities(self): poller = self.phone_number_client.begin_update_phone_number_capabilities( - "+16194895875", + "+18335260208", PhoneNumberCapabilityValue.OUTBOUND, PhoneNumberCapabilityValue.INBOUND_OUTBOUND, polling = True From 598c24a75d60df719a403ae97007998b25061b3a Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Tue, 16 Feb 2021 18:07:46 -0600 Subject: [PATCH 20/32] Addresses comments --- .../README.md | 6 ++ .../phonenumbers/_phone_numbers_client.py | 20 +++++ .../communication/phonenumbers/_version.py | 2 +- .../aio/_phone_numbers_client_async.py | 77 ++++++++++++++----- ...stration_client.test_get_phone_number.yaml | 14 ++++ ...on_client_async.test_get_phone_number.yaml | 26 +++++-- ...sync.test_list_acquired_phone_numbers.yaml | 34 ++++---- ...hone_number_administration_client_async.py | 4 +- 8 files changed, 144 insertions(+), 39 deletions(-) diff --git a/sdk/communication/azure-communication-phonenumbers/README.md b/sdk/communication/azure-communication-phonenumbers/README.md index a8d53f57e526..51611565d33c 100644 --- a/sdk/communication/azure-communication-phonenumbers/README.md +++ b/sdk/communication/azure-communication-phonenumbers/README.md @@ -124,6 +124,9 @@ poller = self.phone_number_client.begin_release_phone_number( ) ``` <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> 2b281d8ce... Addresses comments ### Updating Phone Number Capabilities @@ -143,8 +146,11 @@ poller = self.phone_number_client.begin_update_phone_number_capabilities( ) ``` +<<<<<<< HEAD ======= >>>>>>> 968de8d7e... Added README and samples +======= +>>>>>>> 2b281d8ce... Addresses comments # Troubleshooting The Phone Numbers Administration client will raise exceptions defined in [Azure Core][azure_core]. diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py index 9624c476f4e3..034b0e194709 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py @@ -109,7 +109,12 @@ def begin_search_available_phone_numbers( phone_number_type, # type: str assignment_type, # type: str capabilities, # type: PhoneNumberCapabilities +<<<<<<< HEAD quantity=None, # type: int +======= + area_code, # type: str + quantity=1, # type: int +>>>>>>> 2b281d8ce... Addresses comments **kwargs # type: Any ): # type: (...) -> LROPoller[PhoneNumberSearchResult] @@ -143,8 +148,13 @@ def begin_search_available_phone_numbers( phone_number_type=phone_number_type, assignment_type=assignment_type, capabilities=capabilities, +<<<<<<< HEAD quantity=quantity, area_code=kwargs.pop('area_code', None) +======= + area_code=area_code, + quantity=quantity +>>>>>>> 2b281d8ce... Addresses comments ) return self._phone_number_client.phone_numbers.begin_search_available_phone_numbers( country_code, @@ -152,10 +162,14 @@ def begin_search_available_phone_numbers( **kwargs ) <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 798b57943... Regenerated code +======= + +>>>>>>> 2b281d8ce... Addresses comments @distributed_trace def begin_update_phone_number_capabilities( self, @@ -221,6 +235,12 @@ def list_acquired_phone_numbers( :param skip: An optional parameter for how many entries to skip, for pagination purposes. The default value is 0. :type skip: int +<<<<<<< HEAD +======= + :param top: An optional parameter for how many entries to return, for pagination purposes. The + default value is 100. + :type top: int +>>>>>>> 2b281d8ce... Addresses comments :rtype: ~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.models.AcquiredPhoneNumber] """ return self._phone_number_client.phone_numbers.list_phone_numbers( diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_version.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_version.py index a7bc8e8c9303..a01196623d45 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_version.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_version.py @@ -6,4 +6,4 @@ VERSION = "1.0.0b4" -SDK_MONIKER = "communication-administration/{}".format(VERSION) # type: str \ No newline at end of file +SDK_MONIKER = "communication-administration/{}".format(VERSION) # type: str diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py index d7d84d74dd61..b88dbeeaafaf 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py @@ -16,6 +16,7 @@ class PhoneNumbersClient(object): def __init__( self, +<<<<<<< HEAD <<<<<<< HEAD endpoint, # type: str credential, # type: str @@ -54,30 +55,36 @@ def from_connection_string( endpoint, # type: str credential, # type: str **kwargs # type: Any +======= + endpoint, # type: str + credential, # type: str + **kwargs # type: Any +>>>>>>> 2b281d8ce... Addresses comments ): - # type: (...) -> None - try: - if not endpoint.lower().startswith('http'): - endpoint = "https://" + endpoint - except AttributeError: - raise ValueError("Account URL must be a string.") + # type: (...) -> None + try: + if not endpoint.lower().startswith('http'): + endpoint = "https://" + endpoint + except AttributeError: + raise ValueError("Account URL must be a string.") - if not credential: - raise ValueError( - "You need to provide account shared key to authenticate.") + if not credential: + raise ValueError( + "You need to provide account shared key to authenticate.") - self._endpoint = endpoint - self._phone_number_client = PhoneNumbersClientGen( - self._endpoint, - authentication_policy=get_authentication_policy(endpoint, credential, is_async=True), - sdk_moniker=SDK_MONIKER, - **kwargs) + self._endpoint = endpoint + self._phone_number_client = PhoneNumbersClientGen( + self._endpoint, + authentication_policy=get_authentication_policy(endpoint, credential), + sdk_moniker=SDK_MONIKER, + **kwargs) @classmethod def from_connection_string( - cls, conn_str, # type: str - **kwargs # type: Any - ): # type: (...) -> PhoneNumbersAdministrationClient + cls, conn_str, # type: str + **kwargs # type: Any + ): + # type: (...) -> PhoneNumbersAdministrationClient """Create PhoneNumbersAdministrationClient from a Connection String. :param str conn_str: A connection string to an Azure Communication Service resource. @@ -89,11 +96,15 @@ def from_connection_string( return cls(endpoint, access_key, **kwargs) <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 798b57943... Regenerated code +======= + +>>>>>>> 2b281d8ce... Addresses comments @distributed_trace_async async def begin_purchase_phone_numbers( self, @@ -118,10 +129,14 @@ async def begin_purchase_phone_numbers( **kwargs ) <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 798b57943... Regenerated code +======= + +>>>>>>> 2b281d8ce... Addresses comments @distributed_trace_async async def begin_release_phone_number( self, @@ -154,7 +169,12 @@ async def begin_search_available_phone_numbers( phone_number_type, # type: str assignment_type, # type: str capabilities, +<<<<<<< HEAD quantity=None, # type: int +======= + area_code, # type: str + quantity=1, # type: int +>>>>>>> 2b281d8ce... Addresses comments **kwargs ): # type: (...) -> AsyncLROPoller[PhoneNumberSearchResult] @@ -188,8 +208,13 @@ async def begin_search_available_phone_numbers( phone_number_type=phone_number_type, assignment_type=assignment_type, capabilities=capabilities, +<<<<<<< HEAD quantity=quantity, area_code=kwargs.pop('area_code', None) +======= + area_code=area_code, + quantity=quantity +>>>>>>> 2b281d8ce... Addresses comments ) return await self._phone_number_client.phone_numbers.begin_search_available_phone_numbers( country_code, @@ -201,8 +226,13 @@ async def begin_search_available_phone_numbers( async def begin_update_phone_number_capabilities( self, phone_number, # type: str +<<<<<<< HEAD sms = None, # type: str calling = None, # type: str +======= + sms, # type: str + calling, # type: str +>>>>>>> 2b281d8ce... Addresses comments **kwargs # type: Any ): # type: (...) -> AsyncLROPoller["_models.AcquiredPhoneNumber"] @@ -253,6 +283,7 @@ async def get_phone_number( @distributed_trace def list_acquired_phone_numbers( +<<<<<<< HEAD <<<<<<< HEAD self, **kwargs # type: Any @@ -260,6 +291,10 @@ def list_acquired_phone_numbers( self, **kwargs >>>>>>> 798b57943... Regenerated code +======= + self, + **kwargs # type: Any +>>>>>>> 2b281d8ce... Addresses comments ): # type: (...) -> AsyncItemPaged[AcquiredPhoneNumbers] """Gets the list of all acquired phone numbers. @@ -276,6 +311,7 @@ def list_acquired_phone_numbers( **kwargs ) <<<<<<< HEAD +<<<<<<< HEAD ======= @distributed_trace_async @@ -310,6 +346,8 @@ async def close(self) -> None: application_id, **kwargs ) +======= +>>>>>>> 2b281d8ce... Addresses comments async def __aenter__(self) -> "PhoneNumbersClient": await self._phone_number_client.__aenter__() @@ -323,4 +361,7 @@ async def close(self) -> None: `~azure.communication.phonenumbers.aio.PhoneNumbersClient` session. """ await self._phone_number_client.__aexit__() +<<<<<<< HEAD >>>>>>> 798b57943... Regenerated code +======= +>>>>>>> 2b281d8ce... Addresses comments diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml index cb85742d2524..5ef05d00ddf9 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml @@ -12,6 +12,7 @@ interactions: <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - Mon, 22 Feb 2021 19:48:24 GMT ======= @@ -26,6 +27,9 @@ interactions: ======= - Mon, 15 Feb 2021 17:03:10 GMT >>>>>>> 968de8d7e... Added README and samples +======= + - Tue, 16 Feb 2021 19:42:45 GMT +>>>>>>> 2b281d8ce... Addresses comments User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -73,6 +77,7 @@ interactions: <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - Mon, 22 Feb 2021 19:48:23 GMT ms-cv: @@ -97,6 +102,11 @@ interactions: ms-cv: - Sz35r6+6dUyc5CXXRpte2A.0 >>>>>>> 968de8d7e... Added README and samples +======= + - Tue, 16 Feb 2021 19:42:46 GMT + ms-cv: + - Npb2F6HCHUCS3PCMa+LVKA.0 +>>>>>>> 2b281d8ce... Addresses comments request-context: - appId= transfer-encoding: @@ -105,6 +115,7 @@ interactions: <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - 847ms ======= @@ -119,6 +130,9 @@ interactions: ======= - 970ms >>>>>>> 968de8d7e... Added README and samples +======= + - 810ms +>>>>>>> 2b281d8ce... Addresses comments status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml index 0fb4612dcc3a..a9798485e5bb 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml @@ -6,6 +6,7 @@ interactions: - application/json Date: <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD - Tue, 16 Feb 2021 19:45:38 GMT ======= @@ -14,11 +15,15 @@ interactions: ======= - Tue, 16 Feb 2021 19:28:29 GMT >>>>>>> 2deb4f44c... Tests work with new area code +======= + - Tue, 16 Feb 2021 19:45:38 GMT +>>>>>>> 2b281d8ce... Addresses comments User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET +<<<<<<< HEAD <<<<<<< HEAD uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272412?api-version=2021-03-07 response: @@ -39,19 +44,30 @@ interactions: url: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272412?api-version=2021-03-07 ======= uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 +======= + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272412?api-version=2021-03-07 +>>>>>>> 2b281d8ce... Addresses comments response: body: - string: '{"error": {"code": "Denied", "message": "Denied by the resource provider."}}' + string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", + "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": + "inbound+outbound"}, "assignmentType": "Application"}' headers: - content-type: application/json - date: Tue, 16 Feb 2021 19:28:29 GMT - ms-cv: t32QEy5Lvky+yflBUjWr8w.0 + content-type: application/json; charset=utf-8 + date: Tue, 16 Feb 2021 19:45:39 GMT + ms-cv: pDmuqc/E1EGttt2gQZMupQ.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 152ms + x-processing-time: 960ms status: +<<<<<<< HEAD code: 401 message: Unauthorized url: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 >>>>>>> 798b57943... Regenerated code +======= + code: 200 + message: OK + url: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272412?api-version=2021-03-07 +>>>>>>> 2b281d8ce... Addresses comments version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml index 501b2c6a1dc3..532de4de2d5e 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml @@ -5,11 +5,15 @@ interactions: Accept: - application/json Date: +<<<<<<< HEAD <<<<<<< HEAD - Mon, 22 Feb 2021 19:49:31 GMT ======= - Thu, 11 Feb 2021 20:20:13 GMT >>>>>>> 798b57943... Regenerated code +======= + - Tue, 16 Feb 2021 19:45:32 GMT +>>>>>>> 2b281d8ce... Addresses comments User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -50,26 +54,26 @@ interactions: ======= string: '{"phoneNumbers": [{"id": "16194895875", "phoneNumber": "+16194895875", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": "16194895877", + "outbound", "sms": "none"}, "assignmentType": "Person"}, {"id": "16194895877", "phoneNumber": "+16194895877", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": - "User"}, {"id": "16194895878", "phoneNumber": "+16194895878", "countryCode": + "Person"}, {"id": "16194895878", "phoneNumber": "+16194895878", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "User"}, {"id": "16194895879", "phoneNumber": + "sms": "none"}, "assignmentType": "Person"}, {"id": "16194895879", "phoneNumber": "+16194895879", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": - {"calling": "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": + {"calling": "outbound", "sms": "none"}, "assignmentType": "Person"}, {"id": "16194895880", "phoneNumber": "+16194895880", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": - "User"}, {"id": "16194895882", "phoneNumber": "+16194895882", "countryCode": + "Person"}, {"id": "16194895882", "phoneNumber": "+16194895882", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "User"}, {"id": "16194895885", "phoneNumber": + "sms": "none"}, "assignmentType": "Person"}, {"id": "16194895885", "phoneNumber": "+16194895885", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": - {"calling": "outbound", "sms": "none"}, "assignmentType": "User"}, {"id": + {"calling": "outbound", "sms": "none"}, "assignmentType": "Person"}, {"id": "16194895887", "phoneNumber": "+16194895887", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": - "User"}, {"id": "16194895889", "phoneNumber": "+16194895889", "countryCode": + "Person"}, {"id": "16194895889", "phoneNumber": "+16194895889", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "User"}, {"id": "18332271680", "phoneNumber": + "sms": "none"}, "assignmentType": "Person"}, {"id": "18332271680", "phoneNumber": "+18332271680", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "none", "sms": "outbound"}, "assignmentType": "Application"}, {"id": "18332272412", "phoneNumber": "+18332272412", "countryCode": "US", @@ -88,19 +92,23 @@ interactions: "phoneNumber": "+18332321226", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18335260208", "phoneNumber": "+18335260208", "countryCode": - "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", - "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18336369501", + "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound+outbound", + "sms": "outbound"}, "assignmentType": "Application"}, {"id": "18336369501", "phoneNumber": "+18336369501", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound+outbound", "sms": "none"}, "assignmentType": "Application"}]}' headers: content-type: application/json; charset=utf-8 - date: Thu, 11 Feb 2021 20:20:15 GMT - ms-cv: /PDnQzArpkm1GBLVqCNyKg.0 + date: Tue, 16 Feb 2021 19:45:33 GMT + ms-cv: 64fjFm+18EKAQ/UkeQyQuQ.0 request-context: appId= transfer-encoding: chunked +<<<<<<< HEAD x-processing-time: 2257ms >>>>>>> 798b57943... Regenerated code +======= + x-processing-time: 908ms +>>>>>>> 2b281d8ce... Addresses comments status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index b7df8f968f8e..56ebc4ed8258 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -139,8 +139,8 @@ async def test_purchase_phone_numbers(self): ======= async def test_get_phone_number(self): async with self.phone_number_client: - phone_number = await self.phone_number_client.get_phone_number("+16194895875") - assert phone_number.phone_number == "+16194895875" + phone_number = await self.phone_number_client.get_phone_number("+18332272412") + assert phone_number.phone_number == "+18332272412" ''' def test_update_phone_number(self): From 5a34e82bd910d9c5f70ac1060dc18e0fb04b2aa2 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Wed, 17 Feb 2021 11:22:09 -0600 Subject: [PATCH 21/32] Corrected samples --- .../communication/phonenumbers/_phone_numbers_client.py | 3 +++ .../samples/get_phone_number_sample.py | 4 ++++ .../samples/list_acquired_phone_numbers_sample.py | 5 +++++ .../samples/release_phone_number_sample.py | 6 ++++++ 4 files changed, 18 insertions(+) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py index 034b0e194709..eea60ff89667 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py @@ -236,11 +236,14 @@ def list_acquired_phone_numbers( default value is 0. :type skip: int <<<<<<< HEAD +<<<<<<< HEAD ======= :param top: An optional parameter for how many entries to return, for pagination purposes. The default value is 100. :type top: int >>>>>>> 2b281d8ce... Addresses comments +======= +>>>>>>> a11fa64fb... Corrected samples :rtype: ~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.models.AcquiredPhoneNumber] """ return self._phone_number_client.phone_numbers.list_phone_numbers( diff --git a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py index fbda399bfaa7..ca357c697174 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py @@ -33,6 +33,7 @@ connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") # e.g. "+18001234567" ======= phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") @@ -40,6 +41,9 @@ ======= phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_INFORMATION") >>>>>>> 968de8d7e... Added README and samples +======= +phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") +>>>>>>> a11fa64fb... Corrected samples phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) def get_phone_number_information(): diff --git a/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py index a2cabd95c8d9..3d533d576f30 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py @@ -33,12 +33,17 @@ def list_acquired_phone_numbers(): acquired_phone_numbers = phone_numbers_client.list_acquired_phone_numbers() print('Acquired phone numbers:') +<<<<<<< HEAD <<<<<<< HEAD for acquired_phone_number in acquired_phone_numbers: print(acquired_phone_number.phone_number) ======= print(acquired_phone_numbers) >>>>>>> 798b57943... Regenerated code +======= + for acquired_phone_number in acquired_phone_numbers: + print(acquired_phone_number) +>>>>>>> a11fa64fb... Corrected samples if __name__ == '__main__': diff --git a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py index f07ec3898a59..4194dcc385e9 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py @@ -35,12 +35,18 @@ connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') <<<<<<< HEAD +<<<<<<< HEAD phone_number_to_release = os.getenv( "AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE" # e.g. "+18001234567" ) ======= phone_number_to_release = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_RELEASE") >>>>>>> 968de8d7e... Added README and samples +======= +phone_number_to_release = os.getenv( + "AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE" # e.g. "+18001234567" +) +>>>>>>> a11fa64fb... Corrected samples phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) def release_phone_number(): From 92bc389134a42ff6a8fe722151d91522ccf8112c Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Wed, 17 Feb 2021 17:37:54 -0600 Subject: [PATCH 22/32] Added fixed samples --- .../communication/phonenumbers/__init__.py | 16 ++++ .../samples/get_phone_number_sample.py | 16 +++- .../list_acquired_phone_numbers_sample.py | 6 ++ .../samples/purchase_phone_number_sample.py | 30 +++++- .../samples/release_phone_number_sample.py | 12 ++- .../search_available_phone_numbers_sample.py | 14 ++- ...update_phone_number_capabilities_sample.py | 14 +++ ...hone_number_administration_client_async.py | 93 +++++++++++-------- 8 files changed, 151 insertions(+), 50 deletions(-) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py index cab6c97d04c4..dfba7b332986 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py @@ -8,8 +8,16 @@ from ._generated.models import ( AcquiredPhoneNumber, +<<<<<<< HEAD PhoneNumberCapabilities, PhoneNumberCost, +======= + AcquiredPhoneNumbers, + CommunicationError, + PhoneNumberCapabilities, + PhoneNumberCost, + PhoneNumberOperation, +>>>>>>> cb958a482... Added fixed samples PhoneNumberSearchResult, BillingFrequency, PhoneNumberAssignmentType, @@ -20,8 +28,16 @@ __all__ = [ 'AcquiredPhoneNumber', +<<<<<<< HEAD + 'PhoneNumberCapabilities', + 'PhoneNumberCost', +======= + 'AcquiredPhoneNumbers', + 'CommunicationError', 'PhoneNumberCapabilities', 'PhoneNumberCost', + 'PhoneNumberOperation', +>>>>>>> cb958a482... Added fixed samples 'PhoneNumberSearchResult', 'BillingFrequency', 'PhoneNumberAssignmentType', diff --git a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py index ca357c697174..efa512860a3a 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py @@ -8,6 +8,7 @@ """ <<<<<<< HEAD +<<<<<<< HEAD FILE:get_phone_number_sample.py DESCRIPTION: This sample demonstrates how to get the information from an acquired phone number using your connection string @@ -15,14 +16,21 @@ python get_phone_number_sample.py ======= FILE: phone_number_area_codes_sample.py +======= +FILE:get_phone_number_sample.py +>>>>>>> cb958a482... Added fixed samples DESCRIPTION: - This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. + This sample demonstrates how to get the information from an acquired phone number using your connection string USAGE: +<<<<<<< HEAD python list_acquired_phone_numbers_sample.py >>>>>>> 798b57943... Regenerated code +======= + python get_phone_number_sample.py +>>>>>>> cb958a482... Added fixed samples Set the environment variables with your own values before running the sample: 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service - 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_INFORMATION - The phone number you want to get its information + 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER - The phone number you want to get its information """ import os @@ -34,6 +42,7 @@ <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") # e.g. "+18001234567" ======= phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") @@ -44,6 +53,9 @@ ======= phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") >>>>>>> a11fa64fb... Corrected samples +======= +phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") # e.g. "+18001234567" +>>>>>>> cb958a482... Added fixed samples phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) def get_phone_number_information(): diff --git a/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py index 3d533d576f30..38f0265be5ba 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py @@ -8,6 +8,7 @@ """ <<<<<<< HEAD +<<<<<<< HEAD FILE: list_acquired_phone_numbers_sample.py DESCRIPTION: This sample demonstrates how to get all off you acquired phone numbers using your connection string @@ -16,6 +17,11 @@ DESCRIPTION: This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. >>>>>>> 798b57943... Regenerated code +======= +FILE: list_acquired_phone_numbers_sample.py +DESCRIPTION: + This sample demonstrates how to get all off you acquired phone numbers using your connection string +>>>>>>> cb958a482... Added fixed samples USAGE: python list_acquired_phone_numbers_sample.py Set the environment variables with your own values before running the sample: diff --git a/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py index a5d4e89e1a5f..1af340b23ae9 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py @@ -8,6 +8,7 @@ """ <<<<<<< HEAD +<<<<<<< HEAD FILE: purchase_phone_number_sample.py DESCRIPTION: This sample demonstrates how to purchase a phone number using the search id you got from the search_available_phone_number API @@ -15,11 +16,18 @@ python purchase_phone_number_sample.py ======= FILE: phone_number_area_codes_sample.py +======= +FILE: purchase_phone_number_sample.py +>>>>>>> cb958a482... Added fixed samples DESCRIPTION: - This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. + This sample demonstrates how to purchase a phone number using the search id you got from the search_available_phone_number API USAGE: +<<<<<<< HEAD python list_acquired_phone_numbers_sample.py >>>>>>> 968de8d7e... Added README and samples +======= + python purchase_phone_number_sample.py +>>>>>>> cb958a482... Added fixed samples Set the environment variables with your own values before running the sample: 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service 2) AZURE_COMMUNICATION_SERVICE_SEARCH_ID_TO_PURCHASE - The search id for the phone number you reserved and want to purchase @@ -32,6 +40,7 @@ connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') <<<<<<< HEAD +<<<<<<< HEAD search_id = os.getenv("AZURE_COMMUNICATION_SERVICE_SEARCH_ID_TO_PURCHASE") phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) @@ -48,14 +57,25 @@ def purchase_phone_number(): purchase_phone_number() ======= phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_INFORMATION") +======= +search_id = os.getenv("AZURE_COMMUNICATION_SERVICE_SEARCH_ID_TO_PURCHASE") +>>>>>>> cb958a482... Added fixed samples phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) -def get_phone_number_information(): - phone_number_information = phone_numbers_client.get_phone_number(phone_number) - print('Phone number information:') - print(phone_number_information) +def purchase_phone_number(): + poller = phone_numbers_client.begin_purchase_phone_numbers( + search_id, + polling = True + ) + poller.result() + print("Result from the purchase operation: ") + print(poller.status) if __name__ == '__main__': +<<<<<<< HEAD get_phone_number_information() >>>>>>> 968de8d7e... Added README and samples +======= + purchase_phone_number() +>>>>>>> cb958a482... Added fixed samples diff --git a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py index 4194dcc385e9..df53639ff332 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py @@ -8,6 +8,7 @@ """ <<<<<<< HEAD +<<<<<<< HEAD FILE: release_phone_number_sample.py DESCRIPTION: This sample demonstrates how to release a previously acquired phone number using your connection string. @@ -18,14 +19,21 @@ 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE - The phone number you want to release ======= FILE: phone_number_area_codes_sample.py +======= +FILE: release_phone_number_sample.py +>>>>>>> cb958a482... Added fixed samples DESCRIPTION: - This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. + This sample demonstrates how to release a previously acquired phone number using your connection string. USAGE: - python list_acquired_phone_numbers_sample.py + python release_phone_number_sample.py Set the environment variables with your own values before running the sample: 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service +<<<<<<< HEAD 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_RELEASE - The phone number you want to release >>>>>>> 968de8d7e... Added README and samples +======= + 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE - The phone number you want to release +>>>>>>> cb958a482... Added fixed samples """ import os diff --git a/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py index 5502ba866cbe..c8539a37e06b 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py @@ -8,6 +8,7 @@ """ <<<<<<< HEAD +<<<<<<< HEAD FILE: search_available_phone_numbers_sample.py DESCRIPTION: This sample demonstrates how to search for available numbers you can buy with the respective API. @@ -15,11 +16,18 @@ python search_available_phone_numbers_sample.py ======= FILE: phone_number_area_codes_sample.py +======= +FILE: search_available_phone_numbers_sample.py +>>>>>>> cb958a482... Added fixed samples DESCRIPTION: - This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. + This sample demonstrates how to search for available numbers you can buy with the respective API. USAGE: +<<<<<<< HEAD python list_acquired_phone_numbers_sample.py >>>>>>> 968de8d7e... Added README and samples +======= + python search_available_phone_numbers_sample.py +>>>>>>> cb958a482... Added fixed samples Set the environment variables with your own values before running the sample: 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service 2) AZURE_COMMUNICATION_SERVICE_AREA_CODE - The area code you want the number to be in @@ -73,5 +81,9 @@ def search_available_phone_numbers(): if __name__ == '__main__': +<<<<<<< HEAD list_acquired_phone_numbers() >>>>>>> 968de8d7e... Added README and samples +======= + search_available_phone_numbers() +>>>>>>> cb958a482... Added fixed samples diff --git a/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py index 1985b1f671b2..246e278a0fd0 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py @@ -20,7 +20,11 @@ import os from azure.communication.phonenumbers import ( PhoneNumbersClient, +<<<<<<< HEAD PhoneNumberCapabilityType +======= + PhoneNumberCapabilityValue +>>>>>>> cb958a482... Added fixed samples ) connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') @@ -32,12 +36,22 @@ def update_phone_number_capabilities(): poller = phone_numbers_client.begin_update_phone_number_capabilities( "+18335260208", +<<<<<<< HEAD PhoneNumberCapabilityType.OUTBOUND, PhoneNumberCapabilityType.INBOUND_OUTBOUND, polling = True ) poller.result() print('Status of the operation: ' + poller.status()) +======= + PhoneNumberCapabilityValue.OUTBOUND, + PhoneNumberCapabilityValue.INBOUND_OUTBOUND, + polling = True + ) + poller.result() + print('Status of the operation:') + print(poller.status()) +>>>>>>> cb958a482... Added fixed samples if __name__ == '__main__': update_phone_number_capabilities() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index 56ebc4ed8258..0a8e816f778b 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -40,6 +40,7 @@ def setUp(self): ResponseReplacerProcessor(keys=[self._resource_name])]) @AsyncCommunicationTestCase.await_prepared_test +<<<<<<< HEAD <<<<<<< HEAD @pytest.mark.live_test_only async def test_list_all_phone_numbers_from_managed_identity(self): @@ -57,6 +58,9 @@ async def test_list_all_phone_numbers_from_managed_identity(self): @pytest.mark.live_test_only ======= >>>>>>> 798b57943... Regenerated code +======= + @pytest.mark.live_test_only +>>>>>>> cb958a482... Added fixed samples async def test_list_acquired_phone_numbers(self): async with self.phone_number_client: phone_numbers = self.phone_number_client.list_acquired_phone_numbers() @@ -66,6 +70,7 @@ async def test_list_acquired_phone_numbers(self): assert len(items) > 0 @AsyncCommunicationTestCase.await_prepared_test +<<<<<<< HEAD <<<<<<< HEAD @pytest.mark.live_test_only async def test_get_phone_number(self): @@ -137,70 +142,78 @@ async def test_purchase_phone_numbers(self): ======= >>>>>>> ea76a164a... Added new pnm redesign code ======= +======= + @pytest.mark.live_test_only +>>>>>>> cb958a482... Added fixed samples async def test_get_phone_number(self): async with self.phone_number_client: phone_number = await self.phone_number_client.get_phone_number("+18332272412") assert phone_number.phone_number == "+18332272412" - ''' - def test_update_phone_number(self): - updated_phone_number = self.phone_number_client.update_phone_number( - "+16194895842", - "", - "" - ) - assert updated_phone_number.application_id == "" @AsyncCommunicationTestCase.await_prepared_test + @pytest.mark.live_test_only async def test_release_phone_number(self): async with self.phone_number_client: poller = await self.phone_number_client.begin_release_phone_number("+16194895875") result = await poller.result() assert result - - def test_search_available_phone_numbers(self): + + @AsyncCommunicationTestCase.await_prepared_test + @pytest.mark.live_test_only + async def test_search_available_phone_numbers(self): capabilities = PhoneNumberCapabilities( calling = PhoneNumberCapabilityValue.INBOUND, sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND ) - poller = self.phone_number_client.begin_search_available_phone_numbers( - "US", - PhoneNumberType.TOLL_FREE, - PhoneNumberAssignmentType.APPLICATION, - capabilities, - "833", - 1, - polling = True - ) + async with self.phone_number_client: + poller = await self.phone_number_client.begin_search_available_phone_numbers( + "US", + PhoneNumberType.TOLL_FREE, + PhoneNumberAssignmentType.APPLICATION, + capabilities, + "833", + 1, + polling = True + ) assert poller.result() - def test_update_phone_number_capabilities(self): - poller = self.phone_number_client.begin_update_phone_number_capabilities( - "+16194895875", - PhoneNumberCapabilityValue.OUTBOUND, - PhoneNumberCapabilityValue.OUTBOUND, - polling = True - ) + @AsyncCommunicationTestCase.await_prepared_test + @pytest.mark.live_test_only + async def test_update_phone_number_capabilities(self): + async with self.phone_number_client: + poller = self.phone_number_client.begin_update_phone_number_capabilities( + "+16194895875", + PhoneNumberCapabilityValue.OUTBOUND, + PhoneNumberCapabilityValue.OUTBOUND, + polling = True + ) assert poller.result() - def test_purchase_phone_numbers(self): + @AsyncCommunicationTestCase.await_prepared_test + @pytest.mark.live_test_only + async def test_purchase_phone_numbers(self): capabilities = PhoneNumberCapabilities( calling = PhoneNumberCapabilityValue.INBOUND, sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND ) - search_poller = self.phone_number_client.begin_search_available_phone_numbers( - "US", - PhoneNumberType.TOLL_FREE, - PhoneNumberAssignmentType.APPLICATION, - capabilities, - "833", - 1, - polling = True - ) - phone_number_to_buy = search_poller.result() - purchase_poller = self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) - assert purchase_poller.result() - release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) + async with self.phone_number_client: + search_poller = await self.phone_number_client.begin_search_available_phone_numbers( + "US", + PhoneNumberType.TOLL_FREE, + PhoneNumberAssignmentType.APPLICATION, + capabilities, + "833", + 1, + polling = True + ) + phone_number_to_buy = search_poller.result() + purchase_poller = await self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) + assert purchase_poller.result() + release_poller = await self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) assert release_poller.status() == 'succeeded' +<<<<<<< HEAD ''' >>>>>>> 798b57943... Regenerated code +======= +>>>>>>> cb958a482... Added fixed samples From 4141b14967cdf30f7e53f8b7645601b7318f1b22 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Thu, 18 Feb 2021 11:46:31 -0600 Subject: [PATCH 23/32] Removed hardcoded info from tests --- ...test_phone_number_administration_client.py | 33 +++++++++++++++---- ...hone_number_administration_client_async.py | 26 ++++++++++----- 2 files changed, 44 insertions(+), 15 deletions(-) diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index 104c1ba49350..60cced5a1b8b 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -1,4 +1,5 @@ <<<<<<< HEAD +<<<<<<< HEAD import os import pytest from azure.communication.phonenumbers import PhoneNumbersClient @@ -7,6 +8,9 @@ from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityType, PhoneNumberType from azure.communication.phonenumbers._shared.utils import parse_connection_str ======= +======= +import os +>>>>>>> dae559a62... Removed hardcoded info from tests import pytest from azure.communication.phonenumbers import PhoneNumbersClient from _shared.testcase import CommunicationTestCase, ResponseReplacerProcessor, BodyReplacerProcessor @@ -17,6 +21,9 @@ class NewTests(CommunicationTestCase): def setUp(self): super(NewTests, self).setUp() <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> dae559a62... Removed hardcoded info from tests if self.is_playback(): self.phone_number = "+18000005555" self.phone_number_to_release = "+18000005556" @@ -27,6 +34,7 @@ def setUp(self): self.phone_number_to_release = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE") self.country_code = os.getenv("AZURE_COMMUNICATION_SERVICE_COUNTRY_CODE") self.area_code = os.getenv("AZURE_COMMUNICATION_SERIVCE_AREA_CODE") +<<<<<<< HEAD self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ BodyReplacerProcessor( @@ -96,6 +104,8 @@ def test_purchase_phone_numbers(self): capabilities, self.area_code, ======= +======= +>>>>>>> dae559a62... Removed hardcoded info from tests self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ BodyReplacerProcessor( @@ -110,12 +120,12 @@ def test_list_acquired_phone_numbers(self): @pytest.mark.live_test_only def test_get_phone_number(self): - phone_number = self.phone_number_client.get_phone_number("+18332272412") - assert phone_number.phone_number == "+18332272412" + phone_number = self.phone_number_client.get_phone_number(self.phone_number) + assert phone_number.phone_number == self.phone_number @pytest.mark.live_test_only def test_release_phone_number(self): - poller = self.phone_number_client.begin_release_phone_number("+16194895886") + poller = self.phone_number_client.begin_release_phone_number(self.phone_number_to_release) assert poller.status() == 'succeeded' @pytest.mark.live_test_only @@ -125,11 +135,11 @@ def test_search_available_phone_numbers(self): sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND ) poller = self.phone_number_client.begin_search_available_phone_numbers( - "US", + self.country_code, PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - "844", + self.area_code, polling = True ) assert poller.result() @@ -137,7 +147,7 @@ def test_search_available_phone_numbers(self): @pytest.mark.live_test_only def test_update_phone_number_capabilities(self): poller = self.phone_number_client.begin_update_phone_number_capabilities( - "+18335260208", + self.phone_number, PhoneNumberCapabilityValue.OUTBOUND, PhoneNumberCapabilityValue.INBOUND_OUTBOUND, polling = True @@ -151,16 +161,20 @@ def test_purchase_phone_numbers(self): sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND ) search_poller = self.phone_number_client.begin_search_available_phone_numbers( - "US", + self.country_code, PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, +<<<<<<< HEAD <<<<<<< HEAD "833", >>>>>>> ea76a164a... Added new pnm redesign code ======= "844", >>>>>>> 968de8d7e... Added README and samples +======= + self.area_code, +>>>>>>> dae559a62... Removed hardcoded info from tests 1, polling = True ) @@ -169,6 +183,7 @@ def test_purchase_phone_numbers(self): assert purchase_poller.result() <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) ======= @@ -186,3 +201,7 @@ def test_purchase_phone_numbers(self): ##release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) ##assert release_poller.status() == 'succeeded' >>>>>>> 968de8d7e... Added README and samples +======= + release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) + assert release_poller.status() == 'succeeded' +>>>>>>> dae559a62... Removed hardcoded info from tests diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index 0a8e816f778b..edbdc062fae7 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -1,8 +1,12 @@ <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD import os ======= >>>>>>> 798b57943... Regenerated code +======= +import os +>>>>>>> dae559a62... Removed hardcoded info from tests import pytest from azure.communication.phonenumbers.aio import PhoneNumbersClient from _shared.asynctestcase import AsyncCommunicationTestCase @@ -19,6 +23,9 @@ class NewTests(AsyncCommunicationTestCase): def setUp(self): super(NewTests, self).setUp() <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> dae559a62... Removed hardcoded info from tests if self.is_playback(): self.phone_number = "+18000005555" self.phone_number_to_release = "+18000005556" @@ -30,8 +37,11 @@ def setUp(self): self.country_code = os.getenv("AZURE_COMMUNICATION_SERVICE_COUNTRY_CODE") self.area_code = os.getenv("AZURE_COMMUNICATION_SERIVCE_AREA_CODE") +<<<<<<< HEAD ======= >>>>>>> 798b57943... Regenerated code +======= +>>>>>>> dae559a62... Removed hardcoded info from tests self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ BodyReplacerProcessor( @@ -147,15 +157,15 @@ async def test_purchase_phone_numbers(self): >>>>>>> cb958a482... Added fixed samples async def test_get_phone_number(self): async with self.phone_number_client: - phone_number = await self.phone_number_client.get_phone_number("+18332272412") - assert phone_number.phone_number == "+18332272412" + phone_number = await self.phone_number_client.get_phone_number(self.phone_number) + assert phone_number.phone_number == self.phone_number @AsyncCommunicationTestCase.await_prepared_test @pytest.mark.live_test_only async def test_release_phone_number(self): async with self.phone_number_client: - poller = await self.phone_number_client.begin_release_phone_number("+16194895875") + poller = await self.phone_number_client.begin_release_phone_number(self.phone_number_to_release) result = await poller.result() assert result @@ -168,11 +178,11 @@ async def test_search_available_phone_numbers(self): ) async with self.phone_number_client: poller = await self.phone_number_client.begin_search_available_phone_numbers( - "US", + self.country_code, PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - "833", + self.area_code, 1, polling = True ) @@ -183,7 +193,7 @@ async def test_search_available_phone_numbers(self): async def test_update_phone_number_capabilities(self): async with self.phone_number_client: poller = self.phone_number_client.begin_update_phone_number_capabilities( - "+16194895875", + self.phone_number, PhoneNumberCapabilityValue.OUTBOUND, PhoneNumberCapabilityValue.OUTBOUND, polling = True @@ -199,11 +209,11 @@ async def test_purchase_phone_numbers(self): ) async with self.phone_number_client: search_poller = await self.phone_number_client.begin_search_available_phone_numbers( - "US", + self.country_code, PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - "833", + self.area_code, 1, polling = True ) From 0b1974649eef87d0e1a9e0338291a964190d6ce9 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Mon, 22 Feb 2021 13:35:01 -0600 Subject: [PATCH 24/32] Added managed identity tests and addressed apiview comments --- .../phonenumbers/_phone_numbers_client.py | 9 +++++++ .../aio/_phone_numbers_client_async.py | 16 ++++++++++++ ...test_phone_number_administration_client.py | 15 ++++++++++- ...hone_number_administration_client_async.py | 25 +++++++++++++++++-- 4 files changed, 62 insertions(+), 3 deletions(-) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py index eea60ff89667..b611d9ffb1bc 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py @@ -109,12 +109,16 @@ def begin_search_available_phone_numbers( phone_number_type, # type: str assignment_type, # type: str capabilities, # type: PhoneNumberCapabilities +<<<<<<< HEAD <<<<<<< HEAD quantity=None, # type: int ======= area_code, # type: str quantity=1, # type: int >>>>>>> 2b281d8ce... Addresses comments +======= + quantity=None, # type: int +>>>>>>> 33c619188... Added managed identity tests and addressed apiview comments **kwargs # type: Any ): # type: (...) -> LROPoller[PhoneNumberSearchResult] @@ -148,6 +152,7 @@ def begin_search_available_phone_numbers( phone_number_type=phone_number_type, assignment_type=assignment_type, capabilities=capabilities, +<<<<<<< HEAD <<<<<<< HEAD quantity=quantity, area_code=kwargs.pop('area_code', None) @@ -155,6 +160,10 @@ def begin_search_available_phone_numbers( area_code=area_code, quantity=quantity >>>>>>> 2b281d8ce... Addresses comments +======= + quantity=quantity, + area_code=kwargs.pop('area_code', None) +>>>>>>> 33c619188... Added managed identity tests and addressed apiview comments ) return self._phone_number_client.phone_numbers.begin_search_available_phone_numbers( country_code, diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py index b88dbeeaafaf..8077c760807d 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py @@ -47,6 +47,7 @@ def from_connection_string( ): # type: (...) -> PhoneNumbersClient """Create PhoneNumbersClient from a Connection String. +<<<<<<< HEAD :param str conn_str: A connection string to an Azure Communication Service resource. :returns: Instance of PhoneNumbersClient. @@ -91,6 +92,12 @@ def from_connection_string( :returns: Instance of PhoneNumbersAdministrationClient. :rtype: ~azure.communication.PhoneNumbersAdministrationClient >>>>>>> 798b57943... Regenerated code +======= + :param str conn_str: + A connection string to an Azure Communication Service resource. + :returns: Instance of PhoneNumbersClient. + :rtype: ~azure.communication.phonenumbers.aio.PhoneNumbersClient +>>>>>>> 33c619188... Added managed identity tests and addressed apiview comments """ endpoint, access_key = parse_connection_str(conn_str) @@ -169,12 +176,16 @@ async def begin_search_available_phone_numbers( phone_number_type, # type: str assignment_type, # type: str capabilities, +<<<<<<< HEAD <<<<<<< HEAD quantity=None, # type: int ======= area_code, # type: str quantity=1, # type: int >>>>>>> 2b281d8ce... Addresses comments +======= + quantity=None, # type: int +>>>>>>> 33c619188... Added managed identity tests and addressed apiview comments **kwargs ): # type: (...) -> AsyncLROPoller[PhoneNumberSearchResult] @@ -208,6 +219,7 @@ async def begin_search_available_phone_numbers( phone_number_type=phone_number_type, assignment_type=assignment_type, capabilities=capabilities, +<<<<<<< HEAD <<<<<<< HEAD quantity=quantity, area_code=kwargs.pop('area_code', None) @@ -215,6 +227,10 @@ async def begin_search_available_phone_numbers( area_code=area_code, quantity=quantity >>>>>>> 2b281d8ce... Addresses comments +======= + quantity=quantity, + area_code=kwargs.pop('area_code', None) +>>>>>>> 33c619188... Added managed identity tests and addressed apiview comments ) return await self._phone_number_client.phone_numbers.begin_search_available_phone_numbers( country_code, diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index 60cced5a1b8b..acf7545c3ca0 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -5,6 +5,7 @@ from azure.communication.phonenumbers import PhoneNumbersClient from _shared.testcase import CommunicationTestCase, ResponseReplacerProcessor, BodyReplacerProcessor from _shared.utils import create_token_credential +<<<<<<< HEAD from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityType, PhoneNumberType from azure.communication.phonenumbers._shared.utils import parse_connection_str ======= @@ -16,6 +17,10 @@ from _shared.testcase import CommunicationTestCase, ResponseReplacerProcessor, BodyReplacerProcessor from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType >>>>>>> ea76a164a... Added new pnm redesign code +======= +from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType +from azure.communication.phonenumbers._shared.utils import parse_connection_str +>>>>>>> 33c619188... Added managed identity tests and addressed apiview comments class NewTests(CommunicationTestCase): def setUp(self): @@ -113,6 +118,14 @@ def test_purchase_phone_numbers(self): ), ResponseReplacerProcessor(keys=[self._resource_name])]) + @pytest.mark.live_test_only + def test_list_all_phone_numbers_from_managed_identity(self): + endpoint, access_key = parse_connection_str(self.connection_str) + credential = create_token_credential() + phone_number_client = PhoneNumbersClient(endpoint, credential) + phone_numbers = phone_number_client.list_all_phone_numbers() + assert phone_numbers.next() + @pytest.mark.live_test_only def test_list_acquired_phone_numbers(self): phone_numbers = self.phone_number_client.list_acquired_phone_numbers() @@ -139,7 +152,7 @@ def test_search_available_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - self.area_code, + area_code=self.area_code, polling = True ) assert poller.result() diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index edbdc062fae7..6501226d0da0 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -12,12 +12,18 @@ from _shared.asynctestcase import AsyncCommunicationTestCase from _shared.testcase import ResponseReplacerProcessor, BodyReplacerProcessor <<<<<<< HEAD +<<<<<<< HEAD from _shared.utils import create_token_credential from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityType, PhoneNumberType from azure.communication.phonenumbers._shared.utils import parse_connection_str ======= from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType >>>>>>> 798b57943... Regenerated code +======= +from _shared.utils import create_token_credential +from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType +from azure.communication.phonenumbers._shared.utils import parse_connection_str +>>>>>>> 33c619188... Added managed identity tests and addressed apiview comments class NewTests(AsyncCommunicationTestCase): def setUp(self): @@ -66,11 +72,27 @@ async def test_list_all_phone_numbers_from_managed_identity(self): @AsyncCommunicationTestCase.await_prepared_test @pytest.mark.live_test_only +<<<<<<< HEAD ======= >>>>>>> 798b57943... Regenerated code ======= @pytest.mark.live_test_only >>>>>>> cb958a482... Added fixed samples +======= + def test_list_all_phone_numbers_from_managed_identity(self): + endpoint, access_key = parse_connection_str(self.connection_str) + credential = create_token_credential() + phone_number_client = PhoneNumbersClient(endpoint, credential) + async with self.phone_number_client: + phone_numbers = phone_number_client.list_acquired_phone_numbers() + items = [] + async for item in phone_numbers: + items.append(item) + assert len(items) > 0 + + @AsyncCommunicationTestCase.await_prepared_test + @pytest.mark.live_test_only +>>>>>>> 33c619188... Added managed identity tests and addressed apiview comments async def test_list_acquired_phone_numbers(self): async with self.phone_number_client: phone_numbers = self.phone_number_client.list_acquired_phone_numbers() @@ -182,8 +204,7 @@ async def test_search_available_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - self.area_code, - 1, + area_code=self.area_code, polling = True ) assert poller.result() From 938e10a98979d275692ea0f8c4ead1d2b6b2d687 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Mon, 22 Feb 2021 13:55:49 -0600 Subject: [PATCH 25/32] Addressed comments --- .../samples/get_phone_number_sample.py | 4 + .../samples/purchase_phone_number_sample.py | 3 +- .../samples/release_phone_number_sample.py | 4 + .../search_available_phone_numbers_sample.py | 4 + ...update_phone_number_capabilities_sample.py | 4 + .../setup.cfg | 2 +- .../test/_shared/{utills.py => utils.py} | 0 ...stration_client.test_get_phone_number.yaml | 23 ++++ ...on_client.test_purchase_phone_numbers.yaml | 45 ------- ...t.test_search_available_phone_numbers.yaml | 87 ------------ ...test_update_phone_number_capabilities.yaml | 124 ------------------ ...sync.test_list_acquired_phone_numbers.yaml | 18 ++- ...lient_async.test_release_phone_number.yaml | 29 ---- ...test_phone_number_administration_client.py | 2 +- ...hone_number_administration_client_async.py | 4 + 15 files changed, 62 insertions(+), 291 deletions(-) rename sdk/communication/azure-communication-phonenumbers/test/_shared/{utills.py => utils.py} (100%) delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_number.yaml diff --git a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py index efa512860a3a..4dbf84324101 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py @@ -60,6 +60,7 @@ def get_phone_number_information(): phone_number_information = phone_numbers_client.get_phone_number(phone_number) +<<<<<<< HEAD <<<<<<< HEAD print('Phone number information: ' + phone_number_information) ======= @@ -67,6 +68,9 @@ def get_phone_number_information(): print(phone_number_information) >>>>>>> 798b57943... Regenerated code +======= + print('Phone number information: ' + phone_number_information) +>>>>>>> e339e2227... Addressed comments if __name__ == '__main__': get_phone_number_information() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py index 1af340b23ae9..64cbb63ae4e4 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py @@ -68,8 +68,7 @@ def purchase_phone_number(): polling = True ) poller.result() - print("Result from the purchase operation: ") - print(poller.status) + print("Result from the purchase operation: " + poller.status) if __name__ == '__main__': diff --git a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py index df53639ff332..44d6a30fed27 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py @@ -60,10 +60,14 @@ def release_phone_number(): poller = phone_numbers_client.begin_release_phone_number(phone_number_to_release) poller.result() +<<<<<<< HEAD <<<<<<< HEAD print('Status of the operation: ' + poller.status()) ======= print('Status of the operation:') +======= + print('Status of the operation: ' + poller.status) +>>>>>>> e339e2227... Addressed comments print(poller.status()) >>>>>>> 968de8d7e... Added README and samples diff --git a/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py index c8539a37e06b..bdd093798da5 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py @@ -69,6 +69,7 @@ def search_available_phone_numbers(): 1, polling = True ) +<<<<<<< HEAD <<<<<<< HEAD print('Acquired phone numbers: ' + poller.result()) @@ -78,6 +79,9 @@ def search_available_phone_numbers(): ======= print('Acquired phone numbers:') print(poller.result) +======= + print('Acquired phone numbers: ' + poller.result) +>>>>>>> e339e2227... Addressed comments if __name__ == '__main__': diff --git a/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py index 246e278a0fd0..1bf6d9c5b7ca 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py @@ -49,9 +49,13 @@ def update_phone_number_capabilities(): polling = True ) poller.result() +<<<<<<< HEAD print('Status of the operation:') print(poller.status()) >>>>>>> cb958a482... Added fixed samples +======= + print('Status of the operation: ' + poller.status()) +>>>>>>> e339e2227... Addressed comments if __name__ == '__main__': update_phone_number_capabilities() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/setup.cfg b/sdk/communication/azure-communication-phonenumbers/setup.cfg index 1d45b470b8ab..3480374bc2f2 100644 --- a/sdk/communication/azure-communication-phonenumbers/setup.cfg +++ b/sdk/communication/azure-communication-phonenumbers/setup.cfg @@ -1,2 +1,2 @@ [bdist_wheel] -universal=1 \ No newline at end of file +universal=1 \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/test/_shared/utills.py b/sdk/communication/azure-communication-phonenumbers/test/_shared/utils.py similarity index 100% rename from sdk/communication/azure-communication-phonenumbers/test/_shared/utills.py rename to sdk/communication/azure-communication-phonenumbers/test/_shared/utils.py diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml index 5ef05d00ddf9..374f44c27447 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml @@ -13,6 +13,7 @@ interactions: <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - Mon, 22 Feb 2021 19:48:24 GMT ======= @@ -30,12 +31,16 @@ interactions: ======= - Tue, 16 Feb 2021 19:42:45 GMT >>>>>>> 2b281d8ce... Addresses comments +======= + - Mon, 22 Feb 2021 19:48:24 GMT +>>>>>>> e339e2227... Addressed comments User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18335260208?api-version=2021-03-07 response: @@ -70,6 +75,14 @@ interactions: "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application"}' >>>>>>> 968de8d7e... Added README and samples +======= + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18335260208?api-version=2021-03-07 + response: + body: + string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", + "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound+outbound", + "sms": "outbound"}, "assignmentType": "Application"}' +>>>>>>> e339e2227... Addressed comments headers: content-type: - application/json; charset=utf-8 @@ -78,6 +91,7 @@ interactions: <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - Mon, 22 Feb 2021 19:48:23 GMT ms-cv: @@ -107,6 +121,11 @@ interactions: ms-cv: - Npb2F6HCHUCS3PCMa+LVKA.0 >>>>>>> 2b281d8ce... Addresses comments +======= + - Mon, 22 Feb 2021 19:48:23 GMT + ms-cv: + - KQDB5Gt5/EiYmdjzTHoodQ.0 +>>>>>>> e339e2227... Addressed comments request-context: - appId= transfer-encoding: @@ -116,6 +135,7 @@ interactions: <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - 847ms ======= @@ -133,6 +153,9 @@ interactions: ======= - 810ms >>>>>>> 2b281d8ce... Addresses comments +======= + - 847ms +>>>>>>> e339e2227... Addressed comments status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml deleted file mode 100644 index 21449229dadc..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml +++ /dev/null @@ -1,45 +0,0 @@ -interactions: -- request: - body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": - {"calling": "inbound", "sms": "inbound+outbound"}, "areaCode": "844", "quantity": - 1}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '165' - Content-Type: - - application/json - Date: - - Mon, 15 Feb 2021 16:48:55 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 - response: - body: - string: '{"error": {"code": "InvalidInput", "message": "We are unable to find - phone plans to match your requested capabilities.", "target": "areacode"}}' - headers: - content-type: - - application/json - date: - - Mon, 15 Feb 2021 16:48:53 GMT - ms-cv: - - 2YSqApoKaEOE7TviEFBpMA.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 777ms - status: - code: 400 - message: Bad Request -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml deleted file mode 100644 index c0e337ffded5..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml +++ /dev/null @@ -1,87 +0,0 @@ -interactions: -- request: - body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": - {"calling": "inbound", "sms": "inbound+outbound"}, "areaCode": "844", "quantity": - 1}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '165' - Content-Type: - - application/json - Date: - - Tue, 16 Feb 2021 18:40:28 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: POST - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Tue, 16 Feb 2021 18:40:27 GMT - ms-cv: - - m3sIDXIbBkWugK33dLdtTQ.0 - operation-id: - - search_6e059e43-dded-43ca-9740-65ec3047e551 - operation-location: - - /phoneNumbers/operations/search_6e059e43-dded-43ca-9740-65ec3047e551?api-version=2021-03-07 - request-context: - - appId= - search-id: - - 6e059e43-dded-43ca-9740-65ec3047e551 - x-processing-time: - - 1563ms - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Tue, 16 Feb 2021 18:41:00 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_6e059e43-dded-43ca-9740-65ec3047e551?api-version=2021-03-07 - response: - body: - string: '{"status": "Failed", "resourceLocation": null, "createdDateTime": "2021-02-16T18:40:27.7542139+00:00", - "error": {"code": "OutOfStock", "message": "Error 1000: Not enough stock to - fulfill search request."}, "id": "search_6e059e43-dded-43ca-9740-65ec3047e551", - "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Tue, 16 Feb 2021 18:41:00 GMT - ms-cv: - - sfe/kkZvskqwyUmS3r7wxw.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 2654ms - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml deleted file mode 100644 index e855d7af1d31..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml +++ /dev/null @@ -1,124 +0,0 @@ -interactions: -- request: - body: '{"calling": "inbound+outbound", "sms": "outbound"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '50' - Content-Type: - - application/merge-patch+json - Date: - - Tue, 16 Feb 2021 19:21:29 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: PATCH - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18335260208/capabilities?api-version=2021-03-07 - response: - body: - string: '{"capabilitiesUpdateId": "404951bf-440b-4ff3-938c-43cbcdc62f91"}' - headers: - capabilities-id: - - 404951bf-440b-4ff3-938c-43cbcdc62f91 - content-type: - - application/json; charset=utf-8 - date: - - Tue, 16 Feb 2021 19:21:31 GMT - ms-cv: - - dBNwCvx0C0Cx7bVqcZdyZQ.0 - operation-id: - - capabilities_404951bf-440b-4ff3-938c-43cbcdc62f91 - operation-location: - - /phoneNumbers/operations/capabilities_404951bf-440b-4ff3-938c-43cbcdc62f91?api-version=2021-03-07 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 1267ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Tue, 16 Feb 2021 19:22:01 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/capabilities_404951bf-440b-4ff3-938c-43cbcdc62f91?api-version=2021-03-07 - response: - body: - string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": - "2021-02-16T19:21:30.6218852+00:00", "id": "capabilities_404951bf-440b-4ff3-938c-43cbcdc62f91", - "operationType": "UpdatePhoneNumberCapabilities", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Tue, 16 Feb 2021 19:22:01 GMT - ms-cv: - - 9I1ueyxoaUaH5olBCjvHnQ.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 642ms - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Date: - - Tue, 16 Feb 2021 19:22:02 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18335260208/capabilities?api-version=2021-03-07 - response: - body: - string: '{"error": {"code": "UnsupportedApiVersion", "message": "The HTTP resource - that matches the request URI ''https://sanitized.communication.azure.com/phoneNumbers/+18335260208/capabilities'' - does not support the API version ''2021-03-07''.", "innerError": null}}' - headers: - content-type: - - application/json; charset=utf-8 - date: - - Tue, 16 Feb 2021 19:22:01 GMT - ms-cv: - - mUgwWEP7I0SD1ghOfm4l4g.0 - request-context: - - appId= - transfer-encoding: - - chunked - x-processing-time: - - 10ms - status: - code: 400 - message: Bad Request -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml index 532de4de2d5e..9870293b3983 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml @@ -6,6 +6,7 @@ interactions: - application/json Date: <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD - Mon, 22 Feb 2021 19:49:31 GMT ======= @@ -14,6 +15,9 @@ interactions: ======= - Tue, 16 Feb 2021 19:45:32 GMT >>>>>>> 2b281d8ce... Addresses comments +======= + - Mon, 22 Feb 2021 19:49:31 GMT +>>>>>>> e339e2227... Addressed comments User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -23,6 +27,9 @@ interactions: response: body: <<<<<<< HEAD +<<<<<<< HEAD +======= +>>>>>>> e339e2227... Addressed comments string: '{"phoneNumbers": [{"id": "18332272412", "phoneNumber": "+18332272412", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": @@ -44,6 +51,7 @@ interactions: {"id": "18336369501", "phoneNumber": "+18336369501", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound+outbound", "sms": "none"}, "assignmentType": "Application"}]}' +<<<<<<< HEAD headers: content-type: application/json; charset=utf-8 date: Mon, 22 Feb 2021 19:49:29 GMT @@ -97,18 +105,24 @@ interactions: "phoneNumber": "+18336369501", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound+outbound", "sms": "none"}, "assignmentType": "Application"}]}' +======= +>>>>>>> e339e2227... Addressed comments headers: content-type: application/json; charset=utf-8 - date: Tue, 16 Feb 2021 19:45:33 GMT - ms-cv: 64fjFm+18EKAQ/UkeQyQuQ.0 + date: Mon, 22 Feb 2021 19:49:29 GMT + ms-cv: gR+k7FVMNkWEuGWjsZ5mUg.0 request-context: appId= transfer-encoding: chunked +<<<<<<< HEAD <<<<<<< HEAD x-processing-time: 2257ms >>>>>>> 798b57943... Regenerated code ======= x-processing-time: 908ms >>>>>>> 2b281d8ce... Addresses comments +======= + x-processing-time: 930ms +>>>>>>> e339e2227... Addressed comments status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_number.yaml deleted file mode 100644 index 2ebeaaaf4371..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_release_phone_number.yaml +++ /dev/null @@ -1,29 +0,0 @@ -interactions: -- request: - body: '' - headers: - Accept: - - application/json - Date: - - Thu, 11 Feb 2021 19:16:56 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: DELETE - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 - response: - body: - string: '{"error": {"code": "Denied", "message": "Denied by the resource provider."}}' - headers: - content-type: application/json - date: Thu, 11 Feb 2021 19:16:58 GMT - ms-cv: GAxbDJ8Kuk6pDjdEn5+mxA.0 - request-context: appId= - transfer-encoding: chunked - x-processing-time: 158ms - status: - code: 401 - message: Unauthorized - url: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index acf7545c3ca0..39f0f4ac5f94 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -114,7 +114,7 @@ def test_purchase_phone_numbers(self): self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ BodyReplacerProcessor( - keys=[] + keys=["id", "token", "phoneNumber", "phonenumbers"] ), ResponseReplacerProcessor(keys=[self._resource_name])]) diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index 6501226d0da0..c3619ddcac3e 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -77,9 +77,13 @@ async def test_list_all_phone_numbers_from_managed_identity(self): >>>>>>> 798b57943... Regenerated code ======= @pytest.mark.live_test_only +<<<<<<< HEAD >>>>>>> cb958a482... Added fixed samples ======= def test_list_all_phone_numbers_from_managed_identity(self): +======= + async def test_list_all_phone_numbers_from_managed_identity(self): +>>>>>>> e339e2227... Addressed comments endpoint, access_key = parse_connection_str(self.connection_str) credential = create_token_credential() phone_number_client = PhoneNumbersClient(endpoint, credential) From 8031157864ff7e63097ef6fd11e9dd293bcd5b70 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Thu, 25 Feb 2021 13:55:20 -0600 Subject: [PATCH 26/32] Regenerated code and addressed comments --- .../aio/operations/_phone_numbers_operations.py | 9 +++++++++ .../phonenumbers/_generated/models/_models.py | 9 +++++++++ .../_generated/models/_models_py3.py | 9 +++++++++ .../operations/_phone_numbers_operations.py | 9 +++++++++ .../list_acquired_phone_numbers_sample.py | 4 ++++ .../samples/purchase_phone_number_sample.py | 2 +- .../samples/release_phone_number_sample.py | 4 ++++ .../search_available_phone_numbers_sample.py | 13 +++++++++++++ .../update_phone_number_capabilities_sample.py | 9 +++++++++ .../swagger/PHONE_NUMBER_SWAGGER.md | 4 ++++ .../test_phone_number_administration_client.py | 16 ++++++++++------ ...t_phone_number_administration_client_async.py | 14 +++++++------- 12 files changed, 88 insertions(+), 14 deletions(-) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py index 623573299826..075a719e4c00 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py @@ -289,6 +289,7 @@ async def _purchase_phone_numbers_initial( raise HttpResponseError(response=response, model=error) response_headers = {} +<<<<<<< HEAD <<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) <<<<<<< HEAD @@ -303,6 +304,11 @@ async def _purchase_phone_numbers_initial( response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) >>>>>>> 798b57943... Regenerated code +======= + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) +>>>>>>> f5c946df0... Regenerated code and addressed comments if cls: return cls(pipeline_response, None, response_headers) @@ -349,6 +355,7 @@ async def begin_purchase_phone_numbers( def get_long_running_output(pipeline_response): <<<<<<< HEAD +<<<<<<< HEAD ======= response_headers = {} response = pipeline_response.http_response @@ -359,6 +366,8 @@ def get_long_running_output(pipeline_response): deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) >>>>>>> 798b57943... Regenerated code +======= +>>>>>>> f5c946df0... Regenerated code and addressed comments if cls: return cls(pipeline_response, None, {}) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py index 0aa0d7925687..c20b7141e15a 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py @@ -34,11 +34,15 @@ class AcquiredPhoneNumber(msrest.serialization.Model): ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param purchase_date: Required. The date and time that the phone number was purchased. :type purchase_date: ~datetime.datetime +<<<<<<< HEAD <<<<<<< HEAD :param cost: Required. The incurred cost for a single phone number. ======= :param cost: The incurred cost for a single phone number. >>>>>>> 798b57943... Regenerated code +======= + :param cost: Required. The incurred cost for a single phone number. +>>>>>>> f5c946df0... Regenerated code and addressed comments :type cost: ~azure.communication.phonenumbers.models.PhoneNumberCost """ @@ -75,6 +79,7 @@ def __init__( self.phone_number_type = kwargs['phone_number_type'] self.capabilities = kwargs['capabilities'] self.assignment_type = kwargs['assignment_type'] +<<<<<<< HEAD <<<<<<< HEAD self.purchase_date = kwargs['purchase_date'] self.cost = kwargs['cost'] @@ -82,6 +87,10 @@ def __init__( self.purchase_date = kwargs.get('purchase_date', None) self.cost = kwargs.get('cost', None) >>>>>>> 798b57943... Regenerated code +======= + self.purchase_date = kwargs['purchase_date'] + self.cost = kwargs['cost'] +>>>>>>> f5c946df0... Regenerated code and addressed comments class AcquiredPhoneNumbers(msrest.serialization.Model): diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py index ccbac0e1918d..f315b0ae7be5 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py @@ -39,11 +39,15 @@ class AcquiredPhoneNumber(msrest.serialization.Model): ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param purchase_date: Required. The date and time that the phone number was purchased. :type purchase_date: ~datetime.datetime +<<<<<<< HEAD <<<<<<< HEAD :param cost: Required. The incurred cost for a single phone number. ======= :param cost: The incurred cost for a single phone number. >>>>>>> 798b57943... Regenerated code +======= + :param cost: Required. The incurred cost for a single phone number. +>>>>>>> f5c946df0... Regenerated code and addressed comments :type cost: ~azure.communication.phonenumbers.models.PhoneNumberCost """ @@ -78,6 +82,7 @@ def __init__( phone_number_type: Union[str, "PhoneNumberType"], capabilities: "PhoneNumberCapabilities", assignment_type: Union[str, "PhoneNumberAssignmentType"], +<<<<<<< HEAD <<<<<<< HEAD purchase_date: datetime.datetime, cost: "PhoneNumberCost", @@ -85,6 +90,10 @@ def __init__( purchase_date: Optional[datetime.datetime] = None, cost: Optional["PhoneNumberCost"] = None, >>>>>>> 798b57943... Regenerated code +======= + purchase_date: datetime.datetime, + cost: "PhoneNumberCost", +>>>>>>> f5c946df0... Regenerated code and addressed comments **kwargs ): super(AcquiredPhoneNumber, self).__init__(**kwargs) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py index b7a92b6310fe..2d1ae673070e 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py @@ -297,6 +297,7 @@ def _purchase_phone_numbers_initial( raise HttpResponseError(response=response, model=error) response_headers = {} +<<<<<<< HEAD <<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) <<<<<<< HEAD @@ -311,6 +312,11 @@ def _purchase_phone_numbers_initial( response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) >>>>>>> 798b57943... Regenerated code +======= + response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) + response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) + response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) +>>>>>>> f5c946df0... Regenerated code and addressed comments if cls: return cls(pipeline_response, None, response_headers) @@ -358,6 +364,7 @@ def begin_purchase_phone_numbers( def get_long_running_output(pipeline_response): <<<<<<< HEAD +<<<<<<< HEAD ======= response_headers = {} response = pipeline_response.http_response @@ -368,6 +375,8 @@ def get_long_running_output(pipeline_response): deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) >>>>>>> 798b57943... Regenerated code +======= +>>>>>>> f5c946df0... Regenerated code and addressed comments if cls: return cls(pipeline_response, None, {}) diff --git a/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py index 38f0265be5ba..e35d938f49bb 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py @@ -48,8 +48,12 @@ def list_acquired_phone_numbers(): >>>>>>> 798b57943... Regenerated code ======= for acquired_phone_number in acquired_phone_numbers: +<<<<<<< HEAD print(acquired_phone_number) >>>>>>> a11fa64fb... Corrected samples +======= + print(acquired_phone_number.phone_number) +>>>>>>> f5c946df0... Regenerated code and addressed comments if __name__ == '__main__': diff --git a/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py index 64cbb63ae4e4..3d0b30bc080f 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py @@ -68,7 +68,7 @@ def purchase_phone_number(): polling = True ) poller.result() - print("Result from the purchase operation: " + poller.status) + print("Result from the purchase operation: " + poller.status()) if __name__ == '__main__': diff --git a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py index 44d6a30fed27..ff93bc8c1004 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py @@ -61,6 +61,7 @@ def release_phone_number(): poller = phone_numbers_client.begin_release_phone_number(phone_number_to_release) poller.result() <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD print('Status of the operation: ' + poller.status()) ======= @@ -71,6 +72,9 @@ def release_phone_number(): print(poller.status()) >>>>>>> 968de8d7e... Added README and samples +======= + print('Status of the operation: ' + poller.status()) +>>>>>>> f5c946df0... Regenerated code and addressed comments if __name__ == '__main__': release_phone_number() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py index bdd093798da5..4cb6a8935d0a 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py @@ -39,11 +39,15 @@ PhoneNumberType, PhoneNumberAssignmentType, PhoneNumberCapabilities, +<<<<<<< HEAD <<<<<<< HEAD PhoneNumberCapabilityType ======= PhoneNumberCapabilityValue >>>>>>> 968de8d7e... Added README and samples +======= + PhoneNumberCapabilityType +>>>>>>> f5c946df0... Regenerated code and addressed comments ) connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') @@ -52,6 +56,7 @@ def search_available_phone_numbers(): capabilities = PhoneNumberCapabilities( +<<<<<<< HEAD <<<<<<< HEAD calling = PhoneNumberCapabilityType.INBOUND, sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND @@ -59,6 +64,10 @@ def search_available_phone_numbers(): calling = PhoneNumberCapabilityValue.INBOUND, sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND >>>>>>> 968de8d7e... Added README and samples +======= + calling = PhoneNumberCapabilityType.INBOUND, + sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND +>>>>>>> f5c946df0... Regenerated code and addressed comments ) poller = phone_numbers_client.begin_search_available_phone_numbers( "US", @@ -70,6 +79,7 @@ def search_available_phone_numbers(): polling = True ) <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD print('Acquired phone numbers: ' + poller.result()) @@ -82,6 +92,9 @@ def search_available_phone_numbers(): ======= print('Acquired phone numbers: ' + poller.result) >>>>>>> e339e2227... Addressed comments +======= + print('Acquired phone numbers: ' + poller.result()) +>>>>>>> f5c946df0... Regenerated code and addressed comments if __name__ == '__main__': diff --git a/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py index 1bf6d9c5b7ca..f088d9dd8dad 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py @@ -20,11 +20,15 @@ import os from azure.communication.phonenumbers import ( PhoneNumbersClient, +<<<<<<< HEAD <<<<<<< HEAD PhoneNumberCapabilityType ======= PhoneNumberCapabilityValue >>>>>>> cb958a482... Added fixed samples +======= + PhoneNumberCapabilityType +>>>>>>> f5c946df0... Regenerated code and addressed comments ) connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') @@ -36,6 +40,7 @@ def update_phone_number_capabilities(): poller = phone_numbers_client.begin_update_phone_number_capabilities( "+18335260208", +<<<<<<< HEAD <<<<<<< HEAD PhoneNumberCapabilityType.OUTBOUND, PhoneNumberCapabilityType.INBOUND_OUTBOUND, @@ -46,6 +51,10 @@ def update_phone_number_capabilities(): ======= PhoneNumberCapabilityValue.OUTBOUND, PhoneNumberCapabilityValue.INBOUND_OUTBOUND, +======= + PhoneNumberCapabilityType.OUTBOUND, + PhoneNumberCapabilityType.INBOUND_OUTBOUND, +>>>>>>> f5c946df0... Regenerated code and addressed comments polling = True ) poller.result() diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md b/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md index 62d1d0410482..6ee5dec1027d 100644 --- a/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md +++ b/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md @@ -13,6 +13,7 @@ autorest ./PHONE_NUMBER_SWAGGER.md <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a4d1e1516433894fca89f9600a6ac8a5471fc598/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json ======= input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/f20d92b324842b407e0dcce36ad0e67bd9bb66cf/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json @@ -23,6 +24,9 @@ input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/e23190a ======= input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/967da531665d4b51a7a5599324e5edd95489cc3d/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json >>>>>>> 968de8d7e... Added README and samples +======= +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a4d1e1516433894fca89f9600a6ac8a5471fc598/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json +>>>>>>> f5c946df0... Regenerated code and addressed comments output-folder: ../azure/communication/phonenumbers/_generated namespace: azure.communication.phonenumbers license-header: MICROSOFT_MIT_NO_VERSION diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index 39f0f4ac5f94..abc8a6850576 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -6,6 +6,7 @@ from _shared.testcase import CommunicationTestCase, ResponseReplacerProcessor, BodyReplacerProcessor from _shared.utils import create_token_credential <<<<<<< HEAD +<<<<<<< HEAD from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityType, PhoneNumberType from azure.communication.phonenumbers._shared.utils import parse_connection_str ======= @@ -19,6 +20,9 @@ >>>>>>> ea76a164a... Added new pnm redesign code ======= from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType +======= +from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityType, PhoneNumberType +>>>>>>> f5c946df0... Regenerated code and addressed comments from azure.communication.phonenumbers._shared.utils import parse_connection_str >>>>>>> 33c619188... Added managed identity tests and addressed apiview comments @@ -144,8 +148,8 @@ def test_release_phone_number(self): @pytest.mark.live_test_only def test_search_available_phone_numbers(self): capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityValue.INBOUND, - sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + calling = PhoneNumberCapabilityType.INBOUND, + sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND ) poller = self.phone_number_client.begin_search_available_phone_numbers( self.country_code, @@ -161,8 +165,8 @@ def test_search_available_phone_numbers(self): def test_update_phone_number_capabilities(self): poller = self.phone_number_client.begin_update_phone_number_capabilities( self.phone_number, - PhoneNumberCapabilityValue.OUTBOUND, - PhoneNumberCapabilityValue.INBOUND_OUTBOUND, + PhoneNumberCapabilityType.OUTBOUND, + PhoneNumberCapabilityType.INBOUND_OUTBOUND, polling = True ) assert poller.result() @@ -170,8 +174,8 @@ def test_update_phone_number_capabilities(self): @pytest.mark.live_test_only def test_purchase_phone_numbers(self): capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityValue.INBOUND, - sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + calling = PhoneNumberCapabilityType.INBOUND, + sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND ) search_poller = self.phone_number_client.begin_search_available_phone_numbers( self.country_code, diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index c3619ddcac3e..ee8e5f6cfc91 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -21,7 +21,7 @@ >>>>>>> 798b57943... Regenerated code ======= from _shared.utils import create_token_credential -from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType +from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityType, PhoneNumberType from azure.communication.phonenumbers._shared.utils import parse_connection_str >>>>>>> 33c619188... Added managed identity tests and addressed apiview comments @@ -199,8 +199,8 @@ async def test_release_phone_number(self): @pytest.mark.live_test_only async def test_search_available_phone_numbers(self): capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityValue.INBOUND, - sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + calling = PhoneNumberCapabilityType.INBOUND, + sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND ) async with self.phone_number_client: poller = await self.phone_number_client.begin_search_available_phone_numbers( @@ -219,8 +219,8 @@ async def test_update_phone_number_capabilities(self): async with self.phone_number_client: poller = self.phone_number_client.begin_update_phone_number_capabilities( self.phone_number, - PhoneNumberCapabilityValue.OUTBOUND, - PhoneNumberCapabilityValue.OUTBOUND, + PhoneNumberCapabilityType.OUTBOUND, + PhoneNumberCapabilityType.OUTBOUND, polling = True ) assert poller.result() @@ -229,8 +229,8 @@ async def test_update_phone_number_capabilities(self): @pytest.mark.live_test_only async def test_purchase_phone_numbers(self): capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityValue.INBOUND, - sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + calling = PhoneNumberCapabilityType.INBOUND, + sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND ) async with self.phone_number_client: search_poller = await self.phone_number_client.begin_search_available_phone_numbers( From 2e549c5d71710f94e4060a82c68226c3144e7e45 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Tue, 2 Mar 2021 15:04:44 -0700 Subject: [PATCH 27/32] Fixed merge conflicts --- .../README.md | 9 -- .../communication/phonenumbers/__init__.py | 20 +-- .../_generated/_phone_numbers_client.py | 20 +++ .../_generated/aio/_phone_numbers_client.py | 18 +++ .../operations/_phone_numbers_operations.py | 66 -------- .../phonenumbers/_generated/models/_models.py | 18 --- .../_generated/models/_models_py3.py | 18 --- .../operations/_phone_numbers_operations.py | 66 -------- .../phonenumbers/_phone_numbers_client.py | 49 +----- .../aio/_phone_numbers_client_async.py | 152 +----------------- ..._phonenumbers-1.0.0b4-py2.py3-none-any.whl | Bin 44179 -> 0 bytes .../samples/get_phone_number_sample.py | 42 ----- .../list_acquired_phone_numbers_sample.py | 25 --- .../samples/purchase_phone_number_sample.py | 41 ----- .../samples/release_phone_number_sample.py | 43 ----- .../search_available_phone_numbers_sample.py | 55 ------- ...update_phone_number_capabilities_sample.py | 27 ---- .../swagger/PHONE_NUMBER_SWAGGER.md | 16 -- ...stration_client.test_get_phone_number.yaml | 122 -------------- ...ient.test_list_acquired_phone_numbers.yaml | 38 +++++ ...on_client_async.test_get_phone_number.yaml | 42 ----- ...sync.test_list_acquired_phone_numbers.yaml | 81 ---------- ...test_phone_number_administration_client.py | 141 +--------------- ...hone_number_administration_client_async.py | 133 --------------- 24 files changed, 96 insertions(+), 1146 deletions(-) delete mode 100644 sdk/communication/azure-communication-phonenumbers/azure_communication_phonenumbers-1.0.0b4-py2.py3-none-any.whl create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml diff --git a/sdk/communication/azure-communication-phonenumbers/README.md b/sdk/communication/azure-communication-phonenumbers/README.md index 51611565d33c..6a28ebb57a68 100644 --- a/sdk/communication/azure-communication-phonenumbers/README.md +++ b/sdk/communication/azure-communication-phonenumbers/README.md @@ -123,10 +123,6 @@ poller = self.phone_number_client.begin_release_phone_number( polling = True ) ``` -<<<<<<< HEAD -<<<<<<< HEAD -======= ->>>>>>> 2b281d8ce... Addresses comments ### Updating Phone Number Capabilities @@ -146,11 +142,6 @@ poller = self.phone_number_client.begin_update_phone_number_capabilities( ) ``` -<<<<<<< HEAD -======= ->>>>>>> 968de8d7e... Added README and samples -======= ->>>>>>> 2b281d8ce... Addresses comments # Troubleshooting The Phone Numbers Administration client will raise exceptions defined in [Azure Core][azure_core]. diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py index dfba7b332986..958eb870d459 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py @@ -8,40 +8,24 @@ from ._generated.models import ( AcquiredPhoneNumber, -<<<<<<< HEAD PhoneNumberCapabilities, PhoneNumberCost, -======= - AcquiredPhoneNumbers, - CommunicationError, - PhoneNumberCapabilities, - PhoneNumberCost, - PhoneNumberOperation, ->>>>>>> cb958a482... Added fixed samples PhoneNumberSearchResult, BillingFrequency, PhoneNumberAssignmentType, - PhoneNumberCapabilityValue, + PhoneNumberCapabilityType, PhoneNumberOperationStatus, PhoneNumberType, ) __all__ = [ 'AcquiredPhoneNumber', -<<<<<<< HEAD - 'PhoneNumberCapabilities', - 'PhoneNumberCost', -======= - 'AcquiredPhoneNumbers', - 'CommunicationError', 'PhoneNumberCapabilities', 'PhoneNumberCost', - 'PhoneNumberOperation', ->>>>>>> cb958a482... Added fixed samples 'PhoneNumberSearchResult', 'BillingFrequency', 'PhoneNumberAssignmentType', - 'PhoneNumberCapabilityValue', + 'PhoneNumberCapabilityType', 'PhoneNumberOperationStatus', 'PhoneNumberType', 'PhoneNumbersClient' diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/_phone_numbers_client.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/_phone_numbers_client.py index 2795b08204be..2d8d55386d92 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/_phone_numbers_client.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/_phone_numbers_client.py @@ -15,6 +15,8 @@ # pylint: disable=unused-import,ungrouped-imports from typing import Any + from azure.core.pipeline.transport import HttpRequest, HttpResponse + from ._configuration import PhoneNumbersClientConfiguration from .operations import PhoneNumbersOperations from . import models @@ -47,6 +49,24 @@ def __init__( self.phone_numbers = PhoneNumbersOperations( self._client, self._config, self._serialize, self._deserialize) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/_phone_numbers_client.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/_phone_numbers_client.py index 61d925e71895..f4478bf96aee 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/_phone_numbers_client.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/_phone_numbers_client.py @@ -9,6 +9,7 @@ from typing import Any from azure.core import AsyncPipelineClient +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from msrest import Deserializer, Serializer from ._configuration import PhoneNumbersClientConfiguration @@ -42,6 +43,23 @@ def __init__( self.phone_numbers = PhoneNumbersOperations( self._client, self._config, self._serialize, self._deserialize) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py index 075a719e4c00..8bcfc898be2c 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/aio/operations/_phone_numbers_operations.py @@ -88,14 +88,7 @@ async def _search_available_phone_numbers_initial( response_headers = {} response_headers['Location']=self._deserialize('str', response.headers.get('Location')) -<<<<<<< HEAD -<<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) -======= ->>>>>>> 798b57943... Regenerated code -======= - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) ->>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -152,14 +145,7 @@ def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response response_headers['Location']=self._deserialize('str', response.headers.get('Location')) -<<<<<<< HEAD -<<<<<<< HEAD - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) -======= ->>>>>>> 798b57943... Regenerated code -======= response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) ->>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -289,26 +275,9 @@ async def _purchase_phone_numbers_initial( raise HttpResponseError(response=response, model=error) response_headers = {} -<<<<<<< HEAD -<<<<<<< HEAD - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) -<<<<<<< HEAD - response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) - response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) -======= -======= ->>>>>>> 968de8d7e... Added README and samples - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) - response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) - response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) - deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) ->>>>>>> 798b57943... Regenerated code -======= response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) ->>>>>>> f5c946df0... Regenerated code and addressed comments if cls: return cls(pipeline_response, None, response_headers) @@ -354,20 +323,6 @@ async def begin_purchase_phone_numbers( kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): -<<<<<<< HEAD -<<<<<<< HEAD -======= - response_headers = {} - response = pipeline_response.http_response - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) - response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) - response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) - deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) - ->>>>>>> 798b57943... Regenerated code -======= ->>>>>>> f5c946df0... Regenerated code and addressed comments if cls: return cls(pipeline_response, None, {}) @@ -600,13 +555,6 @@ async def _release_phone_number_initial( response_headers = {} response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) -<<<<<<< HEAD -<<<<<<< HEAD -======= - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) ->>>>>>> 798b57943... Regenerated code -======= ->>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['release-id']=self._deserialize('str', response.headers.get('release-id')) @@ -813,14 +761,7 @@ async def _update_capabilities_initial( response_headers = {} response_headers['Location']=self._deserialize('str', response.headers.get('Location')) -<<<<<<< HEAD -<<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) -======= ->>>>>>> 798b57943... Regenerated code -======= - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) ->>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) @@ -882,14 +823,7 @@ def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response response_headers['Location']=self._deserialize('str', response.headers.get('Location')) -<<<<<<< HEAD -<<<<<<< HEAD - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) -======= ->>>>>>> 798b57943... Regenerated code -======= response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) ->>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py index c20b7141e15a..2f56422efbef 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models.py @@ -34,15 +34,7 @@ class AcquiredPhoneNumber(msrest.serialization.Model): ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param purchase_date: Required. The date and time that the phone number was purchased. :type purchase_date: ~datetime.datetime -<<<<<<< HEAD -<<<<<<< HEAD :param cost: Required. The incurred cost for a single phone number. -======= - :param cost: The incurred cost for a single phone number. ->>>>>>> 798b57943... Regenerated code -======= - :param cost: Required. The incurred cost for a single phone number. ->>>>>>> f5c946df0... Regenerated code and addressed comments :type cost: ~azure.communication.phonenumbers.models.PhoneNumberCost """ @@ -79,18 +71,8 @@ def __init__( self.phone_number_type = kwargs['phone_number_type'] self.capabilities = kwargs['capabilities'] self.assignment_type = kwargs['assignment_type'] -<<<<<<< HEAD -<<<<<<< HEAD - self.purchase_date = kwargs['purchase_date'] - self.cost = kwargs['cost'] -======= - self.purchase_date = kwargs.get('purchase_date', None) - self.cost = kwargs.get('cost', None) ->>>>>>> 798b57943... Regenerated code -======= self.purchase_date = kwargs['purchase_date'] self.cost = kwargs['cost'] ->>>>>>> f5c946df0... Regenerated code and addressed comments class AcquiredPhoneNumbers(msrest.serialization.Model): diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py index f315b0ae7be5..7c9e3386983b 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/models/_models_py3.py @@ -39,15 +39,7 @@ class AcquiredPhoneNumber(msrest.serialization.Model): ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param purchase_date: Required. The date and time that the phone number was purchased. :type purchase_date: ~datetime.datetime -<<<<<<< HEAD -<<<<<<< HEAD :param cost: Required. The incurred cost for a single phone number. -======= - :param cost: The incurred cost for a single phone number. ->>>>>>> 798b57943... Regenerated code -======= - :param cost: Required. The incurred cost for a single phone number. ->>>>>>> f5c946df0... Regenerated code and addressed comments :type cost: ~azure.communication.phonenumbers.models.PhoneNumberCost """ @@ -82,18 +74,8 @@ def __init__( phone_number_type: Union[str, "PhoneNumberType"], capabilities: "PhoneNumberCapabilities", assignment_type: Union[str, "PhoneNumberAssignmentType"], -<<<<<<< HEAD -<<<<<<< HEAD - purchase_date: datetime.datetime, - cost: "PhoneNumberCost", -======= - purchase_date: Optional[datetime.datetime] = None, - cost: Optional["PhoneNumberCost"] = None, ->>>>>>> 798b57943... Regenerated code -======= purchase_date: datetime.datetime, cost: "PhoneNumberCost", ->>>>>>> f5c946df0... Regenerated code and addressed comments **kwargs ): super(AcquiredPhoneNumber, self).__init__(**kwargs) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py index 2d1ae673070e..9c38f1c39bf1 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_generated/operations/_phone_numbers_operations.py @@ -93,14 +93,7 @@ def _search_available_phone_numbers_initial( response_headers = {} response_headers['Location']=self._deserialize('str', response.headers.get('Location')) -<<<<<<< HEAD -<<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) -======= ->>>>>>> 798b57943... Regenerated code -======= - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) ->>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -158,14 +151,7 @@ def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response response_headers['Location']=self._deserialize('str', response.headers.get('Location')) -<<<<<<< HEAD -<<<<<<< HEAD - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) -======= ->>>>>>> 798b57943... Regenerated code -======= response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) ->>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['search-id']=self._deserialize('str', response.headers.get('search-id')) deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) @@ -297,26 +283,9 @@ def _purchase_phone_numbers_initial( raise HttpResponseError(response=response, model=error) response_headers = {} -<<<<<<< HEAD -<<<<<<< HEAD - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) -<<<<<<< HEAD - response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) - response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) -======= -======= ->>>>>>> 968de8d7e... Added README and samples - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) - response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) - response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) - deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) ->>>>>>> 798b57943... Regenerated code -======= response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) ->>>>>>> f5c946df0... Regenerated code and addressed comments if cls: return cls(pipeline_response, None, response_headers) @@ -363,20 +332,6 @@ def begin_purchase_phone_numbers( kwargs.pop('content_type', None) def get_long_running_output(pipeline_response): -<<<<<<< HEAD -<<<<<<< HEAD -======= - response_headers = {} - response = pipeline_response.http_response - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) - response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) - response_headers['purchase-id']=self._deserialize('str', response.headers.get('purchase-id')) - deserialized = self._deserialize('PhoneNumberSearchResult', pipeline_response) - ->>>>>>> 798b57943... Regenerated code -======= ->>>>>>> f5c946df0... Regenerated code and addressed comments if cls: return cls(pipeline_response, None, {}) @@ -613,13 +568,6 @@ def _release_phone_number_initial( response_headers = {} response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) -<<<<<<< HEAD -<<<<<<< HEAD -======= - response_headers['Location']=self._deserialize('str', response.headers.get('Location')) ->>>>>>> 798b57943... Regenerated code -======= ->>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['release-id']=self._deserialize('str', response.headers.get('release-id')) @@ -829,14 +777,7 @@ def _update_capabilities_initial( response_headers = {} response_headers['Location']=self._deserialize('str', response.headers.get('Location')) -<<<<<<< HEAD -<<<<<<< HEAD response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) -======= ->>>>>>> 798b57943... Regenerated code -======= - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) ->>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) @@ -899,14 +840,7 @@ def get_long_running_output(pipeline_response): response_headers = {} response = pipeline_response.http_response response_headers['Location']=self._deserialize('str', response.headers.get('Location')) -<<<<<<< HEAD -<<<<<<< HEAD - response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) -======= ->>>>>>> 798b57943... Regenerated code -======= response_headers['Operation-Location']=self._deserialize('str', response.headers.get('Operation-Location')) ->>>>>>> 968de8d7e... Added README and samples response_headers['operation-id']=self._deserialize('str', response.headers.get('operation-id')) response_headers['capabilities-id']=self._deserialize('str', response.headers.get('capabilities-id')) deserialized = self._deserialize('AcquiredPhoneNumber', pipeline_response) diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py index b611d9ffb1bc..c2704c822724 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py @@ -109,16 +109,7 @@ def begin_search_available_phone_numbers( phone_number_type, # type: str assignment_type, # type: str capabilities, # type: PhoneNumberCapabilities -<<<<<<< HEAD -<<<<<<< HEAD quantity=None, # type: int -======= - area_code, # type: str - quantity=1, # type: int ->>>>>>> 2b281d8ce... Addresses comments -======= - quantity=None, # type: int ->>>>>>> 33c619188... Added managed identity tests and addressed apiview comments **kwargs # type: Any ): # type: (...) -> LROPoller[PhoneNumberSearchResult] @@ -152,39 +143,20 @@ def begin_search_available_phone_numbers( phone_number_type=phone_number_type, assignment_type=assignment_type, capabilities=capabilities, -<<<<<<< HEAD -<<<<<<< HEAD - quantity=quantity, - area_code=kwargs.pop('area_code', None) -======= - area_code=area_code, - quantity=quantity ->>>>>>> 2b281d8ce... Addresses comments -======= quantity=quantity, area_code=kwargs.pop('area_code', None) ->>>>>>> 33c619188... Added managed identity tests and addressed apiview comments ) return self._phone_number_client.phone_numbers.begin_search_available_phone_numbers( country_code, search_request, **kwargs ) -<<<<<<< HEAD -<<<<<<< HEAD - -======= - ->>>>>>> 798b57943... Regenerated code -======= - ->>>>>>> 2b281d8ce... Addresses comments @distributed_trace def begin_update_phone_number_capabilities( self, phone_number, # type: str - sms, #type: str or PhoneNumberCapabilityValue - calling, #type: str or PhoneNumberCapabilityValue + sms=None, #type: str or PhoneNumberCapabilityType + calling=None, #type: str or PhoneNumberCapabilityType **kwargs # type: Any ): # type: (...) -> LROPoller["_models.AcquiredPhoneNumber"] @@ -194,9 +166,9 @@ def begin_update_phone_number_capabilities( encoded as %2B, e.g. +11234567890. :type phone_number: str :param calling: Capability value for calling. - :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType :param sms: Capability value for SMS. - :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the LROBasePolling polling method, @@ -208,8 +180,8 @@ def begin_update_phone_number_capabilities( """ return self._phone_number_client.phone_numbers.begin_update_capabilities( phone_number, - calling, - sms, + calling=calling, + sms=sms, **kwargs ) @@ -244,15 +216,6 @@ def list_acquired_phone_numbers( :param skip: An optional parameter for how many entries to skip, for pagination purposes. The default value is 0. :type skip: int -<<<<<<< HEAD -<<<<<<< HEAD -======= - :param top: An optional parameter for how many entries to return, for pagination purposes. The - default value is 100. - :type top: int ->>>>>>> 2b281d8ce... Addresses comments -======= ->>>>>>> a11fa64fb... Corrected samples :rtype: ~azure.core.paging.ItemPaged[~azure.communication.phonenumbers.models.AcquiredPhoneNumber] """ return self._phone_number_client.phone_numbers.list_phone_numbers( diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py index 8077c760807d..5a19b27c6513 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py @@ -16,8 +16,6 @@ class PhoneNumbersClient(object): def __init__( self, -<<<<<<< HEAD -<<<<<<< HEAD endpoint, # type: str credential, # type: str **kwargs # type: Any @@ -47,71 +45,15 @@ def from_connection_string( ): # type: (...) -> PhoneNumbersClient """Create PhoneNumbersClient from a Connection String. -<<<<<<< HEAD :param str conn_str: A connection string to an Azure Communication Service resource. :returns: Instance of PhoneNumbersClient. :rtype: ~azure.communication.phonenumbers.aio.PhoneNumbersClient -======= - endpoint, # type: str - credential, # type: str - **kwargs # type: Any -======= - endpoint, # type: str - credential, # type: str - **kwargs # type: Any ->>>>>>> 2b281d8ce... Addresses comments - ): - # type: (...) -> None - try: - if not endpoint.lower().startswith('http'): - endpoint = "https://" + endpoint - except AttributeError: - raise ValueError("Account URL must be a string.") - - if not credential: - raise ValueError( - "You need to provide account shared key to authenticate.") - - self._endpoint = endpoint - self._phone_number_client = PhoneNumbersClientGen( - self._endpoint, - authentication_policy=get_authentication_policy(endpoint, credential), - sdk_moniker=SDK_MONIKER, - **kwargs) - - @classmethod - def from_connection_string( - cls, conn_str, # type: str - **kwargs # type: Any - ): - # type: (...) -> PhoneNumbersAdministrationClient - """Create PhoneNumbersAdministrationClient from a Connection String. - :param str conn_str: - A connection string to an Azure Communication Service resource. - :returns: Instance of PhoneNumbersAdministrationClient. - :rtype: ~azure.communication.PhoneNumbersAdministrationClient ->>>>>>> 798b57943... Regenerated code -======= - :param str conn_str: - A connection string to an Azure Communication Service resource. - :returns: Instance of PhoneNumbersClient. - :rtype: ~azure.communication.phonenumbers.aio.PhoneNumbersClient ->>>>>>> 33c619188... Added managed identity tests and addressed apiview comments """ endpoint, access_key = parse_connection_str(conn_str) return cls(endpoint, access_key, **kwargs) -<<<<<<< HEAD -<<<<<<< HEAD -======= - - ->>>>>>> 798b57943... Regenerated code -======= - ->>>>>>> 2b281d8ce... Addresses comments @distributed_trace_async async def begin_purchase_phone_numbers( self, @@ -135,15 +77,7 @@ async def begin_purchase_phone_numbers( search_id, **kwargs ) -<<<<<<< HEAD -<<<<<<< HEAD - -======= - ->>>>>>> 798b57943... Regenerated code -======= ->>>>>>> 2b281d8ce... Addresses comments @distributed_trace_async async def begin_release_phone_number( self, @@ -176,16 +110,7 @@ async def begin_search_available_phone_numbers( phone_number_type, # type: str assignment_type, # type: str capabilities, -<<<<<<< HEAD -<<<<<<< HEAD quantity=None, # type: int -======= - area_code, # type: str - quantity=1, # type: int ->>>>>>> 2b281d8ce... Addresses comments -======= - quantity=None, # type: int ->>>>>>> 33c619188... Added managed identity tests and addressed apiview comments **kwargs ): # type: (...) -> AsyncLROPoller[PhoneNumberSearchResult] @@ -205,7 +130,7 @@ async def begin_search_available_phone_numbers( :type capabilities: ~azure.communication.phonenumbers.models.PhoneNumberCapabilities :param quantity: The quantity of phone numbers in the search. Should be at least 1. :type quantity: int - :keyword str area_code: The area code of the desired phone number, e.g. 425. If not set, + :keyword str area_code: The area code of the desired phone number, e.g. 425. If not set, any area code could be used in the final search. :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the LROBasePolling polling method, @@ -219,18 +144,8 @@ async def begin_search_available_phone_numbers( phone_number_type=phone_number_type, assignment_type=assignment_type, capabilities=capabilities, -<<<<<<< HEAD -<<<<<<< HEAD - quantity=quantity, - area_code=kwargs.pop('area_code', None) -======= - area_code=area_code, - quantity=quantity ->>>>>>> 2b281d8ce... Addresses comments -======= quantity=quantity, area_code=kwargs.pop('area_code', None) ->>>>>>> 33c619188... Added managed identity tests and addressed apiview comments ) return await self._phone_number_client.phone_numbers.begin_search_available_phone_numbers( country_code, @@ -242,13 +157,8 @@ async def begin_search_available_phone_numbers( async def begin_update_phone_number_capabilities( self, phone_number, # type: str -<<<<<<< HEAD - sms = None, # type: str - calling = None, # type: str -======= - sms, # type: str - calling, # type: str ->>>>>>> 2b281d8ce... Addresses comments + sms=None, # type: str + calling=None, # type: str **kwargs # type: Any ): # type: (...) -> AsyncLROPoller["_models.AcquiredPhoneNumber"] @@ -258,9 +168,9 @@ async def begin_update_phone_number_capabilities( encoded as %2B, e.g. +11234567890. :type phone_number: str :param calling: Capability value for calling. - :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType :param sms: Capability value for SMS. - :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityValue + :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the LROBasePolling polling method, @@ -299,18 +209,8 @@ async def get_phone_number( @distributed_trace def list_acquired_phone_numbers( -<<<<<<< HEAD -<<<<<<< HEAD self, **kwargs # type: Any -======= - self, - **kwargs ->>>>>>> 798b57943... Regenerated code -======= - self, - **kwargs # type: Any ->>>>>>> 2b281d8ce... Addresses comments ): # type: (...) -> AsyncItemPaged[AcquiredPhoneNumbers] """Gets the list of all acquired phone numbers. @@ -326,44 +226,6 @@ def list_acquired_phone_numbers( return self._phone_number_client.phone_numbers.list_phone_numbers( **kwargs ) -<<<<<<< HEAD -<<<<<<< HEAD -======= - - @distributed_trace_async - async def update_phone_number( - self, - phone_number, - callback_uri, - application_id, - **kwargs - ): - # type: (...) -> AcquiredPhoneNumber - """Updates the configuration of a phone number. ->>>>>>> 798b57943... Regenerated code - - async def __aenter__(self) -> "PhoneNumbersClient": - await self._phone_number_client.__aenter__() - return self - - async def __aexit__(self, *args: "Any") -> None: - await self.close() - - async def close(self) -> None: - """Close the :class: - `~azure.communication.phonenumbers.aio.PhoneNumbersClient` session. - """ -<<<<<<< HEAD - await self._phone_number_client.__aexit__() -======= - return await self._phone_number_client.phone_numbers.update( - phone_number, - callback_uri, - application_id, - **kwargs - ) -======= ->>>>>>> 2b281d8ce... Addresses comments async def __aenter__(self) -> "PhoneNumbersClient": await self._phone_number_client.__aenter__() @@ -377,7 +239,3 @@ async def close(self) -> None: `~azure.communication.phonenumbers.aio.PhoneNumbersClient` session. """ await self._phone_number_client.__aexit__() -<<<<<<< HEAD ->>>>>>> 798b57943... Regenerated code -======= ->>>>>>> 2b281d8ce... Addresses comments diff --git a/sdk/communication/azure-communication-phonenumbers/azure_communication_phonenumbers-1.0.0b4-py2.py3-none-any.whl b/sdk/communication/azure-communication-phonenumbers/azure_communication_phonenumbers-1.0.0b4-py2.py3-none-any.whl deleted file mode 100644 index 397bc1477bb537efcac5107df8725b9877097939..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 44179 zcmbrl1CVTev*z1&_io#^-Mekuwr$(CZQHhOo4eh+t=sR+x%WHYOiaW%b0aFEDk`F) zVr8!9pTB%Emz*Rp2r>Ww00e+?wSfZf-<~;fKmdSQU;qH>pKtX&oE?nm3~jBgoo&nw z^_|RZZRqUGY;BBfoUILv9USR&bD9GR;*91=Z_SF$^n}Cc|E!kDh|(+Bj1f}SM1O#!1|hTl zJK~Y0AsvjOaZI0#=t2k_1a=NS*~P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<7?})DY_kH@tE5FVM*aa7uOOC$C+S5regyw<>G?I3|*_` zei)15kU5d?$YEcHo?RgH*rH&7?N!}kAhQZJx%+&{E0pRnEFw6uQ%rSbc!V2pH(-x@ zG&n8Tt44gcX-E-PwmS&RNoIrn_s3BcaPjG$x4Vl4=TGio&a3X>tBvliO1|jLnZ6yS zDg}FsJz@IS>*Z2%9E|t(l7AJdhb2B<#k9dN@cVY$!!X%dFrhyyzy@my`u7+Qn3vne z$?=-xi{!ca#xdwcMRNwsUoQA#^ssYPfC9|L`1g{nEF3Ld?z#P3=6rSd7ZAJFym24c z++)KAEBX^;5|$zUTM#oRM@t(kcNp?N^=XBn@}**PE(%J_(Ba@@enJ()(gS}B^$)Ji zg>vIw>HHY58RUn};6(|`kE1Fe3TA=7L%fz-a(x!jCBi*#!&EbYsV4b@0y|d)d?ow? z(BI8u)s|7a1Ps>!GjD~Ta3Q3BfcuBDd9^pC+)q??ir=SRc1ZkhH*t=8jF1GZJ7aeq z9GuQi%xud4AM*H$mrao2k#U*ZITe}?<{5?E(!6lb?@J+_!r@q2KuXtJs$D<NCZue|^3 z;;$!zUW$+N`v>Cx%j^4Bxty2MdHnyW^q=p{Ynh!_)%jH##3j%=>@VQ&If||%MO)k9dzB_bqUgZ@kgNl^?qHaT=z{~Qm~W$i1L%C>N@SZkLm}l0^aS< bX#et9sVgI2_}1X4U_U4TIJgJt7k~W^QwXV< diff --git a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py index 4dbf84324101..5493fce13d1b 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py @@ -7,27 +7,11 @@ # -------------------------------------------------------------------------- """ -<<<<<<< HEAD -<<<<<<< HEAD FILE:get_phone_number_sample.py DESCRIPTION: This sample demonstrates how to get the information from an acquired phone number using your connection string USAGE: python get_phone_number_sample.py -======= -FILE: phone_number_area_codes_sample.py -======= -FILE:get_phone_number_sample.py ->>>>>>> cb958a482... Added fixed samples -DESCRIPTION: - This sample demonstrates how to get the information from an acquired phone number using your connection string -USAGE: -<<<<<<< HEAD - python list_acquired_phone_numbers_sample.py ->>>>>>> 798b57943... Regenerated code -======= - python get_phone_number_sample.py ->>>>>>> cb958a482... Added fixed samples Set the environment variables with your own values before running the sample: 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER - The phone number you want to get its information @@ -39,38 +23,12 @@ ) connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") # e.g. "+18001234567" -======= -phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") ->>>>>>> 798b57943... Regenerated code -======= -phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_INFORMATION") ->>>>>>> 968de8d7e... Added README and samples -======= -phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") ->>>>>>> a11fa64fb... Corrected samples -======= phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") # e.g. "+18001234567" ->>>>>>> cb958a482... Added fixed samples phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) def get_phone_number_information(): phone_number_information = phone_numbers_client.get_phone_number(phone_number) -<<<<<<< HEAD -<<<<<<< HEAD - print('Phone number information: ' + phone_number_information) -======= - print('Phone number information:') - print(phone_number_information) - ->>>>>>> 798b57943... Regenerated code -======= print('Phone number information: ' + phone_number_information) ->>>>>>> e339e2227... Addressed comments if __name__ == '__main__': get_phone_number_information() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py index e35d938f49bb..34dbfe415cf9 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py @@ -7,21 +7,9 @@ # -------------------------------------------------------------------------- """ -<<<<<<< HEAD -<<<<<<< HEAD FILE: list_acquired_phone_numbers_sample.py DESCRIPTION: This sample demonstrates how to get all off you acquired phone numbers using your connection string -======= -FILE: phone_number_area_codes_sample.py -DESCRIPTION: - This sample demonstrates how to get all area codes via a connection string, country code and phone plan id. ->>>>>>> 798b57943... Regenerated code -======= -FILE: list_acquired_phone_numbers_sample.py -DESCRIPTION: - This sample demonstrates how to get all off you acquired phone numbers using your connection string ->>>>>>> cb958a482... Added fixed samples USAGE: python list_acquired_phone_numbers_sample.py Set the environment variables with your own values before running the sample: @@ -39,21 +27,8 @@ def list_acquired_phone_numbers(): acquired_phone_numbers = phone_numbers_client.list_acquired_phone_numbers() print('Acquired phone numbers:') -<<<<<<< HEAD -<<<<<<< HEAD - for acquired_phone_number in acquired_phone_numbers: - print(acquired_phone_number.phone_number) -======= - print(acquired_phone_numbers) ->>>>>>> 798b57943... Regenerated code -======= for acquired_phone_number in acquired_phone_numbers: -<<<<<<< HEAD - print(acquired_phone_number) ->>>>>>> a11fa64fb... Corrected samples -======= print(acquired_phone_number.phone_number) ->>>>>>> f5c946df0... Regenerated code and addressed comments if __name__ == '__main__': diff --git a/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py index 3d0b30bc080f..819f7867e37e 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py @@ -7,27 +7,11 @@ # -------------------------------------------------------------------------- """ -<<<<<<< HEAD -<<<<<<< HEAD FILE: purchase_phone_number_sample.py DESCRIPTION: This sample demonstrates how to purchase a phone number using the search id you got from the search_available_phone_number API USAGE: python purchase_phone_number_sample.py -======= -FILE: phone_number_area_codes_sample.py -======= -FILE: purchase_phone_number_sample.py ->>>>>>> cb958a482... Added fixed samples -DESCRIPTION: - This sample demonstrates how to purchase a phone number using the search id you got from the search_available_phone_number API -USAGE: -<<<<<<< HEAD - python list_acquired_phone_numbers_sample.py ->>>>>>> 968de8d7e... Added README and samples -======= - python purchase_phone_number_sample.py ->>>>>>> cb958a482... Added fixed samples Set the environment variables with your own values before running the sample: 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service 2) AZURE_COMMUNICATION_SERVICE_SEARCH_ID_TO_PURCHASE - The search id for the phone number you reserved and want to purchase @@ -39,27 +23,7 @@ ) connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -<<<<<<< HEAD -<<<<<<< HEAD -search_id = os.getenv("AZURE_COMMUNICATION_SERVICE_SEARCH_ID_TO_PURCHASE") -phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) - -def purchase_phone_number(): - poller = phone_numbers_client.begin_purchase_phone_numbers( - search_id, - polling = True - ) - poller.result() - print("Result from the purchase operation: " + poller.status()) - - -if __name__ == '__main__': - purchase_phone_number() -======= -phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_INFORMATION") -======= search_id = os.getenv("AZURE_COMMUNICATION_SERVICE_SEARCH_ID_TO_PURCHASE") ->>>>>>> cb958a482... Added fixed samples phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) def purchase_phone_number(): @@ -72,9 +36,4 @@ def purchase_phone_number(): if __name__ == '__main__': -<<<<<<< HEAD - get_phone_number_information() ->>>>>>> 968de8d7e... Added README and samples -======= purchase_phone_number() ->>>>>>> cb958a482... Added fixed samples diff --git a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py index ff93bc8c1004..4f99c63bb6b7 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py @@ -7,8 +7,6 @@ # -------------------------------------------------------------------------- """ -<<<<<<< HEAD -<<<<<<< HEAD FILE: release_phone_number_sample.py DESCRIPTION: This sample demonstrates how to release a previously acquired phone number using your connection string. @@ -17,23 +15,6 @@ Set the environment variables with your own values before running the sample: 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE - The phone number you want to release -======= -FILE: phone_number_area_codes_sample.py -======= -FILE: release_phone_number_sample.py ->>>>>>> cb958a482... Added fixed samples -DESCRIPTION: - This sample demonstrates how to release a previously acquired phone number using your connection string. -USAGE: - python release_phone_number_sample.py - Set the environment variables with your own values before running the sample: - 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service -<<<<<<< HEAD - 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_RELEASE - The phone number you want to release ->>>>>>> 968de8d7e... Added README and samples -======= - 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE - The phone number you want to release ->>>>>>> cb958a482... Added fixed samples """ import os @@ -42,39 +23,15 @@ ) connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') -<<<<<<< HEAD -<<<<<<< HEAD -phone_number_to_release = os.getenv( - "AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE" # e.g. "+18001234567" -) -======= -phone_number_to_release = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_RELEASE") ->>>>>>> 968de8d7e... Added README and samples -======= phone_number_to_release = os.getenv( "AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE" # e.g. "+18001234567" ) ->>>>>>> a11fa64fb... Corrected samples phone_numbers_client = PhoneNumbersClient.from_connection_string(connection_str) def release_phone_number(): poller = phone_numbers_client.begin_release_phone_number(phone_number_to_release) poller.result() -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD - print('Status of the operation: ' + poller.status()) -======= - print('Status of the operation:') -======= - print('Status of the operation: ' + poller.status) ->>>>>>> e339e2227... Addressed comments - print(poller.status()) - ->>>>>>> 968de8d7e... Added README and samples -======= print('Status of the operation: ' + poller.status()) ->>>>>>> f5c946df0... Regenerated code and addressed comments if __name__ == '__main__': release_phone_number() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py index 4cb6a8935d0a..9c5f01f3df35 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py @@ -7,27 +7,11 @@ # -------------------------------------------------------------------------- """ -<<<<<<< HEAD -<<<<<<< HEAD FILE: search_available_phone_numbers_sample.py DESCRIPTION: This sample demonstrates how to search for available numbers you can buy with the respective API. USAGE: python search_available_phone_numbers_sample.py -======= -FILE: phone_number_area_codes_sample.py -======= -FILE: search_available_phone_numbers_sample.py ->>>>>>> cb958a482... Added fixed samples -DESCRIPTION: - This sample demonstrates how to search for available numbers you can buy with the respective API. -USAGE: -<<<<<<< HEAD - python list_acquired_phone_numbers_sample.py ->>>>>>> 968de8d7e... Added README and samples -======= - python search_available_phone_numbers_sample.py ->>>>>>> cb958a482... Added fixed samples Set the environment variables with your own values before running the sample: 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service 2) AZURE_COMMUNICATION_SERVICE_AREA_CODE - The area code you want the number to be in @@ -39,15 +23,7 @@ PhoneNumberType, PhoneNumberAssignmentType, PhoneNumberCapabilities, -<<<<<<< HEAD -<<<<<<< HEAD - PhoneNumberCapabilityType -======= - PhoneNumberCapabilityValue ->>>>>>> 968de8d7e... Added README and samples -======= PhoneNumberCapabilityType ->>>>>>> f5c946df0... Regenerated code and addressed comments ) connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') @@ -56,18 +32,8 @@ def search_available_phone_numbers(): capabilities = PhoneNumberCapabilities( -<<<<<<< HEAD -<<<<<<< HEAD calling = PhoneNumberCapabilityType.INBOUND, sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND -======= - calling = PhoneNumberCapabilityValue.INBOUND, - sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND ->>>>>>> 968de8d7e... Added README and samples -======= - calling = PhoneNumberCapabilityType.INBOUND, - sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND ->>>>>>> f5c946df0... Regenerated code and addressed comments ) poller = phone_numbers_client.begin_search_available_phone_numbers( "US", @@ -78,29 +44,8 @@ def search_available_phone_numbers(): 1, polling = True ) -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD - print('Acquired phone numbers: ' + poller.result()) - - -if __name__ == '__main__': - search_available_phone_numbers() -======= - print('Acquired phone numbers:') - print(poller.result) -======= - print('Acquired phone numbers: ' + poller.result) ->>>>>>> e339e2227... Addressed comments -======= print('Acquired phone numbers: ' + poller.result()) ->>>>>>> f5c946df0... Regenerated code and addressed comments if __name__ == '__main__': -<<<<<<< HEAD - list_acquired_phone_numbers() ->>>>>>> 968de8d7e... Added README and samples -======= search_available_phone_numbers() ->>>>>>> cb958a482... Added fixed samples diff --git a/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py index f088d9dd8dad..1985b1f671b2 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py @@ -20,15 +20,7 @@ import os from azure.communication.phonenumbers import ( PhoneNumbersClient, -<<<<<<< HEAD -<<<<<<< HEAD PhoneNumberCapabilityType -======= - PhoneNumberCapabilityValue ->>>>>>> cb958a482... Added fixed samples -======= - PhoneNumberCapabilityType ->>>>>>> f5c946df0... Regenerated code and addressed comments ) connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') @@ -40,31 +32,12 @@ def update_phone_number_capabilities(): poller = phone_numbers_client.begin_update_phone_number_capabilities( "+18335260208", -<<<<<<< HEAD -<<<<<<< HEAD - PhoneNumberCapabilityType.OUTBOUND, - PhoneNumberCapabilityType.INBOUND_OUTBOUND, - polling = True - ) - poller.result() - print('Status of the operation: ' + poller.status()) -======= - PhoneNumberCapabilityValue.OUTBOUND, - PhoneNumberCapabilityValue.INBOUND_OUTBOUND, -======= PhoneNumberCapabilityType.OUTBOUND, PhoneNumberCapabilityType.INBOUND_OUTBOUND, ->>>>>>> f5c946df0... Regenerated code and addressed comments polling = True ) poller.result() -<<<<<<< HEAD - print('Status of the operation:') - print(poller.status()) ->>>>>>> cb958a482... Added fixed samples -======= print('Status of the operation: ' + poller.status()) ->>>>>>> e339e2227... Addressed comments if __name__ == '__main__': update_phone_number_capabilities() \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md b/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md index 6ee5dec1027d..908729754762 100644 --- a/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md +++ b/sdk/communication/azure-communication-phonenumbers/swagger/PHONE_NUMBER_SWAGGER.md @@ -10,23 +10,7 @@ autorest ./PHONE_NUMBER_SWAGGER.md ### Settings ``` yaml -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a4d1e1516433894fca89f9600a6ac8a5471fc598/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json -======= -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/f20d92b324842b407e0dcce36ad0e67bd9bb66cf/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json ->>>>>>> ea76a164a... Added new pnm redesign code -======= -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/e23190a5bc64cd8526d08b6c2c1d616939bc88b3/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json ->>>>>>> 798b57943... Regenerated code -======= -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/967da531665d4b51a7a5599324e5edd95489cc3d/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json ->>>>>>> 968de8d7e... Added README and samples -======= -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a4d1e1516433894fca89f9600a6ac8a5471fc598/specification/communication/data-plane/Microsoft.CommunicationServicesPhoneNumbers/stable/2021-03-07/phonenumbers.json ->>>>>>> f5c946df0... Regenerated code and addressed comments output-folder: ../azure/communication/phonenumbers/_generated namespace: azure.communication.phonenumbers license-header: MICROSOFT_MIT_NO_VERSION diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml index 374f44c27447..8133e743555a 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml @@ -9,153 +9,31 @@ interactions: Connection: - keep-alive Date: -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - Mon, 22 Feb 2021 19:48:24 GMT -======= - - Wed, 10 Feb 2021 19:32:33 GMT ->>>>>>> ea76a164a... Added new pnm redesign code:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_phone_numbers_from_managed_identity.yaml -======= - - Wed, 10 Feb 2021 20:42:54 GMT ->>>>>>> 8bb023cc3... Added sanitization -======= - - Thu, 11 Feb 2021 23:15:38 GMT ->>>>>>> 798b57943... Regenerated code -======= - - Mon, 15 Feb 2021 17:03:10 GMT ->>>>>>> 968de8d7e... Added README and samples -======= - - Tue, 16 Feb 2021 19:42:45 GMT ->>>>>>> 2b281d8ce... Addresses comments -======= - - Mon, 22 Feb 2021 19:48:24 GMT ->>>>>>> e339e2227... Addressed comments User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18335260208?api-version=2021-03-07 response: body: string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound+outbound", "sms": "outbound"}, "assignmentType": "Application"}' -======= - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 - response: - body: -<<<<<<< HEAD - string: '{"id": "16194895875", "phoneNumber": "+16194895875", "countryCode": - "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "User", "callbackUri": null, "applicationId": - null}' ->>>>>>> ea76a164a... Added new pnm redesign code:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_phone_numbers_from_managed_identity.yaml -======= - string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", - "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", "sms": -<<<<<<< HEAD - "none"}, "assignmentType": "User", "callbackUri": null, "applicationId": null}' ->>>>>>> 8bb023cc3... Added sanitization -======= - "none"}, "assignmentType": "User"}' ->>>>>>> 798b57943... Regenerated code -======= - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272412?api-version=2021-03-07 - response: - body: - string: '{"id": "18332272412", "phoneNumber": "+18332272412", "countryCode": - "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", - "sms": "inbound+outbound"}, "assignmentType": "Application"}' ->>>>>>> 968de8d7e... Added README and samples -======= - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18335260208?api-version=2021-03-07 - response: - body: - string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", - "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound+outbound", - "sms": "outbound"}, "assignmentType": "Application"}' ->>>>>>> e339e2227... Addressed comments headers: content-type: - application/json; charset=utf-8 date: -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - - Mon, 22 Feb 2021 19:48:23 GMT - ms-cv: - - KQDB5Gt5/EiYmdjzTHoodQ.0 -======= - - Wed, 10 Feb 2021 19:32:33 GMT - ms-cv: - - Y6DU+yoXtk+lfRS/sfS0AA.0 ->>>>>>> ea76a164a... Added new pnm redesign code:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_phone_numbers_from_managed_identity.yaml -======= - - Wed, 10 Feb 2021 20:42:54 GMT - ms-cv: - - NloH7B1nGEu+4ADVEcl9Rw.0 ->>>>>>> 8bb023cc3... Added sanitization -======= - - Thu, 11 Feb 2021 23:15:39 GMT - ms-cv: - - 0Fa+iu/NaEivjqj8QV7AwQ.0 ->>>>>>> 798b57943... Regenerated code -======= - - Mon, 15 Feb 2021 17:03:08 GMT - ms-cv: - - Sz35r6+6dUyc5CXXRpte2A.0 ->>>>>>> 968de8d7e... Added README and samples -======= - - Tue, 16 Feb 2021 19:42:46 GMT - ms-cv: - - Npb2F6HCHUCS3PCMa+LVKA.0 ->>>>>>> 2b281d8ce... Addresses comments -======= - Mon, 22 Feb 2021 19:48:23 GMT ms-cv: - KQDB5Gt5/EiYmdjzTHoodQ.0 ->>>>>>> e339e2227... Addressed comments request-context: - appId= transfer-encoding: - chunked x-processing-time: -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml - - 847ms -======= - - 756ms ->>>>>>> ea76a164a... Added new pnm redesign code:sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_all_phone_numbers_from_managed_identity.yaml -======= - - 778ms ->>>>>>> 8bb023cc3... Added sanitization -======= - - 828ms ->>>>>>> 798b57943... Regenerated code -======= - - 970ms ->>>>>>> 968de8d7e... Added README and samples -======= - - 810ms ->>>>>>> 2b281d8ce... Addresses comments -======= - 847ms ->>>>>>> e339e2227... Addressed comments status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml new file mode 100644 index 000000000000..8c2f54af5f70 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml @@ -0,0 +1,38 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Tue, 02 Mar 2021 22:15:48 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 + response: + body: + string: '{"phoneNumbers": "sanitized"}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Tue, 02 Mar 2021 22:15:52 GMT + ms-cv: + - 1414CoW0X0iYJWEiELIX2A.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 4208ms + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml index a9798485e5bb..f52367daa393 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml @@ -5,48 +5,13 @@ interactions: Accept: - application/json Date: -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD - Tue, 16 Feb 2021 19:45:38 GMT -======= - - Thu, 11 Feb 2021 20:34:10 GMT ->>>>>>> 798b57943... Regenerated code -======= - - Tue, 16 Feb 2021 19:28:29 GMT ->>>>>>> 2deb4f44c... Tests work with new area code -======= - - Tue, 16 Feb 2021 19:45:38 GMT ->>>>>>> 2b281d8ce... Addresses comments User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET -<<<<<<< HEAD -<<<<<<< HEAD - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272412?api-version=2021-03-07 - response: - body: - string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", - "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": - "inbound+outbound"}, "assignmentType": "Application"}' - headers: - content-type: application/json; charset=utf-8 - date: Tue, 16 Feb 2021 19:45:39 GMT - ms-cv: pDmuqc/E1EGttt2gQZMupQ.0 - request-context: appId= - transfer-encoding: chunked - x-processing-time: 960ms - status: - code: 200 - message: OK - url: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272412?api-version=2021-03-07 -======= - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 -======= uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272412?api-version=2021-03-07 ->>>>>>> 2b281d8ce... Addresses comments response: body: string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", @@ -60,14 +25,7 @@ interactions: transfer-encoding: chunked x-processing-time: 960ms status: -<<<<<<< HEAD - code: 401 - message: Unauthorized - url: https://sanitized.communication.azure.com/phoneNumbers/%2B16194895875?api-version=2021-03-07 ->>>>>>> 798b57943... Regenerated code -======= code: 200 message: OK url: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272412?api-version=2021-03-07 ->>>>>>> 2b281d8ce... Addresses comments version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml index 9870293b3983..c0d7daac80a7 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml @@ -5,19 +5,7 @@ interactions: Accept: - application/json Date: -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD - Mon, 22 Feb 2021 19:49:31 GMT -======= - - Thu, 11 Feb 2021 20:20:13 GMT ->>>>>>> 798b57943... Regenerated code -======= - - Tue, 16 Feb 2021 19:45:32 GMT ->>>>>>> 2b281d8ce... Addresses comments -======= - - Mon, 22 Feb 2021 19:49:31 GMT ->>>>>>> e339e2227... Addressed comments User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -26,10 +14,6 @@ interactions: uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 response: body: -<<<<<<< HEAD -<<<<<<< HEAD -======= ->>>>>>> e339e2227... Addressed comments string: '{"phoneNumbers": [{"id": "18332272412", "phoneNumber": "+18332272412", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": @@ -51,78 +35,13 @@ interactions: {"id": "18336369501", "phoneNumber": "+18336369501", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound+outbound", "sms": "none"}, "assignmentType": "Application"}]}' -<<<<<<< HEAD - headers: - content-type: application/json; charset=utf-8 - date: Mon, 22 Feb 2021 19:49:29 GMT - ms-cv: gR+k7FVMNkWEuGWjsZ5mUg.0 - request-context: appId= - transfer-encoding: chunked - x-processing-time: 930ms -======= - string: '{"phoneNumbers": [{"id": "16194895875", "phoneNumber": "+16194895875", - "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": - "outbound", "sms": "none"}, "assignmentType": "Person"}, {"id": "16194895877", - "phoneNumber": "+16194895877", "countryCode": "US", "phoneNumberType": "Geographic", - "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": - "Person"}, {"id": "16194895878", "phoneNumber": "+16194895878", "countryCode": - "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "Person"}, {"id": "16194895879", "phoneNumber": - "+16194895879", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": - {"calling": "outbound", "sms": "none"}, "assignmentType": "Person"}, {"id": - "16194895880", "phoneNumber": "+16194895880", "countryCode": "US", "phoneNumberType": - "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": - "Person"}, {"id": "16194895882", "phoneNumber": "+16194895882", "countryCode": - "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "Person"}, {"id": "16194895885", "phoneNumber": - "+16194895885", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": - {"calling": "outbound", "sms": "none"}, "assignmentType": "Person"}, {"id": - "16194895887", "phoneNumber": "+16194895887", "countryCode": "US", "phoneNumberType": - "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": - "Person"}, {"id": "16194895889", "phoneNumber": "+16194895889", "countryCode": - "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", - "sms": "none"}, "assignmentType": "Person"}, {"id": "18332271680", "phoneNumber": - "+18332271680", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": - {"calling": "none", "sms": "outbound"}, "assignmentType": "Application"}, - {"id": "18332272412", "phoneNumber": "+18332272412", "countryCode": "US", - "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": - "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332272430", - "phoneNumber": "+18332272430", "countryCode": "US", "phoneNumberType": "TollFree", - "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": - "Application"}, {"id": "18332272445", "phoneNumber": "+18332272445", "countryCode": - "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", - "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332321209", - "phoneNumber": "+18332321209", "countryCode": "US", "phoneNumberType": "TollFree", - "capabilities": {"calling": "none", "sms": "inbound+outbound"}, "assignmentType": - "Application"}, {"id": "18332321221", "phoneNumber": "+18332321221", "countryCode": - "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "none", "sms": - "inbound+outbound"}, "assignmentType": "Application"}, {"id": "18332321226", - "phoneNumber": "+18332321226", "countryCode": "US", "phoneNumberType": "TollFree", - "capabilities": {"calling": "none", "sms": "inbound+outbound"}, "assignmentType": - "Application"}, {"id": "18335260208", "phoneNumber": "+18335260208", "countryCode": - "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound+outbound", - "sms": "outbound"}, "assignmentType": "Application"}, {"id": "18336369501", - "phoneNumber": "+18336369501", "countryCode": "US", "phoneNumberType": "TollFree", - "capabilities": {"calling": "inbound+outbound", "sms": "none"}, "assignmentType": - "Application"}]}' -======= ->>>>>>> e339e2227... Addressed comments headers: content-type: application/json; charset=utf-8 date: Mon, 22 Feb 2021 19:49:29 GMT ms-cv: gR+k7FVMNkWEuGWjsZ5mUg.0 request-context: appId= transfer-encoding: chunked -<<<<<<< HEAD -<<<<<<< HEAD - x-processing-time: 2257ms ->>>>>>> 798b57943... Regenerated code -======= - x-processing-time: 908ms ->>>>>>> 2b281d8ce... Addresses comments -======= x-processing-time: 930ms ->>>>>>> e339e2227... Addressed comments status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index abc8a6850576..b117dd1e886c 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -1,38 +1,14 @@ -<<<<<<< HEAD -<<<<<<< HEAD import os import pytest from azure.communication.phonenumbers import PhoneNumbersClient from _shared.testcase import CommunicationTestCase, ResponseReplacerProcessor, BodyReplacerProcessor from _shared.utils import create_token_credential -<<<<<<< HEAD -<<<<<<< HEAD -from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityType, PhoneNumberType -from azure.communication.phonenumbers._shared.utils import parse_connection_str -======= -======= -import os ->>>>>>> dae559a62... Removed hardcoded info from tests -import pytest -from azure.communication.phonenumbers import PhoneNumbersClient -from _shared.testcase import CommunicationTestCase, ResponseReplacerProcessor, BodyReplacerProcessor from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType ->>>>>>> ea76a164a... Added new pnm redesign code -======= -from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType -======= -from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityType, PhoneNumberType ->>>>>>> f5c946df0... Regenerated code and addressed comments from azure.communication.phonenumbers._shared.utils import parse_connection_str ->>>>>>> 33c619188... Added managed identity tests and addressed apiview comments class NewTests(CommunicationTestCase): def setUp(self): super(NewTests, self).setUp() -<<<<<<< HEAD -<<<<<<< HEAD -======= ->>>>>>> dae559a62... Removed hardcoded info from tests if self.is_playback(): self.phone_number = "+18000005555" self.phone_number_to_release = "+18000005556" @@ -43,11 +19,10 @@ def setUp(self): self.phone_number_to_release = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE") self.country_code = os.getenv("AZURE_COMMUNICATION_SERVICE_COUNTRY_CODE") self.area_code = os.getenv("AZURE_COMMUNICATION_SERIVCE_AREA_CODE") -<<<<<<< HEAD self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ BodyReplacerProcessor( - keys=["id", "token", "phoneNumber", "phonenumbers"] + keys=["id", "token", "phoneNumber", "phonenumbers", "phoneNumbers"] ), ResponseReplacerProcessor(keys=[self._resource_name])]) @@ -77,8 +52,8 @@ def test_release_phone_number(self): @pytest.mark.live_test_only def test_search_available_phone_numbers(self): capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityType.INBOUND, - sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND + calling = PhoneNumberCapabilityValue.INBOUND, + sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND ) poller = self.phone_number_client.begin_search_available_phone_numbers( self.country_code, @@ -94,8 +69,8 @@ def test_search_available_phone_numbers(self): def test_update_phone_number_capabilities(self): poller = self.phone_number_client.begin_update_phone_number_capabilities( self.phone_number, - PhoneNumberCapabilityType.OUTBOUND, - PhoneNumberCapabilityType.INBOUND_OUTBOUND, + PhoneNumberCapabilityValue.OUTBOUND, + PhoneNumberCapabilityValue.INBOUND_OUTBOUND, polling = True ) assert poller.result() @@ -103,8 +78,8 @@ def test_update_phone_number_capabilities(self): @pytest.mark.live_test_only def test_purchase_phone_numbers(self): capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityType.INBOUND, - sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND + calling = PhoneNumberCapabilityValue.INBOUND, + sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND ) search_poller = self.phone_number_client.begin_search_available_phone_numbers( self.country_code, @@ -112,113 +87,11 @@ def test_purchase_phone_numbers(self): PhoneNumberAssignmentType.APPLICATION, capabilities, self.area_code, -======= -======= ->>>>>>> dae559a62... Removed hardcoded info from tests - self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) - self.recording_processors.extend([ - BodyReplacerProcessor( - keys=["id", "token", "phoneNumber", "phonenumbers"] - ), - ResponseReplacerProcessor(keys=[self._resource_name])]) - - @pytest.mark.live_test_only - def test_list_all_phone_numbers_from_managed_identity(self): - endpoint, access_key = parse_connection_str(self.connection_str) - credential = create_token_credential() - phone_number_client = PhoneNumbersClient(endpoint, credential) - phone_numbers = phone_number_client.list_all_phone_numbers() - assert phone_numbers.next() - - @pytest.mark.live_test_only - def test_list_acquired_phone_numbers(self): - phone_numbers = self.phone_number_client.list_acquired_phone_numbers() - assert phone_numbers.next() - - @pytest.mark.live_test_only - def test_get_phone_number(self): - phone_number = self.phone_number_client.get_phone_number(self.phone_number) - assert phone_number.phone_number == self.phone_number - - @pytest.mark.live_test_only - def test_release_phone_number(self): - poller = self.phone_number_client.begin_release_phone_number(self.phone_number_to_release) - assert poller.status() == 'succeeded' - - @pytest.mark.live_test_only - def test_search_available_phone_numbers(self): - capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityType.INBOUND, - sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND - ) - poller = self.phone_number_client.begin_search_available_phone_numbers( - self.country_code, - PhoneNumberType.TOLL_FREE, - PhoneNumberAssignmentType.APPLICATION, - capabilities, - area_code=self.area_code, - polling = True - ) - assert poller.result() - - @pytest.mark.live_test_only - def test_update_phone_number_capabilities(self): - poller = self.phone_number_client.begin_update_phone_number_capabilities( - self.phone_number, - PhoneNumberCapabilityType.OUTBOUND, - PhoneNumberCapabilityType.INBOUND_OUTBOUND, - polling = True - ) - assert poller.result() - - @pytest.mark.live_test_only - def test_purchase_phone_numbers(self): - capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityType.INBOUND, - sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND - ) - search_poller = self.phone_number_client.begin_search_available_phone_numbers( - self.country_code, - PhoneNumberType.TOLL_FREE, - PhoneNumberAssignmentType.APPLICATION, - capabilities, -<<<<<<< HEAD -<<<<<<< HEAD - "833", ->>>>>>> ea76a164a... Added new pnm redesign code -======= - "844", ->>>>>>> 968de8d7e... Added README and samples -======= - self.area_code, ->>>>>>> dae559a62... Removed hardcoded info from tests 1, polling = True ) phone_number_to_buy = search_poller.result() purchase_poller = self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) assert purchase_poller.result() -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD - release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) -======= - release_poller = self.phone_number_client.begin_release_phone_number("+") ->>>>>>> ea76a164a... Added new pnm redesign code -======= - release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) -<<<<<<< HEAD ->>>>>>> 8bb023cc3... Added sanitization - assert release_poller.status() == 'succeeded' -======= - assert release_poller.status() == 'succeeded' ->>>>>>> 798b57943... Regenerated code -======= - ##release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) - ##assert release_poller.status() == 'succeeded' ->>>>>>> 968de8d7e... Added README and samples -======= release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) assert release_poller.status() == 'succeeded' ->>>>>>> dae559a62... Removed hardcoded info from tests diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index ee8e5f6cfc91..7dc30f0ee7b5 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -1,37 +1,15 @@ -<<<<<<< HEAD -<<<<<<< HEAD -<<<<<<< HEAD import os -======= ->>>>>>> 798b57943... Regenerated code -======= -import os ->>>>>>> dae559a62... Removed hardcoded info from tests import pytest from azure.communication.phonenumbers.aio import PhoneNumbersClient from _shared.asynctestcase import AsyncCommunicationTestCase from _shared.testcase import ResponseReplacerProcessor, BodyReplacerProcessor -<<<<<<< HEAD -<<<<<<< HEAD -from _shared.utils import create_token_credential -from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityType, PhoneNumberType -from azure.communication.phonenumbers._shared.utils import parse_connection_str -======= -from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType ->>>>>>> 798b57943... Regenerated code -======= from _shared.utils import create_token_credential from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityType, PhoneNumberType from azure.communication.phonenumbers._shared.utils import parse_connection_str ->>>>>>> 33c619188... Added managed identity tests and addressed apiview comments class NewTests(AsyncCommunicationTestCase): def setUp(self): super(NewTests, self).setUp() -<<<<<<< HEAD -<<<<<<< HEAD -======= ->>>>>>> dae559a62... Removed hardcoded info from tests if self.is_playback(): self.phone_number = "+18000005555" self.phone_number_to_release = "+18000005556" @@ -43,11 +21,6 @@ def setUp(self): self.country_code = os.getenv("AZURE_COMMUNICATION_SERVICE_COUNTRY_CODE") self.area_code = os.getenv("AZURE_COMMUNICATION_SERIVCE_AREA_CODE") -<<<<<<< HEAD -======= ->>>>>>> 798b57943... Regenerated code -======= ->>>>>>> dae559a62... Removed hardcoded info from tests self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ BodyReplacerProcessor( @@ -56,34 +29,8 @@ def setUp(self): ResponseReplacerProcessor(keys=[self._resource_name])]) @AsyncCommunicationTestCase.await_prepared_test -<<<<<<< HEAD -<<<<<<< HEAD - @pytest.mark.live_test_only - async def test_list_all_phone_numbers_from_managed_identity(self): - endpoint, access_key = parse_connection_str(self.connection_str) - credential = create_token_credential() - phone_number_client = PhoneNumbersClient(endpoint, credential) - async with self.phone_number_client: - phone_numbers = phone_number_client.list_acquired_phone_numbers() - items = [] - async for item in phone_numbers: - items.append(item) - assert len(items) > 0 - - @AsyncCommunicationTestCase.await_prepared_test @pytest.mark.live_test_only -<<<<<<< HEAD -======= ->>>>>>> 798b57943... Regenerated code -======= - @pytest.mark.live_test_only -<<<<<<< HEAD ->>>>>>> cb958a482... Added fixed samples -======= - def test_list_all_phone_numbers_from_managed_identity(self): -======= async def test_list_all_phone_numbers_from_managed_identity(self): ->>>>>>> e339e2227... Addressed comments endpoint, access_key = parse_connection_str(self.connection_str) credential = create_token_credential() phone_number_client = PhoneNumbersClient(endpoint, credential) @@ -96,7 +43,6 @@ async def test_list_all_phone_numbers_from_managed_identity(self): @AsyncCommunicationTestCase.await_prepared_test @pytest.mark.live_test_only ->>>>>>> 33c619188... Added managed identity tests and addressed apiview comments async def test_list_acquired_phone_numbers(self): async with self.phone_number_client: phone_numbers = self.phone_number_client.list_acquired_phone_numbers() @@ -106,81 +52,7 @@ async def test_list_acquired_phone_numbers(self): assert len(items) > 0 @AsyncCommunicationTestCase.await_prepared_test -<<<<<<< HEAD -<<<<<<< HEAD - @pytest.mark.live_test_only - async def test_get_phone_number(self): - async with self.phone_number_client: - phone_number = await self.phone_number_client.get_phone_number(self.phone_number) - assert phone_number.phone_number == self.phone_number - - - @AsyncCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - async def test_release_phone_number(self): - async with self.phone_number_client: - poller = await self.phone_number_client.begin_release_phone_number(self.phone_number_to_release) - result = await poller.result() - assert result - - @AsyncCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - async def test_search_available_phone_numbers(self): - capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityType.INBOUND, - sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND - ) - async with self.phone_number_client: - poller = await self.phone_number_client.begin_search_available_phone_numbers( - self.country_code, - PhoneNumberType.TOLL_FREE, - PhoneNumberAssignmentType.APPLICATION, - capabilities, - area_code=self.area_code, - polling = True - ) - assert poller.result() - - @AsyncCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - async def test_update_phone_number_capabilities(self): - async with self.phone_number_client: - poller = self.phone_number_client.begin_update_phone_number_capabilities( - self.phone_number, - PhoneNumberCapabilityType.OUTBOUND, - PhoneNumberCapabilityType.OUTBOUND, - polling = True - ) - assert poller.result() - - @AsyncCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - async def test_purchase_phone_numbers(self): - capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityType.INBOUND, - sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND - ) - async with self.phone_number_client: - search_poller = await self.phone_number_client.begin_search_available_phone_numbers( - self.country_code, - PhoneNumberType.TOLL_FREE, - PhoneNumberAssignmentType.APPLICATION, - capabilities, - self.area_code, - 1, - polling = True - ) - phone_number_to_buy = search_poller.result() - purchase_poller = await self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) - assert purchase_poller.result() - release_poller = await self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) - assert release_poller.status() == 'succeeded' -======= ->>>>>>> ea76a164a... Added new pnm redesign code -======= -======= @pytest.mark.live_test_only ->>>>>>> cb958a482... Added fixed samples async def test_get_phone_number(self): async with self.phone_number_client: phone_number = await self.phone_number_client.get_phone_number(self.phone_number) @@ -247,8 +119,3 @@ async def test_purchase_phone_numbers(self): assert purchase_poller.result() release_poller = await self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) assert release_poller.status() == 'succeeded' -<<<<<<< HEAD - ''' ->>>>>>> 798b57943... Regenerated code -======= ->>>>>>> cb958a482... Added fixed samples From 545fcb07e7be29a7e386a29dcce9ffa4d8da1518 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Thu, 4 Mar 2021 17:00:24 -0700 Subject: [PATCH 28/32] Reworked tests --- .../README.md | 4 +- .../phonenumbers/_phone_numbers_client.py | 7 +- .../azure-communication-phonenumbers/setup.py | 1 - .../test/_shared/testcase.py | 2 +- .../test/phone_number_helper.py | 6 +- ...stration_client.test_get_phone_number.yaml | 15 +- ...ient.test_list_acquired_phone_numbers.yaml | 10 +- ...on_client.test_purchase_phone_numbers.yaml | 257 ++++++++++++++++++ ...tion_client.test_release_phone_number.yaml | 24 +- ...t.test_search_available_phone_numbers.yaml | 129 +++++++++ ...test_update_phone_number_capabilities.yaml | 129 +++++++++ ...on_client_async.test_get_phone_number.yaml | 15 +- ...sync.test_list_acquired_phone_numbers.yaml | 51 ++-- ...l_phone_numbers_from_managed_identity.yaml | 25 ++ ...ent_async.test_purchase_phone_numbers.yaml | 185 +++++++++++++ ...c.test_search_available_phone_numbers.yaml | 37 +++ ...test_update_phone_number_capabilities.yaml | 37 +++ ...test_phone_number_administration_client.py | 39 ++- ...hone_number_administration_client_async.py | 50 ++-- 19 files changed, 903 insertions(+), 120 deletions(-) create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers_from_managed_identity.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml diff --git a/sdk/communication/azure-communication-phonenumbers/README.md b/sdk/communication/azure-communication-phonenumbers/README.md index 6a28ebb57a68..90930ca058ab 100644 --- a/sdk/communication/azure-communication-phonenumbers/README.md +++ b/sdk/communication/azure-communication-phonenumbers/README.md @@ -95,8 +95,8 @@ poller = phone_numbers_client.begin_search_available_phone_numbers( PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - "833", # Area code is optional for toll-free numbers - 1, # Quantity is optional, default is 1 + area_code ="833", # Area code is optional for toll-free numbers + quantity = 2, # Quantity is optional. If not set, default is 1 polling = True ) search_result = poller.result() diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py index c2704c822724..f392b4a00ae3 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py @@ -88,7 +88,6 @@ def begin_release_phone_number( :param phone_number: Phone number to be released, e.g. +11234567890. :type phone_number: str - :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. @@ -109,7 +108,6 @@ def begin_search_available_phone_numbers( phone_number_type, # type: str assignment_type, # type: str capabilities, # type: PhoneNumberCapabilities - quantity=None, # type: int **kwargs # type: Any ): # type: (...) -> LROPoller[PhoneNumberSearchResult] @@ -127,10 +125,9 @@ def begin_search_available_phone_numbers( ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param capabilities: Required. Capabilities of a phone number. :type capabilities: ~azure.communication.phonenumbers.models.PhoneNumberCapabilities - :param quantity: The quantity of phone numbers in the search. Should be at least 1. - :type quantity: int :keyword str area_code: The area code of the desired phone number, e.g. 425. If not set, any area code could be used in the final search. + :keyword int quantity: The quantity of phone numbers in the search. Default is 1. :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. @@ -143,7 +140,7 @@ def begin_search_available_phone_numbers( phone_number_type=phone_number_type, assignment_type=assignment_type, capabilities=capabilities, - quantity=quantity, + quantity=kwargs.pop('quantity', None), area_code=kwargs.pop('area_code', None) ) return self._phone_number_client.phone_numbers.begin_search_available_phone_numbers( diff --git a/sdk/communication/azure-communication-phonenumbers/setup.py b/sdk/communication/azure-communication-phonenumbers/setup.py index f25bf8764c33..f5d560282c3b 100644 --- a/sdk/communication/azure-communication-phonenumbers/setup.py +++ b/sdk/communication/azure-communication-phonenumbers/setup.py @@ -49,7 +49,6 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', diff --git a/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py b/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py index bda0dbdb7bdf..97f79f4cfdf6 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py +++ b/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py @@ -73,7 +73,7 @@ def setUp(self): super(CommunicationTestCase, self).setUp() if self.is_playback(): - self.connection_str = "endpoint=https://sanitized/;accesskey=fake===" + self.connection_str = "endpoint=https://sanitized.communication.azure.com/;accesskey=fake===" else: self.connection_str = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING') endpoint, _ = parse_connection_str(self.connection_str) diff --git a/sdk/communication/azure-communication-phonenumbers/test/phone_number_helper.py b/sdk/communication/azure-communication-phonenumbers/test/phone_number_helper.py index fc84aeb70d23..dc68059352bb 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/phone_number_helper.py +++ b/sdk/communication/azure-communication-phonenumbers/test/phone_number_helper.py @@ -10,17 +10,13 @@ class PhoneNumberUriReplacer(RecordingProcessor): def process_request(self, request): import re - request.uri = re.sub('/identities/([^/?]+)', '/identities/sanitized', request.uri) + request.uri = re.sub('phoneNumbers/[%2B\d]+', 'phoneNumbers/sanitized', request.uri) return request def process_response(self, response): import re if 'url' in response: - response['url'] = re.sub('/identities/([^/?]+)', '/identities/sanitized', response['url']) - response['url'] = re.sub('phonePlanId=([^/?&]+)', 'phonePlanId=sanitized', response['url']) response['url'] = re.sub('capabilities/([^/?&]+)', 'capabilities/sanitized', response['url']) - response['url'] = re.sub('phoneplangroups/([^/?&]+)', 'phoneplangroups/sanitized', response['url']) - response['url'] = re.sub('phoneplans/([^/?&]+)', 'phoneplans/sanitized', response['url']) response['url'] = re.sub('releases/([^/?&]+)', 'releases/sanitized', response['url']) response['url'] = re.sub('searches/([^/?&]+)', 'searches/sanitized', response['url']) return response \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml index 8133e743555a..fc085da4f131 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml @@ -9,31 +9,32 @@ interactions: Connection: - keep-alive Date: - - Mon, 22 Feb 2021 19:48:24 GMT + - Thu, 04 Mar 2021 20:09:28 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18335260208?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/sanitized?api-version=2021-03-07 response: body: string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", - "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound+outbound", - "sms": "outbound"}, "assignmentType": "Application"}' + "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": + "inbound+outbound"}, "assignmentType": "Application", "purchaseDate": "2020-11-30T17:51:21.2991518+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}' headers: content-type: - application/json; charset=utf-8 date: - - Mon, 22 Feb 2021 19:48:23 GMT + - Thu, 04 Mar 2021 20:09:30 GMT ms-cv: - - KQDB5Gt5/EiYmdjzTHoodQ.0 + - b1QfQvNXJUCmudxXTNXVYw.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 847ms + - 1995ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml index 8c2f54af5f70..2d767d98e340 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive Date: - - Tue, 02 Mar 2021 22:15:48 GMT + - Thu, 04 Mar 2021 20:09:31 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -18,20 +18,20 @@ interactions: uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 response: body: - string: '{"phoneNumbers": "sanitized"}' + string: '{"phoneNumbers": ["sanitized"]}' headers: content-type: - application/json; charset=utf-8 date: - - Tue, 02 Mar 2021 22:15:52 GMT + - Thu, 04 Mar 2021 20:09:34 GMT ms-cv: - - 1414CoW0X0iYJWEiELIX2A.0 + - Aa07dXCJ1Eiv8sLy5yURtA.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 4208ms + - 4239ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml new file mode 100644 index 000000000000..927be673d40e --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml @@ -0,0 +1,257 @@ +interactions: +- request: + body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": + {"calling": "inbound", "sms": "inbound+outbound"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '131' + Content-Type: + - application/json + Date: + - Thu, 04 Mar 2021 19:00:18 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Location,Operation-Location,operation-id,search-id + content-length: + - '0' + date: + - Thu, 04 Mar 2021 19:00:21 GMT + ms-cv: + - cnDAlYZUaUq80DHCaL9HkQ.0 + operation-id: + - search_bc5ccc45-c46e-4e35-a4cb-b8309e4ef211 + operation-location: + - /phoneNumbers/operations/search_bc5ccc45-c46e-4e35-a4cb-b8309e4ef211?api-version=2021-03-07 + request-context: + - appId= + search-id: + - bc5ccc45-c46e-4e35-a4cb-b8309e4ef211 + x-processing-time: + - 3170ms + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Thu, 04 Mar 2021 19:00:52 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_bc5ccc45-c46e-4e35-a4cb-b8309e4ef211?api-version=2021-03-07 + response: + body: + string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/bc5ccc45-c46e-4e35-a4cb-b8309e4ef211?api-version=2021-03-07", + "createdDateTime": "2021-03-04T19:00:21.3580392+00:00", "id": "sanitized", + "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' + headers: + access-control-expose-headers: + - Location + content-type: + - application/json; charset=utf-8 + date: + - Thu, 04 Mar 2021 19:00:52 GMT + ms-cv: + - OpIdW4weIEGYzCsOBN5sbA.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 572ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Thu, 04 Mar 2021 19:00:52 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/bc5ccc45-c46e-4e35-a4cb-b8309e4ef211?api-version=2021-03-07 + response: + body: + string: '{"searchId": "bc5ccc45-c46e-4e35-a4cb-b8309e4ef211", "phoneNumbers": + "sanitized", "phoneNumberType": "TollFree", "assignmentType": "Application", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": + {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}, "searchExpiresBy": + "2021-03-04T19:16:27.0466380+00:00"}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Thu, 04 Mar 2021 19:00:53 GMT + ms-cv: + - zyw0LCL7MkiWYMgLtDF7EQ.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 957ms + status: + code: 200 + message: OK +- request: + body: '{"searchId": "bc5ccc45-c46e-4e35-a4cb-b8309e4ef211"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '52' + Content-Type: + - application/json + Date: + - Thu, 04 Mar 2021 19:00:53 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/:purchase?api-version=2021-03-07 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Operation-Location,operation-id,purchase-id + content-length: + - '0' + date: + - Thu, 04 Mar 2021 19:00:55 GMT + ms-cv: + - vZooSJe6KkmD8SFNUMVGfg.0 + operation-id: + - purchase_bc5ccc45-c46e-4e35-a4cb-b8309e4ef211 + operation-location: + - /phoneNumbers/operations/purchase_bc5ccc45-c46e-4e35-a4cb-b8309e4ef211?api-version=2021-03-07 + purchase-id: + - bc5ccc45-c46e-4e35-a4cb-b8309e4ef211 + request-context: + - appId= + x-processing-time: + - 2267ms + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Thu, 04 Mar 2021 19:01:26 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_bc5ccc45-c46e-4e35-a4cb-b8309e4ef211?api-version=2021-03-07 + response: + body: + string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": + "2021-03-04T19:00:21.3580392+00:00", "id": "sanitized", "operationType": "Purchase", + "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Thu, 04 Mar 2021 19:01:26 GMT + ms-cv: + - jW8zvj4iqkWUwa/mnePf3w.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 450ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Thu, 04 Mar 2021 19:01:26 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18445499820?api-version=2021-03-07 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Operation-Location,operation-id,release-id + content-length: + - '0' + date: + - Thu, 04 Mar 2021 19:01:27 GMT + ms-cv: + - 3Rh4W/qNvkGW649JaIS4yw.0 + operation-id: + - release_eadbe0e5-0ebd-4018-a05f-f4b708480a7d + operation-location: + - /phoneNumbers/operations/release_eadbe0e5-0ebd-4018-a05f-f4b708480a7d?api-version=2021-03-07 + release-id: + - eadbe0e5-0ebd-4018-a05f-f4b708480a7d + request-context: + - appId= + x-processing-time: + - 1436ms + status: + code: 202 + message: Accepted +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_number.yaml index c8cb46b97265..aab21e2f175a 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_number.yaml @@ -11,28 +11,36 @@ interactions: Content-Length: - '0' Date: - - Tue, 09 Feb 2021 23:10:08 GMT + - Thu, 04 Mar 2021 17:04:48 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272441?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18445495681?api-version=2021-03-07 response: body: string: '' headers: + access-control-expose-headers: + - Operation-Location,operation-id,release-id + content-length: + - '0' date: - - Tue, 09 Feb 2021 23:10:09 GMT + - Thu, 04 Mar 2021 17:04:50 GMT ms-cv: - - zTSfQ5gkkkyKQCTsCcVa7A.0 + - 4M4iMTTkAU2EYlx+U1W1vA.0 + operation-id: + - release_66dd2b9f-0b4d-454f-81b2-4bea870c8740 operation-location: - - /phoneNumbers/operations/release_601597ca-7e59-4433-ae4f-da83aef7da98?api-version=2021-03-07 + - /phoneNumbers/operations/release_66dd2b9f-0b4d-454f-81b2-4bea870c8740?api-version=2021-03-07 + release-id: + - 66dd2b9f-0b4d-454f-81b2-4bea870c8740 request-context: - appId= x-processing-time: - - 1236ms + - 1496ms status: - code: 204 - message: No Content + code: 202 + message: Accepted version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml new file mode 100644 index 000000000000..bbdc9f05b8b8 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml @@ -0,0 +1,129 @@ +interactions: +- request: + body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": + {"calling": "inbound", "sms": "inbound+outbound"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '131' + Content-Type: + - application/json + Date: + - Thu, 04 Mar 2021 20:09:35 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Location,Operation-Location,operation-id,search-id + content-length: + - '0' + date: + - Thu, 04 Mar 2021 20:09:38 GMT + ms-cv: + - xp+gSiPZFEi9TrSBlc6j9w.0 + operation-id: + - search_c0763b8c-895d-4bba-b312-bcf615a90b2d + operation-location: + - /phoneNumbers/operations/search_c0763b8c-895d-4bba-b312-bcf615a90b2d?api-version=2021-03-07 + request-context: + - appId= + search-id: + - c0763b8c-895d-4bba-b312-bcf615a90b2d + x-processing-time: + - 3391ms + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Thu, 04 Mar 2021 20:10:09 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_c0763b8c-895d-4bba-b312-bcf615a90b2d?api-version=2021-03-07 + response: + body: + string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/c0763b8c-895d-4bba-b312-bcf615a90b2d?api-version=2021-03-07", + "createdDateTime": "2021-03-04T20:09:38.6605579+00:00", "id": "sanitized", + "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' + headers: + access-control-expose-headers: + - Location + content-type: + - application/json; charset=utf-8 + date: + - Thu, 04 Mar 2021 20:10:09 GMT + ms-cv: + - WJ4OvgfDfE22EY3w9XwIlA.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 483ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Thu, 04 Mar 2021 20:10:09 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/c0763b8c-895d-4bba-b312-bcf615a90b2d?api-version=2021-03-07 + response: + body: + string: '{"searchId": "c0763b8c-895d-4bba-b312-bcf615a90b2d", "phoneNumbers": + ["sanitized"], "phoneNumberType": "TollFree", "assignmentType": "Application", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": + {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}, "searchExpiresBy": + "2021-03-04T20:25:44.8545724+00:00"}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Thu, 04 Mar 2021 20:10:10 GMT + ms-cv: + - yGgJPefdTUCTFErjWAngFA.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 968ms + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml new file mode 100644 index 000000000000..45ebf79305c6 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml @@ -0,0 +1,129 @@ +interactions: +- request: + body: '{"calling": "inbound", "sms": "inbound+outbound"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '49' + Content-Type: + - application/merge-patch+json + Date: + - Thu, 04 Mar 2021 20:10:10 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: PATCH + uri: https://sanitized.communication.azure.com/phoneNumbers/sanitized/capabilities?api-version=2021-03-07 + response: + body: + string: '{"capabilitiesUpdateId": "c753b8c0-bf2e-4f28-ad44-487b3e55c126"}' + headers: + access-control-expose-headers: + - Operation-Location,Location,operation-id,capabilities-id + capabilities-id: + - c753b8c0-bf2e-4f28-ad44-487b3e55c126 + content-type: + - application/json; charset=utf-8 + date: + - Thu, 04 Mar 2021 20:10:11 GMT + ms-cv: + - nJy2pwvO2kOqoLVJr05Tlg.0 + operation-id: + - capabilities_c753b8c0-bf2e-4f28-ad44-487b3e55c126 + operation-location: + - /phoneNumbers/operations/capabilities_c753b8c0-bf2e-4f28-ad44-487b3e55c126?api-version=2021-03-07 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 1111ms + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Thu, 04 Mar 2021 20:10:42 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/capabilities_c753b8c0-bf2e-4f28-ad44-487b3e55c126?api-version=2021-03-07 + response: + body: + string: '{"status": "Succeeded", "resourceLocation": "/phoneNumbers/+18332143261?api-version=2021-03-07", + "createdDateTime": "2021-03-04T20:10:11.7620886+00:00", "id": "sanitized", + "operationType": "UpdatePhoneNumberCapabilities", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' + headers: + access-control-expose-headers: + - Location + content-type: + - application/json; charset=utf-8 + date: + - Thu, 04 Mar 2021 20:10:43 GMT + ms-cv: + - bhOOUelnIEioRhByfOIYkQ.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 2355ms + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Date: + - Thu, 04 Mar 2021 20:10:44 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/+18332143261?api-version=2021-03-07 + response: + body: + string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", + "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": + "inbound+outbound"}, "assignmentType": "Application", "purchaseDate": "2020-11-30T17:51:21.2991518+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Thu, 04 Mar 2021 20:10:46 GMT + ms-cv: + - UmM4C4ozVkijkaibJMfTjQ.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 2097ms + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml index f52367daa393..4ebae7f27df7 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml @@ -5,27 +5,28 @@ interactions: Accept: - application/json Date: - - Tue, 16 Feb 2021 19:45:38 GMT + - Thu, 04 Mar 2021 20:10:46 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272412?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/sanitized?api-version=2021-03-07 response: body: string: '{"id": "sanitized", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": - "inbound+outbound"}, "assignmentType": "Application"}' + "inbound+outbound"}, "assignmentType": "Application", "purchaseDate": "2020-11-30T17:51:21.2991518+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}' headers: content-type: application/json; charset=utf-8 - date: Tue, 16 Feb 2021 19:45:39 GMT - ms-cv: pDmuqc/E1EGttt2gQZMupQ.0 + date: Thu, 04 Mar 2021 20:10:47 GMT + ms-cv: g+yRryu4o02OCKglJx1kXg.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 960ms + x-processing-time: 1282ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/phoneNumbers/%2B18332272412?api-version=2021-03-07 + url: https://live-testing.communication.azure.com/phoneNumbers/%2B18332143261?api-version=2021-03-07 version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml index c0d7daac80a7..952d2ff9dc0f 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml @@ -5,7 +5,7 @@ interactions: Accept: - application/json Date: - - Mon, 22 Feb 2021 19:49:31 GMT + - Thu, 04 Mar 2021 20:10:48 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -14,36 +14,35 @@ interactions: uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 response: body: - string: '{"phoneNumbers": [{"id": "18332272412", "phoneNumber": "+18332272412", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": - "18332272430", "phoneNumber": "+18332272430", "countryCode": "US", "phoneNumberType": - "TollFree", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, - "assignmentType": "Application"}, {"id": "18332272445", "phoneNumber": "+18332272445", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": - "18332321209", "phoneNumber": "+18332321209", "countryCode": "US", "phoneNumberType": - "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, - "assignmentType": "Application"}, {"id": "18332321221", "phoneNumber": "+18332321221", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "none", "sms": "inbound+outbound"}, "assignmentType": "Application"}, {"id": - "18332321226", "phoneNumber": "+18332321226", "countryCode": "US", "phoneNumberType": - "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, - "assignmentType": "Application"}, {"id": "18335260208", "phoneNumber": "+18335260208", - "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": - "inbound+outbound", "sms": "outbound"}, "assignmentType": "Application"}, - {"id": "18336369501", "phoneNumber": "+18336369501", "countryCode": "US", - "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound+outbound", - "sms": "none"}, "assignmentType": "Application"}]}' + string: '{"phoneNumbers": [{"id": "16194895581", "phoneNumber": "+16194895581", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "Person", "purchaseDate": "2021-01-13T20:01:52.0795301+00:00", + "cost": {"amount": 1.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "16194895593", "phoneNumber": "+16194895593", "countryCode": "US", + "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", "sms": + "none"}, "assignmentType": "Person", "purchaseDate": "2021-01-13T20:57:24.5482566+00:00", + "cost": {"amount": 1.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18332143261", "phoneNumber": "+18332143261", "countryCode": "US", + "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": + "inbound+outbound"}, "assignmentType": "Application", "purchaseDate": "2020-11-30T17:51:21.2991518+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18443281555", "phoneNumber": "+18443281555", "countryCode": "US", + "phoneNumberType": "TollFree", "capabilities": {"calling": "none", "sms": + "inbound+outbound"}, "assignmentType": "Application", "purchaseDate": "2020-11-12T21:53:12.2088187+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18445492606", "phoneNumber": "+18445492606", "countryCode": "US", + "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": + "inbound+outbound"}, "assignmentType": "Application", "purchaseDate": "2021-03-04T19:24:10.3004481+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}]}' headers: content-type: application/json; charset=utf-8 - date: Mon, 22 Feb 2021 19:49:29 GMT - ms-cv: gR+k7FVMNkWEuGWjsZ5mUg.0 + date: Thu, 04 Mar 2021 20:10:51 GMT + ms-cv: XvhXXgKui0CweHemAySMfw.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 930ms + x-processing-time: 3574ms status: code: 200 message: OK - url: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 + url: https://live-testing.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers_from_managed_identity.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers_from_managed_identity.yaml new file mode 100644 index 000000000000..23a9450384fa --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers_from_managed_identity.yaml @@ -0,0 +1,25 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 + response: + body: + string: '{"error": {"code": "Denied", "message": "Denied by the resource provider."}}' + headers: + content-type: application/json + date: Thu, 04 Mar 2021 18:16:08 GMT + ms-cv: SyFWaYd1okyG+rITVB0DKQ.0 + request-context: appId= + transfer-encoding: chunked + x-processing-time: 177ms + status: + code: 401 + message: Unauthorized + url: https://live-testing.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml new file mode 100644 index 000000000000..367ebfae0896 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml @@ -0,0 +1,185 @@ +interactions: +- request: + body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": + {"calling": "inbound", "sms": "inbound+outbound"}}' + headers: + Accept: + - application/json + Content-Length: + - '131' + Content-Type: + - application/json + Date: + - Thu, 04 Mar 2021 18:17:42 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 + response: + body: + string: '' + headers: + access-control-expose-headers: Location,Operation-Location,operation-id,search-id + content-length: '0' + date: Thu, 04 Mar 2021 18:17:45 GMT + ms-cv: /9Dp1W9J10W5ZzyvLykP6g.0 + operation-id: search_a061a85c-c652-44d8-b051-014b8d892a07 + operation-location: /phoneNumbers/operations/search_a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 + request-context: appId= + search-id: a061a85c-c652-44d8-b051-014b8d892a07 + x-processing-time: 3200ms + status: + code: 202 + message: Accepted + url: https://live-testing.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 +- request: + body: '' + headers: + Date: + - Thu, 04 Mar 2021 18:18:15 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 + response: + body: + string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07", + "createdDateTime": "2021-03-04T18:17:45.1869951+00:00", "id": "sanitized", + "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' + headers: + access-control-expose-headers: Location + content-type: application/json; charset=utf-8 + date: Thu, 04 Mar 2021 18:18:15 GMT + ms-cv: An9SG0xNA02+nCEJ2iyPGg.0 + request-context: appId= + transfer-encoding: chunked + x-processing-time: 559ms + status: + code: 200 + message: OK + url: https://live-testing.communication.azure.com/phoneNumbers/operations/search_a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 +- request: + body: '' + headers: + Date: + - Thu, 04 Mar 2021 18:18:16 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 + response: + body: + string: '{"searchId": "a061a85c-c652-44d8-b051-014b8d892a07", "phoneNumbers": + ["+18445496587"], "phoneNumberType": "TollFree", "assignmentType": "Application", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": + {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}, "searchExpiresBy": + "2021-03-04T18:33:53.9609193+00:00"}' + headers: + content-type: application/json; charset=utf-8 + date: Thu, 04 Mar 2021 18:18:17 GMT + ms-cv: tajtINiuYU6xpPdp0AwTzA.0 + request-context: appId= + transfer-encoding: chunked + x-processing-time: 1571ms + status: + code: 200 + message: OK + url: https://live-testing.communication.azure.com/availablePhoneNumbers/searchResults/a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 +- request: + body: '{"searchId": "a061a85c-c652-44d8-b051-014b8d892a07"}' + headers: + Accept: + - application/json + Content-Length: + - '52' + Content-Type: + - application/json + Date: + - Thu, 04 Mar 2021 18:18:18 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/:purchase?api-version=2021-03-07 + response: + body: + string: '' + headers: + access-control-expose-headers: Operation-Location,operation-id,purchase-id + content-length: '0' + date: Thu, 04 Mar 2021 18:18:20 GMT + ms-cv: cfO6OqU0F0SdpnnF3G0Qxg.0 + operation-id: purchase_a061a85c-c652-44d8-b051-014b8d892a07 + operation-location: /phoneNumbers/operations/purchase_a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 + purchase-id: a061a85c-c652-44d8-b051-014b8d892a07 + request-context: appId= + x-processing-time: 2228ms + status: + code: 202 + message: Accepted + url: https://live-testing.communication.azure.com/availablePhoneNumbers/:purchase?api-version=2021-03-07 +- request: + body: '' + headers: + Date: + - Thu, 04 Mar 2021 18:18:50 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 + response: + body: + string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": + "2021-03-04T18:17:45.1869951+00:00", "id": "sanitized", "operationType": "Purchase", + "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' + headers: + content-type: application/json; charset=utf-8 + date: Thu, 04 Mar 2021 18:18:50 GMT + ms-cv: 2BX6oEo9cEOkNVEY8GJghg.0 + request-context: appId= + transfer-encoding: chunked + x-processing-time: 530ms + status: + code: 200 + message: OK + url: https://live-testing.communication.azure.com/phoneNumbers/operations/purchase_a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 +- request: + body: '' + headers: + Accept: + - application/json + Date: + - Thu, 04 Mar 2021 18:18:51 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: DELETE + uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18445496587?api-version=2021-03-07 + response: + body: + string: '' + headers: + access-control-expose-headers: Operation-Location,operation-id,release-id + content-length: '0' + date: Thu, 04 Mar 2021 18:18:51 GMT + ms-cv: nPiFBK6ha02zRzkcjIkNwA.0 + operation-id: release_4427e952-844b-4d4a-9830-774e2b588066 + operation-location: /phoneNumbers/operations/release_4427e952-844b-4d4a-9830-774e2b588066?api-version=2021-03-07 + release-id: 4427e952-844b-4d4a-9830-774e2b588066 + request-context: appId= + x-processing-time: 872ms + status: + code: 202 + message: Accepted + url: https://live-testing.communication.azure.com/phoneNumbers/%2B18445496587?api-version=2021-03-07 +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml new file mode 100644 index 000000000000..dc596a27a626 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml @@ -0,0 +1,37 @@ +interactions: +- request: + body: '{"phoneNumberType": "tollFree", "assignmentType": "application", "capabilities": + {"calling": "inbound", "sms": "inbound+outbound"}}' + headers: + Accept: + - application/json + Content-Length: + - '131' + Content-Type: + - application/json + Date: + - Thu, 04 Mar 2021 20:10:52 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: POST + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 + response: + body: + string: '' + headers: + access-control-expose-headers: Location,Operation-Location,operation-id,search-id + content-length: '0' + date: Thu, 04 Mar 2021 20:10:54 GMT + ms-cv: 8WLGSUfKPU6zyEk9ShCZmw.0 + operation-id: search_d2b92f7d-1c61-481c-ac7d-044754b422bb + operation-location: /phoneNumbers/operations/search_d2b92f7d-1c61-481c-ac7d-044754b422bb?api-version=2021-03-07 + request-context: appId= + search-id: d2b92f7d-1c61-481c-ac7d-044754b422bb + x-processing-time: 2876ms + status: + code: 202 + message: Accepted + url: https://live-testing.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml new file mode 100644 index 000000000000..46e9b930efed --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml @@ -0,0 +1,37 @@ +interactions: +- request: + body: '{"calling": "inbound", "sms": "inbound+outbound"}' + headers: + Accept: + - application/json + Content-Length: + - '49' + Content-Type: + - application/merge-patch+json + Date: + - Thu, 04 Mar 2021 20:10:55 GMT + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + x-ms-return-client-request-id: + - 'true' + method: PATCH + uri: https://sanitized.communication.azure.com/phoneNumbers/sanitized/capabilities?api-version=2021-03-07 + response: + body: + string: '{"capabilitiesUpdateId": "a51ebf71-91f5-4410-917a-1d3993e8d7ae"}' + headers: + access-control-expose-headers: Operation-Location,Location,operation-id,capabilities-id + capabilities-id: a51ebf71-91f5-4410-917a-1d3993e8d7ae + content-type: application/json; charset=utf-8 + date: Thu, 04 Mar 2021 20:10:56 GMT + ms-cv: nQRrDvDF9kSmUHvSW2nJNw.0 + operation-id: capabilities_a51ebf71-91f5-4410-917a-1d3993e8d7ae + operation-location: /phoneNumbers/operations/capabilities_a51ebf71-91f5-4410-917a-1d3993e8d7ae?api-version=2021-03-07 + request-context: appId= + transfer-encoding: chunked + x-processing-time: 1183ms + status: + code: 202 + message: Accepted + url: https://live-testing.communication.azure.com/phoneNumbers/%2B18332143261/capabilities?api-version=2021-03-07 +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index b117dd1e886c..67f4d51a526c 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -5,13 +5,16 @@ from _shared.utils import create_token_credential from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType from azure.communication.phonenumbers._shared.utils import parse_connection_str +from phone_number_helper import PhoneNumberUriReplacer + +SKIP_PURCHASE_PHONE_NUMBER_TESTS = True +PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON = "Phone numbers shouldn't be purchased in live tests" class NewTests(CommunicationTestCase): def setUp(self): super(NewTests, self).setUp() if self.is_playback(): - self.phone_number = "+18000005555" - self.phone_number_to_release = "+18000005556" + self.phone_number = "sanitized" self.country_code = "US" self.area_code = "833" else: @@ -22,11 +25,11 @@ def setUp(self): self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ BodyReplacerProcessor( - keys=["id", "token", "phoneNumber", "phonenumbers", "phoneNumbers"] + keys=["id", "token", "phoneNumber"] ), - ResponseReplacerProcessor(keys=[self._resource_name])]) + PhoneNumberUriReplacer()]) - @pytest.mark.live_test_only + @pytest.mark.skipif(SKIP_PURCHASE_PHONE_NUMBER_TESTS, reason=PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON) def test_list_all_phone_numbers_from_managed_identity(self): endpoint, access_key = parse_connection_str(self.connection_str) credential = create_token_credential() @@ -34,22 +37,14 @@ def test_list_all_phone_numbers_from_managed_identity(self): phone_numbers = phone_number_client.list_all_phone_numbers() assert phone_numbers.next() - @pytest.mark.live_test_only def test_list_acquired_phone_numbers(self): phone_numbers = self.phone_number_client.list_acquired_phone_numbers() assert phone_numbers.next() - @pytest.mark.live_test_only def test_get_phone_number(self): phone_number = self.phone_number_client.get_phone_number(self.phone_number) assert phone_number.phone_number == self.phone_number - - @pytest.mark.live_test_only - def test_release_phone_number(self): - poller = self.phone_number_client.begin_release_phone_number(self.phone_number_to_release) - assert poller.status() == 'succeeded' - @pytest.mark.live_test_only def test_search_available_phone_numbers(self): capabilities = PhoneNumberCapabilities( calling = PhoneNumberCapabilityValue.INBOUND, @@ -65,17 +60,16 @@ def test_search_available_phone_numbers(self): ) assert poller.result() - @pytest.mark.live_test_only def test_update_phone_number_capabilities(self): poller = self.phone_number_client.begin_update_phone_number_capabilities( - self.phone_number, - PhoneNumberCapabilityValue.OUTBOUND, - PhoneNumberCapabilityValue.INBOUND_OUTBOUND, - polling = True + self.phone_number, + PhoneNumberCapabilityValue.INBOUND_OUTBOUND, + PhoneNumberCapabilityValue.INBOUND, + polling = True ) assert poller.result() - - @pytest.mark.live_test_only + + @pytest.mark.skipif(SKIP_PURCHASE_PHONE_NUMBER_TESTS, reason=PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON) def test_purchase_phone_numbers(self): capabilities = PhoneNumberCapabilities( calling = PhoneNumberCapabilityValue.INBOUND, @@ -86,12 +80,11 @@ def test_purchase_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - self.area_code, - 1, + area_code=self.area_code, polling = True ) phone_number_to_buy = search_poller.result() purchase_poller = self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) assert purchase_poller.result() - release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) + release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_numbers[0]) assert release_poller.status() == 'succeeded' diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index 7dc30f0ee7b5..a2f049c6e1e6 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -4,8 +4,12 @@ from _shared.asynctestcase import AsyncCommunicationTestCase from _shared.testcase import ResponseReplacerProcessor, BodyReplacerProcessor from _shared.utils import create_token_credential -from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityType, PhoneNumberType +from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType from azure.communication.phonenumbers._shared.utils import parse_connection_str +from phone_number_helper import PhoneNumberUriReplacer + +SKIP_PURCHASE_PHONE_NUMBER_TESTS = True +PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON = "Phone numbers shouldn't be purchased in live tests" class NewTests(AsyncCommunicationTestCase): def setUp(self): @@ -26,10 +30,10 @@ def setUp(self): BodyReplacerProcessor( keys=["id", "token", "phoneNumber", "phonenumbers"] ), - ResponseReplacerProcessor(keys=[self._resource_name])]) - + PhoneNumberUriReplacer()]) + + @pytest.mark.skipif(SKIP_PURCHASE_PHONE_NUMBER_TESTS, reason=PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON) @AsyncCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only async def test_list_all_phone_numbers_from_managed_identity(self): endpoint, access_key = parse_connection_str(self.connection_str) credential = create_token_credential() @@ -42,7 +46,6 @@ async def test_list_all_phone_numbers_from_managed_identity(self): assert len(items) > 0 @AsyncCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only async def test_list_acquired_phone_numbers(self): async with self.phone_number_client: phone_numbers = self.phone_number_client.list_acquired_phone_numbers() @@ -52,27 +55,16 @@ async def test_list_acquired_phone_numbers(self): assert len(items) > 0 @AsyncCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only async def test_get_phone_number(self): async with self.phone_number_client: phone_number = await self.phone_number_client.get_phone_number(self.phone_number) assert phone_number.phone_number == self.phone_number - - - @AsyncCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only - async def test_release_phone_number(self): - async with self.phone_number_client: - poller = await self.phone_number_client.begin_release_phone_number(self.phone_number_to_release) - result = await poller.result() - assert result @AsyncCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only async def test_search_available_phone_numbers(self): capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityType.INBOUND, - sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND + calling = PhoneNumberCapabilityValue.INBOUND, + sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND ) async with self.phone_number_client: poller = await self.phone_number_client.begin_search_available_phone_numbers( @@ -86,23 +78,22 @@ async def test_search_available_phone_numbers(self): assert poller.result() @AsyncCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only async def test_update_phone_number_capabilities(self): async with self.phone_number_client: - poller = self.phone_number_client.begin_update_phone_number_capabilities( + poller = await self.phone_number_client.begin_update_phone_number_capabilities( self.phone_number, - PhoneNumberCapabilityType.OUTBOUND, - PhoneNumberCapabilityType.OUTBOUND, + PhoneNumberCapabilityValue.INBOUND_OUTBOUND, + PhoneNumberCapabilityValue.INBOUND, polling = True ) assert poller.result() + @pytest.mark.skipif(SKIP_PURCHASE_PHONE_NUMBER_TESTS, reason=PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON) @AsyncCommunicationTestCase.await_prepared_test - @pytest.mark.live_test_only async def test_purchase_phone_numbers(self): capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityType.INBOUND, - sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND + calling = PhoneNumberCapabilityValue.INBOUND, + sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND ) async with self.phone_number_client: search_poller = await self.phone_number_client.begin_search_available_phone_numbers( @@ -110,12 +101,11 @@ async def test_purchase_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - self.area_code, - 1, + area_code=self.area_code, polling = True ) - phone_number_to_buy = search_poller.result() + phone_number_to_buy = await search_poller.result() purchase_poller = await self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) - assert purchase_poller.result() - release_poller = await self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_number) + assert await purchase_poller.result() + release_poller = await self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_numbers[0]) assert release_poller.status() == 'succeeded' From a7d0a0cbe8e3935189692ddc5dbff20aba513a6d Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Fri, 5 Mar 2021 11:18:40 -0700 Subject: [PATCH 29/32] Fixed EVERYTHING --- .../phonenumbers/_phone_numbers_client.py | 2 - .../aio/_phone_numbers_client_async.py | 11 +-- .../test/_shared/testcase.py | 20 +++- ...stration_client.test_get_phone_number.yaml | 9 +- ...ient.test_list_acquired_phone_numbers.yaml | 30 +++++- ...d_phone_numbers_from_managed_identity.yaml | 67 +++++++++++++ ...on_client.test_purchase_phone_numbers.yaml | 91 +++++++++--------- ...tion_client.test_release_phone_number.yaml | 46 --------- ...t.test_search_available_phone_numbers.yaml | 44 +++++---- ...test_update_phone_number_capabilities.yaml | 39 ++++---- ...on_client_async.test_get_phone_number.yaml | 10 +- ...sync.test_list_acquired_phone_numbers.yaml | 40 ++++---- ...d_phone_numbers_from_managed_identity.yaml | 57 +++++++++++ ...l_phone_numbers_from_managed_identity.yaml | 25 ----- ...ent_async.test_purchase_phone_numbers.yaml | 96 +++++++++---------- ...c.test_search_available_phone_numbers.yaml | 14 +-- ...test_update_phone_number_capabilities.yaml | 18 ++-- ...test_phone_number_administration_client.py | 19 ++-- ...hone_number_administration_client_async.py | 23 ++--- 19 files changed, 370 insertions(+), 291 deletions(-) create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers_from_managed_identity.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_number.yaml create mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers_from_managed_identity.yaml delete mode 100644 sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers_from_managed_identity.yaml diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py index f392b4a00ae3..a3262d4012f7 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py @@ -166,7 +166,6 @@ def begin_update_phone_number_capabilities( :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType :param sms: Capability value for SMS. :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType - :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. @@ -194,7 +193,6 @@ def get_phone_number( :param phone_number: The acquired phone number whose details are to be fetched in E.164 format, e.g. +11234567890. :type phone_number: str - :keyword callable cls: A custom type or function that will be passed the direct response :rtype: ~azure.communication.phonenumbers.models.AcquiredPhoneNumber """ return self._phone_number_client.phone_numbers.get_by_number( diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py index 5a19b27c6513..994071dc72b9 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py @@ -60,7 +60,7 @@ async def begin_purchase_phone_numbers( search_id, # type: str **kwargs # type: Any ): - # type: (...) -> AsyncLROPoller[PhoneNumberSearchResult] + # type: (...) -> AsyncLROPoller[None] """Purchases phone numbers. :param search_id: The search id. @@ -89,7 +89,6 @@ async def begin_release_phone_number( :param phone_number: Phone number to be released, e.g. +11234567890. :type phone_number: str - :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. @@ -110,7 +109,6 @@ async def begin_search_available_phone_numbers( phone_number_type, # type: str assignment_type, # type: str capabilities, - quantity=None, # type: int **kwargs ): # type: (...) -> AsyncLROPoller[PhoneNumberSearchResult] @@ -128,10 +126,9 @@ async def begin_search_available_phone_numbers( ~azure.communication.phonenumbers.models.PhoneNumberAssignmentType :param capabilities: Required. Capabilities of a phone number. :type capabilities: ~azure.communication.phonenumbers.models.PhoneNumberCapabilities - :param quantity: The quantity of phone numbers in the search. Should be at least 1. - :type quantity: int :keyword str area_code: The area code of the desired phone number, e.g. 425. If not set, any area code could be used in the final search. + :keyword int quantity: The quantity of phone numbers in the search. Default is 1. :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. @@ -144,7 +141,7 @@ async def begin_search_available_phone_numbers( phone_number_type=phone_number_type, assignment_type=assignment_type, capabilities=capabilities, - quantity=quantity, + quantity=kwargs.pop('quantity', None), area_code=kwargs.pop('area_code', None) ) return await self._phone_number_client.phone_numbers.begin_search_available_phone_numbers( @@ -171,7 +168,6 @@ async def begin_update_phone_number_capabilities( :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType :param sms: Capability value for SMS. :type sms: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType - :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the LROBasePolling polling method, False for no polling, or your own initialized polling object for a personal polling strategy. @@ -199,7 +195,6 @@ async def get_phone_number( :param phone_number: The acquired phone number whose details are to be fetched in E.164 format, e.g. +11234567890. :type phone_number: str - :keyword callable cls: A custom type or function that will be passed the direct response :rtype: ~azure.communication.phonenumbers.models.AcquiredPhoneNumber """ return await self._phone_number_client.phone_numbers.get_by_number( diff --git a/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py b/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py index 97f79f4cfdf6..89d33f397a7a 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py +++ b/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py @@ -17,7 +17,23 @@ def __init__(self, keys=None, replacement="sanitized"): self._replacement = replacement def process_response(self, response): - def sanitize_dict(dictionary): + import json + try: + body = json.loads(response['body']['string']) + if 'phoneNumbers' in body: + for item in body["phoneNumbers"]: + if isinstance(item, str): + body["phoneNumbers"] = [self._replacement] + break + elif "phoneNumber" in item: + item['phoneNumber'] = self._replacement + response['body']['string'] = json.dumps(body) + response['url'] = self._replacement + return response + except (KeyError, ValueError): + return response + + '''def sanitize_dict(dictionary): for key in dictionary: value = dictionary[key] if isinstance(value, str): @@ -30,7 +46,7 @@ def sanitize_dict(dictionary): sanitize_dict(response) - return response + return response''' class BodyReplacerProcessor(RecordingProcessor): """Sanitize the sensitive info inside request or response bodies""" diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml index fc085da4f131..0501e2364ffb 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive Date: - - Thu, 04 Mar 2021 20:09:28 GMT + - Fri, 05 Mar 2021 17:31:53 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -26,16 +26,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 20:09:30 GMT + - Fri, 05 Mar 2021 17:31:55 GMT ms-cv: - - b1QfQvNXJUCmudxXTNXVYw.0 + - 0XgNRxFgsU+jtkYdzUXCig.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 1995ms + - 1782ms status: code: 200 message: OK + url: sanitized version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml index 2d767d98e340..04a6e3c516f1 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive Date: - - Thu, 04 Mar 2021 20:09:31 GMT + - Fri, 05 Mar 2021 17:31:55 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -18,21 +18,41 @@ interactions: uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 response: body: - string: '{"phoneNumbers": ["sanitized"]}' + string: '{"phoneNumbers": [{"id": "16194895581", "phoneNumber": "sanitized", + "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": + "outbound", "sms": "none"}, "assignmentType": "Person", "purchaseDate": "2021-01-13T20:01:52.0795301+00:00", + "cost": {"amount": 1.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "16194895593", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": + "Person", "purchaseDate": "2021-01-13T20:57:24.5482566+00:00", "cost": {"amount": + 1.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": "18332143261", + "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": + "Application", "purchaseDate": "2020-11-30T17:51:21.2991518+00:00", "cost": + {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": + "18443281555", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2020-11-12T21:53:12.2088187+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18445492606", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2021-03-04T19:24:10.3004481+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}]}' headers: content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 20:09:34 GMT + - Fri, 05 Mar 2021 17:32:00 GMT ms-cv: - - Aa07dXCJ1Eiv8sLy5yURtA.0 + - KdBSgkLB20KwA9de1Xr6AA.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 4239ms + - 4581ms status: code: 200 message: OK + url: sanitized version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers_from_managed_identity.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers_from_managed_identity.yaml new file mode 100644 index 000000000000..5c9216ec3237 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers_from_managed_identity.yaml @@ -0,0 +1,67 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 + response: + body: + string: '{"phoneNumbers": [{"id": "18332272412", "phoneNumber": "sanitized", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "purchaseDate": + "2021-02-09T23:00:10.4372681+00:00", "cost": {"amount": 2.0, "currencyCode": + "USD", "billingFrequency": "Monthly"}}, {"id": "18332272430", "phoneNumber": + "sanitized", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": + {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", + "purchaseDate": "2021-02-09T22:58:41.2504122+00:00", "cost": {"amount": 2.0, + "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": "18332272445", + "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": + "Application", "purchaseDate": "2021-02-09T23:03:57.6969271+00:00", "cost": + {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": + "18332321209", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2021-02-10T17:51:13.4876763+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18332321221", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2021-02-10T17:52:41.818335+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18332321226", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2021-02-10T18:01:46.4199999+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18335260208", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2000-01-01T00:00:00+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18336369501", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "inbound+outbound", "sms": "none"}, + "assignmentType": "Application", "purchaseDate": "2020-09-18T15:03:19.5370985+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}]}' + headers: + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Mar 2021 17:57:40 GMT + ms-cv: + - RfWp91uvd02ICqvPQgnxlA.0 + request-context: + - appId= + transfer-encoding: + - chunked + x-processing-time: + - 5011ms + status: + code: 200 + message: OK + url: sanitized +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml index 927be673d40e..7a1b07c196c2 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 04 Mar 2021 19:00:18 GMT + - Fri, 05 Mar 2021 17:32:00 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -30,19 +30,19 @@ interactions: content-length: - '0' date: - - Thu, 04 Mar 2021 19:00:21 GMT + - Fri, 05 Mar 2021 17:32:03 GMT ms-cv: - - cnDAlYZUaUq80DHCaL9HkQ.0 + - UiKRXu2IPkmNlhE+PAE0Pg.0 operation-id: - - search_bc5ccc45-c46e-4e35-a4cb-b8309e4ef211 + - search_15d9eb25-3c3e-453d-89c6-0402c6101659 operation-location: - - /phoneNumbers/operations/search_bc5ccc45-c46e-4e35-a4cb-b8309e4ef211?api-version=2021-03-07 + - /phoneNumbers/operations/search_15d9eb25-3c3e-453d-89c6-0402c6101659?api-version=2021-03-07 request-context: - appId= search-id: - - bc5ccc45-c46e-4e35-a4cb-b8309e4ef211 + - 15d9eb25-3c3e-453d-89c6-0402c6101659 x-processing-time: - - 3170ms + - 2572ms status: code: 202 message: Accepted @@ -56,17 +56,17 @@ interactions: Connection: - keep-alive Date: - - Thu, 04 Mar 2021 19:00:52 GMT + - Fri, 05 Mar 2021 17:32:33 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_bc5ccc45-c46e-4e35-a4cb-b8309e4ef211?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_15d9eb25-3c3e-453d-89c6-0402c6101659?api-version=2021-03-07 response: body: - string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/bc5ccc45-c46e-4e35-a4cb-b8309e4ef211?api-version=2021-03-07", - "createdDateTime": "2021-03-04T19:00:21.3580392+00:00", "id": "sanitized", + string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/15d9eb25-3c3e-453d-89c6-0402c6101659?api-version=2021-03-07", + "createdDateTime": "2021-03-05T17:32:03.428505+00:00", "id": "sanitized", "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: access-control-expose-headers: @@ -74,18 +74,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 19:00:52 GMT + - Fri, 05 Mar 2021 17:32:33 GMT ms-cv: - - OpIdW4weIEGYzCsOBN5sbA.0 + - yswyogbtVUK6ilnPI2ZPVQ.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 572ms + - 499ms status: code: 200 message: OK + url: sanitized - request: body: null headers: @@ -96,38 +97,39 @@ interactions: Connection: - keep-alive Date: - - Thu, 04 Mar 2021 19:00:52 GMT + - Fri, 05 Mar 2021 17:32:34 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/bc5ccc45-c46e-4e35-a4cb-b8309e4ef211?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/15d9eb25-3c3e-453d-89c6-0402c6101659?api-version=2021-03-07 response: body: - string: '{"searchId": "bc5ccc45-c46e-4e35-a4cb-b8309e4ef211", "phoneNumbers": - "sanitized", "phoneNumberType": "TollFree", "assignmentType": "Application", + string: '{"searchId": "15d9eb25-3c3e-453d-89c6-0402c6101659", "phoneNumbers": + ["sanitized"], "phoneNumberType": "TollFree", "assignmentType": "Application", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}, "searchExpiresBy": - "2021-03-04T19:16:27.0466380+00:00"}' + "2021-03-05T17:48:09.6152644+00:00"}' headers: content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 19:00:53 GMT + - Fri, 05 Mar 2021 17:32:34 GMT ms-cv: - - zyw0LCL7MkiWYMgLtDF7EQ.0 + - nBPsj2RK7UeRMXJw/YYAQA.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 957ms + - 959ms status: code: 200 message: OK + url: sanitized - request: - body: '{"searchId": "bc5ccc45-c46e-4e35-a4cb-b8309e4ef211"}' + body: '{"searchId": "15d9eb25-3c3e-453d-89c6-0402c6101659"}' headers: Accept: - application/json @@ -140,7 +142,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 04 Mar 2021 19:00:53 GMT + - Fri, 05 Mar 2021 17:32:35 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -156,19 +158,19 @@ interactions: content-length: - '0' date: - - Thu, 04 Mar 2021 19:00:55 GMT + - Fri, 05 Mar 2021 17:32:37 GMT ms-cv: - - vZooSJe6KkmD8SFNUMVGfg.0 + - HBenQJLrBUuUbCoTX6b96A.0 operation-id: - - purchase_bc5ccc45-c46e-4e35-a4cb-b8309e4ef211 + - purchase_15d9eb25-3c3e-453d-89c6-0402c6101659 operation-location: - - /phoneNumbers/operations/purchase_bc5ccc45-c46e-4e35-a4cb-b8309e4ef211?api-version=2021-03-07 + - /phoneNumbers/operations/purchase_15d9eb25-3c3e-453d-89c6-0402c6101659?api-version=2021-03-07 purchase-id: - - bc5ccc45-c46e-4e35-a4cb-b8309e4ef211 + - 15d9eb25-3c3e-453d-89c6-0402c6101659 request-context: - appId= x-processing-time: - - 2267ms + - 2322ms status: code: 202 message: Accepted @@ -182,34 +184,35 @@ interactions: Connection: - keep-alive Date: - - Thu, 04 Mar 2021 19:01:26 GMT + - Fri, 05 Mar 2021 17:33:07 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_bc5ccc45-c46e-4e35-a4cb-b8309e4ef211?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_15d9eb25-3c3e-453d-89c6-0402c6101659?api-version=2021-03-07 response: body: string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": - "2021-03-04T19:00:21.3580392+00:00", "id": "sanitized", "operationType": "Purchase", + "2021-03-05T17:32:03.428505+00:00", "id": "sanitized", "operationType": "Purchase", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 19:01:26 GMT + - Fri, 05 Mar 2021 17:33:07 GMT ms-cv: - - jW8zvj4iqkWUwa/mnePf3w.0 + - 2nzsapS2kkSU1CqHHZ4D+Q.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 450ms + - 558ms status: code: 200 message: OK + url: sanitized - request: body: null headers: @@ -222,13 +225,13 @@ interactions: Content-Length: - '0' Date: - - Thu, 04 Mar 2021 19:01:26 GMT + - Fri, 05 Mar 2021 17:33:08 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18445499820?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/sanitized?api-version=2021-03-07 response: body: string: '' @@ -238,19 +241,19 @@ interactions: content-length: - '0' date: - - Thu, 04 Mar 2021 19:01:27 GMT + - Fri, 05 Mar 2021 17:33:09 GMT ms-cv: - - 3Rh4W/qNvkGW649JaIS4yw.0 + - 8CVr0+mmo06VtKlKCc8pwg.0 operation-id: - - release_eadbe0e5-0ebd-4018-a05f-f4b708480a7d + - release_9f9a864e-f7bb-4b05-b26b-74c1076051f1 operation-location: - - /phoneNumbers/operations/release_eadbe0e5-0ebd-4018-a05f-f4b708480a7d?api-version=2021-03-07 + - /phoneNumbers/operations/release_9f9a864e-f7bb-4b05-b26b-74c1076051f1?api-version=2021-03-07 release-id: - - eadbe0e5-0ebd-4018-a05f-f4b708480a7d + - 9f9a864e-f7bb-4b05-b26b-74c1076051f1 request-context: - appId= x-processing-time: - - 1436ms + - 1449ms status: code: 202 message: Accepted diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_number.yaml deleted file mode 100644 index aab21e2f175a..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_release_phone_number.yaml +++ /dev/null @@ -1,46 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Date: - - Thu, 04 Mar 2021 17:04:48 GMT - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - x-ms-return-client-request-id: - - 'true' - method: DELETE - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18445495681?api-version=2021-03-07 - response: - body: - string: '' - headers: - access-control-expose-headers: - - Operation-Location,operation-id,release-id - content-length: - - '0' - date: - - Thu, 04 Mar 2021 17:04:50 GMT - ms-cv: - - 4M4iMTTkAU2EYlx+U1W1vA.0 - operation-id: - - release_66dd2b9f-0b4d-454f-81b2-4bea870c8740 - operation-location: - - /phoneNumbers/operations/release_66dd2b9f-0b4d-454f-81b2-4bea870c8740?api-version=2021-03-07 - release-id: - - 66dd2b9f-0b4d-454f-81b2-4bea870c8740 - request-context: - - appId= - x-processing-time: - - 1496ms - status: - code: 202 - message: Accepted -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml index bbdc9f05b8b8..5fca591c796b 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 04 Mar 2021 20:09:35 GMT + - Fri, 05 Mar 2021 17:33:09 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -30,19 +30,19 @@ interactions: content-length: - '0' date: - - Thu, 04 Mar 2021 20:09:38 GMT + - Fri, 05 Mar 2021 17:33:13 GMT ms-cv: - - xp+gSiPZFEi9TrSBlc6j9w.0 + - xUw7Lzf1zEqW60yFP7jeCw.0 operation-id: - - search_c0763b8c-895d-4bba-b312-bcf615a90b2d + - search_324670a6-ab6b-4379-ac4e-8a0af6f374af operation-location: - - /phoneNumbers/operations/search_c0763b8c-895d-4bba-b312-bcf615a90b2d?api-version=2021-03-07 + - /phoneNumbers/operations/search_324670a6-ab6b-4379-ac4e-8a0af6f374af?api-version=2021-03-07 request-context: - appId= search-id: - - c0763b8c-895d-4bba-b312-bcf615a90b2d + - 324670a6-ab6b-4379-ac4e-8a0af6f374af x-processing-time: - - 3391ms + - 2515ms status: code: 202 message: Accepted @@ -56,17 +56,17 @@ interactions: Connection: - keep-alive Date: - - Thu, 04 Mar 2021 20:10:09 GMT + - Fri, 05 Mar 2021 17:33:42 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_c0763b8c-895d-4bba-b312-bcf615a90b2d?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_324670a6-ab6b-4379-ac4e-8a0af6f374af?api-version=2021-03-07 response: body: - string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/c0763b8c-895d-4bba-b312-bcf615a90b2d?api-version=2021-03-07", - "createdDateTime": "2021-03-04T20:09:38.6605579+00:00", "id": "sanitized", + string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/324670a6-ab6b-4379-ac4e-8a0af6f374af?api-version=2021-03-07", + "createdDateTime": "2021-03-05T17:33:12.6372497+00:00", "id": "sanitized", "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: access-control-expose-headers: @@ -74,18 +74,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 20:10:09 GMT + - Fri, 05 Mar 2021 17:33:43 GMT ms-cv: - - WJ4OvgfDfE22EY3w9XwIlA.0 + - pT0wbkG2tk6KY3RAbY7ddA.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 483ms + - 294ms status: code: 200 message: OK + url: sanitized - request: body: null headers: @@ -96,34 +97,35 @@ interactions: Connection: - keep-alive Date: - - Thu, 04 Mar 2021 20:10:09 GMT + - Fri, 05 Mar 2021 17:33:43 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/c0763b8c-895d-4bba-b312-bcf615a90b2d?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/324670a6-ab6b-4379-ac4e-8a0af6f374af?api-version=2021-03-07 response: body: - string: '{"searchId": "c0763b8c-895d-4bba-b312-bcf615a90b2d", "phoneNumbers": + string: '{"searchId": "324670a6-ab6b-4379-ac4e-8a0af6f374af", "phoneNumbers": ["sanitized"], "phoneNumberType": "TollFree", "assignmentType": "Application", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}, "searchExpiresBy": - "2021-03-04T20:25:44.8545724+00:00"}' + "2021-03-05T17:49:18.9992018+00:00"}' headers: content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 20:10:10 GMT + - Fri, 05 Mar 2021 17:33:44 GMT ms-cv: - - yGgJPefdTUCTFErjWAngFA.0 + - zFJciOzbiESSdFWHimD7fw.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 968ms + - 691ms status: code: 200 message: OK + url: sanitized version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml index 45ebf79305c6..eeaa0ef70f11 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml @@ -13,7 +13,7 @@ interactions: Content-Type: - application/merge-patch+json Date: - - Thu, 04 Mar 2021 20:10:10 GMT + - Fri, 05 Mar 2021 17:33:44 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -22,31 +22,32 @@ interactions: uri: https://sanitized.communication.azure.com/phoneNumbers/sanitized/capabilities?api-version=2021-03-07 response: body: - string: '{"capabilitiesUpdateId": "c753b8c0-bf2e-4f28-ad44-487b3e55c126"}' + string: '{"capabilitiesUpdateId": "ae9c880c-b537-4538-b260-0f818b21481e"}' headers: access-control-expose-headers: - Operation-Location,Location,operation-id,capabilities-id capabilities-id: - - c753b8c0-bf2e-4f28-ad44-487b3e55c126 + - ae9c880c-b537-4538-b260-0f818b21481e content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 20:10:11 GMT + - Fri, 05 Mar 2021 17:33:45 GMT ms-cv: - - nJy2pwvO2kOqoLVJr05Tlg.0 + - GVS3fDhlAkimsjGVwfBIvg.0 operation-id: - - capabilities_c753b8c0-bf2e-4f28-ad44-487b3e55c126 + - capabilities_ae9c880c-b537-4538-b260-0f818b21481e operation-location: - - /phoneNumbers/operations/capabilities_c753b8c0-bf2e-4f28-ad44-487b3e55c126?api-version=2021-03-07 + - /phoneNumbers/operations/capabilities_ae9c880c-b537-4538-b260-0f818b21481e?api-version=2021-03-07 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 1111ms + - 1149ms status: code: 202 message: Accepted + url: sanitized - request: body: null headers: @@ -57,17 +58,17 @@ interactions: Connection: - keep-alive Date: - - Thu, 04 Mar 2021 20:10:42 GMT + - Fri, 05 Mar 2021 17:34:15 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/capabilities_c753b8c0-bf2e-4f28-ad44-487b3e55c126?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/capabilities_ae9c880c-b537-4538-b260-0f818b21481e?api-version=2021-03-07 response: body: string: '{"status": "Succeeded", "resourceLocation": "/phoneNumbers/+18332143261?api-version=2021-03-07", - "createdDateTime": "2021-03-04T20:10:11.7620886+00:00", "id": "sanitized", + "createdDateTime": "2021-03-05T17:33:45.8891088+00:00", "id": "sanitized", "operationType": "UpdatePhoneNumberCapabilities", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: access-control-expose-headers: @@ -75,18 +76,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 20:10:43 GMT + - Fri, 05 Mar 2021 17:34:16 GMT ms-cv: - - bhOOUelnIEioRhByfOIYkQ.0 + - n/+asM0FEUeGb/LSEzp4pQ.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 2355ms + - 306ms status: code: 200 message: OK + url: sanitized - request: body: null headers: @@ -97,7 +99,7 @@ interactions: Connection: - keep-alive Date: - - Thu, 04 Mar 2021 20:10:44 GMT + - Fri, 05 Mar 2021 17:34:16 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -114,16 +116,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 04 Mar 2021 20:10:46 GMT + - Fri, 05 Mar 2021 17:34:18 GMT ms-cv: - - UmM4C4ozVkijkaibJMfTjQ.0 + - uRSIpbt/jUKbaCw7kHXPlg.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 2097ms + - 2022ms status: code: 200 message: OK + url: sanitized version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml index 4ebae7f27df7..14a00558facd 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml @@ -5,7 +5,7 @@ interactions: Accept: - application/json Date: - - Thu, 04 Mar 2021 20:10:46 GMT + - Fri, 05 Mar 2021 17:34:18 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -20,13 +20,13 @@ interactions: "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}' headers: content-type: application/json; charset=utf-8 - date: Thu, 04 Mar 2021 20:10:47 GMT - ms-cv: g+yRryu4o02OCKglJx1kXg.0 + date: Fri, 05 Mar 2021 17:34:21 GMT + ms-cv: U5bV9Vsk/UOitUB2oyKQCA.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 1282ms + x-processing-time: 2642ms status: code: 200 message: OK - url: https://live-testing.communication.azure.com/phoneNumbers/%2B18332143261?api-version=2021-03-07 + url: sanitized version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml index 952d2ff9dc0f..322eddc215fe 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml @@ -5,7 +5,7 @@ interactions: Accept: - application/json Date: - - Thu, 04 Mar 2021 20:10:48 GMT + - Fri, 05 Mar 2021 17:34:21 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -14,35 +14,35 @@ interactions: uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 response: body: - string: '{"phoneNumbers": [{"id": "16194895581", "phoneNumber": "+16194895581", + string: '{"phoneNumbers": [{"id": "16194895581", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": "Person", "purchaseDate": "2021-01-13T20:01:52.0795301+00:00", "cost": {"amount": 1.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, - {"id": "16194895593", "phoneNumber": "+16194895593", "countryCode": "US", - "phoneNumberType": "Geographic", "capabilities": {"calling": "outbound", "sms": - "none"}, "assignmentType": "Person", "purchaseDate": "2021-01-13T20:57:24.5482566+00:00", - "cost": {"amount": 1.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, - {"id": "18332143261", "phoneNumber": "+18332143261", "countryCode": "US", - "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": - "inbound+outbound"}, "assignmentType": "Application", "purchaseDate": "2020-11-30T17:51:21.2991518+00:00", - "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, - {"id": "18443281555", "phoneNumber": "+18443281555", "countryCode": "US", - "phoneNumberType": "TollFree", "capabilities": {"calling": "none", "sms": - "inbound+outbound"}, "assignmentType": "Application", "purchaseDate": "2020-11-12T21:53:12.2088187+00:00", + {"id": "16194895593", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "Geographic", "capabilities": {"calling": "outbound", "sms": "none"}, "assignmentType": + "Person", "purchaseDate": "2021-01-13T20:57:24.5482566+00:00", "cost": {"amount": + 1.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": "18332143261", + "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": + "Application", "purchaseDate": "2020-11-30T17:51:21.2991518+00:00", "cost": + {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": + "18443281555", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2020-11-12T21:53:12.2088187+00:00", "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, - {"id": "18445492606", "phoneNumber": "+18445492606", "countryCode": "US", - "phoneNumberType": "TollFree", "capabilities": {"calling": "inbound", "sms": - "inbound+outbound"}, "assignmentType": "Application", "purchaseDate": "2021-03-04T19:24:10.3004481+00:00", + {"id": "18445492606", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2021-03-04T19:24:10.3004481+00:00", "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}]}' headers: content-type: application/json; charset=utf-8 - date: Thu, 04 Mar 2021 20:10:51 GMT - ms-cv: XvhXXgKui0CweHemAySMfw.0 + date: Fri, 05 Mar 2021 17:34:25 GMT + ms-cv: z+IYJRktqUqBrFrJry0c/w.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 3574ms + x-processing-time: 4036ms status: code: 200 message: OK - url: https://live-testing.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 + url: sanitized version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers_from_managed_identity.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers_from_managed_identity.yaml new file mode 100644 index 000000000000..82ff61a3b603 --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers_from_managed_identity.yaml @@ -0,0 +1,57 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + User-Agent: + - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 + response: + body: + string: '{"phoneNumbers": [{"id": "18332272412", "phoneNumber": "sanitized", + "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": {"calling": + "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "purchaseDate": + "2021-02-09T23:00:10.4372681+00:00", "cost": {"amount": 2.0, "currencyCode": + "USD", "billingFrequency": "Monthly"}}, {"id": "18332272430", "phoneNumber": + "sanitized", "countryCode": "US", "phoneNumberType": "TollFree", "capabilities": + {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", + "purchaseDate": "2021-02-09T22:58:41.2504122+00:00", "cost": {"amount": 2.0, + "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": "18332272445", + "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": "TollFree", + "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": + "Application", "purchaseDate": "2021-02-09T23:03:57.6969271+00:00", "cost": + {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": + "18332321209", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2021-02-10T17:51:13.4876763+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18332321221", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2021-02-10T17:52:41.818335+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18332321226", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2021-02-10T18:01:46.4199999+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18335260208", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, + "assignmentType": "Application", "purchaseDate": "2000-01-01T00:00:00+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, + {"id": "18336369501", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": + "TollFree", "capabilities": {"calling": "inbound+outbound", "sms": "none"}, + "assignmentType": "Application", "purchaseDate": "2020-09-18T15:03:19.5370985+00:00", + "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}]}' + headers: + content-type: application/json; charset=utf-8 + date: Fri, 05 Mar 2021 17:58:17 GMT + ms-cv: xYZEMY9Gj0y/qud0smN4KA.0 + request-context: appId= + transfer-encoding: chunked + x-processing-time: 6189ms + status: + code: 200 + message: OK + url: sanitized +version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers_from_managed_identity.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers_from_managed_identity.yaml deleted file mode 100644 index 23a9450384fa..000000000000 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_all_phone_numbers_from_managed_identity.yaml +++ /dev/null @@ -1,25 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - User-Agent: - - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 - response: - body: - string: '{"error": {"code": "Denied", "message": "Denied by the resource provider."}}' - headers: - content-type: application/json - date: Thu, 04 Mar 2021 18:16:08 GMT - ms-cv: SyFWaYd1okyG+rITVB0DKQ.0 - request-context: appId= - transfer-encoding: chunked - x-processing-time: 177ms - status: - code: 401 - message: Unauthorized - url: https://live-testing.communication.azure.com/phoneNumbers?skip=0&top=100&api-version=2021-03-07 -version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml index 367ebfae0896..45564a427e4a 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml @@ -10,7 +10,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 04 Mar 2021 18:17:42 GMT + - Fri, 05 Mar 2021 17:34:25 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -23,13 +23,13 @@ interactions: headers: access-control-expose-headers: Location,Operation-Location,operation-id,search-id content-length: '0' - date: Thu, 04 Mar 2021 18:17:45 GMT - ms-cv: /9Dp1W9J10W5ZzyvLykP6g.0 - operation-id: search_a061a85c-c652-44d8-b051-014b8d892a07 - operation-location: /phoneNumbers/operations/search_a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 + date: Fri, 05 Mar 2021 17:34:28 GMT + ms-cv: Bi0spXFiXE+wBTBjBbNF2Q.0 + operation-id: search_21a51537-3995-4974-a2d7-e6b87dadce2a + operation-location: /phoneNumbers/operations/search_21a51537-3995-4974-a2d7-e6b87dadce2a?api-version=2021-03-07 request-context: appId= - search-id: a061a85c-c652-44d8-b051-014b8d892a07 - x-processing-time: 3200ms + search-id: 21a51537-3995-4974-a2d7-e6b87dadce2a + x-processing-time: 2724ms status: code: 202 message: Accepted @@ -38,61 +38,61 @@ interactions: body: '' headers: Date: - - Thu, 04 Mar 2021 18:18:15 GMT + - Fri, 05 Mar 2021 17:34:58 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_21a51537-3995-4974-a2d7-e6b87dadce2a?api-version=2021-03-07 response: body: - string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07", - "createdDateTime": "2021-03-04T18:17:45.1869951+00:00", "id": "sanitized", + string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/21a51537-3995-4974-a2d7-e6b87dadce2a?api-version=2021-03-07", + "createdDateTime": "2021-03-05T17:34:28.9687105+00:00", "id": "sanitized", "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: access-control-expose-headers: Location content-type: application/json; charset=utf-8 - date: Thu, 04 Mar 2021 18:18:15 GMT - ms-cv: An9SG0xNA02+nCEJ2iyPGg.0 + date: Fri, 05 Mar 2021 17:34:59 GMT + ms-cv: moro0LSAOUe8lq83MXbvPw.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 559ms + x-processing-time: 570ms status: code: 200 message: OK - url: https://live-testing.communication.azure.com/phoneNumbers/operations/search_a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 + url: sanitized - request: body: '' headers: Date: - - Thu, 04 Mar 2021 18:18:16 GMT + - Fri, 05 Mar 2021 17:34:59 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/21a51537-3995-4974-a2d7-e6b87dadce2a?api-version=2021-03-07 response: body: - string: '{"searchId": "a061a85c-c652-44d8-b051-014b8d892a07", "phoneNumbers": - ["+18445496587"], "phoneNumberType": "TollFree", "assignmentType": "Application", + string: '{"searchId": "21a51537-3995-4974-a2d7-e6b87dadce2a", "phoneNumbers": + ["sanitized"], "phoneNumberType": "TollFree", "assignmentType": "Application", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}, "searchExpiresBy": - "2021-03-04T18:33:53.9609193+00:00"}' + "2021-03-05T17:50:34.9533619+00:00"}' headers: content-type: application/json; charset=utf-8 - date: Thu, 04 Mar 2021 18:18:17 GMT - ms-cv: tajtINiuYU6xpPdp0AwTzA.0 + date: Fri, 05 Mar 2021 17:35:01 GMT + ms-cv: c0t2UOUpo0y74f3dLa9Mcw.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 1571ms + x-processing-time: 1205ms status: code: 200 message: OK - url: https://live-testing.communication.azure.com/availablePhoneNumbers/searchResults/a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 + url: sanitized - request: - body: '{"searchId": "a061a85c-c652-44d8-b051-014b8d892a07"}' + body: '{"searchId": "21a51537-3995-4974-a2d7-e6b87dadce2a"}' headers: Accept: - application/json @@ -101,7 +101,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 04 Mar 2021 18:18:18 GMT + - Fri, 05 Mar 2021 17:35:01 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -114,13 +114,13 @@ interactions: headers: access-control-expose-headers: Operation-Location,operation-id,purchase-id content-length: '0' - date: Thu, 04 Mar 2021 18:18:20 GMT - ms-cv: cfO6OqU0F0SdpnnF3G0Qxg.0 - operation-id: purchase_a061a85c-c652-44d8-b051-014b8d892a07 - operation-location: /phoneNumbers/operations/purchase_a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 - purchase-id: a061a85c-c652-44d8-b051-014b8d892a07 + date: Fri, 05 Mar 2021 17:35:03 GMT + ms-cv: cwr5L3s6sESZzNYi0shhsg.0 + operation-id: purchase_21a51537-3995-4974-a2d7-e6b87dadce2a + operation-location: /phoneNumbers/operations/purchase_21a51537-3995-4974-a2d7-e6b87dadce2a?api-version=2021-03-07 + purchase-id: 21a51537-3995-4974-a2d7-e6b87dadce2a request-context: appId= - x-processing-time: 2228ms + x-processing-time: 2201ms status: code: 202 message: Accepted @@ -129,57 +129,57 @@ interactions: body: '' headers: Date: - - Thu, 04 Mar 2021 18:18:50 GMT + - Fri, 05 Mar 2021 17:35:33 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_21a51537-3995-4974-a2d7-e6b87dadce2a?api-version=2021-03-07 response: body: string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": - "2021-03-04T18:17:45.1869951+00:00", "id": "sanitized", "operationType": "Purchase", + "2021-03-05T17:34:28.9687105+00:00", "id": "sanitized", "operationType": "Purchase", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: content-type: application/json; charset=utf-8 - date: Thu, 04 Mar 2021 18:18:50 GMT - ms-cv: 2BX6oEo9cEOkNVEY8GJghg.0 + date: Fri, 05 Mar 2021 17:35:34 GMT + ms-cv: RYddi1AflE69nYIk0rXmAQ.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 530ms + x-processing-time: 491ms status: code: 200 message: OK - url: https://live-testing.communication.azure.com/phoneNumbers/operations/purchase_a061a85c-c652-44d8-b051-014b8d892a07?api-version=2021-03-07 + url: sanitized - request: body: '' headers: Accept: - application/json Date: - - Thu, 04 Mar 2021 18:18:51 GMT + - Fri, 05 Mar 2021 17:35:34 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: DELETE - uri: https://sanitized.communication.azure.com/phoneNumbers/%2B18445496587?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/sanitized?api-version=2021-03-07 response: body: string: '' headers: access-control-expose-headers: Operation-Location,operation-id,release-id content-length: '0' - date: Thu, 04 Mar 2021 18:18:51 GMT - ms-cv: nPiFBK6ha02zRzkcjIkNwA.0 - operation-id: release_4427e952-844b-4d4a-9830-774e2b588066 - operation-location: /phoneNumbers/operations/release_4427e952-844b-4d4a-9830-774e2b588066?api-version=2021-03-07 - release-id: 4427e952-844b-4d4a-9830-774e2b588066 + date: Fri, 05 Mar 2021 17:35:35 GMT + ms-cv: jfGHX2rOTU+YERN3l8Gruw.0 + operation-id: release_f5bd3fc8-e53f-40f3-b63b-d66d68f76f40 + operation-location: /phoneNumbers/operations/release_f5bd3fc8-e53f-40f3-b63b-d66d68f76f40?api-version=2021-03-07 + release-id: f5bd3fc8-e53f-40f3-b63b-d66d68f76f40 request-context: appId= - x-processing-time: 872ms + x-processing-time: 1503ms status: code: 202 message: Accepted - url: https://live-testing.communication.azure.com/phoneNumbers/%2B18445496587?api-version=2021-03-07 + url: https://live-testing.communication.azure.com/phoneNumbers/%2B18447304825?api-version=2021-03-07 version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml index dc596a27a626..37907a99490f 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml @@ -10,7 +10,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 04 Mar 2021 20:10:52 GMT + - Fri, 05 Mar 2021 17:35:36 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -23,13 +23,13 @@ interactions: headers: access-control-expose-headers: Location,Operation-Location,operation-id,search-id content-length: '0' - date: Thu, 04 Mar 2021 20:10:54 GMT - ms-cv: 8WLGSUfKPU6zyEk9ShCZmw.0 - operation-id: search_d2b92f7d-1c61-481c-ac7d-044754b422bb - operation-location: /phoneNumbers/operations/search_d2b92f7d-1c61-481c-ac7d-044754b422bb?api-version=2021-03-07 + date: Fri, 05 Mar 2021 17:35:39 GMT + ms-cv: OtXGmscJ8EmKsbecqjaAag.0 + operation-id: search_7f99cec8-7846-4159-b200-3c536909c7da + operation-location: /phoneNumbers/operations/search_7f99cec8-7846-4159-b200-3c536909c7da?api-version=2021-03-07 request-context: appId= - search-id: d2b92f7d-1c61-481c-ac7d-044754b422bb - x-processing-time: 2876ms + search-id: 7f99cec8-7846-4159-b200-3c536909c7da + x-processing-time: 2811ms status: code: 202 message: Accepted diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml index 46e9b930efed..676f2d9ff5b7 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml @@ -9,7 +9,7 @@ interactions: Content-Type: - application/merge-patch+json Date: - - Thu, 04 Mar 2021 20:10:55 GMT + - Fri, 05 Mar 2021 17:35:39 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -18,20 +18,20 @@ interactions: uri: https://sanitized.communication.azure.com/phoneNumbers/sanitized/capabilities?api-version=2021-03-07 response: body: - string: '{"capabilitiesUpdateId": "a51ebf71-91f5-4410-917a-1d3993e8d7ae"}' + string: '{"capabilitiesUpdateId": "162b8e8d-b692-41ab-bbf8-9fffd289710e"}' headers: access-control-expose-headers: Operation-Location,Location,operation-id,capabilities-id - capabilities-id: a51ebf71-91f5-4410-917a-1d3993e8d7ae + capabilities-id: 162b8e8d-b692-41ab-bbf8-9fffd289710e content-type: application/json; charset=utf-8 - date: Thu, 04 Mar 2021 20:10:56 GMT - ms-cv: nQRrDvDF9kSmUHvSW2nJNw.0 - operation-id: capabilities_a51ebf71-91f5-4410-917a-1d3993e8d7ae - operation-location: /phoneNumbers/operations/capabilities_a51ebf71-91f5-4410-917a-1d3993e8d7ae?api-version=2021-03-07 + date: Fri, 05 Mar 2021 17:35:40 GMT + ms-cv: xnZ+QUgohUWXJmu2IYvDAw.0 + operation-id: capabilities_162b8e8d-b692-41ab-bbf8-9fffd289710e + operation-location: /phoneNumbers/operations/capabilities_162b8e8d-b692-41ab-bbf8-9fffd289710e?api-version=2021-03-07 request-context: appId= transfer-encoding: chunked - x-processing-time: 1183ms + x-processing-time: 1088ms status: code: 202 message: Accepted - url: https://live-testing.communication.azure.com/phoneNumbers/%2B18332143261/capabilities?api-version=2021-03-07 + url: sanitized version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index 67f4d51a526c..891240a0227e 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -10,31 +10,28 @@ SKIP_PURCHASE_PHONE_NUMBER_TESTS = True PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON = "Phone numbers shouldn't be purchased in live tests" -class NewTests(CommunicationTestCase): +class PhoneNumbersAdministrationClientTest(CommunicationTestCase): def setUp(self): - super(NewTests, self).setUp() + super(PhoneNumbersAdministrationClientTest, self).setUp() if self.is_playback(): self.phone_number = "sanitized" self.country_code = "US" - self.area_code = "833" else: self.phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") - self.phone_number_to_release = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE") - self.country_code = os.getenv("AZURE_COMMUNICATION_SERVICE_COUNTRY_CODE") - self.area_code = os.getenv("AZURE_COMMUNICATION_SERIVCE_AREA_CODE") + self.country_code = os.getenv("AZURE_COMMUNICATION_SERVICE_COUNTRY_CODE", "US") self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ BodyReplacerProcessor( keys=["id", "token", "phoneNumber"] ), - PhoneNumberUriReplacer()]) + PhoneNumberUriReplacer(), + ResponseReplacerProcessor()]) - @pytest.mark.skipif(SKIP_PURCHASE_PHONE_NUMBER_TESTS, reason=PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON) - def test_list_all_phone_numbers_from_managed_identity(self): + def test_list_acquired_phone_numbers_from_managed_identity(self): endpoint, access_key = parse_connection_str(self.connection_str) credential = create_token_credential() phone_number_client = PhoneNumbersClient(endpoint, credential) - phone_numbers = phone_number_client.list_all_phone_numbers() + phone_numbers = phone_number_client.list_acquired_phone_numbers() assert phone_numbers.next() def test_list_acquired_phone_numbers(self): @@ -55,7 +52,6 @@ def test_search_available_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - area_code=self.area_code, polling = True ) assert poller.result() @@ -80,7 +76,6 @@ def test_purchase_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - area_code=self.area_code, polling = True ) phone_number_to_buy = search_poller.result() diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index a2f049c6e1e6..dbea44a7db7d 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -11,30 +11,25 @@ SKIP_PURCHASE_PHONE_NUMBER_TESTS = True PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON = "Phone numbers shouldn't be purchased in live tests" -class NewTests(AsyncCommunicationTestCase): +class PhoneNumbersAdministrationClientTestAsync(AsyncCommunicationTestCase): def setUp(self): - super(NewTests, self).setUp() + super(PhoneNumbersAdministrationClientTestAsync, self).setUp() if self.is_playback(): - self.phone_number = "+18000005555" - self.phone_number_to_release = "+18000005556" + self.phone_number = "sanitized" self.country_code = "US" - self.area_code = "833" else: self.phone_number = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER") - self.phone_number_to_release = os.getenv("AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE") - self.country_code = os.getenv("AZURE_COMMUNICATION_SERVICE_COUNTRY_CODE") - self.area_code = os.getenv("AZURE_COMMUNICATION_SERIVCE_AREA_CODE") - + self.country_code = os.getenv("AZURE_COMMUNICATION_SERVICE_COUNTRY_CODE", "US") self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ BodyReplacerProcessor( - keys=["id", "token", "phoneNumber", "phonenumbers"] + keys=["id", "token", "phoneNumber"] ), - PhoneNumberUriReplacer()]) + PhoneNumberUriReplacer(), + ResponseReplacerProcessor()]) - @pytest.mark.skipif(SKIP_PURCHASE_PHONE_NUMBER_TESTS, reason=PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON) @AsyncCommunicationTestCase.await_prepared_test - async def test_list_all_phone_numbers_from_managed_identity(self): + async def test_list_acquired_phone_numbers_from_managed_identity(self): endpoint, access_key = parse_connection_str(self.connection_str) credential = create_token_credential() phone_number_client = PhoneNumbersClient(endpoint, credential) @@ -72,7 +67,6 @@ async def test_search_available_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - area_code=self.area_code, polling = True ) assert poller.result() @@ -101,7 +95,6 @@ async def test_purchase_phone_numbers(self): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - area_code=self.area_code, polling = True ) phone_number_to_buy = await search_poller.result() From e268c60c85bd951790e473d0f36e0e293edf6039 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Fri, 5 Mar 2021 12:30:13 -0700 Subject: [PATCH 30/32] Addressed comments --- ...tion_identity-1.0.0b4-py2.py3-none-any.whl | Bin 33505 -> 0 bytes .../README.md | 24 ++--- .../communication/phonenumbers/__init__.py | 2 - .../phonenumbers/_phone_numbers_client.py | 6 +- .../aio/_phone_numbers_client_async.py | 2 +- .../samples/get_phone_number_sample.py | 5 +- .../list_acquired_phone_numbers_sample.py | 6 +- .../samples/purchase_phone_number_sample.py | 4 +- .../samples/release_phone_number_sample.py | 5 +- .../search_available_phone_numbers_sample.py | 6 +- ...update_phone_number_capabilities_sample.py | 5 +- .../test/_shared/__init__.py | 6 ++ .../test/_shared/testcase.py | 19 +--- ...stration_client.test_get_phone_number.yaml | 8 +- ...ient.test_list_acquired_phone_numbers.yaml | 8 +- ...d_phone_numbers_from_managed_identity.yaml | 6 +- ...on_client.test_purchase_phone_numbers.yaml | 84 ++++++++-------- ...t.test_search_available_phone_numbers.yaml | 42 ++++---- ...test_update_phone_number_capabilities.yaml | 36 +++---- ...on_client_async.test_get_phone_number.yaml | 8 +- ...sync.test_list_acquired_phone_numbers.yaml | 8 +- ...d_phone_numbers_from_managed_identity.yaml | 6 +- ...ent_async.test_purchase_phone_numbers.yaml | 91 +++++++++--------- ...c.test_search_available_phone_numbers.yaml | 14 +-- ...test_update_phone_number_capabilities.yaml | 16 +-- ...test_phone_number_administration_client.py | 14 +-- ...hone_number_administration_client_async.py | 16 +-- 27 files changed, 219 insertions(+), 228 deletions(-) delete mode 100644 sdk/communication/azure-communication-identity/azure_communication_identity-1.0.0b4-py2.py3-none-any.whl create mode 100644 sdk/communication/azure-communication-phonenumbers/test/_shared/__init__.py diff --git a/sdk/communication/azure-communication-identity/azure_communication_identity-1.0.0b4-py2.py3-none-any.whl b/sdk/communication/azure-communication-identity/azure_communication_identity-1.0.0b4-py2.py3-none-any.whl deleted file mode 100644 index 03a4726a88bd3cb10e5ee02b06f46861bc739722..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33505 zcmeFYV~}Ry(xzLsyKLL8F59+k+qP}nc9&h%W!tu`>HfZ%*?UjK#6J6+zvtH*vEu!+ z?)7Bmm3ikQCkYIK3;+NC0T2->s4&s=YY-d|0H6v80D%0@Q+*F-2V*)zTWf1)8*@W_ zCv#gHI&&jq8z*xocRF2Na~pFfU0qr`_iDK=ivfCs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xr&J4jyu3#o`^^=tW>2Y)0Wc zo$(=JJ&a9z`d;DX4-=Ax@A#3QfD_)-rrRhYSaAeDq|@Ijnz`hM4>Ogwy_dRk{)#hw zUqaKM3`=ueSALws{|O3zc9C*qyAf;5pQ|s{eo&vfKFh}Fx$~qm)0@_uzI&2}Q=bM1 zB{)lQZTbOPCu3>aK)RBOm^I9gHCFn_w9bZyh0sm(4bNPI+R$ki9mD1~P{XmkfzV)(4pm=HXtZ4}rw+hvv(#$d5$+ut4L z3Z9TX5h8BonAxz!W#<+VJy4}ey+n@&yd@t+{iyjdFt29YNr%L2p#Mx#wOu*LnW!!G zef*BvR5mHv%7Hu^-AW*E;w`zExoSnImCbj`LQ&f!_xxh2%EY*la6US_0%81t?q+5s z)NgG~>!w(r@?qVRj86~8SMhcmo}LpcfI!Fq$j>+TzwQD1{KX%ydheefzuOV^SF3;3 z4D}y20RZZ~C7=(*_$i|Jx{2Bg0PAxfr{4znJEQdz_I0zU7ude%MgMQW{(FyxU$5@x zkMg>G%?nH_!tcYpItu<3QvCzwRP@5w*4 z!(RGVzs7m3XZnJ}`tI-J{D&)jrEdD#hu2z^FFpW}{e2()#S(rE^ICxI1;+N7g8aMl z_Mb!gkIz5l*nWljc?`seF;4S3#j{VvqY1o>}s_O%qw3)bi7ea!y_>p%R8 zFYdgWuRpK&HAVf!i?Zhd`0rl)S)}_P7L325i@#X+p9Fdj6Um_+tA=@HcJ$ ziz@hf9=s+Sz1aRP`kS`@f9la|kk|Z&7mz{8{~O4^*buLwUKd}#KsCw!9jO0Qiv1ez zbeuV}t0V9i z)DfLOQGY+n^UHzwYn<2TkuNw!&uOJU0{!=K{&_n28sv47>ILMx<=+PRBW3j(;dMgk y1);*~ZzKF$dg(RN>%`JOk!k@Etp7IBKhjJx;vhd0VF0+#fBny_Cm_e4|NTEERmhG2 diff --git a/sdk/communication/azure-communication-phonenumbers/README.md b/sdk/communication/azure-communication-phonenumbers/README.md index 90930ca058ab..0c75a7bce28f 100644 --- a/sdk/communication/azure-communication-phonenumbers/README.md +++ b/sdk/communication/azure-communication-phonenumbers/README.md @@ -46,7 +46,7 @@ phone_number_administration_client = PhoneNumbersAdministrationClient.from_conne ### Phone Number Types overview -Phone numbers come in two types; Geographic and Toll-Free. Geographic phone plans are phone plans associated with a location, whose phone numbers' area codes are associated with the area code of a geographic location. Toll-Free phone plans are phone plans not associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888. +Phone numbers come in two types; Geographic and Toll-Free. Geographic phone numbers are phone numbers associated with a location, whose area codes are associated with the area code of a geographic location. Toll-Free phone numbers are phone numbers with no associated location. For example, in the US, toll-free numbers can come with area codes such as 800 or 888. ### Searching and Purchasing and Releasing numbers @@ -71,7 +71,7 @@ print(acquired_phone_number.phone_number) Gets the information from the specified phone number ```python -result = phone_numbers_client.get_phone_number("+18001234567") +result = phone_numbers_client.get_phone_number("") print(result.country_code) print(result.phone_number) ``` @@ -87,8 +87,8 @@ The result of the search can then be used to purchase the number in the correspo ```python capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityValue.INBOUND, - sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + calling = PhoneNumberCapabilityType.INBOUND, + sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND ) poller = phone_numbers_client.begin_search_available_phone_numbers( "US", @@ -119,7 +119,7 @@ Releases an acquired phone number. ```python poller = self.phone_number_client.begin_release_phone_number( - "+18001234567", + "", polling = True ) ``` @@ -128,16 +128,16 @@ poller = self.phone_number_client.begin_release_phone_number( Updates the specified phone number capabilities for Calling and SMS to one of: -- `PhoneNumberCapabilityValue.NONE` -- `PhoneNumberCapabilityValue.INBOUND` -- `PhoneNumberCapabilityValue.OUTBOUND` -- `PhoneNumberCapabilityValue.INBOUND_OUTBOUND` +- `PhoneNumberCapabilityType.NONE` +- `PhoneNumberCapabilityType.INBOUND` +- `PhoneNumberCapabilityType.OUTBOUND` +- `PhoneNumberCapabilityType.INBOUND_OUTBOUND` ```python poller = self.phone_number_client.begin_update_phone_number_capabilities( - "+18335260208", - PhoneNumberCapabilityValue.OUTBOUND, - PhoneNumberCapabilityValue.INBOUND_OUTBOUND, + "", + PhoneNumberCapabilityType.OUTBOUND, + PhoneNumberCapabilityType.INBOUND_OUTBOUND, polling = True ) ``` diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py index 958eb870d459..f9c3de4f04b4 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/__init__.py @@ -14,7 +14,6 @@ BillingFrequency, PhoneNumberAssignmentType, PhoneNumberCapabilityType, - PhoneNumberOperationStatus, PhoneNumberType, ) @@ -26,7 +25,6 @@ 'BillingFrequency', 'PhoneNumberAssignmentType', 'PhoneNumberCapabilityType', - 'PhoneNumberOperationStatus', 'PhoneNumberType', 'PhoneNumbersClient' ] diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py index a3262d4012f7..9fd9bcf079e1 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/_phone_numbers_client.py @@ -70,7 +70,7 @@ def begin_purchase_phone_numbers( :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :rtype: ~azure.core.polling.LROPoller[~azure.communication.phonenumbers.models.PhoneNumberSearchResult] + :rtype: ~azure.core.polling.LROPoller[None] """ return self._phone_number_client.phone_numbers.begin_purchase_phone_numbers( search_id, @@ -86,7 +86,7 @@ def begin_release_phone_number( # type: (...) -> LROPoller[None] """Releases an acquired phone number. - :param phone_number: Phone number to be released, e.g. +11234567890. + :param phone_number: Phone number to be released, e.g. +55534567890. :type phone_number: str :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: Pass in True if you'd like the LROBasePolling polling method, @@ -160,7 +160,7 @@ def begin_update_phone_number_capabilities( """Updates the capabilities of a phone number. :param phone_number: The phone number id in E.164 format. The leading plus can be either + or - encoded as %2B, e.g. +11234567890. + encoded as %2B, e.g. +55534567890. :type phone_number: str :param calling: Capability value for calling. :type calling: str or ~azure.communication.phonenumbers.models.PhoneNumberCapabilityType diff --git a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py index 994071dc72b9..92fe009fc369 100644 --- a/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/azure/communication/phonenumbers/aio/_phone_numbers_client_async.py @@ -71,7 +71,7 @@ async def begin_purchase_phone_numbers( :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.communication.phonenumbers.models.PhoneNumberSearchResult] + :rtype: ~azure.core.polling.AsyncLROPoller[None] """ return await self._phone_number_client.phone_numbers.begin_purchase_phone_numbers( search_id, diff --git a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py index 5493fce13d1b..f09d43591120 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/get_phone_number_sample.py @@ -13,7 +13,8 @@ USAGE: python get_phone_number_sample.py Set the environment variables with your own values before running the sample: - 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service + 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The connection string including your endpoint and + access key of your Azure Communication Service 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER - The phone number you want to get its information """ @@ -31,4 +32,4 @@ def get_phone_number_information(): print('Phone number information: ' + phone_number_information) if __name__ == '__main__': - get_phone_number_information() \ No newline at end of file + get_phone_number_information() diff --git a/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py index 34dbfe415cf9..7991282088bc 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/list_acquired_phone_numbers_sample.py @@ -13,8 +13,8 @@ USAGE: python list_acquired_phone_numbers_sample.py Set the environment variables with your own values before running the sample: - 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service -""" + 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The connection string including your endpoint and + access key of your Azure Communication Service""" import os from azure.communication.phonenumbers import ( @@ -32,4 +32,4 @@ def list_acquired_phone_numbers(): if __name__ == '__main__': - list_acquired_phone_numbers() \ No newline at end of file + list_acquired_phone_numbers() diff --git a/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py index 819f7867e37e..ec16e3913222 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/purchase_phone_number_sample.py @@ -13,8 +13,8 @@ USAGE: python purchase_phone_number_sample.py Set the environment variables with your own values before running the sample: - 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service - 2) AZURE_COMMUNICATION_SERVICE_SEARCH_ID_TO_PURCHASE - The search id for the phone number you reserved and want to purchase + 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The connection string including your endpoint and + access key of your Azure Communication Service 2) AZURE_COMMUNICATION_SERVICE_SEARCH_ID_TO_PURCHASE - The search id for the phone number you reserved and want to purchase """ import os diff --git a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py index 4f99c63bb6b7..a06804445d34 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/release_phone_number_sample.py @@ -13,7 +13,8 @@ USAGE: python release_phone_number_sample.py Set the environment variables with your own values before running the sample: - 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service + 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The connection string including your endpoint and + access key of your Azure Communication Service 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_RELEASE - The phone number you want to release """ @@ -34,4 +35,4 @@ def release_phone_number(): print('Status of the operation: ' + poller.status()) if __name__ == '__main__': - release_phone_number() \ No newline at end of file + release_phone_number() diff --git a/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py index 9c5f01f3df35..61187bb07838 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/search_available_phone_numbers_sample.py @@ -13,8 +13,8 @@ USAGE: python search_available_phone_numbers_sample.py Set the environment variables with your own values before running the sample: - 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service - 2) AZURE_COMMUNICATION_SERVICE_AREA_CODE - The area code you want the number to be in + 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The connection string including your endpoint and + access key of your Azure Communication Service """ import os @@ -40,8 +40,6 @@ def search_available_phone_numbers(): PhoneNumberType.TOLL_FREE, PhoneNumberAssignmentType.APPLICATION, capabilities, - area_code, - 1, polling = True ) print('Acquired phone numbers: ' + poller.result()) diff --git a/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py b/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py index 1985b1f671b2..fc7fefac08bb 100644 --- a/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py +++ b/sdk/communication/azure-communication-phonenumbers/samples/update_phone_number_capabilities_sample.py @@ -13,7 +13,8 @@ USAGE: python update_phone_number_capabilities_sample.py Set the environment variables with your own values before running the sample: - 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The endpoint of your Azure Communication Service + 1) AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING - The connection string including your endpoint and + access key of your Azure Communication Service 2) AZURE_COMMUNICATION_SERVICE_PHONE_NUMBER_TO_UPDATE - The phone number you want to update """ @@ -40,4 +41,4 @@ def update_phone_number_capabilities(): print('Status of the operation: ' + poller.status()) if __name__ == '__main__': - update_phone_number_capabilities() \ No newline at end of file + update_phone_number_capabilities() diff --git a/sdk/communication/azure-communication-phonenumbers/test/_shared/__init__.py b/sdk/communication/azure-communication-phonenumbers/test/_shared/__init__.py new file mode 100644 index 000000000000..841b812e10ba --- /dev/null +++ b/sdk/communication/azure-communication-phonenumbers/test/_shared/__init__.py @@ -0,0 +1,6 @@ +# coding: utf-8 +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py b/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py index 89d33f397a7a..5ec27d644d24 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py +++ b/sdk/communication/azure-communication-phonenumbers/test/_shared/testcase.py @@ -9,7 +9,7 @@ from devtools_testutils import AzureTestCase from azure_devtools.scenario_tests import RecordingProcessor, ReplayableTest from azure_devtools.scenario_tests.utilities import is_text_payload -from azure.communication.administration._shared.utils import parse_connection_str +from azure.communication.phonenumbers._shared.utils import parse_connection_str class ResponseReplacerProcessor(RecordingProcessor): def __init__(self, keys=None, replacement="sanitized"): @@ -27,26 +27,13 @@ def process_response(self, response): break elif "phoneNumber" in item: item['phoneNumber'] = self._replacement + elif "id" in item: + item['id'] = self._replacement response['body']['string'] = json.dumps(body) response['url'] = self._replacement return response except (KeyError, ValueError): return response - - '''def sanitize_dict(dictionary): - for key in dictionary: - value = dictionary[key] - if isinstance(value, str): - dictionary[key] = re.sub( - r"("+'|'.join(self._keys)+r")", - self._replacement, - dictionary[key]) - elif isinstance(value, dict): - sanitize_dict(value) - - sanitize_dict(response) - - return response''' class BodyReplacerProcessor(RecordingProcessor): """Sanitize the sensitive info inside request or response bodies""" diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml index 0501e2364ffb..898673eacbed 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 05 Mar 2021 17:31:53 GMT + - Fri, 05 Mar 2021 19:17:51 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -26,15 +26,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 17:31:55 GMT + - Fri, 05 Mar 2021 19:17:53 GMT ms-cv: - - 0XgNRxFgsU+jtkYdzUXCig.0 + - EUrW0PP/LU+krc4gcF6lsQ.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 1782ms + - 1555ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml index 04a6e3c516f1..414fffb4d360 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 05 Mar 2021 17:31:55 GMT + - Fri, 05 Mar 2021 19:17:53 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -42,15 +42,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 17:32:00 GMT + - Fri, 05 Mar 2021 19:17:58 GMT ms-cv: - - KdBSgkLB20KwA9de1Xr6AA.0 + - niTttbtcLEejKy6F2IYX3g.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 4581ms + - 4534ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers_from_managed_identity.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers_from_managed_identity.yaml index 5c9216ec3237..4c5dc58319b5 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers_from_managed_identity.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers_from_managed_identity.yaml @@ -51,15 +51,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 17:57:40 GMT + - Fri, 05 Mar 2021 19:23:21 GMT ms-cv: - - RfWp91uvd02ICqvPQgnxlA.0 + - 71j4bfMWu0emybxhaM3JNA.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 5011ms + - 5338ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml index 7a1b07c196c2..ec0a93bf7653 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 05 Mar 2021 17:32:00 GMT + - Fri, 05 Mar 2021 19:18:00 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -30,19 +30,19 @@ interactions: content-length: - '0' date: - - Fri, 05 Mar 2021 17:32:03 GMT + - Fri, 05 Mar 2021 19:18:04 GMT ms-cv: - - UiKRXu2IPkmNlhE+PAE0Pg.0 + - 56e5zc+JAkSyPvMiakXNQQ.0 operation-id: - - search_15d9eb25-3c3e-453d-89c6-0402c6101659 + - search_1798f414-0bb8-419f-986c-f44c0d99c475 operation-location: - - /phoneNumbers/operations/search_15d9eb25-3c3e-453d-89c6-0402c6101659?api-version=2021-03-07 + - /phoneNumbers/operations/search_1798f414-0bb8-419f-986c-f44c0d99c475?api-version=2021-03-07 request-context: - appId= search-id: - - 15d9eb25-3c3e-453d-89c6-0402c6101659 + - 1798f414-0bb8-419f-986c-f44c0d99c475 x-processing-time: - - 2572ms + - 3557ms status: code: 202 message: Accepted @@ -56,17 +56,17 @@ interactions: Connection: - keep-alive Date: - - Fri, 05 Mar 2021 17:32:33 GMT + - Fri, 05 Mar 2021 19:18:34 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_15d9eb25-3c3e-453d-89c6-0402c6101659?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_1798f414-0bb8-419f-986c-f44c0d99c475?api-version=2021-03-07 response: body: - string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/15d9eb25-3c3e-453d-89c6-0402c6101659?api-version=2021-03-07", - "createdDateTime": "2021-03-05T17:32:03.428505+00:00", "id": "sanitized", + string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/1798f414-0bb8-419f-986c-f44c0d99c475?api-version=2021-03-07", + "createdDateTime": "2021-03-05T19:18:03.9690504+00:00", "id": "sanitized", "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: access-control-expose-headers: @@ -74,15 +74,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 17:32:33 GMT + - Fri, 05 Mar 2021 19:18:35 GMT ms-cv: - - yswyogbtVUK6ilnPI2ZPVQ.0 + - sFNNn28le0uiJ6ts4OZXhw.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 499ms + - 462ms status: code: 200 message: OK @@ -97,39 +97,39 @@ interactions: Connection: - keep-alive Date: - - Fri, 05 Mar 2021 17:32:34 GMT + - Fri, 05 Mar 2021 19:18:34 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/15d9eb25-3c3e-453d-89c6-0402c6101659?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/1798f414-0bb8-419f-986c-f44c0d99c475?api-version=2021-03-07 response: body: - string: '{"searchId": "15d9eb25-3c3e-453d-89c6-0402c6101659", "phoneNumbers": + string: '{"searchId": "1798f414-0bb8-419f-986c-f44c0d99c475", "phoneNumbers": ["sanitized"], "phoneNumberType": "TollFree", "assignmentType": "Application", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}, "searchExpiresBy": - "2021-03-05T17:48:09.6152644+00:00"}' + "2021-03-05T19:34:09.3360252+00:00"}' headers: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 17:32:34 GMT + - Fri, 05 Mar 2021 19:18:36 GMT ms-cv: - - nBPsj2RK7UeRMXJw/YYAQA.0 + - twckNvyEv0+kDoJ16vIfqQ.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 959ms + - 978ms status: code: 200 message: OK url: sanitized - request: - body: '{"searchId": "15d9eb25-3c3e-453d-89c6-0402c6101659"}' + body: '{"searchId": "1798f414-0bb8-419f-986c-f44c0d99c475"}' headers: Accept: - application/json @@ -142,7 +142,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 05 Mar 2021 17:32:35 GMT + - Fri, 05 Mar 2021 19:18:35 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -158,19 +158,19 @@ interactions: content-length: - '0' date: - - Fri, 05 Mar 2021 17:32:37 GMT + - Fri, 05 Mar 2021 19:18:38 GMT ms-cv: - - HBenQJLrBUuUbCoTX6b96A.0 + - dEWJXsmK5U+S1d+SW4xPLA.0 operation-id: - - purchase_15d9eb25-3c3e-453d-89c6-0402c6101659 + - purchase_1798f414-0bb8-419f-986c-f44c0d99c475 operation-location: - - /phoneNumbers/operations/purchase_15d9eb25-3c3e-453d-89c6-0402c6101659?api-version=2021-03-07 + - /phoneNumbers/operations/purchase_1798f414-0bb8-419f-986c-f44c0d99c475?api-version=2021-03-07 purchase-id: - - 15d9eb25-3c3e-453d-89c6-0402c6101659 + - 1798f414-0bb8-419f-986c-f44c0d99c475 request-context: - appId= x-processing-time: - - 2322ms + - 2193ms status: code: 202 message: Accepted @@ -184,31 +184,31 @@ interactions: Connection: - keep-alive Date: - - Fri, 05 Mar 2021 17:33:07 GMT + - Fri, 05 Mar 2021 19:19:08 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_15d9eb25-3c3e-453d-89c6-0402c6101659?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_1798f414-0bb8-419f-986c-f44c0d99c475?api-version=2021-03-07 response: body: string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": - "2021-03-05T17:32:03.428505+00:00", "id": "sanitized", "operationType": "Purchase", + "2021-03-05T19:18:03.9690504+00:00", "id": "sanitized", "operationType": "Purchase", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 17:33:07 GMT + - Fri, 05 Mar 2021 19:19:08 GMT ms-cv: - - 2nzsapS2kkSU1CqHHZ4D+Q.0 + - a8V5HwLBx0uJkiycA5HEMQ.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 558ms + - 449ms status: code: 200 message: OK @@ -225,7 +225,7 @@ interactions: Content-Length: - '0' Date: - - Fri, 05 Mar 2021 17:33:08 GMT + - Fri, 05 Mar 2021 19:19:09 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -241,19 +241,19 @@ interactions: content-length: - '0' date: - - Fri, 05 Mar 2021 17:33:09 GMT + - Fri, 05 Mar 2021 19:19:10 GMT ms-cv: - - 8CVr0+mmo06VtKlKCc8pwg.0 + - gXwa83+iEUSNidCup9AaWQ.0 operation-id: - - release_9f9a864e-f7bb-4b05-b26b-74c1076051f1 + - release_3b7c3afa-226a-436f-abc4-a6df95e73bd0 operation-location: - - /phoneNumbers/operations/release_9f9a864e-f7bb-4b05-b26b-74c1076051f1?api-version=2021-03-07 + - /phoneNumbers/operations/release_3b7c3afa-226a-436f-abc4-a6df95e73bd0?api-version=2021-03-07 release-id: - - 9f9a864e-f7bb-4b05-b26b-74c1076051f1 + - 3b7c3afa-226a-436f-abc4-a6df95e73bd0 request-context: - appId= x-processing-time: - - 1449ms + - 1478ms status: code: 202 message: Accepted diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml index 5fca591c796b..a59f6a50c937 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 05 Mar 2021 17:33:09 GMT + - Fri, 05 Mar 2021 19:19:10 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -30,19 +30,19 @@ interactions: content-length: - '0' date: - - Fri, 05 Mar 2021 17:33:13 GMT + - Fri, 05 Mar 2021 19:19:14 GMT ms-cv: - - xUw7Lzf1zEqW60yFP7jeCw.0 + - HI5oDtNjIkO9obcU02/TnA.0 operation-id: - - search_324670a6-ab6b-4379-ac4e-8a0af6f374af + - search_dddfd575-b872-4290-8f82-908dbd22e800 operation-location: - - /phoneNumbers/operations/search_324670a6-ab6b-4379-ac4e-8a0af6f374af?api-version=2021-03-07 + - /phoneNumbers/operations/search_dddfd575-b872-4290-8f82-908dbd22e800?api-version=2021-03-07 request-context: - appId= search-id: - - 324670a6-ab6b-4379-ac4e-8a0af6f374af + - dddfd575-b872-4290-8f82-908dbd22e800 x-processing-time: - - 2515ms + - 2886ms status: code: 202 message: Accepted @@ -56,17 +56,17 @@ interactions: Connection: - keep-alive Date: - - Fri, 05 Mar 2021 17:33:42 GMT + - Fri, 05 Mar 2021 19:19:43 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_324670a6-ab6b-4379-ac4e-8a0af6f374af?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_dddfd575-b872-4290-8f82-908dbd22e800?api-version=2021-03-07 response: body: - string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/324670a6-ab6b-4379-ac4e-8a0af6f374af?api-version=2021-03-07", - "createdDateTime": "2021-03-05T17:33:12.6372497+00:00", "id": "sanitized", + string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/dddfd575-b872-4290-8f82-908dbd22e800?api-version=2021-03-07", + "createdDateTime": "2021-03-05T19:19:13.5921044+00:00", "id": "sanitized", "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: access-control-expose-headers: @@ -74,15 +74,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 17:33:43 GMT + - Fri, 05 Mar 2021 19:19:44 GMT ms-cv: - - pT0wbkG2tk6KY3RAbY7ddA.0 + - n8OjTIjg5kGrTDHhGhrZmw.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 294ms + - 408ms status: code: 200 message: OK @@ -97,33 +97,33 @@ interactions: Connection: - keep-alive Date: - - Fri, 05 Mar 2021 17:33:43 GMT + - Fri, 05 Mar 2021 19:19:44 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/324670a6-ab6b-4379-ac4e-8a0af6f374af?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/dddfd575-b872-4290-8f82-908dbd22e800?api-version=2021-03-07 response: body: - string: '{"searchId": "324670a6-ab6b-4379-ac4e-8a0af6f374af", "phoneNumbers": + string: '{"searchId": "dddfd575-b872-4290-8f82-908dbd22e800", "phoneNumbers": ["sanitized"], "phoneNumberType": "TollFree", "assignmentType": "Application", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}, "searchExpiresBy": - "2021-03-05T17:49:18.9992018+00:00"}' + "2021-03-05T19:35:19.6536336+00:00"}' headers: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 17:33:44 GMT + - Fri, 05 Mar 2021 19:19:45 GMT ms-cv: - - zFJciOzbiESSdFWHimD7fw.0 + - sf39R20CXkGD39qtdJxuOA.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 691ms + - 708ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml index eeaa0ef70f11..33316d6f0592 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml @@ -13,7 +13,7 @@ interactions: Content-Type: - application/merge-patch+json Date: - - Fri, 05 Mar 2021 17:33:44 GMT + - Fri, 05 Mar 2021 19:19:45 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -22,28 +22,28 @@ interactions: uri: https://sanitized.communication.azure.com/phoneNumbers/sanitized/capabilities?api-version=2021-03-07 response: body: - string: '{"capabilitiesUpdateId": "ae9c880c-b537-4538-b260-0f818b21481e"}' + string: '{"capabilitiesUpdateId": "35ecf590-bfbc-415b-82ee-b7e9400204d6"}' headers: access-control-expose-headers: - Operation-Location,Location,operation-id,capabilities-id capabilities-id: - - ae9c880c-b537-4538-b260-0f818b21481e + - 35ecf590-bfbc-415b-82ee-b7e9400204d6 content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 17:33:45 GMT + - Fri, 05 Mar 2021 19:19:46 GMT ms-cv: - - GVS3fDhlAkimsjGVwfBIvg.0 + - /IaPskT6LUuEPttH/OvoVA.0 operation-id: - - capabilities_ae9c880c-b537-4538-b260-0f818b21481e + - capabilities_35ecf590-bfbc-415b-82ee-b7e9400204d6 operation-location: - - /phoneNumbers/operations/capabilities_ae9c880c-b537-4538-b260-0f818b21481e?api-version=2021-03-07 + - /phoneNumbers/operations/capabilities_35ecf590-bfbc-415b-82ee-b7e9400204d6?api-version=2021-03-07 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 1149ms + - 1161ms status: code: 202 message: Accepted @@ -58,17 +58,17 @@ interactions: Connection: - keep-alive Date: - - Fri, 05 Mar 2021 17:34:15 GMT + - Fri, 05 Mar 2021 19:20:16 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/capabilities_ae9c880c-b537-4538-b260-0f818b21481e?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/capabilities_35ecf590-bfbc-415b-82ee-b7e9400204d6?api-version=2021-03-07 response: body: string: '{"status": "Succeeded", "resourceLocation": "/phoneNumbers/+18332143261?api-version=2021-03-07", - "createdDateTime": "2021-03-05T17:33:45.8891088+00:00", "id": "sanitized", + "createdDateTime": "2021-03-05T19:19:46.5981586+00:00", "id": "sanitized", "operationType": "UpdatePhoneNumberCapabilities", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: access-control-expose-headers: @@ -76,15 +76,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 17:34:16 GMT + - Fri, 05 Mar 2021 19:20:17 GMT ms-cv: - - n/+asM0FEUeGb/LSEzp4pQ.0 + - xV6axejo0k+QRdAH1Rk69Q.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 306ms + - 281ms status: code: 200 message: OK @@ -99,7 +99,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 05 Mar 2021 17:34:16 GMT + - Fri, 05 Mar 2021 19:20:17 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -116,15 +116,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 17:34:18 GMT + - Fri, 05 Mar 2021 19:20:18 GMT ms-cv: - - uRSIpbt/jUKbaCw7kHXPlg.0 + - Q3qXC9n6RE2l9LyykCWkZw.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 2022ms + - 1272ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml index 14a00558facd..3bd5b1a0b46a 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml @@ -5,7 +5,7 @@ interactions: Accept: - application/json Date: - - Fri, 05 Mar 2021 17:34:18 GMT + - Fri, 05 Mar 2021 19:20:18 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -20,11 +20,11 @@ interactions: "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}' headers: content-type: application/json; charset=utf-8 - date: Fri, 05 Mar 2021 17:34:21 GMT - ms-cv: U5bV9Vsk/UOitUB2oyKQCA.0 + date: Fri, 05 Mar 2021 19:20:20 GMT + ms-cv: kFE1175CCUiKXQJad4Q+Rg.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 2642ms + x-processing-time: 1840ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml index 322eddc215fe..96b2d0f65c55 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml @@ -5,7 +5,7 @@ interactions: Accept: - application/json Date: - - Fri, 05 Mar 2021 17:34:21 GMT + - Fri, 05 Mar 2021 19:20:20 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -36,11 +36,11 @@ interactions: "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}]}' headers: content-type: application/json; charset=utf-8 - date: Fri, 05 Mar 2021 17:34:25 GMT - ms-cv: z+IYJRktqUqBrFrJry0c/w.0 + date: Fri, 05 Mar 2021 19:20:24 GMT + ms-cv: 7TF1eTJPIkGVQSU8gfRPpw.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 4036ms + x-processing-time: 3266ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers_from_managed_identity.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers_from_managed_identity.yaml index 82ff61a3b603..67e3898a0d3a 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers_from_managed_identity.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers_from_managed_identity.yaml @@ -45,11 +45,11 @@ interactions: "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}]}' headers: content-type: application/json; charset=utf-8 - date: Fri, 05 Mar 2021 17:58:17 GMT - ms-cv: xYZEMY9Gj0y/qud0smN4KA.0 + date: Fri, 05 Mar 2021 19:23:36 GMT + ms-cv: ShclAXnIdUmr25TTZUkiUg.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 6189ms + x-processing-time: 4685ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml index 45564a427e4a..84a0c65df6ba 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml @@ -10,7 +10,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 05 Mar 2021 17:34:25 GMT + - Fri, 05 Mar 2021 19:20:25 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -23,13 +23,13 @@ interactions: headers: access-control-expose-headers: Location,Operation-Location,operation-id,search-id content-length: '0' - date: Fri, 05 Mar 2021 17:34:28 GMT - ms-cv: Bi0spXFiXE+wBTBjBbNF2Q.0 - operation-id: search_21a51537-3995-4974-a2d7-e6b87dadce2a - operation-location: /phoneNumbers/operations/search_21a51537-3995-4974-a2d7-e6b87dadce2a?api-version=2021-03-07 + date: Fri, 05 Mar 2021 19:20:28 GMT + ms-cv: hjxtjdPoZkS4HsFnBpk5Mg.0 + operation-id: search_a3e95dab-1aaf-4200-8fa8-85979ece7e1e + operation-location: /phoneNumbers/operations/search_a3e95dab-1aaf-4200-8fa8-85979ece7e1e?api-version=2021-03-07 request-context: appId= - search-id: 21a51537-3995-4974-a2d7-e6b87dadce2a - x-processing-time: 2724ms + search-id: a3e95dab-1aaf-4200-8fa8-85979ece7e1e + x-processing-time: 2925ms status: code: 202 message: Accepted @@ -38,26 +38,26 @@ interactions: body: '' headers: Date: - - Fri, 05 Mar 2021 17:34:58 GMT + - Fri, 05 Mar 2021 19:20:58 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_21a51537-3995-4974-a2d7-e6b87dadce2a?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_a3e95dab-1aaf-4200-8fa8-85979ece7e1e?api-version=2021-03-07 response: body: - string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/21a51537-3995-4974-a2d7-e6b87dadce2a?api-version=2021-03-07", - "createdDateTime": "2021-03-05T17:34:28.9687105+00:00", "id": "sanitized", + string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/a3e95dab-1aaf-4200-8fa8-85979ece7e1e?api-version=2021-03-07", + "createdDateTime": "2021-03-05T19:20:28.5356258+00:00", "id": "sanitized", "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: access-control-expose-headers: Location content-type: application/json; charset=utf-8 - date: Fri, 05 Mar 2021 17:34:59 GMT - ms-cv: moro0LSAOUe8lq83MXbvPw.0 + date: Fri, 05 Mar 2021 19:21:00 GMT + ms-cv: TxrrSSJpk0WOmMvHpfKF1g.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 570ms + x-processing-time: 559ms status: code: 200 message: OK @@ -66,33 +66,32 @@ interactions: body: '' headers: Date: - - Fri, 05 Mar 2021 17:34:59 GMT + - Fri, 05 Mar 2021 19:20:59 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/21a51537-3995-4974-a2d7-e6b87dadce2a?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/a3e95dab-1aaf-4200-8fa8-85979ece7e1e?api-version=2021-03-07 response: body: - string: '{"searchId": "21a51537-3995-4974-a2d7-e6b87dadce2a", "phoneNumbers": - ["sanitized"], "phoneNumberType": "TollFree", "assignmentType": "Application", - "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": - {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}, "searchExpiresBy": - "2021-03-05T17:50:34.9533619+00:00"}' + string: '{"searchId": "sanitized", "phoneNumbers": ["sanitized"], "phoneNumberType": + "TollFree", "assignmentType": "Application", "capabilities": {"calling": "inbound", + "sms": "inbound+outbound"}, "cost": {"amount": 2.0, "currencyCode": "USD", + "billingFrequency": "Monthly"}, "searchExpiresBy": "2021-03-05T19:36:35.2621881+00:00"}' headers: content-type: application/json; charset=utf-8 - date: Fri, 05 Mar 2021 17:35:01 GMT - ms-cv: c0t2UOUpo0y74f3dLa9Mcw.0 + date: Fri, 05 Mar 2021 19:21:02 GMT + ms-cv: qwgXAO6Yb0OQ+Iblp+k+0Q.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 1205ms + x-processing-time: 1822ms status: code: 200 message: OK url: sanitized - request: - body: '{"searchId": "21a51537-3995-4974-a2d7-e6b87dadce2a"}' + body: '{"searchId": "sanitized"}' headers: Accept: - application/json @@ -101,7 +100,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 05 Mar 2021 17:35:01 GMT + - Fri, 05 Mar 2021 19:21:01 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -114,13 +113,13 @@ interactions: headers: access-control-expose-headers: Operation-Location,operation-id,purchase-id content-length: '0' - date: Fri, 05 Mar 2021 17:35:03 GMT - ms-cv: cwr5L3s6sESZzNYi0shhsg.0 - operation-id: purchase_21a51537-3995-4974-a2d7-e6b87dadce2a - operation-location: /phoneNumbers/operations/purchase_21a51537-3995-4974-a2d7-e6b87dadce2a?api-version=2021-03-07 - purchase-id: 21a51537-3995-4974-a2d7-e6b87dadce2a + date: Fri, 05 Mar 2021 19:21:04 GMT + ms-cv: ef/N5CH/okSNClWcPT9ekw.0 + operation-id: purchase_a3e95dab-1aaf-4200-8fa8-85979ece7e1e + operation-location: /phoneNumbers/operations/purchase_a3e95dab-1aaf-4200-8fa8-85979ece7e1e?api-version=2021-03-07 + purchase-id: a3e95dab-1aaf-4200-8fa8-85979ece7e1e request-context: appId= - x-processing-time: 2201ms + x-processing-time: 2355ms status: code: 202 message: Accepted @@ -129,25 +128,25 @@ interactions: body: '' headers: Date: - - Fri, 05 Mar 2021 17:35:33 GMT + - Fri, 05 Mar 2021 19:21:34 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_21a51537-3995-4974-a2d7-e6b87dadce2a?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_a3e95dab-1aaf-4200-8fa8-85979ece7e1e?api-version=2021-03-07 response: body: string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": - "2021-03-05T17:34:28.9687105+00:00", "id": "sanitized", "operationType": "Purchase", + "2021-03-05T19:20:28.5356258+00:00", "id": "sanitized", "operationType": "Purchase", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: content-type: application/json; charset=utf-8 - date: Fri, 05 Mar 2021 17:35:34 GMT - ms-cv: RYddi1AflE69nYIk0rXmAQ.0 + date: Fri, 05 Mar 2021 19:21:35 GMT + ms-cv: NmjYIg/ffEuDwehvQ7gkSQ.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 491ms + x-processing-time: 454ms status: code: 200 message: OK @@ -158,7 +157,7 @@ interactions: Accept: - application/json Date: - - Fri, 05 Mar 2021 17:35:34 GMT + - Fri, 05 Mar 2021 19:21:34 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -171,15 +170,15 @@ interactions: headers: access-control-expose-headers: Operation-Location,operation-id,release-id content-length: '0' - date: Fri, 05 Mar 2021 17:35:35 GMT - ms-cv: jfGHX2rOTU+YERN3l8Gruw.0 - operation-id: release_f5bd3fc8-e53f-40f3-b63b-d66d68f76f40 - operation-location: /phoneNumbers/operations/release_f5bd3fc8-e53f-40f3-b63b-d66d68f76f40?api-version=2021-03-07 - release-id: f5bd3fc8-e53f-40f3-b63b-d66d68f76f40 + date: Fri, 05 Mar 2021 19:21:36 GMT + ms-cv: oS2wQRMnEECDd/jRqFeEOw.0 + operation-id: release_aaa3269b-3700-4a3b-9c50-144819dc842f + operation-location: /phoneNumbers/operations/release_aaa3269b-3700-4a3b-9c50-144819dc842f?api-version=2021-03-07 + release-id: aaa3269b-3700-4a3b-9c50-144819dc842f request-context: appId= - x-processing-time: 1503ms + x-processing-time: 834ms status: code: 202 message: Accepted - url: https://live-testing.communication.azure.com/phoneNumbers/%2B18447304825?api-version=2021-03-07 + url: https://live-testing.communication.azure.com/phoneNumbers/%2B18447309859?api-version=2021-03-07 version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml index 37907a99490f..88d2ce8e41d7 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml @@ -10,7 +10,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 05 Mar 2021 17:35:36 GMT + - Fri, 05 Mar 2021 19:21:35 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -23,13 +23,13 @@ interactions: headers: access-control-expose-headers: Location,Operation-Location,operation-id,search-id content-length: '0' - date: Fri, 05 Mar 2021 17:35:39 GMT - ms-cv: OtXGmscJ8EmKsbecqjaAag.0 - operation-id: search_7f99cec8-7846-4159-b200-3c536909c7da - operation-location: /phoneNumbers/operations/search_7f99cec8-7846-4159-b200-3c536909c7da?api-version=2021-03-07 + date: Fri, 05 Mar 2021 19:21:38 GMT + ms-cv: e110zEkQSU+9yXzr/zWfZw.0 + operation-id: search_9d8de051-26e1-42db-aa89-b9ceb39c0ea5 + operation-location: /phoneNumbers/operations/search_9d8de051-26e1-42db-aa89-b9ceb39c0ea5?api-version=2021-03-07 request-context: appId= - search-id: 7f99cec8-7846-4159-b200-3c536909c7da - x-processing-time: 2811ms + search-id: 9d8de051-26e1-42db-aa89-b9ceb39c0ea5 + x-processing-time: 2304ms status: code: 202 message: Accepted diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml index 676f2d9ff5b7..db8f5ec53692 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml @@ -9,7 +9,7 @@ interactions: Content-Type: - application/merge-patch+json Date: - - Fri, 05 Mar 2021 17:35:39 GMT + - Fri, 05 Mar 2021 19:21:38 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -18,18 +18,18 @@ interactions: uri: https://sanitized.communication.azure.com/phoneNumbers/sanitized/capabilities?api-version=2021-03-07 response: body: - string: '{"capabilitiesUpdateId": "162b8e8d-b692-41ab-bbf8-9fffd289710e"}' + string: '{"capabilitiesUpdateId": "df7429f7-1cb6-4dc2-a27f-125b8272e432"}' headers: access-control-expose-headers: Operation-Location,Location,operation-id,capabilities-id - capabilities-id: 162b8e8d-b692-41ab-bbf8-9fffd289710e + capabilities-id: df7429f7-1cb6-4dc2-a27f-125b8272e432 content-type: application/json; charset=utf-8 - date: Fri, 05 Mar 2021 17:35:40 GMT - ms-cv: xnZ+QUgohUWXJmu2IYvDAw.0 - operation-id: capabilities_162b8e8d-b692-41ab-bbf8-9fffd289710e - operation-location: /phoneNumbers/operations/capabilities_162b8e8d-b692-41ab-bbf8-9fffd289710e?api-version=2021-03-07 + date: Fri, 05 Mar 2021 19:21:39 GMT + ms-cv: 0UfLEuRBJkiWSMMLxdqKBA.0 + operation-id: capabilities_df7429f7-1cb6-4dc2-a27f-125b8272e432 + operation-location: /phoneNumbers/operations/capabilities_df7429f7-1cb6-4dc2-a27f-125b8272e432?api-version=2021-03-07 request-context: appId= transfer-encoding: chunked - x-processing-time: 1088ms + x-processing-time: 1063ms status: code: 202 message: Accepted diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index 891240a0227e..5bd21ad5c7d1 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -3,7 +3,7 @@ from azure.communication.phonenumbers import PhoneNumbersClient from _shared.testcase import CommunicationTestCase, ResponseReplacerProcessor, BodyReplacerProcessor from _shared.utils import create_token_credential -from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType +from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityType, PhoneNumberType from azure.communication.phonenumbers._shared.utils import parse_connection_str from phone_number_helper import PhoneNumberUriReplacer @@ -44,8 +44,8 @@ def test_get_phone_number(self): def test_search_available_phone_numbers(self): capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityValue.INBOUND, - sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + calling = PhoneNumberCapabilityType.INBOUND, + sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND ) poller = self.phone_number_client.begin_search_available_phone_numbers( self.country_code, @@ -59,8 +59,8 @@ def test_search_available_phone_numbers(self): def test_update_phone_number_capabilities(self): poller = self.phone_number_client.begin_update_phone_number_capabilities( self.phone_number, - PhoneNumberCapabilityValue.INBOUND_OUTBOUND, - PhoneNumberCapabilityValue.INBOUND, + PhoneNumberCapabilityType.INBOUND_OUTBOUND, + PhoneNumberCapabilityType.INBOUND, polling = True ) assert poller.result() @@ -68,8 +68,8 @@ def test_update_phone_number_capabilities(self): @pytest.mark.skipif(SKIP_PURCHASE_PHONE_NUMBER_TESTS, reason=PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON) def test_purchase_phone_numbers(self): capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityValue.INBOUND, - sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + calling = PhoneNumberCapabilityType.INBOUND, + sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND ) search_poller = self.phone_number_client.begin_search_available_phone_numbers( self.country_code, diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index dbea44a7db7d..75487e773064 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -4,7 +4,7 @@ from _shared.asynctestcase import AsyncCommunicationTestCase from _shared.testcase import ResponseReplacerProcessor, BodyReplacerProcessor from _shared.utils import create_token_credential -from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityValue, PhoneNumberType +from azure.communication.phonenumbers import PhoneNumberAssignmentType, PhoneNumberCapabilities, PhoneNumberCapabilityType, PhoneNumberType from azure.communication.phonenumbers._shared.utils import parse_connection_str from phone_number_helper import PhoneNumberUriReplacer @@ -23,7 +23,7 @@ def setUp(self): self.phone_number_client = PhoneNumbersClient.from_connection_string(self.connection_str) self.recording_processors.extend([ BodyReplacerProcessor( - keys=["id", "token", "phoneNumber"] + keys=["id", "token", "phoneNumber", "searchId"] ), PhoneNumberUriReplacer(), ResponseReplacerProcessor()]) @@ -58,8 +58,8 @@ async def test_get_phone_number(self): @AsyncCommunicationTestCase.await_prepared_test async def test_search_available_phone_numbers(self): capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityValue.INBOUND, - sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + calling = PhoneNumberCapabilityType.INBOUND, + sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND ) async with self.phone_number_client: poller = await self.phone_number_client.begin_search_available_phone_numbers( @@ -76,8 +76,8 @@ async def test_update_phone_number_capabilities(self): async with self.phone_number_client: poller = await self.phone_number_client.begin_update_phone_number_capabilities( self.phone_number, - PhoneNumberCapabilityValue.INBOUND_OUTBOUND, - PhoneNumberCapabilityValue.INBOUND, + PhoneNumberCapabilityType.INBOUND_OUTBOUND, + PhoneNumberCapabilityType.INBOUND, polling = True ) assert poller.result() @@ -86,8 +86,8 @@ async def test_update_phone_number_capabilities(self): @AsyncCommunicationTestCase.await_prepared_test async def test_purchase_phone_numbers(self): capabilities = PhoneNumberCapabilities( - calling = PhoneNumberCapabilityValue.INBOUND, - sms = PhoneNumberCapabilityValue.INBOUND_OUTBOUND + calling = PhoneNumberCapabilityType.INBOUND, + sms = PhoneNumberCapabilityType.INBOUND_OUTBOUND ) async with self.phone_number_client: search_poller = await self.phone_number_client.begin_search_available_phone_numbers( From b14ef4d2a5a05e1e92554718138b357592fc4508 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Fri, 5 Mar 2021 15:39:01 -0700 Subject: [PATCH 31/32] Added more sanitization --- .../test/phone_number_helper.py | 2 + ...stration_client.test_get_phone_number.yaml | 8 +- ...ient.test_list_acquired_phone_numbers.yaml | 10 +-- ...on_client.test_purchase_phone_numbers.yaml | 84 +++++++++--------- ...t.test_search_available_phone_numbers.yaml | 42 ++++----- ...test_update_phone_number_capabilities.yaml | 36 ++++---- ...on_client_async.test_get_phone_number.yaml | 8 +- ...sync.test_list_acquired_phone_numbers.yaml | 10 +-- ...ent_async.test_purchase_phone_numbers.yaml | 86 +++++++++---------- ...c.test_search_available_phone_numbers.yaml | 16 ++-- ...test_update_phone_number_capabilities.yaml | 16 ++-- ...test_phone_number_administration_client.py | 6 +- ...hone_number_administration_client_async.py | 8 +- 13 files changed, 167 insertions(+), 165 deletions(-) diff --git a/sdk/communication/azure-communication-phonenumbers/test/phone_number_helper.py b/sdk/communication/azure-communication-phonenumbers/test/phone_number_helper.py index dc68059352bb..970b73a467bf 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/phone_number_helper.py +++ b/sdk/communication/azure-communication-phonenumbers/test/phone_number_helper.py @@ -19,4 +19,6 @@ def process_response(self, response): response['url'] = re.sub('capabilities/([^/?&]+)', 'capabilities/sanitized', response['url']) response['url'] = re.sub('releases/([^/?&]+)', 'releases/sanitized', response['url']) response['url'] = re.sub('searches/([^/?&]+)', 'searches/sanitized', response['url']) + response['url'] = re.sub('phoneNumbers/[%2B\d]+', 'phoneNumbers/sanitized', response['url']) + response['url'] = re.sub('^(.*?)\.communication.azure.com', 'https://sanitized.communication.azure.com', response['url']) return response \ No newline at end of file diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml index 898673eacbed..542ecd2ce24e 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_get_phone_number.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 05 Mar 2021 19:17:51 GMT + - Fri, 05 Mar 2021 22:19:58 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -26,15 +26,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 19:17:53 GMT + - Fri, 05 Mar 2021 22:20:00 GMT ms-cv: - - EUrW0PP/LU+krc4gcF6lsQ.0 + - aa2xk97xc06kIOakrLVlZQ.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 1555ms + - 1617ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml index 414fffb4d360..949938277bd2 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_list_acquired_phone_numbers.yaml @@ -9,7 +9,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 05 Mar 2021 19:17:53 GMT + - Fri, 05 Mar 2021 22:20:00 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -31,7 +31,7 @@ interactions: "Application", "purchaseDate": "2020-11-30T17:51:21.2991518+00:00", "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": "18443281555", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": - "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "TollFree", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "purchaseDate": "2020-11-12T21:53:12.2088187+00:00", "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": "18445492606", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": @@ -42,15 +42,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 19:17:58 GMT + - Fri, 05 Mar 2021 22:20:04 GMT ms-cv: - - niTttbtcLEejKy6F2IYX3g.0 + - PcsdnL23aEGt6Y89OREU2w.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 4534ms + - 3504ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml index ec0a93bf7653..bc4181a1e29c 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_purchase_phone_numbers.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 05 Mar 2021 19:18:00 GMT + - Fri, 05 Mar 2021 22:37:27 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -30,19 +30,19 @@ interactions: content-length: - '0' date: - - Fri, 05 Mar 2021 19:18:04 GMT + - Fri, 05 Mar 2021 22:37:30 GMT ms-cv: - - 56e5zc+JAkSyPvMiakXNQQ.0 + - VhMuFqxihkaysW9imFiPuw.0 operation-id: - - search_1798f414-0bb8-419f-986c-f44c0d99c475 + - search_ffd97d84-b129-42bc-a61c-5017ad455ca9 operation-location: - - /phoneNumbers/operations/search_1798f414-0bb8-419f-986c-f44c0d99c475?api-version=2021-03-07 + - /phoneNumbers/operations/search_ffd97d84-b129-42bc-a61c-5017ad455ca9?api-version=2021-03-07 request-context: - appId= search-id: - - 1798f414-0bb8-419f-986c-f44c0d99c475 + - ffd97d84-b129-42bc-a61c-5017ad455ca9 x-processing-time: - - 3557ms + - 3134ms status: code: 202 message: Accepted @@ -56,17 +56,17 @@ interactions: Connection: - keep-alive Date: - - Fri, 05 Mar 2021 19:18:34 GMT + - Fri, 05 Mar 2021 22:38:00 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_1798f414-0bb8-419f-986c-f44c0d99c475?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_ffd97d84-b129-42bc-a61c-5017ad455ca9?api-version=2021-03-07 response: body: - string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/1798f414-0bb8-419f-986c-f44c0d99c475?api-version=2021-03-07", - "createdDateTime": "2021-03-05T19:18:03.9690504+00:00", "id": "sanitized", + string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/ffd97d84-b129-42bc-a61c-5017ad455ca9?api-version=2021-03-07", + "createdDateTime": "2021-03-05T22:37:30.7635903+00:00", "id": "sanitized", "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: access-control-expose-headers: @@ -74,15 +74,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 19:18:35 GMT + - Fri, 05 Mar 2021 22:38:01 GMT ms-cv: - - sFNNn28le0uiJ6ts4OZXhw.0 + - T3yVAofuCEuelpDd35xMKw.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 462ms + - 285ms status: code: 200 message: OK @@ -97,39 +97,39 @@ interactions: Connection: - keep-alive Date: - - Fri, 05 Mar 2021 19:18:34 GMT + - Fri, 05 Mar 2021 22:38:01 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/1798f414-0bb8-419f-986c-f44c0d99c475?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/ffd97d84-b129-42bc-a61c-5017ad455ca9?api-version=2021-03-07 response: body: - string: '{"searchId": "1798f414-0bb8-419f-986c-f44c0d99c475", "phoneNumbers": + string: '{"searchId": "ffd97d84-b129-42bc-a61c-5017ad455ca9", "phoneNumbers": ["sanitized"], "phoneNumberType": "TollFree", "assignmentType": "Application", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}, "searchExpiresBy": - "2021-03-05T19:34:09.3360252+00:00"}' + "2021-03-05T22:53:36.8689765+00:00"}' headers: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 19:18:36 GMT + - Fri, 05 Mar 2021 22:38:02 GMT ms-cv: - - twckNvyEv0+kDoJ16vIfqQ.0 + - jL4EmsUh2kOE79pfuKfEOg.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 978ms + - 1041ms status: code: 200 message: OK url: sanitized - request: - body: '{"searchId": "1798f414-0bb8-419f-986c-f44c0d99c475"}' + body: '{"searchId": "ffd97d84-b129-42bc-a61c-5017ad455ca9"}' headers: Accept: - application/json @@ -142,7 +142,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 05 Mar 2021 19:18:35 GMT + - Fri, 05 Mar 2021 22:38:02 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -158,19 +158,19 @@ interactions: content-length: - '0' date: - - Fri, 05 Mar 2021 19:18:38 GMT + - Fri, 05 Mar 2021 22:38:04 GMT ms-cv: - - dEWJXsmK5U+S1d+SW4xPLA.0 + - YScv4qTh00iygWp6FH6vVQ.0 operation-id: - - purchase_1798f414-0bb8-419f-986c-f44c0d99c475 + - purchase_ffd97d84-b129-42bc-a61c-5017ad455ca9 operation-location: - - /phoneNumbers/operations/purchase_1798f414-0bb8-419f-986c-f44c0d99c475?api-version=2021-03-07 + - /phoneNumbers/operations/purchase_ffd97d84-b129-42bc-a61c-5017ad455ca9?api-version=2021-03-07 purchase-id: - - 1798f414-0bb8-419f-986c-f44c0d99c475 + - ffd97d84-b129-42bc-a61c-5017ad455ca9 request-context: - appId= x-processing-time: - - 2193ms + - 1831ms status: code: 202 message: Accepted @@ -184,31 +184,31 @@ interactions: Connection: - keep-alive Date: - - Fri, 05 Mar 2021 19:19:08 GMT + - Fri, 05 Mar 2021 22:38:34 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_1798f414-0bb8-419f-986c-f44c0d99c475?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_ffd97d84-b129-42bc-a61c-5017ad455ca9?api-version=2021-03-07 response: body: string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": - "2021-03-05T19:18:03.9690504+00:00", "id": "sanitized", "operationType": "Purchase", + "2021-03-05T22:37:30.7635903+00:00", "id": "sanitized", "operationType": "Purchase", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 19:19:08 GMT + - Fri, 05 Mar 2021 22:38:34 GMT ms-cv: - - a8V5HwLBx0uJkiycA5HEMQ.0 + - XBQActeVX0OyNZznJoJlAA.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 449ms + - 427ms status: code: 200 message: OK @@ -225,7 +225,7 @@ interactions: Content-Length: - '0' Date: - - Fri, 05 Mar 2021 19:19:09 GMT + - Fri, 05 Mar 2021 22:38:34 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -241,19 +241,19 @@ interactions: content-length: - '0' date: - - Fri, 05 Mar 2021 19:19:10 GMT + - Fri, 05 Mar 2021 22:38:36 GMT ms-cv: - - gXwa83+iEUSNidCup9AaWQ.0 + - l3EH+DWVGU+VZvw9SFZx8g.0 operation-id: - - release_3b7c3afa-226a-436f-abc4-a6df95e73bd0 + - release_1e3b87e0-9991-41d8-ade7-cf7f26e7c00f operation-location: - - /phoneNumbers/operations/release_3b7c3afa-226a-436f-abc4-a6df95e73bd0?api-version=2021-03-07 + - /phoneNumbers/operations/release_1e3b87e0-9991-41d8-ade7-cf7f26e7c00f?api-version=2021-03-07 release-id: - - 3b7c3afa-226a-436f-abc4-a6df95e73bd0 + - 1e3b87e0-9991-41d8-ade7-cf7f26e7c00f request-context: - appId= x-processing-time: - - 1478ms + - 1331ms status: code: 202 message: Accepted diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml index a59f6a50c937..acccd805e6d9 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_search_available_phone_numbers.yaml @@ -14,7 +14,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 05 Mar 2021 19:19:10 GMT + - Fri, 05 Mar 2021 22:20:06 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -30,19 +30,19 @@ interactions: content-length: - '0' date: - - Fri, 05 Mar 2021 19:19:14 GMT + - Fri, 05 Mar 2021 22:20:10 GMT ms-cv: - - HI5oDtNjIkO9obcU02/TnA.0 + - lzRA3VrAnEC+gMwWY5/d5w.0 operation-id: - - search_dddfd575-b872-4290-8f82-908dbd22e800 + - search_c7deaed5-e41e-4fe5-91a6-a21e7210cbe4 operation-location: - - /phoneNumbers/operations/search_dddfd575-b872-4290-8f82-908dbd22e800?api-version=2021-03-07 + - /phoneNumbers/operations/search_c7deaed5-e41e-4fe5-91a6-a21e7210cbe4?api-version=2021-03-07 request-context: - appId= search-id: - - dddfd575-b872-4290-8f82-908dbd22e800 + - c7deaed5-e41e-4fe5-91a6-a21e7210cbe4 x-processing-time: - - 2886ms + - 4133ms status: code: 202 message: Accepted @@ -56,17 +56,17 @@ interactions: Connection: - keep-alive Date: - - Fri, 05 Mar 2021 19:19:43 GMT + - Fri, 05 Mar 2021 22:20:41 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_dddfd575-b872-4290-8f82-908dbd22e800?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_c7deaed5-e41e-4fe5-91a6-a21e7210cbe4?api-version=2021-03-07 response: body: - string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/dddfd575-b872-4290-8f82-908dbd22e800?api-version=2021-03-07", - "createdDateTime": "2021-03-05T19:19:13.5921044+00:00", "id": "sanitized", + string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/c7deaed5-e41e-4fe5-91a6-a21e7210cbe4?api-version=2021-03-07", + "createdDateTime": "2021-03-05T22:20:11.001373+00:00", "id": "sanitized", "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: access-control-expose-headers: @@ -74,15 +74,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 19:19:44 GMT + - Fri, 05 Mar 2021 22:20:41 GMT ms-cv: - - n8OjTIjg5kGrTDHhGhrZmw.0 + - AbkHLPOGRUirq1KzJ53Qlw.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 408ms + - 670ms status: code: 200 message: OK @@ -97,33 +97,33 @@ interactions: Connection: - keep-alive Date: - - Fri, 05 Mar 2021 19:19:44 GMT + - Fri, 05 Mar 2021 22:20:41 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/dddfd575-b872-4290-8f82-908dbd22e800?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/c7deaed5-e41e-4fe5-91a6-a21e7210cbe4?api-version=2021-03-07 response: body: - string: '{"searchId": "dddfd575-b872-4290-8f82-908dbd22e800", "phoneNumbers": + string: '{"searchId": "c7deaed5-e41e-4fe5-91a6-a21e7210cbe4", "phoneNumbers": ["sanitized"], "phoneNumberType": "TollFree", "assignmentType": "Application", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}, "searchExpiresBy": - "2021-03-05T19:35:19.6536336+00:00"}' + "2021-03-05T22:36:18.4979540+00:00"}' headers: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 19:19:45 GMT + - Fri, 05 Mar 2021 22:20:42 GMT ms-cv: - - sf39R20CXkGD39qtdJxuOA.0 + - Rn4DVw7s5UOVfiCFfiXCOQ.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 708ms + - 997ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml index 33316d6f0592..47a2ab186c0a 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client.test_update_phone_number_capabilities.yaml @@ -13,7 +13,7 @@ interactions: Content-Type: - application/merge-patch+json Date: - - Fri, 05 Mar 2021 19:19:45 GMT + - Fri, 05 Mar 2021 22:20:43 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -22,28 +22,28 @@ interactions: uri: https://sanitized.communication.azure.com/phoneNumbers/sanitized/capabilities?api-version=2021-03-07 response: body: - string: '{"capabilitiesUpdateId": "35ecf590-bfbc-415b-82ee-b7e9400204d6"}' + string: '{"capabilitiesUpdateId": "a8589969-1d09-4ad3-9b5a-39ce067ea535"}' headers: access-control-expose-headers: - Operation-Location,Location,operation-id,capabilities-id capabilities-id: - - 35ecf590-bfbc-415b-82ee-b7e9400204d6 + - a8589969-1d09-4ad3-9b5a-39ce067ea535 content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 19:19:46 GMT + - Fri, 05 Mar 2021 22:20:44 GMT ms-cv: - - /IaPskT6LUuEPttH/OvoVA.0 + - KjGZkSHB5kCrsxscH9ibgQ.0 operation-id: - - capabilities_35ecf590-bfbc-415b-82ee-b7e9400204d6 + - capabilities_a8589969-1d09-4ad3-9b5a-39ce067ea535 operation-location: - - /phoneNumbers/operations/capabilities_35ecf590-bfbc-415b-82ee-b7e9400204d6?api-version=2021-03-07 + - /phoneNumbers/operations/capabilities_a8589969-1d09-4ad3-9b5a-39ce067ea535?api-version=2021-03-07 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 1161ms + - 987ms status: code: 202 message: Accepted @@ -58,17 +58,17 @@ interactions: Connection: - keep-alive Date: - - Fri, 05 Mar 2021 19:20:16 GMT + - Fri, 05 Mar 2021 22:21:14 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/capabilities_35ecf590-bfbc-415b-82ee-b7e9400204d6?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/capabilities_a8589969-1d09-4ad3-9b5a-39ce067ea535?api-version=2021-03-07 response: body: string: '{"status": "Succeeded", "resourceLocation": "/phoneNumbers/+18332143261?api-version=2021-03-07", - "createdDateTime": "2021-03-05T19:19:46.5981586+00:00", "id": "sanitized", + "createdDateTime": "2021-03-05T22:20:44.5342481+00:00", "id": "sanitized", "operationType": "UpdatePhoneNumberCapabilities", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: access-control-expose-headers: @@ -76,15 +76,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 19:20:17 GMT + - Fri, 05 Mar 2021 22:21:14 GMT ms-cv: - - xV6axejo0k+QRdAH1Rk69Q.0 + - I5gz/NLH7kWVu9cfp44HpQ.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 281ms + - 254ms status: code: 200 message: OK @@ -99,7 +99,7 @@ interactions: Connection: - keep-alive Date: - - Fri, 05 Mar 2021 19:20:17 GMT + - Fri, 05 Mar 2021 22:21:14 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -116,15 +116,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 05 Mar 2021 19:20:18 GMT + - Fri, 05 Mar 2021 22:21:15 GMT ms-cv: - - Q3qXC9n6RE2l9LyykCWkZw.0 + - VbgvUURuDkyiQ4llLoXMPA.0 request-context: - appId= transfer-encoding: - chunked x-processing-time: - - 1272ms + - 1201ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml index 3bd5b1a0b46a..dbc6f9dcbe97 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_get_phone_number.yaml @@ -5,7 +5,7 @@ interactions: Accept: - application/json Date: - - Fri, 05 Mar 2021 19:20:18 GMT + - Fri, 05 Mar 2021 22:21:16 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -20,11 +20,11 @@ interactions: "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}' headers: content-type: application/json; charset=utf-8 - date: Fri, 05 Mar 2021 19:20:20 GMT - ms-cv: kFE1175CCUiKXQJad4Q+Rg.0 + date: Fri, 05 Mar 2021 22:21:18 GMT + ms-cv: jkDUEFxq6E2BFPuvbj9mvw.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 1840ms + x-processing-time: 1670ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml index 96b2d0f65c55..3ec83d977845 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_list_acquired_phone_numbers.yaml @@ -5,7 +5,7 @@ interactions: Accept: - application/json Date: - - Fri, 05 Mar 2021 19:20:20 GMT + - Fri, 05 Mar 2021 22:21:18 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -27,7 +27,7 @@ interactions: "Application", "purchaseDate": "2020-11-30T17:51:21.2991518+00:00", "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": "18443281555", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": - "TollFree", "capabilities": {"calling": "none", "sms": "inbound+outbound"}, + "TollFree", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "assignmentType": "Application", "purchaseDate": "2020-11-12T21:53:12.2088187+00:00", "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}, {"id": "18445492606", "phoneNumber": "sanitized", "countryCode": "US", "phoneNumberType": @@ -36,11 +36,11 @@ interactions: "cost": {"amount": 2.0, "currencyCode": "USD", "billingFrequency": "Monthly"}}]}' headers: content-type: application/json; charset=utf-8 - date: Fri, 05 Mar 2021 19:20:24 GMT - ms-cv: 7TF1eTJPIkGVQSU8gfRPpw.0 + date: Fri, 05 Mar 2021 22:21:22 GMT + ms-cv: US5P4qB/KEOB9kd4FEf70w.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 3266ms + x-processing-time: 4347ms status: code: 200 message: OK diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml index 84a0c65df6ba..3d0180913d84 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_purchase_phone_numbers.yaml @@ -10,7 +10,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 05 Mar 2021 19:20:25 GMT + - Fri, 05 Mar 2021 22:35:23 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -23,41 +23,41 @@ interactions: headers: access-control-expose-headers: Location,Operation-Location,operation-id,search-id content-length: '0' - date: Fri, 05 Mar 2021 19:20:28 GMT - ms-cv: hjxtjdPoZkS4HsFnBpk5Mg.0 - operation-id: search_a3e95dab-1aaf-4200-8fa8-85979ece7e1e - operation-location: /phoneNumbers/operations/search_a3e95dab-1aaf-4200-8fa8-85979ece7e1e?api-version=2021-03-07 + date: Fri, 05 Mar 2021 22:35:27 GMT + ms-cv: gRWIpKbT+kmke+2n5126eQ.0 + operation-id: search_bb432956-3ef1-4c0f-b5d9-b6879db9815e + operation-location: /phoneNumbers/operations/search_bb432956-3ef1-4c0f-b5d9-b6879db9815e?api-version=2021-03-07 request-context: appId= - search-id: a3e95dab-1aaf-4200-8fa8-85979ece7e1e - x-processing-time: 2925ms + search-id: bb432956-3ef1-4c0f-b5d9-b6879db9815e + x-processing-time: 3810ms status: code: 202 message: Accepted - url: https://live-testing.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 - request: body: '' headers: Date: - - Fri, 05 Mar 2021 19:20:58 GMT + - Fri, 05 Mar 2021 22:35:57 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_a3e95dab-1aaf-4200-8fa8-85979ece7e1e?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/search_bb432956-3ef1-4c0f-b5d9-b6879db9815e?api-version=2021-03-07 response: body: - string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/a3e95dab-1aaf-4200-8fa8-85979ece7e1e?api-version=2021-03-07", - "createdDateTime": "2021-03-05T19:20:28.5356258+00:00", "id": "sanitized", + string: '{"status": "Succeeded", "resourceLocation": "/availablePhoneNumbers/searchResults/bb432956-3ef1-4c0f-b5d9-b6879db9815e?api-version=2021-03-07", + "createdDateTime": "2021-03-05T22:35:27.2958238+00:00", "id": "sanitized", "operationType": "Search", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: access-control-expose-headers: Location content-type: application/json; charset=utf-8 - date: Fri, 05 Mar 2021 19:21:00 GMT - ms-cv: TxrrSSJpk0WOmMvHpfKF1g.0 + date: Fri, 05 Mar 2021 22:35:58 GMT + ms-cv: ATBr7EqjekGNk1Wb/IhNug.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 559ms + x-processing-time: 490ms status: code: 200 message: OK @@ -66,26 +66,26 @@ interactions: body: '' headers: Date: - - Fri, 05 Mar 2021 19:20:59 GMT + - Fri, 05 Mar 2021 22:35:58 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/a3e95dab-1aaf-4200-8fa8-85979ece7e1e?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/availablePhoneNumbers/searchResults/bb432956-3ef1-4c0f-b5d9-b6879db9815e?api-version=2021-03-07 response: body: string: '{"searchId": "sanitized", "phoneNumbers": ["sanitized"], "phoneNumberType": "TollFree", "assignmentType": "Application", "capabilities": {"calling": "inbound", "sms": "inbound+outbound"}, "cost": {"amount": 2.0, "currencyCode": "USD", - "billingFrequency": "Monthly"}, "searchExpiresBy": "2021-03-05T19:36:35.2621881+00:00"}' + "billingFrequency": "Monthly"}, "searchExpiresBy": "2021-03-05T22:51:34.5337238+00:00"}' headers: content-type: application/json; charset=utf-8 - date: Fri, 05 Mar 2021 19:21:02 GMT - ms-cv: qwgXAO6Yb0OQ+Iblp+k+0Q.0 + date: Fri, 05 Mar 2021 22:35:59 GMT + ms-cv: y12bsIrEV06zDF8jFb3ong.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 1822ms + x-processing-time: 1045ms status: code: 200 message: OK @@ -100,7 +100,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 05 Mar 2021 19:21:01 GMT + - Fri, 05 Mar 2021 22:35:59 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -113,40 +113,40 @@ interactions: headers: access-control-expose-headers: Operation-Location,operation-id,purchase-id content-length: '0' - date: Fri, 05 Mar 2021 19:21:04 GMT - ms-cv: ef/N5CH/okSNClWcPT9ekw.0 - operation-id: purchase_a3e95dab-1aaf-4200-8fa8-85979ece7e1e - operation-location: /phoneNumbers/operations/purchase_a3e95dab-1aaf-4200-8fa8-85979ece7e1e?api-version=2021-03-07 - purchase-id: a3e95dab-1aaf-4200-8fa8-85979ece7e1e + date: Fri, 05 Mar 2021 22:36:01 GMT + ms-cv: 4h5c14zJiE253OeHRw0Wsg.0 + operation-id: purchase_bb432956-3ef1-4c0f-b5d9-b6879db9815e + operation-location: /phoneNumbers/operations/purchase_bb432956-3ef1-4c0f-b5d9-b6879db9815e?api-version=2021-03-07 + purchase-id: bb432956-3ef1-4c0f-b5d9-b6879db9815e request-context: appId= - x-processing-time: 2355ms + x-processing-time: 2008ms status: code: 202 message: Accepted - url: https://live-testing.communication.azure.com/availablePhoneNumbers/:purchase?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/availablePhoneNumbers/:purchase?api-version=2021-03-07 - request: body: '' headers: Date: - - Fri, 05 Mar 2021 19:21:34 GMT + - Fri, 05 Mar 2021 22:36:31 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: - 'true' method: GET - uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_a3e95dab-1aaf-4200-8fa8-85979ece7e1e?api-version=2021-03-07 + uri: https://sanitized.communication.azure.com/phoneNumbers/operations/purchase_bb432956-3ef1-4c0f-b5d9-b6879db9815e?api-version=2021-03-07 response: body: string: '{"status": "Succeeded", "resourceLocation": null, "createdDateTime": - "2021-03-05T19:20:28.5356258+00:00", "id": "sanitized", "operationType": "Purchase", + "2021-03-05T22:35:27.2958238+00:00", "id": "sanitized", "operationType": "Purchase", "lastActionDateTime": "0001-01-01T00:00:00+00:00"}' headers: content-type: application/json; charset=utf-8 - date: Fri, 05 Mar 2021 19:21:35 GMT - ms-cv: NmjYIg/ffEuDwehvQ7gkSQ.0 + date: Fri, 05 Mar 2021 22:36:32 GMT + ms-cv: jhCr06bwNE+lcTBxGKenjA.0 request-context: appId= transfer-encoding: chunked - x-processing-time: 454ms + x-processing-time: 496ms status: code: 200 message: OK @@ -157,7 +157,7 @@ interactions: Accept: - application/json Date: - - Fri, 05 Mar 2021 19:21:34 GMT + - Fri, 05 Mar 2021 22:36:32 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -170,15 +170,15 @@ interactions: headers: access-control-expose-headers: Operation-Location,operation-id,release-id content-length: '0' - date: Fri, 05 Mar 2021 19:21:36 GMT - ms-cv: oS2wQRMnEECDd/jRqFeEOw.0 - operation-id: release_aaa3269b-3700-4a3b-9c50-144819dc842f - operation-location: /phoneNumbers/operations/release_aaa3269b-3700-4a3b-9c50-144819dc842f?api-version=2021-03-07 - release-id: aaa3269b-3700-4a3b-9c50-144819dc842f + date: Fri, 05 Mar 2021 22:36:34 GMT + ms-cv: YaASgzOV90Kwo1U5RYtDew.0 + operation-id: release_dd96b4c4-bc64-4728-9973-0d4ab4b6ba94 + operation-location: /phoneNumbers/operations/release_dd96b4c4-bc64-4728-9973-0d4ab4b6ba94?api-version=2021-03-07 + release-id: dd96b4c4-bc64-4728-9973-0d4ab4b6ba94 request-context: appId= - x-processing-time: 834ms + x-processing-time: 1258ms status: code: 202 message: Accepted - url: https://live-testing.communication.azure.com/phoneNumbers/%2B18447309859?api-version=2021-03-07 + url: https://sanitized.communication.azure.com/phoneNumbers/sanitized?api-version=2021-03-07 version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml index 88d2ce8e41d7..a544ea22a494 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_search_available_phone_numbers.yaml @@ -10,7 +10,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 05 Mar 2021 19:21:35 GMT + - Fri, 05 Mar 2021 22:21:24 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -23,15 +23,15 @@ interactions: headers: access-control-expose-headers: Location,Operation-Location,operation-id,search-id content-length: '0' - date: Fri, 05 Mar 2021 19:21:38 GMT - ms-cv: e110zEkQSU+9yXzr/zWfZw.0 - operation-id: search_9d8de051-26e1-42db-aa89-b9ceb39c0ea5 - operation-location: /phoneNumbers/operations/search_9d8de051-26e1-42db-aa89-b9ceb39c0ea5?api-version=2021-03-07 + date: Fri, 05 Mar 2021 22:21:26 GMT + ms-cv: GqHHQ9p7T06x81w+XWm1Rw.0 + operation-id: search_f29ce617-6079-4be4-b947-1832b96a93a2 + operation-location: /phoneNumbers/operations/search_f29ce617-6079-4be4-b947-1832b96a93a2?api-version=2021-03-07 request-context: appId= - search-id: 9d8de051-26e1-42db-aa89-b9ceb39c0ea5 - x-processing-time: 2304ms + search-id: f29ce617-6079-4be4-b947-1832b96a93a2 + x-processing-time: 2514ms status: code: 202 message: Accepted - url: https://live-testing.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 + url: sanitized.communication.azure.com/availablePhoneNumbers/countries/US/:search?api-version=2021-03-07 version: 1 diff --git a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml index db8f5ec53692..1871eac99f84 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml +++ b/sdk/communication/azure-communication-phonenumbers/test/recordings/test_phone_number_administration_client_async.test_update_phone_number_capabilities.yaml @@ -9,7 +9,7 @@ interactions: Content-Type: - application/merge-patch+json Date: - - Fri, 05 Mar 2021 19:21:38 GMT + - Fri, 05 Mar 2021 22:21:26 GMT User-Agent: - azsdk-python-communication-administration/1.0.0b4 Python/3.8.5 (Windows-10-10.0.19041-SP0) x-ms-return-client-request-id: @@ -18,18 +18,18 @@ interactions: uri: https://sanitized.communication.azure.com/phoneNumbers/sanitized/capabilities?api-version=2021-03-07 response: body: - string: '{"capabilitiesUpdateId": "df7429f7-1cb6-4dc2-a27f-125b8272e432"}' + string: '{"capabilitiesUpdateId": "d44aa3e8-32ba-4ee4-b887-842c24752059"}' headers: access-control-expose-headers: Operation-Location,Location,operation-id,capabilities-id - capabilities-id: df7429f7-1cb6-4dc2-a27f-125b8272e432 + capabilities-id: d44aa3e8-32ba-4ee4-b887-842c24752059 content-type: application/json; charset=utf-8 - date: Fri, 05 Mar 2021 19:21:39 GMT - ms-cv: 0UfLEuRBJkiWSMMLxdqKBA.0 - operation-id: capabilities_df7429f7-1cb6-4dc2-a27f-125b8272e432 - operation-location: /phoneNumbers/operations/capabilities_df7429f7-1cb6-4dc2-a27f-125b8272e432?api-version=2021-03-07 + date: Fri, 05 Mar 2021 22:21:27 GMT + ms-cv: ABRb4DZXnkOpl1LmEQgSmQ.0 + operation-id: capabilities_d44aa3e8-32ba-4ee4-b887-842c24752059 + operation-location: /phoneNumbers/operations/capabilities_d44aa3e8-32ba-4ee4-b887-842c24752059?api-version=2021-03-07 request-context: appId= transfer-encoding: chunked - x-processing-time: 1063ms + x-processing-time: 1084ms status: code: 202 message: Accepted diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index 5bd21ad5c7d1..e6935e71d857 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -10,9 +10,9 @@ SKIP_PURCHASE_PHONE_NUMBER_TESTS = True PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON = "Phone numbers shouldn't be purchased in live tests" -class PhoneNumbersAdministrationClientTest(CommunicationTestCase): +class PhoneNumbersClientTest(CommunicationTestCase): def setUp(self): - super(PhoneNumbersAdministrationClientTest, self).setUp() + super(PhoneNumbersClientTest, self).setUp() if self.is_playback(): self.phone_number = "sanitized" self.country_code = "US" @@ -80,6 +80,6 @@ def test_purchase_phone_numbers(self): ) phone_number_to_buy = search_poller.result() purchase_poller = self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) - assert purchase_poller.result() + purchase_poller.result() release_poller = self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_numbers[0]) assert release_poller.status() == 'succeeded' diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index 75487e773064..f7abb447a307 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -11,9 +11,9 @@ SKIP_PURCHASE_PHONE_NUMBER_TESTS = True PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON = "Phone numbers shouldn't be purchased in live tests" -class PhoneNumbersAdministrationClientTestAsync(AsyncCommunicationTestCase): +class PhoneNumbersClientTestAsync(AsyncCommunicationTestCase): def setUp(self): - super(PhoneNumbersAdministrationClientTestAsync, self).setUp() + super(PhoneNumbersClientTestAsync, self).setUp() if self.is_playback(): self.phone_number = "sanitized" self.country_code = "US" @@ -81,7 +81,7 @@ async def test_update_phone_number_capabilities(self): polling = True ) assert poller.result() - + @pytest.mark.skipif(SKIP_PURCHASE_PHONE_NUMBER_TESTS, reason=PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON) @AsyncCommunicationTestCase.await_prepared_test async def test_purchase_phone_numbers(self): @@ -99,6 +99,6 @@ async def test_purchase_phone_numbers(self): ) phone_number_to_buy = await search_poller.result() purchase_poller = await self.phone_number_client.begin_purchase_phone_numbers(phone_number_to_buy.search_id, polling=True) - assert await purchase_poller.result() + await purchase_poller.result() release_poller = await self.phone_number_client.begin_release_phone_number(phone_number_to_buy.phone_numbers[0]) assert release_poller.status() == 'succeeded' From 8b92a11e455f45d74a6ba57c3ad92a4af4f277e9 Mon Sep 17 00:00:00 2001 From: Jorge Beauregard Date: Fri, 5 Mar 2021 16:35:01 -0700 Subject: [PATCH 32/32] Disabling search tests --- .../test/test_phone_number_administration_client.py | 1 + .../test/test_phone_number_administration_client_async.py | 1 + 2 files changed, 2 insertions(+) diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py index e6935e71d857..f9becc7e332a 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client.py @@ -42,6 +42,7 @@ def test_get_phone_number(self): phone_number = self.phone_number_client.get_phone_number(self.phone_number) assert phone_number.phone_number == self.phone_number + @pytest.mark.skipif(SKIP_PURCHASE_PHONE_NUMBER_TESTS, reason=PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON) def test_search_available_phone_numbers(self): capabilities = PhoneNumberCapabilities( calling = PhoneNumberCapabilityType.INBOUND, diff --git a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py index f7abb447a307..ad74a2a1a284 100644 --- a/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py +++ b/sdk/communication/azure-communication-phonenumbers/test/test_phone_number_administration_client_async.py @@ -55,6 +55,7 @@ async def test_get_phone_number(self): phone_number = await self.phone_number_client.get_phone_number(self.phone_number) assert phone_number.phone_number == self.phone_number + @pytest.mark.skipif(SKIP_PURCHASE_PHONE_NUMBER_TESTS, reason=PURCHASE_PHONE_NUMBER_TEST_SKIP_REASON) @AsyncCommunicationTestCase.await_prepared_test async def test_search_available_phone_numbers(self): capabilities = PhoneNumberCapabilities(