twilio 3.83.1 → 3.83.3

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.
@@ -13,7 +13,9 @@ var _ = require('lodash'); /* jshint ignore:line */
13
13
  var ChannelList = require('./v1/channel').ChannelList;
14
14
  var ConfigurationList = require('./v1/configuration').ConfigurationList;
15
15
  var FlexFlowList = require('./v1/flexFlow').FlexFlowList;
16
+ var GoodDataList = require('./v1/goodData').GoodDataList;
16
17
  var InteractionList = require('./v1/interaction').InteractionList;
18
+ var UserRolesList = require('./v1/userRoles').UserRolesList;
17
19
  var Version = require('../../base/Version'); /* jshint ignore:line */
18
20
  var WebChannelList = require('./v1/webChannel').WebChannelList;
19
21
 
@@ -28,7 +30,9 @@ var WebChannelList = require('./v1/webChannel').WebChannelList;
28
30
  * @property {Twilio.FlexApi.V1.ConfigurationList} configuration -
29
31
  * configuration resource
30
32
  * @property {Twilio.FlexApi.V1.FlexFlowList} flexFlow - flexFlow resource
33
+ * @property {Twilio.FlexApi.V1.GoodDataList} goodData - goodData resource
31
34
  * @property {Twilio.FlexApi.V1.InteractionList} interaction - interaction resource
35
+ * @property {Twilio.FlexApi.V1.UserRolesList} userRoles - userRoles resource
32
36
  * @property {Twilio.FlexApi.V1.WebChannelList} webChannel - webChannel resource
33
37
  *
34
38
  * @param {Twilio.FlexApi} domain - The twilio domain
@@ -41,7 +45,9 @@ function V1(domain) {
41
45
  this._channel = undefined;
42
46
  this._configuration = undefined;
43
47
  this._flexFlow = undefined;
48
+ this._goodData = undefined;
44
49
  this._interaction = undefined;
50
+ this._userRoles = undefined;
45
51
  this._webChannel = undefined;
46
52
  }
47
53
 
@@ -72,6 +78,14 @@ Object.defineProperty(V1.prototype,
72
78
  }
73
79
  });
74
80
 
81
+ Object.defineProperty(V1.prototype,
82
+ 'goodData', {
83
+ get: function() {
84
+ this._goodData = this._goodData || new GoodDataList(this);
85
+ return this._goodData;
86
+ }
87
+ });
88
+
75
89
  Object.defineProperty(V1.prototype,
76
90
  'interaction', {
77
91
  get: function() {
@@ -80,6 +94,14 @@ Object.defineProperty(V1.prototype,
80
94
  }
81
95
  });
82
96
 
97
+ Object.defineProperty(V1.prototype,
98
+ 'userRoles', {
99
+ get: function() {
100
+ this._userRoles = this._userRoles || new UserRolesList(this);
101
+ return this._userRoles;
102
+ }
103
+ });
104
+
83
105
  Object.defineProperty(V1.prototype,
84
106
  'webChannel', {
85
107
  get: function() {
@@ -0,0 +1,144 @@
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 GoodDataList
15
+ *
16
+ * @param version - Version of the resource
17
+ */
18
+ declare function GoodDataList(version: V1): GoodDataListInstance;
19
+
20
+ /**
21
+ * Options to pass to create
22
+ *
23
+ * @property token - The Token HTTP request header
24
+ */
25
+ interface GoodDataInstanceCreateOptions {
26
+ token?: string;
27
+ }
28
+
29
+ interface GoodDataListInstance {
30
+ /**
31
+ * @param sid - sid of instance
32
+ */
33
+ (sid: string): GoodDataContext;
34
+ /**
35
+ * Constructs a good_data
36
+ */
37
+ get(): GoodDataContext;
38
+ /**
39
+ * Provide a user-friendly representation
40
+ */
41
+ toJSON(): any;
42
+ }
43
+
44
+ interface GoodDataPayload extends GoodDataResource, Page.TwilioResponsePayload {
45
+ }
46
+
47
+ interface GoodDataResource {
48
+ gd_base_url: string;
49
+ session_expiry: string;
50
+ session_id: string;
51
+ url: string;
52
+ workspace_id: string;
53
+ }
54
+
55
+ interface GoodDataSolution {
56
+ }
57
+
58
+
59
+ declare class GoodDataContext {
60
+ /**
61
+ * Initialize the GoodDataContext
62
+ *
63
+ * @param version - Version of the resource
64
+ */
65
+ constructor(version: V1);
66
+
67
+ /**
68
+ * create a GoodDataInstance
69
+ *
70
+ * @param callback - Callback to handle processed record
71
+ */
72
+ create(callback?: (error: Error | null, item: GoodDataInstance) => any): Promise<GoodDataInstance>;
73
+ /**
74
+ * create a GoodDataInstance
75
+ *
76
+ * @param opts - Options for request
77
+ * @param callback - Callback to handle processed record
78
+ */
79
+ create(opts?: GoodDataInstanceCreateOptions, callback?: (error: Error | null, item: GoodDataInstance) => any): Promise<GoodDataInstance>;
80
+ /**
81
+ * Provide a user-friendly representation
82
+ */
83
+ toJSON(): any;
84
+ }
85
+
86
+
87
+ declare class GoodDataInstance extends SerializableClass {
88
+ /**
89
+ * Initialize the GoodDataContext
90
+ *
91
+ * @param version - Version of the resource
92
+ * @param payload - The instance payload
93
+ */
94
+ constructor(version: V1, payload: GoodDataPayload);
95
+
96
+ private _proxy: GoodDataContext;
97
+ /**
98
+ * create a GoodDataInstance
99
+ *
100
+ * @param callback - Callback to handle processed record
101
+ */
102
+ create(callback?: (error: Error | null, items: GoodDataInstance) => any): Promise<GoodDataInstance>;
103
+ /**
104
+ * create a GoodDataInstance
105
+ *
106
+ * @param opts - Options for request
107
+ * @param callback - Callback to handle processed record
108
+ */
109
+ create(opts?: GoodDataInstanceCreateOptions, callback?: (error: Error | null, items: GoodDataInstance) => any): Promise<GoodDataInstance>;
110
+ gdBaseUrl: string;
111
+ sessionExpiry: string;
112
+ sessionId: string;
113
+ /**
114
+ * Provide a user-friendly representation
115
+ */
116
+ toJSON(): any;
117
+ url: string;
118
+ workspaceId: string;
119
+ }
120
+
121
+
122
+ declare class GoodDataPage extends Page<V1, GoodDataPayload, GoodDataResource, GoodDataInstance> {
123
+ /**
124
+ * Initialize the GoodDataPage
125
+ *
126
+ * @param version - Version of the resource
127
+ * @param response - Response from the API
128
+ * @param solution - Path solution
129
+ */
130
+ constructor(version: V1, response: Response<string>, solution: GoodDataSolution);
131
+
132
+ /**
133
+ * Build an instance of GoodDataInstance
134
+ *
135
+ * @param payload - Payload response from the API
136
+ */
137
+ getInstance(payload: GoodDataPayload): GoodDataInstance;
138
+ /**
139
+ * Provide a user-friendly representation
140
+ */
141
+ toJSON(): any;
142
+ }
143
+
144
+ export { GoodDataContext, GoodDataInstance, GoodDataInstanceCreateOptions, GoodDataList, GoodDataListInstance, GoodDataPage, GoodDataPayload, GoodDataResource, GoodDataSolution }
@@ -0,0 +1,318 @@
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 GoodDataList;
19
+ var GoodDataPage;
20
+ var GoodDataInstance;
21
+ var GoodDataContext;
22
+
23
+ /* jshint ignore:start */
24
+ /**
25
+ * Initialize the GoodDataList
26
+ *
27
+ * @constructor Twilio.FlexApi.V1.GoodDataList
28
+ *
29
+ * @param {Twilio.FlexApi.V1} version - Version of the resource
30
+ */
31
+ /* jshint ignore:end */
32
+ GoodDataList = function GoodDataList(version) {
33
+ /* jshint ignore:start */
34
+ /**
35
+ * @function goodData
36
+ * @memberof Twilio.FlexApi.V1#
37
+ *
38
+ * @param {string} sid - sid of instance
39
+ *
40
+ * @returns {Twilio.FlexApi.V1.GoodDataContext}
41
+ */
42
+ /* jshint ignore:end */
43
+ function GoodDataListInstance(sid) {
44
+ return GoodDataListInstance.get(sid);
45
+ }
46
+
47
+ GoodDataListInstance._version = version;
48
+ // Path Solution
49
+ GoodDataListInstance._solution = {};
50
+ /* jshint ignore:start */
51
+ /**
52
+ * Constructs a good_data
53
+ *
54
+ * @function get
55
+ * @memberof Twilio.FlexApi.V1.GoodDataList#
56
+ *
57
+ * @returns {Twilio.FlexApi.V1.GoodDataContext}
58
+ */
59
+ /* jshint ignore:end */
60
+ GoodDataListInstance.get = function get() {
61
+ return new GoodDataContext(this._version);
62
+ };
63
+
64
+ /* jshint ignore:start */
65
+ /**
66
+ * Provide a user-friendly representation
67
+ *
68
+ * @function toJSON
69
+ * @memberof Twilio.FlexApi.V1.GoodDataList#
70
+ *
71
+ * @returns Object
72
+ */
73
+ /* jshint ignore:end */
74
+ GoodDataListInstance.toJSON = function toJSON() {
75
+ return this._solution;
76
+ };
77
+
78
+ GoodDataListInstance[util.inspect.custom] = function inspect(depth, options) {
79
+ return util.inspect(this.toJSON(), options);
80
+ };
81
+
82
+ return GoodDataListInstance;
83
+ };
84
+
85
+
86
+ /* jshint ignore:start */
87
+ /**
88
+ * Initialize the GoodDataPage
89
+ *
90
+ * @constructor Twilio.FlexApi.V1.GoodDataPage
91
+ *
92
+ * @param {V1} version - Version of the resource
93
+ * @param {Response<string>} response - Response from the API
94
+ * @param {GoodDataSolution} solution - Path solution
95
+ *
96
+ * @returns GoodDataPage
97
+ */
98
+ /* jshint ignore:end */
99
+ GoodDataPage = function GoodDataPage(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(GoodDataPage.prototype, Page.prototype);
107
+ GoodDataPage.prototype.constructor = GoodDataPage;
108
+
109
+ /* jshint ignore:start */
110
+ /**
111
+ * Build an instance of GoodDataInstance
112
+ *
113
+ * @function getInstance
114
+ * @memberof Twilio.FlexApi.V1.GoodDataPage#
115
+ *
116
+ * @param {GoodDataPayload} payload - Payload response from the API
117
+ *
118
+ * @returns GoodDataInstance
119
+ */
120
+ /* jshint ignore:end */
121
+ GoodDataPage.prototype.getInstance = function getInstance(payload) {
122
+ return new GoodDataInstance(this._version, payload);
123
+ };
124
+
125
+ /* jshint ignore:start */
126
+ /**
127
+ * Provide a user-friendly representation
128
+ *
129
+ * @function toJSON
130
+ * @memberof Twilio.FlexApi.V1.GoodDataPage#
131
+ *
132
+ * @returns Object
133
+ */
134
+ /* jshint ignore:end */
135
+ GoodDataPage.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
+ GoodDataPage.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 GoodDataContext
153
+ *
154
+ * @constructor Twilio.FlexApi.V1.GoodDataInstance
155
+ *
156
+ * @property {string} workspaceId - Unique workspace ID in gooddata
157
+ * @property {string} sessionExpiry - The session expiry date and time
158
+ * @property {string} sessionId - Unique session ID
159
+ * @property {string} gdBaseUrl - GoodData login base URL
160
+ * @property {string} url - The URL of this resource.
161
+ *
162
+ * @param {V1} version - Version of the resource
163
+ * @param {GoodDataPayload} payload - The instance payload
164
+ */
165
+ /* jshint ignore:end */
166
+ GoodDataInstance = function GoodDataInstance(version, payload) {
167
+ this._version = version;
168
+
169
+ // Marshaled Properties
170
+ this.workspaceId = payload.workspace_id; // jshint ignore:line
171
+ this.sessionExpiry = payload.session_expiry; // jshint ignore:line
172
+ this.sessionId = payload.session_id; // jshint ignore:line
173
+ this.gdBaseUrl = payload.gd_base_url; // jshint ignore:line
174
+ this.url = payload.url; // jshint ignore:line
175
+
176
+ // Context
177
+ this._context = undefined;
178
+ this._solution = {};
179
+ };
180
+
181
+ Object.defineProperty(GoodDataInstance.prototype,
182
+ '_proxy', {
183
+ get: function() {
184
+ if (!this._context) {
185
+ this._context = new GoodDataContext(this._version);
186
+ }
187
+
188
+ return this._context;
189
+ }
190
+ });
191
+
192
+ /* jshint ignore:start */
193
+ /**
194
+ * create a GoodDataInstance
195
+ *
196
+ * @function create
197
+ * @memberof Twilio.FlexApi.V1.GoodDataInstance#
198
+ *
199
+ * @param {object} [opts] - Options for request
200
+ * @param {string} [opts.token] - The Token HTTP request header
201
+ * @param {function} [callback] - Callback to handle processed record
202
+ *
203
+ * @returns {Promise} Resolves to processed GoodDataInstance
204
+ */
205
+ /* jshint ignore:end */
206
+ GoodDataInstance.prototype.create = function create(opts, callback) {
207
+ return this._proxy.create(opts, callback);
208
+ };
209
+
210
+ /* jshint ignore:start */
211
+ /**
212
+ * Provide a user-friendly representation
213
+ *
214
+ * @function toJSON
215
+ * @memberof Twilio.FlexApi.V1.GoodDataInstance#
216
+ *
217
+ * @returns Object
218
+ */
219
+ /* jshint ignore:end */
220
+ GoodDataInstance.prototype.toJSON = function toJSON() {
221
+ let clone = {};
222
+ _.forOwn(this, function(value, key) {
223
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
224
+ clone[key] = value;
225
+ }
226
+ });
227
+ return clone;
228
+ };
229
+
230
+ GoodDataInstance.prototype[util.inspect.custom] = function inspect(depth,
231
+ options) {
232
+ return util.inspect(this.toJSON(), options);
233
+ };
234
+
235
+
236
+ /* jshint ignore:start */
237
+ /**
238
+ * Initialize the GoodDataContext
239
+ *
240
+ * @constructor Twilio.FlexApi.V1.GoodDataContext
241
+ *
242
+ * @param {V1} version - Version of the resource
243
+ */
244
+ /* jshint ignore:end */
245
+ GoodDataContext = function GoodDataContext(version) {
246
+ this._version = version;
247
+
248
+ // Path Solution
249
+ this._solution = {};
250
+ this._uri = `/Accounts/GoodData`;
251
+ };
252
+
253
+ /* jshint ignore:start */
254
+ /**
255
+ * create a GoodDataInstance
256
+ *
257
+ * @function create
258
+ * @memberof Twilio.FlexApi.V1.GoodDataContext#
259
+ *
260
+ * @param {object} [opts] - Options for request
261
+ * @param {string} [opts.token] - The Token HTTP request header
262
+ * @param {function} [callback] - Callback to handle processed record
263
+ *
264
+ * @returns {Promise} Resolves to processed GoodDataInstance
265
+ */
266
+ /* jshint ignore:end */
267
+ GoodDataContext.prototype.create = function create(opts, callback) {
268
+ if (_.isFunction(opts)) {
269
+ callback = opts;
270
+ opts = {};
271
+ }
272
+ opts = opts || {};
273
+
274
+ var deferred = Q.defer();
275
+ var headers = values.of({'Token': _.get(opts, 'token')});
276
+
277
+ var promise = this._version.create({uri: this._uri, method: 'POST', headers: headers});
278
+
279
+ promise = promise.then(function(payload) {
280
+ deferred.resolve(new GoodDataInstance(this._version, payload));
281
+ }.bind(this));
282
+
283
+ promise.catch(function(error) {
284
+ deferred.reject(error);
285
+ });
286
+
287
+ if (_.isFunction(callback)) {
288
+ deferred.promise.nodeify(callback);
289
+ }
290
+
291
+ return deferred.promise;
292
+ };
293
+
294
+ /* jshint ignore:start */
295
+ /**
296
+ * Provide a user-friendly representation
297
+ *
298
+ * @function toJSON
299
+ * @memberof Twilio.FlexApi.V1.GoodDataContext#
300
+ *
301
+ * @returns Object
302
+ */
303
+ /* jshint ignore:end */
304
+ GoodDataContext.prototype.toJSON = function toJSON() {
305
+ return this._solution;
306
+ };
307
+
308
+ GoodDataContext.prototype[util.inspect.custom] = function inspect(depth,
309
+ options) {
310
+ return util.inspect(this.toJSON(), options);
311
+ };
312
+
313
+ module.exports = {
314
+ GoodDataList: GoodDataList,
315
+ GoodDataPage: GoodDataPage,
316
+ GoodDataInstance: GoodDataInstance,
317
+ GoodDataContext: GoodDataContext
318
+ };
@@ -0,0 +1,138 @@
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 UserRolesList
15
+ *
16
+ * @param version - Version of the resource
17
+ */
18
+ declare function UserRolesList(version: V1): UserRolesListInstance;
19
+
20
+ /**
21
+ * Options to pass to fetch
22
+ *
23
+ * @property token - The Token HTTP request header
24
+ */
25
+ interface UserRolesInstanceFetchOptions {
26
+ token?: string;
27
+ }
28
+
29
+ interface UserRolesListInstance {
30
+ /**
31
+ * @param sid - sid of instance
32
+ */
33
+ (sid: string): UserRolesContext;
34
+ /**
35
+ * Constructs a user_roles
36
+ */
37
+ get(): UserRolesContext;
38
+ /**
39
+ * Provide a user-friendly representation
40
+ */
41
+ toJSON(): any;
42
+ }
43
+
44
+ interface UserRolesPayload extends UserRolesResource, Page.TwilioResponsePayload {
45
+ }
46
+
47
+ interface UserRolesResource {
48
+ roles: string[];
49
+ url: string;
50
+ }
51
+
52
+ interface UserRolesSolution {
53
+ }
54
+
55
+
56
+ declare class UserRolesContext {
57
+ /**
58
+ * Initialize the UserRolesContext
59
+ *
60
+ * @param version - Version of the resource
61
+ */
62
+ constructor(version: V1);
63
+
64
+ /**
65
+ * fetch a UserRolesInstance
66
+ *
67
+ * @param callback - Callback to handle processed record
68
+ */
69
+ fetch(callback?: (error: Error | null, items: UserRolesInstance) => any): Promise<UserRolesInstance>;
70
+ /**
71
+ * fetch a UserRolesInstance
72
+ *
73
+ * @param opts - Options for request
74
+ * @param callback - Callback to handle processed record
75
+ */
76
+ fetch(opts?: UserRolesInstanceFetchOptions, callback?: (error: Error | null, items: UserRolesInstance) => any): Promise<UserRolesInstance>;
77
+ /**
78
+ * Provide a user-friendly representation
79
+ */
80
+ toJSON(): any;
81
+ }
82
+
83
+
84
+ declare class UserRolesInstance extends SerializableClass {
85
+ /**
86
+ * Initialize the UserRolesContext
87
+ *
88
+ * @param version - Version of the resource
89
+ * @param payload - The instance payload
90
+ */
91
+ constructor(version: V1, payload: UserRolesPayload);
92
+
93
+ private _proxy: UserRolesContext;
94
+ /**
95
+ * fetch a UserRolesInstance
96
+ *
97
+ * @param callback - Callback to handle processed record
98
+ */
99
+ fetch(callback?: (error: Error | null, items: UserRolesInstance) => any): Promise<UserRolesInstance>;
100
+ /**
101
+ * fetch a UserRolesInstance
102
+ *
103
+ * @param opts - Options for request
104
+ * @param callback - Callback to handle processed record
105
+ */
106
+ fetch(opts?: UserRolesInstanceFetchOptions, callback?: (error: Error | null, items: UserRolesInstance) => any): Promise<UserRolesInstance>;
107
+ roles: string[];
108
+ /**
109
+ * Provide a user-friendly representation
110
+ */
111
+ toJSON(): any;
112
+ url: string;
113
+ }
114
+
115
+
116
+ declare class UserRolesPage extends Page<V1, UserRolesPayload, UserRolesResource, UserRolesInstance> {
117
+ /**
118
+ * Initialize the UserRolesPage
119
+ *
120
+ * @param version - Version of the resource
121
+ * @param response - Response from the API
122
+ * @param solution - Path solution
123
+ */
124
+ constructor(version: V1, response: Response<string>, solution: UserRolesSolution);
125
+
126
+ /**
127
+ * Build an instance of UserRolesInstance
128
+ *
129
+ * @param payload - Payload response from the API
130
+ */
131
+ getInstance(payload: UserRolesPayload): UserRolesInstance;
132
+ /**
133
+ * Provide a user-friendly representation
134
+ */
135
+ toJSON(): any;
136
+ }
137
+
138
+ export { UserRolesContext, UserRolesInstance, UserRolesInstanceFetchOptions, UserRolesList, UserRolesListInstance, UserRolesPage, UserRolesPayload, UserRolesResource, UserRolesSolution }