twilio 3.82.2 → 3.83.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/rest/Oauth.d.ts +32 -0
- package/lib/rest/Oauth.js +79 -0
- package/lib/rest/Supersim.d.ts +2 -0
- package/lib/rest/Supersim.js +9 -0
- package/lib/rest/Twilio.d.ts +2 -0
- package/lib/rest/Twilio.js +14 -0
- package/lib/rest/api/v2010/account/call/userDefinedMessage.d.ts +107 -0
- package/lib/rest/api/v2010/account/call/userDefinedMessage.js +259 -0
- package/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.d.ts +153 -0
- package/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.js +407 -0
- package/lib/rest/api/v2010/account/call.d.ts +14 -0
- package/lib/rest/api/v2010/account/call.js +67 -0
- package/lib/rest/api/v2010/account/conference/participant.d.ts +2 -2
- package/lib/rest/api/v2010/account/conference/participant.js +6 -4
- package/lib/rest/api/v2010/account/message.d.ts +6 -0
- package/lib/rest/api/v2010/account/message.js +10 -1
- package/lib/rest/oauth/V1.d.ts +34 -0
- package/lib/rest/oauth/V1.js +80 -0
- package/lib/rest/oauth/v1/oauth.d.ts +115 -0
- package/lib/rest/oauth/v1/oauth.js +299 -0
- package/lib/rest/oauth/v1/openidDiscovery.d.ts +137 -0
- package/lib/rest/oauth/v1/openidDiscovery.js +329 -0
- package/lib/rest/oauth/v1/token.d.ts +115 -0
- package/lib/rest/oauth/v1/token.js +265 -0
- package/lib/rest/oauth/v1/userInfo.d.ts +123 -0
- package/lib/rest/oauth/v1/userInfo.js +308 -0
- package/lib/rest/proxy/v1/service/session/participant.d.ts +0 -2
- package/lib/rest/proxy/v1/service/session/participant.js +1 -6
- package/lib/rest/proxy/v1/service/session.d.ts +0 -4
- package/lib/rest/proxy/v1/service/session.js +2 -10
- package/lib/rest/supersim/V1.d.ts +3 -0
- package/lib/rest/supersim/V1.js +12 -0
- package/lib/rest/supersim/v1/settingsUpdate.d.ts +261 -0
- package/lib/rest/supersim/v1/settingsUpdate.js +466 -0
- package/lib/rest/taskrouter/v1/workspace/task/reservation.d.ts +6 -0
- package/lib/rest/taskrouter/v1/workspace/task/reservation.js +7 -0
- package/lib/rest/taskrouter/v1/workspace/taskQueue.d.ts +6 -0
- package/lib/rest/taskrouter/v1/workspace/taskQueue.js +4 -0
- package/lib/rest/taskrouter/v1/workspace/worker.d.ts +6 -0
- package/lib/rest/taskrouter/v1/workspace/worker.js +4 -0
- package/lib/rest/verify/v2/service/accessToken.d.ts +0 -12
- package/lib/rest/verify/v2/service/accessToken.js +0 -12
- package/lib/rest/verify/v2/service/entity/challenge/notification.d.ts +0 -9
- package/lib/rest/verify/v2/service/entity/challenge/notification.js +0 -9
- package/lib/rest/verify/v2/service/entity/challenge.d.ts +0 -12
- package/lib/rest/verify/v2/service/entity/challenge.js +0 -12
- package/lib/rest/verify/v2/service/entity/factor.d.ts +0 -12
- package/lib/rest/verify/v2/service/entity/factor.js +0 -12
- package/lib/rest/verify/v2/service/entity/newFactor.d.ts +0 -9
- package/lib/rest/verify/v2/service/entity/newFactor.js +0 -9
- package/lib/rest/verify/v2/service/entity.d.ts +0 -12
- package/lib/rest/verify/v2/service/entity.js +0 -12
- package/lib/rest/verify/v2/service/verification.d.ts +1 -1
- package/lib/rest/verify/v2/service/verification.js +2 -1
- package/lib/rest/verify/v2/service/webhook.d.ts +0 -12
- package/lib/rest/verify/v2/service/webhook.js +0 -12
- package/lib/rest/verify/v2/template.d.ts +2 -0
- package/lib/rest/verify/v2/template.js +2 -0
- package/lib/twiml/VoiceResponse.d.ts +7 -1
- package/lib/twiml/VoiceResponse.js +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by
|
|
3
|
+
* \ / _ _ _| _ _
|
|
4
|
+
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
* / /
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import Page = require('../../../../../base/Page');
|
|
9
|
+
import Response = require('../../../../../http/response');
|
|
10
|
+
import V2010 = require('../../../V2010');
|
|
11
|
+
import { SerializableClass } from '../../../../../interfaces';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Initialize the UserDefinedMessageSubscriptionList
|
|
15
|
+
*
|
|
16
|
+
* @param version - Version of the resource
|
|
17
|
+
* @param accountSid - Account Sid.
|
|
18
|
+
* @param callSid - Call Sid.
|
|
19
|
+
*/
|
|
20
|
+
declare function UserDefinedMessageSubscriptionList(version: V2010, accountSid: string, callSid: string): UserDefinedMessageSubscriptionListInstance;
|
|
21
|
+
|
|
22
|
+
interface UserDefinedMessageSubscriptionListInstance {
|
|
23
|
+
/**
|
|
24
|
+
* @param sid - sid of instance
|
|
25
|
+
*/
|
|
26
|
+
(sid: string): UserDefinedMessageSubscriptionContext;
|
|
27
|
+
/**
|
|
28
|
+
* create a UserDefinedMessageSubscriptionInstance
|
|
29
|
+
*
|
|
30
|
+
* @param opts - Options for request
|
|
31
|
+
* @param callback - Callback to handle processed record
|
|
32
|
+
*/
|
|
33
|
+
create(opts: UserDefinedMessageSubscriptionListInstanceCreateOptions, callback?: (error: Error | null, item: UserDefinedMessageSubscriptionInstance) => any): Promise<UserDefinedMessageSubscriptionInstance>;
|
|
34
|
+
/**
|
|
35
|
+
* Constructs a user_defined_message_subscription
|
|
36
|
+
*
|
|
37
|
+
* @param sid - User Defined Message Subscription Sid
|
|
38
|
+
*/
|
|
39
|
+
get(sid: string): UserDefinedMessageSubscriptionContext;
|
|
40
|
+
/**
|
|
41
|
+
* Provide a user-friendly representation
|
|
42
|
+
*/
|
|
43
|
+
toJSON(): any;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Options to pass to create
|
|
48
|
+
*
|
|
49
|
+
* @property callback - The URL we should call to send user defined messages.
|
|
50
|
+
* @property idempotencyKey - A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated.
|
|
51
|
+
* @property method - HTTP method used with the callback.
|
|
52
|
+
*/
|
|
53
|
+
interface UserDefinedMessageSubscriptionListInstanceCreateOptions {
|
|
54
|
+
callback: string;
|
|
55
|
+
idempotencyKey?: string;
|
|
56
|
+
method: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface UserDefinedMessageSubscriptionPayload extends UserDefinedMessageSubscriptionResource, Page.TwilioResponsePayload {
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface UserDefinedMessageSubscriptionResource {
|
|
63
|
+
account_sid: string;
|
|
64
|
+
call_sid: string;
|
|
65
|
+
date_created: Date;
|
|
66
|
+
sid: string;
|
|
67
|
+
uri: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
interface UserDefinedMessageSubscriptionSolution {
|
|
71
|
+
accountSid?: string;
|
|
72
|
+
callSid?: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
declare class UserDefinedMessageSubscriptionContext {
|
|
77
|
+
/**
|
|
78
|
+
* Initialize the UserDefinedMessageSubscriptionContext
|
|
79
|
+
*
|
|
80
|
+
* @param version - Version of the resource
|
|
81
|
+
* @param accountSid - Account Sid.
|
|
82
|
+
* @param callSid - Call Sid.
|
|
83
|
+
* @param sid - User Defined Message Subscription Sid
|
|
84
|
+
*/
|
|
85
|
+
constructor(version: V2010, accountSid: string, callSid: string, sid: string);
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* remove a UserDefinedMessageSubscriptionInstance
|
|
89
|
+
*
|
|
90
|
+
* @param callback - Callback to handle processed record
|
|
91
|
+
*/
|
|
92
|
+
remove(callback?: (error: Error | null, items: UserDefinedMessageSubscriptionInstance) => any): Promise<boolean>;
|
|
93
|
+
/**
|
|
94
|
+
* Provide a user-friendly representation
|
|
95
|
+
*/
|
|
96
|
+
toJSON(): any;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
declare class UserDefinedMessageSubscriptionInstance extends SerializableClass {
|
|
101
|
+
/**
|
|
102
|
+
* Initialize the UserDefinedMessageSubscriptionContext
|
|
103
|
+
*
|
|
104
|
+
* @param version - Version of the resource
|
|
105
|
+
* @param payload - The instance payload
|
|
106
|
+
* @param accountSid - Account Sid.
|
|
107
|
+
* @param callSid - Call Sid.
|
|
108
|
+
* @param sid - User Defined Message Subscription Sid
|
|
109
|
+
*/
|
|
110
|
+
constructor(version: V2010, payload: UserDefinedMessageSubscriptionPayload, accountSid: string, callSid: string, sid: string);
|
|
111
|
+
|
|
112
|
+
private _proxy: UserDefinedMessageSubscriptionContext;
|
|
113
|
+
accountSid: string;
|
|
114
|
+
callSid: string;
|
|
115
|
+
dateCreated: Date;
|
|
116
|
+
/**
|
|
117
|
+
* remove a UserDefinedMessageSubscriptionInstance
|
|
118
|
+
*
|
|
119
|
+
* @param callback - Callback to handle processed record
|
|
120
|
+
*/
|
|
121
|
+
remove(callback?: (error: Error | null, items: UserDefinedMessageSubscriptionInstance) => any): Promise<boolean>;
|
|
122
|
+
sid: string;
|
|
123
|
+
/**
|
|
124
|
+
* Provide a user-friendly representation
|
|
125
|
+
*/
|
|
126
|
+
toJSON(): any;
|
|
127
|
+
uri: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
declare class UserDefinedMessageSubscriptionPage extends Page<V2010, UserDefinedMessageSubscriptionPayload, UserDefinedMessageSubscriptionResource, UserDefinedMessageSubscriptionInstance> {
|
|
132
|
+
/**
|
|
133
|
+
* Initialize the UserDefinedMessageSubscriptionPage
|
|
134
|
+
*
|
|
135
|
+
* @param version - Version of the resource
|
|
136
|
+
* @param response - Response from the API
|
|
137
|
+
* @param solution - Path solution
|
|
138
|
+
*/
|
|
139
|
+
constructor(version: V2010, response: Response<string>, solution: UserDefinedMessageSubscriptionSolution);
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Build an instance of UserDefinedMessageSubscriptionInstance
|
|
143
|
+
*
|
|
144
|
+
* @param payload - Payload response from the API
|
|
145
|
+
*/
|
|
146
|
+
getInstance(payload: UserDefinedMessageSubscriptionPayload): UserDefinedMessageSubscriptionInstance;
|
|
147
|
+
/**
|
|
148
|
+
* Provide a user-friendly representation
|
|
149
|
+
*/
|
|
150
|
+
toJSON(): any;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export { UserDefinedMessageSubscriptionContext, UserDefinedMessageSubscriptionInstance, UserDefinedMessageSubscriptionList, UserDefinedMessageSubscriptionListInstance, UserDefinedMessageSubscriptionListInstanceCreateOptions, UserDefinedMessageSubscriptionPage, UserDefinedMessageSubscriptionPayload, UserDefinedMessageSubscriptionResource, UserDefinedMessageSubscriptionSolution }
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* jshint ignore:start */
|
|
4
|
+
/**
|
|
5
|
+
* This code was generated by
|
|
6
|
+
* \ / _ _ _| _ _
|
|
7
|
+
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
8
|
+
* / /
|
|
9
|
+
*/
|
|
10
|
+
/* jshint ignore:end */
|
|
11
|
+
|
|
12
|
+
var Q = require('q'); /* jshint ignore:line */
|
|
13
|
+
var _ = require('lodash'); /* jshint ignore:line */
|
|
14
|
+
var util = require('util'); /* jshint ignore:line */
|
|
15
|
+
var Page = require('../../../../../base/Page'); /* jshint ignore:line */
|
|
16
|
+
var deserialize = require(
|
|
17
|
+
'../../../../../base/deserialize'); /* jshint ignore:line */
|
|
18
|
+
var values = require('../../../../../base/values'); /* jshint ignore:line */
|
|
19
|
+
|
|
20
|
+
var UserDefinedMessageSubscriptionList;
|
|
21
|
+
var UserDefinedMessageSubscriptionPage;
|
|
22
|
+
var UserDefinedMessageSubscriptionInstance;
|
|
23
|
+
var UserDefinedMessageSubscriptionContext;
|
|
24
|
+
|
|
25
|
+
/* jshint ignore:start */
|
|
26
|
+
/**
|
|
27
|
+
* Initialize the UserDefinedMessageSubscriptionList
|
|
28
|
+
*
|
|
29
|
+
* @constructor Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionList
|
|
30
|
+
*
|
|
31
|
+
* @param {Twilio.Api.V2010} version - Version of the resource
|
|
32
|
+
* @param {string} accountSid - Account Sid.
|
|
33
|
+
* @param {string} callSid - Call Sid.
|
|
34
|
+
*/
|
|
35
|
+
/* jshint ignore:end */
|
|
36
|
+
UserDefinedMessageSubscriptionList = function
|
|
37
|
+
UserDefinedMessageSubscriptionList(version, accountSid, callSid) {
|
|
38
|
+
/* jshint ignore:start */
|
|
39
|
+
/**
|
|
40
|
+
* @function userDefinedMessageSubscriptions
|
|
41
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext#
|
|
42
|
+
*
|
|
43
|
+
* @param {string} sid - sid of instance
|
|
44
|
+
*
|
|
45
|
+
* @returns {Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionContext}
|
|
46
|
+
*/
|
|
47
|
+
/* jshint ignore:end */
|
|
48
|
+
function UserDefinedMessageSubscriptionListInstance(sid) {
|
|
49
|
+
return UserDefinedMessageSubscriptionListInstance.get(sid);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
UserDefinedMessageSubscriptionListInstance._version = version;
|
|
53
|
+
// Path Solution
|
|
54
|
+
UserDefinedMessageSubscriptionListInstance._solution = {accountSid: accountSid, callSid: callSid};
|
|
55
|
+
UserDefinedMessageSubscriptionListInstance._uri = `/Accounts/${accountSid}/Calls/${callSid}/UserDefinedMessageSubscriptions.json`;
|
|
56
|
+
/* jshint ignore:start */
|
|
57
|
+
/**
|
|
58
|
+
* create a UserDefinedMessageSubscriptionInstance
|
|
59
|
+
*
|
|
60
|
+
* @function create
|
|
61
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionList#
|
|
62
|
+
*
|
|
63
|
+
* @param {object} opts - Options for request
|
|
64
|
+
* @param {string} opts.callback -
|
|
65
|
+
* The URL we should call to send user defined messages.
|
|
66
|
+
* @param {string} opts.method - HTTP method used with the callback.
|
|
67
|
+
* @param {string} [opts.idempotencyKey] -
|
|
68
|
+
* A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated.
|
|
69
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
70
|
+
*
|
|
71
|
+
* @returns {Promise} Resolves to processed UserDefinedMessageSubscriptionInstance
|
|
72
|
+
*/
|
|
73
|
+
/* jshint ignore:end */
|
|
74
|
+
UserDefinedMessageSubscriptionListInstance.create = function create(opts,
|
|
75
|
+
callback) {
|
|
76
|
+
if (_.isUndefined(opts)) {
|
|
77
|
+
throw new Error('Required parameter "opts" missing.');
|
|
78
|
+
}
|
|
79
|
+
if (_.isUndefined(opts['callback'])) {
|
|
80
|
+
throw new Error('Required parameter "opts[\'callback\']" missing.');
|
|
81
|
+
}
|
|
82
|
+
if (_.isUndefined(opts['method'])) {
|
|
83
|
+
throw new Error('Required parameter "opts[\'method\']" missing.');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
var deferred = Q.defer();
|
|
87
|
+
var data = values.of({
|
|
88
|
+
'Callback': _.get(opts, 'callback'),
|
|
89
|
+
'Method': _.get(opts, 'method'),
|
|
90
|
+
'IdempotencyKey': _.get(opts, 'idempotencyKey')
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
|
|
94
|
+
|
|
95
|
+
promise = promise.then(function(payload) {
|
|
96
|
+
deferred.resolve(new UserDefinedMessageSubscriptionInstance(
|
|
97
|
+
this._version,
|
|
98
|
+
payload,
|
|
99
|
+
this._solution.accountSid,
|
|
100
|
+
this._solution.callSid,
|
|
101
|
+
this._solution.sid
|
|
102
|
+
));
|
|
103
|
+
}.bind(this));
|
|
104
|
+
|
|
105
|
+
promise.catch(function(error) {
|
|
106
|
+
deferred.reject(error);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
if (_.isFunction(callback)) {
|
|
110
|
+
deferred.promise.nodeify(callback);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return deferred.promise;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/* jshint ignore:start */
|
|
117
|
+
/**
|
|
118
|
+
* Constructs a user_defined_message_subscription
|
|
119
|
+
*
|
|
120
|
+
* @function get
|
|
121
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionList#
|
|
122
|
+
*
|
|
123
|
+
* @param {string} sid - User Defined Message Subscription Sid
|
|
124
|
+
*
|
|
125
|
+
* @returns {Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionContext}
|
|
126
|
+
*/
|
|
127
|
+
/* jshint ignore:end */
|
|
128
|
+
UserDefinedMessageSubscriptionListInstance.get = function get(sid) {
|
|
129
|
+
return new UserDefinedMessageSubscriptionContext(
|
|
130
|
+
this._version,
|
|
131
|
+
this._solution.accountSid,
|
|
132
|
+
this._solution.callSid,
|
|
133
|
+
sid
|
|
134
|
+
);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
/* jshint ignore:start */
|
|
138
|
+
/**
|
|
139
|
+
* Provide a user-friendly representation
|
|
140
|
+
*
|
|
141
|
+
* @function toJSON
|
|
142
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionList#
|
|
143
|
+
*
|
|
144
|
+
* @returns Object
|
|
145
|
+
*/
|
|
146
|
+
/* jshint ignore:end */
|
|
147
|
+
UserDefinedMessageSubscriptionListInstance.toJSON = function toJSON() {
|
|
148
|
+
return this._solution;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
UserDefinedMessageSubscriptionListInstance[util.inspect.custom] = function
|
|
152
|
+
inspect(depth, options) {
|
|
153
|
+
return util.inspect(this.toJSON(), options);
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
return UserDefinedMessageSubscriptionListInstance;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
/* jshint ignore:start */
|
|
161
|
+
/**
|
|
162
|
+
* Initialize the UserDefinedMessageSubscriptionPage
|
|
163
|
+
*
|
|
164
|
+
* @constructor Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionPage
|
|
165
|
+
*
|
|
166
|
+
* @param {V2010} version - Version of the resource
|
|
167
|
+
* @param {Response<string>} response - Response from the API
|
|
168
|
+
* @param {UserDefinedMessageSubscriptionSolution} solution - Path solution
|
|
169
|
+
*
|
|
170
|
+
* @returns UserDefinedMessageSubscriptionPage
|
|
171
|
+
*/
|
|
172
|
+
/* jshint ignore:end */
|
|
173
|
+
UserDefinedMessageSubscriptionPage = function
|
|
174
|
+
UserDefinedMessageSubscriptionPage(version, response, solution) {
|
|
175
|
+
// Path Solution
|
|
176
|
+
this._solution = solution;
|
|
177
|
+
|
|
178
|
+
Page.prototype.constructor.call(this, version, response, this._solution);
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
_.extend(UserDefinedMessageSubscriptionPage.prototype, Page.prototype);
|
|
182
|
+
UserDefinedMessageSubscriptionPage.prototype.constructor = UserDefinedMessageSubscriptionPage;
|
|
183
|
+
|
|
184
|
+
/* jshint ignore:start */
|
|
185
|
+
/**
|
|
186
|
+
* Build an instance of UserDefinedMessageSubscriptionInstance
|
|
187
|
+
*
|
|
188
|
+
* @function getInstance
|
|
189
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionPage#
|
|
190
|
+
*
|
|
191
|
+
* @param {UserDefinedMessageSubscriptionPayload} payload -
|
|
192
|
+
* Payload response from the API
|
|
193
|
+
*
|
|
194
|
+
* @returns UserDefinedMessageSubscriptionInstance
|
|
195
|
+
*/
|
|
196
|
+
/* jshint ignore:end */
|
|
197
|
+
UserDefinedMessageSubscriptionPage.prototype.getInstance = function
|
|
198
|
+
getInstance(payload) {
|
|
199
|
+
return new UserDefinedMessageSubscriptionInstance(
|
|
200
|
+
this._version,
|
|
201
|
+
payload,
|
|
202
|
+
this._solution.accountSid,
|
|
203
|
+
this._solution.callSid
|
|
204
|
+
);
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
/* jshint ignore:start */
|
|
208
|
+
/**
|
|
209
|
+
* Provide a user-friendly representation
|
|
210
|
+
*
|
|
211
|
+
* @function toJSON
|
|
212
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionPage#
|
|
213
|
+
*
|
|
214
|
+
* @returns Object
|
|
215
|
+
*/
|
|
216
|
+
/* jshint ignore:end */
|
|
217
|
+
UserDefinedMessageSubscriptionPage.prototype.toJSON = function toJSON() {
|
|
218
|
+
let clone = {};
|
|
219
|
+
_.forOwn(this, function(value, key) {
|
|
220
|
+
if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
|
|
221
|
+
clone[key] = value;
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
return clone;
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
UserDefinedMessageSubscriptionPage.prototype[util.inspect.custom] = function
|
|
228
|
+
inspect(depth, options) {
|
|
229
|
+
return util.inspect(this.toJSON(), options);
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
/* jshint ignore:start */
|
|
234
|
+
/**
|
|
235
|
+
* Initialize the UserDefinedMessageSubscriptionContext
|
|
236
|
+
*
|
|
237
|
+
* @constructor Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionInstance
|
|
238
|
+
*
|
|
239
|
+
* @property {string} accountSid - Account Sid.
|
|
240
|
+
* @property {string} callSid - Call Sid.
|
|
241
|
+
* @property {string} sid - User Defined Message Subscription Sid
|
|
242
|
+
* @property {Date} dateCreated -
|
|
243
|
+
* The date this User Defined Message Subscription was created
|
|
244
|
+
* @property {string} uri -
|
|
245
|
+
* The URI of the resource, relative to `https://api.twilio.com`.
|
|
246
|
+
*
|
|
247
|
+
* @param {V2010} version - Version of the resource
|
|
248
|
+
* @param {UserDefinedMessageSubscriptionPayload} payload - The instance payload
|
|
249
|
+
* @param {sid} accountSid - Account Sid.
|
|
250
|
+
* @param {sid} callSid - Call Sid.
|
|
251
|
+
* @param {sid} sid - User Defined Message Subscription Sid
|
|
252
|
+
*/
|
|
253
|
+
/* jshint ignore:end */
|
|
254
|
+
UserDefinedMessageSubscriptionInstance = function
|
|
255
|
+
UserDefinedMessageSubscriptionInstance(version, payload, accountSid,
|
|
256
|
+
callSid, sid) {
|
|
257
|
+
this._version = version;
|
|
258
|
+
|
|
259
|
+
// Marshaled Properties
|
|
260
|
+
this.accountSid = payload.account_sid; // jshint ignore:line
|
|
261
|
+
this.callSid = payload.call_sid; // jshint ignore:line
|
|
262
|
+
this.sid = payload.sid; // jshint ignore:line
|
|
263
|
+
this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); // jshint ignore:line
|
|
264
|
+
this.uri = payload.uri; // jshint ignore:line
|
|
265
|
+
|
|
266
|
+
// Context
|
|
267
|
+
this._context = undefined;
|
|
268
|
+
this._solution = {accountSid: accountSid, callSid: callSid, sid: sid || this.sid, };
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
Object.defineProperty(UserDefinedMessageSubscriptionInstance.prototype,
|
|
272
|
+
'_proxy', {
|
|
273
|
+
get: function() {
|
|
274
|
+
if (!this._context) {
|
|
275
|
+
this._context = new UserDefinedMessageSubscriptionContext(
|
|
276
|
+
this._version,
|
|
277
|
+
this._solution.accountSid,
|
|
278
|
+
this._solution.callSid,
|
|
279
|
+
this._solution.sid
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
return this._context;
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
/* jshint ignore:start */
|
|
288
|
+
/**
|
|
289
|
+
* remove a UserDefinedMessageSubscriptionInstance
|
|
290
|
+
*
|
|
291
|
+
* @function remove
|
|
292
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionInstance#
|
|
293
|
+
*
|
|
294
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
295
|
+
*
|
|
296
|
+
* @returns {Promise} Resolves to processed UserDefinedMessageSubscriptionInstance
|
|
297
|
+
*/
|
|
298
|
+
/* jshint ignore:end */
|
|
299
|
+
UserDefinedMessageSubscriptionInstance.prototype.remove = function
|
|
300
|
+
remove(callback) {
|
|
301
|
+
return this._proxy.remove(callback);
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
/* jshint ignore:start */
|
|
305
|
+
/**
|
|
306
|
+
* Provide a user-friendly representation
|
|
307
|
+
*
|
|
308
|
+
* @function toJSON
|
|
309
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionInstance#
|
|
310
|
+
*
|
|
311
|
+
* @returns Object
|
|
312
|
+
*/
|
|
313
|
+
/* jshint ignore:end */
|
|
314
|
+
UserDefinedMessageSubscriptionInstance.prototype.toJSON = function toJSON() {
|
|
315
|
+
let clone = {};
|
|
316
|
+
_.forOwn(this, function(value, key) {
|
|
317
|
+
if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
|
|
318
|
+
clone[key] = value;
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
return clone;
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
UserDefinedMessageSubscriptionInstance.prototype[util.inspect.custom] = function
|
|
325
|
+
inspect(depth, options) {
|
|
326
|
+
return util.inspect(this.toJSON(), options);
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
/* jshint ignore:start */
|
|
331
|
+
/**
|
|
332
|
+
* Initialize the UserDefinedMessageSubscriptionContext
|
|
333
|
+
*
|
|
334
|
+
* @constructor Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionContext
|
|
335
|
+
*
|
|
336
|
+
* @param {V2010} version - Version of the resource
|
|
337
|
+
* @param {sid} accountSid - Account Sid.
|
|
338
|
+
* @param {sid} callSid - Call Sid.
|
|
339
|
+
* @param {sid} sid - User Defined Message Subscription Sid
|
|
340
|
+
*/
|
|
341
|
+
/* jshint ignore:end */
|
|
342
|
+
UserDefinedMessageSubscriptionContext = function
|
|
343
|
+
UserDefinedMessageSubscriptionContext(version, accountSid, callSid, sid) {
|
|
344
|
+
this._version = version;
|
|
345
|
+
|
|
346
|
+
// Path Solution
|
|
347
|
+
this._solution = {accountSid: accountSid, callSid: callSid, sid: sid, };
|
|
348
|
+
this._uri = `/Accounts/${accountSid}/Calls/${callSid}/UserDefinedMessageSubscriptions/${sid}.json`;
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
/* jshint ignore:start */
|
|
352
|
+
/**
|
|
353
|
+
* remove a UserDefinedMessageSubscriptionInstance
|
|
354
|
+
*
|
|
355
|
+
* @function remove
|
|
356
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionContext#
|
|
357
|
+
*
|
|
358
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
359
|
+
*
|
|
360
|
+
* @returns {Promise} Resolves to processed UserDefinedMessageSubscriptionInstance
|
|
361
|
+
*/
|
|
362
|
+
/* jshint ignore:end */
|
|
363
|
+
UserDefinedMessageSubscriptionContext.prototype.remove = function
|
|
364
|
+
remove(callback) {
|
|
365
|
+
var deferred = Q.defer();
|
|
366
|
+
var promise = this._version.remove({uri: this._uri, method: 'DELETE'});
|
|
367
|
+
|
|
368
|
+
promise = promise.then(function(payload) {
|
|
369
|
+
deferred.resolve(payload);
|
|
370
|
+
}.bind(this));
|
|
371
|
+
|
|
372
|
+
promise.catch(function(error) {
|
|
373
|
+
deferred.reject(error);
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
if (_.isFunction(callback)) {
|
|
377
|
+
deferred.promise.nodeify(callback);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
return deferred.promise;
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
/* jshint ignore:start */
|
|
384
|
+
/**
|
|
385
|
+
* Provide a user-friendly representation
|
|
386
|
+
*
|
|
387
|
+
* @function toJSON
|
|
388
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionContext#
|
|
389
|
+
*
|
|
390
|
+
* @returns Object
|
|
391
|
+
*/
|
|
392
|
+
/* jshint ignore:end */
|
|
393
|
+
UserDefinedMessageSubscriptionContext.prototype.toJSON = function toJSON() {
|
|
394
|
+
return this._solution;
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
UserDefinedMessageSubscriptionContext.prototype[util.inspect.custom] = function
|
|
398
|
+
inspect(depth, options) {
|
|
399
|
+
return util.inspect(this.toJSON(), options);
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
module.exports = {
|
|
403
|
+
UserDefinedMessageSubscriptionList: UserDefinedMessageSubscriptionList,
|
|
404
|
+
UserDefinedMessageSubscriptionPage: UserDefinedMessageSubscriptionPage,
|
|
405
|
+
UserDefinedMessageSubscriptionInstance: UserDefinedMessageSubscriptionInstance,
|
|
406
|
+
UserDefinedMessageSubscriptionContext: UserDefinedMessageSubscriptionContext
|
|
407
|
+
};
|
|
@@ -24,6 +24,10 @@ import { SiprecList } from './call/siprec';
|
|
|
24
24
|
import { SiprecListInstance } from './call/siprec';
|
|
25
25
|
import { StreamList } from './call/stream';
|
|
26
26
|
import { StreamListInstance } from './call/stream';
|
|
27
|
+
import { UserDefinedMessageList } from './call/userDefinedMessage';
|
|
28
|
+
import { UserDefinedMessageListInstance } from './call/userDefinedMessage';
|
|
29
|
+
import { UserDefinedMessageSubscriptionList } from './call/userDefinedMessageSubscription';
|
|
30
|
+
import { UserDefinedMessageSubscriptionListInstance } from './call/userDefinedMessageSubscription';
|
|
27
31
|
|
|
28
32
|
type CallEvent = 'initiated'|'ringing'|'answered'|'completed';
|
|
29
33
|
|
|
@@ -462,6 +466,8 @@ declare class CallContext {
|
|
|
462
466
|
* @param callback - Callback to handle processed record
|
|
463
467
|
*/
|
|
464
468
|
update(opts?: CallInstanceUpdateOptions, callback?: (error: Error | null, items: CallInstance) => any): Promise<CallInstance>;
|
|
469
|
+
userDefinedMessageSubscriptions: UserDefinedMessageSubscriptionListInstance;
|
|
470
|
+
userDefinedMessages: UserDefinedMessageListInstance;
|
|
465
471
|
}
|
|
466
472
|
|
|
467
473
|
|
|
@@ -560,6 +566,14 @@ declare class CallInstance extends SerializableClass {
|
|
|
560
566
|
*/
|
|
561
567
|
update(opts?: CallInstanceUpdateOptions, callback?: (error: Error | null, items: CallInstance) => any): Promise<CallInstance>;
|
|
562
568
|
uri: string;
|
|
569
|
+
/**
|
|
570
|
+
* Access the userDefinedMessageSubscriptions
|
|
571
|
+
*/
|
|
572
|
+
userDefinedMessageSubscriptions(): UserDefinedMessageSubscriptionListInstance;
|
|
573
|
+
/**
|
|
574
|
+
* Access the userDefinedMessages
|
|
575
|
+
*/
|
|
576
|
+
userDefinedMessages(): UserDefinedMessageListInstance;
|
|
563
577
|
}
|
|
564
578
|
|
|
565
579
|
|
|
@@ -21,6 +21,10 @@ var PaymentList = require('./call/payment').PaymentList;
|
|
|
21
21
|
var RecordingList = require('./call/recording').RecordingList;
|
|
22
22
|
var SiprecList = require('./call/siprec').SiprecList;
|
|
23
23
|
var StreamList = require('./call/stream').StreamList;
|
|
24
|
+
var UserDefinedMessageList = require(
|
|
25
|
+
'./call/userDefinedMessage').UserDefinedMessageList;
|
|
26
|
+
var UserDefinedMessageSubscriptionList = require(
|
|
27
|
+
'./call/userDefinedMessageSubscription').UserDefinedMessageSubscriptionList;
|
|
24
28
|
var deserialize = require(
|
|
25
29
|
'../../../../base/deserialize'); /* jshint ignore:line */
|
|
26
30
|
var serialize = require('../../../../base/serialize'); /* jshint ignore:line */
|
|
@@ -881,6 +885,35 @@ CallInstance.prototype.streams = function streams() {
|
|
|
881
885
|
return this._proxy.streams;
|
|
882
886
|
};
|
|
883
887
|
|
|
888
|
+
/* jshint ignore:start */
|
|
889
|
+
/**
|
|
890
|
+
* Access the userDefinedMessageSubscriptions
|
|
891
|
+
*
|
|
892
|
+
* @function userDefinedMessageSubscriptions
|
|
893
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallInstance#
|
|
894
|
+
*
|
|
895
|
+
* @returns {Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionList}
|
|
896
|
+
*/
|
|
897
|
+
/* jshint ignore:end */
|
|
898
|
+
CallInstance.prototype.userDefinedMessageSubscriptions = function
|
|
899
|
+
userDefinedMessageSubscriptions() {
|
|
900
|
+
return this._proxy.userDefinedMessageSubscriptions;
|
|
901
|
+
};
|
|
902
|
+
|
|
903
|
+
/* jshint ignore:start */
|
|
904
|
+
/**
|
|
905
|
+
* Access the userDefinedMessages
|
|
906
|
+
*
|
|
907
|
+
* @function userDefinedMessages
|
|
908
|
+
* @memberof Twilio.Api.V2010.AccountContext.CallInstance#
|
|
909
|
+
*
|
|
910
|
+
* @returns {Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageList}
|
|
911
|
+
*/
|
|
912
|
+
/* jshint ignore:end */
|
|
913
|
+
CallInstance.prototype.userDefinedMessages = function userDefinedMessages() {
|
|
914
|
+
return this._proxy.userDefinedMessages;
|
|
915
|
+
};
|
|
916
|
+
|
|
884
917
|
/* jshint ignore:start */
|
|
885
918
|
/**
|
|
886
919
|
* Provide a user-friendly representation
|
|
@@ -926,6 +959,10 @@ CallInstance.prototype[util.inspect.custom] = function inspect(depth, options) {
|
|
|
926
959
|
* siprec resource
|
|
927
960
|
* @property {Twilio.Api.V2010.AccountContext.CallContext.StreamList} streams -
|
|
928
961
|
* streams resource
|
|
962
|
+
* @property {Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageSubscriptionList} userDefinedMessageSubscriptions -
|
|
963
|
+
* userDefinedMessageSubscriptions resource
|
|
964
|
+
* @property {Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageList} userDefinedMessages -
|
|
965
|
+
* userDefinedMessages resource
|
|
929
966
|
*
|
|
930
967
|
* @param {V2010} version - Version of the resource
|
|
931
968
|
* @param {sid} accountSid -
|
|
@@ -948,6 +985,8 @@ CallContext = function CallContext(version, accountSid, sid) {
|
|
|
948
985
|
this._payments = undefined;
|
|
949
986
|
this._siprec = undefined;
|
|
950
987
|
this._streams = undefined;
|
|
988
|
+
this._userDefinedMessageSubscriptions = undefined;
|
|
989
|
+
this._userDefinedMessages = undefined;
|
|
951
990
|
};
|
|
952
991
|
|
|
953
992
|
/* jshint ignore:start */
|
|
@@ -1158,6 +1197,34 @@ Object.defineProperty(CallContext.prototype,
|
|
|
1158
1197
|
}
|
|
1159
1198
|
});
|
|
1160
1199
|
|
|
1200
|
+
Object.defineProperty(CallContext.prototype,
|
|
1201
|
+
'userDefinedMessageSubscriptions', {
|
|
1202
|
+
get: function() {
|
|
1203
|
+
if (!this._userDefinedMessageSubscriptions) {
|
|
1204
|
+
this._userDefinedMessageSubscriptions = new UserDefinedMessageSubscriptionList(
|
|
1205
|
+
this._version,
|
|
1206
|
+
this._solution.accountSid,
|
|
1207
|
+
this._solution.sid
|
|
1208
|
+
);
|
|
1209
|
+
}
|
|
1210
|
+
return this._userDefinedMessageSubscriptions;
|
|
1211
|
+
}
|
|
1212
|
+
});
|
|
1213
|
+
|
|
1214
|
+
Object.defineProperty(CallContext.prototype,
|
|
1215
|
+
'userDefinedMessages', {
|
|
1216
|
+
get: function() {
|
|
1217
|
+
if (!this._userDefinedMessages) {
|
|
1218
|
+
this._userDefinedMessages = new UserDefinedMessageList(
|
|
1219
|
+
this._version,
|
|
1220
|
+
this._solution.accountSid,
|
|
1221
|
+
this._solution.sid
|
|
1222
|
+
);
|
|
1223
|
+
}
|
|
1224
|
+
return this._userDefinedMessages;
|
|
1225
|
+
}
|
|
1226
|
+
});
|
|
1227
|
+
|
|
1161
1228
|
/* jshint ignore:start */
|
|
1162
1229
|
/**
|
|
1163
1230
|
* Provide a user-friendly representation
|