twilio 5.12.0 → 5.12.2
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/lib/base/BaseTwilio.d.ts +0 -1
- package/lib/base/BaseTwilio.js +0 -22
- package/lib/rest/api/v2010/account/call.d.ts +18 -18
- package/lib/rest/api/v2010/account/incomingPhoneNumber.d.ts +6 -0
- package/lib/rest/api/v2010/account/incomingPhoneNumber.js +2 -0
- package/lib/rest/flexApi/V1.d.ts +5 -0
- package/lib/rest/flexApi/V1.js +7 -0
- package/lib/rest/flexApi/v1/createFlexInstance.d.ts +163 -0
- package/lib/rest/flexApi/v1/createFlexInstance.js +159 -0
- package/lib/rest/messaging/v1/tollfreeVerification.d.ts +4 -4
- package/lib/rest/messaging/v2/channelsSender.d.ts +2 -2
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts +12 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle.js +8 -0
- package/lib/rest/oauth/V2.d.ts +5 -0
- package/lib/rest/oauth/V2.js +6 -0
- package/lib/rest/oauth/v2/authorize.d.ts +86 -0
- package/lib/rest/oauth/v2/authorize.js +121 -0
- package/lib/rest/video/v1/room/transcriptions.d.ts +2 -0
- package/lib/rest/video/v1/room/transcriptions.js +4 -0
- package/package.json +1 -1
package/lib/base/BaseTwilio.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import { Headers } from "../http/request";
|
|
|
5
5
|
import AuthStrategy from "../auth_strategy/AuthStrategy";
|
|
6
6
|
import CredentialProvider from "../credential_provider/CredentialProvider";
|
|
7
7
|
declare namespace Twilio {
|
|
8
|
-
const regionToEdgeMap: Map<string, string>;
|
|
9
8
|
interface ClientOpts {
|
|
10
9
|
httpClient?: RequestClient;
|
|
11
10
|
accountSid?: string;
|
package/lib/base/BaseTwilio.js
CHANGED
|
@@ -10,17 +10,6 @@ const util = require("util"); /* jshint ignore:line */
|
|
|
10
10
|
const RestException = require("../base/RestException"); /* jshint ignore:line */
|
|
11
11
|
var Twilio;
|
|
12
12
|
(function (Twilio) {
|
|
13
|
-
Twilio.regionToEdgeMap = new Map([
|
|
14
|
-
["au1", "sydney"],
|
|
15
|
-
["br1", "sao-paulo"],
|
|
16
|
-
["de1", "frankfurt"],
|
|
17
|
-
["ie1", "dublin"],
|
|
18
|
-
["jp1", "tokyo"],
|
|
19
|
-
["jp2", "osaka"],
|
|
20
|
-
["sg1", "singapore"],
|
|
21
|
-
["us1", "ashburn"],
|
|
22
|
-
["us2", "umatilla"],
|
|
23
|
-
]);
|
|
24
13
|
/* jshint ignore:start */
|
|
25
14
|
/**
|
|
26
15
|
* Parent class for Twilio Client that implements request & validation logic
|
|
@@ -134,17 +123,6 @@ var Twilio;
|
|
|
134
123
|
*/
|
|
135
124
|
/* jshint ignore:end */
|
|
136
125
|
request(opts) {
|
|
137
|
-
if ((this.edge !== undefined && this.region === undefined) ||
|
|
138
|
-
(this.edge === undefined && this.region !== undefined)) {
|
|
139
|
-
console.warn("[DEPRECATION WARNING] For regional processing, DNS is of format product.edge.region.twilio.com;otherwise use product.twilio.com");
|
|
140
|
-
}
|
|
141
|
-
if (this.region !== undefined && this.edge === undefined) {
|
|
142
|
-
const mappedEdge = Twilio.regionToEdgeMap.get(this.region);
|
|
143
|
-
if (mappedEdge) {
|
|
144
|
-
console.warn("Setting edge value from the region mapping");
|
|
145
|
-
this.edge = mappedEdge;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
126
|
opts = opts || {};
|
|
149
127
|
if (!opts.method) {
|
|
150
128
|
throw new Error("method is required");
|
|
@@ -130,17 +130,17 @@ export interface CallListInstanceEachOptions {
|
|
|
130
130
|
parentCallSid?: string;
|
|
131
131
|
/** The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. */
|
|
132
132
|
status?: CallStatus;
|
|
133
|
-
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date.
|
|
133
|
+
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. */
|
|
134
134
|
startTime?: Date;
|
|
135
|
-
/** Only include calls that started
|
|
135
|
+
/** Only include calls that started before this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started before this date. */
|
|
136
136
|
startTimeBefore?: Date;
|
|
137
|
-
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on
|
|
137
|
+
/** Only include calls that started on or after this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on or after this date. */
|
|
138
138
|
startTimeAfter?: Date;
|
|
139
|
-
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date.
|
|
139
|
+
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. */
|
|
140
140
|
endTime?: Date;
|
|
141
|
-
/** Only include calls that ended
|
|
141
|
+
/** Only include calls that ended before this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended before this date. */
|
|
142
142
|
endTimeBefore?: Date;
|
|
143
|
-
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on
|
|
143
|
+
/** Only include calls that ended on or after this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on or after this date. */
|
|
144
144
|
endTimeAfter?: Date;
|
|
145
145
|
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
146
146
|
pageSize?: number;
|
|
@@ -163,17 +163,17 @@ export interface CallListInstanceOptions {
|
|
|
163
163
|
parentCallSid?: string;
|
|
164
164
|
/** The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. */
|
|
165
165
|
status?: CallStatus;
|
|
166
|
-
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date.
|
|
166
|
+
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. */
|
|
167
167
|
startTime?: Date;
|
|
168
|
-
/** Only include calls that started
|
|
168
|
+
/** Only include calls that started before this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started before this date. */
|
|
169
169
|
startTimeBefore?: Date;
|
|
170
|
-
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on
|
|
170
|
+
/** Only include calls that started on or after this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on or after this date. */
|
|
171
171
|
startTimeAfter?: Date;
|
|
172
|
-
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date.
|
|
172
|
+
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. */
|
|
173
173
|
endTime?: Date;
|
|
174
|
-
/** Only include calls that ended
|
|
174
|
+
/** Only include calls that ended before this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended before this date. */
|
|
175
175
|
endTimeBefore?: Date;
|
|
176
|
-
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on
|
|
176
|
+
/** Only include calls that ended on or after this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on or after this date. */
|
|
177
177
|
endTimeAfter?: Date;
|
|
178
178
|
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
179
179
|
pageSize?: number;
|
|
@@ -192,17 +192,17 @@ export interface CallListInstancePageOptions {
|
|
|
192
192
|
parentCallSid?: string;
|
|
193
193
|
/** The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. */
|
|
194
194
|
status?: CallStatus;
|
|
195
|
-
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date.
|
|
195
|
+
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. */
|
|
196
196
|
startTime?: Date;
|
|
197
|
-
/** Only include calls that started
|
|
197
|
+
/** Only include calls that started before this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started before this date. */
|
|
198
198
|
startTimeBefore?: Date;
|
|
199
|
-
/** Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on
|
|
199
|
+
/** Only include calls that started on or after this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on or after this date. */
|
|
200
200
|
startTimeAfter?: Date;
|
|
201
|
-
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date.
|
|
201
|
+
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. */
|
|
202
202
|
endTime?: Date;
|
|
203
|
-
/** Only include calls that ended
|
|
203
|
+
/** Only include calls that ended before this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended before this date. */
|
|
204
204
|
endTimeBefore?: Date;
|
|
205
|
-
/** Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on
|
|
205
|
+
/** Only include calls that ended on or after this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on or after this date. */
|
|
206
206
|
endTimeAfter?: Date;
|
|
207
207
|
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
208
208
|
pageSize?: number;
|
|
@@ -319,6 +319,7 @@ interface IncomingPhoneNumberResource {
|
|
|
319
319
|
emergency_address_status: IncomingPhoneNumberEmergencyAddressStatus;
|
|
320
320
|
bundle_sid: string;
|
|
321
321
|
status: string;
|
|
322
|
+
type: string;
|
|
322
323
|
}
|
|
323
324
|
export declare class IncomingPhoneNumberInstance {
|
|
324
325
|
protected _version: V2010;
|
|
@@ -443,6 +444,10 @@ export declare class IncomingPhoneNumberInstance {
|
|
|
443
444
|
*/
|
|
444
445
|
bundleSid: string;
|
|
445
446
|
status: string;
|
|
447
|
+
/**
|
|
448
|
+
* The phone number type.
|
|
449
|
+
*/
|
|
450
|
+
type: string;
|
|
446
451
|
private get _proxy();
|
|
447
452
|
/**
|
|
448
453
|
* Remove a IncomingPhoneNumberInstance
|
|
@@ -554,6 +559,7 @@ export declare class IncomingPhoneNumberInstance {
|
|
|
554
559
|
emergencyAddressStatus: IncomingPhoneNumberEmergencyAddressStatus;
|
|
555
560
|
bundleSid: string;
|
|
556
561
|
status: string;
|
|
562
|
+
type: string;
|
|
557
563
|
};
|
|
558
564
|
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
559
565
|
}
|
|
@@ -296,6 +296,7 @@ class IncomingPhoneNumberInstance {
|
|
|
296
296
|
this.emergencyAddressStatus = payload.emergency_address_status;
|
|
297
297
|
this.bundleSid = payload.bundle_sid;
|
|
298
298
|
this.status = payload.status;
|
|
299
|
+
this.type = payload.type;
|
|
299
300
|
this._solution = { accountSid, sid: sid || this.sid };
|
|
300
301
|
}
|
|
301
302
|
get _proxy() {
|
|
@@ -397,6 +398,7 @@ class IncomingPhoneNumberInstance {
|
|
|
397
398
|
emergencyAddressStatus: this.emergencyAddressStatus,
|
|
398
399
|
bundleSid: this.bundleSid,
|
|
399
400
|
status: this.status,
|
|
401
|
+
type: this.type,
|
|
400
402
|
};
|
|
401
403
|
}
|
|
402
404
|
[util_1.inspect.custom](_depth, options) {
|
package/lib/rest/flexApi/V1.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import Version from "../../base/Version";
|
|
|
3
3
|
import { AssessmentsListInstance } from "./v1/assessments";
|
|
4
4
|
import { ChannelListInstance } from "./v1/channel";
|
|
5
5
|
import { ConfigurationListInstance } from "./v1/configuration";
|
|
6
|
+
import { CreateFlexInstanceListInstance } from "./v1/createFlexInstance";
|
|
6
7
|
import { FlexFlowListInstance } from "./v1/flexFlow";
|
|
7
8
|
import { InsightsAssessmentsCommentListInstance } from "./v1/insightsAssessmentsComment";
|
|
8
9
|
import { InsightsConversationsListInstance } from "./v1/insightsConversations";
|
|
@@ -36,6 +37,8 @@ export default class V1 extends Version {
|
|
|
36
37
|
protected _channel?: ChannelListInstance;
|
|
37
38
|
/** configuration - { Twilio.FlexApi.V1.ConfigurationListInstance } resource */
|
|
38
39
|
protected _configuration?: ConfigurationListInstance;
|
|
40
|
+
/** createFlexInstance - { Twilio.FlexApi.V1.CreateFlexInstanceListInstance } resource */
|
|
41
|
+
protected _createFlexInstance?: CreateFlexInstanceListInstance;
|
|
39
42
|
/** flexFlow - { Twilio.FlexApi.V1.FlexFlowListInstance } resource */
|
|
40
43
|
protected _flexFlow?: FlexFlowListInstance;
|
|
41
44
|
/** insightsAssessmentsComment - { Twilio.FlexApi.V1.InsightsAssessmentsCommentListInstance } resource */
|
|
@@ -82,6 +85,8 @@ export default class V1 extends Version {
|
|
|
82
85
|
get channel(): ChannelListInstance;
|
|
83
86
|
/** Getter for configuration resource */
|
|
84
87
|
get configuration(): ConfigurationListInstance;
|
|
88
|
+
/** Getter for createFlexInstance resource */
|
|
89
|
+
get createFlexInstance(): CreateFlexInstanceListInstance;
|
|
85
90
|
/** Getter for flexFlow resource */
|
|
86
91
|
get flexFlow(): FlexFlowListInstance;
|
|
87
92
|
/** Getter for insightsAssessmentsComment resource */
|
package/lib/rest/flexApi/V1.js
CHANGED
|
@@ -20,6 +20,7 @@ const Version_1 = __importDefault(require("../../base/Version"));
|
|
|
20
20
|
const assessments_1 = require("./v1/assessments");
|
|
21
21
|
const channel_1 = require("./v1/channel");
|
|
22
22
|
const configuration_1 = require("./v1/configuration");
|
|
23
|
+
const createFlexInstance_1 = require("./v1/createFlexInstance");
|
|
23
24
|
const flexFlow_1 = require("./v1/flexFlow");
|
|
24
25
|
const insightsAssessmentsComment_1 = require("./v1/insightsAssessmentsComment");
|
|
25
26
|
const insightsConversations_1 = require("./v1/insightsConversations");
|
|
@@ -65,6 +66,12 @@ class V1 extends Version_1.default {
|
|
|
65
66
|
this._configuration || (0, configuration_1.ConfigurationListInstance)(this);
|
|
66
67
|
return this._configuration;
|
|
67
68
|
}
|
|
69
|
+
/** Getter for createFlexInstance resource */
|
|
70
|
+
get createFlexInstance() {
|
|
71
|
+
this._createFlexInstance =
|
|
72
|
+
this._createFlexInstance || (0, createFlexInstance_1.CreateFlexInstanceListInstance)(this);
|
|
73
|
+
return this._createFlexInstance;
|
|
74
|
+
}
|
|
68
75
|
/** Getter for flexFlow resource */
|
|
69
76
|
get flexFlow() {
|
|
70
77
|
this._flexFlow = this._flexFlow || (0, flexFlow_1.FlexFlowListInstance)(this);
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { inspect, InspectOptions } from "util";
|
|
2
|
+
import V1 from "../V1";
|
|
3
|
+
import { ApiResponse } from "../../../base/ApiResponse";
|
|
4
|
+
export declare class CreateInstanceRequestBody {
|
|
5
|
+
"conversation"?: CreateInstanceRequestBodyConversation;
|
|
6
|
+
}
|
|
7
|
+
export declare class CreateInstanceRequestBodyConversation {
|
|
8
|
+
/**
|
|
9
|
+
* Set newly created conversation service as the default conversation service
|
|
10
|
+
*/
|
|
11
|
+
"_default"?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Options to pass to create a CreateFlexInstanceInstance
|
|
15
|
+
*/
|
|
16
|
+
export interface CreateFlexInstanceContextCreateOptions {
|
|
17
|
+
/** */
|
|
18
|
+
createInstanceRequestBody?: CreateInstanceRequestBody;
|
|
19
|
+
}
|
|
20
|
+
export interface CreateFlexInstanceContext {
|
|
21
|
+
/**
|
|
22
|
+
* Create a CreateFlexInstanceInstance
|
|
23
|
+
*
|
|
24
|
+
* @param callback - Callback to handle processed record
|
|
25
|
+
*
|
|
26
|
+
* @returns Resolves to processed CreateFlexInstanceInstance
|
|
27
|
+
*/
|
|
28
|
+
create(callback?: (error: Error | null, item?: CreateFlexInstanceInstance) => any): Promise<CreateFlexInstanceInstance>;
|
|
29
|
+
/**
|
|
30
|
+
* Create a CreateFlexInstanceInstance
|
|
31
|
+
*
|
|
32
|
+
* @param params - Body for request
|
|
33
|
+
* @param headers - header params for request
|
|
34
|
+
* @param callback - Callback to handle processed record
|
|
35
|
+
*
|
|
36
|
+
* @returns Resolves to processed CreateFlexInstanceInstance
|
|
37
|
+
*/
|
|
38
|
+
create(params: CreateInstanceRequestBody, headers?: any, callback?: (error: Error | null, item?: CreateFlexInstanceInstance) => any): Promise<CreateFlexInstanceInstance>;
|
|
39
|
+
/**
|
|
40
|
+
* Create a CreateFlexInstanceInstance and return HTTP info
|
|
41
|
+
*
|
|
42
|
+
* @param callback - Callback to handle processed record
|
|
43
|
+
*
|
|
44
|
+
* @returns Resolves to processed CreateFlexInstanceInstance with HTTP metadata
|
|
45
|
+
*/
|
|
46
|
+
createWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<CreateFlexInstanceInstance>) => any): Promise<ApiResponse<CreateFlexInstanceInstance>>;
|
|
47
|
+
/**
|
|
48
|
+
* Create a CreateFlexInstanceInstance and return HTTP info
|
|
49
|
+
*
|
|
50
|
+
* @param params - Body for request
|
|
51
|
+
* @param headers - header params for request
|
|
52
|
+
* @param callback - Callback to handle processed record
|
|
53
|
+
*
|
|
54
|
+
* @returns Resolves to processed CreateFlexInstanceInstance with HTTP metadata
|
|
55
|
+
*/
|
|
56
|
+
createWithHttpInfo(params: CreateInstanceRequestBody, headers?: any, callback?: (error: Error | null, item?: ApiResponse<CreateFlexInstanceInstance>) => any): Promise<ApiResponse<CreateFlexInstanceInstance>>;
|
|
57
|
+
/**
|
|
58
|
+
* Provide a user-friendly representation
|
|
59
|
+
*/
|
|
60
|
+
toJSON(): any;
|
|
61
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
62
|
+
}
|
|
63
|
+
export interface CreateFlexInstanceContextSolution {
|
|
64
|
+
}
|
|
65
|
+
export declare class CreateFlexInstanceContextImpl implements CreateFlexInstanceContext {
|
|
66
|
+
protected _version: V1;
|
|
67
|
+
protected _solution: CreateFlexInstanceContextSolution;
|
|
68
|
+
protected _uri: string;
|
|
69
|
+
constructor(_version: V1);
|
|
70
|
+
create(params?: CreateInstanceRequestBody | ((error: Error | null, item?: CreateFlexInstanceInstance) => any), headers?: any, callback?: (error: Error | null, item?: CreateFlexInstanceInstance) => any): Promise<CreateFlexInstanceInstance>;
|
|
71
|
+
createWithHttpInfo(params?: CreateInstanceRequestBody | ((error: Error | null, item?: ApiResponse<CreateFlexInstanceInstance>) => any), headers?: any, callback?: (error: Error | null, item?: ApiResponse<CreateFlexInstanceInstance>) => any): Promise<ApiResponse<CreateFlexInstanceInstance>>;
|
|
72
|
+
/**
|
|
73
|
+
* Provide a user-friendly representation
|
|
74
|
+
*
|
|
75
|
+
* @returns Object
|
|
76
|
+
*/
|
|
77
|
+
toJSON(): CreateFlexInstanceContextSolution;
|
|
78
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
79
|
+
}
|
|
80
|
+
interface CreateFlexInstanceResource {
|
|
81
|
+
flex_instance_sid: string;
|
|
82
|
+
account_sid: string;
|
|
83
|
+
status: string;
|
|
84
|
+
date_created: Date;
|
|
85
|
+
date_updated: Date;
|
|
86
|
+
}
|
|
87
|
+
export declare class CreateFlexInstanceInstance {
|
|
88
|
+
protected _version: V1;
|
|
89
|
+
protected _solution: CreateFlexInstanceContextSolution;
|
|
90
|
+
protected _context?: CreateFlexInstanceContext;
|
|
91
|
+
constructor(_version: V1, payload: CreateFlexInstanceResource);
|
|
92
|
+
flexInstanceSid: string;
|
|
93
|
+
accountSid: string;
|
|
94
|
+
status: string;
|
|
95
|
+
dateCreated: Date;
|
|
96
|
+
dateUpdated: Date;
|
|
97
|
+
private get _proxy();
|
|
98
|
+
/**
|
|
99
|
+
* Create a CreateFlexInstanceInstance
|
|
100
|
+
*
|
|
101
|
+
* @param callback - Callback to handle processed record
|
|
102
|
+
*
|
|
103
|
+
* @returns Resolves to processed CreateFlexInstanceInstance
|
|
104
|
+
*/
|
|
105
|
+
create(callback?: (error: Error | null, item?: CreateFlexInstanceInstance) => any): Promise<CreateFlexInstanceInstance>;
|
|
106
|
+
/**
|
|
107
|
+
* Create a CreateFlexInstanceInstance
|
|
108
|
+
*
|
|
109
|
+
* @param params - Body for request
|
|
110
|
+
* @param headers - header params for request
|
|
111
|
+
* @param callback - Callback to handle processed record
|
|
112
|
+
*
|
|
113
|
+
* @returns Resolves to processed CreateFlexInstanceInstance
|
|
114
|
+
*/
|
|
115
|
+
create(params: CreateInstanceRequestBody, headers?: any, callback?: (error: Error | null, item?: CreateFlexInstanceInstance) => any): Promise<CreateFlexInstanceInstance>;
|
|
116
|
+
/**
|
|
117
|
+
* Create a CreateFlexInstanceInstance and return HTTP info
|
|
118
|
+
*
|
|
119
|
+
* @param callback - Callback to handle processed record
|
|
120
|
+
*
|
|
121
|
+
* @returns Resolves to processed CreateFlexInstanceInstance with HTTP metadata
|
|
122
|
+
*/
|
|
123
|
+
createWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<CreateFlexInstanceInstance>) => any): Promise<ApiResponse<CreateFlexInstanceInstance>>;
|
|
124
|
+
/**
|
|
125
|
+
* Create a CreateFlexInstanceInstance and return HTTP info
|
|
126
|
+
*
|
|
127
|
+
* @param params - Body for request
|
|
128
|
+
* @param headers - header params for request
|
|
129
|
+
* @param callback - Callback to handle processed record
|
|
130
|
+
*
|
|
131
|
+
* @returns Resolves to processed CreateFlexInstanceInstance with HTTP metadata
|
|
132
|
+
*/
|
|
133
|
+
createWithHttpInfo(params: CreateInstanceRequestBody, headers?: any, callback?: (error: Error | null, item?: ApiResponse<CreateFlexInstanceInstance>) => any): Promise<ApiResponse<CreateFlexInstanceInstance>>;
|
|
134
|
+
/**
|
|
135
|
+
* Provide a user-friendly representation
|
|
136
|
+
*
|
|
137
|
+
* @returns Object
|
|
138
|
+
*/
|
|
139
|
+
toJSON(): {
|
|
140
|
+
flexInstanceSid: string;
|
|
141
|
+
accountSid: string;
|
|
142
|
+
status: string;
|
|
143
|
+
dateCreated: Date;
|
|
144
|
+
dateUpdated: Date;
|
|
145
|
+
};
|
|
146
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
147
|
+
}
|
|
148
|
+
export interface CreateFlexInstanceSolution {
|
|
149
|
+
}
|
|
150
|
+
export interface CreateFlexInstanceListInstance {
|
|
151
|
+
_version: V1;
|
|
152
|
+
_solution: CreateFlexInstanceSolution;
|
|
153
|
+
_uri: string;
|
|
154
|
+
(): CreateFlexInstanceContext;
|
|
155
|
+
get(): CreateFlexInstanceContext;
|
|
156
|
+
/**
|
|
157
|
+
* Provide a user-friendly representation
|
|
158
|
+
*/
|
|
159
|
+
toJSON(): any;
|
|
160
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
161
|
+
}
|
|
162
|
+
export declare function CreateFlexInstanceListInstance(version: V1): CreateFlexInstanceListInstance;
|
|
163
|
+
export {};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Flex
|
|
9
|
+
* This is the public Twilio REST API.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator.
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.CreateFlexInstanceInstance = exports.CreateFlexInstanceContextImpl = exports.CreateInstanceRequestBodyConversation = exports.CreateInstanceRequestBody = void 0;
|
|
17
|
+
exports.CreateFlexInstanceListInstance = CreateFlexInstanceListInstance;
|
|
18
|
+
const util_1 = require("util");
|
|
19
|
+
const deserialize = require("../../../base/deserialize");
|
|
20
|
+
const serialize = require("../../../base/serialize");
|
|
21
|
+
class CreateInstanceRequestBody {
|
|
22
|
+
}
|
|
23
|
+
exports.CreateInstanceRequestBody = CreateInstanceRequestBody;
|
|
24
|
+
class CreateInstanceRequestBodyConversation {
|
|
25
|
+
}
|
|
26
|
+
exports.CreateInstanceRequestBodyConversation = CreateInstanceRequestBodyConversation;
|
|
27
|
+
class CreateFlexInstanceContextImpl {
|
|
28
|
+
constructor(_version) {
|
|
29
|
+
this._version = _version;
|
|
30
|
+
this._solution = {};
|
|
31
|
+
this._uri = `/Instances`;
|
|
32
|
+
}
|
|
33
|
+
create(params, headers, callback) {
|
|
34
|
+
if (params instanceof Function) {
|
|
35
|
+
callback = params;
|
|
36
|
+
params = {};
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
params = params || {};
|
|
40
|
+
}
|
|
41
|
+
let data = {};
|
|
42
|
+
data = params;
|
|
43
|
+
if (headers === null || headers === undefined) {
|
|
44
|
+
headers = {};
|
|
45
|
+
}
|
|
46
|
+
headers["Content-Type"] = "application/json";
|
|
47
|
+
headers["Accept"] = "application/json";
|
|
48
|
+
const instance = this;
|
|
49
|
+
let operationVersion = instance._version, operationPromise = operationVersion.create({
|
|
50
|
+
uri: instance._uri,
|
|
51
|
+
method: "post",
|
|
52
|
+
data,
|
|
53
|
+
headers,
|
|
54
|
+
});
|
|
55
|
+
operationPromise = operationPromise.then((payload) => new CreateFlexInstanceInstance(operationVersion, payload));
|
|
56
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
57
|
+
return operationPromise;
|
|
58
|
+
}
|
|
59
|
+
createWithHttpInfo(params, headers, callback) {
|
|
60
|
+
if (params instanceof Function) {
|
|
61
|
+
callback = params;
|
|
62
|
+
params = {};
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
params = params || {};
|
|
66
|
+
}
|
|
67
|
+
let data = {};
|
|
68
|
+
data = params;
|
|
69
|
+
if (headers === null || headers === undefined) {
|
|
70
|
+
headers = {};
|
|
71
|
+
}
|
|
72
|
+
headers["Content-Type"] = "application/json";
|
|
73
|
+
headers["Accept"] = "application/json";
|
|
74
|
+
const instance = this;
|
|
75
|
+
let operationVersion = instance._version;
|
|
76
|
+
// CREATE, FETCH, UPDATE operations
|
|
77
|
+
let operationPromise = operationVersion
|
|
78
|
+
.createWithResponseInfo({
|
|
79
|
+
uri: instance._uri,
|
|
80
|
+
method: "post",
|
|
81
|
+
data,
|
|
82
|
+
headers,
|
|
83
|
+
})
|
|
84
|
+
.then((response) => ({
|
|
85
|
+
...response,
|
|
86
|
+
body: new CreateFlexInstanceInstance(operationVersion, response.body),
|
|
87
|
+
}));
|
|
88
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
89
|
+
return operationPromise;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Provide a user-friendly representation
|
|
93
|
+
*
|
|
94
|
+
* @returns Object
|
|
95
|
+
*/
|
|
96
|
+
toJSON() {
|
|
97
|
+
return this._solution;
|
|
98
|
+
}
|
|
99
|
+
[util_1.inspect.custom](_depth, options) {
|
|
100
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.CreateFlexInstanceContextImpl = CreateFlexInstanceContextImpl;
|
|
104
|
+
class CreateFlexInstanceInstance {
|
|
105
|
+
constructor(_version, payload) {
|
|
106
|
+
this._version = _version;
|
|
107
|
+
this.flexInstanceSid = payload.flex_instance_sid;
|
|
108
|
+
this.accountSid = payload.account_sid;
|
|
109
|
+
this.status = payload.status;
|
|
110
|
+
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
|
111
|
+
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
|
112
|
+
this._solution = {};
|
|
113
|
+
}
|
|
114
|
+
get _proxy() {
|
|
115
|
+
this._context =
|
|
116
|
+
this._context || new CreateFlexInstanceContextImpl(this._version);
|
|
117
|
+
return this._context;
|
|
118
|
+
}
|
|
119
|
+
create(params, callback) {
|
|
120
|
+
return this._proxy.create(params, callback);
|
|
121
|
+
}
|
|
122
|
+
createWithHttpInfo(params, callback) {
|
|
123
|
+
return this._proxy.createWithHttpInfo(params, callback);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Provide a user-friendly representation
|
|
127
|
+
*
|
|
128
|
+
* @returns Object
|
|
129
|
+
*/
|
|
130
|
+
toJSON() {
|
|
131
|
+
return {
|
|
132
|
+
flexInstanceSid: this.flexInstanceSid,
|
|
133
|
+
accountSid: this.accountSid,
|
|
134
|
+
status: this.status,
|
|
135
|
+
dateCreated: this.dateCreated,
|
|
136
|
+
dateUpdated: this.dateUpdated,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
[util_1.inspect.custom](_depth, options) {
|
|
140
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
exports.CreateFlexInstanceInstance = CreateFlexInstanceInstance;
|
|
144
|
+
function CreateFlexInstanceListInstance(version) {
|
|
145
|
+
const instance = (() => instance.get());
|
|
146
|
+
instance.get = function get() {
|
|
147
|
+
return new CreateFlexInstanceContextImpl(version);
|
|
148
|
+
};
|
|
149
|
+
instance._version = version;
|
|
150
|
+
instance._solution = {};
|
|
151
|
+
instance._uri = ``;
|
|
152
|
+
instance.toJSON = function toJSON() {
|
|
153
|
+
return instance._solution;
|
|
154
|
+
};
|
|
155
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
156
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
157
|
+
};
|
|
158
|
+
return instance;
|
|
159
|
+
}
|
|
@@ -140,13 +140,13 @@ export interface TollfreeVerificationListInstanceCreateOptions {
|
|
|
140
140
|
businessContactPhone?: string;
|
|
141
141
|
/** An optional external reference ID supplied by customer and echoed back on status retrieval. */
|
|
142
142
|
externalReferenceId?: string;
|
|
143
|
-
/** A legally recognized business registration number */
|
|
143
|
+
/** A legally recognized business registration number. Required for all business types except SOLE_PROPRIETOR. */
|
|
144
144
|
businessRegistrationNumber?: string;
|
|
145
|
-
/** The organizational authority for business registrations */
|
|
145
|
+
/** The organizational authority for business registrations. Required for all business types except SOLE_PROPRIETOR. */
|
|
146
146
|
businessRegistrationAuthority?: string;
|
|
147
|
-
/**
|
|
147
|
+
/** The country where the business is registered. Required for all business types except SOLE_PROPRIETOR. */
|
|
148
148
|
businessRegistrationCountry?: string;
|
|
149
|
-
/** The type of business, valid values are PRIVATE_PROFIT, PUBLIC_PROFIT, NON_PROFIT, SOLE_PROPRIETOR, GOVERNMENT */
|
|
149
|
+
/** The type of business, valid values are PRIVATE_PROFIT, PUBLIC_PROFIT, NON_PROFIT, SOLE_PROPRIETOR, GOVERNMENT. Required field. */
|
|
150
150
|
businessType?: string;
|
|
151
151
|
/** The E.164 formatted number associated with the business. */
|
|
152
152
|
businessRegistrationPhoneNumber?: string;
|
|
@@ -83,7 +83,7 @@ export declare class MessagingV2ChannelsSenderProfile {
|
|
|
83
83
|
*/
|
|
84
84
|
"accentColor"?: string | null;
|
|
85
85
|
/**
|
|
86
|
-
* The vertical of the sender. Allowed values are: - `Automotive` - `Beauty, Spa and Salon` - `Clothing and Apparel` - `Education` - `Entertainment` - `Event Planning and Service` - `Finance and Banking` - `Food and Grocery` - `
|
|
86
|
+
* The vertical of the sender. Allowed values are: - `Alcohol` - `Automotive` - `Beauty, Spa and Salon` - `Clothing and Apparel` - `Education` - `Entertainment` - `Event Planning and Service` - `Finance and Banking` - `Food and Grocery` - `Hotel and Lodging` - `Matrimony Service` - `Medical and Health` - `Non-profit` - `Online Gambling` - `OTC Drugs` - `Other` - `Physical Gambling` - `Professional Services` - `Public Service` - `Restaurant` - `Shopping and Retail` - `Travel and Transportation`
|
|
87
87
|
*/
|
|
88
88
|
"vertical"?: string | null;
|
|
89
89
|
/**
|
|
@@ -140,7 +140,7 @@ export declare class MessagingV2ChannelsSenderProfileGenericResponse {
|
|
|
140
140
|
*/
|
|
141
141
|
"accentColor"?: string | null;
|
|
142
142
|
/**
|
|
143
|
-
* The vertical of the sender. Allowed values are: - `Automotive` - `Beauty, Spa and Salon` - `Clothing and Apparel` - `Education` - `Entertainment` - `Event Planning and Service` - `Finance and Banking` - `Food and Grocery` - `
|
|
143
|
+
* The vertical of the sender. Allowed values are: - `Alcohol` - `Automotive` - `Beauty, Spa and Salon` - `Clothing and Apparel` - `Education` - `Entertainment` - `Event Planning and Service` - `Finance and Banking` - `Food and Grocery` - `Hotel and Lodging` - `Matrimony Service` - `Medical and Health` - `Non-profit` - `Online Gambling` - `OTC Drugs` - `Other` - `Physical Gambling` - `Professional Services` - `Public Service` - `Restaurant` - `Shopping and Retail` - `Travel and Transportation`
|
|
144
144
|
*/
|
|
145
145
|
"vertical"?: string | null;
|
|
146
146
|
/**
|
|
@@ -54,6 +54,8 @@ export interface BundleListInstanceCreateOptions {
|
|
|
54
54
|
export interface BundleListInstanceEachOptions {
|
|
55
55
|
/** The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details. */
|
|
56
56
|
status?: BundleStatus;
|
|
57
|
+
/** A comma-separated list of Bundle SIDs to filter the results (maximum 20). Each Bundle SID must match `^BU[0-9a-fA-F]{32}$`. */
|
|
58
|
+
bundleSids?: string;
|
|
57
59
|
/** The string that you assigned to describe the resource. The column can contain 255 variable characters. */
|
|
58
60
|
friendlyName?: string;
|
|
59
61
|
/** The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. */
|
|
@@ -62,6 +64,8 @@ export interface BundleListInstanceEachOptions {
|
|
|
62
64
|
isoCountry?: string;
|
|
63
65
|
/** The type of phone number of the Bundle\'s ownership request. Can be `local`, `mobile`, `national`, or `toll-free`. */
|
|
64
66
|
numberType?: string;
|
|
67
|
+
/** The end user type of the regulation of the Bundle. Can be `business` or `individual`. */
|
|
68
|
+
endUserType?: "business" | "individual";
|
|
65
69
|
/** Indicates that the Bundle is a valid Bundle until a specified expiration date. */
|
|
66
70
|
hasValidUntilDate?: boolean;
|
|
67
71
|
/** Can be `valid-until` or `date-updated`. Defaults to `date-created`. */
|
|
@@ -89,6 +93,8 @@ export interface BundleListInstanceEachOptions {
|
|
|
89
93
|
export interface BundleListInstanceOptions {
|
|
90
94
|
/** The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details. */
|
|
91
95
|
status?: BundleStatus;
|
|
96
|
+
/** A comma-separated list of Bundle SIDs to filter the results (maximum 20). Each Bundle SID must match `^BU[0-9a-fA-F]{32}$`. */
|
|
97
|
+
bundleSids?: string;
|
|
92
98
|
/** The string that you assigned to describe the resource. The column can contain 255 variable characters. */
|
|
93
99
|
friendlyName?: string;
|
|
94
100
|
/** The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. */
|
|
@@ -97,6 +103,8 @@ export interface BundleListInstanceOptions {
|
|
|
97
103
|
isoCountry?: string;
|
|
98
104
|
/** The type of phone number of the Bundle\'s ownership request. Can be `local`, `mobile`, `national`, or `toll-free`. */
|
|
99
105
|
numberType?: string;
|
|
106
|
+
/** The end user type of the regulation of the Bundle. Can be `business` or `individual`. */
|
|
107
|
+
endUserType?: "business" | "individual";
|
|
100
108
|
/** Indicates that the Bundle is a valid Bundle until a specified expiration date. */
|
|
101
109
|
hasValidUntilDate?: boolean;
|
|
102
110
|
/** Can be `valid-until` or `date-updated`. Defaults to `date-created`. */
|
|
@@ -120,6 +128,8 @@ export interface BundleListInstanceOptions {
|
|
|
120
128
|
export interface BundleListInstancePageOptions {
|
|
121
129
|
/** The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details. */
|
|
122
130
|
status?: BundleStatus;
|
|
131
|
+
/** A comma-separated list of Bundle SIDs to filter the results (maximum 20). Each Bundle SID must match `^BU[0-9a-fA-F]{32}$`. */
|
|
132
|
+
bundleSids?: string;
|
|
123
133
|
/** The string that you assigned to describe the resource. The column can contain 255 variable characters. */
|
|
124
134
|
friendlyName?: string;
|
|
125
135
|
/** The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. */
|
|
@@ -128,6 +138,8 @@ export interface BundleListInstancePageOptions {
|
|
|
128
138
|
isoCountry?: string;
|
|
129
139
|
/** The type of phone number of the Bundle\'s ownership request. Can be `local`, `mobile`, `national`, or `toll-free`. */
|
|
130
140
|
numberType?: string;
|
|
141
|
+
/** The end user type of the regulation of the Bundle. Can be `business` or `individual`. */
|
|
142
|
+
endUserType?: "business" | "individual";
|
|
131
143
|
/** Indicates that the Bundle is a valid Bundle until a specified expiration date. */
|
|
132
144
|
hasValidUntilDate?: boolean;
|
|
133
145
|
/** Can be `valid-until` or `date-updated`. Defaults to `date-created`. */
|
|
@@ -419,6 +419,8 @@ function BundleListInstance(version) {
|
|
|
419
419
|
let data = {};
|
|
420
420
|
if (params["status"] !== undefined)
|
|
421
421
|
data["Status"] = params["status"];
|
|
422
|
+
if (params["bundleSids"] !== undefined)
|
|
423
|
+
data["BundleSids"] = params["bundleSids"];
|
|
422
424
|
if (params["friendlyName"] !== undefined)
|
|
423
425
|
data["FriendlyName"] = params["friendlyName"];
|
|
424
426
|
if (params["regulationSid"] !== undefined)
|
|
@@ -427,6 +429,8 @@ function BundleListInstance(version) {
|
|
|
427
429
|
data["IsoCountry"] = params["isoCountry"];
|
|
428
430
|
if (params["numberType"] !== undefined)
|
|
429
431
|
data["NumberType"] = params["numberType"];
|
|
432
|
+
if (params["endUserType"] !== undefined)
|
|
433
|
+
data["EndUserType"] = params["endUserType"];
|
|
430
434
|
if (params["hasValidUntilDate"] !== undefined)
|
|
431
435
|
data["HasValidUntilDate"] = serialize.bool(params["hasValidUntilDate"]);
|
|
432
436
|
if (params["sortBy"] !== undefined)
|
|
@@ -479,6 +483,8 @@ function BundleListInstance(version) {
|
|
|
479
483
|
let data = {};
|
|
480
484
|
if (params["status"] !== undefined)
|
|
481
485
|
data["Status"] = params["status"];
|
|
486
|
+
if (params["bundleSids"] !== undefined)
|
|
487
|
+
data["BundleSids"] = params["bundleSids"];
|
|
482
488
|
if (params["friendlyName"] !== undefined)
|
|
483
489
|
data["FriendlyName"] = params["friendlyName"];
|
|
484
490
|
if (params["regulationSid"] !== undefined)
|
|
@@ -487,6 +493,8 @@ function BundleListInstance(version) {
|
|
|
487
493
|
data["IsoCountry"] = params["isoCountry"];
|
|
488
494
|
if (params["numberType"] !== undefined)
|
|
489
495
|
data["NumberType"] = params["numberType"];
|
|
496
|
+
if (params["endUserType"] !== undefined)
|
|
497
|
+
data["EndUserType"] = params["endUserType"];
|
|
490
498
|
if (params["hasValidUntilDate"] !== undefined)
|
|
491
499
|
data["HasValidUntilDate"] = serialize.bool(params["hasValidUntilDate"]);
|
|
492
500
|
if (params["sortBy"] !== undefined)
|
package/lib/rest/oauth/V2.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import OauthBase from "../OauthBase";
|
|
2
2
|
import Version from "../../base/Version";
|
|
3
|
+
import { AuthorizeListInstance } from "./v2/authorize";
|
|
3
4
|
import { TokenListInstance } from "./v2/token";
|
|
4
5
|
export default class V2 extends Version {
|
|
5
6
|
/**
|
|
@@ -8,8 +9,12 @@ export default class V2 extends Version {
|
|
|
8
9
|
* @param domain - The Twilio (Twilio.Oauth) domain
|
|
9
10
|
*/
|
|
10
11
|
constructor(domain: OauthBase);
|
|
12
|
+
/** authorize - { Twilio.Oauth.V2.AuthorizeListInstance } resource */
|
|
13
|
+
protected _authorize?: AuthorizeListInstance;
|
|
11
14
|
/** token - { Twilio.Oauth.V2.TokenListInstance } resource */
|
|
12
15
|
protected _token?: TokenListInstance;
|
|
16
|
+
/** Getter for authorize resource */
|
|
17
|
+
get authorize(): AuthorizeListInstance;
|
|
13
18
|
/** Getter for token resource */
|
|
14
19
|
get token(): TokenListInstance;
|
|
15
20
|
}
|
package/lib/rest/oauth/V2.js
CHANGED
|
@@ -17,6 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
};
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
19
|
const Version_1 = __importDefault(require("../../base/Version"));
|
|
20
|
+
const authorize_1 = require("./v2/authorize");
|
|
20
21
|
const token_1 = require("./v2/token");
|
|
21
22
|
class V2 extends Version_1.default {
|
|
22
23
|
/**
|
|
@@ -27,6 +28,11 @@ class V2 extends Version_1.default {
|
|
|
27
28
|
constructor(domain) {
|
|
28
29
|
super(domain, "v2");
|
|
29
30
|
}
|
|
31
|
+
/** Getter for authorize resource */
|
|
32
|
+
get authorize() {
|
|
33
|
+
this._authorize = this._authorize || (0, authorize_1.AuthorizeListInstance)(this);
|
|
34
|
+
return this._authorize;
|
|
35
|
+
}
|
|
30
36
|
/** Getter for token resource */
|
|
31
37
|
get token() {
|
|
32
38
|
this._token = this._token || (0, token_1.TokenListInstance)(this);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { inspect, InspectOptions } from "util";
|
|
2
|
+
import V2 from "../V2";
|
|
3
|
+
import { ApiResponse } from "../../../base/ApiResponse";
|
|
4
|
+
/**
|
|
5
|
+
* Options to pass to fetch a AuthorizeInstance
|
|
6
|
+
*/
|
|
7
|
+
export interface AuthorizeListInstanceFetchOptions {
|
|
8
|
+
/** */
|
|
9
|
+
responseType?: string;
|
|
10
|
+
/** */
|
|
11
|
+
clientId?: string;
|
|
12
|
+
/** */
|
|
13
|
+
redirectUri?: string;
|
|
14
|
+
/** */
|
|
15
|
+
scope?: string;
|
|
16
|
+
/** */
|
|
17
|
+
state?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface AuthorizeSolution {
|
|
20
|
+
}
|
|
21
|
+
export interface AuthorizeListInstance {
|
|
22
|
+
_version: V2;
|
|
23
|
+
_solution: AuthorizeSolution;
|
|
24
|
+
_uri: string;
|
|
25
|
+
/**
|
|
26
|
+
* Fetch a AuthorizeInstance
|
|
27
|
+
*
|
|
28
|
+
* @param callback - Callback to handle processed record
|
|
29
|
+
*
|
|
30
|
+
* @returns Resolves to processed AuthorizeInstance
|
|
31
|
+
*/
|
|
32
|
+
fetch(callback?: (error: Error | null, item?: AuthorizeInstance) => any): Promise<AuthorizeInstance>;
|
|
33
|
+
/**
|
|
34
|
+
* Fetch a AuthorizeInstance
|
|
35
|
+
*
|
|
36
|
+
* @param params - Parameter for request
|
|
37
|
+
* @param callback - Callback to handle processed record
|
|
38
|
+
*
|
|
39
|
+
* @returns Resolves to processed AuthorizeInstance
|
|
40
|
+
*/
|
|
41
|
+
fetch(params: AuthorizeListInstanceFetchOptions, callback?: (error: Error | null, item?: AuthorizeInstance) => any): Promise<AuthorizeInstance>;
|
|
42
|
+
/**
|
|
43
|
+
* Fetch a AuthorizeInstance and return HTTP info
|
|
44
|
+
*
|
|
45
|
+
* @param callback - Callback to handle processed record
|
|
46
|
+
*
|
|
47
|
+
* @returns Resolves to processed AuthorizeInstance with HTTP metadata
|
|
48
|
+
*/
|
|
49
|
+
fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse<AuthorizeInstance>) => any): Promise<ApiResponse<AuthorizeInstance>>;
|
|
50
|
+
/**
|
|
51
|
+
* Fetch a AuthorizeInstance and return HTTP info
|
|
52
|
+
*
|
|
53
|
+
* @param params - Parameter for request
|
|
54
|
+
* @param callback - Callback to handle processed record
|
|
55
|
+
*
|
|
56
|
+
* @returns Resolves to processed AuthorizeInstance with HTTP metadata
|
|
57
|
+
*/
|
|
58
|
+
fetchWithHttpInfo(params: AuthorizeListInstanceFetchOptions, callback?: (error: Error | null, item?: ApiResponse<AuthorizeInstance>) => any): Promise<ApiResponse<AuthorizeInstance>>;
|
|
59
|
+
/**
|
|
60
|
+
* Provide a user-friendly representation
|
|
61
|
+
*/
|
|
62
|
+
toJSON(): any;
|
|
63
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
64
|
+
}
|
|
65
|
+
export declare function AuthorizeListInstance(version: V2): AuthorizeListInstance;
|
|
66
|
+
interface AuthorizeResource {
|
|
67
|
+
redirect_to: string;
|
|
68
|
+
}
|
|
69
|
+
export declare class AuthorizeInstance {
|
|
70
|
+
protected _version: V2;
|
|
71
|
+
constructor(_version: V2, payload: AuthorizeResource);
|
|
72
|
+
/**
|
|
73
|
+
* The callback URL
|
|
74
|
+
*/
|
|
75
|
+
redirectTo: string;
|
|
76
|
+
/**
|
|
77
|
+
* Provide a user-friendly representation
|
|
78
|
+
*
|
|
79
|
+
* @returns Object
|
|
80
|
+
*/
|
|
81
|
+
toJSON(): {
|
|
82
|
+
redirectTo: string;
|
|
83
|
+
};
|
|
84
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
85
|
+
}
|
|
86
|
+
export {};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* User OAuth API
|
|
9
|
+
* User OAuth API
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator.
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.AuthorizeInstance = void 0;
|
|
17
|
+
exports.AuthorizeListInstance = AuthorizeListInstance;
|
|
18
|
+
const util_1 = require("util");
|
|
19
|
+
const deserialize = require("../../../base/deserialize");
|
|
20
|
+
const serialize = require("../../../base/serialize");
|
|
21
|
+
function AuthorizeListInstance(version) {
|
|
22
|
+
const instance = {};
|
|
23
|
+
instance._version = version;
|
|
24
|
+
instance._solution = {};
|
|
25
|
+
instance._uri = `/authorize`;
|
|
26
|
+
instance.fetch = function fetch(params, callback) {
|
|
27
|
+
if (params instanceof Function) {
|
|
28
|
+
callback = params;
|
|
29
|
+
params = {};
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
params = params || {};
|
|
33
|
+
}
|
|
34
|
+
let data = {};
|
|
35
|
+
if (params["responseType"] !== undefined)
|
|
36
|
+
data["response_type"] = params["responseType"];
|
|
37
|
+
if (params["clientId"] !== undefined)
|
|
38
|
+
data["client_id"] = params["clientId"];
|
|
39
|
+
if (params["redirectUri"] !== undefined)
|
|
40
|
+
data["redirect_uri"] = params["redirectUri"];
|
|
41
|
+
if (params["scope"] !== undefined)
|
|
42
|
+
data["scope"] = params["scope"];
|
|
43
|
+
if (params["state"] !== undefined)
|
|
44
|
+
data["state"] = params["state"];
|
|
45
|
+
const headers = {};
|
|
46
|
+
headers["Accept"] = "application/json";
|
|
47
|
+
let operationVersion = version, operationPromise = operationVersion.fetch({
|
|
48
|
+
uri: instance._uri,
|
|
49
|
+
method: "get",
|
|
50
|
+
params: data,
|
|
51
|
+
headers,
|
|
52
|
+
});
|
|
53
|
+
operationPromise = operationPromise.then((payload) => new AuthorizeInstance(operationVersion, payload));
|
|
54
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
55
|
+
return operationPromise;
|
|
56
|
+
};
|
|
57
|
+
instance.fetchWithHttpInfo = function fetchWithHttpInfo(params, callback) {
|
|
58
|
+
if (params instanceof Function) {
|
|
59
|
+
callback = params;
|
|
60
|
+
params = {};
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
params = params || {};
|
|
64
|
+
}
|
|
65
|
+
let data = {};
|
|
66
|
+
if (params["responseType"] !== undefined)
|
|
67
|
+
data["response_type"] = params["responseType"];
|
|
68
|
+
if (params["clientId"] !== undefined)
|
|
69
|
+
data["client_id"] = params["clientId"];
|
|
70
|
+
if (params["redirectUri"] !== undefined)
|
|
71
|
+
data["redirect_uri"] = params["redirectUri"];
|
|
72
|
+
if (params["scope"] !== undefined)
|
|
73
|
+
data["scope"] = params["scope"];
|
|
74
|
+
if (params["state"] !== undefined)
|
|
75
|
+
data["state"] = params["state"];
|
|
76
|
+
const headers = {};
|
|
77
|
+
headers["Accept"] = "application/json";
|
|
78
|
+
let operationVersion = version;
|
|
79
|
+
// CREATE, FETCH, UPDATE operations
|
|
80
|
+
let operationPromise = operationVersion
|
|
81
|
+
.fetchWithResponseInfo({
|
|
82
|
+
uri: instance._uri,
|
|
83
|
+
method: "get",
|
|
84
|
+
params: data,
|
|
85
|
+
headers,
|
|
86
|
+
})
|
|
87
|
+
.then((response) => ({
|
|
88
|
+
...response,
|
|
89
|
+
body: new AuthorizeInstance(operationVersion, response.body),
|
|
90
|
+
}));
|
|
91
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
92
|
+
return operationPromise;
|
|
93
|
+
};
|
|
94
|
+
instance.toJSON = function toJSON() {
|
|
95
|
+
return instance._solution;
|
|
96
|
+
};
|
|
97
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
98
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
99
|
+
};
|
|
100
|
+
return instance;
|
|
101
|
+
}
|
|
102
|
+
class AuthorizeInstance {
|
|
103
|
+
constructor(_version, payload) {
|
|
104
|
+
this._version = _version;
|
|
105
|
+
this.redirectTo = payload.redirect_to;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Provide a user-friendly representation
|
|
109
|
+
*
|
|
110
|
+
* @returns Object
|
|
111
|
+
*/
|
|
112
|
+
toJSON() {
|
|
113
|
+
return {
|
|
114
|
+
redirectTo: this.redirectTo,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
[util_1.inspect.custom](_depth, options) {
|
|
118
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
exports.AuthorizeInstance = AuthorizeInstance;
|
|
@@ -13,6 +13,8 @@ export type TranscriptionsStatus = "started" | "stopped" | "failed";
|
|
|
13
13
|
export interface TranscriptionsContextUpdateOptions {
|
|
14
14
|
/** */
|
|
15
15
|
status?: TranscriptionsStatus;
|
|
16
|
+
/** A collection of properties that describe transcription behaviour. */
|
|
17
|
+
configuration?: object;
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
20
|
* Options to pass to create a TranscriptionsInstance
|
|
@@ -78,6 +78,8 @@ class TranscriptionsContextImpl {
|
|
|
78
78
|
let data = {};
|
|
79
79
|
if (params["status"] !== undefined)
|
|
80
80
|
data["Status"] = params["status"];
|
|
81
|
+
if (params["configuration"] !== undefined)
|
|
82
|
+
data["Configuration"] = serialize.object(params["configuration"]);
|
|
81
83
|
const headers = {};
|
|
82
84
|
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
83
85
|
headers["Accept"] = "application/json";
|
|
@@ -103,6 +105,8 @@ class TranscriptionsContextImpl {
|
|
|
103
105
|
let data = {};
|
|
104
106
|
if (params["status"] !== undefined)
|
|
105
107
|
data["Status"] = params["status"];
|
|
108
|
+
if (params["configuration"] !== undefined)
|
|
109
|
+
data["Configuration"] = serialize.object(params["configuration"]);
|
|
106
110
|
const headers = {};
|
|
107
111
|
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
108
112
|
headers["Accept"] = "application/json";
|