Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
69fad2a
Number lookup ga (#37719)
ericasp16 Jan 29, 2024
460abbe
Merge branch 'main' into ericasp/number-lookup-ga-staging
ericasp16 Feb 2, 2024
5ab2972
update generated code
ericasp16 Feb 15, 2024
2e5bae7
update test recordings
ericasp16 Feb 22, 2024
c6dcf56
update package to beta version
ericasp16 Feb 22, 2024
4742713
update service version
ericasp16 Feb 22, 2024
5486811
fix build issues
ericasp16 Feb 22, 2024
688ed2f
Merge branch 'main' into convert-number-lookup-ga-to-preview
ericasp16 Feb 22, 2024
b0c5ef8
fix linting issue
ericasp16 Feb 22, 2024
fa64221
t statusMerge branch 'convert-number-lookup-ga-to-preview' of https:/…
ericasp16 Feb 22, 2024
6b6674d
update to address comments, restore unintentionally modified tests
ericasp16 Mar 7, 2024
05a84ea
restore unintentionally modified tests
ericasp16 Mar 7, 2024
c3e3c7a
Merge branch 'main' into convert-number-lookup-ga-to-preview
ericasp16 Mar 7, 2024
26fc884
restore unintentionally modified tests
ericasp16 Mar 7, 2024
8168d9f
Merge brt status
ericasp16 Mar 7, 2024
8b796fb
fix version_client
ericasp16 Mar 7, 2024
5b25f95
fix import statements
ericasp16 Mar 11, 2024
69cdcf3
update test files
ericasp16 Mar 11, 2024
fe45ae2
update test files
ericasp16 Mar 11, 2024
99fc1b8
update test files
ericasp16 Mar 11, 2024
7d83d13
update searchOperatorInformation tests to redact phone number
ericasp16 Mar 12, 2024
45aac94
update with latest tests
ericasp16 Mar 12, 2024
4118d60
update tests and recordings
ericasp16 Mar 12, 2024
0d54adc
update test files to redact phoneNumbers in request body for searchOp…
ericasp16 Mar 13, 2024
0c9c76c
remove setters on return type fields
ericasp16 Mar 13, 2024
6c257f3
update based on API view comments
ericasp16 Mar 13, 2024
1027aba
fix build errors
ericasp16 Mar 13, 2024
c2938f9
fix sanitizers, update test recordings
ericasp16 Mar 14, 2024
b8e617e
update based on PR comments
ericasp16 Mar 14, 2024
90982e9
fix errors
ericasp16 Mar 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Number lookup ga (#37719)
GA implementation of the number lookup feature.  This commit should cover the vast majority of the work needed, and is updated to incorporate feedback from the stewardship board.  These changes are going into a branch to wait until we're ready to do our final bug bashing and eventually merging and shipping the feature.

----------

* Implementation of Number Lookup feature for public preview in communication-phonenumbers (#35674)

* implementation of number lookup in java SDK

* fix readme to remove debug logging

* fix autorest generation swagger mismatch issue

* update autorest generation and yaml directives

* update service version

* fix public/private type generation, update changelog

* fix checkstyle issues

* update test recordings

* update test base to redact phonenumbers in operatorInformation response, update test recordings

* update changelog

* update date format for changelog

* Increment package versions for communication releases (#36670)

* fix imports in test file

* update auto-generated files

* implement ga updates

* removing edits to version_client.txt

* fix build errors

* attempt to fix versioning issue

* update based on SDK review

---------

Co-authored-by: Azure SDK Bot <[email protected]>
  • Loading branch information
ericasp16 and azure-sdk authored Jan 29, 2024
commit 69fad2a68590788da0ebf62f320dbf48437299e2
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# Release History

## 1.2.0-beta.1 (Unreleased)
## 1.2.0 (2024-03-01)

### Features Added
- Add support for number lookup
- Format only can be returned for no cost
- Additional number details can be returned for a cost

### Breaking Changes
## 1.2.0-beta.1 (2023-09-07)

### Bugs Fixed
### Features Added
- Number Lookup API public preview
- API version `2023-05-01-preview` is the default

### Other Changes

## 1.1.9 (2023-12-04)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "java",
"TagPrefix": "java/communication/azure-communication-phonenumbers",
"Tag": "java/communication/azure-communication-phonenumbers_154a5685d1"
"Tag": "java/communication/azure-communication-phonenumbers_04198d656b"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<groupId>com.azure</groupId>
<artifactId>azure-communication-phonenumbers</artifactId>
<packaging>jar</packaging>
<version>1.2.0-beta.1</version> <!-- {x-version-update;com.azure:azure-communication-phonenumbers;current} -->
<version>1.2.0</version> <!-- {x-version-update;com.azure:azure-communication-phonenumbers;current} -->

<name>Microsoft Azure client phone numbers library for communication</name>
<description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
import com.azure.communication.phonenumbers.implementation.models.PhoneNumbersReleasePhoneNumberResponse;
import com.azure.communication.phonenumbers.implementation.models.PhoneNumberCapabilitiesRequest;
import com.azure.communication.phonenumbers.implementation.models.PhoneNumbersUpdateCapabilitiesResponse;
import com.azure.communication.phonenumbers.implementation.models.OperatorInformationRequest;
import com.azure.communication.phonenumbers.implementation.models.OperatorInformationRequestOptions;
import com.azure.communication.phonenumbers.models.OperatorInformationResult;
import com.azure.communication.phonenumbers.models.PhoneNumberAreaCode;
import com.azure.communication.phonenumbers.models.PurchasedPhoneNumber;
import com.azure.communication.phonenumbers.models.ReleasePhoneNumberResult;
Expand Down Expand Up @@ -45,6 +48,7 @@
import reactor.core.publisher.Mono;

import java.time.Duration;
import java.util.List;
import java.util.Objects;
import java.util.function.BiFunction;
import java.util.function.Function;
Expand All @@ -61,15 +65,15 @@
*
* <!-- src_embed com.azure.communication.phonenumbers.asyncclient.instantiation
* -->
*
*
* <pre>
* PhoneNumbersAsyncClient phoneNumberAsyncClient = new PhoneNumbersClientBuilder&#40;&#41;
* .endpoint&#40;endpoint&#41;
* .credential&#40;keyCredential&#41;
* .httpClient&#40;httpClient&#41;
* .buildAsyncClient&#40;&#41;;
* </pre>
*
*
* <!-- end com.azure.communication.phonenumbers.asyncclient.instantiation -->
*
* @see PhoneNumbersClientBuilder
Expand Down Expand Up @@ -99,13 +103,13 @@ public final class PhoneNumbersAsyncClient {
*
* <!-- src_embed com.azure.communication.phonenumbers.asyncclient.getPurchased
* -->
*
*
* <pre>
* PurchasedPhoneNumber phoneNumber = phoneNumberAsyncClient.getPurchasedPhoneNumber&#40;&quot;+18001234567&quot;&#41;.block&#40;&#41;;
* System.out.println&#40;&quot;Phone Number Value: &quot; + phoneNumber.getPhoneNumber&#40;&#41;&#41;;
* System.out.println&#40;&quot;Phone Number Country Code: &quot; + phoneNumber.getCountryCode&#40;&#41;&#41;;
* </pre>
*
*
* <!-- end com.azure.communication.phonenumbers.asyncclient.getPurchased -->
*
* @param phoneNumber The phone number id in E.164 format. The leading plus can
Expand Down Expand Up @@ -133,15 +137,15 @@ public Mono<PurchasedPhoneNumber> getPurchasedPhoneNumber(String phoneNumber) {
*
* <!-- src_embed
* com.azure.communication.phonenumbers.asyncclient.getPurchasedWithResponse -->
*
*
* <pre>
* Response&lt;PurchasedPhoneNumber&gt; response = phoneNumberAsyncClient
* .getPurchasedPhoneNumberWithResponse&#40;&quot;+18001234567&quot;&#41;.block&#40;&#41;;
* PurchasedPhoneNumber phoneNumber = response.getValue&#40;&#41;;
* System.out.println&#40;&quot;Phone Number Value: &quot; + phoneNumber.getPhoneNumber&#40;&#41;&#41;;
* System.out.println&#40;&quot;Phone Number Country Code: &quot; + phoneNumber.getCountryCode&#40;&#41;&#41;;
* </pre>
*
*
* <!-- end
* com.azure.communication.phonenumbers.asyncclient.getPurchasedWithResponse -->
*
Expand Down Expand Up @@ -170,14 +174,14 @@ public Mono<Response<PurchasedPhoneNumber>> getPurchasedPhoneNumberWithResponse(
*
* <!-- src_embed com.azure.communication.phonenumbers.asyncclient.listPurchased
* -->
*
*
* <pre>
* PagedFlux&lt;PurchasedPhoneNumber&gt; phoneNumbers = phoneNumberAsyncClient.listPurchasedPhoneNumbers&#40;&#41;;
* PurchasedPhoneNumber phoneNumber = phoneNumbers.blockFirst&#40;&#41;;
* System.out.println&#40;&quot;Phone Number Value: &quot; + phoneNumber.getPhoneNumber&#40;&#41;&#41;;
* System.out.println&#40;&quot;Phone Number Country Code: &quot; + phoneNumber.getCountryCode&#40;&#41;&#41;;
* </pre>
*
*
* <!-- end com.azure.communication.phonenumbers.asyncclient.listPurchased -->
*
* @return A {@link PagedFlux} of {@link PurchasedPhoneNumber} instances
Expand All @@ -201,7 +205,7 @@ public PagedFlux<PurchasedPhoneNumber> listPurchasedPhoneNumbers() {
*
* <!-- src_embed
* com.azure.communication.phonenumbers.asyncclient.beginSearchAvailable -->
*
*
* <pre>
* PhoneNumberCapabilities capabilities = new PhoneNumberCapabilities&#40;&#41;
* .setCalling&#40;PhoneNumberCapabilityType.INBOUND&#41;
Expand All @@ -221,7 +225,7 @@ public PagedFlux<PurchasedPhoneNumber> listPurchasedPhoneNumbers() {
* System.out.println&#40;&quot;Phone number costs:&quot; + searchResult.getCost&#40;&#41;.getAmount&#40;&#41;&#41;;
* &#125;
* </pre>
*
*
* <!-- end
* com.azure.communication.phonenumbers.asyncclient.beginSearchAvailable -->
*
Expand Down Expand Up @@ -252,7 +256,7 @@ public PollerFlux<PhoneNumberOperation, PhoneNumberSearchResult> beginSearchAvai
* <!-- src_embed
* com.azure.communication.phonenumbers.asyncclient.beginSearchAvailableWithOptions
* -->
*
*
* <pre>
* PhoneNumberCapabilities capabilities = new PhoneNumberCapabilities&#40;&#41;
* .setCalling&#40;PhoneNumberCapabilityType.INBOUND&#41;
Expand All @@ -272,7 +276,7 @@ public PollerFlux<PhoneNumberOperation, PhoneNumberSearchResult> beginSearchAvai
* System.out.println&#40;&quot;Phone number costs:&quot; + searchResult.getCost&#40;&#41;.getAmount&#40;&#41;&#41;;
* &#125;
* </pre>
*
*
* <!-- end
* com.azure.communication.phonenumbers.asyncclient.beginSearchAvailableWithOptions
* -->
Expand Down Expand Up @@ -406,13 +410,13 @@ private Function<PollingContext<PhoneNumberOperation>, Mono<PhoneNumberSearchRes
*
* <!-- src_embed com.azure.communication.phonenumbers.asyncclient.beginPurchase
* -->
*
*
* <pre>
* AsyncPollResponse&lt;PhoneNumberOperation, PurchasePhoneNumbersResult&gt; purchaseResponse = phoneNumberAsyncClient
* .beginPurchasePhoneNumbers&#40;searchId&#41;.blockFirst&#40;&#41;;
* System.out.println&#40;&quot;Purchase phone numbers is complete: &quot; + purchaseResponse.getStatus&#40;&#41;&#41;;
* </pre>
*
*
* <!-- end com.azure.communication.phonenumbers.asyncclient.beginPurchase -->
*
* @param searchId ID of the search.
Expand Down Expand Up @@ -472,13 +476,13 @@ private Function<PollingContext<PhoneNumberOperation>, Mono<PhoneNumberOperation
*
* <!-- src_embed com.azure.communication.phonenumbers.asyncclient.beginRelease
* -->
*
*
* <pre>
* AsyncPollResponse&lt;PhoneNumberOperation, ReleasePhoneNumberResult&gt; releaseResponse = phoneNumberAsyncClient
* .beginReleasePhoneNumber&#40;&quot;+18001234567&quot;&#41;.blockFirst&#40;&#41;;
* System.out.println&#40;&quot;Release phone number is complete: &quot; + releaseResponse.getStatus&#40;&#41;&#41;;
* </pre>
*
*
* <!-- end com.azure.communication.phonenumbers.asyncclient.beginRelease -->
*
* @param phoneNumber The phone number id in E.164 format. The leading plus can
Expand Down Expand Up @@ -534,7 +538,7 @@ private Function<PollingContext<PhoneNumberOperation>, Mono<PhoneNumberOperation
*
* <!-- src_embed
* com.azure.communication.phonenumbers.asyncclient.beginUpdateCapabilities -->
*
*
* <pre>
* PhoneNumberCapabilities capabilities = new PhoneNumberCapabilities&#40;&#41;;
* capabilities
Expand All @@ -551,7 +555,7 @@ private Function<PollingContext<PhoneNumberOperation>, Mono<PhoneNumberOperation
* System.out.println&#40;&quot;Phone Number SMS capabilities: &quot; + phoneNumber.getCapabilities&#40;&#41;.getSms&#40;&#41;&#41;;
* &#125;
* </pre>
*
*
* <!-- end
* com.azure.communication.phonenumbers.asyncclient.beginUpdateCapabilities -->
*
Expand Down Expand Up @@ -715,6 +719,36 @@ public PagedFlux<PhoneNumberOffering> listAvailableOfferings(String countryCode,
}
}

/**
* Searches for operator information for a given list of phone numbers.
*
* @param phoneNumbers The phone number(s) whose operator information should be searched.
*
* @return A {@link OperatorInformationResult} which contains the results of the search.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<OperatorInformationResult> searchOperatorInformation(List<String> phoneNumbers) {
return this.searchOperatorInformation(phoneNumbers, false);
}

/**
* Searches for operator information for a given list of phone numbers.
*
* @param phoneNumbers The phone number(s) whose operator information should be searched.
* @param includeAdditionalPhoneAndOperatorDetails Modifies the search to include additional fields in the response.
* Please note: use of this option will affect the cost of the search.
*
* @return A {@link OperatorInformationResult} which contains the results of the search.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<OperatorInformationResult>> searchOperatorInformationWithResponse(List<String> phoneNumbers, boolean includeAdditionalPhoneAndOperatorDetails) {
OperatorInformationRequest request = new OperatorInformationRequest();
request.setPhoneNumbers(phoneNumbers);
request.setOptions(new OperatorInformationRequestOptions().setIncludeAdditionalPhoneAndOperatorDetails(includeAdditionalPhoneAndOperatorDetails));
return client.operatorInformationSearchWithResponseAsync(request)
.onErrorMap(CommunicationErrorResponseException.class, e -> translateException(e));
}

private Mono<PhoneNumberOperation> getOperation(String operationId) {
return client.getOperationAsync(operationId)
.onErrorMap(CommunicationErrorResponseException.class, e -> translateException(e))
Expand Down
Loading