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.
Files changed (61) hide show
  1. package/lib/rest/Oauth.d.ts +32 -0
  2. package/lib/rest/Oauth.js +79 -0
  3. package/lib/rest/Supersim.d.ts +2 -0
  4. package/lib/rest/Supersim.js +9 -0
  5. package/lib/rest/Twilio.d.ts +2 -0
  6. package/lib/rest/Twilio.js +14 -0
  7. package/lib/rest/api/v2010/account/call/userDefinedMessage.d.ts +107 -0
  8. package/lib/rest/api/v2010/account/call/userDefinedMessage.js +259 -0
  9. package/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.d.ts +153 -0
  10. package/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.js +407 -0
  11. package/lib/rest/api/v2010/account/call.d.ts +14 -0
  12. package/lib/rest/api/v2010/account/call.js +67 -0
  13. package/lib/rest/api/v2010/account/conference/participant.d.ts +2 -2
  14. package/lib/rest/api/v2010/account/conference/participant.js +6 -4
  15. package/lib/rest/api/v2010/account/message.d.ts +6 -0
  16. package/lib/rest/api/v2010/account/message.js +10 -1
  17. package/lib/rest/oauth/V1.d.ts +34 -0
  18. package/lib/rest/oauth/V1.js +80 -0
  19. package/lib/rest/oauth/v1/oauth.d.ts +115 -0
  20. package/lib/rest/oauth/v1/oauth.js +299 -0
  21. package/lib/rest/oauth/v1/openidDiscovery.d.ts +137 -0
  22. package/lib/rest/oauth/v1/openidDiscovery.js +329 -0
  23. package/lib/rest/oauth/v1/token.d.ts +115 -0
  24. package/lib/rest/oauth/v1/token.js +265 -0
  25. package/lib/rest/oauth/v1/userInfo.d.ts +123 -0
  26. package/lib/rest/oauth/v1/userInfo.js +308 -0
  27. package/lib/rest/proxy/v1/service/session/participant.d.ts +0 -2
  28. package/lib/rest/proxy/v1/service/session/participant.js +1 -6
  29. package/lib/rest/proxy/v1/service/session.d.ts +0 -4
  30. package/lib/rest/proxy/v1/service/session.js +2 -10
  31. package/lib/rest/supersim/V1.d.ts +3 -0
  32. package/lib/rest/supersim/V1.js +12 -0
  33. package/lib/rest/supersim/v1/settingsUpdate.d.ts +261 -0
  34. package/lib/rest/supersim/v1/settingsUpdate.js +466 -0
  35. package/lib/rest/taskrouter/v1/workspace/task/reservation.d.ts +6 -0
  36. package/lib/rest/taskrouter/v1/workspace/task/reservation.js +7 -0
  37. package/lib/rest/taskrouter/v1/workspace/taskQueue.d.ts +6 -0
  38. package/lib/rest/taskrouter/v1/workspace/taskQueue.js +4 -0
  39. package/lib/rest/taskrouter/v1/workspace/worker.d.ts +6 -0
  40. package/lib/rest/taskrouter/v1/workspace/worker.js +4 -0
  41. package/lib/rest/verify/v2/service/accessToken.d.ts +0 -12
  42. package/lib/rest/verify/v2/service/accessToken.js +0 -12
  43. package/lib/rest/verify/v2/service/entity/challenge/notification.d.ts +0 -9
  44. package/lib/rest/verify/v2/service/entity/challenge/notification.js +0 -9
  45. package/lib/rest/verify/v2/service/entity/challenge.d.ts +0 -12
  46. package/lib/rest/verify/v2/service/entity/challenge.js +0 -12
  47. package/lib/rest/verify/v2/service/entity/factor.d.ts +0 -12
  48. package/lib/rest/verify/v2/service/entity/factor.js +0 -12
  49. package/lib/rest/verify/v2/service/entity/newFactor.d.ts +0 -9
  50. package/lib/rest/verify/v2/service/entity/newFactor.js +0 -9
  51. package/lib/rest/verify/v2/service/entity.d.ts +0 -12
  52. package/lib/rest/verify/v2/service/entity.js +0 -12
  53. package/lib/rest/verify/v2/service/verification.d.ts +1 -1
  54. package/lib/rest/verify/v2/service/verification.js +2 -1
  55. package/lib/rest/verify/v2/service/webhook.d.ts +0 -12
  56. package/lib/rest/verify/v2/service/webhook.js +0 -12
  57. package/lib/rest/verify/v2/template.d.ts +2 -0
  58. package/lib/rest/verify/v2/template.js +2 -0
  59. package/lib/twiml/VoiceResponse.d.ts +7 -1
  60. package/lib/twiml/VoiceResponse.js +6 -0
  61. package/package.json +1 -1
@@ -0,0 +1,32 @@
1
+ /**
2
+ * This code was generated by
3
+ * \ / _ _ _| _ _
4
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ * / /
6
+ */
7
+
8
+ import Domain = require('../base/Domain');
9
+ import Twilio = require('./Twilio');
10
+ import V1 = require('./oauth/V1');
11
+ import { OauthListInstance } from './oauth/v1/oauth';
12
+ import { OpenidDiscoveryListInstance } from './oauth/v1/openidDiscovery';
13
+ import { TokenListInstance } from './oauth/v1/token';
14
+ import { UserInfoListInstance } from './oauth/v1/userInfo';
15
+
16
+
17
+ declare class Oauth extends Domain {
18
+ /**
19
+ * Initialize oauth domain
20
+ *
21
+ * @param twilio - The twilio client
22
+ */
23
+ constructor(twilio: Twilio);
24
+
25
+ readonly oauth: OauthListInstance;
26
+ readonly openidDiscovery: OpenidDiscoveryListInstance;
27
+ readonly token: TokenListInstance;
28
+ readonly userInfo: UserInfoListInstance;
29
+ readonly v1: V1;
30
+ }
31
+
32
+ export = Oauth;
@@ -0,0 +1,79 @@
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 Domain = require('../base/Domain'); /* jshint ignore:line */
14
+ var V1 = require('./oauth/V1'); /* jshint ignore:line */
15
+
16
+
17
+ /* jshint ignore:start */
18
+ /**
19
+ * Initialize oauth domain
20
+ *
21
+ * @constructor Twilio.Oauth
22
+ *
23
+ * @property {Twilio.Oauth.V1} v1 - v1 version
24
+ * @property {Twilio.Oauth.V1.OauthList} oauth - oauth resource
25
+ * @property {Twilio.Oauth.V1.OpenidDiscoveryList} openidDiscovery -
26
+ * openidDiscovery resource
27
+ * @property {Twilio.Oauth.V1.TokenList} token - token resource
28
+ * @property {Twilio.Oauth.V1.UserInfoList} userInfo - userInfo resource
29
+ *
30
+ * @param {Twilio} twilio - The twilio client
31
+ */
32
+ /* jshint ignore:end */
33
+ function Oauth(twilio) {
34
+ Domain.prototype.constructor.call(this, twilio, 'https://oauth.twilio.com');
35
+
36
+ // Versions
37
+ this._v1 = undefined;
38
+ }
39
+
40
+ _.extend(Oauth.prototype, Domain.prototype);
41
+ Oauth.prototype.constructor = Oauth;
42
+
43
+ Object.defineProperty(Oauth.prototype,
44
+ 'v1', {
45
+ get: function() {
46
+ this._v1 = this._v1 || new V1(this);
47
+ return this._v1;
48
+ }
49
+ });
50
+
51
+ Object.defineProperty(Oauth.prototype,
52
+ 'oauth', {
53
+ get: function() {
54
+ return this.v1.oauth;
55
+ }
56
+ });
57
+
58
+ Object.defineProperty(Oauth.prototype,
59
+ 'openidDiscovery', {
60
+ get: function() {
61
+ return this.v1.openidDiscovery;
62
+ }
63
+ });
64
+
65
+ Object.defineProperty(Oauth.prototype,
66
+ 'token', {
67
+ get: function() {
68
+ return this.v1.token;
69
+ }
70
+ });
71
+
72
+ Object.defineProperty(Oauth.prototype,
73
+ 'userInfo', {
74
+ get: function() {
75
+ return this.v1.userInfo;
76
+ }
77
+ });
78
+
79
+ module.exports = Oauth;
@@ -13,6 +13,7 @@ import { FleetListInstance } from './supersim/v1/fleet';
13
13
  import { IpCommandListInstance } from './supersim/v1/ipCommand';
14
14
  import { NetworkAccessProfileListInstance } from './supersim/v1/networkAccessProfile';
15
15
  import { NetworkListInstance } from './supersim/v1/network';
16
+ import { SettingsUpdateListInstance } from './supersim/v1/settingsUpdate';
16
17
  import { SimListInstance } from './supersim/v1/sim';
17
18
  import { SmsCommandListInstance } from './supersim/v1/smsCommand';
18
19
  import { UsageRecordListInstance } from './supersim/v1/usageRecord';
@@ -31,6 +32,7 @@ declare class Supersim extends Domain {
31
32
  readonly ipCommands: IpCommandListInstance;
32
33
  readonly networkAccessProfiles: NetworkAccessProfileListInstance;
33
34
  readonly networks: NetworkListInstance;
35
+ readonly settingsUpdates: SettingsUpdateListInstance;
34
36
  readonly sims: SimListInstance;
35
37
  readonly smsCommands: SmsCommandListInstance;
36
38
  readonly usageRecords: UsageRecordListInstance;
@@ -28,6 +28,8 @@ var V1 = require('./supersim/V1'); /* jshint ignore:line */
28
28
  * @property {Twilio.Supersim.V1.NetworkList} networks - networks resource
29
29
  * @property {Twilio.Supersim.V1.NetworkAccessProfileList} networkAccessProfiles -
30
30
  * networkAccessProfiles resource
31
+ * @property {Twilio.Supersim.V1.SettingsUpdateList} settingsUpdates -
32
+ * settingsUpdates resource
31
33
  * @property {Twilio.Supersim.V1.SimList} sims - sims resource
32
34
  * @property {Twilio.Supersim.V1.SmsCommandList} smsCommands - smsCommands resource
33
35
  * @property {Twilio.Supersim.V1.UsageRecordList} usageRecords -
@@ -89,6 +91,13 @@ Object.defineProperty(Supersim.prototype,
89
91
  }
90
92
  });
91
93
 
94
+ Object.defineProperty(Supersim.prototype,
95
+ 'settingsUpdates', {
96
+ get: function() {
97
+ return this.v1.settingsUpdates;
98
+ }
99
+ });
100
+
92
101
  Object.defineProperty(Supersim.prototype,
93
102
  'sims', {
94
103
  get: function() {
@@ -23,6 +23,7 @@ import Microvisor = require('./Microvisor');
23
23
  import Monitor = require('./Monitor');
24
24
  import Notify = require('./Notify');
25
25
  import Numbers = require('./Numbers');
26
+ import Oauth = require('./Oauth');
26
27
  import Preview = require('./Preview');
27
28
  import Pricing = require('./Pricing');
28
29
  import Proxy = require('./Proxy');
@@ -83,6 +84,7 @@ declare class Twilio {
83
84
  notifications: (typeof Api.prototype.account.notifications);
84
85
  notify: Notify;
85
86
  numbers: Numbers;
87
+ oauth: Oauth;
86
88
  outgoingCallerIds: (typeof Api.prototype.account.outgoingCallerIds);
87
89
  preview: Preview;
88
90
  pricing: Pricing;
@@ -38,6 +38,7 @@ var RestException = require('../base/RestException'); /* jshint ignore:line */
38
38
  * @property {Twilio.Monitor} monitor - monitor domain
39
39
  * @property {Twilio.Notify} notify - notify domain
40
40
  * @property {Twilio.Numbers} numbers - numbers domain
41
+ * @property {Twilio.Oauth} oauth - oauth domain
41
42
  * @property {Twilio.Preview} preview - preview domain
42
43
  * @property {Twilio.Pricing} pricing - pricing domain
43
44
  * @property {Twilio.Proxy} proxy - proxy domain
@@ -165,6 +166,7 @@ function Twilio(username, password, opts) {
165
166
  this._monitor = undefined;
166
167
  this._notify = undefined;
167
168
  this._numbers = undefined;
169
+ this._oauth = undefined;
168
170
  this._preview = undefined;
169
171
  this._pricing = undefined;
170
172
  this._proxy = undefined;
@@ -200,6 +202,7 @@ function Twilio(username, password, opts) {
200
202
  this.monitor;
201
203
  this.notify;
202
204
  this.numbers;
205
+ this.oauth;
203
206
  this.preview;
204
207
  this.pricing;
205
208
  this.proxy;
@@ -541,6 +544,17 @@ Object.defineProperty(Twilio.prototype,
541
544
  }
542
545
  });
543
546
 
547
+ Object.defineProperty(Twilio.prototype,
548
+ 'oauth', {
549
+ get: function() {
550
+ if (!this._oauth) {
551
+ var Oauth = require('./Oauth'); /* jshint ignore:line */
552
+ this._oauth = new Oauth(this);
553
+ }
554
+ return this._oauth;
555
+ }
556
+ });
557
+
544
558
  Object.defineProperty(Twilio.prototype,
545
559
  'preview', {
546
560
  get: function() {
@@ -0,0 +1,107 @@
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 UserDefinedMessageList
15
+ *
16
+ * @param version - Version of the resource
17
+ * @param accountSid - Account Sid.
18
+ * @param callSid - Call Sid.
19
+ */
20
+ declare function UserDefinedMessageList(version: V2010, accountSid: string, callSid: string): UserDefinedMessageListInstance;
21
+
22
+ interface UserDefinedMessageListInstance {
23
+ /**
24
+ * create a UserDefinedMessageInstance
25
+ *
26
+ * @param opts - Options for request
27
+ * @param callback - Callback to handle processed record
28
+ */
29
+ create(opts: UserDefinedMessageListInstanceCreateOptions, callback?: (error: Error | null, item: UserDefinedMessageInstance) => any): Promise<UserDefinedMessageInstance>;
30
+ /**
31
+ * Provide a user-friendly representation
32
+ */
33
+ toJSON(): any;
34
+ }
35
+
36
+ /**
37
+ * Options to pass to create
38
+ *
39
+ * @property content - A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated.
40
+ * @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.
41
+ */
42
+ interface UserDefinedMessageListInstanceCreateOptions {
43
+ content: string;
44
+ idempotencyKey?: string;
45
+ }
46
+
47
+ interface UserDefinedMessagePayload extends UserDefinedMessageResource, Page.TwilioResponsePayload {
48
+ }
49
+
50
+ interface UserDefinedMessageResource {
51
+ account_sid: string;
52
+ call_sid: string;
53
+ date_created: Date;
54
+ sid: string;
55
+ }
56
+
57
+ interface UserDefinedMessageSolution {
58
+ accountSid?: string;
59
+ callSid?: string;
60
+ }
61
+
62
+
63
+ declare class UserDefinedMessageInstance extends SerializableClass {
64
+ /**
65
+ * Initialize the UserDefinedMessageContext
66
+ *
67
+ * @param version - Version of the resource
68
+ * @param payload - The instance payload
69
+ * @param accountSid - Account Sid.
70
+ * @param callSid - Call Sid.
71
+ */
72
+ constructor(version: V2010, payload: UserDefinedMessagePayload, accountSid: string, callSid: string);
73
+
74
+ accountSid: string;
75
+ callSid: string;
76
+ dateCreated: Date;
77
+ sid: string;
78
+ /**
79
+ * Provide a user-friendly representation
80
+ */
81
+ toJSON(): any;
82
+ }
83
+
84
+
85
+ declare class UserDefinedMessagePage extends Page<V2010, UserDefinedMessagePayload, UserDefinedMessageResource, UserDefinedMessageInstance> {
86
+ /**
87
+ * Initialize the UserDefinedMessagePage
88
+ *
89
+ * @param version - Version of the resource
90
+ * @param response - Response from the API
91
+ * @param solution - Path solution
92
+ */
93
+ constructor(version: V2010, response: Response<string>, solution: UserDefinedMessageSolution);
94
+
95
+ /**
96
+ * Build an instance of UserDefinedMessageInstance
97
+ *
98
+ * @param payload - Payload response from the API
99
+ */
100
+ getInstance(payload: UserDefinedMessagePayload): UserDefinedMessageInstance;
101
+ /**
102
+ * Provide a user-friendly representation
103
+ */
104
+ toJSON(): any;
105
+ }
106
+
107
+ export { UserDefinedMessageInstance, UserDefinedMessageList, UserDefinedMessageListInstance, UserDefinedMessageListInstanceCreateOptions, UserDefinedMessagePage, UserDefinedMessagePayload, UserDefinedMessageResource, UserDefinedMessageSolution }
@@ -0,0 +1,259 @@
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 UserDefinedMessageList;
21
+ var UserDefinedMessagePage;
22
+ var UserDefinedMessageInstance;
23
+
24
+ /* jshint ignore:start */
25
+ /**
26
+ * Initialize the UserDefinedMessageList
27
+ *
28
+ * @constructor Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageList
29
+ *
30
+ * @param {Twilio.Api.V2010} version - Version of the resource
31
+ * @param {string} accountSid - Account Sid.
32
+ * @param {string} callSid - Call Sid.
33
+ */
34
+ /* jshint ignore:end */
35
+ UserDefinedMessageList = function UserDefinedMessageList(version, accountSid,
36
+ callSid) {
37
+ /* jshint ignore:start */
38
+ /**
39
+ * @function userDefinedMessages
40
+ * @memberof Twilio.Api.V2010.AccountContext.CallContext#
41
+ *
42
+ * @param {string} sid - sid of instance
43
+ *
44
+ * @returns {Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageContext}
45
+ */
46
+ /* jshint ignore:end */
47
+ function UserDefinedMessageListInstance(sid) {
48
+ return UserDefinedMessageListInstance.get(sid);
49
+ }
50
+
51
+ UserDefinedMessageListInstance._version = version;
52
+ // Path Solution
53
+ UserDefinedMessageListInstance._solution = {accountSid: accountSid, callSid: callSid};
54
+ UserDefinedMessageListInstance._uri = `/Accounts/${accountSid}/Calls/${callSid}/UserDefinedMessages.json`;
55
+ /* jshint ignore:start */
56
+ /**
57
+ * create a UserDefinedMessageInstance
58
+ *
59
+ * @function create
60
+ * @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageList#
61
+ *
62
+ * @param {object} opts - Options for request
63
+ * @param {string} opts.content -
64
+ * A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated.
65
+ * @param {string} [opts.idempotencyKey] -
66
+ * A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated.
67
+ * @param {function} [callback] - Callback to handle processed record
68
+ *
69
+ * @returns {Promise} Resolves to processed UserDefinedMessageInstance
70
+ */
71
+ /* jshint ignore:end */
72
+ UserDefinedMessageListInstance.create = function create(opts, callback) {
73
+ if (_.isUndefined(opts)) {
74
+ throw new Error('Required parameter "opts" missing.');
75
+ }
76
+ if (_.isUndefined(opts['content'])) {
77
+ throw new Error('Required parameter "opts[\'content\']" missing.');
78
+ }
79
+
80
+ var deferred = Q.defer();
81
+ var data = values.of({
82
+ 'Content': _.get(opts, 'content'),
83
+ 'IdempotencyKey': _.get(opts, 'idempotencyKey')
84
+ });
85
+
86
+ var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
87
+
88
+ promise = promise.then(function(payload) {
89
+ deferred.resolve(new UserDefinedMessageInstance(this._version, payload));
90
+ }.bind(this));
91
+
92
+ promise.catch(function(error) {
93
+ deferred.reject(error);
94
+ });
95
+
96
+ if (_.isFunction(callback)) {
97
+ deferred.promise.nodeify(callback);
98
+ }
99
+
100
+ return deferred.promise;
101
+ };
102
+
103
+ /* jshint ignore:start */
104
+ /**
105
+ * Provide a user-friendly representation
106
+ *
107
+ * @function toJSON
108
+ * @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageList#
109
+ *
110
+ * @returns Object
111
+ */
112
+ /* jshint ignore:end */
113
+ UserDefinedMessageListInstance.toJSON = function toJSON() {
114
+ return this._solution;
115
+ };
116
+
117
+ UserDefinedMessageListInstance[util.inspect.custom] = function inspect(depth,
118
+ options) {
119
+ return util.inspect(this.toJSON(), options);
120
+ };
121
+
122
+ return UserDefinedMessageListInstance;
123
+ };
124
+
125
+
126
+ /* jshint ignore:start */
127
+ /**
128
+ * Initialize the UserDefinedMessagePage
129
+ *
130
+ * @constructor Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessagePage
131
+ *
132
+ * @param {V2010} version - Version of the resource
133
+ * @param {Response<string>} response - Response from the API
134
+ * @param {UserDefinedMessageSolution} solution - Path solution
135
+ *
136
+ * @returns UserDefinedMessagePage
137
+ */
138
+ /* jshint ignore:end */
139
+ UserDefinedMessagePage = function UserDefinedMessagePage(version, response,
140
+ solution) {
141
+ // Path Solution
142
+ this._solution = solution;
143
+
144
+ Page.prototype.constructor.call(this, version, response, this._solution);
145
+ };
146
+
147
+ _.extend(UserDefinedMessagePage.prototype, Page.prototype);
148
+ UserDefinedMessagePage.prototype.constructor = UserDefinedMessagePage;
149
+
150
+ /* jshint ignore:start */
151
+ /**
152
+ * Build an instance of UserDefinedMessageInstance
153
+ *
154
+ * @function getInstance
155
+ * @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessagePage#
156
+ *
157
+ * @param {UserDefinedMessagePayload} payload - Payload response from the API
158
+ *
159
+ * @returns UserDefinedMessageInstance
160
+ */
161
+ /* jshint ignore:end */
162
+ UserDefinedMessagePage.prototype.getInstance = function getInstance(payload) {
163
+ return new UserDefinedMessageInstance(
164
+ this._version,
165
+ payload,
166
+ this._solution.accountSid,
167
+ this._solution.callSid
168
+ );
169
+ };
170
+
171
+ /* jshint ignore:start */
172
+ /**
173
+ * Provide a user-friendly representation
174
+ *
175
+ * @function toJSON
176
+ * @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessagePage#
177
+ *
178
+ * @returns Object
179
+ */
180
+ /* jshint ignore:end */
181
+ UserDefinedMessagePage.prototype.toJSON = function toJSON() {
182
+ let clone = {};
183
+ _.forOwn(this, function(value, key) {
184
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
185
+ clone[key] = value;
186
+ }
187
+ });
188
+ return clone;
189
+ };
190
+
191
+ UserDefinedMessagePage.prototype[util.inspect.custom] = function inspect(depth,
192
+ options) {
193
+ return util.inspect(this.toJSON(), options);
194
+ };
195
+
196
+
197
+ /* jshint ignore:start */
198
+ /**
199
+ * Initialize the UserDefinedMessageContext
200
+ *
201
+ * @constructor Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageInstance
202
+ *
203
+ * @property {string} accountSid - Account Sid.
204
+ * @property {string} callSid - Call Sid.
205
+ * @property {string} sid -
206
+ * A string that uniquely identifies this User Defined Message.
207
+ * @property {Date} dateCreated - The date this User Defined Message was created
208
+ *
209
+ * @param {V2010} version - Version of the resource
210
+ * @param {UserDefinedMessagePayload} payload - The instance payload
211
+ * @param {sid} accountSid - Account Sid.
212
+ * @param {sid} callSid - Call Sid.
213
+ */
214
+ /* jshint ignore:end */
215
+ UserDefinedMessageInstance = function UserDefinedMessageInstance(version,
216
+ payload, accountSid, callSid) {
217
+ this._version = version;
218
+
219
+ // Marshaled Properties
220
+ this.accountSid = payload.account_sid; // jshint ignore:line
221
+ this.callSid = payload.call_sid; // jshint ignore:line
222
+ this.sid = payload.sid; // jshint ignore:line
223
+ this.dateCreated = deserialize.rfc2822DateTime(payload.date_created); // jshint ignore:line
224
+
225
+ // Context
226
+ this._context = undefined;
227
+ this._solution = {accountSid: accountSid, callSid: callSid, };
228
+ };
229
+
230
+ /* jshint ignore:start */
231
+ /**
232
+ * Provide a user-friendly representation
233
+ *
234
+ * @function toJSON
235
+ * @memberof Twilio.Api.V2010.AccountContext.CallContext.UserDefinedMessageInstance#
236
+ *
237
+ * @returns Object
238
+ */
239
+ /* jshint ignore:end */
240
+ UserDefinedMessageInstance.prototype.toJSON = function toJSON() {
241
+ let clone = {};
242
+ _.forOwn(this, function(value, key) {
243
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
244
+ clone[key] = value;
245
+ }
246
+ });
247
+ return clone;
248
+ };
249
+
250
+ UserDefinedMessageInstance.prototype[util.inspect.custom] = function
251
+ inspect(depth, options) {
252
+ return util.inspect(this.toJSON(), options);
253
+ };
254
+
255
+ module.exports = {
256
+ UserDefinedMessageList: UserDefinedMessageList,
257
+ UserDefinedMessagePage: UserDefinedMessagePage,
258
+ UserDefinedMessageInstance: UserDefinedMessageInstance
259
+ };