@azure/communication-phone-numbers 1.5.0-beta.2 → 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 (235) hide show
  1. package/README.md +1 -20
  2. package/dist/browser/generated/src/lroImpl.js +7 -3
  3. package/dist/browser/generated/src/lroImpl.js.map +1 -1
  4. package/dist/browser/generated/src/operations/phoneNumbers.js +219 -296
  5. package/dist/browser/generated/src/operations/phoneNumbers.js.map +1 -1
  6. package/dist/browser/generated/src/pagingHelper.js +2 -4
  7. package/dist/browser/generated/src/pagingHelper.js.map +1 -1
  8. package/dist/browser/generated/src/phoneNumbersClient.js +11 -4
  9. package/dist/browser/generated/src/phoneNumbersClient.js.map +1 -1
  10. package/dist/browser/generated/src/siprouting/index.d.ts +1 -0
  11. package/dist/browser/generated/src/siprouting/index.d.ts.map +1 -1
  12. package/dist/browser/generated/src/siprouting/index.js +1 -0
  13. package/dist/browser/generated/src/siprouting/index.js.map +1 -1
  14. package/dist/browser/generated/src/siprouting/models/index.d.ts +2 -141
  15. package/dist/browser/generated/src/siprouting/models/index.d.ts.map +1 -1
  16. package/dist/browser/generated/src/siprouting/models/index.js +1 -6
  17. package/dist/browser/generated/src/siprouting/models/index.js.map +1 -1
  18. package/dist/browser/generated/src/siprouting/models/mappers.d.ts +0 -7
  19. package/dist/browser/generated/src/siprouting/models/mappers.d.ts.map +1 -1
  20. package/dist/browser/generated/src/siprouting/models/mappers.js +77 -284
  21. package/dist/browser/generated/src/siprouting/models/mappers.js.map +1 -1
  22. package/dist/browser/generated/src/siprouting/models/parameters.d.ts +0 -7
  23. package/dist/browser/generated/src/siprouting/models/parameters.d.ts.map +1 -1
  24. package/dist/browser/generated/src/siprouting/models/parameters.js +16 -62
  25. package/dist/browser/generated/src/siprouting/models/parameters.js.map +1 -1
  26. package/dist/browser/generated/src/siprouting/operations/sipRouting.d.ts +3 -9
  27. package/dist/browser/generated/src/siprouting/operations/sipRouting.d.ts.map +1 -1
  28. package/dist/browser/generated/src/siprouting/operations/sipRouting.js +12 -45
  29. package/dist/browser/generated/src/siprouting/operations/sipRouting.js.map +1 -1
  30. package/dist/browser/generated/src/siprouting/operationsInterfaces/sipRouting.d.ts +1 -7
  31. package/dist/browser/generated/src/siprouting/operationsInterfaces/sipRouting.d.ts.map +1 -1
  32. package/dist/browser/generated/src/siprouting/operationsInterfaces/sipRouting.js.map +1 -1
  33. package/dist/browser/generated/src/siprouting/sipRoutingClient.d.ts +2 -6
  34. package/dist/browser/generated/src/siprouting/sipRoutingClient.d.ts.map +1 -1
  35. package/dist/browser/generated/src/siprouting/sipRoutingClient.js +4 -51
  36. package/dist/browser/generated/src/siprouting/sipRoutingClient.js.map +1 -1
  37. package/dist/browser/generated/src/siprouting/sipRoutingClientContext.js +10 -3
  38. package/dist/browser/generated/src/siprouting/sipRoutingClientContext.js.map +1 -1
  39. package/dist/browser/generated/src/tracing.js +1 -1
  40. package/dist/browser/generated/src/tracing.js.map +1 -1
  41. package/dist/browser/mappers.d.ts +3 -17
  42. package/dist/browser/mappers.d.ts.map +1 -1
  43. package/dist/browser/mappers.js +2 -51
  44. package/dist/browser/mappers.js.map +1 -1
  45. package/dist/browser/models.d.ts +1 -60
  46. package/dist/browser/models.d.ts.map +1 -1
  47. package/dist/browser/models.js.map +1 -1
  48. package/dist/browser/phoneNumbersClient.d.ts +1 -1
  49. package/dist/browser/phoneNumbersClient.js +86 -28
  50. package/dist/browser/phoneNumbersClient.js.map +1 -1
  51. package/dist/browser/sipRoutingClient.d.ts +1 -41
  52. package/dist/browser/sipRoutingClient.d.ts.map +1 -1
  53. package/dist/browser/sipRoutingClient.js +49 -218
  54. package/dist/browser/sipRoutingClient.js.map +1 -1
  55. package/dist/browser/utils/constants.d.ts.map +1 -1
  56. package/dist/browser/utils/constants.js +1 -1
  57. package/dist/browser/utils/constants.js.map +1 -1
  58. package/dist/browser/utils/customPipelinePolicies.js +1 -2
  59. package/dist/browser/utils/customPipelinePolicies.js.map +1 -1
  60. package/dist/commonjs/generated/src/lroImpl.js +7 -3
  61. package/dist/commonjs/generated/src/lroImpl.js.map +1 -1
  62. package/dist/commonjs/generated/src/operations/phoneNumbers.js +219 -295
  63. package/dist/commonjs/generated/src/operations/phoneNumbers.js.map +1 -1
  64. package/dist/commonjs/generated/src/pagingHelper.js +2 -4
  65. package/dist/commonjs/generated/src/pagingHelper.js.map +1 -1
  66. package/dist/commonjs/generated/src/phoneNumbersClient.js +11 -4
  67. package/dist/commonjs/generated/src/phoneNumbersClient.js.map +1 -1
  68. package/dist/commonjs/generated/src/siprouting/index.d.ts +1 -0
  69. package/dist/commonjs/generated/src/siprouting/index.d.ts.map +1 -1
  70. package/dist/commonjs/generated/src/siprouting/index.js +3 -1
  71. package/dist/commonjs/generated/src/siprouting/index.js.map +1 -1
  72. package/dist/commonjs/generated/src/siprouting/models/index.d.ts +2 -141
  73. package/dist/commonjs/generated/src/siprouting/models/index.d.ts.map +1 -1
  74. package/dist/commonjs/generated/src/siprouting/models/index.js +0 -7
  75. package/dist/commonjs/generated/src/siprouting/models/index.js.map +1 -1
  76. package/dist/commonjs/generated/src/siprouting/models/mappers.d.ts +0 -7
  77. package/dist/commonjs/generated/src/siprouting/models/mappers.d.ts.map +1 -1
  78. package/dist/commonjs/generated/src/siprouting/models/mappers.js +78 -285
  79. package/dist/commonjs/generated/src/siprouting/models/mappers.js.map +1 -1
  80. package/dist/commonjs/generated/src/siprouting/models/parameters.d.ts +0 -7
  81. package/dist/commonjs/generated/src/siprouting/models/parameters.d.ts.map +1 -1
  82. package/dist/commonjs/generated/src/siprouting/models/parameters.js +16 -62
  83. package/dist/commonjs/generated/src/siprouting/models/parameters.js.map +1 -1
  84. package/dist/commonjs/generated/src/siprouting/operations/sipRouting.d.ts +3 -9
  85. package/dist/commonjs/generated/src/siprouting/operations/sipRouting.d.ts.map +1 -1
  86. package/dist/commonjs/generated/src/siprouting/operations/sipRouting.js +12 -45
  87. package/dist/commonjs/generated/src/siprouting/operations/sipRouting.js.map +1 -1
  88. package/dist/commonjs/generated/src/siprouting/operationsInterfaces/sipRouting.d.ts +1 -7
  89. package/dist/commonjs/generated/src/siprouting/operationsInterfaces/sipRouting.d.ts.map +1 -1
  90. package/dist/commonjs/generated/src/siprouting/operationsInterfaces/sipRouting.js.map +1 -1
  91. package/dist/commonjs/generated/src/siprouting/sipRoutingClient.d.ts +2 -6
  92. package/dist/commonjs/generated/src/siprouting/sipRoutingClient.d.ts.map +1 -1
  93. package/dist/commonjs/generated/src/siprouting/sipRoutingClient.js +4 -52
  94. package/dist/commonjs/generated/src/siprouting/sipRoutingClient.js.map +1 -1
  95. package/dist/commonjs/generated/src/siprouting/sipRoutingClientContext.js +10 -3
  96. package/dist/commonjs/generated/src/siprouting/sipRoutingClientContext.js.map +1 -1
  97. package/dist/commonjs/generated/src/tracing.js +1 -1
  98. package/dist/commonjs/generated/src/tracing.js.map +1 -1
  99. package/dist/commonjs/mappers.d.ts +3 -17
  100. package/dist/commonjs/mappers.d.ts.map +1 -1
  101. package/dist/commonjs/mappers.js +2 -53
  102. package/dist/commonjs/mappers.js.map +1 -1
  103. package/dist/commonjs/models.d.ts +1 -60
  104. package/dist/commonjs/models.d.ts.map +1 -1
  105. package/dist/commonjs/models.js.map +1 -1
  106. package/dist/commonjs/phoneNumbersClient.d.ts +1 -1
  107. package/dist/commonjs/phoneNumbersClient.js +86 -28
  108. package/dist/commonjs/phoneNumbersClient.js.map +1 -1
  109. package/dist/commonjs/sipRoutingClient.d.ts +1 -41
  110. package/dist/commonjs/sipRoutingClient.d.ts.map +1 -1
  111. package/dist/commonjs/sipRoutingClient.js +48 -216
  112. package/dist/commonjs/sipRoutingClient.js.map +1 -1
  113. package/dist/commonjs/tsdoc-metadata.json +11 -11
  114. package/dist/commonjs/utils/constants.d.ts.map +1 -1
  115. package/dist/commonjs/utils/constants.js +1 -1
  116. package/dist/commonjs/utils/constants.js.map +1 -1
  117. package/dist/commonjs/utils/customPipelinePolicies.js +1 -2
  118. package/dist/commonjs/utils/customPipelinePolicies.js.map +1 -1
  119. package/dist/esm/generated/src/lroImpl.js +7 -3
  120. package/dist/esm/generated/src/lroImpl.js.map +1 -1
  121. package/dist/esm/generated/src/operations/phoneNumbers.js +219 -296
  122. package/dist/esm/generated/src/operations/phoneNumbers.js.map +1 -1
  123. package/dist/esm/generated/src/pagingHelper.js +2 -4
  124. package/dist/esm/generated/src/pagingHelper.js.map +1 -1
  125. package/dist/esm/generated/src/phoneNumbersClient.js +11 -4
  126. package/dist/esm/generated/src/phoneNumbersClient.js.map +1 -1
  127. package/dist/esm/generated/src/siprouting/index.d.ts +1 -0
  128. package/dist/esm/generated/src/siprouting/index.d.ts.map +1 -1
  129. package/dist/esm/generated/src/siprouting/index.js +1 -0
  130. package/dist/esm/generated/src/siprouting/index.js.map +1 -1
  131. package/dist/esm/generated/src/siprouting/models/index.d.ts +2 -141
  132. package/dist/esm/generated/src/siprouting/models/index.d.ts.map +1 -1
  133. package/dist/esm/generated/src/siprouting/models/index.js +1 -6
  134. package/dist/esm/generated/src/siprouting/models/index.js.map +1 -1
  135. package/dist/esm/generated/src/siprouting/models/mappers.d.ts +0 -7
  136. package/dist/esm/generated/src/siprouting/models/mappers.d.ts.map +1 -1
  137. package/dist/esm/generated/src/siprouting/models/mappers.js +77 -284
  138. package/dist/esm/generated/src/siprouting/models/mappers.js.map +1 -1
  139. package/dist/esm/generated/src/siprouting/models/parameters.d.ts +0 -7
  140. package/dist/esm/generated/src/siprouting/models/parameters.d.ts.map +1 -1
  141. package/dist/esm/generated/src/siprouting/models/parameters.js +16 -62
  142. package/dist/esm/generated/src/siprouting/models/parameters.js.map +1 -1
  143. package/dist/esm/generated/src/siprouting/operations/sipRouting.d.ts +3 -9
  144. package/dist/esm/generated/src/siprouting/operations/sipRouting.d.ts.map +1 -1
  145. package/dist/esm/generated/src/siprouting/operations/sipRouting.js +12 -45
  146. package/dist/esm/generated/src/siprouting/operations/sipRouting.js.map +1 -1
  147. package/dist/esm/generated/src/siprouting/operationsInterfaces/sipRouting.d.ts +1 -7
  148. package/dist/esm/generated/src/siprouting/operationsInterfaces/sipRouting.d.ts.map +1 -1
  149. package/dist/esm/generated/src/siprouting/operationsInterfaces/sipRouting.js.map +1 -1
  150. package/dist/esm/generated/src/siprouting/sipRoutingClient.d.ts +2 -6
  151. package/dist/esm/generated/src/siprouting/sipRoutingClient.d.ts.map +1 -1
  152. package/dist/esm/generated/src/siprouting/sipRoutingClient.js +4 -51
  153. package/dist/esm/generated/src/siprouting/sipRoutingClient.js.map +1 -1
  154. package/dist/esm/generated/src/siprouting/sipRoutingClientContext.js +10 -3
  155. package/dist/esm/generated/src/siprouting/sipRoutingClientContext.js.map +1 -1
  156. package/dist/esm/generated/src/tracing.js +1 -1
  157. package/dist/esm/generated/src/tracing.js.map +1 -1
  158. package/dist/esm/mappers.d.ts +3 -17
  159. package/dist/esm/mappers.d.ts.map +1 -1
  160. package/dist/esm/mappers.js +2 -51
  161. package/dist/esm/mappers.js.map +1 -1
  162. package/dist/esm/models.d.ts +1 -60
  163. package/dist/esm/models.d.ts.map +1 -1
  164. package/dist/esm/models.js.map +1 -1
  165. package/dist/esm/phoneNumbersClient.d.ts +1 -1
  166. package/dist/esm/phoneNumbersClient.js +86 -28
  167. package/dist/esm/phoneNumbersClient.js.map +1 -1
  168. package/dist/esm/sipRoutingClient.d.ts +1 -41
  169. package/dist/esm/sipRoutingClient.d.ts.map +1 -1
  170. package/dist/esm/sipRoutingClient.js +49 -218
  171. package/dist/esm/sipRoutingClient.js.map +1 -1
  172. package/dist/esm/utils/constants.d.ts.map +1 -1
  173. package/dist/esm/utils/constants.js +1 -1
  174. package/dist/esm/utils/constants.js.map +1 -1
  175. package/dist/esm/utils/customPipelinePolicies.js +1 -2
  176. package/dist/esm/utils/customPipelinePolicies.js.map +1 -1
  177. package/dist/react-native/generated/src/lroImpl.js +7 -3
  178. package/dist/react-native/generated/src/lroImpl.js.map +1 -1
  179. package/dist/react-native/generated/src/operations/phoneNumbers.js +219 -296
  180. package/dist/react-native/generated/src/operations/phoneNumbers.js.map +1 -1
  181. package/dist/react-native/generated/src/pagingHelper.js +2 -4
  182. package/dist/react-native/generated/src/pagingHelper.js.map +1 -1
  183. package/dist/react-native/generated/src/phoneNumbersClient.js +11 -4
  184. package/dist/react-native/generated/src/phoneNumbersClient.js.map +1 -1
  185. package/dist/react-native/generated/src/siprouting/index.d.ts +1 -0
  186. package/dist/react-native/generated/src/siprouting/index.d.ts.map +1 -1
  187. package/dist/react-native/generated/src/siprouting/index.js +1 -0
  188. package/dist/react-native/generated/src/siprouting/index.js.map +1 -1
  189. package/dist/react-native/generated/src/siprouting/models/index.d.ts +2 -141
  190. package/dist/react-native/generated/src/siprouting/models/index.d.ts.map +1 -1
  191. package/dist/react-native/generated/src/siprouting/models/index.js +1 -6
  192. package/dist/react-native/generated/src/siprouting/models/index.js.map +1 -1
  193. package/dist/react-native/generated/src/siprouting/models/mappers.d.ts +0 -7
  194. package/dist/react-native/generated/src/siprouting/models/mappers.d.ts.map +1 -1
  195. package/dist/react-native/generated/src/siprouting/models/mappers.js +77 -284
  196. package/dist/react-native/generated/src/siprouting/models/mappers.js.map +1 -1
  197. package/dist/react-native/generated/src/siprouting/models/parameters.d.ts +0 -7
  198. package/dist/react-native/generated/src/siprouting/models/parameters.d.ts.map +1 -1
  199. package/dist/react-native/generated/src/siprouting/models/parameters.js +16 -62
  200. package/dist/react-native/generated/src/siprouting/models/parameters.js.map +1 -1
  201. package/dist/react-native/generated/src/siprouting/operations/sipRouting.d.ts +3 -9
  202. package/dist/react-native/generated/src/siprouting/operations/sipRouting.d.ts.map +1 -1
  203. package/dist/react-native/generated/src/siprouting/operations/sipRouting.js +12 -45
  204. package/dist/react-native/generated/src/siprouting/operations/sipRouting.js.map +1 -1
  205. package/dist/react-native/generated/src/siprouting/operationsInterfaces/sipRouting.d.ts +1 -7
  206. package/dist/react-native/generated/src/siprouting/operationsInterfaces/sipRouting.d.ts.map +1 -1
  207. package/dist/react-native/generated/src/siprouting/operationsInterfaces/sipRouting.js.map +1 -1
  208. package/dist/react-native/generated/src/siprouting/sipRoutingClient.d.ts +2 -6
  209. package/dist/react-native/generated/src/siprouting/sipRoutingClient.d.ts.map +1 -1
  210. package/dist/react-native/generated/src/siprouting/sipRoutingClient.js +4 -51
  211. package/dist/react-native/generated/src/siprouting/sipRoutingClient.js.map +1 -1
  212. package/dist/react-native/generated/src/siprouting/sipRoutingClientContext.js +10 -3
  213. package/dist/react-native/generated/src/siprouting/sipRoutingClientContext.js.map +1 -1
  214. package/dist/react-native/generated/src/tracing.js +1 -1
  215. package/dist/react-native/generated/src/tracing.js.map +1 -1
  216. package/dist/react-native/mappers.d.ts +3 -17
  217. package/dist/react-native/mappers.d.ts.map +1 -1
  218. package/dist/react-native/mappers.js +2 -51
  219. package/dist/react-native/mappers.js.map +1 -1
  220. package/dist/react-native/models.d.ts +1 -60
  221. package/dist/react-native/models.d.ts.map +1 -1
  222. package/dist/react-native/models.js.map +1 -1
  223. package/dist/react-native/phoneNumbersClient.d.ts +1 -1
  224. package/dist/react-native/phoneNumbersClient.js +86 -28
  225. package/dist/react-native/phoneNumbersClient.js.map +1 -1
  226. package/dist/react-native/sipRoutingClient.d.ts +1 -41
  227. package/dist/react-native/sipRoutingClient.d.ts.map +1 -1
  228. package/dist/react-native/sipRoutingClient.js +49 -218
  229. package/dist/react-native/sipRoutingClient.js.map +1 -1
  230. package/dist/react-native/utils/constants.d.ts.map +1 -1
  231. package/dist/react-native/utils/constants.js +1 -1
  232. package/dist/react-native/utils/constants.js.map +1 -1
  233. package/dist/react-native/utils/customPipelinePolicies.js +1 -2
  234. package/dist/react-native/utils/customPipelinePolicies.js.map +1 -1
  235. package/package.json +35 -37
@@ -19,6 +19,7 @@ const lroImpl_js_1 = require("../lroImpl.js");
19
19
  /// <reference lib="esnext.asynciterable" />
20
20
  /** Class containing PhoneNumbers operations. */
21
21
  class PhoneNumbersImpl {
22
+ client;
22
23
  /**
23
24
  * Initialize a new instance of the class PhoneNumbers class.
24
25
  * @param client Reference to the service client
@@ -42,52 +43,35 @@ class PhoneNumbersImpl {
42
43
  return this;
43
44
  },
44
45
  byPage: (settings) => {
45
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
46
+ if (settings?.maxPageSize) {
46
47
  throw new Error("maxPageSize is not supported by this operation.");
47
48
  }
48
49
  return this.listAreaCodesPagingPage(countryCode, phoneNumberType, options, settings);
49
50
  },
50
51
  };
51
52
  }
52
- listAreaCodesPagingPage(countryCode, phoneNumberType, options, settings) {
53
- return tslib_1.__asyncGenerator(this, arguments, function* listAreaCodesPagingPage_1() {
54
- let result;
55
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
56
- if (!continuationToken) {
57
- result = yield tslib_1.__await(this._listAreaCodes(countryCode, phoneNumberType, options));
58
- let page = result.areaCodes || [];
59
- continuationToken = result.nextLink;
60
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
61
- yield yield tslib_1.__await(page);
62
- }
63
- while (continuationToken) {
64
- result = yield tslib_1.__await(this._listAreaCodesNext(countryCode, continuationToken, options));
65
- continuationToken = result.nextLink;
66
- let page = result.areaCodes || [];
67
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
68
- yield yield tslib_1.__await(page);
69
- }
70
- });
53
+ async *listAreaCodesPagingPage(countryCode, phoneNumberType, options, settings) {
54
+ let result;
55
+ let continuationToken = settings?.continuationToken;
56
+ if (!continuationToken) {
57
+ result = await this._listAreaCodes(countryCode, phoneNumberType, options);
58
+ let page = result.areaCodes || [];
59
+ continuationToken = result.nextLink;
60
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
61
+ yield page;
62
+ }
63
+ while (continuationToken) {
64
+ result = await this._listAreaCodesNext(countryCode, continuationToken, options);
65
+ continuationToken = result.nextLink;
66
+ let page = result.areaCodes || [];
67
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
68
+ yield page;
69
+ }
71
70
  }
72
- listAreaCodesPagingAll(countryCode, phoneNumberType, options) {
73
- return tslib_1.__asyncGenerator(this, arguments, function* listAreaCodesPagingAll_1() {
74
- var _a, e_1, _b, _c;
75
- try {
76
- for (var _d = true, _e = tslib_1.__asyncValues(this.listAreaCodesPagingPage(countryCode, phoneNumberType, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
77
- _c = _f.value;
78
- _d = false;
79
- const page = _c;
80
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
81
- }
82
- }
83
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
84
- finally {
85
- try {
86
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
87
- }
88
- finally { if (e_1) throw e_1.error; }
89
- }
90
- });
71
+ async *listAreaCodesPagingAll(countryCode, phoneNumberType, options) {
72
+ for await (const page of this.listAreaCodesPagingPage(countryCode, phoneNumberType, options)) {
73
+ yield* page;
74
+ }
91
75
  }
92
76
  /**
93
77
  * Gets the list of supported countries.
@@ -103,52 +87,35 @@ class PhoneNumbersImpl {
103
87
  return this;
104
88
  },
105
89
  byPage: (settings) => {
106
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
90
+ if (settings?.maxPageSize) {
107
91
  throw new Error("maxPageSize is not supported by this operation.");
108
92
  }
109
93
  return this.listAvailableCountriesPagingPage(options, settings);
110
94
  },
111
95
  };
112
96
  }
113
- listAvailableCountriesPagingPage(options, settings) {
114
- return tslib_1.__asyncGenerator(this, arguments, function* listAvailableCountriesPagingPage_1() {
115
- let result;
116
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
117
- if (!continuationToken) {
118
- result = yield tslib_1.__await(this._listAvailableCountries(options));
119
- let page = result.countries || [];
120
- continuationToken = result.nextLink;
121
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
122
- yield yield tslib_1.__await(page);
123
- }
124
- while (continuationToken) {
125
- result = yield tslib_1.__await(this._listAvailableCountriesNext(continuationToken, options));
126
- continuationToken = result.nextLink;
127
- let page = result.countries || [];
128
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
129
- yield yield tslib_1.__await(page);
130
- }
131
- });
97
+ async *listAvailableCountriesPagingPage(options, settings) {
98
+ let result;
99
+ let continuationToken = settings?.continuationToken;
100
+ if (!continuationToken) {
101
+ result = await this._listAvailableCountries(options);
102
+ let page = result.countries || [];
103
+ continuationToken = result.nextLink;
104
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
105
+ yield page;
106
+ }
107
+ while (continuationToken) {
108
+ result = await this._listAvailableCountriesNext(continuationToken, options);
109
+ continuationToken = result.nextLink;
110
+ let page = result.countries || [];
111
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
112
+ yield page;
113
+ }
132
114
  }
133
- listAvailableCountriesPagingAll(options) {
134
- return tslib_1.__asyncGenerator(this, arguments, function* listAvailableCountriesPagingAll_1() {
135
- var _a, e_2, _b, _c;
136
- try {
137
- for (var _d = true, _e = tslib_1.__asyncValues(this.listAvailableCountriesPagingPage(options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
138
- _c = _f.value;
139
- _d = false;
140
- const page = _c;
141
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
142
- }
143
- }
144
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
145
- finally {
146
- try {
147
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
148
- }
149
- finally { if (e_2) throw e_2.error; }
150
- }
151
- });
115
+ async *listAvailableCountriesPagingAll(options) {
116
+ for await (const page of this.listAvailableCountriesPagingPage(options)) {
117
+ yield* page;
118
+ }
152
119
  }
153
120
  /**
154
121
  * Gets the list of cities or towns with available phone numbers.
@@ -165,52 +132,35 @@ class PhoneNumbersImpl {
165
132
  return this;
166
133
  },
167
134
  byPage: (settings) => {
168
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
135
+ if (settings?.maxPageSize) {
169
136
  throw new Error("maxPageSize is not supported by this operation.");
170
137
  }
171
138
  return this.listAvailableLocalitiesPagingPage(countryCode, options, settings);
172
139
  },
173
140
  };
174
141
  }
175
- listAvailableLocalitiesPagingPage(countryCode, options, settings) {
176
- return tslib_1.__asyncGenerator(this, arguments, function* listAvailableLocalitiesPagingPage_1() {
177
- let result;
178
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
179
- if (!continuationToken) {
180
- result = yield tslib_1.__await(this._listAvailableLocalities(countryCode, options));
181
- let page = result.phoneNumberLocalities || [];
182
- continuationToken = result.nextLink;
183
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
184
- yield yield tslib_1.__await(page);
185
- }
186
- while (continuationToken) {
187
- result = yield tslib_1.__await(this._listAvailableLocalitiesNext(countryCode, continuationToken, options));
188
- continuationToken = result.nextLink;
189
- let page = result.phoneNumberLocalities || [];
190
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
191
- yield yield tslib_1.__await(page);
192
- }
193
- });
142
+ async *listAvailableLocalitiesPagingPage(countryCode, options, settings) {
143
+ let result;
144
+ let continuationToken = settings?.continuationToken;
145
+ if (!continuationToken) {
146
+ result = await this._listAvailableLocalities(countryCode, options);
147
+ let page = result.phoneNumberLocalities || [];
148
+ continuationToken = result.nextLink;
149
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
150
+ yield page;
151
+ }
152
+ while (continuationToken) {
153
+ result = await this._listAvailableLocalitiesNext(countryCode, continuationToken, options);
154
+ continuationToken = result.nextLink;
155
+ let page = result.phoneNumberLocalities || [];
156
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
157
+ yield page;
158
+ }
194
159
  }
195
- listAvailableLocalitiesPagingAll(countryCode, options) {
196
- return tslib_1.__asyncGenerator(this, arguments, function* listAvailableLocalitiesPagingAll_1() {
197
- var _a, e_3, _b, _c;
198
- try {
199
- for (var _d = true, _e = tslib_1.__asyncValues(this.listAvailableLocalitiesPagingPage(countryCode, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
200
- _c = _f.value;
201
- _d = false;
202
- const page = _c;
203
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
204
- }
205
- }
206
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
207
- finally {
208
- try {
209
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
210
- }
211
- finally { if (e_3) throw e_3.error; }
212
- }
213
- });
160
+ async *listAvailableLocalitiesPagingAll(countryCode, options) {
161
+ for await (const page of this.listAvailableLocalitiesPagingPage(countryCode, options)) {
162
+ yield* page;
163
+ }
214
164
  }
215
165
  /**
216
166
  * List available offerings of capabilities with rates for the given country.
@@ -227,52 +177,35 @@ class PhoneNumbersImpl {
227
177
  return this;
228
178
  },
229
179
  byPage: (settings) => {
230
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
180
+ if (settings?.maxPageSize) {
231
181
  throw new Error("maxPageSize is not supported by this operation.");
232
182
  }
233
183
  return this.listOfferingsPagingPage(countryCode, options, settings);
234
184
  },
235
185
  };
236
186
  }
237
- listOfferingsPagingPage(countryCode, options, settings) {
238
- return tslib_1.__asyncGenerator(this, arguments, function* listOfferingsPagingPage_1() {
239
- let result;
240
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
241
- if (!continuationToken) {
242
- result = yield tslib_1.__await(this._listOfferings(countryCode, options));
243
- let page = result.phoneNumberOfferings || [];
244
- continuationToken = result.nextLink;
245
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
246
- yield yield tslib_1.__await(page);
247
- }
248
- while (continuationToken) {
249
- result = yield tslib_1.__await(this._listOfferingsNext(countryCode, continuationToken, options));
250
- continuationToken = result.nextLink;
251
- let page = result.phoneNumberOfferings || [];
252
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
253
- yield yield tslib_1.__await(page);
254
- }
255
- });
187
+ async *listOfferingsPagingPage(countryCode, options, settings) {
188
+ let result;
189
+ let continuationToken = settings?.continuationToken;
190
+ if (!continuationToken) {
191
+ result = await this._listOfferings(countryCode, options);
192
+ let page = result.phoneNumberOfferings || [];
193
+ continuationToken = result.nextLink;
194
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
195
+ yield page;
196
+ }
197
+ while (continuationToken) {
198
+ result = await this._listOfferingsNext(countryCode, continuationToken, options);
199
+ continuationToken = result.nextLink;
200
+ let page = result.phoneNumberOfferings || [];
201
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
202
+ yield page;
203
+ }
256
204
  }
257
- listOfferingsPagingAll(countryCode, options) {
258
- return tslib_1.__asyncGenerator(this, arguments, function* listOfferingsPagingAll_1() {
259
- var _a, e_4, _b, _c;
260
- try {
261
- for (var _d = true, _e = tslib_1.__asyncValues(this.listOfferingsPagingPage(countryCode, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
262
- _c = _f.value;
263
- _d = false;
264
- const page = _c;
265
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
266
- }
267
- }
268
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
269
- finally {
270
- try {
271
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
272
- }
273
- finally { if (e_4) throw e_4.error; }
274
- }
275
- });
205
+ async *listOfferingsPagingAll(countryCode, options) {
206
+ for await (const page of this.listOfferingsPagingPage(countryCode, options)) {
207
+ yield* page;
208
+ }
276
209
  }
277
210
  /**
278
211
  * Retrieves a paginated list of all phone number reservations. Note that the reservations will not be
@@ -289,52 +222,35 @@ class PhoneNumbersImpl {
289
222
  return this;
290
223
  },
291
224
  byPage: (settings) => {
292
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
225
+ if (settings?.maxPageSize) {
293
226
  throw new Error("maxPageSize is not supported by this operation.");
294
227
  }
295
228
  return this.listReservationsPagingPage(options, settings);
296
229
  },
297
230
  };
298
231
  }
299
- listReservationsPagingPage(options, settings) {
300
- return tslib_1.__asyncGenerator(this, arguments, function* listReservationsPagingPage_1() {
301
- let result;
302
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
303
- if (!continuationToken) {
304
- result = yield tslib_1.__await(this._listReservations(options));
305
- let page = result.reservations || [];
306
- continuationToken = result.nextLink;
307
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
308
- yield yield tslib_1.__await(page);
309
- }
310
- while (continuationToken) {
311
- result = yield tslib_1.__await(this._listReservationsNext(continuationToken, options));
312
- continuationToken = result.nextLink;
313
- let page = result.reservations || [];
314
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
315
- yield yield tslib_1.__await(page);
316
- }
317
- });
232
+ async *listReservationsPagingPage(options, settings) {
233
+ let result;
234
+ let continuationToken = settings?.continuationToken;
235
+ if (!continuationToken) {
236
+ result = await this._listReservations(options);
237
+ let page = result.reservations || [];
238
+ continuationToken = result.nextLink;
239
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
240
+ yield page;
241
+ }
242
+ while (continuationToken) {
243
+ result = await this._listReservationsNext(continuationToken, options);
244
+ continuationToken = result.nextLink;
245
+ let page = result.reservations || [];
246
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
247
+ yield page;
248
+ }
318
249
  }
319
- listReservationsPagingAll(options) {
320
- return tslib_1.__asyncGenerator(this, arguments, function* listReservationsPagingAll_1() {
321
- var _a, e_5, _b, _c;
322
- try {
323
- for (var _d = true, _e = tslib_1.__asyncValues(this.listReservationsPagingPage(options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
324
- _c = _f.value;
325
- _d = false;
326
- const page = _c;
327
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
328
- }
329
- }
330
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
331
- finally {
332
- try {
333
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
334
- }
335
- finally { if (e_5) throw e_5.error; }
336
- }
337
- });
250
+ async *listReservationsPagingAll(options) {
251
+ for await (const page of this.listReservationsPagingPage(options)) {
252
+ yield* page;
253
+ }
338
254
  }
339
255
  /**
340
256
  * Gets the list of all purchased phone numbers.
@@ -350,52 +266,35 @@ class PhoneNumbersImpl {
350
266
  return this;
351
267
  },
352
268
  byPage: (settings) => {
353
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
269
+ if (settings?.maxPageSize) {
354
270
  throw new Error("maxPageSize is not supported by this operation.");
355
271
  }
356
272
  return this.listPhoneNumbersPagingPage(options, settings);
357
273
  },
358
274
  };
359
275
  }
360
- listPhoneNumbersPagingPage(options, settings) {
361
- return tslib_1.__asyncGenerator(this, arguments, function* listPhoneNumbersPagingPage_1() {
362
- let result;
363
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
364
- if (!continuationToken) {
365
- result = yield tslib_1.__await(this._listPhoneNumbers(options));
366
- let page = result.phoneNumbers || [];
367
- continuationToken = result.nextLink;
368
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
369
- yield yield tslib_1.__await(page);
370
- }
371
- while (continuationToken) {
372
- result = yield tslib_1.__await(this._listPhoneNumbersNext(continuationToken, options));
373
- continuationToken = result.nextLink;
374
- let page = result.phoneNumbers || [];
375
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
376
- yield yield tslib_1.__await(page);
377
- }
378
- });
276
+ async *listPhoneNumbersPagingPage(options, settings) {
277
+ let result;
278
+ let continuationToken = settings?.continuationToken;
279
+ if (!continuationToken) {
280
+ result = await this._listPhoneNumbers(options);
281
+ let page = result.phoneNumbers || [];
282
+ continuationToken = result.nextLink;
283
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
284
+ yield page;
285
+ }
286
+ while (continuationToken) {
287
+ result = await this._listPhoneNumbersNext(continuationToken, options);
288
+ continuationToken = result.nextLink;
289
+ let page = result.phoneNumbers || [];
290
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
291
+ yield page;
292
+ }
379
293
  }
380
- listPhoneNumbersPagingAll(options) {
381
- return tslib_1.__asyncGenerator(this, arguments, function* listPhoneNumbersPagingAll_1() {
382
- var _a, e_6, _b, _c;
383
- try {
384
- for (var _d = true, _e = tslib_1.__asyncValues(this.listPhoneNumbersPagingPage(options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
385
- _c = _f.value;
386
- _d = false;
387
- const page = _c;
388
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
389
- }
390
- }
391
- catch (e_6_1) { e_6 = { error: e_6_1 }; }
392
- finally {
393
- try {
394
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
395
- }
396
- finally { if (e_6) throw e_6.error; }
397
- }
398
- });
294
+ async *listPhoneNumbersPagingAll(options) {
295
+ for await (const page of this.listPhoneNumbersPagingPage(options)) {
296
+ yield* page;
297
+ }
399
298
  }
400
299
  /**
401
300
  * Gets the list of available area codes.
@@ -404,7 +303,7 @@ class PhoneNumbersImpl {
404
303
  * @param options The options parameters.
405
304
  */
406
305
  async _listAreaCodes(countryCode, phoneNumberType, options) {
407
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listAreaCodes", options !== null && options !== void 0 ? options : {}, async (options) => {
306
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listAreaCodes", options ?? {}, async (options) => {
408
307
  return this.client.sendOperationRequest({ countryCode, phoneNumberType, options }, listAreaCodesOperationSpec);
409
308
  });
410
309
  }
@@ -413,7 +312,7 @@ class PhoneNumbersImpl {
413
312
  * @param options The options parameters.
414
313
  */
415
314
  async _listAvailableCountries(options) {
416
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listAvailableCountries", options !== null && options !== void 0 ? options : {}, async (options) => {
315
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listAvailableCountries", options ?? {}, async (options) => {
417
316
  return this.client.sendOperationRequest({ options }, listAvailableCountriesOperationSpec);
418
317
  });
419
318
  }
@@ -426,7 +325,7 @@ class PhoneNumbersImpl {
426
325
  * @param options The options parameters.
427
326
  */
428
327
  async browseAvailableNumbers(countryCode, phoneNumberType, options) {
429
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.browseAvailableNumbers", options !== null && options !== void 0 ? options : {}, async (options) => {
328
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.browseAvailableNumbers", options ?? {}, async (options) => {
430
329
  return this.client.sendOperationRequest({ countryCode, phoneNumberType, options }, browseAvailableNumbersOperationSpec);
431
330
  });
432
331
  }
@@ -436,7 +335,7 @@ class PhoneNumbersImpl {
436
335
  * @param options The options parameters.
437
336
  */
438
337
  async _listAvailableLocalities(countryCode, options) {
439
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listAvailableLocalities", options !== null && options !== void 0 ? options : {}, async (options) => {
338
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listAvailableLocalities", options ?? {}, async (options) => {
440
339
  return this.client.sendOperationRequest({ countryCode, options }, listAvailableLocalitiesOperationSpec);
441
340
  });
442
341
  }
@@ -446,7 +345,7 @@ class PhoneNumbersImpl {
446
345
  * @param options The options parameters.
447
346
  */
448
347
  async _listOfferings(countryCode, options) {
449
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listOfferings", options !== null && options !== void 0 ? options : {}, async (options) => {
348
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listOfferings", options ?? {}, async (options) => {
450
349
  return this.client.sendOperationRequest({ countryCode, options }, listOfferingsOperationSpec);
451
350
  });
452
351
  }
@@ -456,7 +355,7 @@ class PhoneNumbersImpl {
456
355
  * @param options The options parameters.
457
356
  */
458
357
  async _listReservations(options) {
459
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listReservations", options !== null && options !== void 0 ? options : {}, async (options) => {
358
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listReservations", options ?? {}, async (options) => {
460
359
  return this.client.sendOperationRequest({ options }, listReservationsOperationSpec);
461
360
  });
462
361
  }
@@ -473,7 +372,7 @@ class PhoneNumbersImpl {
473
372
  * @param options The options parameters.
474
373
  */
475
374
  async createOrUpdateReservation(reservationId, options) {
476
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.createOrUpdateReservation", options !== null && options !== void 0 ? options : {}, async (options) => {
375
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.createOrUpdateReservation", options ?? {}, async (options) => {
477
376
  return this.client.sendOperationRequest({ reservationId, options }, createOrUpdateReservationOperationSpec);
478
377
  });
479
378
  }
@@ -483,7 +382,7 @@ class PhoneNumbersImpl {
483
382
  * @param options The options parameters.
484
383
  */
485
384
  async getReservation(reservationId, options) {
486
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.getReservation", options !== null && options !== void 0 ? options : {}, async (options) => {
385
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.getReservation", options ?? {}, async (options) => {
487
386
  return this.client.sendOperationRequest({ reservationId, options }, getReservationOperationSpec);
488
387
  });
489
388
  }
@@ -494,7 +393,7 @@ class PhoneNumbersImpl {
494
393
  * @param options The options parameters.
495
394
  */
496
395
  async deleteReservation(reservationId, options) {
497
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.deleteReservation", options !== null && options !== void 0 ? options : {}, async (options) => {
396
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.deleteReservation", options ?? {}, async (options) => {
498
397
  return this.client.sendOperationRequest({ reservationId, options }, deleteReservationOperationSpec);
499
398
  });
500
399
  }
@@ -509,19 +408,24 @@ class PhoneNumbersImpl {
509
408
  */
510
409
  async beginPurchaseReservation(reservationId, options) {
511
410
  const directSendOperation = async (args, spec) => {
512
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.beginPurchaseReservation", options !== null && options !== void 0 ? options : {}, async () => {
411
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.beginPurchaseReservation", options ?? {}, async () => {
513
412
  return this.client.sendOperationRequest(args, spec);
514
413
  });
515
414
  };
516
415
  const sendOperationFn = async (args, spec) => {
517
- var _a;
518
416
  let currentRawResponse = undefined;
519
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
417
+ const providedCallback = args.options?.onResponse;
520
418
  const callback = (rawResponse, flatResponse) => {
521
419
  currentRawResponse = rawResponse;
522
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
420
+ providedCallback?.(rawResponse, flatResponse);
421
+ };
422
+ const updatedArgs = {
423
+ ...args,
424
+ options: {
425
+ ...args.options,
426
+ onResponse: callback,
427
+ },
523
428
  };
524
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
525
429
  const flatResponse = await directSendOperation(updatedArgs, spec);
526
430
  return {
527
431
  flatResponse,
@@ -538,8 +442,8 @@ class PhoneNumbersImpl {
538
442
  spec: purchaseReservationOperationSpec,
539
443
  });
540
444
  const poller = new core_lro_1.LroEngine(lro, {
541
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
542
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
445
+ resumeFrom: options?.resumeFrom,
446
+ intervalInMs: options?.updateIntervalInMs,
543
447
  });
544
448
  await poller.poll();
545
449
  return poller;
@@ -568,19 +472,24 @@ class PhoneNumbersImpl {
568
472
  */
569
473
  async beginSearchAvailablePhoneNumbers(countryCode, phoneNumberType, assignmentType, capabilities, options) {
570
474
  const directSendOperation = async (args, spec) => {
571
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.beginSearchAvailablePhoneNumbers", options !== null && options !== void 0 ? options : {}, async () => {
475
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.beginSearchAvailablePhoneNumbers", options ?? {}, async () => {
572
476
  return this.client.sendOperationRequest(args, spec);
573
477
  });
574
478
  };
575
479
  const sendOperationFn = async (args, spec) => {
576
- var _a;
577
480
  let currentRawResponse = undefined;
578
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
481
+ const providedCallback = args.options?.onResponse;
579
482
  const callback = (rawResponse, flatResponse) => {
580
483
  currentRawResponse = rawResponse;
581
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
484
+ providedCallback?.(rawResponse, flatResponse);
485
+ };
486
+ const updatedArgs = {
487
+ ...args,
488
+ options: {
489
+ ...args.options,
490
+ onResponse: callback,
491
+ },
582
492
  };
583
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
584
493
  const flatResponse = await directSendOperation(updatedArgs, spec);
585
494
  return {
586
495
  flatResponse,
@@ -603,8 +512,8 @@ class PhoneNumbersImpl {
603
512
  spec: searchAvailablePhoneNumbersOperationSpec,
604
513
  });
605
514
  const poller = new core_lro_1.LroEngine(lro, {
606
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
607
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
515
+ resumeFrom: options?.resumeFrom,
516
+ intervalInMs: options?.updateIntervalInMs,
608
517
  lroResourceLocationConfig: "location",
609
518
  });
610
519
  await poller.poll();
@@ -629,7 +538,7 @@ class PhoneNumbersImpl {
629
538
  * @param options The options parameters.
630
539
  */
631
540
  async getSearchResult(searchId, options) {
632
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.getSearchResult", options !== null && options !== void 0 ? options : {}, async (options) => {
541
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.getSearchResult", options ?? {}, async (options) => {
633
542
  return this.client.sendOperationRequest({ searchId, options }, getSearchResultOperationSpec);
634
543
  });
635
544
  }
@@ -639,19 +548,24 @@ class PhoneNumbersImpl {
639
548
  */
640
549
  async beginPurchasePhoneNumbers(options) {
641
550
  const directSendOperation = async (args, spec) => {
642
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.beginPurchasePhoneNumbers", options !== null && options !== void 0 ? options : {}, async () => {
551
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.beginPurchasePhoneNumbers", options ?? {}, async () => {
643
552
  return this.client.sendOperationRequest(args, spec);
644
553
  });
645
554
  };
646
555
  const sendOperationFn = async (args, spec) => {
647
- var _a;
648
556
  let currentRawResponse = undefined;
649
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
557
+ const providedCallback = args.options?.onResponse;
650
558
  const callback = (rawResponse, flatResponse) => {
651
559
  currentRawResponse = rawResponse;
652
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
560
+ providedCallback?.(rawResponse, flatResponse);
561
+ };
562
+ const updatedArgs = {
563
+ ...args,
564
+ options: {
565
+ ...args.options,
566
+ onResponse: callback,
567
+ },
653
568
  };
654
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
655
569
  const flatResponse = await directSendOperation(updatedArgs, spec);
656
570
  return {
657
571
  flatResponse,
@@ -668,8 +582,8 @@ class PhoneNumbersImpl {
668
582
  spec: purchasePhoneNumbersOperationSpec,
669
583
  });
670
584
  const poller = new core_lro_1.LroEngine(lro, {
671
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
672
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
585
+ resumeFrom: options?.resumeFrom,
586
+ intervalInMs: options?.updateIntervalInMs,
673
587
  });
674
588
  await poller.poll();
675
589
  return poller;
@@ -688,7 +602,7 @@ class PhoneNumbersImpl {
688
602
  * @param options The options parameters.
689
603
  */
690
604
  async getOperation(operationId, options) {
691
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.getOperation", options !== null && options !== void 0 ? options : {}, async (options) => {
605
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.getOperation", options ?? {}, async (options) => {
692
606
  return this.client.sendOperationRequest({ operationId, options }, getOperationOperationSpec);
693
607
  });
694
608
  }
@@ -698,7 +612,7 @@ class PhoneNumbersImpl {
698
612
  * @param options The options parameters.
699
613
  */
700
614
  async cancelOperation(operationId, options) {
701
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.cancelOperation", options !== null && options !== void 0 ? options : {}, async (options) => {
615
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.cancelOperation", options ?? {}, async (options) => {
702
616
  return this.client.sendOperationRequest({ operationId, options }, cancelOperationOperationSpec);
703
617
  });
704
618
  }
@@ -710,19 +624,24 @@ class PhoneNumbersImpl {
710
624
  */
711
625
  async beginUpdateCapabilities(phoneNumber, options) {
712
626
  const directSendOperation = async (args, spec) => {
713
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.beginUpdateCapabilities", options !== null && options !== void 0 ? options : {}, async () => {
627
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.beginUpdateCapabilities", options ?? {}, async () => {
714
628
  return this.client.sendOperationRequest(args, spec);
715
629
  });
716
630
  };
717
631
  const sendOperationFn = async (args, spec) => {
718
- var _a;
719
632
  let currentRawResponse = undefined;
720
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
633
+ const providedCallback = args.options?.onResponse;
721
634
  const callback = (rawResponse, flatResponse) => {
722
635
  currentRawResponse = rawResponse;
723
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
636
+ providedCallback?.(rawResponse, flatResponse);
637
+ };
638
+ const updatedArgs = {
639
+ ...args,
640
+ options: {
641
+ ...args.options,
642
+ onResponse: callback,
643
+ },
724
644
  };
725
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
726
645
  const flatResponse = await directSendOperation(updatedArgs, spec);
727
646
  return {
728
647
  flatResponse,
@@ -739,8 +658,8 @@ class PhoneNumbersImpl {
739
658
  spec: updateCapabilitiesOperationSpec,
740
659
  });
741
660
  const poller = new core_lro_1.LroEngine(lro, {
742
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
743
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
661
+ resumeFrom: options?.resumeFrom,
662
+ intervalInMs: options?.updateIntervalInMs,
744
663
  lroResourceLocationConfig: "location",
745
664
  });
746
665
  await poller.poll();
@@ -763,7 +682,7 @@ class PhoneNumbersImpl {
763
682
  * @param options The options parameters.
764
683
  */
765
684
  async getByNumber(phoneNumber, options) {
766
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.getByNumber", options !== null && options !== void 0 ? options : {}, async (options) => {
685
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.getByNumber", options ?? {}, async (options) => {
767
686
  return this.client.sendOperationRequest({ phoneNumber, options }, getByNumberOperationSpec);
768
687
  });
769
688
  }
@@ -774,19 +693,24 @@ class PhoneNumbersImpl {
774
693
  */
775
694
  async beginReleasePhoneNumber(phoneNumber, options) {
776
695
  const directSendOperation = async (args, spec) => {
777
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.beginReleasePhoneNumber", options !== null && options !== void 0 ? options : {}, async () => {
696
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.beginReleasePhoneNumber", options ?? {}, async () => {
778
697
  return this.client.sendOperationRequest(args, spec);
779
698
  });
780
699
  };
781
700
  const sendOperationFn = async (args, spec) => {
782
- var _a;
783
701
  let currentRawResponse = undefined;
784
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
702
+ const providedCallback = args.options?.onResponse;
785
703
  const callback = (rawResponse, flatResponse) => {
786
704
  currentRawResponse = rawResponse;
787
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
705
+ providedCallback?.(rawResponse, flatResponse);
706
+ };
707
+ const updatedArgs = {
708
+ ...args,
709
+ options: {
710
+ ...args.options,
711
+ onResponse: callback,
712
+ },
788
713
  };
789
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
790
714
  const flatResponse = await directSendOperation(updatedArgs, spec);
791
715
  return {
792
716
  flatResponse,
@@ -803,8 +727,8 @@ class PhoneNumbersImpl {
803
727
  spec: releasePhoneNumberOperationSpec,
804
728
  });
805
729
  const poller = new core_lro_1.LroEngine(lro, {
806
- resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
807
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
730
+ resumeFrom: options?.resumeFrom,
731
+ intervalInMs: options?.updateIntervalInMs,
808
732
  });
809
733
  await poller.poll();
810
734
  return poller;
@@ -823,7 +747,7 @@ class PhoneNumbersImpl {
823
747
  * @param options The options parameters.
824
748
  */
825
749
  async _listPhoneNumbers(options) {
826
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listPhoneNumbers", options !== null && options !== void 0 ? options : {}, async (options) => {
750
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listPhoneNumbers", options ?? {}, async (options) => {
827
751
  return this.client.sendOperationRequest({ options }, listPhoneNumbersOperationSpec);
828
752
  });
829
753
  }
@@ -833,7 +757,7 @@ class PhoneNumbersImpl {
833
757
  * @param options The options parameters.
834
758
  */
835
759
  async operatorInformationSearch(phoneNumbers, options) {
836
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.operatorInformationSearch", options !== null && options !== void 0 ? options : {}, async (options) => {
760
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient.operatorInformationSearch", options ?? {}, async (options) => {
837
761
  return this.client.sendOperationRequest({ phoneNumbers, options }, operatorInformationSearchOperationSpec);
838
762
  });
839
763
  }
@@ -844,7 +768,7 @@ class PhoneNumbersImpl {
844
768
  * @param options The options parameters.
845
769
  */
846
770
  async _listAreaCodesNext(countryCode, nextLink, options) {
847
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listAreaCodesNext", options !== null && options !== void 0 ? options : {}, async (options) => {
771
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listAreaCodesNext", options ?? {}, async (options) => {
848
772
  return this.client.sendOperationRequest({ countryCode, nextLink, options }, listAreaCodesNextOperationSpec);
849
773
  });
850
774
  }
@@ -854,7 +778,7 @@ class PhoneNumbersImpl {
854
778
  * @param options The options parameters.
855
779
  */
856
780
  async _listAvailableCountriesNext(nextLink, options) {
857
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listAvailableCountriesNext", options !== null && options !== void 0 ? options : {}, async (options) => {
781
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listAvailableCountriesNext", options ?? {}, async (options) => {
858
782
  return this.client.sendOperationRequest({ nextLink, options }, listAvailableCountriesNextOperationSpec);
859
783
  });
860
784
  }
@@ -866,7 +790,7 @@ class PhoneNumbersImpl {
866
790
  * @param options The options parameters.
867
791
  */
868
792
  async _listAvailableLocalitiesNext(countryCode, nextLink, options) {
869
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listAvailableLocalitiesNext", options !== null && options !== void 0 ? options : {}, async (options) => {
793
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listAvailableLocalitiesNext", options ?? {}, async (options) => {
870
794
  return this.client.sendOperationRequest({ countryCode, nextLink, options }, listAvailableLocalitiesNextOperationSpec);
871
795
  });
872
796
  }
@@ -877,7 +801,7 @@ class PhoneNumbersImpl {
877
801
  * @param options The options parameters.
878
802
  */
879
803
  async _listOfferingsNext(countryCode, nextLink, options) {
880
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listOfferingsNext", options !== null && options !== void 0 ? options : {}, async (options) => {
804
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listOfferingsNext", options ?? {}, async (options) => {
881
805
  return this.client.sendOperationRequest({ countryCode, nextLink, options }, listOfferingsNextOperationSpec);
882
806
  });
883
807
  }
@@ -887,7 +811,7 @@ class PhoneNumbersImpl {
887
811
  * @param options The options parameters.
888
812
  */
889
813
  async _listReservationsNext(nextLink, options) {
890
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listReservationsNext", options !== null && options !== void 0 ? options : {}, async (options) => {
814
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listReservationsNext", options ?? {}, async (options) => {
891
815
  return this.client.sendOperationRequest({ nextLink, options }, listReservationsNextOperationSpec);
892
816
  });
893
817
  }
@@ -897,7 +821,7 @@ class PhoneNumbersImpl {
897
821
  * @param options The options parameters.
898
822
  */
899
823
  async _listPhoneNumbersNext(nextLink, options) {
900
- return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listPhoneNumbersNext", options !== null && options !== void 0 ? options : {}, async (options) => {
824
+ return tracing_js_1.tracingClient.withSpan("PhoneNumbersClient._listPhoneNumbersNext", options ?? {}, async (options) => {
901
825
  return this.client.sendOperationRequest({ nextLink, options }, listPhoneNumbersNextOperationSpec);
902
826
  });
903
827
  }
@@ -967,7 +891,7 @@ const browseAvailableNumbersOperationSpec = {
967
891
  assignmentType: ["options", "assignmentType"],
968
892
  phoneNumberPrefixes: ["options", "phoneNumberPrefixes"],
969
893
  },
970
- mapper: Object.assign(Object.assign({}, Mappers.PhoneNumbersBrowseRequest), { required: true }),
894
+ mapper: { ...Mappers.PhoneNumbersBrowseRequest, required: true },
971
895
  },
972
896
  queryParameters: [Parameters.apiVersion],
973
897
  urlParameters: [Parameters.endpoint, Parameters.countryCode],
@@ -1059,7 +983,7 @@ const createOrUpdateReservationOperationSpec = {
1059
983
  phoneNumbers: ["options", "phoneNumbers"],
1060
984
  status: ["options", "status"],
1061
985
  },
1062
- mapper: Object.assign(Object.assign({}, Mappers.PhoneNumbersReservation), { required: true }),
986
+ mapper: { ...Mappers.PhoneNumbersReservation, required: true },
1063
987
  },
1064
988
  queryParameters: [Parameters.apiVersion],
1065
989
  urlParameters: [Parameters.endpoint, Parameters.reservationId],
@@ -1159,7 +1083,7 @@ const searchAvailablePhoneNumbersOperationSpec = {
1159
1083
  areaCode: ["options", "areaCode"],
1160
1084
  quantity: ["options", "quantity"],
1161
1085
  },
1162
- mapper: Object.assign(Object.assign({}, Mappers.PhoneNumberSearchRequest), { required: true }),
1086
+ mapper: { ...Mappers.PhoneNumberSearchRequest, required: true },
1163
1087
  },
1164
1088
  queryParameters: [Parameters.apiVersion],
1165
1089
  urlParameters: [Parameters.endpoint, Parameters.countryCode],
@@ -1208,7 +1132,7 @@ const purchasePhoneNumbersOperationSpec = {
1208
1132
  searchId: ["options", "searchId"],
1209
1133
  agreeToNotResell: ["options", "agreeToNotResell"],
1210
1134
  },
1211
- mapper: Object.assign(Object.assign({}, Mappers.PhoneNumberPurchaseRequest), { required: true }),
1135
+ mapper: { ...Mappers.PhoneNumberPurchaseRequest, required: true },
1212
1136
  },
1213
1137
  queryParameters: [Parameters.apiVersion],
1214
1138
  urlParameters: [Parameters.endpoint],
@@ -1354,7 +1278,7 @@ const operatorInformationSearchOperationSpec = {
1354
1278
  phoneNumbers: ["phoneNumbers"],
1355
1279
  options: ["options", "options"],
1356
1280
  },
1357
- mapper: Object.assign(Object.assign({}, Mappers.OperatorInformationRequest), { required: true }),
1281
+ mapper: { ...Mappers.OperatorInformationRequest, required: true },
1358
1282
  },
1359
1283
  queryParameters: [Parameters.apiVersion],
1360
1284
  urlParameters: [Parameters.endpoint],