@azure/communication-phone-numbers 1.5.0-beta.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/dist/browser/generated/src/lroImpl.js +7 -3
  2. package/dist/browser/generated/src/lroImpl.js.map +1 -1
  3. package/dist/browser/generated/src/operations/phoneNumbers.js +219 -296
  4. package/dist/browser/generated/src/operations/phoneNumbers.js.map +1 -1
  5. package/dist/browser/generated/src/pagingHelper.js +2 -4
  6. package/dist/browser/generated/src/pagingHelper.js.map +1 -1
  7. package/dist/browser/generated/src/phoneNumbersClient.js +11 -4
  8. package/dist/browser/generated/src/phoneNumbersClient.js.map +1 -1
  9. package/dist/browser/generated/src/siprouting/operations/sipRouting.js +1 -0
  10. package/dist/browser/generated/src/siprouting/operations/sipRouting.js.map +1 -1
  11. package/dist/browser/generated/src/siprouting/sipRoutingClient.js +1 -0
  12. package/dist/browser/generated/src/siprouting/sipRoutingClient.js.map +1 -1
  13. package/dist/browser/generated/src/siprouting/sipRoutingClientContext.js +10 -3
  14. package/dist/browser/generated/src/siprouting/sipRoutingClientContext.js.map +1 -1
  15. package/dist/browser/generated/src/tracing.js +1 -1
  16. package/dist/browser/generated/src/tracing.js.map +1 -1
  17. package/dist/browser/phoneNumbersClient.d.ts +1 -1
  18. package/dist/browser/phoneNumbersClient.js +86 -28
  19. package/dist/browser/phoneNumbersClient.js.map +1 -1
  20. package/dist/browser/sipRoutingClient.js +48 -61
  21. package/dist/browser/sipRoutingClient.js.map +1 -1
  22. package/dist/browser/utils/constants.d.ts.map +1 -1
  23. package/dist/browser/utils/constants.js +1 -1
  24. package/dist/browser/utils/constants.js.map +1 -1
  25. package/dist/browser/utils/customPipelinePolicies.js +1 -2
  26. package/dist/browser/utils/customPipelinePolicies.js.map +1 -1
  27. package/dist/commonjs/generated/src/lroImpl.js +7 -3
  28. package/dist/commonjs/generated/src/lroImpl.js.map +1 -1
  29. package/dist/commonjs/generated/src/operations/phoneNumbers.js +219 -295
  30. package/dist/commonjs/generated/src/operations/phoneNumbers.js.map +1 -1
  31. package/dist/commonjs/generated/src/pagingHelper.js +2 -4
  32. package/dist/commonjs/generated/src/pagingHelper.js.map +1 -1
  33. package/dist/commonjs/generated/src/phoneNumbersClient.js +11 -4
  34. package/dist/commonjs/generated/src/phoneNumbersClient.js.map +1 -1
  35. package/dist/commonjs/generated/src/siprouting/operations/sipRouting.js +1 -0
  36. package/dist/commonjs/generated/src/siprouting/operations/sipRouting.js.map +1 -1
  37. package/dist/commonjs/generated/src/siprouting/sipRoutingClient.js +1 -0
  38. package/dist/commonjs/generated/src/siprouting/sipRoutingClient.js.map +1 -1
  39. package/dist/commonjs/generated/src/siprouting/sipRoutingClientContext.js +10 -3
  40. package/dist/commonjs/generated/src/siprouting/sipRoutingClientContext.js.map +1 -1
  41. package/dist/commonjs/generated/src/tracing.js +1 -1
  42. package/dist/commonjs/generated/src/tracing.js.map +1 -1
  43. package/dist/commonjs/phoneNumbersClient.d.ts +1 -1
  44. package/dist/commonjs/phoneNumbersClient.js +86 -28
  45. package/dist/commonjs/phoneNumbersClient.js.map +1 -1
  46. package/dist/commonjs/sipRoutingClient.js +48 -60
  47. package/dist/commonjs/sipRoutingClient.js.map +1 -1
  48. package/dist/commonjs/tsdoc-metadata.json +11 -11
  49. package/dist/commonjs/utils/constants.d.ts.map +1 -1
  50. package/dist/commonjs/utils/constants.js +1 -1
  51. package/dist/commonjs/utils/constants.js.map +1 -1
  52. package/dist/commonjs/utils/customPipelinePolicies.js +1 -2
  53. package/dist/commonjs/utils/customPipelinePolicies.js.map +1 -1
  54. package/dist/esm/generated/src/lroImpl.js +7 -3
  55. package/dist/esm/generated/src/lroImpl.js.map +1 -1
  56. package/dist/esm/generated/src/operations/phoneNumbers.js +219 -296
  57. package/dist/esm/generated/src/operations/phoneNumbers.js.map +1 -1
  58. package/dist/esm/generated/src/pagingHelper.js +2 -4
  59. package/dist/esm/generated/src/pagingHelper.js.map +1 -1
  60. package/dist/esm/generated/src/phoneNumbersClient.js +11 -4
  61. package/dist/esm/generated/src/phoneNumbersClient.js.map +1 -1
  62. package/dist/esm/generated/src/siprouting/operations/sipRouting.js +1 -0
  63. package/dist/esm/generated/src/siprouting/operations/sipRouting.js.map +1 -1
  64. package/dist/esm/generated/src/siprouting/sipRoutingClient.js +1 -0
  65. package/dist/esm/generated/src/siprouting/sipRoutingClient.js.map +1 -1
  66. package/dist/esm/generated/src/siprouting/sipRoutingClientContext.js +10 -3
  67. package/dist/esm/generated/src/siprouting/sipRoutingClientContext.js.map +1 -1
  68. package/dist/esm/generated/src/tracing.js +1 -1
  69. package/dist/esm/generated/src/tracing.js.map +1 -1
  70. package/dist/esm/phoneNumbersClient.d.ts +1 -1
  71. package/dist/esm/phoneNumbersClient.js +86 -28
  72. package/dist/esm/phoneNumbersClient.js.map +1 -1
  73. package/dist/esm/sipRoutingClient.js +48 -61
  74. package/dist/esm/sipRoutingClient.js.map +1 -1
  75. package/dist/esm/utils/constants.d.ts.map +1 -1
  76. package/dist/esm/utils/constants.js +1 -1
  77. package/dist/esm/utils/constants.js.map +1 -1
  78. package/dist/esm/utils/customPipelinePolicies.js +1 -2
  79. package/dist/esm/utils/customPipelinePolicies.js.map +1 -1
  80. package/dist/react-native/generated/src/lroImpl.js +7 -3
  81. package/dist/react-native/generated/src/lroImpl.js.map +1 -1
  82. package/dist/react-native/generated/src/operations/phoneNumbers.js +219 -296
  83. package/dist/react-native/generated/src/operations/phoneNumbers.js.map +1 -1
  84. package/dist/react-native/generated/src/pagingHelper.js +2 -4
  85. package/dist/react-native/generated/src/pagingHelper.js.map +1 -1
  86. package/dist/react-native/generated/src/phoneNumbersClient.js +11 -4
  87. package/dist/react-native/generated/src/phoneNumbersClient.js.map +1 -1
  88. package/dist/react-native/generated/src/siprouting/operations/sipRouting.js +1 -0
  89. package/dist/react-native/generated/src/siprouting/operations/sipRouting.js.map +1 -1
  90. package/dist/react-native/generated/src/siprouting/sipRoutingClient.js +1 -0
  91. package/dist/react-native/generated/src/siprouting/sipRoutingClient.js.map +1 -1
  92. package/dist/react-native/generated/src/siprouting/sipRoutingClientContext.js +10 -3
  93. package/dist/react-native/generated/src/siprouting/sipRoutingClientContext.js.map +1 -1
  94. package/dist/react-native/generated/src/tracing.js +1 -1
  95. package/dist/react-native/generated/src/tracing.js.map +1 -1
  96. package/dist/react-native/phoneNumbersClient.d.ts +1 -1
  97. package/dist/react-native/phoneNumbersClient.js +86 -28
  98. package/dist/react-native/phoneNumbersClient.js.map +1 -1
  99. package/dist/react-native/sipRoutingClient.js +48 -61
  100. package/dist/react-native/sipRoutingClient.js.map +1 -1
  101. package/dist/react-native/utils/constants.d.ts.map +1 -1
  102. package/dist/react-native/utils/constants.js +1 -1
  103. package/dist/react-native/utils/constants.js.map +1 -1
  104. package/dist/react-native/utils/customPipelinePolicies.js +1 -2
  105. package/dist/react-native/utils/customPipelinePolicies.js.map +1 -1
  106. package/package.json +35 -36
@@ -5,7 +5,6 @@
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
- import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
9
8
  import { tracingClient } from "../tracing.js";
10
9
  import { setContinuationToken } from "../pagingHelper.js";
11
10
  import * as coreClient from "@azure/core-client";
@@ -16,6 +15,7 @@ import { createLroSpec } from "../lroImpl.js";
16
15
  /// <reference lib="esnext.asynciterable" />
17
16
  /** Class containing PhoneNumbers operations. */
18
17
  export class PhoneNumbersImpl {
18
+ client;
19
19
  /**
20
20
  * Initialize a new instance of the class PhoneNumbers class.
21
21
  * @param client Reference to the service client
@@ -39,52 +39,35 @@ export class PhoneNumbersImpl {
39
39
  return this;
40
40
  },
41
41
  byPage: (settings) => {
42
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
42
+ if (settings?.maxPageSize) {
43
43
  throw new Error("maxPageSize is not supported by this operation.");
44
44
  }
45
45
  return this.listAreaCodesPagingPage(countryCode, phoneNumberType, options, settings);
46
46
  },
47
47
  };
48
48
  }
49
- listAreaCodesPagingPage(countryCode, phoneNumberType, options, settings) {
50
- return __asyncGenerator(this, arguments, function* listAreaCodesPagingPage_1() {
51
- let result;
52
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
53
- if (!continuationToken) {
54
- result = yield __await(this._listAreaCodes(countryCode, phoneNumberType, options));
55
- let page = result.areaCodes || [];
56
- continuationToken = result.nextLink;
57
- setContinuationToken(page, continuationToken);
58
- yield yield __await(page);
59
- }
60
- while (continuationToken) {
61
- result = yield __await(this._listAreaCodesNext(countryCode, continuationToken, options));
62
- continuationToken = result.nextLink;
63
- let page = result.areaCodes || [];
64
- setContinuationToken(page, continuationToken);
65
- yield yield __await(page);
66
- }
67
- });
49
+ async *listAreaCodesPagingPage(countryCode, phoneNumberType, options, settings) {
50
+ let result;
51
+ let continuationToken = settings?.continuationToken;
52
+ if (!continuationToken) {
53
+ result = await this._listAreaCodes(countryCode, phoneNumberType, options);
54
+ let page = result.areaCodes || [];
55
+ continuationToken = result.nextLink;
56
+ setContinuationToken(page, continuationToken);
57
+ yield page;
58
+ }
59
+ while (continuationToken) {
60
+ result = await this._listAreaCodesNext(countryCode, continuationToken, options);
61
+ continuationToken = result.nextLink;
62
+ let page = result.areaCodes || [];
63
+ setContinuationToken(page, continuationToken);
64
+ yield page;
65
+ }
68
66
  }
69
- listAreaCodesPagingAll(countryCode, phoneNumberType, options) {
70
- return __asyncGenerator(this, arguments, function* listAreaCodesPagingAll_1() {
71
- var _a, e_1, _b, _c;
72
- try {
73
- for (var _d = true, _e = __asyncValues(this.listAreaCodesPagingPage(countryCode, phoneNumberType, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
74
- _c = _f.value;
75
- _d = false;
76
- const page = _c;
77
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
78
- }
79
- }
80
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
81
- finally {
82
- try {
83
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
84
- }
85
- finally { if (e_1) throw e_1.error; }
86
- }
87
- });
67
+ async *listAreaCodesPagingAll(countryCode, phoneNumberType, options) {
68
+ for await (const page of this.listAreaCodesPagingPage(countryCode, phoneNumberType, options)) {
69
+ yield* page;
70
+ }
88
71
  }
89
72
  /**
90
73
  * Gets the list of supported countries.
@@ -100,52 +83,35 @@ export class PhoneNumbersImpl {
100
83
  return this;
101
84
  },
102
85
  byPage: (settings) => {
103
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
86
+ if (settings?.maxPageSize) {
104
87
  throw new Error("maxPageSize is not supported by this operation.");
105
88
  }
106
89
  return this.listAvailableCountriesPagingPage(options, settings);
107
90
  },
108
91
  };
109
92
  }
110
- listAvailableCountriesPagingPage(options, settings) {
111
- return __asyncGenerator(this, arguments, function* listAvailableCountriesPagingPage_1() {
112
- let result;
113
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
114
- if (!continuationToken) {
115
- result = yield __await(this._listAvailableCountries(options));
116
- let page = result.countries || [];
117
- continuationToken = result.nextLink;
118
- setContinuationToken(page, continuationToken);
119
- yield yield __await(page);
120
- }
121
- while (continuationToken) {
122
- result = yield __await(this._listAvailableCountriesNext(continuationToken, options));
123
- continuationToken = result.nextLink;
124
- let page = result.countries || [];
125
- setContinuationToken(page, continuationToken);
126
- yield yield __await(page);
127
- }
128
- });
93
+ async *listAvailableCountriesPagingPage(options, settings) {
94
+ let result;
95
+ let continuationToken = settings?.continuationToken;
96
+ if (!continuationToken) {
97
+ result = await this._listAvailableCountries(options);
98
+ let page = result.countries || [];
99
+ continuationToken = result.nextLink;
100
+ setContinuationToken(page, continuationToken);
101
+ yield page;
102
+ }
103
+ while (continuationToken) {
104
+ result = await this._listAvailableCountriesNext(continuationToken, options);
105
+ continuationToken = result.nextLink;
106
+ let page = result.countries || [];
107
+ setContinuationToken(page, continuationToken);
108
+ yield page;
109
+ }
129
110
  }
130
- listAvailableCountriesPagingAll(options) {
131
- return __asyncGenerator(this, arguments, function* listAvailableCountriesPagingAll_1() {
132
- var _a, e_2, _b, _c;
133
- try {
134
- for (var _d = true, _e = __asyncValues(this.listAvailableCountriesPagingPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
135
- _c = _f.value;
136
- _d = false;
137
- const page = _c;
138
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
139
- }
140
- }
141
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
142
- finally {
143
- try {
144
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
145
- }
146
- finally { if (e_2) throw e_2.error; }
147
- }
148
- });
111
+ async *listAvailableCountriesPagingAll(options) {
112
+ for await (const page of this.listAvailableCountriesPagingPage(options)) {
113
+ yield* page;
114
+ }
149
115
  }
150
116
  /**
151
117
  * Gets the list of cities or towns with available phone numbers.
@@ -162,52 +128,35 @@ export class PhoneNumbersImpl {
162
128
  return this;
163
129
  },
164
130
  byPage: (settings) => {
165
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
131
+ if (settings?.maxPageSize) {
166
132
  throw new Error("maxPageSize is not supported by this operation.");
167
133
  }
168
134
  return this.listAvailableLocalitiesPagingPage(countryCode, options, settings);
169
135
  },
170
136
  };
171
137
  }
172
- listAvailableLocalitiesPagingPage(countryCode, options, settings) {
173
- return __asyncGenerator(this, arguments, function* listAvailableLocalitiesPagingPage_1() {
174
- let result;
175
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
176
- if (!continuationToken) {
177
- result = yield __await(this._listAvailableLocalities(countryCode, options));
178
- let page = result.phoneNumberLocalities || [];
179
- continuationToken = result.nextLink;
180
- setContinuationToken(page, continuationToken);
181
- yield yield __await(page);
182
- }
183
- while (continuationToken) {
184
- result = yield __await(this._listAvailableLocalitiesNext(countryCode, continuationToken, options));
185
- continuationToken = result.nextLink;
186
- let page = result.phoneNumberLocalities || [];
187
- setContinuationToken(page, continuationToken);
188
- yield yield __await(page);
189
- }
190
- });
138
+ async *listAvailableLocalitiesPagingPage(countryCode, options, settings) {
139
+ let result;
140
+ let continuationToken = settings?.continuationToken;
141
+ if (!continuationToken) {
142
+ result = await this._listAvailableLocalities(countryCode, options);
143
+ let page = result.phoneNumberLocalities || [];
144
+ continuationToken = result.nextLink;
145
+ setContinuationToken(page, continuationToken);
146
+ yield page;
147
+ }
148
+ while (continuationToken) {
149
+ result = await this._listAvailableLocalitiesNext(countryCode, continuationToken, options);
150
+ continuationToken = result.nextLink;
151
+ let page = result.phoneNumberLocalities || [];
152
+ setContinuationToken(page, continuationToken);
153
+ yield page;
154
+ }
191
155
  }
192
- listAvailableLocalitiesPagingAll(countryCode, options) {
193
- return __asyncGenerator(this, arguments, function* listAvailableLocalitiesPagingAll_1() {
194
- var _a, e_3, _b, _c;
195
- try {
196
- for (var _d = true, _e = __asyncValues(this.listAvailableLocalitiesPagingPage(countryCode, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
197
- _c = _f.value;
198
- _d = false;
199
- const page = _c;
200
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
201
- }
202
- }
203
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
204
- finally {
205
- try {
206
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
207
- }
208
- finally { if (e_3) throw e_3.error; }
209
- }
210
- });
156
+ async *listAvailableLocalitiesPagingAll(countryCode, options) {
157
+ for await (const page of this.listAvailableLocalitiesPagingPage(countryCode, options)) {
158
+ yield* page;
159
+ }
211
160
  }
212
161
  /**
213
162
  * List available offerings of capabilities with rates for the given country.
@@ -224,52 +173,35 @@ export class PhoneNumbersImpl {
224
173
  return this;
225
174
  },
226
175
  byPage: (settings) => {
227
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
176
+ if (settings?.maxPageSize) {
228
177
  throw new Error("maxPageSize is not supported by this operation.");
229
178
  }
230
179
  return this.listOfferingsPagingPage(countryCode, options, settings);
231
180
  },
232
181
  };
233
182
  }
234
- listOfferingsPagingPage(countryCode, options, settings) {
235
- return __asyncGenerator(this, arguments, function* listOfferingsPagingPage_1() {
236
- let result;
237
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
238
- if (!continuationToken) {
239
- result = yield __await(this._listOfferings(countryCode, options));
240
- let page = result.phoneNumberOfferings || [];
241
- continuationToken = result.nextLink;
242
- setContinuationToken(page, continuationToken);
243
- yield yield __await(page);
244
- }
245
- while (continuationToken) {
246
- result = yield __await(this._listOfferingsNext(countryCode, continuationToken, options));
247
- continuationToken = result.nextLink;
248
- let page = result.phoneNumberOfferings || [];
249
- setContinuationToken(page, continuationToken);
250
- yield yield __await(page);
251
- }
252
- });
183
+ async *listOfferingsPagingPage(countryCode, options, settings) {
184
+ let result;
185
+ let continuationToken = settings?.continuationToken;
186
+ if (!continuationToken) {
187
+ result = await this._listOfferings(countryCode, options);
188
+ let page = result.phoneNumberOfferings || [];
189
+ continuationToken = result.nextLink;
190
+ setContinuationToken(page, continuationToken);
191
+ yield page;
192
+ }
193
+ while (continuationToken) {
194
+ result = await this._listOfferingsNext(countryCode, continuationToken, options);
195
+ continuationToken = result.nextLink;
196
+ let page = result.phoneNumberOfferings || [];
197
+ setContinuationToken(page, continuationToken);
198
+ yield page;
199
+ }
253
200
  }
254
- listOfferingsPagingAll(countryCode, options) {
255
- return __asyncGenerator(this, arguments, function* listOfferingsPagingAll_1() {
256
- var _a, e_4, _b, _c;
257
- try {
258
- for (var _d = true, _e = __asyncValues(this.listOfferingsPagingPage(countryCode, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
259
- _c = _f.value;
260
- _d = false;
261
- const page = _c;
262
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
263
- }
264
- }
265
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
266
- finally {
267
- try {
268
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
269
- }
270
- finally { if (e_4) throw e_4.error; }
271
- }
272
- });
201
+ async *listOfferingsPagingAll(countryCode, options) {
202
+ for await (const page of this.listOfferingsPagingPage(countryCode, options)) {
203
+ yield* page;
204
+ }
273
205
  }
274
206
  /**
275
207
  * Retrieves a paginated list of all phone number reservations. Note that the reservations will not be
@@ -286,52 +218,35 @@ export class PhoneNumbersImpl {
286
218
  return this;
287
219
  },
288
220
  byPage: (settings) => {
289
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
221
+ if (settings?.maxPageSize) {
290
222
  throw new Error("maxPageSize is not supported by this operation.");
291
223
  }
292
224
  return this.listReservationsPagingPage(options, settings);
293
225
  },
294
226
  };
295
227
  }
296
- listReservationsPagingPage(options, settings) {
297
- return __asyncGenerator(this, arguments, function* listReservationsPagingPage_1() {
298
- let result;
299
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
300
- if (!continuationToken) {
301
- result = yield __await(this._listReservations(options));
302
- let page = result.reservations || [];
303
- continuationToken = result.nextLink;
304
- setContinuationToken(page, continuationToken);
305
- yield yield __await(page);
306
- }
307
- while (continuationToken) {
308
- result = yield __await(this._listReservationsNext(continuationToken, options));
309
- continuationToken = result.nextLink;
310
- let page = result.reservations || [];
311
- setContinuationToken(page, continuationToken);
312
- yield yield __await(page);
313
- }
314
- });
228
+ async *listReservationsPagingPage(options, settings) {
229
+ let result;
230
+ let continuationToken = settings?.continuationToken;
231
+ if (!continuationToken) {
232
+ result = await this._listReservations(options);
233
+ let page = result.reservations || [];
234
+ continuationToken = result.nextLink;
235
+ setContinuationToken(page, continuationToken);
236
+ yield page;
237
+ }
238
+ while (continuationToken) {
239
+ result = await this._listReservationsNext(continuationToken, options);
240
+ continuationToken = result.nextLink;
241
+ let page = result.reservations || [];
242
+ setContinuationToken(page, continuationToken);
243
+ yield page;
244
+ }
315
245
  }
316
- listReservationsPagingAll(options) {
317
- return __asyncGenerator(this, arguments, function* listReservationsPagingAll_1() {
318
- var _a, e_5, _b, _c;
319
- try {
320
- for (var _d = true, _e = __asyncValues(this.listReservationsPagingPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
321
- _c = _f.value;
322
- _d = false;
323
- const page = _c;
324
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
325
- }
326
- }
327
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
328
- finally {
329
- try {
330
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
331
- }
332
- finally { if (e_5) throw e_5.error; }
333
- }
334
- });
246
+ async *listReservationsPagingAll(options) {
247
+ for await (const page of this.listReservationsPagingPage(options)) {
248
+ yield* page;
249
+ }
335
250
  }
336
251
  /**
337
252
  * Gets the list of all purchased phone numbers.
@@ -347,52 +262,35 @@ export class PhoneNumbersImpl {
347
262
  return this;
348
263
  },
349
264
  byPage: (settings) => {
350
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
265
+ if (settings?.maxPageSize) {
351
266
  throw new Error("maxPageSize is not supported by this operation.");
352
267
  }
353
268
  return this.listPhoneNumbersPagingPage(options, settings);
354
269
  },
355
270
  };
356
271
  }
357
- listPhoneNumbersPagingPage(options, settings) {
358
- return __asyncGenerator(this, arguments, function* listPhoneNumbersPagingPage_1() {
359
- let result;
360
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
361
- if (!continuationToken) {
362
- result = yield __await(this._listPhoneNumbers(options));
363
- let page = result.phoneNumbers || [];
364
- continuationToken = result.nextLink;
365
- setContinuationToken(page, continuationToken);
366
- yield yield __await(page);
367
- }
368
- while (continuationToken) {
369
- result = yield __await(this._listPhoneNumbersNext(continuationToken, options));
370
- continuationToken = result.nextLink;
371
- let page = result.phoneNumbers || [];
372
- setContinuationToken(page, continuationToken);
373
- yield yield __await(page);
374
- }
375
- });
272
+ async *listPhoneNumbersPagingPage(options, settings) {
273
+ let result;
274
+ let continuationToken = settings?.continuationToken;
275
+ if (!continuationToken) {
276
+ result = await this._listPhoneNumbers(options);
277
+ let page = result.phoneNumbers || [];
278
+ continuationToken = result.nextLink;
279
+ setContinuationToken(page, continuationToken);
280
+ yield page;
281
+ }
282
+ while (continuationToken) {
283
+ result = await this._listPhoneNumbersNext(continuationToken, options);
284
+ continuationToken = result.nextLink;
285
+ let page = result.phoneNumbers || [];
286
+ setContinuationToken(page, continuationToken);
287
+ yield page;
288
+ }
376
289
  }
377
- listPhoneNumbersPagingAll(options) {
378
- return __asyncGenerator(this, arguments, function* listPhoneNumbersPagingAll_1() {
379
- var _a, e_6, _b, _c;
380
- try {
381
- for (var _d = true, _e = __asyncValues(this.listPhoneNumbersPagingPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
382
- _c = _f.value;
383
- _d = false;
384
- const page = _c;
385
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
386
- }
387
- }
388
- catch (e_6_1) { e_6 = { error: e_6_1 }; }
389
- finally {
390
- try {
391
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
392
- }
393
- finally { if (e_6) throw e_6.error; }
394
- }
395
- });
290
+ async *listPhoneNumbersPagingAll(options) {
291
+ for await (const page of this.listPhoneNumbersPagingPage(options)) {
292
+ yield* page;
293
+ }
396
294
  }
397
295
  /**
398
296
  * Gets the list of available area codes.
@@ -401,7 +299,7 @@ export class PhoneNumbersImpl {
401
299
  * @param options The options parameters.
402
300
  */
403
301
  async _listAreaCodes(countryCode, phoneNumberType, options) {
404
- return tracingClient.withSpan("PhoneNumbersClient._listAreaCodes", options !== null && options !== void 0 ? options : {}, async (options) => {
302
+ return tracingClient.withSpan("PhoneNumbersClient._listAreaCodes", options ?? {}, async (options) => {
405
303
  return this.client.sendOperationRequest({ countryCode, phoneNumberType, options }, listAreaCodesOperationSpec);
406
304
  });
407
305
  }
@@ -410,7 +308,7 @@ export class PhoneNumbersImpl {
410
308
  * @param options The options parameters.
411
309
  */
412
310
  async _listAvailableCountries(options) {
413
- return tracingClient.withSpan("PhoneNumbersClient._listAvailableCountries", options !== null && options !== void 0 ? options : {}, async (options) => {
311
+ return tracingClient.withSpan("PhoneNumbersClient._listAvailableCountries", options ?? {}, async (options) => {
414
312
  return this.client.sendOperationRequest({ options }, listAvailableCountriesOperationSpec);
415
313
  });
416
314
  }
@@ -423,7 +321,7 @@ export class PhoneNumbersImpl {
423
321
  * @param options The options parameters.
424
322
  */
425
323
  async browseAvailableNumbers(countryCode, phoneNumberType, options) {
426
- return tracingClient.withSpan("PhoneNumbersClient.browseAvailableNumbers", options !== null && options !== void 0 ? options : {}, async (options) => {
324
+ return tracingClient.withSpan("PhoneNumbersClient.browseAvailableNumbers", options ?? {}, async (options) => {
427
325
  return this.client.sendOperationRequest({ countryCode, phoneNumberType, options }, browseAvailableNumbersOperationSpec);
428
326
  });
429
327
  }
@@ -433,7 +331,7 @@ export class PhoneNumbersImpl {
433
331
  * @param options The options parameters.
434
332
  */
435
333
  async _listAvailableLocalities(countryCode, options) {
436
- return tracingClient.withSpan("PhoneNumbersClient._listAvailableLocalities", options !== null && options !== void 0 ? options : {}, async (options) => {
334
+ return tracingClient.withSpan("PhoneNumbersClient._listAvailableLocalities", options ?? {}, async (options) => {
437
335
  return this.client.sendOperationRequest({ countryCode, options }, listAvailableLocalitiesOperationSpec);
438
336
  });
439
337
  }
@@ -443,7 +341,7 @@ export class PhoneNumbersImpl {
443
341
  * @param options The options parameters.
444
342
  */
445
343
  async _listOfferings(countryCode, options) {
446
- return tracingClient.withSpan("PhoneNumbersClient._listOfferings", options !== null && options !== void 0 ? options : {}, async (options) => {
344
+ return tracingClient.withSpan("PhoneNumbersClient._listOfferings", options ?? {}, async (options) => {
447
345
  return this.client.sendOperationRequest({ countryCode, options }, listOfferingsOperationSpec);
448
346
  });
449
347
  }
@@ -453,7 +351,7 @@ export class PhoneNumbersImpl {
453
351
  * @param options The options parameters.
454
352
  */
455
353
  async _listReservations(options) {
456
- return tracingClient.withSpan("PhoneNumbersClient._listReservations", options !== null && options !== void 0 ? options : {}, async (options) => {
354
+ return tracingClient.withSpan("PhoneNumbersClient._listReservations", options ?? {}, async (options) => {
457
355
  return this.client.sendOperationRequest({ options }, listReservationsOperationSpec);
458
356
  });
459
357
  }
@@ -470,7 +368,7 @@ export class PhoneNumbersImpl {
470
368
  * @param options The options parameters.
471
369
  */
472
370
  async createOrUpdateReservation(reservationId, options) {
473
- return tracingClient.withSpan("PhoneNumbersClient.createOrUpdateReservation", options !== null && options !== void 0 ? options : {}, async (options) => {
371
+ return tracingClient.withSpan("PhoneNumbersClient.createOrUpdateReservation", options ?? {}, async (options) => {
474
372
  return this.client.sendOperationRequest({ reservationId, options }, createOrUpdateReservationOperationSpec);
475
373
  });
476
374
  }
@@ -480,7 +378,7 @@ export class PhoneNumbersImpl {
480
378
  * @param options The options parameters.
481
379
  */
482
380
  async getReservation(reservationId, options) {
483
- return tracingClient.withSpan("PhoneNumbersClient.getReservation", options !== null && options !== void 0 ? options : {}, async (options) => {
381
+ return tracingClient.withSpan("PhoneNumbersClient.getReservation", options ?? {}, async (options) => {
484
382
  return this.client.sendOperationRequest({ reservationId, options }, getReservationOperationSpec);
485
383
  });
486
384
  }
@@ -491,7 +389,7 @@ export class PhoneNumbersImpl {
491
389
  * @param options The options parameters.
492
390
  */
493
391
  async deleteReservation(reservationId, options) {
494
- return tracingClient.withSpan("PhoneNumbersClient.deleteReservation", options !== null && options !== void 0 ? options : {}, async (options) => {
392
+ return tracingClient.withSpan("PhoneNumbersClient.deleteReservation", options ?? {}, async (options) => {
495
393
  return this.client.sendOperationRequest({ reservationId, options }, deleteReservationOperationSpec);
496
394
  });
497
395
  }
@@ -506,19 +404,24 @@ export class PhoneNumbersImpl {
506
404
  */
507
405
  async beginPurchaseReservation(reservationId, options) {
508
406
  const directSendOperation = async (args, spec) => {
509
- return tracingClient.withSpan("PhoneNumbersClient.beginPurchaseReservation", options !== null && options !== void 0 ? options : {}, async () => {
407
+ return tracingClient.withSpan("PhoneNumbersClient.beginPurchaseReservation", options ?? {}, async () => {
510
408
  return this.client.sendOperationRequest(args, spec);
511
409
  });
512
410
  };
513
411
  const sendOperationFn = async (args, spec) => {
514
- var _a;
515
412
  let currentRawResponse = undefined;
516
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
413
+ const providedCallback = args.options?.onResponse;
517
414
  const callback = (rawResponse, flatResponse) => {
518
415
  currentRawResponse = rawResponse;
519
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
416
+ providedCallback?.(rawResponse, flatResponse);
417
+ };
418
+ const updatedArgs = {
419
+ ...args,
420
+ options: {
421
+ ...args.options,
422
+ onResponse: callback,
423
+ },
520
424
  };
521
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
522
425
  const flatResponse = await directSendOperation(updatedArgs, spec);
523
426
  return {
524
427
  flatResponse,
@@ -535,8 +438,8 @@ export class PhoneNumbersImpl {
535
438
  spec: purchaseReservationOperationSpec,
536
439
  });
537
440
  const poller = new LroEngine(lro, {
538
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
539
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
441
+ resumeFrom: options?.resumeFrom,
442
+ intervalInMs: options?.updateIntervalInMs,
540
443
  });
541
444
  await poller.poll();
542
445
  return poller;
@@ -565,19 +468,24 @@ export class PhoneNumbersImpl {
565
468
  */
566
469
  async beginSearchAvailablePhoneNumbers(countryCode, phoneNumberType, assignmentType, capabilities, options) {
567
470
  const directSendOperation = async (args, spec) => {
568
- return tracingClient.withSpan("PhoneNumbersClient.beginSearchAvailablePhoneNumbers", options !== null && options !== void 0 ? options : {}, async () => {
471
+ return tracingClient.withSpan("PhoneNumbersClient.beginSearchAvailablePhoneNumbers", options ?? {}, async () => {
569
472
  return this.client.sendOperationRequest(args, spec);
570
473
  });
571
474
  };
572
475
  const sendOperationFn = async (args, spec) => {
573
- var _a;
574
476
  let currentRawResponse = undefined;
575
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
477
+ const providedCallback = args.options?.onResponse;
576
478
  const callback = (rawResponse, flatResponse) => {
577
479
  currentRawResponse = rawResponse;
578
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
480
+ providedCallback?.(rawResponse, flatResponse);
481
+ };
482
+ const updatedArgs = {
483
+ ...args,
484
+ options: {
485
+ ...args.options,
486
+ onResponse: callback,
487
+ },
579
488
  };
580
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
581
489
  const flatResponse = await directSendOperation(updatedArgs, spec);
582
490
  return {
583
491
  flatResponse,
@@ -600,8 +508,8 @@ export class PhoneNumbersImpl {
600
508
  spec: searchAvailablePhoneNumbersOperationSpec,
601
509
  });
602
510
  const poller = new LroEngine(lro, {
603
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
604
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
511
+ resumeFrom: options?.resumeFrom,
512
+ intervalInMs: options?.updateIntervalInMs,
605
513
  lroResourceLocationConfig: "location",
606
514
  });
607
515
  await poller.poll();
@@ -626,7 +534,7 @@ export class PhoneNumbersImpl {
626
534
  * @param options The options parameters.
627
535
  */
628
536
  async getSearchResult(searchId, options) {
629
- return tracingClient.withSpan("PhoneNumbersClient.getSearchResult", options !== null && options !== void 0 ? options : {}, async (options) => {
537
+ return tracingClient.withSpan("PhoneNumbersClient.getSearchResult", options ?? {}, async (options) => {
630
538
  return this.client.sendOperationRequest({ searchId, options }, getSearchResultOperationSpec);
631
539
  });
632
540
  }
@@ -636,19 +544,24 @@ export class PhoneNumbersImpl {
636
544
  */
637
545
  async beginPurchasePhoneNumbers(options) {
638
546
  const directSendOperation = async (args, spec) => {
639
- return tracingClient.withSpan("PhoneNumbersClient.beginPurchasePhoneNumbers", options !== null && options !== void 0 ? options : {}, async () => {
547
+ return tracingClient.withSpan("PhoneNumbersClient.beginPurchasePhoneNumbers", options ?? {}, async () => {
640
548
  return this.client.sendOperationRequest(args, spec);
641
549
  });
642
550
  };
643
551
  const sendOperationFn = async (args, spec) => {
644
- var _a;
645
552
  let currentRawResponse = undefined;
646
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
553
+ const providedCallback = args.options?.onResponse;
647
554
  const callback = (rawResponse, flatResponse) => {
648
555
  currentRawResponse = rawResponse;
649
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
556
+ providedCallback?.(rawResponse, flatResponse);
557
+ };
558
+ const updatedArgs = {
559
+ ...args,
560
+ options: {
561
+ ...args.options,
562
+ onResponse: callback,
563
+ },
650
564
  };
651
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
652
565
  const flatResponse = await directSendOperation(updatedArgs, spec);
653
566
  return {
654
567
  flatResponse,
@@ -665,8 +578,8 @@ export class PhoneNumbersImpl {
665
578
  spec: purchasePhoneNumbersOperationSpec,
666
579
  });
667
580
  const poller = new LroEngine(lro, {
668
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
669
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
581
+ resumeFrom: options?.resumeFrom,
582
+ intervalInMs: options?.updateIntervalInMs,
670
583
  });
671
584
  await poller.poll();
672
585
  return poller;
@@ -685,7 +598,7 @@ export class PhoneNumbersImpl {
685
598
  * @param options The options parameters.
686
599
  */
687
600
  async getOperation(operationId, options) {
688
- return tracingClient.withSpan("PhoneNumbersClient.getOperation", options !== null && options !== void 0 ? options : {}, async (options) => {
601
+ return tracingClient.withSpan("PhoneNumbersClient.getOperation", options ?? {}, async (options) => {
689
602
  return this.client.sendOperationRequest({ operationId, options }, getOperationOperationSpec);
690
603
  });
691
604
  }
@@ -695,7 +608,7 @@ export class PhoneNumbersImpl {
695
608
  * @param options The options parameters.
696
609
  */
697
610
  async cancelOperation(operationId, options) {
698
- return tracingClient.withSpan("PhoneNumbersClient.cancelOperation", options !== null && options !== void 0 ? options : {}, async (options) => {
611
+ return tracingClient.withSpan("PhoneNumbersClient.cancelOperation", options ?? {}, async (options) => {
699
612
  return this.client.sendOperationRequest({ operationId, options }, cancelOperationOperationSpec);
700
613
  });
701
614
  }
@@ -707,19 +620,24 @@ export class PhoneNumbersImpl {
707
620
  */
708
621
  async beginUpdateCapabilities(phoneNumber, options) {
709
622
  const directSendOperation = async (args, spec) => {
710
- return tracingClient.withSpan("PhoneNumbersClient.beginUpdateCapabilities", options !== null && options !== void 0 ? options : {}, async () => {
623
+ return tracingClient.withSpan("PhoneNumbersClient.beginUpdateCapabilities", options ?? {}, async () => {
711
624
  return this.client.sendOperationRequest(args, spec);
712
625
  });
713
626
  };
714
627
  const sendOperationFn = async (args, spec) => {
715
- var _a;
716
628
  let currentRawResponse = undefined;
717
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
629
+ const providedCallback = args.options?.onResponse;
718
630
  const callback = (rawResponse, flatResponse) => {
719
631
  currentRawResponse = rawResponse;
720
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
632
+ providedCallback?.(rawResponse, flatResponse);
633
+ };
634
+ const updatedArgs = {
635
+ ...args,
636
+ options: {
637
+ ...args.options,
638
+ onResponse: callback,
639
+ },
721
640
  };
722
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
723
641
  const flatResponse = await directSendOperation(updatedArgs, spec);
724
642
  return {
725
643
  flatResponse,
@@ -736,8 +654,8 @@ export class PhoneNumbersImpl {
736
654
  spec: updateCapabilitiesOperationSpec,
737
655
  });
738
656
  const poller = new LroEngine(lro, {
739
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
740
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
657
+ resumeFrom: options?.resumeFrom,
658
+ intervalInMs: options?.updateIntervalInMs,
741
659
  lroResourceLocationConfig: "location",
742
660
  });
743
661
  await poller.poll();
@@ -760,7 +678,7 @@ export class PhoneNumbersImpl {
760
678
  * @param options The options parameters.
761
679
  */
762
680
  async getByNumber(phoneNumber, options) {
763
- return tracingClient.withSpan("PhoneNumbersClient.getByNumber", options !== null && options !== void 0 ? options : {}, async (options) => {
681
+ return tracingClient.withSpan("PhoneNumbersClient.getByNumber", options ?? {}, async (options) => {
764
682
  return this.client.sendOperationRequest({ phoneNumber, options }, getByNumberOperationSpec);
765
683
  });
766
684
  }
@@ -771,19 +689,24 @@ export class PhoneNumbersImpl {
771
689
  */
772
690
  async beginReleasePhoneNumber(phoneNumber, options) {
773
691
  const directSendOperation = async (args, spec) => {
774
- return tracingClient.withSpan("PhoneNumbersClient.beginReleasePhoneNumber", options !== null && options !== void 0 ? options : {}, async () => {
692
+ return tracingClient.withSpan("PhoneNumbersClient.beginReleasePhoneNumber", options ?? {}, async () => {
775
693
  return this.client.sendOperationRequest(args, spec);
776
694
  });
777
695
  };
778
696
  const sendOperationFn = async (args, spec) => {
779
- var _a;
780
697
  let currentRawResponse = undefined;
781
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
698
+ const providedCallback = args.options?.onResponse;
782
699
  const callback = (rawResponse, flatResponse) => {
783
700
  currentRawResponse = rawResponse;
784
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
701
+ providedCallback?.(rawResponse, flatResponse);
702
+ };
703
+ const updatedArgs = {
704
+ ...args,
705
+ options: {
706
+ ...args.options,
707
+ onResponse: callback,
708
+ },
785
709
  };
786
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
787
710
  const flatResponse = await directSendOperation(updatedArgs, spec);
788
711
  return {
789
712
  flatResponse,
@@ -800,8 +723,8 @@ export class PhoneNumbersImpl {
800
723
  spec: releasePhoneNumberOperationSpec,
801
724
  });
802
725
  const poller = new LroEngine(lro, {
803
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
804
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
726
+ resumeFrom: options?.resumeFrom,
727
+ intervalInMs: options?.updateIntervalInMs,
805
728
  });
806
729
  await poller.poll();
807
730
  return poller;
@@ -820,7 +743,7 @@ export class PhoneNumbersImpl {
820
743
  * @param options The options parameters.
821
744
  */
822
745
  async _listPhoneNumbers(options) {
823
- return tracingClient.withSpan("PhoneNumbersClient._listPhoneNumbers", options !== null && options !== void 0 ? options : {}, async (options) => {
746
+ return tracingClient.withSpan("PhoneNumbersClient._listPhoneNumbers", options ?? {}, async (options) => {
824
747
  return this.client.sendOperationRequest({ options }, listPhoneNumbersOperationSpec);
825
748
  });
826
749
  }
@@ -830,7 +753,7 @@ export class PhoneNumbersImpl {
830
753
  * @param options The options parameters.
831
754
  */
832
755
  async operatorInformationSearch(phoneNumbers, options) {
833
- return tracingClient.withSpan("PhoneNumbersClient.operatorInformationSearch", options !== null && options !== void 0 ? options : {}, async (options) => {
756
+ return tracingClient.withSpan("PhoneNumbersClient.operatorInformationSearch", options ?? {}, async (options) => {
834
757
  return this.client.sendOperationRequest({ phoneNumbers, options }, operatorInformationSearchOperationSpec);
835
758
  });
836
759
  }
@@ -841,7 +764,7 @@ export class PhoneNumbersImpl {
841
764
  * @param options The options parameters.
842
765
  */
843
766
  async _listAreaCodesNext(countryCode, nextLink, options) {
844
- return tracingClient.withSpan("PhoneNumbersClient._listAreaCodesNext", options !== null && options !== void 0 ? options : {}, async (options) => {
767
+ return tracingClient.withSpan("PhoneNumbersClient._listAreaCodesNext", options ?? {}, async (options) => {
845
768
  return this.client.sendOperationRequest({ countryCode, nextLink, options }, listAreaCodesNextOperationSpec);
846
769
  });
847
770
  }
@@ -851,7 +774,7 @@ export class PhoneNumbersImpl {
851
774
  * @param options The options parameters.
852
775
  */
853
776
  async _listAvailableCountriesNext(nextLink, options) {
854
- return tracingClient.withSpan("PhoneNumbersClient._listAvailableCountriesNext", options !== null && options !== void 0 ? options : {}, async (options) => {
777
+ return tracingClient.withSpan("PhoneNumbersClient._listAvailableCountriesNext", options ?? {}, async (options) => {
855
778
  return this.client.sendOperationRequest({ nextLink, options }, listAvailableCountriesNextOperationSpec);
856
779
  });
857
780
  }
@@ -863,7 +786,7 @@ export class PhoneNumbersImpl {
863
786
  * @param options The options parameters.
864
787
  */
865
788
  async _listAvailableLocalitiesNext(countryCode, nextLink, options) {
866
- return tracingClient.withSpan("PhoneNumbersClient._listAvailableLocalitiesNext", options !== null && options !== void 0 ? options : {}, async (options) => {
789
+ return tracingClient.withSpan("PhoneNumbersClient._listAvailableLocalitiesNext", options ?? {}, async (options) => {
867
790
  return this.client.sendOperationRequest({ countryCode, nextLink, options }, listAvailableLocalitiesNextOperationSpec);
868
791
  });
869
792
  }
@@ -874,7 +797,7 @@ export class PhoneNumbersImpl {
874
797
  * @param options The options parameters.
875
798
  */
876
799
  async _listOfferingsNext(countryCode, nextLink, options) {
877
- return tracingClient.withSpan("PhoneNumbersClient._listOfferingsNext", options !== null && options !== void 0 ? options : {}, async (options) => {
800
+ return tracingClient.withSpan("PhoneNumbersClient._listOfferingsNext", options ?? {}, async (options) => {
878
801
  return this.client.sendOperationRequest({ countryCode, nextLink, options }, listOfferingsNextOperationSpec);
879
802
  });
880
803
  }
@@ -884,7 +807,7 @@ export class PhoneNumbersImpl {
884
807
  * @param options The options parameters.
885
808
  */
886
809
  async _listReservationsNext(nextLink, options) {
887
- return tracingClient.withSpan("PhoneNumbersClient._listReservationsNext", options !== null && options !== void 0 ? options : {}, async (options) => {
810
+ return tracingClient.withSpan("PhoneNumbersClient._listReservationsNext", options ?? {}, async (options) => {
888
811
  return this.client.sendOperationRequest({ nextLink, options }, listReservationsNextOperationSpec);
889
812
  });
890
813
  }
@@ -894,7 +817,7 @@ export class PhoneNumbersImpl {
894
817
  * @param options The options parameters.
895
818
  */
896
819
  async _listPhoneNumbersNext(nextLink, options) {
897
- return tracingClient.withSpan("PhoneNumbersClient._listPhoneNumbersNext", options !== null && options !== void 0 ? options : {}, async (options) => {
820
+ return tracingClient.withSpan("PhoneNumbersClient._listPhoneNumbersNext", options ?? {}, async (options) => {
898
821
  return this.client.sendOperationRequest({ nextLink, options }, listPhoneNumbersNextOperationSpec);
899
822
  });
900
823
  }
@@ -963,7 +886,7 @@ const browseAvailableNumbersOperationSpec = {
963
886
  assignmentType: ["options", "assignmentType"],
964
887
  phoneNumberPrefixes: ["options", "phoneNumberPrefixes"],
965
888
  },
966
- mapper: Object.assign(Object.assign({}, Mappers.PhoneNumbersBrowseRequest), { required: true }),
889
+ mapper: { ...Mappers.PhoneNumbersBrowseRequest, required: true },
967
890
  },
968
891
  queryParameters: [Parameters.apiVersion],
969
892
  urlParameters: [Parameters.endpoint, Parameters.countryCode],
@@ -1055,7 +978,7 @@ const createOrUpdateReservationOperationSpec = {
1055
978
  phoneNumbers: ["options", "phoneNumbers"],
1056
979
  status: ["options", "status"],
1057
980
  },
1058
- mapper: Object.assign(Object.assign({}, Mappers.PhoneNumbersReservation), { required: true }),
981
+ mapper: { ...Mappers.PhoneNumbersReservation, required: true },
1059
982
  },
1060
983
  queryParameters: [Parameters.apiVersion],
1061
984
  urlParameters: [Parameters.endpoint, Parameters.reservationId],
@@ -1155,7 +1078,7 @@ const searchAvailablePhoneNumbersOperationSpec = {
1155
1078
  areaCode: ["options", "areaCode"],
1156
1079
  quantity: ["options", "quantity"],
1157
1080
  },
1158
- mapper: Object.assign(Object.assign({}, Mappers.PhoneNumberSearchRequest), { required: true }),
1081
+ mapper: { ...Mappers.PhoneNumberSearchRequest, required: true },
1159
1082
  },
1160
1083
  queryParameters: [Parameters.apiVersion],
1161
1084
  urlParameters: [Parameters.endpoint, Parameters.countryCode],
@@ -1204,7 +1127,7 @@ const purchasePhoneNumbersOperationSpec = {
1204
1127
  searchId: ["options", "searchId"],
1205
1128
  agreeToNotResell: ["options", "agreeToNotResell"],
1206
1129
  },
1207
- mapper: Object.assign(Object.assign({}, Mappers.PhoneNumberPurchaseRequest), { required: true }),
1130
+ mapper: { ...Mappers.PhoneNumberPurchaseRequest, required: true },
1208
1131
  },
1209
1132
  queryParameters: [Parameters.apiVersion],
1210
1133
  urlParameters: [Parameters.endpoint],
@@ -1350,7 +1273,7 @@ const operatorInformationSearchOperationSpec = {
1350
1273
  phoneNumbers: ["phoneNumbers"],
1351
1274
  options: ["options", "options"],
1352
1275
  },
1353
- mapper: Object.assign(Object.assign({}, Mappers.OperatorInformationRequest), { required: true }),
1276
+ mapper: { ...Mappers.OperatorInformationRequest, required: true },
1354
1277
  },
1355
1278
  queryParameters: [Parameters.apiVersion],
1356
1279
  urlParameters: [Parameters.endpoint],