@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.
- package/dist/browser/generated/src/lroImpl.js +7 -3
- package/dist/browser/generated/src/lroImpl.js.map +1 -1
- package/dist/browser/generated/src/operations/phoneNumbers.js +219 -296
- package/dist/browser/generated/src/operations/phoneNumbers.js.map +1 -1
- package/dist/browser/generated/src/pagingHelper.js +2 -4
- package/dist/browser/generated/src/pagingHelper.js.map +1 -1
- package/dist/browser/generated/src/phoneNumbersClient.js +11 -4
- package/dist/browser/generated/src/phoneNumbersClient.js.map +1 -1
- package/dist/browser/generated/src/siprouting/operations/sipRouting.js +1 -0
- package/dist/browser/generated/src/siprouting/operations/sipRouting.js.map +1 -1
- package/dist/browser/generated/src/siprouting/sipRoutingClient.js +1 -0
- package/dist/browser/generated/src/siprouting/sipRoutingClient.js.map +1 -1
- package/dist/browser/generated/src/siprouting/sipRoutingClientContext.js +10 -3
- package/dist/browser/generated/src/siprouting/sipRoutingClientContext.js.map +1 -1
- package/dist/browser/generated/src/tracing.js +1 -1
- package/dist/browser/generated/src/tracing.js.map +1 -1
- package/dist/browser/phoneNumbersClient.d.ts +1 -1
- package/dist/browser/phoneNumbersClient.js +86 -28
- package/dist/browser/phoneNumbersClient.js.map +1 -1
- package/dist/browser/sipRoutingClient.js +48 -61
- package/dist/browser/sipRoutingClient.js.map +1 -1
- package/dist/browser/utils/constants.d.ts.map +1 -1
- package/dist/browser/utils/constants.js +1 -1
- package/dist/browser/utils/constants.js.map +1 -1
- package/dist/browser/utils/customPipelinePolicies.js +1 -2
- package/dist/browser/utils/customPipelinePolicies.js.map +1 -1
- package/dist/commonjs/generated/src/lroImpl.js +7 -3
- package/dist/commonjs/generated/src/lroImpl.js.map +1 -1
- package/dist/commonjs/generated/src/operations/phoneNumbers.js +219 -295
- package/dist/commonjs/generated/src/operations/phoneNumbers.js.map +1 -1
- package/dist/commonjs/generated/src/pagingHelper.js +2 -4
- package/dist/commonjs/generated/src/pagingHelper.js.map +1 -1
- package/dist/commonjs/generated/src/phoneNumbersClient.js +11 -4
- package/dist/commonjs/generated/src/phoneNumbersClient.js.map +1 -1
- package/dist/commonjs/generated/src/siprouting/operations/sipRouting.js +1 -0
- package/dist/commonjs/generated/src/siprouting/operations/sipRouting.js.map +1 -1
- package/dist/commonjs/generated/src/siprouting/sipRoutingClient.js +1 -0
- package/dist/commonjs/generated/src/siprouting/sipRoutingClient.js.map +1 -1
- package/dist/commonjs/generated/src/siprouting/sipRoutingClientContext.js +10 -3
- package/dist/commonjs/generated/src/siprouting/sipRoutingClientContext.js.map +1 -1
- package/dist/commonjs/generated/src/tracing.js +1 -1
- package/dist/commonjs/generated/src/tracing.js.map +1 -1
- package/dist/commonjs/phoneNumbersClient.d.ts +1 -1
- package/dist/commonjs/phoneNumbersClient.js +86 -28
- package/dist/commonjs/phoneNumbersClient.js.map +1 -1
- package/dist/commonjs/sipRoutingClient.js +48 -60
- package/dist/commonjs/sipRoutingClient.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/commonjs/utils/constants.d.ts.map +1 -1
- package/dist/commonjs/utils/constants.js +1 -1
- package/dist/commonjs/utils/constants.js.map +1 -1
- package/dist/commonjs/utils/customPipelinePolicies.js +1 -2
- package/dist/commonjs/utils/customPipelinePolicies.js.map +1 -1
- package/dist/esm/generated/src/lroImpl.js +7 -3
- package/dist/esm/generated/src/lroImpl.js.map +1 -1
- package/dist/esm/generated/src/operations/phoneNumbers.js +219 -296
- package/dist/esm/generated/src/operations/phoneNumbers.js.map +1 -1
- package/dist/esm/generated/src/pagingHelper.js +2 -4
- package/dist/esm/generated/src/pagingHelper.js.map +1 -1
- package/dist/esm/generated/src/phoneNumbersClient.js +11 -4
- package/dist/esm/generated/src/phoneNumbersClient.js.map +1 -1
- package/dist/esm/generated/src/siprouting/operations/sipRouting.js +1 -0
- package/dist/esm/generated/src/siprouting/operations/sipRouting.js.map +1 -1
- package/dist/esm/generated/src/siprouting/sipRoutingClient.js +1 -0
- package/dist/esm/generated/src/siprouting/sipRoutingClient.js.map +1 -1
- package/dist/esm/generated/src/siprouting/sipRoutingClientContext.js +10 -3
- package/dist/esm/generated/src/siprouting/sipRoutingClientContext.js.map +1 -1
- package/dist/esm/generated/src/tracing.js +1 -1
- package/dist/esm/generated/src/tracing.js.map +1 -1
- package/dist/esm/phoneNumbersClient.d.ts +1 -1
- package/dist/esm/phoneNumbersClient.js +86 -28
- package/dist/esm/phoneNumbersClient.js.map +1 -1
- package/dist/esm/sipRoutingClient.js +48 -61
- package/dist/esm/sipRoutingClient.js.map +1 -1
- package/dist/esm/utils/constants.d.ts.map +1 -1
- package/dist/esm/utils/constants.js +1 -1
- package/dist/esm/utils/constants.js.map +1 -1
- package/dist/esm/utils/customPipelinePolicies.js +1 -2
- package/dist/esm/utils/customPipelinePolicies.js.map +1 -1
- package/dist/react-native/generated/src/lroImpl.js +7 -3
- package/dist/react-native/generated/src/lroImpl.js.map +1 -1
- package/dist/react-native/generated/src/operations/phoneNumbers.js +219 -296
- package/dist/react-native/generated/src/operations/phoneNumbers.js.map +1 -1
- package/dist/react-native/generated/src/pagingHelper.js +2 -4
- package/dist/react-native/generated/src/pagingHelper.js.map +1 -1
- package/dist/react-native/generated/src/phoneNumbersClient.js +11 -4
- package/dist/react-native/generated/src/phoneNumbersClient.js.map +1 -1
- package/dist/react-native/generated/src/siprouting/operations/sipRouting.js +1 -0
- package/dist/react-native/generated/src/siprouting/operations/sipRouting.js.map +1 -1
- package/dist/react-native/generated/src/siprouting/sipRoutingClient.js +1 -0
- package/dist/react-native/generated/src/siprouting/sipRoutingClient.js.map +1 -1
- package/dist/react-native/generated/src/siprouting/sipRoutingClientContext.js +10 -3
- package/dist/react-native/generated/src/siprouting/sipRoutingClientContext.js.map +1 -1
- package/dist/react-native/generated/src/tracing.js +1 -1
- package/dist/react-native/generated/src/tracing.js.map +1 -1
- package/dist/react-native/phoneNumbersClient.d.ts +1 -1
- package/dist/react-native/phoneNumbersClient.js +86 -28
- package/dist/react-native/phoneNumbersClient.js.map +1 -1
- package/dist/react-native/sipRoutingClient.js +48 -61
- package/dist/react-native/sipRoutingClient.js.map +1 -1
- package/dist/react-native/utils/constants.d.ts.map +1 -1
- package/dist/react-native/utils/constants.js +1 -1
- package/dist/react-native/utils/constants.js.map +1 -1
- package/dist/react-native/utils/customPipelinePolicies.js +1 -2
- package/dist/react-native/utils/customPipelinePolicies.js.map +1 -1
- package/package.json +35 -36
|
@@ -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
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
|
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
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
|
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
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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
|
|
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
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
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
|
-
|
|
321
|
-
|
|
322
|
-
|
|
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
|
|
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
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
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
|
-
|
|
382
|
-
|
|
383
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 =
|
|
417
|
+
const providedCallback = args.options?.onResponse;
|
|
520
418
|
const callback = (rawResponse, flatResponse) => {
|
|
521
419
|
currentRawResponse = rawResponse;
|
|
522
|
-
providedCallback
|
|
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
|
|
542
|
-
intervalInMs: options
|
|
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
|
|
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 =
|
|
481
|
+
const providedCallback = args.options?.onResponse;
|
|
579
482
|
const callback = (rawResponse, flatResponse) => {
|
|
580
483
|
currentRawResponse = rawResponse;
|
|
581
|
-
providedCallback
|
|
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
|
|
607
|
-
intervalInMs: options
|
|
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
|
|
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
|
|
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 =
|
|
557
|
+
const providedCallback = args.options?.onResponse;
|
|
650
558
|
const callback = (rawResponse, flatResponse) => {
|
|
651
559
|
currentRawResponse = rawResponse;
|
|
652
|
-
providedCallback
|
|
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
|
|
672
|
-
intervalInMs: options
|
|
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
|
|
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
|
|
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
|
|
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 =
|
|
633
|
+
const providedCallback = args.options?.onResponse;
|
|
721
634
|
const callback = (rawResponse, flatResponse) => {
|
|
722
635
|
currentRawResponse = rawResponse;
|
|
723
|
-
providedCallback
|
|
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
|
|
743
|
-
intervalInMs: options
|
|
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
|
|
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
|
|
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 =
|
|
702
|
+
const providedCallback = args.options?.onResponse;
|
|
785
703
|
const callback = (rawResponse, flatResponse) => {
|
|
786
704
|
currentRawResponse = rawResponse;
|
|
787
|
-
providedCallback
|
|
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
|
|
807
|
-
intervalInMs: options
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
1281
|
+
mapper: { ...Mappers.OperatorInformationRequest, required: true },
|
|
1358
1282
|
},
|
|
1359
1283
|
queryParameters: [Parameters.apiVersion],
|
|
1360
1284
|
urlParameters: [Parameters.endpoint],
|