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,142 @@
|
|
|
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.FlexUserListInstance = exports.FlexUserInstance = exports.FlexUserContextImpl = 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 FlexUserContextImpl {
|
|
22
|
+
constructor(_version, instanceSid, flexUserSid) {
|
|
23
|
+
this._version = _version;
|
|
24
|
+
if (!(0, utility_1.isValidPathParam)(instanceSid)) {
|
|
25
|
+
throw new Error("Parameter 'instanceSid' is not valid.");
|
|
26
|
+
}
|
|
27
|
+
if (!(0, utility_1.isValidPathParam)(flexUserSid)) {
|
|
28
|
+
throw new Error("Parameter 'flexUserSid' is not valid.");
|
|
29
|
+
}
|
|
30
|
+
this._solution = { instanceSid, flexUserSid };
|
|
31
|
+
this._uri = `/Instances/${instanceSid}/Users/${flexUserSid}`;
|
|
32
|
+
}
|
|
33
|
+
fetch(callback) {
|
|
34
|
+
const instance = this;
|
|
35
|
+
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
36
|
+
uri: instance._uri,
|
|
37
|
+
method: "get",
|
|
38
|
+
});
|
|
39
|
+
operationPromise = operationPromise.then((payload) => new FlexUserInstance(operationVersion, payload, instance._solution.instanceSid, instance._solution.flexUserSid));
|
|
40
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
41
|
+
return operationPromise;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Provide a user-friendly representation
|
|
45
|
+
*
|
|
46
|
+
* @returns Object
|
|
47
|
+
*/
|
|
48
|
+
toJSON() {
|
|
49
|
+
return this._solution;
|
|
50
|
+
}
|
|
51
|
+
[util_1.inspect.custom](_depth, options) {
|
|
52
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.FlexUserContextImpl = FlexUserContextImpl;
|
|
56
|
+
class FlexUserInstance {
|
|
57
|
+
constructor(_version, payload, instanceSid, flexUserSid) {
|
|
58
|
+
this._version = _version;
|
|
59
|
+
this.accountSid = payload.account_sid;
|
|
60
|
+
this.instanceSid = payload.instance_sid;
|
|
61
|
+
this.userSid = payload.user_sid;
|
|
62
|
+
this.flexUserSid = payload.flex_user_sid;
|
|
63
|
+
this.workerSid = payload.worker_sid;
|
|
64
|
+
this.workspaceSid = payload.workspace_sid;
|
|
65
|
+
this.flexTeamSid = payload.flex_team_sid;
|
|
66
|
+
this.firstName = payload.first_name;
|
|
67
|
+
this.lastName = payload.last_name;
|
|
68
|
+
this.username = payload.username;
|
|
69
|
+
this.email = payload.email;
|
|
70
|
+
this.friendlyName = payload.friendly_name;
|
|
71
|
+
this.createdDate = deserialize.iso8601DateTime(payload.created_date);
|
|
72
|
+
this.updatedDate = deserialize.iso8601DateTime(payload.updated_date);
|
|
73
|
+
this.version = deserialize.integer(payload.version);
|
|
74
|
+
this.url = payload.url;
|
|
75
|
+
this._solution = {
|
|
76
|
+
instanceSid: instanceSid || this.instanceSid,
|
|
77
|
+
flexUserSid: flexUserSid || this.flexUserSid,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
get _proxy() {
|
|
81
|
+
this._context =
|
|
82
|
+
this._context ||
|
|
83
|
+
new FlexUserContextImpl(this._version, this._solution.instanceSid, this._solution.flexUserSid);
|
|
84
|
+
return this._context;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Fetch a FlexUserInstance
|
|
88
|
+
*
|
|
89
|
+
* @param callback - Callback to handle processed record
|
|
90
|
+
*
|
|
91
|
+
* @returns Resolves to processed FlexUserInstance
|
|
92
|
+
*/
|
|
93
|
+
fetch(callback) {
|
|
94
|
+
return this._proxy.fetch(callback);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Provide a user-friendly representation
|
|
98
|
+
*
|
|
99
|
+
* @returns Object
|
|
100
|
+
*/
|
|
101
|
+
toJSON() {
|
|
102
|
+
return {
|
|
103
|
+
accountSid: this.accountSid,
|
|
104
|
+
instanceSid: this.instanceSid,
|
|
105
|
+
userSid: this.userSid,
|
|
106
|
+
flexUserSid: this.flexUserSid,
|
|
107
|
+
workerSid: this.workerSid,
|
|
108
|
+
workspaceSid: this.workspaceSid,
|
|
109
|
+
flexTeamSid: this.flexTeamSid,
|
|
110
|
+
firstName: this.firstName,
|
|
111
|
+
lastName: this.lastName,
|
|
112
|
+
username: this.username,
|
|
113
|
+
email: this.email,
|
|
114
|
+
friendlyName: this.friendlyName,
|
|
115
|
+
createdDate: this.createdDate,
|
|
116
|
+
updatedDate: this.updatedDate,
|
|
117
|
+
version: this.version,
|
|
118
|
+
url: this.url,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
[util_1.inspect.custom](_depth, options) {
|
|
122
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
exports.FlexUserInstance = FlexUserInstance;
|
|
126
|
+
function FlexUserListInstance(version) {
|
|
127
|
+
const instance = ((instanceSid, flexUserSid) => instance.get(instanceSid, flexUserSid));
|
|
128
|
+
instance.get = function get(instanceSid, flexUserSid) {
|
|
129
|
+
return new FlexUserContextImpl(version, instanceSid, flexUserSid);
|
|
130
|
+
};
|
|
131
|
+
instance._version = version;
|
|
132
|
+
instance._solution = {};
|
|
133
|
+
instance._uri = ``;
|
|
134
|
+
instance.toJSON = function toJSON() {
|
|
135
|
+
return instance._solution;
|
|
136
|
+
};
|
|
137
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
138
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
139
|
+
};
|
|
140
|
+
return instance;
|
|
141
|
+
}
|
|
142
|
+
exports.FlexUserListInstance = FlexUserListInstance;
|
|
@@ -7,6 +7,8 @@ import V2 from "../V2";
|
|
|
7
7
|
export interface WebChannelsListInstanceCreateOptions {
|
|
8
8
|
/** The SID of the Conversations Address. See [Address Configuration Resource](https://www.twilio.com/docs/conversations/api/address-configuration-resource) for configuration details. When a conversation is created on the Flex backend, the callback URL will be set to the corresponding Studio Flow SID or webhook URL in your address configuration. */
|
|
9
9
|
addressSid: string;
|
|
10
|
+
/** The Ui-Version HTTP request header */
|
|
11
|
+
uiVersion?: string;
|
|
10
12
|
/** The Conversation\\\'s friendly name. See the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource) for an example. */
|
|
11
13
|
chatFriendlyName?: string;
|
|
12
14
|
/** The Conversation participant\\\'s friendly name. See the [Conversation Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource) for an example. */
|
|
@@ -39,6 +39,8 @@ function WebChannelsListInstance(version) {
|
|
|
39
39
|
data["PreEngagementData"] = params["preEngagementData"];
|
|
40
40
|
const headers = {};
|
|
41
41
|
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
42
|
+
if (params["uiVersion"] !== undefined)
|
|
43
|
+
headers["Ui-Version"] = params["uiVersion"];
|
|
42
44
|
let operationVersion = version, operationPromise = operationVersion.create({
|
|
43
45
|
uri: instance._uri,
|
|
44
46
|
method: "post",
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import IntelligenceBase from "../IntelligenceBase";
|
|
2
2
|
import Version from "../../base/Version";
|
|
3
|
+
import { CustomOperatorListInstance } from "./v2/customOperator";
|
|
4
|
+
import { OperatorListInstance } from "./v2/operator";
|
|
5
|
+
import { OperatorAttachmentListInstance } from "./v2/operatorAttachment";
|
|
6
|
+
import { OperatorAttachmentsListInstance } from "./v2/operatorAttachments";
|
|
7
|
+
import { OperatorTypeListInstance } from "./v2/operatorType";
|
|
8
|
+
import { PrebuiltOperatorListInstance } from "./v2/prebuiltOperator";
|
|
3
9
|
import { ServiceListInstance } from "./v2/service";
|
|
4
10
|
import { TranscriptListInstance } from "./v2/transcript";
|
|
5
11
|
export default class V2 extends Version {
|
|
@@ -9,10 +15,34 @@ export default class V2 extends Version {
|
|
|
9
15
|
* @param domain - The Twilio (Twilio.Intelligence) domain
|
|
10
16
|
*/
|
|
11
17
|
constructor(domain: IntelligenceBase);
|
|
18
|
+
/** customOperators - { Twilio.Intelligence.V2.CustomOperatorListInstance } resource */
|
|
19
|
+
protected _customOperators?: CustomOperatorListInstance;
|
|
20
|
+
/** operators - { Twilio.Intelligence.V2.OperatorListInstance } resource */
|
|
21
|
+
protected _operators?: OperatorListInstance;
|
|
22
|
+
/** operatorAttachment - { Twilio.Intelligence.V2.OperatorAttachmentListInstance } resource */
|
|
23
|
+
protected _operatorAttachment?: OperatorAttachmentListInstance;
|
|
24
|
+
/** operatorAttachments - { Twilio.Intelligence.V2.OperatorAttachmentsListInstance } resource */
|
|
25
|
+
protected _operatorAttachments?: OperatorAttachmentsListInstance;
|
|
26
|
+
/** operatorType - { Twilio.Intelligence.V2.OperatorTypeListInstance } resource */
|
|
27
|
+
protected _operatorType?: OperatorTypeListInstance;
|
|
28
|
+
/** prebuiltOperators - { Twilio.Intelligence.V2.PrebuiltOperatorListInstance } resource */
|
|
29
|
+
protected _prebuiltOperators?: PrebuiltOperatorListInstance;
|
|
12
30
|
/** services - { Twilio.Intelligence.V2.ServiceListInstance } resource */
|
|
13
31
|
protected _services?: ServiceListInstance;
|
|
14
32
|
/** transcripts - { Twilio.Intelligence.V2.TranscriptListInstance } resource */
|
|
15
33
|
protected _transcripts?: TranscriptListInstance;
|
|
34
|
+
/** Getter for customOperators resource */
|
|
35
|
+
get customOperators(): CustomOperatorListInstance;
|
|
36
|
+
/** Getter for operators resource */
|
|
37
|
+
get operators(): OperatorListInstance;
|
|
38
|
+
/** Getter for operatorAttachment resource */
|
|
39
|
+
get operatorAttachment(): OperatorAttachmentListInstance;
|
|
40
|
+
/** Getter for operatorAttachments resource */
|
|
41
|
+
get operatorAttachments(): OperatorAttachmentsListInstance;
|
|
42
|
+
/** Getter for operatorType resource */
|
|
43
|
+
get operatorType(): OperatorTypeListInstance;
|
|
44
|
+
/** Getter for prebuiltOperators resource */
|
|
45
|
+
get prebuiltOperators(): PrebuiltOperatorListInstance;
|
|
16
46
|
/** Getter for services resource */
|
|
17
47
|
get services(): ServiceListInstance;
|
|
18
48
|
/** Getter for transcripts resource */
|
|
@@ -17,6 +17,12 @@ 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 customOperator_1 = require("./v2/customOperator");
|
|
21
|
+
const operator_1 = require("./v2/operator");
|
|
22
|
+
const operatorAttachment_1 = require("./v2/operatorAttachment");
|
|
23
|
+
const operatorAttachments_1 = require("./v2/operatorAttachments");
|
|
24
|
+
const operatorType_1 = require("./v2/operatorType");
|
|
25
|
+
const prebuiltOperator_1 = require("./v2/prebuiltOperator");
|
|
20
26
|
const service_1 = require("./v2/service");
|
|
21
27
|
const transcript_1 = require("./v2/transcript");
|
|
22
28
|
class V2 extends Version_1.default {
|
|
@@ -28,6 +34,40 @@ class V2 extends Version_1.default {
|
|
|
28
34
|
constructor(domain) {
|
|
29
35
|
super(domain, "v2");
|
|
30
36
|
}
|
|
37
|
+
/** Getter for customOperators resource */
|
|
38
|
+
get customOperators() {
|
|
39
|
+
this._customOperators =
|
|
40
|
+
this._customOperators || (0, customOperator_1.CustomOperatorListInstance)(this);
|
|
41
|
+
return this._customOperators;
|
|
42
|
+
}
|
|
43
|
+
/** Getter for operators resource */
|
|
44
|
+
get operators() {
|
|
45
|
+
this._operators = this._operators || (0, operator_1.OperatorListInstance)(this);
|
|
46
|
+
return this._operators;
|
|
47
|
+
}
|
|
48
|
+
/** Getter for operatorAttachment resource */
|
|
49
|
+
get operatorAttachment() {
|
|
50
|
+
this._operatorAttachment =
|
|
51
|
+
this._operatorAttachment || (0, operatorAttachment_1.OperatorAttachmentListInstance)(this);
|
|
52
|
+
return this._operatorAttachment;
|
|
53
|
+
}
|
|
54
|
+
/** Getter for operatorAttachments resource */
|
|
55
|
+
get operatorAttachments() {
|
|
56
|
+
this._operatorAttachments =
|
|
57
|
+
this._operatorAttachments || (0, operatorAttachments_1.OperatorAttachmentsListInstance)(this);
|
|
58
|
+
return this._operatorAttachments;
|
|
59
|
+
}
|
|
60
|
+
/** Getter for operatorType resource */
|
|
61
|
+
get operatorType() {
|
|
62
|
+
this._operatorType = this._operatorType || (0, operatorType_1.OperatorTypeListInstance)(this);
|
|
63
|
+
return this._operatorType;
|
|
64
|
+
}
|
|
65
|
+
/** Getter for prebuiltOperators resource */
|
|
66
|
+
get prebuiltOperators() {
|
|
67
|
+
this._prebuiltOperators =
|
|
68
|
+
this._prebuiltOperators || (0, prebuiltOperator_1.PrebuiltOperatorListInstance)(this);
|
|
69
|
+
return this._prebuiltOperators;
|
|
70
|
+
}
|
|
31
71
|
/** Getter for services resource */
|
|
32
72
|
get services() {
|
|
33
73
|
this._services = this._services || (0, service_1.ServiceListInstance)(this);
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { inspect, InspectOptions } from "util";
|
|
3
|
+
import Page, { TwilioResponsePayload } from "../../../base/Page";
|
|
4
|
+
import Response from "../../../http/response";
|
|
5
|
+
import V2 from "../V2";
|
|
6
|
+
export type CustomOperatorAvailability = "internal" | "beta" | "public" | "retired";
|
|
7
|
+
/**
|
|
8
|
+
* Options to pass to update a CustomOperatorInstance
|
|
9
|
+
*/
|
|
10
|
+
export interface CustomOperatorContextUpdateOptions {
|
|
11
|
+
/** A human-readable name of this resource, up to 64 characters. */
|
|
12
|
+
friendlyName: string;
|
|
13
|
+
/** Operator configuration, following the schema defined by the Operator Type. */
|
|
14
|
+
config: any;
|
|
15
|
+
/** The If-Match HTTP request header */
|
|
16
|
+
ifMatch?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Options to pass to create a CustomOperatorInstance
|
|
20
|
+
*/
|
|
21
|
+
export interface CustomOperatorListInstanceCreateOptions {
|
|
22
|
+
/** A human readable description of the new Operator, up to 64 characters. */
|
|
23
|
+
friendlyName: string;
|
|
24
|
+
/** Operator Type for this Operator. References an existing Operator Type resource. */
|
|
25
|
+
operatorType: string;
|
|
26
|
+
/** Operator configuration, following the schema defined by the Operator Type. */
|
|
27
|
+
config: any;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Options to pass to each
|
|
31
|
+
*/
|
|
32
|
+
export interface CustomOperatorListInstanceEachOptions {
|
|
33
|
+
/** Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired. */
|
|
34
|
+
availability?: CustomOperatorAvailability;
|
|
35
|
+
/** Returns Custom Operators that support the provided language code. */
|
|
36
|
+
languageCode?: string;
|
|
37
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
38
|
+
pageSize?: number;
|
|
39
|
+
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
|
40
|
+
callback?: (item: CustomOperatorInstance, done: (err?: Error) => void) => void;
|
|
41
|
+
/** Function to be called upon completion of streaming */
|
|
42
|
+
done?: Function;
|
|
43
|
+
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
|
44
|
+
limit?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Options to pass to list
|
|
48
|
+
*/
|
|
49
|
+
export interface CustomOperatorListInstanceOptions {
|
|
50
|
+
/** Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired. */
|
|
51
|
+
availability?: CustomOperatorAvailability;
|
|
52
|
+
/** Returns Custom Operators that support the provided language code. */
|
|
53
|
+
languageCode?: string;
|
|
54
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
55
|
+
pageSize?: number;
|
|
56
|
+
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
|
57
|
+
limit?: number;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Options to pass to page
|
|
61
|
+
*/
|
|
62
|
+
export interface CustomOperatorListInstancePageOptions {
|
|
63
|
+
/** Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired. */
|
|
64
|
+
availability?: CustomOperatorAvailability;
|
|
65
|
+
/** Returns Custom Operators that support the provided language code. */
|
|
66
|
+
languageCode?: string;
|
|
67
|
+
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
68
|
+
pageSize?: number;
|
|
69
|
+
/** Page Number, this value is simply for client state */
|
|
70
|
+
pageNumber?: number;
|
|
71
|
+
/** PageToken provided by the API */
|
|
72
|
+
pageToken?: string;
|
|
73
|
+
}
|
|
74
|
+
export interface CustomOperatorContext {
|
|
75
|
+
/**
|
|
76
|
+
* Remove a CustomOperatorInstance
|
|
77
|
+
*
|
|
78
|
+
* @param callback - Callback to handle processed record
|
|
79
|
+
*
|
|
80
|
+
* @returns Resolves to processed boolean
|
|
81
|
+
*/
|
|
82
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
83
|
+
/**
|
|
84
|
+
* Fetch a CustomOperatorInstance
|
|
85
|
+
*
|
|
86
|
+
* @param callback - Callback to handle processed record
|
|
87
|
+
*
|
|
88
|
+
* @returns Resolves to processed CustomOperatorInstance
|
|
89
|
+
*/
|
|
90
|
+
fetch(callback?: (error: Error | null, item?: CustomOperatorInstance) => any): Promise<CustomOperatorInstance>;
|
|
91
|
+
/**
|
|
92
|
+
* Update a CustomOperatorInstance
|
|
93
|
+
*
|
|
94
|
+
* @param params - Parameter for request
|
|
95
|
+
* @param callback - Callback to handle processed record
|
|
96
|
+
*
|
|
97
|
+
* @returns Resolves to processed CustomOperatorInstance
|
|
98
|
+
*/
|
|
99
|
+
update(params: CustomOperatorContextUpdateOptions, callback?: (error: Error | null, item?: CustomOperatorInstance) => any): Promise<CustomOperatorInstance>;
|
|
100
|
+
/**
|
|
101
|
+
* Provide a user-friendly representation
|
|
102
|
+
*/
|
|
103
|
+
toJSON(): any;
|
|
104
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
105
|
+
}
|
|
106
|
+
export interface CustomOperatorContextSolution {
|
|
107
|
+
sid: string;
|
|
108
|
+
}
|
|
109
|
+
export declare class CustomOperatorContextImpl implements CustomOperatorContext {
|
|
110
|
+
protected _version: V2;
|
|
111
|
+
protected _solution: CustomOperatorContextSolution;
|
|
112
|
+
protected _uri: string;
|
|
113
|
+
constructor(_version: V2, sid: string);
|
|
114
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
115
|
+
fetch(callback?: (error: Error | null, item?: CustomOperatorInstance) => any): Promise<CustomOperatorInstance>;
|
|
116
|
+
update(params: CustomOperatorContextUpdateOptions, callback?: (error: Error | null, item?: CustomOperatorInstance) => any): Promise<CustomOperatorInstance>;
|
|
117
|
+
/**
|
|
118
|
+
* Provide a user-friendly representation
|
|
119
|
+
*
|
|
120
|
+
* @returns Object
|
|
121
|
+
*/
|
|
122
|
+
toJSON(): CustomOperatorContextSolution;
|
|
123
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
124
|
+
}
|
|
125
|
+
interface CustomOperatorPayload extends TwilioResponsePayload {
|
|
126
|
+
operators: CustomOperatorResource[];
|
|
127
|
+
}
|
|
128
|
+
interface CustomOperatorResource {
|
|
129
|
+
account_sid: string;
|
|
130
|
+
sid: string;
|
|
131
|
+
friendly_name: string;
|
|
132
|
+
description: string;
|
|
133
|
+
author: string;
|
|
134
|
+
operator_type: string;
|
|
135
|
+
version: number;
|
|
136
|
+
availability: CustomOperatorAvailability;
|
|
137
|
+
config: any;
|
|
138
|
+
date_created: Date;
|
|
139
|
+
date_updated: Date;
|
|
140
|
+
url: string;
|
|
141
|
+
}
|
|
142
|
+
export declare class CustomOperatorInstance {
|
|
143
|
+
protected _version: V2;
|
|
144
|
+
protected _solution: CustomOperatorContextSolution;
|
|
145
|
+
protected _context?: CustomOperatorContext;
|
|
146
|
+
constructor(_version: V2, payload: CustomOperatorResource, sid?: string);
|
|
147
|
+
/**
|
|
148
|
+
* The unique SID identifier of the Account the Custom Operator belongs to.
|
|
149
|
+
*/
|
|
150
|
+
accountSid: string;
|
|
151
|
+
/**
|
|
152
|
+
* A 34 character string that uniquely identifies this Custom Operator.
|
|
153
|
+
*/
|
|
154
|
+
sid: string;
|
|
155
|
+
/**
|
|
156
|
+
* A human-readable name of this resource, up to 64 characters.
|
|
157
|
+
*/
|
|
158
|
+
friendlyName: string;
|
|
159
|
+
/**
|
|
160
|
+
* A human-readable description of this resource, longer than the friendly name.
|
|
161
|
+
*/
|
|
162
|
+
description: string;
|
|
163
|
+
/**
|
|
164
|
+
* The creator of the Custom Operator. Custom Operators can only be created by a Twilio Account.
|
|
165
|
+
*/
|
|
166
|
+
author: string;
|
|
167
|
+
/**
|
|
168
|
+
* Operator Type for this Operator. References an existing Operator Type resource.
|
|
169
|
+
*/
|
|
170
|
+
operatorType: string;
|
|
171
|
+
/**
|
|
172
|
+
* Numeric Custom Operator version. Incremented with each update on the resource, used to ensure integrity when updating the Custom Operator.
|
|
173
|
+
*/
|
|
174
|
+
version: number;
|
|
175
|
+
availability: CustomOperatorAvailability;
|
|
176
|
+
/**
|
|
177
|
+
* Operator configuration, following the schema defined by the Operator Type. Only available on Operators created by the Account.
|
|
178
|
+
*/
|
|
179
|
+
config: any;
|
|
180
|
+
/**
|
|
181
|
+
* The date that this Custom Operator was created, given in ISO 8601 format.
|
|
182
|
+
*/
|
|
183
|
+
dateCreated: Date;
|
|
184
|
+
/**
|
|
185
|
+
* The date that this Custom Operator was updated, given in ISO 8601 format.
|
|
186
|
+
*/
|
|
187
|
+
dateUpdated: Date;
|
|
188
|
+
/**
|
|
189
|
+
* The URL of this resource.
|
|
190
|
+
*/
|
|
191
|
+
url: string;
|
|
192
|
+
private get _proxy();
|
|
193
|
+
/**
|
|
194
|
+
* Remove a CustomOperatorInstance
|
|
195
|
+
*
|
|
196
|
+
* @param callback - Callback to handle processed record
|
|
197
|
+
*
|
|
198
|
+
* @returns Resolves to processed boolean
|
|
199
|
+
*/
|
|
200
|
+
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
201
|
+
/**
|
|
202
|
+
* Fetch a CustomOperatorInstance
|
|
203
|
+
*
|
|
204
|
+
* @param callback - Callback to handle processed record
|
|
205
|
+
*
|
|
206
|
+
* @returns Resolves to processed CustomOperatorInstance
|
|
207
|
+
*/
|
|
208
|
+
fetch(callback?: (error: Error | null, item?: CustomOperatorInstance) => any): Promise<CustomOperatorInstance>;
|
|
209
|
+
/**
|
|
210
|
+
* Update a CustomOperatorInstance
|
|
211
|
+
*
|
|
212
|
+
* @param params - Parameter for request
|
|
213
|
+
* @param callback - Callback to handle processed record
|
|
214
|
+
*
|
|
215
|
+
* @returns Resolves to processed CustomOperatorInstance
|
|
216
|
+
*/
|
|
217
|
+
update(params: CustomOperatorContextUpdateOptions, callback?: (error: Error | null, item?: CustomOperatorInstance) => any): Promise<CustomOperatorInstance>;
|
|
218
|
+
/**
|
|
219
|
+
* Provide a user-friendly representation
|
|
220
|
+
*
|
|
221
|
+
* @returns Object
|
|
222
|
+
*/
|
|
223
|
+
toJSON(): {
|
|
224
|
+
accountSid: string;
|
|
225
|
+
sid: string;
|
|
226
|
+
friendlyName: string;
|
|
227
|
+
description: string;
|
|
228
|
+
author: string;
|
|
229
|
+
operatorType: string;
|
|
230
|
+
version: number;
|
|
231
|
+
availability: CustomOperatorAvailability;
|
|
232
|
+
config: any;
|
|
233
|
+
dateCreated: Date;
|
|
234
|
+
dateUpdated: Date;
|
|
235
|
+
url: string;
|
|
236
|
+
};
|
|
237
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
238
|
+
}
|
|
239
|
+
export interface CustomOperatorSolution {
|
|
240
|
+
}
|
|
241
|
+
export interface CustomOperatorListInstance {
|
|
242
|
+
_version: V2;
|
|
243
|
+
_solution: CustomOperatorSolution;
|
|
244
|
+
_uri: string;
|
|
245
|
+
(sid: string): CustomOperatorContext;
|
|
246
|
+
get(sid: string): CustomOperatorContext;
|
|
247
|
+
/**
|
|
248
|
+
* Create a CustomOperatorInstance
|
|
249
|
+
*
|
|
250
|
+
* @param params - Parameter for request
|
|
251
|
+
* @param callback - Callback to handle processed record
|
|
252
|
+
*
|
|
253
|
+
* @returns Resolves to processed CustomOperatorInstance
|
|
254
|
+
*/
|
|
255
|
+
create(params: CustomOperatorListInstanceCreateOptions, callback?: (error: Error | null, item?: CustomOperatorInstance) => any): Promise<CustomOperatorInstance>;
|
|
256
|
+
/**
|
|
257
|
+
* Streams CustomOperatorInstance records from the API.
|
|
258
|
+
*
|
|
259
|
+
* This operation lazily loads records as efficiently as possible until the limit
|
|
260
|
+
* is reached.
|
|
261
|
+
*
|
|
262
|
+
* The results are passed into the callback function, so this operation is memory
|
|
263
|
+
* efficient.
|
|
264
|
+
*
|
|
265
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
266
|
+
* function.
|
|
267
|
+
*
|
|
268
|
+
* @param { CustomOperatorListInstanceEachOptions } [params] - Options for request
|
|
269
|
+
* @param { function } [callback] - Function to process each record
|
|
270
|
+
*/
|
|
271
|
+
each(callback?: (item: CustomOperatorInstance, done: (err?: Error) => void) => void): void;
|
|
272
|
+
each(params: CustomOperatorListInstanceEachOptions, callback?: (item: CustomOperatorInstance, done: (err?: Error) => void) => void): void;
|
|
273
|
+
/**
|
|
274
|
+
* Retrieve a single target page of CustomOperatorInstance records from the API.
|
|
275
|
+
*
|
|
276
|
+
* The request is executed immediately.
|
|
277
|
+
*
|
|
278
|
+
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
|
279
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
280
|
+
*/
|
|
281
|
+
getPage(targetUrl: string, callback?: (error: Error | null, items: CustomOperatorPage) => any): Promise<CustomOperatorPage>;
|
|
282
|
+
/**
|
|
283
|
+
* Lists CustomOperatorInstance records from the API as a list.
|
|
284
|
+
*
|
|
285
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
286
|
+
* function.
|
|
287
|
+
*
|
|
288
|
+
* @param { CustomOperatorListInstanceOptions } [params] - Options for request
|
|
289
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
290
|
+
*/
|
|
291
|
+
list(callback?: (error: Error | null, items: CustomOperatorInstance[]) => any): Promise<CustomOperatorInstance[]>;
|
|
292
|
+
list(params: CustomOperatorListInstanceOptions, callback?: (error: Error | null, items: CustomOperatorInstance[]) => any): Promise<CustomOperatorInstance[]>;
|
|
293
|
+
/**
|
|
294
|
+
* Retrieve a single page of CustomOperatorInstance records from the API.
|
|
295
|
+
*
|
|
296
|
+
* The request is executed immediately.
|
|
297
|
+
*
|
|
298
|
+
* If a function is passed as the first argument, it will be used as the callback
|
|
299
|
+
* function.
|
|
300
|
+
*
|
|
301
|
+
* @param { CustomOperatorListInstancePageOptions } [params] - Options for request
|
|
302
|
+
* @param { function } [callback] - Callback to handle list of records
|
|
303
|
+
*/
|
|
304
|
+
page(callback?: (error: Error | null, items: CustomOperatorPage) => any): Promise<CustomOperatorPage>;
|
|
305
|
+
page(params: CustomOperatorListInstancePageOptions, callback?: (error: Error | null, items: CustomOperatorPage) => any): Promise<CustomOperatorPage>;
|
|
306
|
+
/**
|
|
307
|
+
* Provide a user-friendly representation
|
|
308
|
+
*/
|
|
309
|
+
toJSON(): any;
|
|
310
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
311
|
+
}
|
|
312
|
+
export declare function CustomOperatorListInstance(version: V2): CustomOperatorListInstance;
|
|
313
|
+
export declare class CustomOperatorPage extends Page<V2, CustomOperatorPayload, CustomOperatorResource, CustomOperatorInstance> {
|
|
314
|
+
/**
|
|
315
|
+
* Initialize the CustomOperatorPage
|
|
316
|
+
*
|
|
317
|
+
* @param version - Version of the resource
|
|
318
|
+
* @param response - Response from the API
|
|
319
|
+
* @param solution - Path solution
|
|
320
|
+
*/
|
|
321
|
+
constructor(version: V2, response: Response<string>, solution: CustomOperatorSolution);
|
|
322
|
+
/**
|
|
323
|
+
* Build an instance of CustomOperatorInstance
|
|
324
|
+
*
|
|
325
|
+
* @param payload - Payload response from the API
|
|
326
|
+
*/
|
|
327
|
+
getInstance(payload: CustomOperatorResource): CustomOperatorInstance;
|
|
328
|
+
[inspect.custom](depth: any, options: InspectOptions): string;
|
|
329
|
+
}
|
|
330
|
+
export {};
|