@@ -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 }
0 commit comments