@azure/communication-phone-numbers 1.3.0-alpha.20250122.7 → 1.3.0-alpha.20250127.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. package/README.md +165 -186
  2. package/dist/browser/generated/src/lroImpl.d.ts.map +1 -1
  3. package/dist/browser/generated/src/lroImpl.js +0 -7
  4. package/dist/browser/generated/src/lroImpl.js.map +1 -1
  5. package/dist/browser/phoneNumbersClient.d.ts +141 -50
  6. package/dist/browser/phoneNumbersClient.d.ts.map +1 -1
  7. package/dist/browser/phoneNumbersClient.js +141 -50
  8. package/dist/browser/phoneNumbersClient.js.map +1 -1
  9. package/dist/commonjs/generated/src/lroImpl.d.ts.map +1 -1
  10. package/dist/commonjs/generated/src/lroImpl.js +0 -7
  11. package/dist/commonjs/generated/src/lroImpl.js.map +1 -1
  12. package/dist/commonjs/phoneNumbersClient.d.ts +141 -50
  13. package/dist/commonjs/phoneNumbersClient.d.ts.map +1 -1
  14. package/dist/commonjs/phoneNumbersClient.js +141 -50
  15. package/dist/commonjs/phoneNumbersClient.js.map +1 -1
  16. package/dist/esm/generated/src/lroImpl.d.ts.map +1 -1
  17. package/dist/esm/generated/src/lroImpl.js +0 -7
  18. package/dist/esm/generated/src/lroImpl.js.map +1 -1
  19. package/dist/esm/phoneNumbersClient.d.ts +141 -50
  20. package/dist/esm/phoneNumbersClient.d.ts.map +1 -1
  21. package/dist/esm/phoneNumbersClient.js +141 -50
  22. package/dist/esm/phoneNumbersClient.js.map +1 -1
  23. package/dist/react-native/generated/src/lroImpl.d.ts.map +1 -1
  24. package/dist/react-native/generated/src/lroImpl.js +0 -7
  25. package/dist/react-native/generated/src/lroImpl.js.map +1 -1
  26. package/dist/react-native/phoneNumbersClient.d.ts +141 -50
  27. package/dist/react-native/phoneNumbersClient.d.ts.map +1 -1
  28. package/dist/react-native/phoneNumbersClient.js +141 -50
  29. package/dist/react-native/phoneNumbersClient.js.map +1 -1
  30. package/package.json +16 -16
@@ -59,10 +59,18 @@ export declare class PhoneNumbersClient {
59
59
  * Iterates the purchased phone numbers.
60
60
  *
61
61
  * Example usage:
62
- * ```ts
63
- * let client = new PhoneNumbersClient(credentials);
64
- * for await (const purchased of client.listPhoneNumbers()) {
65
- * console.log("phone number: ", purchased.phoneNumber);
62
+ * ```ts snippet:PhoneNumbersClientListPurchasedPhoneNumbers
63
+ * import { DefaultAzureCredential } from "@azure/identity";
64
+ * import { PhoneNumbersClient } from "@azure/communication-phone-numbers";
65
+ *
66
+ * const credential = new DefaultAzureCredential();
67
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
68
+ *
69
+ * const phoneNumbers = client.listPurchasedPhoneNumbers();
70
+ *
71
+ * for await (const phoneNumber of phoneNumbers) {
72
+ * console.log(`The id is the same as the phone number: ${phoneNumber.id}`);
73
+ * console.log(`Phone number type is ${phoneNumber.phoneNumberType}`);
66
74
  * }
67
75
  * ```
68
76
  * List all purchased phone numbers.
@@ -75,16 +83,20 @@ export declare class PhoneNumbersClient {
75
83
  * This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.
76
84
  *
77
85
  * Example usage:
78
- * ```ts
79
- * const client = new PhoneNumbersClient(CONNECTION_STRING);
80
- * const releasePoller = await client.beginReleasePhoneNumber("+14125550100");
86
+ * ```ts snippet:PhoneNumbersClientReleasePhoneNumber
87
+ * import { DefaultAzureCredential } from "@azure/identity";
88
+ * import { PhoneNumbersClient } from "@azure/communication-phone-numbers";
81
89
  *
82
- * // Serializing the poller
83
- * const serialized = releasePoller.toString();
90
+ * const credential = new DefaultAzureCredential();
91
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
84
92
  *
85
- * // Waiting until it's done
86
- * const results = await releasePoller.pollUntilDone();
87
- * console.log(results);
93
+ * const phoneNumberToRelease = "<phone-number-to-release>";
94
+ *
95
+ * const releasePoller = await client.beginReleasePhoneNumber(phoneNumberToRelease);
96
+ *
97
+ * // Release is underway.
98
+ * await releasePoller.pollUntilDone();
99
+ * console.log("Successfully release phone number.");
88
100
  * ```
89
101
  * @param phoneNumber - The E.164 formatted phone number being released. The leading plus can be either + or encoded as %2B.
90
102
  * @param options - Additional request options.
@@ -97,16 +109,33 @@ export declare class PhoneNumbersClient {
97
109
  * This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.
98
110
  *
99
111
  * Example usage:
100
- * ```ts
101
- * const client = new PhoneNumberAdministrationClient(CONNECTION_STRING);
102
- * const searchPoller = await client.beginSearchAvailablePhoneNumbers(SEARCH_REQUEST);
112
+ * ```ts snippet:PhoneNumbersClientSearchAvailablePhoneNumbers
113
+ * import { DefaultAzureCredential } from "@azure/identity";
114
+ * import {
115
+ * PhoneNumbersClient,
116
+ * SearchAvailablePhoneNumbersRequest,
117
+ * } from "@azure/communication-phone-numbers";
118
+ *
119
+ * const credential = new DefaultAzureCredential();
120
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
103
121
  *
104
- * // Serializing the poller
105
- * const serialized = searchPoller.toString();
122
+ * const searchRequest: SearchAvailablePhoneNumbersRequest = {
123
+ * countryCode: "US",
124
+ * phoneNumberType: "tollFree",
125
+ * assignmentType: "application",
126
+ * capabilities: {
127
+ * sms: "outbound",
128
+ * calling: "none",
129
+ * },
130
+ * quantity: 1,
131
+ * };
106
132
  *
107
- * // Waiting until it's done
108
- * const results = await searchPoller.pollUntilDone();
109
- * console.log(results);
133
+ * const searchPoller = await client.beginSearchAvailablePhoneNumbers(searchRequest);
134
+ *
135
+ * // The search is underway. Wait to receive searchId.
136
+ * const searchResults = await searchPoller.pollUntilDone();
137
+ * console.log(`Found phone number: ${searchResults.phoneNumbers[0]}`);
138
+ * console.log(`searchId: ${searchResults.searchId}`);
110
139
  * ```
111
140
  *
112
141
  * @param search - Request properties to constraint the search scope.
@@ -119,16 +148,37 @@ export declare class PhoneNumbersClient {
119
148
  * This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.
120
149
  *
121
150
  * Example usage:
122
- * ```ts
123
- * const client = new PhoneNumbersClient(CONNECTION_STRING);
124
- * const purchasePoller = await client.beginPurchasePhoneNumbers(SEARCH_ID);
151
+ * ```ts snippet:PhoneNumbersClientPurchasePhoneNumbers
152
+ * import { DefaultAzureCredential } from "@azure/identity";
153
+ * import {
154
+ * PhoneNumbersClient,
155
+ * SearchAvailablePhoneNumbersRequest,
156
+ * } from "@azure/communication-phone-numbers";
157
+ *
158
+ * const credential = new DefaultAzureCredential();
159
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
160
+ *
161
+ * const searchRequest: SearchAvailablePhoneNumbersRequest = {
162
+ * countryCode: "US",
163
+ * phoneNumberType: "tollFree",
164
+ * assignmentType: "application",
165
+ * capabilities: {
166
+ * sms: "outbound",
167
+ * calling: "none",
168
+ * },
169
+ * quantity: 1,
170
+ * };
125
171
  *
126
- * // Serializing the poller
127
- * const serialized = purchasePoller.toString();
172
+ * const searchPoller = await client.beginSearchAvailablePhoneNumbers(searchRequest);
128
173
  *
129
- * // Waiting until it's done
130
- * const results = await purchasePoller.pollUntilDone();
131
- * console.log(results);
174
+ * // The search is underway. Wait to receive searchId.
175
+ * const { searchId, phoneNumbers } = await searchPoller.pollUntilDone();
176
+ *
177
+ * const purchasePoller = await client.beginPurchasePhoneNumbers(searchId);
178
+ *
179
+ * // Purchase is underway.
180
+ * await purchasePoller.pollUntilDone();
181
+ * console.log(`Successfully purchased ${phoneNumbers[0]}`);
132
182
  * ```
133
183
  *
134
184
  * @param searchId - The id of the search to purchase. Returned from `beginSearchAvailablePhoneNumbers`
@@ -141,16 +191,32 @@ export declare class PhoneNumbersClient {
141
191
  * This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.
142
192
  *
143
193
  * Example usage:
144
- * ```ts
145
- * const client = new PhoneNumbersClient(CONNECTION_STRING);
146
- * const updatePoller = await client.beginUpdatePhoneNumberCapabilities("+14125550100", UPDATE_REQUEST);
194
+ * ```ts snippet:PhoneNumbersClientUpdatePhoneNumberCapabilities
195
+ * import { DefaultAzureCredential } from "@azure/identity";
196
+ * import {
197
+ * PhoneNumbersClient,
198
+ * PhoneNumberCapabilitiesRequest,
199
+ * } from "@azure/communication-phone-numbers";
200
+ *
201
+ * const credential = new DefaultAzureCredential();
202
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
147
203
  *
148
- * // Serializing the poller
149
- * const serialized = updatePoller.toString();
204
+ * const phoneNumberToUpdate = "<phone-number-to-update>";
150
205
  *
151
- * // Waiting until it's done
152
- * const results = await updatePoller.pollUntilDone();
153
- * console.log(results);
206
+ * // This will update phone number to send and receive sms, but only send calls.
207
+ * const updateRequest: PhoneNumberCapabilitiesRequest = {
208
+ * sms: "inbound+outbound",
209
+ * calling: "outbound",
210
+ * };
211
+ *
212
+ * const updatePoller = await client.beginUpdatePhoneNumberCapabilities(
213
+ * phoneNumberToUpdate,
214
+ * updateRequest,
215
+ * );
216
+ *
217
+ * // Update is underway.
218
+ * const { capabilities } = await updatePoller.pollUntilDone();
219
+ * console.log(`These are the update capabilities: ${capabilities}`);
154
220
  * ```
155
221
  *
156
222
  * @param phoneNumber - The E.164 formatted phone number being updated. The leading plus can be either + or encoded as %2B.
@@ -162,8 +228,13 @@ export declare class PhoneNumbersClient {
162
228
  * Iterates the available countries.
163
229
  *
164
230
  * Example usage:
165
- * ```ts
166
- * let client = new PhoneNumbersClient(credentials);
231
+ * ```ts snippet:PhoneNumbersClientListAvailableCountries
232
+ * import { DefaultAzureCredential } from "@azure/identity";
233
+ * import { PhoneNumbersClient } from "@azure/communication-phone-numbers";
234
+ *
235
+ * const credential = new DefaultAzureCredential();
236
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
237
+ *
167
238
  * for await (const country of client.listAvailableCountries()) {
168
239
  * console.log("country: ", country.localizedName);
169
240
  * }
@@ -176,9 +247,14 @@ export declare class PhoneNumbersClient {
176
247
  * Iterates the available Toll-Free area codes.
177
248
  *
178
249
  * Example usage:
179
- * ```ts
180
- * let client = new PhoneNumbersClient(credentials);
181
- * for await (const areaCodeItem of client.listTollFreeAreaCodes()) {
250
+ * ```ts snippet:PhoneNumbersClientListTollFreeAreaCodes
251
+ * import { DefaultAzureCredential } from "@azure/identity";
252
+ * import { PhoneNumbersClient } from "@azure/communication-phone-numbers";
253
+ *
254
+ * const credential = new DefaultAzureCredential();
255
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
256
+ *
257
+ * for await (const areaCodeItem of client.listAvailableTollFreeAreaCodes("US")) {
182
258
  * console.log("area code: ", areaCodeItem.areaCode);
183
259
  * }
184
260
  * ```
@@ -191,9 +267,14 @@ export declare class PhoneNumbersClient {
191
267
  * Iterates the available Geographic area codes.
192
268
  *
193
269
  * Example usage:
194
- * ```ts
195
- * let client = new PhoneNumbersClient(credentials);
196
- * for await (const areaCodeItem of client.listGeographicAreaCodes()) {
270
+ * ```ts snippet:PhoneNumbersClientListGeographicAreaCodes
271
+ * import { DefaultAzureCredential } from "@azure/identity";
272
+ * import { PhoneNumbersClient } from "@azure/communication-phone-numbers";
273
+ *
274
+ * const credential = new DefaultAzureCredential();
275
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
276
+ *
277
+ * for await (const areaCodeItem of client.listAvailableGeographicAreaCodes("US")) {
197
278
  * console.log("area code: ", areaCodeItem.areaCode);
198
279
  * }
199
280
  * ```
@@ -206,9 +287,14 @@ export declare class PhoneNumbersClient {
206
287
  * Iterates the available localities.
207
288
  *
208
289
  * Example usage:
209
- * ```ts
210
- * let client = new PhoneNumbersClient(credentials);
211
- * for await (const locality of client.listAvailableLocalities()) {
290
+ * ```ts snippet:PhoneNumbersClientListAvailableLocalities
291
+ * import { DefaultAzureCredential } from "@azure/identity";
292
+ * import { PhoneNumbersClient } from "@azure/communication-phone-numbers";
293
+ *
294
+ * const credential = new DefaultAzureCredential();
295
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
296
+ *
297
+ * for await (const locality of client.listAvailableLocalities("US")) {
212
298
  * console.log("locality: ", locality.localizedName);
213
299
  * }
214
300
  * ```
@@ -221,9 +307,14 @@ export declare class PhoneNumbersClient {
221
307
  * Iterates the available offerings.
222
308
  *
223
309
  * Example usage:
224
- * ```ts
225
- * let client = new PhoneNumbersClient(credentials);
226
- * for await (const offering of client.listAvailableOfferings()) {
310
+ * ```ts snippet:PhoneNumbersClientListAvailableOfferings
311
+ * import { DefaultAzureCredential } from "@azure/identity";
312
+ * import { PhoneNumbersClient } from "@azure/communication-phone-numbers";
313
+ *
314
+ * const credential = new DefaultAzureCredential();
315
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
316
+ *
317
+ * for await (const offering of client.listAvailableOfferings("US")) {
227
318
  * console.log("phone number type: ", offering.phoneNumberType);
228
319
  * console.log("cost: ", offering.cost.amount);
229
320
  * }
@@ -1 +1 @@
1
- {"version":3,"file":"phoneNumbersClient.d.ts","sourceRoot":"","sources":["../../src/phoneNumbersClient.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAErE,OAAO,KAAK,EACV,yBAAyB,EACzB,mBAAmB,EACnB,8BAA8B,EAC9B,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,8BAA8B,EAC9B,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,EACrB,oBAAoB,EACpB,gCAAgC,EAChC,4BAA4B,EAC5B,0BAA0B,EAC1B,wBAAwB,EACxB,kCAAkC,EAClC,gCAAgC,EACjC,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,gCAAgC,EAChC,8BAA8B,EAC9B,uCAAuC,EACvC,yCAAyC,EAC1C,MAAM,gBAAgB,C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nC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,4BAAiC,GACzC,0BAA0B,CAAC,mBAAmB,CAAC;IAuBlD;;;;;;;;;;;;;;;;;;OAkBG;IACI,gCAAgC,CACrC,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,8BAAmC,GAC3C,0BAA0B,CAAC,mBAAmB,CAAC;IAsBlD;;;;;;;;;;;;;;;;;;OAkBG;IACI,uBAAuB,CAC5B,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,qBAA0B,GAClC,0BAA0B,CAAC,mBAAmB,CAAC;IAuBlD;;;;;;;;;;;;;;;;;;;OAmBG;IACI,sBAAsB,CAC3B,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,oBAAyB,GACjC,0BAA0B,CAAC,mBAAmB,CAAC;IAsBlD;;;;;OAKG;IACI,yBAAyB,CAC9B,YAAY,EAAE,MAAM,EAAE,EACtB,OAAO,GAAE,gCAA8E,GACtF,OAAO,CAAC,yBAAyB,CAAC;CAsBtC"}
@@ -47,10 +47,18 @@ export class PhoneNumbersClient {
47
47
  * Iterates the purchased phone numbers.
48
48
  *
49
49
  * Example usage:
50
- * ```ts
51
- * let client = new PhoneNumbersClient(credentials);
52
- * for await (const purchased of client.listPhoneNumbers()) {
53
- * console.log("phone number: ", purchased.phoneNumber);
50
+ * ```ts snippet:PhoneNumbersClientListPurchasedPhoneNumbers
51
+ * import { DefaultAzureCredential } from "@azure/identity";
52
+ * import { PhoneNumbersClient } from "@azure/communication-phone-numbers";
53
+ *
54
+ * const credential = new DefaultAzureCredential();
55
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
56
+ *
57
+ * const phoneNumbers = client.listPurchasedPhoneNumbers();
58
+ *
59
+ * for await (const phoneNumber of phoneNumbers) {
60
+ * console.log(`The id is the same as the phone number: ${phoneNumber.id}`);
61
+ * console.log(`Phone number type is ${phoneNumber.phoneNumberType}`);
54
62
  * }
55
63
  * ```
56
64
  * List all purchased phone numbers.
@@ -78,16 +86,20 @@ export class PhoneNumbersClient {
78
86
  * This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.
79
87
  *
80
88
  * Example usage:
81
- * ```ts
82
- * const client = new PhoneNumbersClient(CONNECTION_STRING);
83
- * const releasePoller = await client.beginReleasePhoneNumber("+14125550100");
89
+ * ```ts snippet:PhoneNumbersClientReleasePhoneNumber
90
+ * import { DefaultAzureCredential } from "@azure/identity";
91
+ * import { PhoneNumbersClient } from "@azure/communication-phone-numbers";
84
92
  *
85
- * // Serializing the poller
86
- * const serialized = releasePoller.toString();
93
+ * const credential = new DefaultAzureCredential();
94
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
87
95
  *
88
- * // Waiting until it's done
89
- * const results = await releasePoller.pollUntilDone();
90
- * console.log(results);
96
+ * const phoneNumberToRelease = "<phone-number-to-release>";
97
+ *
98
+ * const releasePoller = await client.beginReleasePhoneNumber(phoneNumberToRelease);
99
+ *
100
+ * // Release is underway.
101
+ * await releasePoller.pollUntilDone();
102
+ * console.log("Successfully release phone number.");
91
103
  * ```
92
104
  * @param phoneNumber - The E.164 formatted phone number being released. The leading plus can be either + or encoded as %2B.
93
105
  * @param options - Additional request options.
@@ -104,16 +116,33 @@ export class PhoneNumbersClient {
104
116
  * This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.
105
117
  *
106
118
  * Example usage:
107
- * ```ts
108
- * const client = new PhoneNumberAdministrationClient(CONNECTION_STRING);
109
- * const searchPoller = await client.beginSearchAvailablePhoneNumbers(SEARCH_REQUEST);
119
+ * ```ts snippet:PhoneNumbersClientSearchAvailablePhoneNumbers
120
+ * import { DefaultAzureCredential } from "@azure/identity";
121
+ * import {
122
+ * PhoneNumbersClient,
123
+ * SearchAvailablePhoneNumbersRequest,
124
+ * } from "@azure/communication-phone-numbers";
125
+ *
126
+ * const credential = new DefaultAzureCredential();
127
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
110
128
  *
111
- * // Serializing the poller
112
- * const serialized = searchPoller.toString();
129
+ * const searchRequest: SearchAvailablePhoneNumbersRequest = {
130
+ * countryCode: "US",
131
+ * phoneNumberType: "tollFree",
132
+ * assignmentType: "application",
133
+ * capabilities: {
134
+ * sms: "outbound",
135
+ * calling: "none",
136
+ * },
137
+ * quantity: 1,
138
+ * };
113
139
  *
114
- * // Waiting until it's done
115
- * const results = await searchPoller.pollUntilDone();
116
- * console.log(results);
140
+ * const searchPoller = await client.beginSearchAvailablePhoneNumbers(searchRequest);
141
+ *
142
+ * // The search is underway. Wait to receive searchId.
143
+ * const searchResults = await searchPoller.pollUntilDone();
144
+ * console.log(`Found phone number: ${searchResults.phoneNumbers[0]}`);
145
+ * console.log(`searchId: ${searchResults.searchId}`);
117
146
  * ```
118
147
  *
119
148
  * @param search - Request properties to constraint the search scope.
@@ -131,16 +160,37 @@ export class PhoneNumbersClient {
131
160
  * This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.
132
161
  *
133
162
  * Example usage:
134
- * ```ts
135
- * const client = new PhoneNumbersClient(CONNECTION_STRING);
136
- * const purchasePoller = await client.beginPurchasePhoneNumbers(SEARCH_ID);
163
+ * ```ts snippet:PhoneNumbersClientPurchasePhoneNumbers
164
+ * import { DefaultAzureCredential } from "@azure/identity";
165
+ * import {
166
+ * PhoneNumbersClient,
167
+ * SearchAvailablePhoneNumbersRequest,
168
+ * } from "@azure/communication-phone-numbers";
169
+ *
170
+ * const credential = new DefaultAzureCredential();
171
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
172
+ *
173
+ * const searchRequest: SearchAvailablePhoneNumbersRequest = {
174
+ * countryCode: "US",
175
+ * phoneNumberType: "tollFree",
176
+ * assignmentType: "application",
177
+ * capabilities: {
178
+ * sms: "outbound",
179
+ * calling: "none",
180
+ * },
181
+ * quantity: 1,
182
+ * };
137
183
  *
138
- * // Serializing the poller
139
- * const serialized = purchasePoller.toString();
184
+ * const searchPoller = await client.beginSearchAvailablePhoneNumbers(searchRequest);
140
185
  *
141
- * // Waiting until it's done
142
- * const results = await purchasePoller.pollUntilDone();
143
- * console.log(results);
186
+ * // The search is underway. Wait to receive searchId.
187
+ * const { searchId, phoneNumbers } = await searchPoller.pollUntilDone();
188
+ *
189
+ * const purchasePoller = await client.beginPurchasePhoneNumbers(searchId);
190
+ *
191
+ * // Purchase is underway.
192
+ * await purchasePoller.pollUntilDone();
193
+ * console.log(`Successfully purchased ${phoneNumbers[0]}`);
144
194
  * ```
145
195
  *
146
196
  * @param searchId - The id of the search to purchase. Returned from `beginSearchAvailablePhoneNumbers`
@@ -157,16 +207,32 @@ export class PhoneNumbersClient {
157
207
  * This function returns a Long Running Operation poller that allows you to wait indefinitely until the operation is complete.
158
208
  *
159
209
  * Example usage:
160
- * ```ts
161
- * const client = new PhoneNumbersClient(CONNECTION_STRING);
162
- * const updatePoller = await client.beginUpdatePhoneNumberCapabilities("+14125550100", UPDATE_REQUEST);
210
+ * ```ts snippet:PhoneNumbersClientUpdatePhoneNumberCapabilities
211
+ * import { DefaultAzureCredential } from "@azure/identity";
212
+ * import {
213
+ * PhoneNumbersClient,
214
+ * PhoneNumberCapabilitiesRequest,
215
+ * } from "@azure/communication-phone-numbers";
216
+ *
217
+ * const credential = new DefaultAzureCredential();
218
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
163
219
  *
164
- * // Serializing the poller
165
- * const serialized = updatePoller.toString();
220
+ * const phoneNumberToUpdate = "<phone-number-to-update>";
166
221
  *
167
- * // Waiting until it's done
168
- * const results = await updatePoller.pollUntilDone();
169
- * console.log(results);
222
+ * // This will update phone number to send and receive sms, but only send calls.
223
+ * const updateRequest: PhoneNumberCapabilitiesRequest = {
224
+ * sms: "inbound+outbound",
225
+ * calling: "outbound",
226
+ * };
227
+ *
228
+ * const updatePoller = await client.beginUpdatePhoneNumberCapabilities(
229
+ * phoneNumberToUpdate,
230
+ * updateRequest,
231
+ * );
232
+ *
233
+ * // Update is underway.
234
+ * const { capabilities } = await updatePoller.pollUntilDone();
235
+ * console.log(`These are the update capabilities: ${capabilities}`);
170
236
  * ```
171
237
  *
172
238
  * @param phoneNumber - The E.164 formatted phone number being updated. The leading plus can be either + or encoded as %2B.
@@ -185,8 +251,13 @@ export class PhoneNumbersClient {
185
251
  * Iterates the available countries.
186
252
  *
187
253
  * Example usage:
188
- * ```ts
189
- * let client = new PhoneNumbersClient(credentials);
254
+ * ```ts snippet:PhoneNumbersClientListAvailableCountries
255
+ * import { DefaultAzureCredential } from "@azure/identity";
256
+ * import { PhoneNumbersClient } from "@azure/communication-phone-numbers";
257
+ *
258
+ * const credential = new DefaultAzureCredential();
259
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
260
+ *
190
261
  * for await (const country of client.listAvailableCountries()) {
191
262
  * console.log("country: ", country.localizedName);
192
263
  * }
@@ -214,9 +285,14 @@ export class PhoneNumbersClient {
214
285
  * Iterates the available Toll-Free area codes.
215
286
  *
216
287
  * Example usage:
217
- * ```ts
218
- * let client = new PhoneNumbersClient(credentials);
219
- * for await (const areaCodeItem of client.listTollFreeAreaCodes()) {
288
+ * ```ts snippet:PhoneNumbersClientListTollFreeAreaCodes
289
+ * import { DefaultAzureCredential } from "@azure/identity";
290
+ * import { PhoneNumbersClient } from "@azure/communication-phone-numbers";
291
+ *
292
+ * const credential = new DefaultAzureCredential();
293
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
294
+ *
295
+ * for await (const areaCodeItem of client.listAvailableTollFreeAreaCodes("US")) {
220
296
  * console.log("area code: ", areaCodeItem.areaCode);
221
297
  * }
222
298
  * ```
@@ -244,9 +320,14 @@ export class PhoneNumbersClient {
244
320
  * Iterates the available Geographic area codes.
245
321
  *
246
322
  * Example usage:
247
- * ```ts
248
- * let client = new PhoneNumbersClient(credentials);
249
- * for await (const areaCodeItem of client.listGeographicAreaCodes()) {
323
+ * ```ts snippet:PhoneNumbersClientListGeographicAreaCodes
324
+ * import { DefaultAzureCredential } from "@azure/identity";
325
+ * import { PhoneNumbersClient } from "@azure/communication-phone-numbers";
326
+ *
327
+ * const credential = new DefaultAzureCredential();
328
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
329
+ *
330
+ * for await (const areaCodeItem of client.listAvailableGeographicAreaCodes("US")) {
250
331
  * console.log("area code: ", areaCodeItem.areaCode);
251
332
  * }
252
333
  * ```
@@ -274,9 +355,14 @@ export class PhoneNumbersClient {
274
355
  * Iterates the available localities.
275
356
  *
276
357
  * Example usage:
277
- * ```ts
278
- * let client = new PhoneNumbersClient(credentials);
279
- * for await (const locality of client.listAvailableLocalities()) {
358
+ * ```ts snippet:PhoneNumbersClientListAvailableLocalities
359
+ * import { DefaultAzureCredential } from "@azure/identity";
360
+ * import { PhoneNumbersClient } from "@azure/communication-phone-numbers";
361
+ *
362
+ * const credential = new DefaultAzureCredential();
363
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
364
+ *
365
+ * for await (const locality of client.listAvailableLocalities("US")) {
280
366
  * console.log("locality: ", locality.localizedName);
281
367
  * }
282
368
  * ```
@@ -304,9 +390,14 @@ export class PhoneNumbersClient {
304
390
  * Iterates the available offerings.
305
391
  *
306
392
  * Example usage:
307
- * ```ts
308
- * let client = new PhoneNumbersClient(credentials);
309
- * for await (const offering of client.listAvailableOfferings()) {
393
+ * ```ts snippet:PhoneNumbersClientListAvailableOfferings
394
+ * import { DefaultAzureCredential } from "@azure/identity";
395
+ * import { PhoneNumbersClient } from "@azure/communication-phone-numbers";
396
+ *
397
+ * const credential = new DefaultAzureCredential();
398
+ * const client = new PhoneNumbersClient("<endpoint-from-resource>", credential);
399
+ *
400
+ * for await (const offering of client.listAvailableOfferings("US")) {
310
401
  * console.log("phone number type: ", offering.phoneNumberType);
311
402
  * console.log("cost: ", offering.cost.amount);
312
403
  * }