twilio 3.83.2 → 3.83.4

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 (51) hide show
  1. package/LICENSE +1 -1
  2. package/lib/rest/Content.d.ts +26 -0
  3. package/lib/rest/Content.js +54 -0
  4. package/lib/rest/FlexApi.d.ts +2 -0
  5. package/lib/rest/FlexApi.js +8 -0
  6. package/lib/rest/Messaging.d.ts +4 -0
  7. package/lib/rest/Messaging.js +18 -0
  8. package/lib/rest/Preview.d.ts +0 -10
  9. package/lib/rest/Preview.js +0 -46
  10. package/lib/rest/Twilio.d.ts +2 -0
  11. package/lib/rest/Twilio.js +14 -0
  12. package/lib/rest/content/V1.d.ts +25 -0
  13. package/lib/rest/content/V1.js +46 -0
  14. package/lib/rest/content/v1/content/approvalFetch.d.ts +139 -0
  15. package/lib/rest/content/v1/content/approvalFetch.js +328 -0
  16. package/lib/rest/content/v1/content.d.ts +323 -0
  17. package/lib/rest/content/v1/content.js +668 -0
  18. package/lib/rest/flexApi/V1.d.ts +3 -0
  19. package/lib/rest/flexApi/V1.js +11 -0
  20. package/lib/rest/flexApi/v1/assessments.d.ts +113 -0
  21. package/lib/rest/flexApi/v1/assessments.js +300 -0
  22. package/lib/rest/flexApi/v1/goodData.d.ts +2 -0
  23. package/lib/rest/flexApi/v1/goodData.js +2 -0
  24. package/lib/rest/insights/v1/call/summary.d.ts +5 -1
  25. package/lib/rest/insights/v1/call/summary.js +2 -0
  26. package/lib/rest/insights/v1/callSummaries.d.ts +5 -1
  27. package/lib/rest/insights/v1/callSummaries.js +2 -0
  28. package/lib/rest/lookups/v2/phoneNumber.d.ts +22 -0
  29. package/lib/rest/lookups/v2/phoneNumber.js +43 -1
  30. package/lib/rest/messaging/V1.d.ts +6 -0
  31. package/lib/rest/messaging/V1.js +24 -0
  32. package/lib/rest/messaging/v1/domainCert.d.ts +178 -0
  33. package/lib/rest/messaging/v1/domainCert.js +447 -0
  34. package/lib/rest/messaging/v1/domainConfig.d.ts +172 -0
  35. package/lib/rest/messaging/v1/domainConfig.js +421 -0
  36. package/lib/rest/microvisor/v1/device.d.ts +2 -0
  37. package/lib/rest/microvisor/v1/device.js +2 -0
  38. package/lib/rest/serverless/v1/service/build.d.ts +1 -1
  39. package/package.json +1 -1
  40. package/lib/rest/preview/TrustedComms.d.ts +0 -34
  41. package/lib/rest/preview/TrustedComms.js +0 -84
  42. package/lib/rest/preview/trusted_comms/brandedChannel/channel.d.ts +0 -120
  43. package/lib/rest/preview/trusted_comms/brandedChannel/channel.js +0 -257
  44. package/lib/rest/preview/trusted_comms/brandedChannel.d.ts +0 -150
  45. package/lib/rest/preview/trusted_comms/brandedChannel.js +0 -362
  46. package/lib/rest/preview/trusted_comms/brandsInformation.d.ts +0 -158
  47. package/lib/rest/preview/trusted_comms/brandsInformation.js +0 -338
  48. package/lib/rest/preview/trusted_comms/cps.d.ts +0 -156
  49. package/lib/rest/preview/trusted_comms/cps.js +0 -332
  50. package/lib/rest/preview/trusted_comms/currentCall.d.ts +0 -180
  51. package/lib/rest/preview/trusted_comms/currentCall.js +0 -367
@@ -13,6 +13,8 @@ var _ = require('lodash'); /* jshint ignore:line */
13
13
  var BrandRegistrationList = require(
14
14
  './v1/brandRegistration').BrandRegistrationList;
15
15
  var DeactivationsList = require('./v1/deactivation').DeactivationsList;
16
+ var DomainCertsList = require('./v1/domainCert').DomainCertsList;
17
+ var DomainConfigList = require('./v1/domainConfig').DomainConfigList;
16
18
  var ExternalCampaignList = require(
17
19
  './v1/externalCampaign').ExternalCampaignList;
18
20
  var ServiceList = require('./v1/service').ServiceList;
@@ -32,6 +34,10 @@ var Version = require('../../base/Version'); /* jshint ignore:line */
32
34
  * brandRegistrations resource
33
35
  * @property {Twilio.Messaging.V1.DeactivationsList} deactivations -
34
36
  * deactivations resource
37
+ * @property {Twilio.Messaging.V1.DomainCertsList} domainCerts -
38
+ * domainCerts resource
39
+ * @property {Twilio.Messaging.V1.DomainConfigList} domainConfig -
40
+ * domainConfig resource
35
41
  * @property {Twilio.Messaging.V1.ExternalCampaignList} externalCampaign -
36
42
  * externalCampaign resource
37
43
  * @property {Twilio.Messaging.V1.ServiceList} services - services resource
@@ -48,6 +54,8 @@ function V1(domain) {
48
54
  // Resources
49
55
  this._brandRegistrations = undefined;
50
56
  this._deactivations = undefined;
57
+ this._domainCerts = undefined;
58
+ this._domainConfig = undefined;
51
59
  this._externalCampaign = undefined;
52
60
  this._services = undefined;
53
61
  this._tollfreeVerifications = undefined;
@@ -73,6 +81,22 @@ Object.defineProperty(V1.prototype,
73
81
  }
74
82
  });
75
83
 
84
+ Object.defineProperty(V1.prototype,
85
+ 'domainCerts', {
86
+ get: function() {
87
+ this._domainCerts = this._domainCerts || new DomainCertsList(this);
88
+ return this._domainCerts;
89
+ }
90
+ });
91
+
92
+ Object.defineProperty(V1.prototype,
93
+ 'domainConfig', {
94
+ get: function() {
95
+ this._domainConfig = this._domainConfig || new DomainConfigList(this);
96
+ return this._domainConfig;
97
+ }
98
+ });
99
+
76
100
  Object.defineProperty(V1.prototype,
77
101
  'externalCampaign', {
78
102
  get: function() {
@@ -0,0 +1,178 @@
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 DomainCertsList
15
+ *
16
+ * PLEASE NOTE that this class contains beta products that are subject to change.
17
+ * Use them with caution.
18
+ *
19
+ * @param version - Version of the resource
20
+ */
21
+ declare function DomainCertsList(version: V1): DomainCertsListInstance;
22
+
23
+ /**
24
+ * Options to pass to update
25
+ *
26
+ * @property tlsCert - Certificate and private key information for this domain.
27
+ */
28
+ interface DomainCertsInstanceUpdateOptions {
29
+ tlsCert: string;
30
+ }
31
+
32
+ interface DomainCertsListInstance {
33
+ /**
34
+ * @param sid - sid of instance
35
+ */
36
+ (sid: string): DomainCertsContext;
37
+ /**
38
+ * Constructs a domain_certs
39
+ *
40
+ * @param domainSid - Unique string used to identify the domain that this certificate should be associated with.
41
+ */
42
+ get(domainSid: string): DomainCertsContext;
43
+ /**
44
+ * Provide a user-friendly representation
45
+ */
46
+ toJSON(): any;
47
+ }
48
+
49
+ interface DomainCertsPayload extends DomainCertsResource, Page.TwilioResponsePayload {
50
+ }
51
+
52
+ interface DomainCertsResource {
53
+ certificate_sid: string;
54
+ date_created: Date;
55
+ date_expires: Date;
56
+ date_updated: Date;
57
+ domain_name: string;
58
+ domain_sid: string;
59
+ url: string;
60
+ validated: boolean;
61
+ }
62
+
63
+ interface DomainCertsSolution {
64
+ }
65
+
66
+
67
+ declare class DomainCertsContext {
68
+ /**
69
+ * Initialize the DomainCertsContext
70
+ *
71
+ * PLEASE NOTE that this class contains beta products that are subject to change.
72
+ * Use them with caution.
73
+ *
74
+ * @param version - Version of the resource
75
+ * @param domainSid - Unique string used to identify the domain that this certificate should be associated with.
76
+ */
77
+ constructor(version: V1, domainSid: string);
78
+
79
+ /**
80
+ * fetch a DomainCertsInstance
81
+ *
82
+ * @param callback - Callback to handle processed record
83
+ */
84
+ fetch(callback?: (error: Error | null, items: DomainCertsInstance) => any): Promise<DomainCertsInstance>;
85
+ /**
86
+ * remove a DomainCertsInstance
87
+ *
88
+ * @param callback - Callback to handle processed record
89
+ */
90
+ remove(callback?: (error: Error | null, items: DomainCertsInstance) => any): Promise<boolean>;
91
+ /**
92
+ * Provide a user-friendly representation
93
+ */
94
+ toJSON(): any;
95
+ /**
96
+ * update a DomainCertsInstance
97
+ *
98
+ * @param opts - Options for request
99
+ * @param callback - Callback to handle processed record
100
+ */
101
+ update(opts: DomainCertsInstanceUpdateOptions, callback?: (error: Error | null, items: DomainCertsInstance) => any): Promise<DomainCertsInstance>;
102
+ }
103
+
104
+
105
+ declare class DomainCertsInstance extends SerializableClass {
106
+ /**
107
+ * Initialize the DomainCertsContext
108
+ *
109
+ * PLEASE NOTE that this class contains beta products that are subject to change.
110
+ * Use them with caution.
111
+ *
112
+ * @param version - Version of the resource
113
+ * @param payload - The instance payload
114
+ * @param domainSid - Unique string used to identify the domain that this certificate should be associated with.
115
+ */
116
+ constructor(version: V1, payload: DomainCertsPayload, domainSid: string);
117
+
118
+ private _proxy: DomainCertsContext;
119
+ certificateSid: string;
120
+ dateCreated: Date;
121
+ dateExpires: Date;
122
+ dateUpdated: Date;
123
+ domainName: string;
124
+ domainSid: string;
125
+ /**
126
+ * fetch a DomainCertsInstance
127
+ *
128
+ * @param callback - Callback to handle processed record
129
+ */
130
+ fetch(callback?: (error: Error | null, items: DomainCertsInstance) => any): Promise<DomainCertsInstance>;
131
+ /**
132
+ * remove a DomainCertsInstance
133
+ *
134
+ * @param callback - Callback to handle processed record
135
+ */
136
+ remove(callback?: (error: Error | null, items: DomainCertsInstance) => any): Promise<boolean>;
137
+ /**
138
+ * Provide a user-friendly representation
139
+ */
140
+ toJSON(): any;
141
+ /**
142
+ * update a DomainCertsInstance
143
+ *
144
+ * @param opts - Options for request
145
+ * @param callback - Callback to handle processed record
146
+ */
147
+ update(opts: DomainCertsInstanceUpdateOptions, callback?: (error: Error | null, items: DomainCertsInstance) => any): Promise<DomainCertsInstance>;
148
+ url: string;
149
+ validated: boolean;
150
+ }
151
+
152
+
153
+ declare class DomainCertsPage extends Page<V1, DomainCertsPayload, DomainCertsResource, DomainCertsInstance> {
154
+ /**
155
+ * Initialize the DomainCertsPage
156
+ *
157
+ * PLEASE NOTE that this class contains beta products that are subject to change.
158
+ * Use them with caution.
159
+ *
160
+ * @param version - Version of the resource
161
+ * @param response - Response from the API
162
+ * @param solution - Path solution
163
+ */
164
+ constructor(version: V1, response: Response<string>, solution: DomainCertsSolution);
165
+
166
+ /**
167
+ * Build an instance of DomainCertsInstance
168
+ *
169
+ * @param payload - Payload response from the API
170
+ */
171
+ getInstance(payload: DomainCertsPayload): DomainCertsInstance;
172
+ /**
173
+ * Provide a user-friendly representation
174
+ */
175
+ toJSON(): any;
176
+ }
177
+
178
+ export { DomainCertsContext, DomainCertsInstance, DomainCertsInstanceUpdateOptions, DomainCertsList, DomainCertsListInstance, DomainCertsPage, DomainCertsPayload, DomainCertsResource, DomainCertsSolution }
@@ -0,0 +1,447 @@
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 DomainCertsList;
21
+ var DomainCertsPage;
22
+ var DomainCertsInstance;
23
+ var DomainCertsContext;
24
+
25
+ /* jshint ignore:start */
26
+ /**
27
+ * Initialize the DomainCertsList
28
+ *
29
+ * PLEASE NOTE that this class contains beta products that are subject to change.
30
+ * Use them with caution.
31
+ *
32
+ * @constructor Twilio.Messaging.V1.DomainCertsList
33
+ *
34
+ * @param {Twilio.Messaging.V1} version - Version of the resource
35
+ */
36
+ /* jshint ignore:end */
37
+ DomainCertsList = function DomainCertsList(version) {
38
+ /* jshint ignore:start */
39
+ /**
40
+ * @function domainCerts
41
+ * @memberof Twilio.Messaging.V1#
42
+ *
43
+ * @param {string} sid - sid of instance
44
+ *
45
+ * @returns {Twilio.Messaging.V1.DomainCertsContext}
46
+ */
47
+ /* jshint ignore:end */
48
+ function DomainCertsListInstance(sid) {
49
+ return DomainCertsListInstance.get(sid);
50
+ }
51
+
52
+ DomainCertsListInstance._version = version;
53
+ // Path Solution
54
+ DomainCertsListInstance._solution = {};
55
+ /* jshint ignore:start */
56
+ /**
57
+ * Constructs a domain_certs
58
+ *
59
+ * @function get
60
+ * @memberof Twilio.Messaging.V1.DomainCertsList#
61
+ *
62
+ * @param {string} domainSid -
63
+ * Unique string used to identify the domain that this certificate should be associated with.
64
+ *
65
+ * @returns {Twilio.Messaging.V1.DomainCertsContext}
66
+ */
67
+ /* jshint ignore:end */
68
+ DomainCertsListInstance.get = function get(domainSid) {
69
+ return new DomainCertsContext(this._version, domainSid);
70
+ };
71
+
72
+ /* jshint ignore:start */
73
+ /**
74
+ * Provide a user-friendly representation
75
+ *
76
+ * @function toJSON
77
+ * @memberof Twilio.Messaging.V1.DomainCertsList#
78
+ *
79
+ * @returns Object
80
+ */
81
+ /* jshint ignore:end */
82
+ DomainCertsListInstance.toJSON = function toJSON() {
83
+ return this._solution;
84
+ };
85
+
86
+ DomainCertsListInstance[util.inspect.custom] = function inspect(depth, options)
87
+ {
88
+ return util.inspect(this.toJSON(), options);
89
+ };
90
+
91
+ return DomainCertsListInstance;
92
+ };
93
+
94
+
95
+ /* jshint ignore:start */
96
+ /**
97
+ * Initialize the DomainCertsPage
98
+ *
99
+ * PLEASE NOTE that this class contains beta products that are subject to change.
100
+ * Use them with caution.
101
+ *
102
+ * @constructor Twilio.Messaging.V1.DomainCertsPage
103
+ *
104
+ * @param {V1} version - Version of the resource
105
+ * @param {Response<string>} response - Response from the API
106
+ * @param {DomainCertsSolution} solution - Path solution
107
+ *
108
+ * @returns DomainCertsPage
109
+ */
110
+ /* jshint ignore:end */
111
+ DomainCertsPage = function DomainCertsPage(version, response, solution) {
112
+ // Path Solution
113
+ this._solution = solution;
114
+
115
+ Page.prototype.constructor.call(this, version, response, this._solution);
116
+ };
117
+
118
+ _.extend(DomainCertsPage.prototype, Page.prototype);
119
+ DomainCertsPage.prototype.constructor = DomainCertsPage;
120
+
121
+ /* jshint ignore:start */
122
+ /**
123
+ * Build an instance of DomainCertsInstance
124
+ *
125
+ * @function getInstance
126
+ * @memberof Twilio.Messaging.V1.DomainCertsPage#
127
+ *
128
+ * @param {DomainCertsPayload} payload - Payload response from the API
129
+ *
130
+ * @returns DomainCertsInstance
131
+ */
132
+ /* jshint ignore:end */
133
+ DomainCertsPage.prototype.getInstance = function getInstance(payload) {
134
+ return new DomainCertsInstance(this._version, payload);
135
+ };
136
+
137
+ /* jshint ignore:start */
138
+ /**
139
+ * Provide a user-friendly representation
140
+ *
141
+ * @function toJSON
142
+ * @memberof Twilio.Messaging.V1.DomainCertsPage#
143
+ *
144
+ * @returns Object
145
+ */
146
+ /* jshint ignore:end */
147
+ DomainCertsPage.prototype.toJSON = function toJSON() {
148
+ let clone = {};
149
+ _.forOwn(this, function(value, key) {
150
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
151
+ clone[key] = value;
152
+ }
153
+ });
154
+ return clone;
155
+ };
156
+
157
+ DomainCertsPage.prototype[util.inspect.custom] = function inspect(depth,
158
+ options) {
159
+ return util.inspect(this.toJSON(), options);
160
+ };
161
+
162
+
163
+ /* jshint ignore:start */
164
+ /**
165
+ * Initialize the DomainCertsContext
166
+ *
167
+ * PLEASE NOTE that this class contains beta products that are subject to change.
168
+ * Use them with caution.
169
+ *
170
+ * @constructor Twilio.Messaging.V1.DomainCertsInstance
171
+ *
172
+ * @property {string} domainSid -
173
+ * The unique string that we created to identify the Domain resource.
174
+ * @property {Date} dateUpdated - Date that this Domain was last updated.
175
+ * @property {Date} dateExpires - Expiration date for your private certificate.
176
+ * @property {Date} dateCreated - Date this Domain SID was created.
177
+ * @property {string} domainName - Full url path for this domain.
178
+ * @property {string} certificateSid -
179
+ * The unique string that we created to identify this Certificate resource.
180
+ * @property {string} url - The url
181
+ * @property {boolean} validated - Certificate validation field
182
+ *
183
+ * @param {V1} version - Version of the resource
184
+ * @param {DomainCertsPayload} payload - The instance payload
185
+ * @param {sid} domainSid -
186
+ * Unique string used to identify the domain that this certificate should be associated with.
187
+ */
188
+ /* jshint ignore:end */
189
+ DomainCertsInstance = function DomainCertsInstance(version, payload, domainSid)
190
+ {
191
+ this._version = version;
192
+
193
+ // Marshaled Properties
194
+ this.domainSid = payload.domain_sid; // jshint ignore:line
195
+ this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line
196
+ this.dateExpires = deserialize.iso8601DateTime(payload.date_expires); // jshint ignore:line
197
+ this.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line
198
+ this.domainName = payload.domain_name; // jshint ignore:line
199
+ this.certificateSid = payload.certificate_sid; // jshint ignore:line
200
+ this.url = payload.url; // jshint ignore:line
201
+ this.validated = payload.validated; // jshint ignore:line
202
+
203
+ // Context
204
+ this._context = undefined;
205
+ this._solution = {domainSid: domainSid || this.domainSid, };
206
+ };
207
+
208
+ Object.defineProperty(DomainCertsInstance.prototype,
209
+ '_proxy', {
210
+ get: function() {
211
+ if (!this._context) {
212
+ this._context = new DomainCertsContext(this._version, this._solution.domainSid);
213
+ }
214
+
215
+ return this._context;
216
+ }
217
+ });
218
+
219
+ /* jshint ignore:start */
220
+ /**
221
+ * update a DomainCertsInstance
222
+ *
223
+ * @function update
224
+ * @memberof Twilio.Messaging.V1.DomainCertsInstance#
225
+ *
226
+ * @param {object} opts - Options for request
227
+ * @param {string} opts.tlsCert -
228
+ * Certificate and private key information for this domain.
229
+ * @param {function} [callback] - Callback to handle processed record
230
+ *
231
+ * @returns {Promise} Resolves to processed DomainCertsInstance
232
+ */
233
+ /* jshint ignore:end */
234
+ DomainCertsInstance.prototype.update = function update(opts, callback) {
235
+ return this._proxy.update(opts, callback);
236
+ };
237
+
238
+ /* jshint ignore:start */
239
+ /**
240
+ * fetch a DomainCertsInstance
241
+ *
242
+ * @function fetch
243
+ * @memberof Twilio.Messaging.V1.DomainCertsInstance#
244
+ *
245
+ * @param {function} [callback] - Callback to handle processed record
246
+ *
247
+ * @returns {Promise} Resolves to processed DomainCertsInstance
248
+ */
249
+ /* jshint ignore:end */
250
+ DomainCertsInstance.prototype.fetch = function fetch(callback) {
251
+ return this._proxy.fetch(callback);
252
+ };
253
+
254
+ /* jshint ignore:start */
255
+ /**
256
+ * remove a DomainCertsInstance
257
+ *
258
+ * @function remove
259
+ * @memberof Twilio.Messaging.V1.DomainCertsInstance#
260
+ *
261
+ * @param {function} [callback] - Callback to handle processed record
262
+ *
263
+ * @returns {Promise} Resolves to processed DomainCertsInstance
264
+ */
265
+ /* jshint ignore:end */
266
+ DomainCertsInstance.prototype.remove = function remove(callback) {
267
+ return this._proxy.remove(callback);
268
+ };
269
+
270
+ /* jshint ignore:start */
271
+ /**
272
+ * Provide a user-friendly representation
273
+ *
274
+ * @function toJSON
275
+ * @memberof Twilio.Messaging.V1.DomainCertsInstance#
276
+ *
277
+ * @returns Object
278
+ */
279
+ /* jshint ignore:end */
280
+ DomainCertsInstance.prototype.toJSON = function toJSON() {
281
+ let clone = {};
282
+ _.forOwn(this, function(value, key) {
283
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
284
+ clone[key] = value;
285
+ }
286
+ });
287
+ return clone;
288
+ };
289
+
290
+ DomainCertsInstance.prototype[util.inspect.custom] = function inspect(depth,
291
+ options) {
292
+ return util.inspect(this.toJSON(), options);
293
+ };
294
+
295
+
296
+ /* jshint ignore:start */
297
+ /**
298
+ * Initialize the DomainCertsContext
299
+ *
300
+ * PLEASE NOTE that this class contains beta products that are subject to change.
301
+ * Use them with caution.
302
+ *
303
+ * @constructor Twilio.Messaging.V1.DomainCertsContext
304
+ *
305
+ * @param {V1} version - Version of the resource
306
+ * @param {sid} domainSid -
307
+ * Unique string used to identify the domain that this certificate should be associated with.
308
+ */
309
+ /* jshint ignore:end */
310
+ DomainCertsContext = function DomainCertsContext(version, domainSid) {
311
+ this._version = version;
312
+
313
+ // Path Solution
314
+ this._solution = {domainSid: domainSid, };
315
+ this._uri = `/LinkShortening/Domains/${domainSid}/Certificate`;
316
+ };
317
+
318
+ /* jshint ignore:start */
319
+ /**
320
+ * update a DomainCertsInstance
321
+ *
322
+ * @function update
323
+ * @memberof Twilio.Messaging.V1.DomainCertsContext#
324
+ *
325
+ * @param {object} opts - Options for request
326
+ * @param {string} opts.tlsCert -
327
+ * Certificate and private key information for this domain.
328
+ * @param {function} [callback] - Callback to handle processed record
329
+ *
330
+ * @returns {Promise} Resolves to processed DomainCertsInstance
331
+ */
332
+ /* jshint ignore:end */
333
+ DomainCertsContext.prototype.update = function update(opts, callback) {
334
+ if (_.isUndefined(opts)) {
335
+ throw new Error('Required parameter "opts" missing.');
336
+ }
337
+ if (_.isUndefined(opts['tlsCert'])) {
338
+ throw new Error('Required parameter "opts[\'tlsCert\']" missing.');
339
+ }
340
+
341
+ var deferred = Q.defer();
342
+ var data = values.of({'TlsCert': _.get(opts, 'tlsCert')});
343
+
344
+ var promise = this._version.update({uri: this._uri, method: 'POST', data: data});
345
+
346
+ promise = promise.then(function(payload) {
347
+ deferred.resolve(new DomainCertsInstance(this._version, payload, this._solution.domainSid));
348
+ }.bind(this));
349
+
350
+ promise.catch(function(error) {
351
+ deferred.reject(error);
352
+ });
353
+
354
+ if (_.isFunction(callback)) {
355
+ deferred.promise.nodeify(callback);
356
+ }
357
+
358
+ return deferred.promise;
359
+ };
360
+
361
+ /* jshint ignore:start */
362
+ /**
363
+ * fetch a DomainCertsInstance
364
+ *
365
+ * @function fetch
366
+ * @memberof Twilio.Messaging.V1.DomainCertsContext#
367
+ *
368
+ * @param {function} [callback] - Callback to handle processed record
369
+ *
370
+ * @returns {Promise} Resolves to processed DomainCertsInstance
371
+ */
372
+ /* jshint ignore:end */
373
+ DomainCertsContext.prototype.fetch = function fetch(callback) {
374
+ var deferred = Q.defer();
375
+ var promise = this._version.fetch({uri: this._uri, method: 'GET'});
376
+
377
+ promise = promise.then(function(payload) {
378
+ deferred.resolve(new DomainCertsInstance(this._version, payload, this._solution.domainSid));
379
+ }.bind(this));
380
+
381
+ promise.catch(function(error) {
382
+ deferred.reject(error);
383
+ });
384
+
385
+ if (_.isFunction(callback)) {
386
+ deferred.promise.nodeify(callback);
387
+ }
388
+
389
+ return deferred.promise;
390
+ };
391
+
392
+ /* jshint ignore:start */
393
+ /**
394
+ * remove a DomainCertsInstance
395
+ *
396
+ * @function remove
397
+ * @memberof Twilio.Messaging.V1.DomainCertsContext#
398
+ *
399
+ * @param {function} [callback] - Callback to handle processed record
400
+ *
401
+ * @returns {Promise} Resolves to processed DomainCertsInstance
402
+ */
403
+ /* jshint ignore:end */
404
+ DomainCertsContext.prototype.remove = function remove(callback) {
405
+ var deferred = Q.defer();
406
+ var promise = this._version.remove({uri: this._uri, method: 'DELETE'});
407
+
408
+ promise = promise.then(function(payload) {
409
+ deferred.resolve(payload);
410
+ }.bind(this));
411
+
412
+ promise.catch(function(error) {
413
+ deferred.reject(error);
414
+ });
415
+
416
+ if (_.isFunction(callback)) {
417
+ deferred.promise.nodeify(callback);
418
+ }
419
+
420
+ return deferred.promise;
421
+ };
422
+
423
+ /* jshint ignore:start */
424
+ /**
425
+ * Provide a user-friendly representation
426
+ *
427
+ * @function toJSON
428
+ * @memberof Twilio.Messaging.V1.DomainCertsContext#
429
+ *
430
+ * @returns Object
431
+ */
432
+ /* jshint ignore:end */
433
+ DomainCertsContext.prototype.toJSON = function toJSON() {
434
+ return this._solution;
435
+ };
436
+
437
+ DomainCertsContext.prototype[util.inspect.custom] = function inspect(depth,
438
+ options) {
439
+ return util.inspect(this.toJSON(), options);
440
+ };
441
+
442
+ module.exports = {
443
+ DomainCertsList: DomainCertsList,
444
+ DomainCertsPage: DomainCertsPage,
445
+ DomainCertsInstance: DomainCertsInstance,
446
+ DomainCertsContext: DomainCertsContext
447
+ };