twilio 5.4.3 → 5.4.5
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/README.md +2 -1
- package/lib/rest/api/v2010/account/address.d.ts +1 -1
- package/lib/rest/api/v2010/account/call/transcription.d.ts +1 -1
- package/lib/rest/flexApi/v1/interaction/interactionChannel/interactionTransfer.d.ts +232 -0
- package/lib/rest/flexApi/v1/interaction/interactionChannel/interactionTransfer.js +203 -0
- package/lib/rest/flexApi/v1/interaction/interactionChannel.d.ts +8 -0
- package/lib/rest/flexApi/v1/interaction/interactionChannel.js +13 -0
- package/lib/rest/iam/V1.d.ts +5 -5
- package/lib/rest/iam/V1.js +5 -5
- package/lib/rest/iam/v1/{newApiKey.d.ts → key.d.ts} +14 -14
- package/lib/rest/iam/v1/{newApiKey.js → key.js} +6 -6
- package/lib/rest/intelligence/v2/transcript/operatorResult.d.ts +4 -1
- package/lib/rest/intelligence/v2/transcript/operatorResult.js +2 -0
- package/lib/rest/messaging/v1/service/destinationAlphaSender.d.ts +272 -0
- package/lib/rest/messaging/v1/service/destinationAlphaSender.js +242 -0
- package/lib/rest/messaging/v1/service.d.ts +8 -0
- package/lib/rest/messaging/v1/service.js +13 -0
- package/lib/rest/numbers/V1.d.ts +5 -5
- package/lib/rest/numbers/V1.js +6 -8
- package/lib/rest/numbers/v1/{portingWebhookConfigurationFetch.d.ts → webhook.d.ts} +10 -10
- package/lib/rest/numbers/v1/{portingWebhookConfigurationFetch.js → webhook.js} +6 -6
- package/lib/rest/trusthub/v1/supportingDocument.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ import { DependentPhoneNumberListInstance } from "./address/dependentPhoneNumber
|
|
|
8
8
|
* Options to pass to update a AddressInstance
|
|
9
9
|
*/
|
|
10
10
|
export interface AddressContextUpdateOptions {
|
|
11
|
-
/** A descriptive string that you create to describe the address. It can be up to 64 characters long. */
|
|
11
|
+
/** A descriptive string that you create to describe the new address. It can be up to 64 characters long for Regulatory Compliance addresses and 32 characters long for Emergency addresses. */
|
|
12
12
|
friendlyName?: string;
|
|
13
13
|
/** The name to associate with the address. */
|
|
14
14
|
customerName?: string;
|
|
@@ -41,7 +41,7 @@ export interface TranscriptionListInstanceCreateOptions {
|
|
|
41
41
|
hints?: string;
|
|
42
42
|
/** The provider will add punctuation to recognition result */
|
|
43
43
|
enableAutomaticPunctuation?: boolean;
|
|
44
|
-
/** The SID of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators . */
|
|
44
|
+
/** The SID or unique name of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators . */
|
|
45
45
|
intelligenceService?: string;
|
|
46
46
|
}
|
|
47
47
|
export interface TranscriptionContext {
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { inspect, InspectOptions } from "util";
|
|
3
|
+
import V1 from "../../../V1";
|
|
4
|
+
export type InteractionTransferTransferStatus = "active" | "failed" | "completed";
|
|
5
|
+
export type InteractionTransferTransferType = "warm" | "cold" | "external";
|
|
6
|
+
/**
|
|
7
|
+
* Options to pass to update a InteractionTransferInstance
|
|
8
|
+
*/
|
|
9
|
+
export interface InteractionTransferContextUpdateOptions {
|
|
10
|
+
/** */
|
|
11
|
+
body?: object;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Options to pass to create a InteractionTransferInstance
|
|
15
|
+
*/
|
|
16
|
+
export interface InteractionTransferListInstanceCreateOptions {
|
|
17
|
+
/** */
|
|
18
|
+
body?: object;
|
|
19
|
+
}
|
|
20
|
+
export interface InteractionTransferContext {
|
|
21
|
+
/**
|
|
22
|
+
* Fetch a InteractionTransferInstance
|
|
23
|
+
*
|
|
24
|
+
* @param callback - Callback to handle processed record
|
|
25
|
+
*
|
|
26
|
+
* @returns Resolves to processed InteractionTransferInstance
|
|
27
|
+
*/
|
|
28
|
+
fetch(callback?: (error: Error | null, item?: InteractionTransferInstance) => any): Promise<InteractionTransferInstance>;
|
|
29
|
+
/**
|
|
30
|
+
* Update a InteractionTransferInstance
|
|
31
|
+
*
|
|
32
|
+
* @param callback - Callback to handle processed record
|
|
33
|
+
*
|
|
34
|
+
* @returns Resolves to processed InteractionTransferInstance
|
|
35
|
+
*/
|
|
36
|
+
update(callback?: (error: Error | null, item?: InteractionTransferInstance) => any): Promise<InteractionTransferInstance>;
|
|
37
|
+
/**
|
|
38
|
+
* Update a InteractionTransferInstance
|
|
39
|
+
*
|
|
40
|
+
* @param params - Body for request
|
|
41
|
+
* @param headers - header params for request
|
|
42
|
+
* @param callback - Callback to handle processed record
|
|
43
|
+
*
|
|
44
|
+
* @returns Resolves to processed InteractionTransferInstance
|
|
45
|
+
*/
|
|
46
|
+
update(params: object, headers?: any, callback?: (error: Error | null, item?: InteractionTransferInstance) => any): Promise<InteractionTransferInstance>;
|
|
47
|
+
/**
|
|
48
|
+
* Provide a user-friendly representation
|
|
49
|
+
*/
|
|
50
|
+
toJSON(): any;
|
|
51
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
52
|
+
}
|
|
53
|
+
export interface InteractionTransferContextSolution {
|
|
54
|
+
interactionSid: string;
|
|
55
|
+
channelSid: string;
|
|
56
|
+
sid: string;
|
|
57
|
+
}
|
|
58
|
+
export declare class InteractionTransferContextImpl implements InteractionTransferContext {
|
|
59
|
+
protected _version: V1;
|
|
60
|
+
protected _solution: InteractionTransferContextSolution;
|
|
61
|
+
protected _uri: string;
|
|
62
|
+
constructor(_version: V1, interactionSid: string, channelSid: string, sid: string);
|
|
63
|
+
fetch(callback?: (error: Error | null, item?: InteractionTransferInstance) => any): Promise<InteractionTransferInstance>;
|
|
64
|
+
update(params?: object | ((error: Error | null, item?: InteractionTransferInstance) => any), headers?: any, callback?: (error: Error | null, item?: InteractionTransferInstance) => any): Promise<InteractionTransferInstance>;
|
|
65
|
+
/**
|
|
66
|
+
* Provide a user-friendly representation
|
|
67
|
+
*
|
|
68
|
+
* @returns Object
|
|
69
|
+
*/
|
|
70
|
+
toJSON(): InteractionTransferContextSolution;
|
|
71
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
72
|
+
}
|
|
73
|
+
interface InteractionTransferResource {
|
|
74
|
+
sid: string;
|
|
75
|
+
instance_sid: string;
|
|
76
|
+
account_sid: string;
|
|
77
|
+
interaction_sid: string;
|
|
78
|
+
channel_sid: string;
|
|
79
|
+
execution_sid: string;
|
|
80
|
+
type: InteractionTransferTransferType;
|
|
81
|
+
status: InteractionTransferTransferStatus;
|
|
82
|
+
from: string;
|
|
83
|
+
to: string;
|
|
84
|
+
note_sid: string;
|
|
85
|
+
summary_sid: string;
|
|
86
|
+
date_created: Date;
|
|
87
|
+
date_updated: Date;
|
|
88
|
+
url: string;
|
|
89
|
+
}
|
|
90
|
+
export declare class InteractionTransferInstance {
|
|
91
|
+
protected _version: V1;
|
|
92
|
+
protected _solution: InteractionTransferContextSolution;
|
|
93
|
+
protected _context?: InteractionTransferContext;
|
|
94
|
+
constructor(_version: V1, payload: InteractionTransferResource, interactionSid: string, channelSid: string, sid?: string);
|
|
95
|
+
/**
|
|
96
|
+
* The unique string created by Twilio to identify an Interaction Transfer resource.
|
|
97
|
+
*/
|
|
98
|
+
sid: string;
|
|
99
|
+
/**
|
|
100
|
+
* The SID of the Instance associated with the Transfer.
|
|
101
|
+
*/
|
|
102
|
+
instanceSid: string;
|
|
103
|
+
/**
|
|
104
|
+
* The SID of the Account that created the Transfer.
|
|
105
|
+
*/
|
|
106
|
+
accountSid: string;
|
|
107
|
+
/**
|
|
108
|
+
* The Interaction Sid for this channel.
|
|
109
|
+
*/
|
|
110
|
+
interactionSid: string;
|
|
111
|
+
/**
|
|
112
|
+
* The Channel Sid for this Transfer.
|
|
113
|
+
*/
|
|
114
|
+
channelSid: string;
|
|
115
|
+
/**
|
|
116
|
+
* The Execution SID associated with the Transfer.
|
|
117
|
+
*/
|
|
118
|
+
executionSid: string;
|
|
119
|
+
type: InteractionTransferTransferType;
|
|
120
|
+
status: InteractionTransferTransferStatus;
|
|
121
|
+
/**
|
|
122
|
+
* The SID of the Participant initiating the Transfer.
|
|
123
|
+
*/
|
|
124
|
+
from: string;
|
|
125
|
+
/**
|
|
126
|
+
* The SID of the Participant receiving the Transfer.
|
|
127
|
+
*/
|
|
128
|
+
to: string;
|
|
129
|
+
/**
|
|
130
|
+
* The SID of the Note associated with the Transfer.
|
|
131
|
+
*/
|
|
132
|
+
noteSid: string;
|
|
133
|
+
/**
|
|
134
|
+
* The SID of the Summary associated with the Transfer.
|
|
135
|
+
*/
|
|
136
|
+
summarySid: string;
|
|
137
|
+
/**
|
|
138
|
+
* The date and time when the Transfer was created.
|
|
139
|
+
*/
|
|
140
|
+
dateCreated: Date;
|
|
141
|
+
/**
|
|
142
|
+
* The date and time when the Transfer was last updated.
|
|
143
|
+
*/
|
|
144
|
+
dateUpdated: Date;
|
|
145
|
+
url: string;
|
|
146
|
+
private get _proxy();
|
|
147
|
+
/**
|
|
148
|
+
* Fetch a InteractionTransferInstance
|
|
149
|
+
*
|
|
150
|
+
* @param callback - Callback to handle processed record
|
|
151
|
+
*
|
|
152
|
+
* @returns Resolves to processed InteractionTransferInstance
|
|
153
|
+
*/
|
|
154
|
+
fetch(callback?: (error: Error | null, item?: InteractionTransferInstance) => any): Promise<InteractionTransferInstance>;
|
|
155
|
+
/**
|
|
156
|
+
* Update a InteractionTransferInstance
|
|
157
|
+
*
|
|
158
|
+
* @param callback - Callback to handle processed record
|
|
159
|
+
*
|
|
160
|
+
* @returns Resolves to processed InteractionTransferInstance
|
|
161
|
+
*/
|
|
162
|
+
update(callback?: (error: Error | null, item?: InteractionTransferInstance) => any): Promise<InteractionTransferInstance>;
|
|
163
|
+
/**
|
|
164
|
+
* Update a InteractionTransferInstance
|
|
165
|
+
*
|
|
166
|
+
* @param params - Body for request
|
|
167
|
+
* @param headers - header params for request
|
|
168
|
+
* @param callback - Callback to handle processed record
|
|
169
|
+
*
|
|
170
|
+
* @returns Resolves to processed InteractionTransferInstance
|
|
171
|
+
*/
|
|
172
|
+
update(params: object, headers?: any, callback?: (error: Error | null, item?: InteractionTransferInstance) => any): Promise<InteractionTransferInstance>;
|
|
173
|
+
/**
|
|
174
|
+
* Provide a user-friendly representation
|
|
175
|
+
*
|
|
176
|
+
* @returns Object
|
|
177
|
+
*/
|
|
178
|
+
toJSON(): {
|
|
179
|
+
sid: string;
|
|
180
|
+
instanceSid: string;
|
|
181
|
+
accountSid: string;
|
|
182
|
+
interactionSid: string;
|
|
183
|
+
channelSid: string;
|
|
184
|
+
executionSid: string;
|
|
185
|
+
type: InteractionTransferTransferType;
|
|
186
|
+
status: InteractionTransferTransferStatus;
|
|
187
|
+
from: string;
|
|
188
|
+
to: string;
|
|
189
|
+
noteSid: string;
|
|
190
|
+
summarySid: string;
|
|
191
|
+
dateCreated: Date;
|
|
192
|
+
dateUpdated: Date;
|
|
193
|
+
url: string;
|
|
194
|
+
};
|
|
195
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
196
|
+
}
|
|
197
|
+
export interface InteractionTransferSolution {
|
|
198
|
+
interactionSid: string;
|
|
199
|
+
channelSid: string;
|
|
200
|
+
}
|
|
201
|
+
export interface InteractionTransferListInstance {
|
|
202
|
+
_version: V1;
|
|
203
|
+
_solution: InteractionTransferSolution;
|
|
204
|
+
_uri: string;
|
|
205
|
+
(sid: string): InteractionTransferContext;
|
|
206
|
+
get(sid: string): InteractionTransferContext;
|
|
207
|
+
/**
|
|
208
|
+
* Create a InteractionTransferInstance
|
|
209
|
+
*
|
|
210
|
+
* @param callback - Callback to handle processed record
|
|
211
|
+
*
|
|
212
|
+
* @returns Resolves to processed InteractionTransferInstance
|
|
213
|
+
*/
|
|
214
|
+
create(callback?: (error: Error | null, item?: InteractionTransferInstance) => any): Promise<InteractionTransferInstance>;
|
|
215
|
+
/**
|
|
216
|
+
* Create a InteractionTransferInstance
|
|
217
|
+
*
|
|
218
|
+
* @param params - Body for request
|
|
219
|
+
* @param headers - header params for request
|
|
220
|
+
* @param callback - Callback to handle processed record
|
|
221
|
+
*
|
|
222
|
+
* @returns Resolves to processed InteractionTransferInstance
|
|
223
|
+
*/
|
|
224
|
+
create(params: object, headers?: any, callback?: (error: Error | null, item?: InteractionTransferInstance) => any): Promise<InteractionTransferInstance>;
|
|
225
|
+
/**
|
|
226
|
+
* Provide a user-friendly representation
|
|
227
|
+
*/
|
|
228
|
+
toJSON(): any;
|
|
229
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
230
|
+
}
|
|
231
|
+
export declare function InteractionTransferListInstance(version: V1, interactionSid: string, channelSid: string): InteractionTransferListInstance;
|
|
232
|
+
export {};
|
|
@@ -0,0 +1,203 @@
|
|
|
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.InteractionTransferListInstance = exports.InteractionTransferInstance = exports.InteractionTransferContextImpl = void 0;
|
|
17
|
+
const util_1 = require("util");
|
|
18
|
+
const deserialize = require("../../../../../base/deserialize");
|
|
19
|
+
const serialize = require("../../../../../base/serialize");
|
|
20
|
+
const utility_1 = require("../../../../../base/utility");
|
|
21
|
+
class InteractionTransferContextImpl {
|
|
22
|
+
constructor(_version, interactionSid, channelSid, sid) {
|
|
23
|
+
this._version = _version;
|
|
24
|
+
if (!(0, utility_1.isValidPathParam)(interactionSid)) {
|
|
25
|
+
throw new Error("Parameter 'interactionSid' is not valid.");
|
|
26
|
+
}
|
|
27
|
+
if (!(0, utility_1.isValidPathParam)(channelSid)) {
|
|
28
|
+
throw new Error("Parameter 'channelSid' is not valid.");
|
|
29
|
+
}
|
|
30
|
+
if (!(0, utility_1.isValidPathParam)(sid)) {
|
|
31
|
+
throw new Error("Parameter 'sid' is not valid.");
|
|
32
|
+
}
|
|
33
|
+
this._solution = { interactionSid, channelSid, sid };
|
|
34
|
+
this._uri = `/Interactions/${interactionSid}/Channels/${channelSid}/Transfers/${sid}`;
|
|
35
|
+
}
|
|
36
|
+
fetch(callback) {
|
|
37
|
+
const headers = {};
|
|
38
|
+
headers["Accept"] = "application/json";
|
|
39
|
+
const instance = this;
|
|
40
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
41
|
+
uri: instance._uri,
|
|
42
|
+
method: "get",
|
|
43
|
+
headers,
|
|
44
|
+
});
|
|
45
|
+
operationPromise = operationPromise.then((payload) => new InteractionTransferInstance(operationVersion, payload, instance._solution.interactionSid, instance._solution.channelSid, instance._solution.sid));
|
|
46
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
47
|
+
return operationPromise;
|
|
48
|
+
}
|
|
49
|
+
update(params, headers, callback) {
|
|
50
|
+
if (params instanceof Function) {
|
|
51
|
+
callback = params;
|
|
52
|
+
params = {};
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
params = params || {};
|
|
56
|
+
}
|
|
57
|
+
let data = {};
|
|
58
|
+
data = params;
|
|
59
|
+
if (headers === null || headers === undefined) {
|
|
60
|
+
headers = {};
|
|
61
|
+
}
|
|
62
|
+
headers["Content-Type"] = "application/json";
|
|
63
|
+
headers["Accept"] = "application/json";
|
|
64
|
+
const instance = this;
|
|
65
|
+
let operationVersion = instance._version, operationPromise = operationVersion.update({
|
|
66
|
+
uri: instance._uri,
|
|
67
|
+
method: "post",
|
|
68
|
+
data,
|
|
69
|
+
headers,
|
|
70
|
+
});
|
|
71
|
+
operationPromise = operationPromise.then((payload) => new InteractionTransferInstance(operationVersion, payload, instance._solution.interactionSid, instance._solution.channelSid, instance._solution.sid));
|
|
72
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
73
|
+
return operationPromise;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Provide a user-friendly representation
|
|
77
|
+
*
|
|
78
|
+
* @returns Object
|
|
79
|
+
*/
|
|
80
|
+
toJSON() {
|
|
81
|
+
return this._solution;
|
|
82
|
+
}
|
|
83
|
+
[util_1.inspect.custom](_depth, options) {
|
|
84
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.InteractionTransferContextImpl = InteractionTransferContextImpl;
|
|
88
|
+
class InteractionTransferInstance {
|
|
89
|
+
constructor(_version, payload, interactionSid, channelSid, sid) {
|
|
90
|
+
this._version = _version;
|
|
91
|
+
this.sid = payload.sid;
|
|
92
|
+
this.instanceSid = payload.instance_sid;
|
|
93
|
+
this.accountSid = payload.account_sid;
|
|
94
|
+
this.interactionSid = payload.interaction_sid;
|
|
95
|
+
this.channelSid = payload.channel_sid;
|
|
96
|
+
this.executionSid = payload.execution_sid;
|
|
97
|
+
this.type = payload.type;
|
|
98
|
+
this.status = payload.status;
|
|
99
|
+
this.from = payload.from;
|
|
100
|
+
this.to = payload.to;
|
|
101
|
+
this.noteSid = payload.note_sid;
|
|
102
|
+
this.summarySid = payload.summary_sid;
|
|
103
|
+
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
|
104
|
+
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
|
105
|
+
this.url = payload.url;
|
|
106
|
+
this._solution = { interactionSid, channelSid, sid: sid || this.sid };
|
|
107
|
+
}
|
|
108
|
+
get _proxy() {
|
|
109
|
+
this._context =
|
|
110
|
+
this._context ||
|
|
111
|
+
new InteractionTransferContextImpl(this._version, this._solution.interactionSid, this._solution.channelSid, this._solution.sid);
|
|
112
|
+
return this._context;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Fetch a InteractionTransferInstance
|
|
116
|
+
*
|
|
117
|
+
* @param callback - Callback to handle processed record
|
|
118
|
+
*
|
|
119
|
+
* @returns Resolves to processed InteractionTransferInstance
|
|
120
|
+
*/
|
|
121
|
+
fetch(callback) {
|
|
122
|
+
return this._proxy.fetch(callback);
|
|
123
|
+
}
|
|
124
|
+
update(params, callback) {
|
|
125
|
+
return this._proxy.update(params, callback);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Provide a user-friendly representation
|
|
129
|
+
*
|
|
130
|
+
* @returns Object
|
|
131
|
+
*/
|
|
132
|
+
toJSON() {
|
|
133
|
+
return {
|
|
134
|
+
sid: this.sid,
|
|
135
|
+
instanceSid: this.instanceSid,
|
|
136
|
+
accountSid: this.accountSid,
|
|
137
|
+
interactionSid: this.interactionSid,
|
|
138
|
+
channelSid: this.channelSid,
|
|
139
|
+
executionSid: this.executionSid,
|
|
140
|
+
type: this.type,
|
|
141
|
+
status: this.status,
|
|
142
|
+
from: this.from,
|
|
143
|
+
to: this.to,
|
|
144
|
+
noteSid: this.noteSid,
|
|
145
|
+
summarySid: this.summarySid,
|
|
146
|
+
dateCreated: this.dateCreated,
|
|
147
|
+
dateUpdated: this.dateUpdated,
|
|
148
|
+
url: this.url,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
[util_1.inspect.custom](_depth, options) {
|
|
152
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
exports.InteractionTransferInstance = InteractionTransferInstance;
|
|
156
|
+
function InteractionTransferListInstance(version, interactionSid, channelSid) {
|
|
157
|
+
if (!(0, utility_1.isValidPathParam)(interactionSid)) {
|
|
158
|
+
throw new Error("Parameter 'interactionSid' is not valid.");
|
|
159
|
+
}
|
|
160
|
+
if (!(0, utility_1.isValidPathParam)(channelSid)) {
|
|
161
|
+
throw new Error("Parameter 'channelSid' is not valid.");
|
|
162
|
+
}
|
|
163
|
+
const instance = ((sid) => instance.get(sid));
|
|
164
|
+
instance.get = function get(sid) {
|
|
165
|
+
return new InteractionTransferContextImpl(version, interactionSid, channelSid, sid);
|
|
166
|
+
};
|
|
167
|
+
instance._version = version;
|
|
168
|
+
instance._solution = { interactionSid, channelSid };
|
|
169
|
+
instance._uri = `/Interactions/${interactionSid}/Channels/${channelSid}/Transfers`;
|
|
170
|
+
instance.create = function create(params, headers, callback) {
|
|
171
|
+
if (params instanceof Function) {
|
|
172
|
+
callback = params;
|
|
173
|
+
params = {};
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
params = params || {};
|
|
177
|
+
}
|
|
178
|
+
let data = {};
|
|
179
|
+
data = params;
|
|
180
|
+
if (headers === null || headers === undefined) {
|
|
181
|
+
headers = {};
|
|
182
|
+
}
|
|
183
|
+
headers["Content-Type"] = "application/json";
|
|
184
|
+
headers["Accept"] = "application/json";
|
|
185
|
+
let operationVersion = version, operationPromise = operationVersion.create({
|
|
186
|
+
uri: instance._uri,
|
|
187
|
+
method: "post",
|
|
188
|
+
data,
|
|
189
|
+
headers,
|
|
190
|
+
});
|
|
191
|
+
operationPromise = operationPromise.then((payload) => new InteractionTransferInstance(operationVersion, payload, instance._solution.interactionSid, instance._solution.channelSid));
|
|
192
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
193
|
+
return operationPromise;
|
|
194
|
+
};
|
|
195
|
+
instance.toJSON = function toJSON() {
|
|
196
|
+
return instance._solution;
|
|
197
|
+
};
|
|
198
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
199
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
200
|
+
};
|
|
201
|
+
return instance;
|
|
202
|
+
}
|
|
203
|
+
exports.InteractionTransferListInstance = InteractionTransferListInstance;
|
|
@@ -5,6 +5,7 @@ import Response from "../../../../http/response";
|
|
|
5
5
|
import V1 from "../../V1";
|
|
6
6
|
import { InteractionChannelInviteListInstance } from "./interactionChannel/interactionChannelInvite";
|
|
7
7
|
import { InteractionChannelParticipantListInstance } from "./interactionChannel/interactionChannelParticipant";
|
|
8
|
+
import { InteractionTransferListInstance } from "./interactionChannel/interactionTransfer";
|
|
8
9
|
export type InteractionChannelChannelStatus = "setup" | "active" | "failed" | "closed" | "inactive";
|
|
9
10
|
export type InteractionChannelType = "voice" | "sms" | "email" | "web" | "whatsapp" | "chat" | "messenger" | "gbm";
|
|
10
11
|
export type InteractionChannelUpdateChannelStatus = "closed" | "inactive";
|
|
@@ -53,6 +54,7 @@ export interface InteractionChannelListInstancePageOptions {
|
|
|
53
54
|
export interface InteractionChannelContext {
|
|
54
55
|
invites: InteractionChannelInviteListInstance;
|
|
55
56
|
participants: InteractionChannelParticipantListInstance;
|
|
57
|
+
transfers: InteractionTransferListInstance;
|
|
56
58
|
/**
|
|
57
59
|
* Fetch a InteractionChannelInstance
|
|
58
60
|
*
|
|
@@ -86,9 +88,11 @@ export declare class InteractionChannelContextImpl implements InteractionChannel
|
|
|
86
88
|
protected _uri: string;
|
|
87
89
|
protected _invites?: InteractionChannelInviteListInstance;
|
|
88
90
|
protected _participants?: InteractionChannelParticipantListInstance;
|
|
91
|
+
protected _transfers?: InteractionTransferListInstance;
|
|
89
92
|
constructor(_version: V1, interactionSid: string, sid: string);
|
|
90
93
|
get invites(): InteractionChannelInviteListInstance;
|
|
91
94
|
get participants(): InteractionChannelParticipantListInstance;
|
|
95
|
+
get transfers(): InteractionTransferListInstance;
|
|
92
96
|
fetch(callback?: (error: Error | null, item?: InteractionChannelInstance) => any): Promise<InteractionChannelInstance>;
|
|
93
97
|
update(params: InteractionChannelContextUpdateOptions, callback?: (error: Error | null, item?: InteractionChannelInstance) => any): Promise<InteractionChannelInstance>;
|
|
94
98
|
/**
|
|
@@ -163,6 +167,10 @@ export declare class InteractionChannelInstance {
|
|
|
163
167
|
* Access the participants.
|
|
164
168
|
*/
|
|
165
169
|
participants(): InteractionChannelParticipantListInstance;
|
|
170
|
+
/**
|
|
171
|
+
* Access the transfers.
|
|
172
|
+
*/
|
|
173
|
+
transfers(): InteractionTransferListInstance;
|
|
166
174
|
/**
|
|
167
175
|
* Provide a user-friendly representation
|
|
168
176
|
*
|
|
@@ -24,6 +24,7 @@ const serialize = require("../../../../base/serialize");
|
|
|
24
24
|
const utility_1 = require("../../../../base/utility");
|
|
25
25
|
const interactionChannelInvite_1 = require("./interactionChannel/interactionChannelInvite");
|
|
26
26
|
const interactionChannelParticipant_1 = require("./interactionChannel/interactionChannelParticipant");
|
|
27
|
+
const interactionTransfer_1 = require("./interactionChannel/interactionTransfer");
|
|
27
28
|
class InteractionChannelContextImpl {
|
|
28
29
|
constructor(_version, interactionSid, sid) {
|
|
29
30
|
this._version = _version;
|
|
@@ -48,6 +49,12 @@ class InteractionChannelContextImpl {
|
|
|
48
49
|
(0, interactionChannelParticipant_1.InteractionChannelParticipantListInstance)(this._version, this._solution.interactionSid, this._solution.sid);
|
|
49
50
|
return this._participants;
|
|
50
51
|
}
|
|
52
|
+
get transfers() {
|
|
53
|
+
this._transfers =
|
|
54
|
+
this._transfers ||
|
|
55
|
+
(0, interactionTransfer_1.InteractionTransferListInstance)(this._version, this._solution.interactionSid, this._solution.sid);
|
|
56
|
+
return this._transfers;
|
|
57
|
+
}
|
|
51
58
|
fetch(callback) {
|
|
52
59
|
const headers = {};
|
|
53
60
|
headers["Accept"] = "application/json";
|
|
@@ -143,6 +150,12 @@ class InteractionChannelInstance {
|
|
|
143
150
|
participants() {
|
|
144
151
|
return this._proxy.participants;
|
|
145
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* Access the transfers.
|
|
155
|
+
*/
|
|
156
|
+
transfers() {
|
|
157
|
+
return this._proxy.transfers;
|
|
158
|
+
}
|
|
146
159
|
/**
|
|
147
160
|
* Provide a user-friendly representation
|
|
148
161
|
*
|
package/lib/rest/iam/V1.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import IamBase from "../IamBase";
|
|
|
2
2
|
import Version from "../../base/Version";
|
|
3
3
|
import { ApiKeyListInstance } from "./v1/apiKey";
|
|
4
4
|
import { GetApiKeysListInstance } from "./v1/getApiKeys";
|
|
5
|
-
import {
|
|
5
|
+
import { KeyListInstance } from "./v1/key";
|
|
6
6
|
export default class V1 extends Version {
|
|
7
7
|
/**
|
|
8
8
|
* Initialize the V1 version of Iam
|
|
@@ -14,12 +14,12 @@ export default class V1 extends Version {
|
|
|
14
14
|
protected _apiKey?: ApiKeyListInstance;
|
|
15
15
|
/** getApiKeys - { Twilio.Iam.V1.GetApiKeysListInstance } resource */
|
|
16
16
|
protected _getApiKeys?: GetApiKeysListInstance;
|
|
17
|
-
/**
|
|
18
|
-
protected
|
|
17
|
+
/** keys - { Twilio.Iam.V1.KeyListInstance } resource */
|
|
18
|
+
protected _keys?: KeyListInstance;
|
|
19
19
|
/** Getter for apiKey resource */
|
|
20
20
|
get apiKey(): ApiKeyListInstance;
|
|
21
21
|
/** Getter for getApiKeys resource */
|
|
22
22
|
get getApiKeys(): GetApiKeysListInstance;
|
|
23
|
-
/** Getter for
|
|
24
|
-
get
|
|
23
|
+
/** Getter for keys resource */
|
|
24
|
+
get keys(): KeyListInstance;
|
|
25
25
|
}
|
package/lib/rest/iam/V1.js
CHANGED
|
@@ -19,7 +19,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
19
|
const Version_1 = __importDefault(require("../../base/Version"));
|
|
20
20
|
const apiKey_1 = require("./v1/apiKey");
|
|
21
21
|
const getApiKeys_1 = require("./v1/getApiKeys");
|
|
22
|
-
const
|
|
22
|
+
const key_1 = require("./v1/key");
|
|
23
23
|
class V1 extends Version_1.default {
|
|
24
24
|
/**
|
|
25
25
|
* Initialize the V1 version of Iam
|
|
@@ -39,10 +39,10 @@ class V1 extends Version_1.default {
|
|
|
39
39
|
this._getApiKeys = this._getApiKeys || (0, getApiKeys_1.GetApiKeysListInstance)(this);
|
|
40
40
|
return this._getApiKeys;
|
|
41
41
|
}
|
|
42
|
-
/** Getter for
|
|
43
|
-
get
|
|
44
|
-
this.
|
|
45
|
-
return this.
|
|
42
|
+
/** Getter for keys resource */
|
|
43
|
+
get keys() {
|
|
44
|
+
this._keys = this._keys || (0, key_1.KeyListInstance)(this);
|
|
45
|
+
return this._keys;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
exports.default = V1;
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { inspect, InspectOptions } from "util";
|
|
3
3
|
import V1 from "../V1";
|
|
4
|
-
export type
|
|
4
|
+
export type KeyKeytype = "restricted";
|
|
5
5
|
/**
|
|
6
|
-
* Options to pass to create a
|
|
6
|
+
* Options to pass to create a KeyInstance
|
|
7
7
|
*/
|
|
8
|
-
export interface
|
|
8
|
+
export interface KeyListInstanceCreateOptions {
|
|
9
9
|
/** The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. */
|
|
10
10
|
accountSid: string;
|
|
11
11
|
/** A descriptive string that you create to describe the resource. It can be up to 64 characters long. */
|
|
12
12
|
friendlyName?: string;
|
|
13
13
|
/** */
|
|
14
|
-
keyType?:
|
|
14
|
+
keyType?: KeyKeytype;
|
|
15
15
|
/** The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). */
|
|
16
16
|
policy?: any;
|
|
17
17
|
}
|
|
18
|
-
export interface
|
|
18
|
+
export interface KeySolution {
|
|
19
19
|
}
|
|
20
|
-
export interface
|
|
20
|
+
export interface KeyListInstance {
|
|
21
21
|
_version: V1;
|
|
22
|
-
_solution:
|
|
22
|
+
_solution: KeySolution;
|
|
23
23
|
_uri: string;
|
|
24
24
|
/**
|
|
25
|
-
* Create a
|
|
25
|
+
* Create a KeyInstance
|
|
26
26
|
*
|
|
27
27
|
* @param params - Parameter for request
|
|
28
28
|
* @param callback - Callback to handle processed record
|
|
29
29
|
*
|
|
30
|
-
* @returns Resolves to processed
|
|
30
|
+
* @returns Resolves to processed KeyInstance
|
|
31
31
|
*/
|
|
32
|
-
create(params:
|
|
32
|
+
create(params: KeyListInstanceCreateOptions, callback?: (error: Error | null, item?: KeyInstance) => any): Promise<KeyInstance>;
|
|
33
33
|
/**
|
|
34
34
|
* Provide a user-friendly representation
|
|
35
35
|
*/
|
|
36
36
|
toJSON(): any;
|
|
37
37
|
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
38
38
|
}
|
|
39
|
-
export declare function
|
|
40
|
-
interface
|
|
39
|
+
export declare function KeyListInstance(version: V1): KeyListInstance;
|
|
40
|
+
interface KeyResource {
|
|
41
41
|
sid: string;
|
|
42
42
|
friendly_name: string;
|
|
43
43
|
date_created: Date;
|
|
@@ -45,9 +45,9 @@ interface NewApiKeyResource {
|
|
|
45
45
|
secret: string;
|
|
46
46
|
policy: any;
|
|
47
47
|
}
|
|
48
|
-
export declare class
|
|
48
|
+
export declare class KeyInstance {
|
|
49
49
|
protected _version: V1;
|
|
50
|
-
constructor(_version: V1, payload:
|
|
50
|
+
constructor(_version: V1, payload: KeyResource);
|
|
51
51
|
/**
|
|
52
52
|
* The unique string that that we created to identify the NewKey resource. You will use this as the basic-auth `user` when authenticating to the API.
|
|
53
53
|
*/
|