Skip to content

Commit 1220839

Browse files
authored
Changed siprouting SDK to GA version. (Azure#33925)
* Changed siprouting SDK to GA version. * Updated CHANGELOG.md * Fixing pr comments. * Updated changelog. * Clearing changelog.
1 parent ea2ebfe commit 1220839

File tree

136 files changed

+4947
-4787
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+4947
-4787
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## 1.1.0-beta.15 (2023-03-15)
44

5+
### Features Added
6+
- Added support for SIP routing API version `2023-03-01`, releasing SIP routing functionality from public preview to GA.
7+
- Added environment variable `AZURE_TEST_DOMAIN` for SIP routing tests to support domain verification.
8+
59
### Other Changes
610

711
#### Dependency Updates

sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/SipRoutingAsyncClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,22 +415,22 @@ public Mono<Response<Void>> deleteTrunkWithResponse(String fqdn) {
415415
}
416416

417417
private Mono<SipConfiguration> getSipConfiguration() {
418-
return client.getSipConfigurationAsync()
418+
return client.getSipRoutings().getAsync()
419419
.onErrorMap(CommunicationErrorResponseException.class, this::translateException);
420420
}
421421

422422
private Mono<Response<SipConfiguration>> getSipConfigurationWithResponse() {
423-
return client.getSipConfigurationWithResponseAsync()
423+
return client.getSipRoutings().getWithResponseAsync()
424424
.onErrorMap(CommunicationErrorResponseException.class, this::translateException);
425425
}
426426

427427
private Mono<SipConfiguration> setSipConfiguration(SipConfiguration update) {
428-
return client.patchSipConfigurationAsync(update)
428+
return client.getSipRoutings().updateAsync(update)
429429
.onErrorMap(CommunicationErrorResponseException.class, this::translateException);
430430
}
431431

432432
private Mono<Response<SipConfiguration>> setSipConfigurationWithResponse(SipConfiguration update) {
433-
return client.patchSipConfigurationWithResponseAsync(update)
433+
return client.getSipRoutings().updateWithResponseAsync(update)
434434
.onErrorMap(CommunicationErrorResponseException.class, this::translateException);
435435
}
436436

sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/SipRoutingClient.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public SipTrunk getTrunk(String fqdn) {
9393
*/
9494
@ServiceMethod(returns = ReturnType.SINGLE)
9595
public Response<SipTrunk> getTrunkWithResponse(String fqdn, Context context) {
96-
return client.getSipConfigurationWithResponseAsync(context)
96+
return client.getSipRoutings().getWithResponseAsync(context)
9797
.onErrorMap(CommunicationErrorResponseException.class, this::translateException)
9898
.map(result -> new SimpleResponse<>(result, convertFromApi(result.getValue().getTrunks()).stream()
9999
.filter(sipTrunk -> fqdn.equals(sipTrunk.getFqdn())).findAny().orElse(null)))
@@ -141,7 +141,7 @@ public List<SipTrunk> listTrunks() {
141141
*/
142142
@ServiceMethod(returns = ReturnType.SINGLE)
143143
public Response<List<SipTrunk>> listTrunksWithResponse(Context context) {
144-
return client.getSipConfigurationWithResponseAsync(context)
144+
return client.getSipRoutings().getWithResponseAsync(context)
145145
.onErrorMap(CommunicationErrorResponseException.class, this::translateException)
146146
.map(result -> new SimpleResponse<>(result, convertFromApi(result.getValue().getTrunks())))
147147
.block();
@@ -194,7 +194,7 @@ public List<SipTrunkRoute> listRoutes() {
194194
*/
195195
@ServiceMethod(returns = ReturnType.SINGLE)
196196
public Response<List<SipTrunkRoute>> listRoutesWithResponse(Context context) {
197-
return client.getSipConfigurationWithResponseAsync(context)
197+
return client.getSipRoutings().getWithResponseAsync(context)
198198
.onErrorMap(CommunicationErrorResponseException.class, this::translateException)
199199
.map(result -> new SimpleResponse<>(result, convertFromApi(result.getValue().getRoutes())))
200200
.block();
@@ -218,7 +218,7 @@ public Response<List<SipTrunkRoute>> listRoutesWithResponse(Context context) {
218218
public void setTrunk(SipTrunk trunk) {
219219
Map<String, com.azure.communication.phonenumbers.siprouting.implementation.models.SipTrunk> trunks = new HashMap<>();
220220
trunks.put(trunk.getFqdn(), convertToApi(trunk));
221-
client.patchSipConfigurationWithResponseAsync(new SipConfiguration().setTrunks(trunks))
221+
client.getSipRoutings().updateWithResponseAsync(new SipConfiguration().setTrunks(trunks))
222222
.onErrorMap(CommunicationErrorResponseException.class, this::translateException)
223223
.block();
224224
}
@@ -285,7 +285,7 @@ public Response<Void> setTrunksWithResponse(List<SipTrunk> trunks, Context conte
285285
}
286286

287287
if (!update.getTrunks().isEmpty()) {
288-
return client.patchSipConfigurationWithResponseAsync(update, context)
288+
return client.getSipRoutings().updateWithResponseAsync(update, context)
289289
.onErrorMap(CommunicationErrorResponseException.class, this::translateException)
290290
.map(result -> new SimpleResponse<Void>(result, null))
291291
.block();
@@ -335,7 +335,7 @@ public void setRoutes(List<SipTrunkRoute> routes) {
335335
*/
336336
@ServiceMethod(returns = ReturnType.SINGLE)
337337
public Response<Void> setRoutesWithResponse(List<SipTrunkRoute> routes, Context context) {
338-
return client.patchSipConfigurationWithResponseAsync(new SipConfiguration().setRoutes(convertToApi(routes)), context)
338+
return client.getSipRoutings().updateWithResponseAsync(new SipConfiguration().setRoutes(convertToApi(routes)), context)
339339
.onErrorMap(CommunicationErrorResponseException.class, this::translateException)
340340
.map(result -> new SimpleResponse<Void>(result, null))
341341
.block();
@@ -364,7 +364,7 @@ public void deleteTrunk(String fqdn) {
364364
if (!deletedTrunks.isEmpty()) {
365365
Map<String, com.azure.communication.phonenumbers.siprouting.implementation.models.SipTrunk> trunksUpdate = new HashMap<>();
366366
trunksUpdate.put(fqdn, null);
367-
client.patchSipConfigurationWithResponseAsync(new SipConfiguration().setTrunks(trunksUpdate))
367+
client.getSipRoutings().updateWithResponseAsync(new SipConfiguration().setTrunks(trunksUpdate))
368368
.onErrorMap(CommunicationErrorResponseException.class, this::translateException)
369369
.block();
370370
}
@@ -394,21 +394,21 @@ public Response<Void> deleteTrunkWithResponse(String fqdn, Context context) {
394394
if (!deletedTrunks.isEmpty()) {
395395
Map<String, com.azure.communication.phonenumbers.siprouting.implementation.models.SipTrunk> trunksUpdate = new HashMap<>();
396396
trunksUpdate.put(fqdn, null);
397-
return client.patchSipConfigurationWithResponseAsync(new SipConfiguration().setTrunks(trunksUpdate), context)
397+
return client.getSipRoutings().updateWithResponseAsync(new SipConfiguration().setTrunks(trunksUpdate), context)
398398
.onErrorMap(CommunicationErrorResponseException.class, this::translateException)
399399
.map(result -> new SimpleResponse<Void>(result, null)).block();
400400
}
401401
return new SimpleResponse<>(null, 200, null, null);
402402
}
403403

404404
private SipConfiguration getSipConfiguration() {
405-
return client.getSipConfigurationAsync()
405+
return client.getSipRoutings().getAsync()
406406
.onErrorMap(CommunicationErrorResponseException.class, this::translateException)
407407
.block();
408408
}
409409

410410
private SipConfiguration setSipConfiguration(SipConfiguration update) {
411-
return client.patchSipConfigurationAsync(update)
411+
return client.getSipRoutings().updateAsync(update)
412412
.onErrorMap(CommunicationErrorResponseException.class, this::translateException)
413413
.block();
414414
}

sdk/communication/azure-communication-phonenumbers/src/main/java/com/azure/communication/phonenumbers/SipRoutingServiceVersion.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
*/
1111
public enum SipRoutingServiceVersion implements ServiceVersion {
1212
/**
13-
* Service version {@code 2021-05-01-preview}.
13+
* Service version {@code 2023-03-01}.
1414
*/
15-
V2021_05_01_PREVIEW("2021-05-01-preview");
15+
V2023_03_01("2023-03-01");
1616

1717
private final String version;
1818

@@ -34,6 +34,6 @@ public String getVersion() {
3434
* @return the latest {@link SipRoutingServiceVersion}
3535
*/
3636
public static SipRoutingServiceVersion getLatest() {
37-
return V2021_05_01_PREVIEW;
37+
return V2023_03_01;
3838
}
3939
}

0 commit comments

Comments
 (0)