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
|
@@ -32,10 +32,10 @@ declare function ParticipantList(version: V2010, accountSid: string, conferenceS
|
|
|
32
32
|
* @property endConferenceOnExit - Whether to end the conference when the participant leaves
|
|
33
33
|
* @property hold - Whether the participant should be on hold
|
|
34
34
|
* @property holdMethod - The HTTP method we should use to call hold_url
|
|
35
|
-
* @property holdUrl - The URL we call using the `hold_method` for
|
|
35
|
+
* @property holdUrl - The URL we call using the `hold_method` for music that plays when the participant is on hold
|
|
36
36
|
* @property muted - Whether the participant should be muted
|
|
37
37
|
* @property waitMethod - The HTTP method we should use to call `wait_url`
|
|
38
|
-
* @property waitUrl - URL
|
|
38
|
+
* @property waitUrl - The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start
|
|
39
39
|
*/
|
|
40
40
|
interface ParticipantInstanceUpdateOptions {
|
|
41
41
|
announceMethod?: string;
|
|
@@ -723,14 +723,15 @@ ParticipantInstance.prototype.fetch = function fetch(callback) {
|
|
|
723
723
|
* @param {boolean} [opts.muted] - Whether the participant should be muted
|
|
724
724
|
* @param {boolean} [opts.hold] - Whether the participant should be on hold
|
|
725
725
|
* @param {string} [opts.holdUrl] -
|
|
726
|
-
* The URL we call using the `hold_method` for
|
|
726
|
+
* The URL we call using the `hold_method` for music that plays when the participant is on hold
|
|
727
727
|
* @param {string} [opts.holdMethod] -
|
|
728
728
|
* The HTTP method we should use to call hold_url
|
|
729
729
|
* @param {string} [opts.announceUrl] -
|
|
730
730
|
* The URL we call using the `announce_method` for an announcement to the participant
|
|
731
731
|
* @param {string} [opts.announceMethod] -
|
|
732
732
|
* The HTTP method we should use to call announce_url
|
|
733
|
-
* @param {string} [opts.waitUrl] -
|
|
733
|
+
* @param {string} [opts.waitUrl] -
|
|
734
|
+
* The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start
|
|
734
735
|
* @param {string} [opts.waitMethod] -
|
|
735
736
|
* The HTTP method we should use to call `wait_url`
|
|
736
737
|
* @param {boolean} [opts.beepOnExit] -
|
|
@@ -863,14 +864,15 @@ ParticipantContext.prototype.fetch = function fetch(callback) {
|
|
|
863
864
|
* @param {boolean} [opts.muted] - Whether the participant should be muted
|
|
864
865
|
* @param {boolean} [opts.hold] - Whether the participant should be on hold
|
|
865
866
|
* @param {string} [opts.holdUrl] -
|
|
866
|
-
* The URL we call using the `hold_method` for
|
|
867
|
+
* The URL we call using the `hold_method` for music that plays when the participant is on hold
|
|
867
868
|
* @param {string} [opts.holdMethod] -
|
|
868
869
|
* The HTTP method we should use to call hold_url
|
|
869
870
|
* @param {string} [opts.announceUrl] -
|
|
870
871
|
* The URL we call using the `announce_method` for an announcement to the participant
|
|
871
872
|
* @param {string} [opts.announceMethod] -
|
|
872
873
|
* The HTTP method we should use to call announce_url
|
|
873
|
-
* @param {string} [opts.waitUrl] -
|
|
874
|
+
* @param {string} [opts.waitUrl] -
|
|
875
|
+
* The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start
|
|
874
876
|
* @param {string} [opts.waitMethod] -
|
|
875
877
|
* The HTTP method we should use to call `wait_url`
|
|
876
878
|
* @param {boolean} [opts.beepOnExit] -
|
|
@@ -175,6 +175,8 @@ interface MessageListInstance {
|
|
|
175
175
|
* @property attempt - Total numer of attempts made , this inclusive to send out the message
|
|
176
176
|
* @property body - The text of the message you want to send. Can be up to 1,600 characters in length.
|
|
177
177
|
* @property contentRetention - Determines if the message content can be stored or redacted based on privacy settings
|
|
178
|
+
* @property contentSid - The SID of the preconfigured Content object you want to associate with the message.
|
|
179
|
+
* @property contentVariables - Key-value pairs of variable names to substitution values, used alongside a content_sid.
|
|
178
180
|
* @property forceDelivery - Reserved
|
|
179
181
|
* @property from - The phone number that initiated the message
|
|
180
182
|
* @property maxPrice - The total maximum price up to 4 decimal places in US dollars acceptable for the message to be delivered.
|
|
@@ -185,6 +187,7 @@ interface MessageListInstance {
|
|
|
185
187
|
* @property scheduleType - Pass the value `fixed` to schedule a message at a fixed time.
|
|
186
188
|
* @property sendAsMms - If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.
|
|
187
189
|
* @property sendAt - The time that Twilio will send the message. Must be in ISO 8601 format.
|
|
190
|
+
* @property shortenUrls - Sets whether to shorten and track links included in the body of this message.
|
|
188
191
|
* @property smartEncoded - Whether to detect Unicode characters that have a similar GSM-7 character and replace them
|
|
189
192
|
* @property statusCallback - The URL we should call to send status information to your application
|
|
190
193
|
* @property to - The destination phone number
|
|
@@ -196,6 +199,8 @@ interface MessageListInstanceCreateOptions {
|
|
|
196
199
|
attempt?: number;
|
|
197
200
|
body?: string;
|
|
198
201
|
contentRetention?: MessageContentRetention;
|
|
202
|
+
contentSid?: string;
|
|
203
|
+
contentVariables?: string;
|
|
199
204
|
forceDelivery?: boolean;
|
|
200
205
|
from?: string;
|
|
201
206
|
maxPrice?: number;
|
|
@@ -206,6 +211,7 @@ interface MessageListInstanceCreateOptions {
|
|
|
206
211
|
scheduleType?: MessageScheduleType;
|
|
207
212
|
sendAsMms?: boolean;
|
|
208
213
|
sendAt?: Date;
|
|
214
|
+
shortenUrls?: boolean;
|
|
209
215
|
smartEncoded?: boolean;
|
|
210
216
|
statusCallback?: string;
|
|
211
217
|
to: string;
|
|
@@ -83,12 +83,18 @@ MessageList = function MessageList(version, accountSid) {
|
|
|
83
83
|
* Whether to detect Unicode characters that have a similar GSM-7 character and replace them
|
|
84
84
|
* @param {string|list} [opts.persistentAction] -
|
|
85
85
|
* Rich actions for Channels Messages.
|
|
86
|
+
* @param {boolean} [opts.shortenUrls] -
|
|
87
|
+
* Sets whether to shorten and track links included in the body of this message.
|
|
86
88
|
* @param {message.schedule_type} [opts.scheduleType] -
|
|
87
89
|
* Pass the value `fixed` to schedule a message at a fixed time.
|
|
88
90
|
* @param {Date} [opts.sendAt] -
|
|
89
91
|
* The time that Twilio will send the message. Must be in ISO 8601 format.
|
|
90
92
|
* @param {boolean} [opts.sendAsMms] -
|
|
91
93
|
* If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media.
|
|
94
|
+
* @param {string} [opts.contentSid] -
|
|
95
|
+
* The SID of the preconfigured Content object you want to associate with the message.
|
|
96
|
+
* @param {string} [opts.contentVariables] -
|
|
97
|
+
* Key-value pairs of variable names to substitution values, used alongside a content_sid.
|
|
92
98
|
* @param {string} [opts.from] - The phone number that initiated the message
|
|
93
99
|
* @param {string} [opts.messagingServiceSid] -
|
|
94
100
|
* The SID of the Messaging Service you want to associate with the message.
|
|
@@ -127,9 +133,12 @@ MessageList = function MessageList(version, accountSid) {
|
|
|
127
133
|
'AddressRetention': _.get(opts, 'addressRetention'),
|
|
128
134
|
'SmartEncoded': serialize.bool(_.get(opts, 'smartEncoded')),
|
|
129
135
|
'PersistentAction': serialize.map(_.get(opts, 'persistentAction'), function(e) { return e; }),
|
|
136
|
+
'ShortenUrls': serialize.bool(_.get(opts, 'shortenUrls')),
|
|
130
137
|
'ScheduleType': _.get(opts, 'scheduleType'),
|
|
131
138
|
'SendAt': serialize.iso8601DateTime(_.get(opts, 'sendAt')),
|
|
132
|
-
'SendAsMms': serialize.bool(_.get(opts, 'sendAsMms'))
|
|
139
|
+
'SendAsMms': serialize.bool(_.get(opts, 'sendAsMms')),
|
|
140
|
+
'ContentSid': _.get(opts, 'contentSid'),
|
|
141
|
+
'ContentVariables': _.get(opts, 'contentVariables')
|
|
133
142
|
});
|
|
134
143
|
|
|
135
144
|
var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by
|
|
3
|
+
* \ / _ _ _| _ _
|
|
4
|
+
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
* / /
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import Oauth = require('../Oauth');
|
|
9
|
+
import Version = require('../../base/Version');
|
|
10
|
+
import { OauthList } from './v1/oauth';
|
|
11
|
+
import { OauthListInstance } from './v1/oauth';
|
|
12
|
+
import { OpenidDiscoveryList } from './v1/openidDiscovery';
|
|
13
|
+
import { OpenidDiscoveryListInstance } from './v1/openidDiscovery';
|
|
14
|
+
import { TokenList } from './v1/token';
|
|
15
|
+
import { TokenListInstance } from './v1/token';
|
|
16
|
+
import { UserInfoList } from './v1/userInfo';
|
|
17
|
+
import { UserInfoListInstance } from './v1/userInfo';
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
declare class V1 extends Version {
|
|
21
|
+
/**
|
|
22
|
+
* Initialize the V1 version of Oauth
|
|
23
|
+
*
|
|
24
|
+
* @param domain - The twilio domain
|
|
25
|
+
*/
|
|
26
|
+
constructor(domain: Oauth);
|
|
27
|
+
|
|
28
|
+
readonly oauth: OauthListInstance;
|
|
29
|
+
readonly openidDiscovery: OpenidDiscoveryListInstance;
|
|
30
|
+
readonly token: TokenListInstance;
|
|
31
|
+
readonly userInfo: UserInfoListInstance;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export = V1;
|
|
@@ -0,0 +1,80 @@
|
|
|
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 _ = require('lodash'); /* jshint ignore:line */
|
|
13
|
+
var OauthList = require('./v1/oauth').OauthList;
|
|
14
|
+
var OpenidDiscoveryList = require('./v1/openidDiscovery').OpenidDiscoveryList;
|
|
15
|
+
var TokenList = require('./v1/token').TokenList;
|
|
16
|
+
var UserInfoList = require('./v1/userInfo').UserInfoList;
|
|
17
|
+
var Version = require('../../base/Version'); /* jshint ignore:line */
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
/* jshint ignore:start */
|
|
21
|
+
/**
|
|
22
|
+
* Initialize the V1 version of Oauth
|
|
23
|
+
*
|
|
24
|
+
* @constructor Twilio.Oauth.V1
|
|
25
|
+
*
|
|
26
|
+
* @property {Twilio.Oauth.V1.OauthList} oauth - oauth resource
|
|
27
|
+
* @property {Twilio.Oauth.V1.OpenidDiscoveryList} openidDiscovery -
|
|
28
|
+
* openidDiscovery resource
|
|
29
|
+
* @property {Twilio.Oauth.V1.TokenList} token - token resource
|
|
30
|
+
* @property {Twilio.Oauth.V1.UserInfoList} userInfo - userInfo resource
|
|
31
|
+
*
|
|
32
|
+
* @param {Twilio.Oauth} domain - The twilio domain
|
|
33
|
+
*/
|
|
34
|
+
/* jshint ignore:end */
|
|
35
|
+
function V1(domain) {
|
|
36
|
+
Version.prototype.constructor.call(this, domain, 'v1');
|
|
37
|
+
|
|
38
|
+
// Resources
|
|
39
|
+
this._oauth = undefined;
|
|
40
|
+
this._openidDiscovery = undefined;
|
|
41
|
+
this._token = undefined;
|
|
42
|
+
this._userInfo = undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
_.extend(V1.prototype, Version.prototype);
|
|
46
|
+
V1.prototype.constructor = V1;
|
|
47
|
+
|
|
48
|
+
Object.defineProperty(V1.prototype,
|
|
49
|
+
'oauth', {
|
|
50
|
+
get: function() {
|
|
51
|
+
this._oauth = this._oauth || new OauthList(this);
|
|
52
|
+
return this._oauth;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
Object.defineProperty(V1.prototype,
|
|
57
|
+
'openidDiscovery', {
|
|
58
|
+
get: function() {
|
|
59
|
+
this._openidDiscovery = this._openidDiscovery || new OpenidDiscoveryList(this);
|
|
60
|
+
return this._openidDiscovery;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
Object.defineProperty(V1.prototype,
|
|
65
|
+
'token', {
|
|
66
|
+
get: function() {
|
|
67
|
+
this._token = this._token || new TokenList(this);
|
|
68
|
+
return this._token;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
Object.defineProperty(V1.prototype,
|
|
73
|
+
'userInfo', {
|
|
74
|
+
get: function() {
|
|
75
|
+
this._userInfo = this._userInfo || new UserInfoList(this);
|
|
76
|
+
return this._userInfo;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
module.exports = V1;
|
|
@@ -0,0 +1,115 @@
|
|
|
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 V1 = require('../V1');
|
|
11
|
+
import { SerializableClass } from '../../../interfaces';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Initialize the OauthList
|
|
15
|
+
*
|
|
16
|
+
* @param version - Version of the resource
|
|
17
|
+
*/
|
|
18
|
+
declare function OauthList(version: V1): OauthListInstance;
|
|
19
|
+
|
|
20
|
+
interface OauthListInstance {
|
|
21
|
+
/**
|
|
22
|
+
* @param sid - sid of instance
|
|
23
|
+
*/
|
|
24
|
+
(sid: string): OauthContext;
|
|
25
|
+
/**
|
|
26
|
+
* Constructs a oauth
|
|
27
|
+
*/
|
|
28
|
+
get(): OauthContext;
|
|
29
|
+
/**
|
|
30
|
+
* Provide a user-friendly representation
|
|
31
|
+
*/
|
|
32
|
+
toJSON(): any;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface OauthPayload extends OauthResource, Page.TwilioResponsePayload {
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface OauthResource {
|
|
39
|
+
keys: object;
|
|
40
|
+
url: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface OauthSolution {
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
declare class OauthContext {
|
|
48
|
+
/**
|
|
49
|
+
* Initialize the OauthContext
|
|
50
|
+
*
|
|
51
|
+
* @param version - Version of the resource
|
|
52
|
+
*/
|
|
53
|
+
constructor(version: V1);
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* fetch a OauthInstance
|
|
57
|
+
*
|
|
58
|
+
* @param callback - Callback to handle processed record
|
|
59
|
+
*/
|
|
60
|
+
fetch(callback?: (error: Error | null, items: OauthInstance) => any): Promise<OauthInstance>;
|
|
61
|
+
/**
|
|
62
|
+
* Provide a user-friendly representation
|
|
63
|
+
*/
|
|
64
|
+
toJSON(): any;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
declare class OauthInstance extends SerializableClass {
|
|
69
|
+
/**
|
|
70
|
+
* Initialize the OauthContext
|
|
71
|
+
*
|
|
72
|
+
* @param version - Version of the resource
|
|
73
|
+
* @param payload - The instance payload
|
|
74
|
+
*/
|
|
75
|
+
constructor(version: V1, payload: OauthPayload);
|
|
76
|
+
|
|
77
|
+
private _proxy: OauthContext;
|
|
78
|
+
/**
|
|
79
|
+
* fetch a OauthInstance
|
|
80
|
+
*
|
|
81
|
+
* @param callback - Callback to handle processed record
|
|
82
|
+
*/
|
|
83
|
+
fetch(callback?: (error: Error | null, items: OauthInstance) => any): Promise<OauthInstance>;
|
|
84
|
+
keys: any;
|
|
85
|
+
/**
|
|
86
|
+
* Provide a user-friendly representation
|
|
87
|
+
*/
|
|
88
|
+
toJSON(): any;
|
|
89
|
+
url: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
declare class OauthPage extends Page<V1, OauthPayload, OauthResource, OauthInstance> {
|
|
94
|
+
/**
|
|
95
|
+
* Initialize the OauthPage
|
|
96
|
+
*
|
|
97
|
+
* @param version - Version of the resource
|
|
98
|
+
* @param response - Response from the API
|
|
99
|
+
* @param solution - Path solution
|
|
100
|
+
*/
|
|
101
|
+
constructor(version: V1, response: Response<string>, solution: OauthSolution);
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Build an instance of OauthInstance
|
|
105
|
+
*
|
|
106
|
+
* @param payload - Payload response from the API
|
|
107
|
+
*/
|
|
108
|
+
getInstance(payload: OauthPayload): OauthInstance;
|
|
109
|
+
/**
|
|
110
|
+
* Provide a user-friendly representation
|
|
111
|
+
*/
|
|
112
|
+
toJSON(): any;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export { OauthContext, OauthInstance, OauthList, OauthListInstance, OauthPage, OauthPayload, OauthResource, OauthSolution }
|
|
@@ -0,0 +1,299 @@
|
|
|
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 values = require('../../../base/values'); /* jshint ignore:line */
|
|
17
|
+
|
|
18
|
+
var OauthList;
|
|
19
|
+
var OauthPage;
|
|
20
|
+
var OauthInstance;
|
|
21
|
+
var OauthContext;
|
|
22
|
+
|
|
23
|
+
/* jshint ignore:start */
|
|
24
|
+
/**
|
|
25
|
+
* Initialize the OauthList
|
|
26
|
+
*
|
|
27
|
+
* @constructor Twilio.Oauth.V1.OauthList
|
|
28
|
+
*
|
|
29
|
+
* @param {Twilio.Oauth.V1} version - Version of the resource
|
|
30
|
+
*/
|
|
31
|
+
/* jshint ignore:end */
|
|
32
|
+
OauthList = function OauthList(version) {
|
|
33
|
+
/* jshint ignore:start */
|
|
34
|
+
/**
|
|
35
|
+
* @function oauth
|
|
36
|
+
* @memberof Twilio.Oauth.V1#
|
|
37
|
+
*
|
|
38
|
+
* @param {string} sid - sid of instance
|
|
39
|
+
*
|
|
40
|
+
* @returns {Twilio.Oauth.V1.OauthContext}
|
|
41
|
+
*/
|
|
42
|
+
/* jshint ignore:end */
|
|
43
|
+
function OauthListInstance(sid) {
|
|
44
|
+
return OauthListInstance.get(sid);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
OauthListInstance._version = version;
|
|
48
|
+
// Path Solution
|
|
49
|
+
OauthListInstance._solution = {};
|
|
50
|
+
/* jshint ignore:start */
|
|
51
|
+
/**
|
|
52
|
+
* Constructs a oauth
|
|
53
|
+
*
|
|
54
|
+
* @function get
|
|
55
|
+
* @memberof Twilio.Oauth.V1.OauthList#
|
|
56
|
+
*
|
|
57
|
+
* @returns {Twilio.Oauth.V1.OauthContext}
|
|
58
|
+
*/
|
|
59
|
+
/* jshint ignore:end */
|
|
60
|
+
OauthListInstance.get = function get() {
|
|
61
|
+
return new OauthContext(this._version);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/* jshint ignore:start */
|
|
65
|
+
/**
|
|
66
|
+
* Provide a user-friendly representation
|
|
67
|
+
*
|
|
68
|
+
* @function toJSON
|
|
69
|
+
* @memberof Twilio.Oauth.V1.OauthList#
|
|
70
|
+
*
|
|
71
|
+
* @returns Object
|
|
72
|
+
*/
|
|
73
|
+
/* jshint ignore:end */
|
|
74
|
+
OauthListInstance.toJSON = function toJSON() {
|
|
75
|
+
return this._solution;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
OauthListInstance[util.inspect.custom] = function inspect(depth, options) {
|
|
79
|
+
return util.inspect(this.toJSON(), options);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
return OauthListInstance;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
/* jshint ignore:start */
|
|
87
|
+
/**
|
|
88
|
+
* Initialize the OauthPage
|
|
89
|
+
*
|
|
90
|
+
* @constructor Twilio.Oauth.V1.OauthPage
|
|
91
|
+
*
|
|
92
|
+
* @param {V1} version - Version of the resource
|
|
93
|
+
* @param {Response<string>} response - Response from the API
|
|
94
|
+
* @param {OauthSolution} solution - Path solution
|
|
95
|
+
*
|
|
96
|
+
* @returns OauthPage
|
|
97
|
+
*/
|
|
98
|
+
/* jshint ignore:end */
|
|
99
|
+
OauthPage = function OauthPage(version, response, solution) {
|
|
100
|
+
// Path Solution
|
|
101
|
+
this._solution = solution;
|
|
102
|
+
|
|
103
|
+
Page.prototype.constructor.call(this, version, response, this._solution);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
_.extend(OauthPage.prototype, Page.prototype);
|
|
107
|
+
OauthPage.prototype.constructor = OauthPage;
|
|
108
|
+
|
|
109
|
+
/* jshint ignore:start */
|
|
110
|
+
/**
|
|
111
|
+
* Build an instance of OauthInstance
|
|
112
|
+
*
|
|
113
|
+
* @function getInstance
|
|
114
|
+
* @memberof Twilio.Oauth.V1.OauthPage#
|
|
115
|
+
*
|
|
116
|
+
* @param {OauthPayload} payload - Payload response from the API
|
|
117
|
+
*
|
|
118
|
+
* @returns OauthInstance
|
|
119
|
+
*/
|
|
120
|
+
/* jshint ignore:end */
|
|
121
|
+
OauthPage.prototype.getInstance = function getInstance(payload) {
|
|
122
|
+
return new OauthInstance(this._version, payload);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
/* jshint ignore:start */
|
|
126
|
+
/**
|
|
127
|
+
* Provide a user-friendly representation
|
|
128
|
+
*
|
|
129
|
+
* @function toJSON
|
|
130
|
+
* @memberof Twilio.Oauth.V1.OauthPage#
|
|
131
|
+
*
|
|
132
|
+
* @returns Object
|
|
133
|
+
*/
|
|
134
|
+
/* jshint ignore:end */
|
|
135
|
+
OauthPage.prototype.toJSON = function toJSON() {
|
|
136
|
+
let clone = {};
|
|
137
|
+
_.forOwn(this, function(value, key) {
|
|
138
|
+
if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
|
|
139
|
+
clone[key] = value;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
return clone;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
OauthPage.prototype[util.inspect.custom] = function inspect(depth, options) {
|
|
146
|
+
return util.inspect(this.toJSON(), options);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
/* jshint ignore:start */
|
|
151
|
+
/**
|
|
152
|
+
* Initialize the OauthContext
|
|
153
|
+
*
|
|
154
|
+
* @constructor Twilio.Oauth.V1.OauthInstance
|
|
155
|
+
*
|
|
156
|
+
* @property {object} keys - A collection of certificates
|
|
157
|
+
* @property {string} url - The url
|
|
158
|
+
*
|
|
159
|
+
* @param {V1} version - Version of the resource
|
|
160
|
+
* @param {OauthPayload} payload - The instance payload
|
|
161
|
+
*/
|
|
162
|
+
/* jshint ignore:end */
|
|
163
|
+
OauthInstance = function OauthInstance(version, payload) {
|
|
164
|
+
this._version = version;
|
|
165
|
+
|
|
166
|
+
// Marshaled Properties
|
|
167
|
+
this.keys = payload.keys; // jshint ignore:line
|
|
168
|
+
this.url = payload.url; // jshint ignore:line
|
|
169
|
+
|
|
170
|
+
// Context
|
|
171
|
+
this._context = undefined;
|
|
172
|
+
this._solution = {};
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
Object.defineProperty(OauthInstance.prototype,
|
|
176
|
+
'_proxy', {
|
|
177
|
+
get: function() {
|
|
178
|
+
if (!this._context) {
|
|
179
|
+
this._context = new OauthContext(this._version);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return this._context;
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
/* jshint ignore:start */
|
|
187
|
+
/**
|
|
188
|
+
* fetch a OauthInstance
|
|
189
|
+
*
|
|
190
|
+
* @function fetch
|
|
191
|
+
* @memberof Twilio.Oauth.V1.OauthInstance#
|
|
192
|
+
*
|
|
193
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
194
|
+
*
|
|
195
|
+
* @returns {Promise} Resolves to processed OauthInstance
|
|
196
|
+
*/
|
|
197
|
+
/* jshint ignore:end */
|
|
198
|
+
OauthInstance.prototype.fetch = function fetch(callback) {
|
|
199
|
+
return this._proxy.fetch(callback);
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
/* jshint ignore:start */
|
|
203
|
+
/**
|
|
204
|
+
* Provide a user-friendly representation
|
|
205
|
+
*
|
|
206
|
+
* @function toJSON
|
|
207
|
+
* @memberof Twilio.Oauth.V1.OauthInstance#
|
|
208
|
+
*
|
|
209
|
+
* @returns Object
|
|
210
|
+
*/
|
|
211
|
+
/* jshint ignore:end */
|
|
212
|
+
OauthInstance.prototype.toJSON = function toJSON() {
|
|
213
|
+
let clone = {};
|
|
214
|
+
_.forOwn(this, function(value, key) {
|
|
215
|
+
if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
|
|
216
|
+
clone[key] = value;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
return clone;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
OauthInstance.prototype[util.inspect.custom] = function inspect(depth, options)
|
|
223
|
+
{
|
|
224
|
+
return util.inspect(this.toJSON(), options);
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
/* jshint ignore:start */
|
|
229
|
+
/**
|
|
230
|
+
* Initialize the OauthContext
|
|
231
|
+
*
|
|
232
|
+
* @constructor Twilio.Oauth.V1.OauthContext
|
|
233
|
+
*
|
|
234
|
+
* @param {V1} version - Version of the resource
|
|
235
|
+
*/
|
|
236
|
+
/* jshint ignore:end */
|
|
237
|
+
OauthContext = function OauthContext(version) {
|
|
238
|
+
this._version = version;
|
|
239
|
+
|
|
240
|
+
// Path Solution
|
|
241
|
+
this._solution = {};
|
|
242
|
+
this._uri = `/certs`;
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
/* jshint ignore:start */
|
|
246
|
+
/**
|
|
247
|
+
* fetch a OauthInstance
|
|
248
|
+
*
|
|
249
|
+
* @function fetch
|
|
250
|
+
* @memberof Twilio.Oauth.V1.OauthContext#
|
|
251
|
+
*
|
|
252
|
+
* @param {function} [callback] - Callback to handle processed record
|
|
253
|
+
*
|
|
254
|
+
* @returns {Promise} Resolves to processed OauthInstance
|
|
255
|
+
*/
|
|
256
|
+
/* jshint ignore:end */
|
|
257
|
+
OauthContext.prototype.fetch = function fetch(callback) {
|
|
258
|
+
var deferred = Q.defer();
|
|
259
|
+
var promise = this._version.fetch({uri: this._uri, method: 'GET'});
|
|
260
|
+
|
|
261
|
+
promise = promise.then(function(payload) {
|
|
262
|
+
deferred.resolve(new OauthInstance(this._version, payload));
|
|
263
|
+
}.bind(this));
|
|
264
|
+
|
|
265
|
+
promise.catch(function(error) {
|
|
266
|
+
deferred.reject(error);
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
if (_.isFunction(callback)) {
|
|
270
|
+
deferred.promise.nodeify(callback);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
return deferred.promise;
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
/* jshint ignore:start */
|
|
277
|
+
/**
|
|
278
|
+
* Provide a user-friendly representation
|
|
279
|
+
*
|
|
280
|
+
* @function toJSON
|
|
281
|
+
* @memberof Twilio.Oauth.V1.OauthContext#
|
|
282
|
+
*
|
|
283
|
+
* @returns Object
|
|
284
|
+
*/
|
|
285
|
+
/* jshint ignore:end */
|
|
286
|
+
OauthContext.prototype.toJSON = function toJSON() {
|
|
287
|
+
return this._solution;
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
OauthContext.prototype[util.inspect.custom] = function inspect(depth, options) {
|
|
291
|
+
return util.inspect(this.toJSON(), options);
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
module.exports = {
|
|
295
|
+
OauthList: OauthList,
|
|
296
|
+
OauthPage: OauthPage,
|
|
297
|
+
OauthInstance: OauthInstance,
|
|
298
|
+
OauthContext: OauthContext
|
|
299
|
+
};
|