Skip to content

Commit 35b9277

Browse files
authored
[Communication] Phone Number Administration: Rename list_all_orders -> list_all_reservations (Azure#15550)
* list_all_orders -> list_all_reservations * update CHANGELOG * flip SKIP_PHONE_NUMBER_TESTS boolean back * update comment in async list_all_reservations
1 parent 96efd25 commit 35b9277

File tree

5 files changed

+22
-4
lines changed

5 files changed

+22
-4
lines changed

sdk/communication/azure-communication-administration/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Caller must provide one of the following:
1111
(2) all of keywords `display_name`, `description`, `phone_plan_ids`, `area_code`, `quantity`, `location_options`
1212
if at least one phone plan to reserve is not toll-free plans.
1313
(3) only keyword `continuation_token` to restart a poller from a saved state.
14+
- `list_all_orders` renamed to `list_all_reservations`.
1415

1516
## 1.0.0b3 (2020-11-16)
1617

sdk/communication/azure-communication-administration/azure/communication/administration/_phone_number_administration_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,12 +514,12 @@ def begin_reserve_phone_numbers(
514514
polling_method=reservation_polling)
515515

516516
@distributed_trace
517-
def list_all_searches(
517+
def list_all_reservations(
518518
self,
519519
**kwargs # type: Any
520520
):
521521
# type: (...) -> ItemPaged[PhoneNumberEntities]
522-
"""Gets a list of all searches.
522+
"""Gets a list of all reservations.
523523
524524
:keyword int skip: An optional parameter for how many entries to skip, for pagination purposes.
525525
The default is 0.

sdk/communication/azure-communication-administration/azure/communication/administration/aio/_phone_number_administration_client_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,12 +523,12 @@ async def begin_reserve_phone_numbers(
523523
polling_method=reservation_polling)
524524

525525
@distributed_trace
526-
def list_all_searches(
526+
def list_all_reservations(
527527
self,
528528
**kwargs # type: Any
529529
):
530530
# type: (...) -> AsyncItemPaged[PhoneNumberEntities]
531-
"""Gets a list of all searches.
531+
"""Gets a list of all reservations.
532532
533533
:keyword int skip: An optional parameter for how many entries to skip, for pagination purposes.
534534
The default is 0.

sdk/communication/azure-communication-administration/tests/test_phone_number_administration_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,3 +274,9 @@ def test_purchase_reservation(self):
274274
reservation_id=self.reservation_id_to_purchase
275275
)
276276
assert poller.result()
277+
278+
@pytest.mark.live_test_only
279+
@pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON)
280+
def test_list_reservations(self):
281+
pages = self._phone_number_administration_client.list_all_reservations()
282+
assert pages.next()

sdk/communication/azure-communication-administration/tests/test_phone_number_administration_client_async.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,3 +335,14 @@ async def test_purchase_reservation(self):
335335
)
336336
result = await poller.result()
337337
assert result
338+
339+
@AsyncPhoneNumberCommunicationTestCase.await_prepared_test
340+
@pytest.mark.live_test_only
341+
@pytest.mark.skipif(SKIP_PHONE_NUMBER_TESTS, reason=PHONE_NUMBER_TEST_SKIP_REASON)
342+
async def test_list_reservations(self):
343+
async with self._phone_number_administration_client:
344+
pages = self._phone_number_administration_client.list_all_reservations()
345+
items = []
346+
async for item in pages:
347+
items.append(item)
348+
assert len(items) > 0

0 commit comments

Comments
 (0)