twilio 3.67.2 → 3.71.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 (81) hide show
  1. package/CHANGES.md +97 -0
  2. package/README.md +1 -1
  3. package/lib/base/RequestClient.js +1 -0
  4. package/lib/jwt/AccessToken.d.ts +16 -0
  5. package/lib/jwt/AccessToken.js +20 -0
  6. package/lib/rest/Media.d.ts +28 -0
  7. package/lib/rest/Media.js +64 -0
  8. package/lib/rest/Twilio.d.ts +2 -0
  9. package/lib/rest/Twilio.js +14 -0
  10. package/lib/rest/Verify.d.ts +2 -2
  11. package/lib/rest/Verify.js +3 -4
  12. package/lib/rest/api/v2010/account/call/siprec.d.ts +776 -0
  13. package/lib/rest/api/v2010/account/call/siprec.js +811 -0
  14. package/lib/rest/api/v2010/account/call.d.ts +7 -0
  15. package/lib/rest/api/v2010/account/call.js +28 -0
  16. package/lib/rest/api/v2010/account/incomingPhoneNumber/local.d.ts +6 -2
  17. package/lib/rest/api/v2010/account/incomingPhoneNumber/local.js +5 -2
  18. package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.d.ts +6 -2
  19. package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.js +5 -2
  20. package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.d.ts +6 -2
  21. package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.js +5 -2
  22. package/lib/rest/api/v2010/account/incomingPhoneNumber.d.ts +7 -3
  23. package/lib/rest/api/v2010/account/incomingPhoneNumber.js +7 -4
  24. package/lib/rest/conversations/v1/service/configuration/notification.d.ts +6 -0
  25. package/lib/rest/conversations/v1/service/configuration/notification.js +11 -1
  26. package/lib/rest/events/v1/sink.d.ts +1 -1
  27. package/lib/rest/flexApi/v1/configuration.d.ts +2 -0
  28. package/lib/rest/flexApi/v1/configuration.js +2 -0
  29. package/lib/rest/insights/v1/callSummaries.d.ts +27 -27
  30. package/lib/rest/insights/v1/callSummaries.js +36 -36
  31. package/lib/rest/media/V1.d.ts +28 -0
  32. package/lib/rest/media/V1.js +59 -0
  33. package/lib/rest/media/v1/mediaProcessor.d.ts +355 -0
  34. package/lib/rest/media/v1/mediaProcessor.js +702 -0
  35. package/lib/rest/media/v1/playerStreamer/playbackGrant.d.ts +162 -0
  36. package/lib/rest/media/v1/playerStreamer/playbackGrant.js +384 -0
  37. package/lib/rest/media/v1/playerStreamer.d.ts +366 -0
  38. package/lib/rest/media/v1/playerStreamer.js +729 -0
  39. package/lib/rest/messaging/v1/brandRegistration/brandVetting.d.ts +286 -0
  40. package/lib/rest/messaging/v1/brandRegistration/brandVetting.js +521 -0
  41. package/lib/rest/messaging/v1/brandRegistration.d.ts +27 -2
  42. package/lib/rest/messaging/v1/brandRegistration.js +48 -2
  43. package/lib/rest/messaging/v1/service.d.ts +8 -0
  44. package/lib/rest/messaging/v1/service.js +14 -0
  45. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.d.ts +133 -0
  46. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.js +268 -0
  47. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.d.ts +127 -0
  48. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.js +271 -0
  49. package/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts +14 -0
  50. package/lib/rest/numbers/v2/regulatoryCompliance/bundle.js +56 -0
  51. package/lib/rest/serverless/v1/service/build.d.ts +1 -1
  52. package/lib/rest/serverless/v1/service/environment.js +1 -1
  53. package/lib/rest/serverless/v1/service.d.ts +2 -0
  54. package/lib/rest/serverless/v1/service.js +3 -0
  55. package/lib/rest/taskrouter/v1/workspace/task/reservation.d.ts +2 -0
  56. package/lib/rest/taskrouter/v1/workspace/task/reservation.js +4 -1
  57. package/lib/rest/taskrouter/v1/workspace/worker/reservation.d.ts +2 -0
  58. package/lib/rest/taskrouter/v1/workspace/worker/reservation.js +4 -1
  59. package/lib/rest/taskrouter/v1/workspace/worker.d.ts +27 -2
  60. package/lib/rest/taskrouter/v1/workspace/worker.js +22 -7
  61. package/lib/rest/trunking/v1/trunk.d.ts +9 -1
  62. package/lib/rest/trunking/v1/trunk.js +13 -2
  63. package/lib/rest/verify/V2.d.ts +3 -3
  64. package/lib/rest/verify/V2.js +6 -8
  65. package/lib/rest/verify/v2/service/entity/factor.d.ts +1 -1
  66. package/lib/rest/verify/v2/service/entity/factor.js +2 -2
  67. package/lib/rest/verify/v2/service/entity/newFactor.d.ts +1 -1
  68. package/lib/rest/verify/v2/service/entity/newFactor.js +1 -1
  69. package/lib/rest/verify/v2/service/verification.d.ts +5 -1
  70. package/lib/rest/verify/v2/service/verification.js +7 -2
  71. package/lib/rest/verify/v2/service.d.ts +6 -0
  72. package/lib/rest/verify/v2/service.js +12 -2
  73. package/lib/rest/verify/v2/{verificationTemplate.d.ts → template.d.ts} +35 -37
  74. package/lib/rest/verify/v2/{verificationTemplate.js → template.js} +58 -64
  75. package/lib/rest/video/v1/room.d.ts +4 -0
  76. package/lib/rest/video/v1/room.js +7 -1
  77. package/lib/rest/wireless/v1/ratePlan.d.ts +1 -1
  78. package/lib/rest/wireless/v1/ratePlan.js +3 -3
  79. package/lib/rest/wireless/v1/sim.d.ts +4 -4
  80. package/lib/rest/wireless/v1/sim.js +18 -24
  81. package/package.json +2 -2
@@ -12,6 +12,8 @@
12
12
  var Q = require('q'); /* jshint ignore:line */
13
13
  var _ = require('lodash'); /* jshint ignore:line */
14
14
  var util = require('util'); /* jshint ignore:line */
15
+ var BrandVettingList = require(
16
+ './brandRegistration/brandVetting').BrandVettingList;
15
17
  var Page = require('../../../base/Page'); /* jshint ignore:line */
16
18
  var deserialize = require(
17
19
  '../../../base/deserialize'); /* jshint ignore:line */
@@ -310,6 +312,7 @@ BrandRegistrationList = function BrandRegistrationList(version) {
310
312
  * Type of brand being created. One of: "STANDARD", "STARTER".
311
313
  * @param {boolean} [opts.mock] -
312
314
  * A boolean that specifies whether brand should be a mock or not. If true, brand will be registered as a mock brand. Defaults to false if no value is provided.
315
+ * @param {boolean} [opts.skipAutomaticSecVet] - Skip Automatic Secondary Vetting
313
316
  * @param {function} [callback] - Callback to handle processed record
314
317
  *
315
318
  * @returns {Promise} Resolves to processed BrandRegistrationInstance
@@ -331,7 +334,8 @@ BrandRegistrationList = function BrandRegistrationList(version) {
331
334
  'CustomerProfileBundleSid': _.get(opts, 'customerProfileBundleSid'),
332
335
  'A2PProfileBundleSid': _.get(opts, 'a2PProfileBundleSid'),
333
336
  'BrandType': _.get(opts, 'brandType'),
334
- 'Mock': serialize.bool(_.get(opts, 'mock'))
337
+ 'Mock': serialize.bool(_.get(opts, 'mock')),
338
+ 'SkipAutomaticSecVet': serialize.bool(_.get(opts, 'skipAutomaticSecVet'))
335
339
  });
336
340
 
337
341
  var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
@@ -478,13 +482,19 @@ BrandRegistrationPage.prototype[util.inspect.custom] = function inspect(depth,
478
482
  * @property {Date} dateUpdated -
479
483
  * The ISO 8601 date and time in GMT when the resource was last updated
480
484
  * @property {string} brandType - Type of brand. One of: "STANDARD", "STARTER".
481
- * @property {brand_registration.status} status - Brand Registration status
485
+ * @property {brand_registration.status} status - Brand Registration status.
482
486
  * @property {string} tcrId - Campaign Registry (TCR) Brand ID
483
487
  * @property {string} failureReason - A reason why brand registration has failed
484
488
  * @property {string} url - The absolute URL of the Brand Registration
485
489
  * @property {number} brandScore - Brand score
490
+ * @property {brand_registration.brand_feedback} brandFeedback - Brand feedback
491
+ * @property {brand_registration.identity_status} identityStatus - Identity Status
492
+ * @property {boolean} russell3000 - Russell 3000
493
+ * @property {string} taxExemptStatus - Tax Exempt Status
494
+ * @property {boolean} skipAutomaticSecVet - Skip Automatic Secondary Vetting
486
495
  * @property {boolean} mock -
487
496
  * A boolean that specifies whether brand should be a mock or not. If true, brand will be registered as a mock brand. Defaults to false if no value is provided.
497
+ * @property {string} links - The links
488
498
  *
489
499
  * @param {V1} version - Version of the resource
490
500
  * @param {BrandRegistrationPayload} payload - The instance payload
@@ -508,7 +518,13 @@ BrandRegistrationInstance = function BrandRegistrationInstance(version, payload,
508
518
  this.failureReason = payload.failure_reason; // jshint ignore:line
509
519
  this.url = payload.url; // jshint ignore:line
510
520
  this.brandScore = deserialize.integer(payload.brand_score); // jshint ignore:line
521
+ this.brandFeedback = payload.brand_feedback; // jshint ignore:line
522
+ this.identityStatus = payload.identity_status; // jshint ignore:line
523
+ this.russell3000 = payload.russell_3000; // jshint ignore:line
524
+ this.taxExemptStatus = payload.tax_exempt_status; // jshint ignore:line
525
+ this.skipAutomaticSecVet = payload.skip_automatic_sec_vet; // jshint ignore:line
511
526
  this.mock = payload.mock; // jshint ignore:line
527
+ this.links = payload.links; // jshint ignore:line
512
528
 
513
529
  // Context
514
530
  this._context = undefined;
@@ -542,6 +558,20 @@ BrandRegistrationInstance.prototype.fetch = function fetch(callback) {
542
558
  return this._proxy.fetch(callback);
543
559
  };
544
560
 
561
+ /* jshint ignore:start */
562
+ /**
563
+ * Access the brandVettings
564
+ *
565
+ * @function brandVettings
566
+ * @memberof Twilio.Messaging.V1.BrandRegistrationInstance#
567
+ *
568
+ * @returns {Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingList}
569
+ */
570
+ /* jshint ignore:end */
571
+ BrandRegistrationInstance.prototype.brandVettings = function brandVettings() {
572
+ return this._proxy.brandVettings;
573
+ };
574
+
545
575
  /* jshint ignore:start */
546
576
  /**
547
577
  * Provide a user-friendly representation
@@ -577,6 +607,9 @@ BrandRegistrationInstance.prototype[util.inspect.custom] = function
577
607
  *
578
608
  * @constructor Twilio.Messaging.V1.BrandRegistrationContext
579
609
  *
610
+ * @property {Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingList} brandVettings -
611
+ * brandVettings resource
612
+ *
580
613
  * @param {V1} version - Version of the resource
581
614
  * @param {sid} sid - The SID that identifies the resource to fetch
582
615
  */
@@ -587,6 +620,9 @@ BrandRegistrationContext = function BrandRegistrationContext(version, sid) {
587
620
  // Path Solution
588
621
  this._solution = {sid: sid, };
589
622
  this._uri = `/a2p/BrandRegistrations/${sid}`;
623
+
624
+ // Dependents
625
+ this._brandVettings = undefined;
590
626
  };
591
627
 
592
628
  /* jshint ignore:start */
@@ -620,6 +656,16 @@ BrandRegistrationContext.prototype.fetch = function fetch(callback) {
620
656
  return deferred.promise;
621
657
  };
622
658
 
659
+ Object.defineProperty(BrandRegistrationContext.prototype,
660
+ 'brandVettings', {
661
+ get: function() {
662
+ if (!this._brandVettings) {
663
+ this._brandVettings = new BrandVettingList(this._version, this._solution.sid);
664
+ }
665
+ return this._brandVettings;
666
+ }
667
+ });
668
+
623
669
  /* jshint ignore:start */
624
670
  /**
625
671
  * Provide a user-friendly representation
@@ -49,6 +49,7 @@ declare function ServiceList(version: V1): ServiceListInstance;
49
49
  * @property stickySender - Whether to enable Sticky Sender on the Service instance
50
50
  * @property synchronousValidation - Reserved
51
51
  * @property useInboundWebhookOnNumber - If enabled, the webhook url configured on the phone number will be used and will override the `inbound_request_url`/`fallback_url` url called when an inbound message is received.
52
+ * @property usecase - A string describing the scenario in which the Messaging Service will be used
52
53
  * @property validityPeriod - How long, in seconds, messages sent from the Service are valid
53
54
  */
54
55
  interface ServiceInstanceUpdateOptions {
@@ -66,6 +67,7 @@ interface ServiceInstanceUpdateOptions {
66
67
  stickySender?: boolean;
67
68
  synchronousValidation?: boolean;
68
69
  useInboundWebhookOnNumber?: boolean;
70
+ usecase?: string;
69
71
  validityPeriod?: number;
70
72
  }
71
73
 
@@ -206,6 +208,7 @@ interface ServiceListInstance {
206
208
  * @property stickySender - Whether to enable Sticky Sender on the Service instance
207
209
  * @property synchronousValidation - Reserved
208
210
  * @property useInboundWebhookOnNumber - If enabled, the webhook url configured on the phone number will be used and will override the `inbound_request_url`/`fallback_url` url called when an inbound message is received.
211
+ * @property usecase - A string describing the scenario in which the Messaging Service will be used
209
212
  * @property validityPeriod - How long, in seconds, messages sent from the Service are valid
210
213
  */
211
214
  interface ServiceListInstanceCreateOptions {
@@ -223,6 +226,7 @@ interface ServiceListInstanceCreateOptions {
223
226
  stickySender?: boolean;
224
227
  synchronousValidation?: boolean;
225
228
  useInboundWebhookOnNumber?: boolean;
229
+ usecase?: string;
226
230
  validityPeriod?: number;
227
231
  }
228
232
 
@@ -306,7 +310,9 @@ interface ServiceResource {
306
310
  sticky_sender: boolean;
307
311
  synchronous_validation: boolean;
308
312
  url: string;
313
+ us_app_to_person_registered: boolean;
309
314
  use_inbound_webhook_on_number: boolean;
315
+ usecase: string;
310
316
  validity_period: number;
311
317
  }
312
318
 
@@ -441,11 +447,13 @@ declare class ServiceInstance extends SerializableClass {
441
447
  * Access the usAppToPerson
442
448
  */
443
449
  usAppToPerson(): UsAppToPersonListInstance;
450
+ usAppToPersonRegistered: boolean;
444
451
  /**
445
452
  * Access the usAppToPersonUsecases
446
453
  */
447
454
  usAppToPersonUsecases(): UsAppToPersonUsecaseListInstance;
448
455
  useInboundWebhookOnNumber: boolean;
456
+ usecase: string;
449
457
  validityPeriod: number;
450
458
  }
451
459
 
@@ -93,6 +93,8 @@ ServiceList = function ServiceList(version) {
93
93
  * @param {number} [opts.validityPeriod] -
94
94
  * How long, in seconds, messages sent from the Service are valid
95
95
  * @param {boolean} [opts.synchronousValidation] - Reserved
96
+ * @param {string} [opts.usecase] -
97
+ * A string describing the scenario in which the Messaging Service will be used
96
98
  * @param {boolean} [opts.useInboundWebhookOnNumber] -
97
99
  * If enabled, the webhook url configured on the phone number will be used and will override the `inbound_request_url`/`fallback_url` url called when an inbound message is received.
98
100
  * @param {function} [callback] - Callback to handle processed record
@@ -124,6 +126,7 @@ ServiceList = function ServiceList(version) {
124
126
  'AreaCodeGeomatch': serialize.bool(_.get(opts, 'areaCodeGeomatch')),
125
127
  'ValidityPeriod': _.get(opts, 'validityPeriod'),
126
128
  'SynchronousValidation': serialize.bool(_.get(opts, 'synchronousValidation')),
129
+ 'Usecase': _.get(opts, 'usecase'),
127
130
  'UseInboundWebhookOnNumber': serialize.bool(_.get(opts, 'useInboundWebhookOnNumber'))
128
131
  });
129
132
 
@@ -533,6 +536,10 @@ ServicePage.prototype[util.inspect.custom] = function inspect(depth, options) {
533
536
  * How long, in seconds, messages sent from the Service are valid
534
537
  * @property {string} url - The absolute URL of the Service resource
535
538
  * @property {string} links - The absolute URLs of related resources
539
+ * @property {string} usecase -
540
+ * A string describing the scenario in which the Messaging Service will be used
541
+ * @property {boolean} usAppToPersonRegistered -
542
+ * Whether US A2P campaign is registered for this Service.
536
543
  * @property {boolean} useInboundWebhookOnNumber -
537
544
  * If enabled, the webhook url configured on the phone number will be used and will override the `inbound_request_url`/`fallback_url` url called when an inbound message is received.
538
545
  *
@@ -565,6 +572,8 @@ ServiceInstance = function ServiceInstance(version, payload, sid) {
565
572
  this.validityPeriod = deserialize.integer(payload.validity_period); // jshint ignore:line
566
573
  this.url = payload.url; // jshint ignore:line
567
574
  this.links = payload.links; // jshint ignore:line
575
+ this.usecase = payload.usecase; // jshint ignore:line
576
+ this.usAppToPersonRegistered = payload.us_app_to_person_registered; // jshint ignore:line
568
577
  this.useInboundWebhookOnNumber = payload.use_inbound_webhook_on_number; // jshint ignore:line
569
578
 
570
579
  // Context
@@ -616,6 +625,8 @@ Object.defineProperty(ServiceInstance.prototype,
616
625
  * @param {number} [opts.validityPeriod] -
617
626
  * How long, in seconds, messages sent from the Service are valid
618
627
  * @param {boolean} [opts.synchronousValidation] - Reserved
628
+ * @param {string} [opts.usecase] -
629
+ * A string describing the scenario in which the Messaging Service will be used
619
630
  * @param {boolean} [opts.useInboundWebhookOnNumber] -
620
631
  * If enabled, the webhook url configured on the phone number will be used and will override the `inbound_request_url`/`fallback_url` url called when an inbound message is received.
621
632
  * @param {function} [callback] - Callback to handle processed record
@@ -828,6 +839,8 @@ ServiceContext = function ServiceContext(version, sid) {
828
839
  * @param {number} [opts.validityPeriod] -
829
840
  * How long, in seconds, messages sent from the Service are valid
830
841
  * @param {boolean} [opts.synchronousValidation] - Reserved
842
+ * @param {string} [opts.usecase] -
843
+ * A string describing the scenario in which the Messaging Service will be used
831
844
  * @param {boolean} [opts.useInboundWebhookOnNumber] -
832
845
  * If enabled, the webhook url configured on the phone number will be used and will override the `inbound_request_url`/`fallback_url` url called when an inbound message is received.
833
846
  * @param {function} [callback] - Callback to handle processed record
@@ -858,6 +871,7 @@ ServiceContext.prototype.update = function update(opts, callback) {
858
871
  'AreaCodeGeomatch': serialize.bool(_.get(opts, 'areaCodeGeomatch')),
859
872
  'ValidityPeriod': _.get(opts, 'validityPeriod'),
860
873
  'SynchronousValidation': serialize.bool(_.get(opts, 'synchronousValidation')),
874
+ 'Usecase': _.get(opts, 'usecase'),
861
875
  'UseInboundWebhookOnNumber': serialize.bool(_.get(opts, 'useInboundWebhookOnNumber'))
862
876
  });
863
877
 
@@ -0,0 +1,133 @@
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 V2 = require('../../../V2');
11
+ import { SerializableClass } from '../../../../../interfaces';
12
+
13
+ type BundleCopyEndUserType = 'individual'|'business';
14
+
15
+ type BundleCopyStatus = 'draft'|'pending-review'|'in-review'|'twilio-rejected'|'twilio-approved'|'provisionally-approved';
16
+
17
+ /**
18
+ * Initialize the BundleCopyList
19
+ *
20
+ * PLEASE NOTE that this class contains beta products that are subject to change.
21
+ * Use them with caution.
22
+ *
23
+ * @param version - Version of the resource
24
+ * @param bundleSid - The unique string that identifies the resource.
25
+ */
26
+ declare function BundleCopyList(version: V2, bundleSid: string): BundleCopyListInstance;
27
+
28
+ interface BundleCopyListInstance {
29
+ /**
30
+ * create a BundleCopyInstance
31
+ *
32
+ * @param callback - Callback to handle processed record
33
+ */
34
+ create(callback?: (error: Error | null, item: BundleCopyInstance) => any): Promise<BundleCopyInstance>;
35
+ /**
36
+ * create a BundleCopyInstance
37
+ *
38
+ * @param opts - Options for request
39
+ * @param callback - Callback to handle processed record
40
+ */
41
+ create(opts?: BundleCopyListInstanceCreateOptions, callback?: (error: Error | null, item: BundleCopyInstance) => any): Promise<BundleCopyInstance>;
42
+ /**
43
+ * Provide a user-friendly representation
44
+ */
45
+ toJSON(): any;
46
+ }
47
+
48
+ /**
49
+ * Options to pass to create
50
+ *
51
+ * @property friendlyName - The string that you assigned to describe the copied bundle
52
+ */
53
+ interface BundleCopyListInstanceCreateOptions {
54
+ friendlyName?: string;
55
+ }
56
+
57
+ interface BundleCopyPayload extends BundleCopyResource, Page.TwilioResponsePayload {
58
+ }
59
+
60
+ interface BundleCopyResource {
61
+ account_sid: string;
62
+ date_created: Date;
63
+ date_updated: Date;
64
+ email: string;
65
+ friendly_name: string;
66
+ regulation_sid: string;
67
+ sid: string;
68
+ status: BundleCopyStatus;
69
+ status_callback: string;
70
+ valid_until: Date;
71
+ }
72
+
73
+ interface BundleCopySolution {
74
+ bundleSid?: string;
75
+ }
76
+
77
+
78
+ declare class BundleCopyInstance extends SerializableClass {
79
+ /**
80
+ * Initialize the BundleCopyContext
81
+ *
82
+ * PLEASE NOTE that this class contains beta products that are subject to change.
83
+ * Use them with caution.
84
+ *
85
+ * @param version - Version of the resource
86
+ * @param payload - The instance payload
87
+ * @param bundleSid - The unique string that identifies the resource.
88
+ */
89
+ constructor(version: V2, payload: BundleCopyPayload, bundleSid: string);
90
+
91
+ accountSid: string;
92
+ dateCreated: Date;
93
+ dateUpdated: Date;
94
+ email: string;
95
+ friendlyName: string;
96
+ regulationSid: string;
97
+ sid: string;
98
+ status: BundleCopyStatus;
99
+ statusCallback: string;
100
+ /**
101
+ * Provide a user-friendly representation
102
+ */
103
+ toJSON(): any;
104
+ validUntil: Date;
105
+ }
106
+
107
+
108
+ declare class BundleCopyPage extends Page<V2, BundleCopyPayload, BundleCopyResource, BundleCopyInstance> {
109
+ /**
110
+ * Initialize the BundleCopyPage
111
+ *
112
+ * PLEASE NOTE that this class contains beta products that are subject to change.
113
+ * Use them with caution.
114
+ *
115
+ * @param version - Version of the resource
116
+ * @param response - Response from the API
117
+ * @param solution - Path solution
118
+ */
119
+ constructor(version: V2, response: Response<string>, solution: BundleCopySolution);
120
+
121
+ /**
122
+ * Build an instance of BundleCopyInstance
123
+ *
124
+ * @param payload - Payload response from the API
125
+ */
126
+ getInstance(payload: BundleCopyPayload): BundleCopyInstance;
127
+ /**
128
+ * Provide a user-friendly representation
129
+ */
130
+ toJSON(): any;
131
+ }
132
+
133
+ export { BundleCopyEndUserType, BundleCopyInstance, BundleCopyList, BundleCopyListInstance, BundleCopyListInstanceCreateOptions, BundleCopyPage, BundleCopyPayload, BundleCopyResource, BundleCopySolution, BundleCopyStatus }
@@ -0,0 +1,268 @@
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 BundleCopyList;
21
+ var BundleCopyPage;
22
+ var BundleCopyInstance;
23
+
24
+ /* jshint ignore:start */
25
+ /**
26
+ * Initialize the BundleCopyList
27
+ *
28
+ * PLEASE NOTE that this class contains beta products that are subject to change.
29
+ * Use them with caution.
30
+ *
31
+ * @constructor Twilio.Numbers.V2.RegulatoryComplianceContext.BundleContext.BundleCopyList
32
+ *
33
+ * @param {Twilio.Numbers.V2} version - Version of the resource
34
+ * @param {string} bundleSid - The unique string that identifies the resource.
35
+ */
36
+ /* jshint ignore:end */
37
+ BundleCopyList = function BundleCopyList(version, bundleSid) {
38
+ /* jshint ignore:start */
39
+ /**
40
+ * @function bundleCopies
41
+ * @memberof Twilio.Numbers.V2.RegulatoryComplianceContext.BundleContext#
42
+ *
43
+ * @param {string} sid - sid of instance
44
+ *
45
+ * @returns {Twilio.Numbers.V2.RegulatoryComplianceContext.BundleContext.BundleCopyContext}
46
+ */
47
+ /* jshint ignore:end */
48
+ function BundleCopyListInstance(sid) {
49
+ return BundleCopyListInstance.get(sid);
50
+ }
51
+
52
+ BundleCopyListInstance._version = version;
53
+ // Path Solution
54
+ BundleCopyListInstance._solution = {bundleSid: bundleSid};
55
+ BundleCopyListInstance._uri = `/RegulatoryCompliance/Bundles/${bundleSid}/Copies`;
56
+ /* jshint ignore:start */
57
+ /**
58
+ * create a BundleCopyInstance
59
+ *
60
+ * @function create
61
+ * @memberof Twilio.Numbers.V2.RegulatoryComplianceContext.BundleContext.BundleCopyList#
62
+ *
63
+ * @param {object} [opts] - Options for request
64
+ * @param {string} [opts.friendlyName] -
65
+ * The string that you assigned to describe the copied bundle
66
+ * @param {function} [callback] - Callback to handle processed record
67
+ *
68
+ * @returns {Promise} Resolves to processed BundleCopyInstance
69
+ */
70
+ /* jshint ignore:end */
71
+ BundleCopyListInstance.create = function create(opts, callback) {
72
+ if (_.isFunction(opts)) {
73
+ callback = opts;
74
+ opts = {};
75
+ }
76
+ opts = opts || {};
77
+
78
+ var deferred = Q.defer();
79
+ var data = values.of({'FriendlyName': _.get(opts, 'friendlyName')});
80
+
81
+ var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
82
+
83
+ promise = promise.then(function(payload) {
84
+ deferred.resolve(new BundleCopyInstance(this._version, payload));
85
+ }.bind(this));
86
+
87
+ promise.catch(function(error) {
88
+ deferred.reject(error);
89
+ });
90
+
91
+ if (_.isFunction(callback)) {
92
+ deferred.promise.nodeify(callback);
93
+ }
94
+
95
+ return deferred.promise;
96
+ };
97
+
98
+ /* jshint ignore:start */
99
+ /**
100
+ * Provide a user-friendly representation
101
+ *
102
+ * @function toJSON
103
+ * @memberof Twilio.Numbers.V2.RegulatoryComplianceContext.BundleContext.BundleCopyList#
104
+ *
105
+ * @returns Object
106
+ */
107
+ /* jshint ignore:end */
108
+ BundleCopyListInstance.toJSON = function toJSON() {
109
+ return this._solution;
110
+ };
111
+
112
+ BundleCopyListInstance[util.inspect.custom] = function inspect(depth, options) {
113
+ return util.inspect(this.toJSON(), options);
114
+ };
115
+
116
+ return BundleCopyListInstance;
117
+ };
118
+
119
+
120
+ /* jshint ignore:start */
121
+ /**
122
+ * Initialize the BundleCopyPage
123
+ *
124
+ * PLEASE NOTE that this class contains beta products that are subject to change.
125
+ * Use them with caution.
126
+ *
127
+ * @constructor Twilio.Numbers.V2.RegulatoryComplianceContext.BundleContext.BundleCopyPage
128
+ *
129
+ * @param {V2} version - Version of the resource
130
+ * @param {Response<string>} response - Response from the API
131
+ * @param {BundleCopySolution} solution - Path solution
132
+ *
133
+ * @returns BundleCopyPage
134
+ */
135
+ /* jshint ignore:end */
136
+ BundleCopyPage = function BundleCopyPage(version, response, solution) {
137
+ // Path Solution
138
+ this._solution = solution;
139
+
140
+ Page.prototype.constructor.call(this, version, response, this._solution);
141
+ };
142
+
143
+ _.extend(BundleCopyPage.prototype, Page.prototype);
144
+ BundleCopyPage.prototype.constructor = BundleCopyPage;
145
+
146
+ /* jshint ignore:start */
147
+ /**
148
+ * Build an instance of BundleCopyInstance
149
+ *
150
+ * @function getInstance
151
+ * @memberof Twilio.Numbers.V2.RegulatoryComplianceContext.BundleContext.BundleCopyPage#
152
+ *
153
+ * @param {BundleCopyPayload} payload - Payload response from the API
154
+ *
155
+ * @returns BundleCopyInstance
156
+ */
157
+ /* jshint ignore:end */
158
+ BundleCopyPage.prototype.getInstance = function getInstance(payload) {
159
+ return new BundleCopyInstance(this._version, payload, this._solution.bundleSid);
160
+ };
161
+
162
+ /* jshint ignore:start */
163
+ /**
164
+ * Provide a user-friendly representation
165
+ *
166
+ * @function toJSON
167
+ * @memberof Twilio.Numbers.V2.RegulatoryComplianceContext.BundleContext.BundleCopyPage#
168
+ *
169
+ * @returns Object
170
+ */
171
+ /* jshint ignore:end */
172
+ BundleCopyPage.prototype.toJSON = function toJSON() {
173
+ let clone = {};
174
+ _.forOwn(this, function(value, key) {
175
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
176
+ clone[key] = value;
177
+ }
178
+ });
179
+ return clone;
180
+ };
181
+
182
+ BundleCopyPage.prototype[util.inspect.custom] = function inspect(depth, options)
183
+ {
184
+ return util.inspect(this.toJSON(), options);
185
+ };
186
+
187
+
188
+ /* jshint ignore:start */
189
+ /**
190
+ * Initialize the BundleCopyContext
191
+ *
192
+ * PLEASE NOTE that this class contains beta products that are subject to change.
193
+ * Use them with caution.
194
+ *
195
+ * @constructor Twilio.Numbers.V2.RegulatoryComplianceContext.BundleContext.BundleCopyInstance
196
+ *
197
+ * @property {string} sid - The unique string that identifies the resource
198
+ * @property {string} accountSid - The SID of the Account that created the resource
199
+ * @property {string} regulationSid - The unique string of a regulation
200
+ * @property {string} friendlyName -
201
+ * The string that you assigned to describe the resource
202
+ * @property {bundle_copy.status} status -
203
+ * The verification status of the Bundle resource
204
+ * @property {Date} validUntil -
205
+ * The ISO 8601 date and time in GMT when the resource will be valid until
206
+ * @property {string} email - The email address
207
+ * @property {string} statusCallback -
208
+ * The URL we call to inform your application of status changes
209
+ * @property {Date} dateCreated -
210
+ * The ISO 8601 date and time in GMT when the resource was created
211
+ * @property {Date} dateUpdated -
212
+ * The ISO 8601 date and time in GMT when the resource was last updated
213
+ *
214
+ * @param {V2} version - Version of the resource
215
+ * @param {BundleCopyPayload} payload - The instance payload
216
+ * @param {sid} bundleSid - The unique string that identifies the resource.
217
+ */
218
+ /* jshint ignore:end */
219
+ BundleCopyInstance = function BundleCopyInstance(version, payload, bundleSid) {
220
+ this._version = version;
221
+
222
+ // Marshaled Properties
223
+ this.sid = payload.sid; // jshint ignore:line
224
+ this.accountSid = payload.account_sid; // jshint ignore:line
225
+ this.regulationSid = payload.regulation_sid; // jshint ignore:line
226
+ this.friendlyName = payload.friendly_name; // jshint ignore:line
227
+ this.status = payload.status; // jshint ignore:line
228
+ this.validUntil = deserialize.iso8601DateTime(payload.valid_until); // jshint ignore:line
229
+ this.email = payload.email; // jshint ignore:line
230
+ this.statusCallback = payload.status_callback; // jshint ignore:line
231
+ this.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line
232
+ this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated); // jshint ignore:line
233
+
234
+ // Context
235
+ this._context = undefined;
236
+ this._solution = {bundleSid: bundleSid, };
237
+ };
238
+
239
+ /* jshint ignore:start */
240
+ /**
241
+ * Provide a user-friendly representation
242
+ *
243
+ * @function toJSON
244
+ * @memberof Twilio.Numbers.V2.RegulatoryComplianceContext.BundleContext.BundleCopyInstance#
245
+ *
246
+ * @returns Object
247
+ */
248
+ /* jshint ignore:end */
249
+ BundleCopyInstance.prototype.toJSON = function toJSON() {
250
+ let clone = {};
251
+ _.forOwn(this, function(value, key) {
252
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
253
+ clone[key] = value;
254
+ }
255
+ });
256
+ return clone;
257
+ };
258
+
259
+ BundleCopyInstance.prototype[util.inspect.custom] = function inspect(depth,
260
+ options) {
261
+ return util.inspect(this.toJSON(), options);
262
+ };
263
+
264
+ module.exports = {
265
+ BundleCopyList: BundleCopyList,
266
+ BundleCopyPage: BundleCopyPage,
267
+ BundleCopyInstance: BundleCopyInstance
268
+ };