-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[Communication] - Phone Numbers - Phone Numbers Redesign #19109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
f2fe9e2
Initial phone number redesign
cf86559
Update names
bc25390
WIP
ab99d3b
Setting some models as internal
261def1
Extracting phone numbers from administration package
239095a
Updating README and CHANGELOG
0a52622
Update README
6fb879f
Address code review comments
8933812
Basic code implementation complete
c707e9b
Cleanup
5e34445
Search Available LRO
4347c30
Complete the rest of the LROs
2de2008
live tests for async client
494b859
Added tests for sync clients
a4de716
Add swagger transforms
f8ce7c8
Adding documents
58ac3fd
Updating swagger changes
b737a7c
Add to versioning
ff7dfae
Fixing test sanitization
9d52442
Address code review comments
a85bb1c
Addressing code review comments for versioning
9100ad8
Fix build
27edd11
Fix build
6b3da61
Updating readme
60eb928
Swagger update WIP
ae42c62
Fix recordings for new swagger
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Address code review comments
- Loading branch information
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,6 +56,7 @@ public final class PhoneNumbersAsyncClient { | |
| * @param phoneNumber The phone number id in E.164 format. The leading plus can be either + or encoded | ||
| * as %2B. | ||
| * @return {@link AcquiredPhoneNumber} representing the acquired telephone number. | ||
|
||
| * @throws NullPointerException if {@code phoneNumber} is null. | ||
| */ | ||
| @ServiceMethod(returns = ReturnType.SINGLE) | ||
| public Mono<AcquiredPhoneNumber> getPhoneNumber(String phoneNumber) { | ||
|
|
@@ -72,6 +73,7 @@ public Mono<AcquiredPhoneNumber> getPhoneNumber(String phoneNumber) { | |
| * @param phoneNumber The phone number id in E.164 format. The leading plus can be either + or encoded | ||
| * as %2B. | ||
| * @return {@link AcquiredPhoneNumber} representing the acquired telephone number. | ||
| * @throws NullPointerException if {@code phoneNumber} is null. | ||
| */ | ||
| @ServiceMethod(returns = ReturnType.SINGLE) | ||
| public Mono<Response<AcquiredPhoneNumber>> getPhoneNumberWithResponse(String phoneNumber) { | ||
|
|
@@ -102,16 +104,16 @@ public PagedFlux<AcquiredPhoneNumber> listPhoneNumbers() { | |
| * | ||
| * @param phoneNumber The phone number id in E.164 format. The leading plus can be either + or encoded | ||
| * as %2B. | ||
| * @param update Update to an acquired phone number. | ||
| * @return A {@link Mono} containing | ||
| * a {@link AcquiredPhoneNumber} representing the acquired phone number | ||
| * @param updateRequest Update request to an acquired phone number. | ||
| * @return A {@link Mono} containing a {@link AcquiredPhoneNumber} representing the acquired phone number | ||
| * @throws NullPointerException if {@code phoneNumber} or {@code updateRequest} is null. | ||
| */ | ||
| @ServiceMethod(returns = ReturnType.SINGLE) | ||
| public Mono<AcquiredPhoneNumber> updatePhoneNumber(String phoneNumber, PhoneNumberUpdateRequest update) { | ||
| public Mono<AcquiredPhoneNumber> updatePhoneNumber(String phoneNumber, PhoneNumberUpdateRequest updateRequest) { | ||
| try { | ||
| Objects.requireNonNull(phoneNumber, "'phoneNumber' cannot be null."); | ||
| Objects.requireNonNull(update, "'update' cannot be null."); | ||
| return client.updateAsync(phoneNumber, update); | ||
| Objects.requireNonNull(updateRequest, "'updateRequest' cannot be null."); | ||
| return client.updateAsync(phoneNumber, updateRequest); | ||
| } catch (RuntimeException ex) { | ||
| return monoError(logger, ex); | ||
| } | ||
|
|
@@ -123,17 +125,17 @@ public Mono<AcquiredPhoneNumber> updatePhoneNumber(String phoneNumber, PhoneNumb | |
| * | ||
| * @param phoneNumber The phone number id in E.164 format. The leading plus can be either + or encoded | ||
| * as %2B. | ||
| * @param update Update to an acquired phone number. | ||
| * @return A {@link Mono} containing | ||
| * a {@link AcquiredPhoneNumber} representing the acquired phone number | ||
| * @param updateRequest Update request to an acquired phone number. | ||
| * @return A {@link Mono} containing a {@link AcquiredPhoneNumber} representing the acquired phone number | ||
| * @throws NullPointerException if {@code phoneNumber} or {@code updateRequest} is null. | ||
| */ | ||
| @ServiceMethod(returns = ReturnType.SINGLE) | ||
| public Mono<Response<AcquiredPhoneNumber>> | ||
| updatePhoneNumberWithResponse(String phoneNumber, PhoneNumberUpdateRequest update) { | ||
| updatePhoneNumberWithResponse(String phoneNumber, PhoneNumberUpdateRequest updateRequest) { | ||
| try { | ||
| Objects.requireNonNull(phoneNumber, "'phoneNumber' cannot be null."); | ||
| Objects.requireNonNull(update, "'update' cannot be null."); | ||
| return client.updateWithResponseAsync(phoneNumber, update); | ||
| Objects.requireNonNull(updateRequest, "'updateRequest' cannot be null."); | ||
| return client.updateWithResponseAsync(phoneNumber, updateRequest); | ||
| } catch (RuntimeException ex) { | ||
| return monoError(logger, ex); | ||
| } | ||
|
|
@@ -146,6 +148,7 @@ public Mono<AcquiredPhoneNumber> updatePhoneNumber(String phoneNumber, PhoneNumb | |
| * @param searchRequest {@link PhoneNumberSearchRequest} specifying the search request | ||
| * until it gets a result from the server | ||
| * @return A {@link PollerFlux} object with the reservation result | ||
| * @throws NullPointerException if {@code countryCode} or {@code searchRequest} is null. | ||
| */ | ||
| @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) | ||
| public PollerFlux<PhoneNumberOperation, PhoneNumberSearchResult> beginSearchAvailablePhoneNumbers( | ||
|
|
@@ -188,9 +191,10 @@ PollerFlux<PhoneNumberOperation, PhoneNumberSearchResult> beginSearchAvailablePh | |
| } | ||
|
|
||
| private String parseIdFromUrl(String url) { | ||
| Objects.requireNonNull(url, "'url' cannot be null."); | ||
| String[] items = url.split("/"); | ||
| String id = items[items.length - 1]; | ||
| return id.substring(0, id.indexOf("?")); | ||
| return id.substring(0, Math.min(id.indexOf("?"), id.length())); | ||
| } | ||
|
|
||
| private Function<PollingContext<PhoneNumberOperation>, Mono<PollResponse<PhoneNumberOperation>>> | ||
|
|
@@ -242,6 +246,7 @@ private String parseIdFromUrl(String url) { | |
| * | ||
| * @param searchId ID of the search | ||
| * @return A {@link PollerFlux} object. | ||
| * @throws NullPointerException if {@code searchId} is null. | ||
| */ | ||
| @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) | ||
| public PollerFlux<PhoneNumberOperation, Void> beginPurchasePhoneNumbers(String searchId) { | ||
|
|
@@ -282,11 +287,10 @@ PollerFlux<PhoneNumberOperation, Void> beginPurchasePhoneNumbers(String searchId | |
| * | ||
| * This function returns a Long Running Operation poller that allows you to wait indefinitely until the | ||
| * operation is complete. | ||
| * | ||
| * | ||
| * @param phoneNumber The phone number id in E.164 format. The leading plus can be either + or encoded | ||
| * as %2B. | ||
| * @return A {@link PollerFlux} object. | ||
| * @throws NullPointerException if {@code phoneNumber} is null. | ||
| */ | ||
| @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) | ||
| public PollerFlux<PhoneNumberOperation, Void> beginReleasePhoneNumber(String phoneNumber) { | ||
|
|
@@ -327,7 +331,8 @@ PollerFlux<PhoneNumberOperation, Void> beginReleasePhoneNumber(String phoneNumbe | |
| * @param phoneNumber The phone number id in E.164 format. The leading plus can be either + or encoded | ||
| * as %2B. | ||
| * @param capabilitiesUpdateRequest Update capabilities of an acquired phone number. | ||
| * @return A {@link PollerFlux} object | ||
| * @return A {@link PollerFlux} object. | ||
| * @throws NullPointerException if {@code phoneNumber} or {@code capabilitiesUpdateRequest} is null. | ||
| */ | ||
| @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) | ||
| public PollerFlux<PhoneNumberOperation, AcquiredPhoneNumber> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.