/
index.ts
396 lines (356 loc) · 13.7 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as coreHttp from "@azure/core-http";
import { LROSYM, LROResponseInfo } from "../lro/models";
/** Represents a phone number search request to find phone numbers. Found phone numbers are temporarily held for a following purchase. */
export interface PhoneNumberSearchRequest {
/** The type of phone numbers to search for, e.g. geographic, or tollFree. */
phoneNumberType: PhoneNumberType;
/** The assignment type of the phone numbers to search for. A phone number can be assigned to a person, or to an application. */
assignmentType: PhoneNumberAssignmentType;
/** Capabilities of a phone number. */
capabilities: PhoneNumberCapabilities;
/** The area code of the desired phone number, e.g. 425. */
areaCode?: string;
/** The quantity of desired phone numbers. The default value is 1. */
quantity?: number;
}
/** Capabilities of a phone number. */
export interface PhoneNumberCapabilities {
/** Capability value for calling. */
calling: PhoneNumberCapabilityType;
/** Capability value for SMS. */
sms: PhoneNumberCapabilityType;
}
/** The result of a phone number search operation. */
export interface PhoneNumberSearchResult {
/** The search id. */
searchId: string;
/** The phone numbers that are available. Can be fewer than the desired search quantity. */
phoneNumbers: string[];
/** The phone number's type, e.g. geographic, or tollFree. */
phoneNumberType: PhoneNumberType;
/** Phone number's assignment type. */
assignmentType: PhoneNumberAssignmentType;
/** Capabilities of a phone number. */
capabilities: PhoneNumberCapabilities;
/** The incurred cost for a single phone number. */
cost: PhoneNumberCost;
/** The date that this search result expires and phone numbers are no longer on hold. A search result expires in less than 15min, e.g. 2020-11-19T16:31:49.048Z. */
searchExpiresBy: Date;
}
/** The incurred cost for a single phone number. */
export interface PhoneNumberCost {
/** The cost amount. */
amount: number;
/** The ISO 4217 currency code for the cost amount, e.g. USD. */
currencyCode: string;
/** The frequency with which the cost gets billed. */
billingFrequency: "monthly";
}
/** The Communication Services error. */
export interface CommunicationErrorResponse {
/** The Communication Services error. */
error: CommunicationError;
}
/** The Communication Services error. */
export interface CommunicationError {
/** The error code. */
code: string;
/** The error message. */
message: string;
/**
* The error target.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly target?: string;
/**
* Further details about specific errors that led to this error.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly details?: CommunicationError[];
/**
* The inner error if any.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly innerError?: CommunicationError;
}
/** The phone number search purchase request. */
export interface PhoneNumberPurchaseRequest {
/** The search id. */
searchId?: string;
}
/** Long running operation. */
export interface PhoneNumberOperation {
/** Status of operation. */
status: PhoneNumberOperationStatus;
/** URL for retrieving the result of the operation, if any. */
resourceLocation?: string;
/** The date that the operation was created. */
createdDateTime: Date;
/** The Communication Services error. */
error?: CommunicationError;
/** Id of operation. */
id: string;
/** The type of operation, e.g. Search */
operationType: PhoneNumberOperationType;
/**
* The most recent date that the operation was changed.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly lastActionDateTime?: Date;
}
/** Capabilities of a phone number. */
export interface PhoneNumberCapabilitiesRequest {
/** Capability value for calling. */
calling?: PhoneNumberCapabilityType;
/** Capability value for SMS. */
sms?: PhoneNumberCapabilityType;
}
/** Represents a purchased phone number. */
export interface PurchasedPhoneNumber {
/** The id of the phone number, e.g. 11234567890. */
id: string;
/** String of the E.164 format of the phone number, e.g. +11234567890. */
phoneNumber: string;
/** The ISO 3166-2 code of the phone number's country, e.g. US. */
countryCode: string;
/** The phone number's type, e.g. Geographic, TollFree. */
phoneNumberType: PhoneNumberType;
/** Capabilities of a phone number. */
capabilities: PhoneNumberCapabilities;
/** The assignment type of the phone number. A phone number can be assigned to a person, or to an application. */
assignmentType: PhoneNumberAssignmentType;
/** The date and time that the phone number was purchased. */
purchaseDate: Date;
/** The incurred cost for a single phone number. */
cost: PhoneNumberCost;
}
/** The list of purchased phone numbers. */
export interface PurchasedPhoneNumbers {
/** Represents a list of phone numbers. */
phoneNumbers: PurchasedPhoneNumber[];
/** Represents the URL link to the next page of phone number results. */
nextLink?: string;
}
/** Defines headers for PhoneNumbers_searchAvailablePhoneNumbers operation. */
export interface PhoneNumbersSearchAvailablePhoneNumbersHeaders {
/** URL to retrieve the final result after operation completes. */
location?: string;
/** URL to query for status of the operation. */
operationLocation?: string;
/** The operation id. */
operationId?: string;
/** The search operation id. */
searchId?: string;
}
/** Defines headers for PhoneNumbers_purchasePhoneNumbers operation. */
export interface PhoneNumbersPurchasePhoneNumbersHeaders {
/** URL to query for status of the operation. */
operationLocation?: string;
/** The operation id. */
operationId?: string;
/** The purchase operation id. */
purchaseId?: string;
}
/** Defines headers for PhoneNumbers_getOperation operation. */
export interface PhoneNumbersGetOperationHeaders {
/** Url to retrieve the final result after operation completes. */
location?: string;
}
/** Defines headers for PhoneNumbers_updateCapabilities operation. */
export interface PhoneNumbersUpdateCapabilitiesHeaders {
/** URL to retrieve the final result after operation completes. */
location?: string;
/** URL to query for status of the operation. */
operationLocation?: string;
/** The operation id. */
operationId?: string;
/** The capabilities operation id. */
capabilitiesId?: string;
}
/** Defines headers for PhoneNumbers_releasePhoneNumber operation. */
export interface PhoneNumbersReleasePhoneNumberHeaders {
/** URL to query for status of the operation. */
operationLocation?: string;
/** The operation id. */
operationId?: string;
/** The release operation id. */
releaseId?: string;
}
/** Defines values for PhoneNumberType. */
export type PhoneNumberType = "geographic" | "tollFree";
/** Defines values for PhoneNumberAssignmentType. */
export type PhoneNumberAssignmentType = "person" | "application";
/** Defines values for PhoneNumberCapabilityType. */
export type PhoneNumberCapabilityType =
| "none"
| "inbound"
| "outbound"
| "inbound+outbound";
/** Defines values for PhoneNumberOperationStatus. */
export type PhoneNumberOperationStatus =
| "notStarted"
| "running"
| "succeeded"
| "failed";
/** Defines values for PhoneNumberOperationType. */
export type PhoneNumberOperationType =
| "purchase"
| "releasePhoneNumber"
| "search"
| "updatePhoneNumberCapabilities";
/** Optional parameters. */
export interface PhoneNumbersSearchAvailablePhoneNumbersOptionalParams
extends coreHttp.OperationOptions {
/** The area code of the desired phone number, e.g. 425. */
areaCode?: string;
/** The quantity of desired phone numbers. The default value is 1. */
quantity?: number;
}
/** Contains response data for the searchAvailablePhoneNumbers operation. */
export type PhoneNumbersSearchAvailablePhoneNumbersResponse = PhoneNumbersSearchAvailablePhoneNumbersHeaders &
PhoneNumberSearchResult & {
/** The underlying HTTP response. */
_response: coreHttp.HttpResponse & {
/** The response body as text (string format) */
bodyAsText: string;
/** The response body as parsed JSON or XML */
parsedBody: PhoneNumberSearchResult;
/** The parsed HTTP response headers. */
parsedHeaders: PhoneNumbersSearchAvailablePhoneNumbersHeaders;
/** The parsed HTTP response headers. */
[LROSYM]: LROResponseInfo;
};
};
/** Contains response data for the getSearchResult operation. */
export type PhoneNumbersGetSearchResultResponse = PhoneNumberSearchResult & {
/** The underlying HTTP response. */
_response: coreHttp.HttpResponse & {
/** The response body as text (string format) */
bodyAsText: string;
/** The response body as parsed JSON or XML */
parsedBody: PhoneNumberSearchResult;
};
};
/** Optional parameters. */
export interface PhoneNumbersPurchasePhoneNumbersOptionalParams
extends coreHttp.OperationOptions {
/** The search id. */
searchId?: string;
}
/** Contains response data for the purchasePhoneNumbers operation. */
export type PhoneNumbersPurchasePhoneNumbersResponse = PhoneNumbersPurchasePhoneNumbersHeaders & {
/** The underlying HTTP response. */
_response: coreHttp.HttpResponse & {
/** The parsed HTTP response headers. */
parsedHeaders: PhoneNumbersPurchasePhoneNumbersHeaders;
/** The parsed HTTP response headers. */
[LROSYM]: LROResponseInfo;
};
};
/** Contains response data for the getOperation operation. */
export type PhoneNumbersGetOperationResponse = PhoneNumbersGetOperationHeaders &
PhoneNumberOperation & {
/** The underlying HTTP response. */
_response: coreHttp.HttpResponse & {
/** The response body as text (string format) */
bodyAsText: string;
/** The response body as parsed JSON or XML */
parsedBody: PhoneNumberOperation;
/** The parsed HTTP response headers. */
parsedHeaders: PhoneNumbersGetOperationHeaders;
};
};
/** Optional parameters. */
export interface PhoneNumbersUpdateCapabilitiesOptionalParams
extends coreHttp.OperationOptions {
/** Capability value for calling. */
calling?: PhoneNumberCapabilityType;
/** Capability value for SMS. */
sms?: PhoneNumberCapabilityType;
}
/** Contains response data for the updateCapabilities operation. */
export type PhoneNumbersUpdateCapabilitiesResponse = PhoneNumbersUpdateCapabilitiesHeaders &
PurchasedPhoneNumber & {
/** The underlying HTTP response. */
_response: coreHttp.HttpResponse & {
/** The response body as text (string format) */
bodyAsText: string;
/** The response body as parsed JSON or XML */
parsedBody: PurchasedPhoneNumber;
/** The parsed HTTP response headers. */
parsedHeaders: PhoneNumbersUpdateCapabilitiesHeaders;
/** The parsed HTTP response headers. */
[LROSYM]: LROResponseInfo;
};
};
/** Contains response data for the getByNumber operation. */
export type PhoneNumbersGetByNumberResponse = PurchasedPhoneNumber & {
/** The underlying HTTP response. */
_response: coreHttp.HttpResponse & {
/** The response body as text (string format) */
bodyAsText: string;
/** The response body as parsed JSON or XML */
parsedBody: PurchasedPhoneNumber;
};
};
/** Contains response data for the releasePhoneNumber operation. */
export type PhoneNumbersReleasePhoneNumberResponse = PhoneNumbersReleasePhoneNumberHeaders & {
/** The underlying HTTP response. */
_response: coreHttp.HttpResponse & {
/** The parsed HTTP response headers. */
parsedHeaders: PhoneNumbersReleasePhoneNumberHeaders;
/** The parsed HTTP response headers. */
[LROSYM]: LROResponseInfo;
};
};
/** Optional parameters. */
export interface PhoneNumbersListPhoneNumbersOptionalParams
extends coreHttp.OperationOptions {
/** An optional parameter for how many entries to skip, for pagination purposes. The default value is 0. */
skip?: number;
/** An optional parameter for how many entries to return, for pagination purposes. The default value is 100. */
top?: number;
}
/** Contains response data for the listPhoneNumbers operation. */
export type PhoneNumbersListPhoneNumbersResponse = PurchasedPhoneNumbers & {
/** The underlying HTTP response. */
_response: coreHttp.HttpResponse & {
/** The response body as text (string format) */
bodyAsText: string;
/** The response body as parsed JSON or XML */
parsedBody: PurchasedPhoneNumbers;
};
};
/** Optional parameters. */
export interface PhoneNumbersListPhoneNumbersNextOptionalParams
extends coreHttp.OperationOptions {
/** An optional parameter for how many entries to skip, for pagination purposes. The default value is 0. */
skip?: number;
/** An optional parameter for how many entries to return, for pagination purposes. The default value is 100. */
top?: number;
}
/** Contains response data for the listPhoneNumbersNext operation. */
export type PhoneNumbersListPhoneNumbersNextResponse = PurchasedPhoneNumbers & {
/** The underlying HTTP response. */
_response: coreHttp.HttpResponse & {
/** The response body as text (string format) */
bodyAsText: string;
/** The response body as parsed JSON or XML */
parsedBody: PurchasedPhoneNumbers;
};
};
/** Optional parameters. */
export interface PhoneNumbersClientOptionalParams
extends coreHttp.ServiceClientOptions {
/** Api Version */
apiVersion?: string;
/** Overrides client endpoint. */
endpoint?: string;
}