twilio 5.0.3 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/lib/rest/ContentBase.d.ts +3 -0
- package/lib/rest/ContentBase.js +5 -0
- package/lib/rest/Twilio.d.ts +0 -5
- package/lib/rest/Twilio.js +0 -6
- package/lib/rest/api/v2010/account/call/stream.d.ts +5 -5
- package/lib/rest/api/v2010/account/message.d.ts +1 -1
- package/lib/rest/content/V2.d.ts +20 -0
- package/lib/rest/content/V2.js +43 -0
- package/lib/rest/content/v2/content.d.ts +196 -0
- package/lib/rest/content/v2/content.js +136 -0
- package/lib/rest/content/v2/contentAndApprovals.d.ts +190 -0
- package/lib/rest/content/v2/contentAndApprovals.js +134 -0
- package/lib/rest/flexApi/V2.d.ts +5 -0
- package/lib/rest/flexApi/V2.js +6 -0
- package/lib/rest/flexApi/v1/interaction.d.ts +1 -1
- package/lib/rest/flexApi/v1/interaction.js +2 -4
- package/lib/rest/flexApi/v1/plugin/pluginVersions.d.ts +4 -1
- package/lib/rest/flexApi/v1/plugin/pluginVersions.js +2 -0
- package/lib/rest/flexApi/v2/flexUser.d.ts +170 -0
- package/lib/rest/flexApi/v2/flexUser.js +142 -0
- package/lib/rest/flexApi/v2/webChannels.d.ts +2 -0
- package/lib/rest/flexApi/v2/webChannels.js +2 -0
- package/lib/rest/intelligence/V2.d.ts +30 -0
- package/lib/rest/intelligence/V2.js +40 -0
- package/lib/rest/intelligence/v2/customOperator.d.ts +330 -0
- package/lib/rest/intelligence/v2/customOperator.js +279 -0
- package/lib/rest/intelligence/v2/operator.d.ts +263 -0
- package/lib/rest/intelligence/v2/operator.js +197 -0
- package/lib/rest/intelligence/v2/operatorAttachment.d.ts +112 -0
- package/lib/rest/intelligence/v2/operatorAttachment.js +135 -0
- package/lib/rest/intelligence/v2/operatorAttachments.d.ts +94 -0
- package/lib/rest/intelligence/v2/operatorAttachments.js +110 -0
- package/lib/rest/intelligence/v2/operatorType.d.ts +259 -0
- package/lib/rest/intelligence/v2/operatorType.js +197 -0
- package/lib/rest/intelligence/v2/prebuiltOperator.d.ts +263 -0
- package/lib/rest/intelligence/v2/prebuiltOperator.js +197 -0
- package/lib/rest/intelligence/v2/service.d.ts +8 -4
- package/lib/rest/intelligence/v2/service.js +3 -2
- package/lib/rest/messaging/v1/service.d.ts +0 -6
- package/lib/rest/messaging/v1/service.js +0 -2
- package/lib/rest/numbers/V1.d.ts +20 -10
- package/lib/rest/numbers/V1.js +31 -14
- package/lib/rest/numbers/v1/portingPortIn.d.ts +133 -14
- package/lib/rest/numbers/v1/portingPortIn.js +116 -24
- package/lib/rest/numbers/v1/portingPortInPhoneNumber.d.ts +175 -0
- package/lib/rest/numbers/v1/portingPortInPhoneNumber.js +157 -0
- package/lib/rest/numbers/v1/portingWebhookConfiguration.d.ts +79 -0
- package/lib/rest/{previewMessaging/v1/broadcast.js → numbers/v1/portingWebhookConfiguration.js} +19 -32
- package/lib/rest/numbers/v1/portingWebhookConfigurationDelete.d.ts +51 -0
- package/lib/rest/numbers/v1/portingWebhookConfigurationDelete.js +68 -0
- package/lib/rest/numbers/v1/portingWebhookConfigurationFetch.d.ts +75 -0
- package/lib/rest/numbers/v1/portingWebhookConfigurationFetch.js +72 -0
- package/lib/rest/taskrouter/v1/workspace/task.d.ts +24 -0
- package/lib/rest/taskrouter/v1/workspace/task.js +12 -0
- package/lib/rest/trusthub/v1/complianceTollfreeInquiries.d.ts +2 -0
- package/lib/rest/trusthub/v1/complianceTollfreeInquiries.js +2 -0
- package/lib/rest/trusthub/v1/customerProfiles.d.ts +6 -0
- package/lib/rest/trusthub/v1/customerProfiles.js +2 -0
- package/lib/rest/trusthub/v1/trustProducts.d.ts +6 -0
- package/lib/rest/trusthub/v1/trustProducts.js +2 -0
- package/lib/rest/verify/v2/service/verification.d.ts +1 -1
- package/lib/rest/verify/v2/service/verificationCheck.d.ts +1 -1
- package/lib/rest/verify/v2/service.d.ts +1 -1
- package/lib/webhooks/webhooks.js +9 -11
- package/package.json +4 -6
- package/lib/rest/PreviewMessaging.d.ts +0 -9
- package/lib/rest/PreviewMessaging.js +0 -15
- package/lib/rest/PreviewMessagingBase.d.ts +0 -13
- package/lib/rest/PreviewMessagingBase.js +0 -31
- package/lib/rest/numbers/v1/portingBulkPortability.d.ts +0 -120
- package/lib/rest/numbers/v1/portingBulkPortability.js +0 -136
- package/lib/rest/numbers/v1/portingPortInFetch.d.ts +0 -142
- package/lib/rest/numbers/v1/portingPortInFetch.js +0 -128
- package/lib/rest/previewMessaging/V1.d.ts +0 -20
- package/lib/rest/previewMessaging/V1.js +0 -42
- package/lib/rest/previewMessaging/v1/broadcast.d.ts +0 -108
- package/lib/rest/previewMessaging/v1/message.d.ts +0 -178
- package/lib/rest/previewMessaging/v1/message.js +0 -91
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Intelligence
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.OperatorPage = exports.OperatorListInstance = exports.OperatorInstance = exports.OperatorContextImpl = void 0;
|
|
20
|
+
const util_1 = require("util");
|
|
21
|
+
const Page_1 = __importDefault(require("../../../base/Page"));
|
|
22
|
+
const deserialize = require("../../../base/deserialize");
|
|
23
|
+
const serialize = require("../../../base/serialize");
|
|
24
|
+
const utility_1 = require("../../../base/utility");
|
|
25
|
+
class OperatorContextImpl {
|
|
26
|
+
constructor(_version, sid) {
|
|
27
|
+
this._version = _version;
|
|
28
|
+
if (!(0, utility_1.isValidPathParam)(sid)) {
|
|
29
|
+
throw new Error("Parameter 'sid' is not valid.");
|
|
30
|
+
}
|
|
31
|
+
this._solution = { sid };
|
|
32
|
+
this._uri = `/Operators/${sid}`;
|
|
33
|
+
}
|
|
34
|
+
fetch(callback) {
|
|
35
|
+
const instance = this;
|
|
36
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
37
|
+
uri: instance._uri,
|
|
38
|
+
method: "get",
|
|
39
|
+
});
|
|
40
|
+
operationPromise = operationPromise.then((payload) => new OperatorInstance(operationVersion, payload, instance._solution.sid));
|
|
41
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
42
|
+
return operationPromise;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Provide a user-friendly representation
|
|
46
|
+
*
|
|
47
|
+
* @returns Object
|
|
48
|
+
*/
|
|
49
|
+
toJSON() {
|
|
50
|
+
return this._solution;
|
|
51
|
+
}
|
|
52
|
+
[util_1.inspect.custom](_depth, options) {
|
|
53
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.OperatorContextImpl = OperatorContextImpl;
|
|
57
|
+
class OperatorInstance {
|
|
58
|
+
constructor(_version, payload, sid) {
|
|
59
|
+
this._version = _version;
|
|
60
|
+
this.accountSid = payload.account_sid;
|
|
61
|
+
this.sid = payload.sid;
|
|
62
|
+
this.friendlyName = payload.friendly_name;
|
|
63
|
+
this.description = payload.description;
|
|
64
|
+
this.author = payload.author;
|
|
65
|
+
this.operatorType = payload.operator_type;
|
|
66
|
+
this.version = deserialize.integer(payload.version);
|
|
67
|
+
this.availability = payload.availability;
|
|
68
|
+
this.config = payload.config;
|
|
69
|
+
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
|
70
|
+
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
|
71
|
+
this.url = payload.url;
|
|
72
|
+
this._solution = { sid: sid || this.sid };
|
|
73
|
+
}
|
|
74
|
+
get _proxy() {
|
|
75
|
+
this._context =
|
|
76
|
+
this._context ||
|
|
77
|
+
new OperatorContextImpl(this._version, this._solution.sid);
|
|
78
|
+
return this._context;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Fetch a OperatorInstance
|
|
82
|
+
*
|
|
83
|
+
* @param callback - Callback to handle processed record
|
|
84
|
+
*
|
|
85
|
+
* @returns Resolves to processed OperatorInstance
|
|
86
|
+
*/
|
|
87
|
+
fetch(callback) {
|
|
88
|
+
return this._proxy.fetch(callback);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Provide a user-friendly representation
|
|
92
|
+
*
|
|
93
|
+
* @returns Object
|
|
94
|
+
*/
|
|
95
|
+
toJSON() {
|
|
96
|
+
return {
|
|
97
|
+
accountSid: this.accountSid,
|
|
98
|
+
sid: this.sid,
|
|
99
|
+
friendlyName: this.friendlyName,
|
|
100
|
+
description: this.description,
|
|
101
|
+
author: this.author,
|
|
102
|
+
operatorType: this.operatorType,
|
|
103
|
+
version: this.version,
|
|
104
|
+
availability: this.availability,
|
|
105
|
+
config: this.config,
|
|
106
|
+
dateCreated: this.dateCreated,
|
|
107
|
+
dateUpdated: this.dateUpdated,
|
|
108
|
+
url: this.url,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
[util_1.inspect.custom](_depth, options) {
|
|
112
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
exports.OperatorInstance = OperatorInstance;
|
|
116
|
+
function OperatorListInstance(version) {
|
|
117
|
+
const instance = ((sid) => instance.get(sid));
|
|
118
|
+
instance.get = function get(sid) {
|
|
119
|
+
return new OperatorContextImpl(version, sid);
|
|
120
|
+
};
|
|
121
|
+
instance._version = version;
|
|
122
|
+
instance._solution = {};
|
|
123
|
+
instance._uri = `/Operators`;
|
|
124
|
+
instance.page = function page(params, callback) {
|
|
125
|
+
if (params instanceof Function) {
|
|
126
|
+
callback = params;
|
|
127
|
+
params = {};
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
params = params || {};
|
|
131
|
+
}
|
|
132
|
+
let data = {};
|
|
133
|
+
if (params["availability"] !== undefined)
|
|
134
|
+
data["Availability"] = params["availability"];
|
|
135
|
+
if (params["languageCode"] !== undefined)
|
|
136
|
+
data["LanguageCode"] = params["languageCode"];
|
|
137
|
+
if (params["pageSize"] !== undefined)
|
|
138
|
+
data["PageSize"] = params["pageSize"];
|
|
139
|
+
if (params.pageNumber !== undefined)
|
|
140
|
+
data["Page"] = params.pageNumber;
|
|
141
|
+
if (params.pageToken !== undefined)
|
|
142
|
+
data["PageToken"] = params.pageToken;
|
|
143
|
+
const headers = {};
|
|
144
|
+
let operationVersion = version, operationPromise = operationVersion.page({
|
|
145
|
+
uri: instance._uri,
|
|
146
|
+
method: "get",
|
|
147
|
+
params: data,
|
|
148
|
+
headers,
|
|
149
|
+
});
|
|
150
|
+
operationPromise = operationPromise.then((payload) => new OperatorPage(operationVersion, payload, instance._solution));
|
|
151
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
152
|
+
return operationPromise;
|
|
153
|
+
};
|
|
154
|
+
instance.each = instance._version.each;
|
|
155
|
+
instance.list = instance._version.list;
|
|
156
|
+
instance.getPage = function getPage(targetUrl, callback) {
|
|
157
|
+
const operationPromise = instance._version._domain.twilio.request({
|
|
158
|
+
method: "get",
|
|
159
|
+
uri: targetUrl,
|
|
160
|
+
});
|
|
161
|
+
let pagePromise = operationPromise.then((payload) => new OperatorPage(instance._version, payload, instance._solution));
|
|
162
|
+
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
163
|
+
return pagePromise;
|
|
164
|
+
};
|
|
165
|
+
instance.toJSON = function toJSON() {
|
|
166
|
+
return instance._solution;
|
|
167
|
+
};
|
|
168
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
169
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
170
|
+
};
|
|
171
|
+
return instance;
|
|
172
|
+
}
|
|
173
|
+
exports.OperatorListInstance = OperatorListInstance;
|
|
174
|
+
class OperatorPage extends Page_1.default {
|
|
175
|
+
/**
|
|
176
|
+
* Initialize the OperatorPage
|
|
177
|
+
*
|
|
178
|
+
* @param version - Version of the resource
|
|
179
|
+
* @param response - Response from the API
|
|
180
|
+
* @param solution - Path solution
|
|
181
|
+
*/
|
|
182
|
+
constructor(version, response, solution) {
|
|
183
|
+
super(version, response, solution);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Build an instance of OperatorInstance
|
|
187
|
+
*
|
|
188
|
+
* @param payload - Payload response from the API
|
|
189
|
+
*/
|
|
190
|
+
getInstance(payload) {
|
|
191
|
+
return new OperatorInstance(this._version, payload);
|
|
192
|
+
}
|
|
193
|
+
[util_1.inspect.custom](depth, options) {
|
|
194
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
exports.OperatorPage = OperatorPage;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { inspect, InspectOptions } from "util";
|
|
3
|
+
import V2 from "../V2";
|
|
4
|
+
export interface OperatorAttachmentContext {
|
|
5
|
+
/**
|
|
6
|
+
* Create a OperatorAttachmentInstance
|
|
7
|
+
*
|
|
8
|
+
* @param callback - Callback to handle processed record
|
|
9
|
+
*
|
|
10
|
+
* @returns Resolves to processed OperatorAttachmentInstance
|
|
11
|
+
*/
|
|
12
|
+
create(callback?: (error: Error | null, item?: OperatorAttachmentInstance) => any): Promise<OperatorAttachmentInstance>;
|
|
13
|
+
/**
|
|
14
|
+
* Remove a OperatorAttachmentInstance
|
|
15
|
+
*
|
|
16
|
+
* @param callback - Callback to handle processed record
|
|
17
|
+
*
|
|
18
|
+
* @returns Resolves to processed boolean
|
|
19
|
+
*/
|
|
20
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
21
|
+
/**
|
|
22
|
+
* Provide a user-friendly representation
|
|
23
|
+
*/
|
|
24
|
+
toJSON(): any;
|
|
25
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
26
|
+
}
|
|
27
|
+
export interface OperatorAttachmentContextSolution {
|
|
28
|
+
serviceSid: string;
|
|
29
|
+
operatorSid: string;
|
|
30
|
+
}
|
|
31
|
+
export declare class OperatorAttachmentContextImpl implements OperatorAttachmentContext {
|
|
32
|
+
protected _version: V2;
|
|
33
|
+
protected _solution: OperatorAttachmentContextSolution;
|
|
34
|
+
protected _uri: string;
|
|
35
|
+
constructor(_version: V2, serviceSid: string, operatorSid: string);
|
|
36
|
+
create(callback?: (error: Error | null, item?: OperatorAttachmentInstance) => any): Promise<OperatorAttachmentInstance>;
|
|
37
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* Provide a user-friendly representation
|
|
40
|
+
*
|
|
41
|
+
* @returns Object
|
|
42
|
+
*/
|
|
43
|
+
toJSON(): OperatorAttachmentContextSolution;
|
|
44
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
45
|
+
}
|
|
46
|
+
interface OperatorAttachmentResource {
|
|
47
|
+
service_sid: string;
|
|
48
|
+
operator_sid: string;
|
|
49
|
+
url: string;
|
|
50
|
+
}
|
|
51
|
+
export declare class OperatorAttachmentInstance {
|
|
52
|
+
protected _version: V2;
|
|
53
|
+
protected _solution: OperatorAttachmentContextSolution;
|
|
54
|
+
protected _context?: OperatorAttachmentContext;
|
|
55
|
+
constructor(_version: V2, payload: OperatorAttachmentResource, serviceSid?: string, operatorSid?: string);
|
|
56
|
+
/**
|
|
57
|
+
* The unique SID identifier of the Service.
|
|
58
|
+
*/
|
|
59
|
+
serviceSid: string;
|
|
60
|
+
/**
|
|
61
|
+
* The unique SID identifier of the Operator.
|
|
62
|
+
*/
|
|
63
|
+
operatorSid: string;
|
|
64
|
+
/**
|
|
65
|
+
* The URL of this resource.
|
|
66
|
+
*/
|
|
67
|
+
url: string;
|
|
68
|
+
private get _proxy();
|
|
69
|
+
/**
|
|
70
|
+
* Create a OperatorAttachmentInstance
|
|
71
|
+
*
|
|
72
|
+
* @param callback - Callback to handle processed record
|
|
73
|
+
*
|
|
74
|
+
* @returns Resolves to processed OperatorAttachmentInstance
|
|
75
|
+
*/
|
|
76
|
+
create(callback?: (error: Error | null, item?: OperatorAttachmentInstance) => any): Promise<OperatorAttachmentInstance>;
|
|
77
|
+
/**
|
|
78
|
+
* Remove a OperatorAttachmentInstance
|
|
79
|
+
*
|
|
80
|
+
* @param callback - Callback to handle processed record
|
|
81
|
+
*
|
|
82
|
+
* @returns Resolves to processed boolean
|
|
83
|
+
*/
|
|
84
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
85
|
+
/**
|
|
86
|
+
* Provide a user-friendly representation
|
|
87
|
+
*
|
|
88
|
+
* @returns Object
|
|
89
|
+
*/
|
|
90
|
+
toJSON(): {
|
|
91
|
+
serviceSid: string;
|
|
92
|
+
operatorSid: string;
|
|
93
|
+
url: string;
|
|
94
|
+
};
|
|
95
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
96
|
+
}
|
|
97
|
+
export interface OperatorAttachmentSolution {
|
|
98
|
+
}
|
|
99
|
+
export interface OperatorAttachmentListInstance {
|
|
100
|
+
_version: V2;
|
|
101
|
+
_solution: OperatorAttachmentSolution;
|
|
102
|
+
_uri: string;
|
|
103
|
+
(serviceSid: string, operatorSid: string): OperatorAttachmentContext;
|
|
104
|
+
get(serviceSid: string, operatorSid: string): OperatorAttachmentContext;
|
|
105
|
+
/**
|
|
106
|
+
* Provide a user-friendly representation
|
|
107
|
+
*/
|
|
108
|
+
toJSON(): any;
|
|
109
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
110
|
+
}
|
|
111
|
+
export declare function OperatorAttachmentListInstance(version: V2): OperatorAttachmentListInstance;
|
|
112
|
+
export {};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Intelligence
|
|
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.OperatorAttachmentListInstance = exports.OperatorAttachmentInstance = exports.OperatorAttachmentContextImpl = 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 OperatorAttachmentContextImpl {
|
|
22
|
+
constructor(_version, serviceSid, operatorSid) {
|
|
23
|
+
this._version = _version;
|
|
24
|
+
if (!(0, utility_1.isValidPathParam)(serviceSid)) {
|
|
25
|
+
throw new Error("Parameter 'serviceSid' is not valid.");
|
|
26
|
+
}
|
|
27
|
+
if (!(0, utility_1.isValidPathParam)(operatorSid)) {
|
|
28
|
+
throw new Error("Parameter 'operatorSid' is not valid.");
|
|
29
|
+
}
|
|
30
|
+
this._solution = { serviceSid, operatorSid };
|
|
31
|
+
this._uri = `/Services/${serviceSid}/Operators/${operatorSid}`;
|
|
32
|
+
}
|
|
33
|
+
create(callback) {
|
|
34
|
+
const instance = this;
|
|
35
|
+
let operationVersion = instance._version, operationPromise = operationVersion.create({
|
|
36
|
+
uri: instance._uri,
|
|
37
|
+
method: "post",
|
|
38
|
+
});
|
|
39
|
+
operationPromise = operationPromise.then((payload) => new OperatorAttachmentInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.operatorSid));
|
|
40
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
41
|
+
return operationPromise;
|
|
42
|
+
}
|
|
43
|
+
remove(callback) {
|
|
44
|
+
const instance = this;
|
|
45
|
+
let operationVersion = instance._version, operationPromise = operationVersion.remove({
|
|
46
|
+
uri: instance._uri,
|
|
47
|
+
method: "delete",
|
|
48
|
+
});
|
|
49
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
50
|
+
return operationPromise;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Provide a user-friendly representation
|
|
54
|
+
*
|
|
55
|
+
* @returns Object
|
|
56
|
+
*/
|
|
57
|
+
toJSON() {
|
|
58
|
+
return this._solution;
|
|
59
|
+
}
|
|
60
|
+
[util_1.inspect.custom](_depth, options) {
|
|
61
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.OperatorAttachmentContextImpl = OperatorAttachmentContextImpl;
|
|
65
|
+
class OperatorAttachmentInstance {
|
|
66
|
+
constructor(_version, payload, serviceSid, operatorSid) {
|
|
67
|
+
this._version = _version;
|
|
68
|
+
this.serviceSid = payload.service_sid;
|
|
69
|
+
this.operatorSid = payload.operator_sid;
|
|
70
|
+
this.url = payload.url;
|
|
71
|
+
this._solution = {
|
|
72
|
+
serviceSid: serviceSid || this.serviceSid,
|
|
73
|
+
operatorSid: operatorSid || this.operatorSid,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
get _proxy() {
|
|
77
|
+
this._context =
|
|
78
|
+
this._context ||
|
|
79
|
+
new OperatorAttachmentContextImpl(this._version, this._solution.serviceSid, this._solution.operatorSid);
|
|
80
|
+
return this._context;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Create a OperatorAttachmentInstance
|
|
84
|
+
*
|
|
85
|
+
* @param callback - Callback to handle processed record
|
|
86
|
+
*
|
|
87
|
+
* @returns Resolves to processed OperatorAttachmentInstance
|
|
88
|
+
*/
|
|
89
|
+
create(callback) {
|
|
90
|
+
return this._proxy.create(callback);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Remove a OperatorAttachmentInstance
|
|
94
|
+
*
|
|
95
|
+
* @param callback - Callback to handle processed record
|
|
96
|
+
*
|
|
97
|
+
* @returns Resolves to processed boolean
|
|
98
|
+
*/
|
|
99
|
+
remove(callback) {
|
|
100
|
+
return this._proxy.remove(callback);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Provide a user-friendly representation
|
|
104
|
+
*
|
|
105
|
+
* @returns Object
|
|
106
|
+
*/
|
|
107
|
+
toJSON() {
|
|
108
|
+
return {
|
|
109
|
+
serviceSid: this.serviceSid,
|
|
110
|
+
operatorSid: this.operatorSid,
|
|
111
|
+
url: this.url,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
[util_1.inspect.custom](_depth, options) {
|
|
115
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.OperatorAttachmentInstance = OperatorAttachmentInstance;
|
|
119
|
+
function OperatorAttachmentListInstance(version) {
|
|
120
|
+
const instance = ((serviceSid, operatorSid) => instance.get(serviceSid, operatorSid));
|
|
121
|
+
instance.get = function get(serviceSid, operatorSid) {
|
|
122
|
+
return new OperatorAttachmentContextImpl(version, serviceSid, operatorSid);
|
|
123
|
+
};
|
|
124
|
+
instance._version = version;
|
|
125
|
+
instance._solution = {};
|
|
126
|
+
instance._uri = ``;
|
|
127
|
+
instance.toJSON = function toJSON() {
|
|
128
|
+
return instance._solution;
|
|
129
|
+
};
|
|
130
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
131
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
132
|
+
};
|
|
133
|
+
return instance;
|
|
134
|
+
}
|
|
135
|
+
exports.OperatorAttachmentListInstance = OperatorAttachmentListInstance;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { inspect, InspectOptions } from "util";
|
|
3
|
+
import V2 from "../V2";
|
|
4
|
+
export interface OperatorAttachmentsContext {
|
|
5
|
+
/**
|
|
6
|
+
* Fetch a OperatorAttachmentsInstance
|
|
7
|
+
*
|
|
8
|
+
* @param callback - Callback to handle processed record
|
|
9
|
+
*
|
|
10
|
+
* @returns Resolves to processed OperatorAttachmentsInstance
|
|
11
|
+
*/
|
|
12
|
+
fetch(callback?: (error: Error | null, item?: OperatorAttachmentsInstance) => any): Promise<OperatorAttachmentsInstance>;
|
|
13
|
+
/**
|
|
14
|
+
* Provide a user-friendly representation
|
|
15
|
+
*/
|
|
16
|
+
toJSON(): any;
|
|
17
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
18
|
+
}
|
|
19
|
+
export interface OperatorAttachmentsContextSolution {
|
|
20
|
+
serviceSid: string;
|
|
21
|
+
}
|
|
22
|
+
export declare class OperatorAttachmentsContextImpl implements OperatorAttachmentsContext {
|
|
23
|
+
protected _version: V2;
|
|
24
|
+
protected _solution: OperatorAttachmentsContextSolution;
|
|
25
|
+
protected _uri: string;
|
|
26
|
+
constructor(_version: V2, serviceSid: string);
|
|
27
|
+
fetch(callback?: (error: Error | null, item?: OperatorAttachmentsInstance) => any): Promise<OperatorAttachmentsInstance>;
|
|
28
|
+
/**
|
|
29
|
+
* Provide a user-friendly representation
|
|
30
|
+
*
|
|
31
|
+
* @returns Object
|
|
32
|
+
*/
|
|
33
|
+
toJSON(): OperatorAttachmentsContextSolution;
|
|
34
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
35
|
+
}
|
|
36
|
+
interface OperatorAttachmentsResource {
|
|
37
|
+
service_sid: string;
|
|
38
|
+
operator_sids: Array<string>;
|
|
39
|
+
url: string;
|
|
40
|
+
}
|
|
41
|
+
export declare class OperatorAttachmentsInstance {
|
|
42
|
+
protected _version: V2;
|
|
43
|
+
protected _solution: OperatorAttachmentsContextSolution;
|
|
44
|
+
protected _context?: OperatorAttachmentsContext;
|
|
45
|
+
constructor(_version: V2, payload: OperatorAttachmentsResource, serviceSid?: string);
|
|
46
|
+
/**
|
|
47
|
+
* The unique SID identifier of the Service.
|
|
48
|
+
*/
|
|
49
|
+
serviceSid: string;
|
|
50
|
+
/**
|
|
51
|
+
* List of Operator SIDs attached to the service. Includes both Custom and Pre-built Operators.
|
|
52
|
+
*/
|
|
53
|
+
operatorSids: Array<string>;
|
|
54
|
+
/**
|
|
55
|
+
* The URL of this resource.
|
|
56
|
+
*/
|
|
57
|
+
url: string;
|
|
58
|
+
private get _proxy();
|
|
59
|
+
/**
|
|
60
|
+
* Fetch a OperatorAttachmentsInstance
|
|
61
|
+
*
|
|
62
|
+
* @param callback - Callback to handle processed record
|
|
63
|
+
*
|
|
64
|
+
* @returns Resolves to processed OperatorAttachmentsInstance
|
|
65
|
+
*/
|
|
66
|
+
fetch(callback?: (error: Error | null, item?: OperatorAttachmentsInstance) => any): Promise<OperatorAttachmentsInstance>;
|
|
67
|
+
/**
|
|
68
|
+
* Provide a user-friendly representation
|
|
69
|
+
*
|
|
70
|
+
* @returns Object
|
|
71
|
+
*/
|
|
72
|
+
toJSON(): {
|
|
73
|
+
serviceSid: string;
|
|
74
|
+
operatorSids: string[];
|
|
75
|
+
url: string;
|
|
76
|
+
};
|
|
77
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
78
|
+
}
|
|
79
|
+
export interface OperatorAttachmentsSolution {
|
|
80
|
+
}
|
|
81
|
+
export interface OperatorAttachmentsListInstance {
|
|
82
|
+
_version: V2;
|
|
83
|
+
_solution: OperatorAttachmentsSolution;
|
|
84
|
+
_uri: string;
|
|
85
|
+
(serviceSid: string): OperatorAttachmentsContext;
|
|
86
|
+
get(serviceSid: string): OperatorAttachmentsContext;
|
|
87
|
+
/**
|
|
88
|
+
* Provide a user-friendly representation
|
|
89
|
+
*/
|
|
90
|
+
toJSON(): any;
|
|
91
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
92
|
+
}
|
|
93
|
+
export declare function OperatorAttachmentsListInstance(version: V2): OperatorAttachmentsListInstance;
|
|
94
|
+
export {};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Intelligence
|
|
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.OperatorAttachmentsListInstance = exports.OperatorAttachmentsInstance = exports.OperatorAttachmentsContextImpl = 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 OperatorAttachmentsContextImpl {
|
|
22
|
+
constructor(_version, serviceSid) {
|
|
23
|
+
this._version = _version;
|
|
24
|
+
if (!(0, utility_1.isValidPathParam)(serviceSid)) {
|
|
25
|
+
throw new Error("Parameter 'serviceSid' is not valid.");
|
|
26
|
+
}
|
|
27
|
+
this._solution = { serviceSid };
|
|
28
|
+
this._uri = `/Services/${serviceSid}/Operators`;
|
|
29
|
+
}
|
|
30
|
+
fetch(callback) {
|
|
31
|
+
const instance = this;
|
|
32
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
33
|
+
uri: instance._uri,
|
|
34
|
+
method: "get",
|
|
35
|
+
});
|
|
36
|
+
operationPromise = operationPromise.then((payload) => new OperatorAttachmentsInstance(operationVersion, payload, instance._solution.serviceSid));
|
|
37
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
38
|
+
return operationPromise;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Provide a user-friendly representation
|
|
42
|
+
*
|
|
43
|
+
* @returns Object
|
|
44
|
+
*/
|
|
45
|
+
toJSON() {
|
|
46
|
+
return this._solution;
|
|
47
|
+
}
|
|
48
|
+
[util_1.inspect.custom](_depth, options) {
|
|
49
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.OperatorAttachmentsContextImpl = OperatorAttachmentsContextImpl;
|
|
53
|
+
class OperatorAttachmentsInstance {
|
|
54
|
+
constructor(_version, payload, serviceSid) {
|
|
55
|
+
this._version = _version;
|
|
56
|
+
this.serviceSid = payload.service_sid;
|
|
57
|
+
this.operatorSids = payload.operator_sids;
|
|
58
|
+
this.url = payload.url;
|
|
59
|
+
this._solution = { serviceSid: serviceSid || this.serviceSid };
|
|
60
|
+
}
|
|
61
|
+
get _proxy() {
|
|
62
|
+
this._context =
|
|
63
|
+
this._context ||
|
|
64
|
+
new OperatorAttachmentsContextImpl(this._version, this._solution.serviceSid);
|
|
65
|
+
return this._context;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Fetch a OperatorAttachmentsInstance
|
|
69
|
+
*
|
|
70
|
+
* @param callback - Callback to handle processed record
|
|
71
|
+
*
|
|
72
|
+
* @returns Resolves to processed OperatorAttachmentsInstance
|
|
73
|
+
*/
|
|
74
|
+
fetch(callback) {
|
|
75
|
+
return this._proxy.fetch(callback);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Provide a user-friendly representation
|
|
79
|
+
*
|
|
80
|
+
* @returns Object
|
|
81
|
+
*/
|
|
82
|
+
toJSON() {
|
|
83
|
+
return {
|
|
84
|
+
serviceSid: this.serviceSid,
|
|
85
|
+
operatorSids: this.operatorSids,
|
|
86
|
+
url: this.url,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
[util_1.inspect.custom](_depth, options) {
|
|
90
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
exports.OperatorAttachmentsInstance = OperatorAttachmentsInstance;
|
|
94
|
+
function OperatorAttachmentsListInstance(version) {
|
|
95
|
+
const instance = ((serviceSid) => instance.get(serviceSid));
|
|
96
|
+
instance.get = function get(serviceSid) {
|
|
97
|
+
return new OperatorAttachmentsContextImpl(version, serviceSid);
|
|
98
|
+
};
|
|
99
|
+
instance._version = version;
|
|
100
|
+
instance._solution = {};
|
|
101
|
+
instance._uri = ``;
|
|
102
|
+
instance.toJSON = function toJSON() {
|
|
103
|
+
return instance._solution;
|
|
104
|
+
};
|
|
105
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
106
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
107
|
+
};
|
|
108
|
+
return instance;
|
|
109
|
+
}
|
|
110
|
+
exports.OperatorAttachmentsListInstance = OperatorAttachmentsListInstance;
|