twilio 3.68.0 → 3.71.2

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 (85) hide show
  1. package/CHANGES.md +104 -0
  2. package/README.md +1 -1
  3. package/lib/jwt/AccessToken.d.ts +16 -0
  4. package/lib/jwt/AccessToken.js +20 -0
  5. package/lib/jwt/ClientCapability.d.ts +1 -1
  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 +8 -1
  15. package/lib/rest/api/v2010/account/call.js +29 -1
  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/flexApi/v1/configuration.d.ts +2 -0
  27. package/lib/rest/flexApi/v1/configuration.js +2 -0
  28. package/lib/rest/frontlineApi/v1/user.d.ts +4 -0
  29. package/lib/rest/frontlineApi/v1/user.js +10 -1
  30. package/lib/rest/insights/v1/callSummaries.d.ts +27 -27
  31. package/lib/rest/insights/v1/callSummaries.js +36 -36
  32. package/lib/rest/media/V1.d.ts +28 -0
  33. package/lib/rest/media/V1.js +59 -0
  34. package/lib/rest/media/v1/mediaProcessor.d.ts +355 -0
  35. package/lib/rest/media/v1/mediaProcessor.js +702 -0
  36. package/lib/rest/media/v1/playerStreamer/playbackGrant.d.ts +162 -0
  37. package/lib/rest/media/v1/playerStreamer/playbackGrant.js +384 -0
  38. package/lib/rest/media/v1/playerStreamer.d.ts +366 -0
  39. package/lib/rest/media/v1/playerStreamer.js +729 -0
  40. package/lib/rest/messaging/v1/brandRegistration/brandVetting.d.ts +330 -0
  41. package/lib/rest/messaging/v1/brandRegistration/brandVetting.js +655 -0
  42. package/lib/rest/messaging/v1/brandRegistration.d.ts +15 -2
  43. package/lib/rest/messaging/v1/brandRegistration.js +37 -1
  44. package/lib/rest/messaging/v1/service.d.ts +8 -0
  45. package/lib/rest/messaging/v1/service.js +14 -0
  46. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.d.ts +133 -0
  47. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.js +268 -0
  48. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.d.ts +127 -0
  49. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.js +271 -0
  50. package/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts +14 -0
  51. package/lib/rest/numbers/v2/regulatoryCompliance/bundle.js +56 -0
  52. package/lib/rest/serverless/v1/service/build.d.ts +1 -1
  53. package/lib/rest/serverless/v1/service/environment.js +1 -1
  54. package/lib/rest/serverless/v1/service.d.ts +2 -0
  55. package/lib/rest/serverless/v1/service.js +3 -0
  56. package/lib/rest/taskrouter/v1/workspace/task/reservation.d.ts +2 -0
  57. package/lib/rest/taskrouter/v1/workspace/task/reservation.js +4 -1
  58. package/lib/rest/taskrouter/v1/workspace/worker/reservation.d.ts +2 -0
  59. package/lib/rest/taskrouter/v1/workspace/worker/reservation.js +4 -1
  60. package/lib/rest/taskrouter/v1/workspace/worker.d.ts +27 -2
  61. package/lib/rest/taskrouter/v1/workspace/worker.js +22 -7
  62. package/lib/rest/trunking/v1/trunk.d.ts +9 -1
  63. package/lib/rest/trunking/v1/trunk.js +13 -2
  64. package/lib/rest/verify/V2.d.ts +3 -3
  65. package/lib/rest/verify/V2.js +6 -8
  66. package/lib/rest/verify/v2/service/entity/factor.d.ts +4 -2
  67. package/lib/rest/verify/v2/service/entity/factor.js +8 -3
  68. package/lib/rest/verify/v2/service/entity/newFactor.d.ts +2 -2
  69. package/lib/rest/verify/v2/service/entity/newFactor.js +1 -1
  70. package/lib/rest/verify/v2/service/verification.d.ts +5 -1
  71. package/lib/rest/verify/v2/service/verification.js +7 -2
  72. package/lib/rest/verify/v2/service.d.ts +6 -0
  73. package/lib/rest/verify/v2/service.js +12 -2
  74. package/lib/rest/verify/v2/{verificationTemplate.d.ts → template.d.ts} +35 -37
  75. package/lib/rest/verify/v2/{verificationTemplate.js → template.js} +58 -64
  76. package/lib/rest/verify/v2/verificationAttempt.d.ts +1 -1
  77. package/lib/rest/video/v1/room.d.ts +4 -0
  78. package/lib/rest/video/v1/room.js +7 -1
  79. package/lib/rest/wireless/v1/ratePlan.d.ts +1 -1
  80. package/lib/rest/wireless/v1/ratePlan.js +3 -3
  81. package/lib/rest/wireless/v1/sim.d.ts +4 -4
  82. package/lib/rest/wireless/v1/sim.js +18 -24
  83. package/lib/twiml/VoiceResponse.d.ts +1296 -24
  84. package/lib/twiml/VoiceResponse.js +2170 -82
  85. package/package.json +2 -2
@@ -8,11 +8,15 @@
8
8
  import Page = require('../../../base/Page');
9
9
  import Response = require('../../../http/response');
10
10
  import V1 = require('../V1');
11
+ import { BrandVettingList } from './brandRegistration/brandVetting';
12
+ import { BrandVettingListInstance } from './brandRegistration/brandVetting';
11
13
  import { SerializableClass } from '../../../interfaces';
12
14
 
15
+ type BrandRegistrationBrandFeedback = 'TAX_ID'|'STOCK_SYMBOL'|'NONPROFIT'|'GOVERNMENT_ENTITY'|'OTHERS';
16
+
13
17
  type BrandRegistrationIdentityStatus = 'SELF_DECLARED'|'UNVERIFIED'|'VERIFIED'|'VETTED_VERIFIED';
14
18
 
15
- type BrandRegistrationStatus = 'PENDING'|'APPROVED'|'FAILED';
19
+ type BrandRegistrationStatus = 'PENDING'|'APPROVED'|'FAILED'|'IN_REVIEW'|'DELETED';
16
20
 
17
21
  /**
18
22
  * Initialize the BrandRegistrationList
@@ -224,6 +228,7 @@ interface BrandRegistrationPayload extends BrandRegistrationResource, Page.Twili
224
228
  interface BrandRegistrationResource {
225
229
  a2p_profile_bundle_sid: string;
226
230
  account_sid: string;
231
+ brand_feedback: BrandRegistrationBrandFeedback[];
227
232
  brand_score: number;
228
233
  brand_type: string;
229
234
  customer_profile_bundle_sid: string;
@@ -231,6 +236,7 @@ interface BrandRegistrationResource {
231
236
  date_updated: Date;
232
237
  failure_reason: string;
233
238
  identity_status: BrandRegistrationIdentityStatus;
239
+ links: string;
234
240
  mock: boolean;
235
241
  russell_3000: boolean;
236
242
  sid: string;
@@ -257,6 +263,7 @@ declare class BrandRegistrationContext {
257
263
  */
258
264
  constructor(version: V1, sid: string);
259
265
 
266
+ brandVettings: BrandVettingListInstance;
260
267
  /**
261
268
  * fetch a BrandRegistrationInstance
262
269
  *
@@ -286,8 +293,13 @@ declare class BrandRegistrationInstance extends SerializableClass {
286
293
  private _proxy: BrandRegistrationContext;
287
294
  a2PProfileBundleSid: string;
288
295
  accountSid: string;
296
+ brandFeedback: BrandRegistrationBrandFeedback[];
289
297
  brandScore: number;
290
298
  brandType: string;
299
+ /**
300
+ * Access the brandVettings
301
+ */
302
+ brandVettings(): BrandVettingListInstance;
291
303
  customerProfileBundleSid: string;
292
304
  dateCreated: Date;
293
305
  dateUpdated: Date;
@@ -299,6 +311,7 @@ declare class BrandRegistrationInstance extends SerializableClass {
299
311
  */
300
312
  fetch(callback?: (error: Error | null, items: BrandRegistrationInstance) => any): Promise<BrandRegistrationInstance>;
301
313
  identityStatus: BrandRegistrationIdentityStatus;
314
+ links: string;
302
315
  mock: boolean;
303
316
  russell3000: boolean;
304
317
  sid: string;
@@ -339,4 +352,4 @@ declare class BrandRegistrationPage extends Page<V1, BrandRegistrationPayload, B
339
352
  toJSON(): any;
340
353
  }
341
354
 
342
- export { BrandRegistrationContext, BrandRegistrationIdentityStatus, BrandRegistrationInstance, BrandRegistrationList, BrandRegistrationListInstance, BrandRegistrationListInstanceCreateOptions, BrandRegistrationListInstanceEachOptions, BrandRegistrationListInstanceOptions, BrandRegistrationListInstancePageOptions, BrandRegistrationPage, BrandRegistrationPayload, BrandRegistrationResource, BrandRegistrationSolution, BrandRegistrationStatus }
355
+ export { BrandRegistrationBrandFeedback, BrandRegistrationContext, BrandRegistrationIdentityStatus, BrandRegistrationInstance, BrandRegistrationList, BrandRegistrationListInstance, BrandRegistrationListInstanceCreateOptions, BrandRegistrationListInstanceEachOptions, BrandRegistrationListInstanceOptions, BrandRegistrationListInstancePageOptions, BrandRegistrationPage, BrandRegistrationPayload, BrandRegistrationResource, BrandRegistrationSolution, BrandRegistrationStatus }
@@ -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 */
@@ -480,17 +482,19 @@ BrandRegistrationPage.prototype[util.inspect.custom] = function inspect(depth,
480
482
  * @property {Date} dateUpdated -
481
483
  * The ISO 8601 date and time in GMT when the resource was last updated
482
484
  * @property {string} brandType - Type of brand. One of: "STANDARD", "STARTER".
483
- * @property {brand_registration.status} status - Brand Registration status
485
+ * @property {brand_registration.status} status - Brand Registration status.
484
486
  * @property {string} tcrId - Campaign Registry (TCR) Brand ID
485
487
  * @property {string} failureReason - A reason why brand registration has failed
486
488
  * @property {string} url - The absolute URL of the Brand Registration
487
489
  * @property {number} brandScore - Brand score
490
+ * @property {brand_registration.brand_feedback} brandFeedback - Brand feedback
488
491
  * @property {brand_registration.identity_status} identityStatus - Identity Status
489
492
  * @property {boolean} russell3000 - Russell 3000
490
493
  * @property {string} taxExemptStatus - Tax Exempt Status
491
494
  * @property {boolean} skipAutomaticSecVet - Skip Automatic Secondary Vetting
492
495
  * @property {boolean} mock -
493
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
494
498
  *
495
499
  * @param {V1} version - Version of the resource
496
500
  * @param {BrandRegistrationPayload} payload - The instance payload
@@ -514,11 +518,13 @@ BrandRegistrationInstance = function BrandRegistrationInstance(version, payload,
514
518
  this.failureReason = payload.failure_reason; // jshint ignore:line
515
519
  this.url = payload.url; // jshint ignore:line
516
520
  this.brandScore = deserialize.integer(payload.brand_score); // jshint ignore:line
521
+ this.brandFeedback = payload.brand_feedback; // jshint ignore:line
517
522
  this.identityStatus = payload.identity_status; // jshint ignore:line
518
523
  this.russell3000 = payload.russell_3000; // jshint ignore:line
519
524
  this.taxExemptStatus = payload.tax_exempt_status; // jshint ignore:line
520
525
  this.skipAutomaticSecVet = payload.skip_automatic_sec_vet; // jshint ignore:line
521
526
  this.mock = payload.mock; // jshint ignore:line
527
+ this.links = payload.links; // jshint ignore:line
522
528
 
523
529
  // Context
524
530
  this._context = undefined;
@@ -552,6 +558,20 @@ BrandRegistrationInstance.prototype.fetch = function fetch(callback) {
552
558
  return this._proxy.fetch(callback);
553
559
  };
554
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
+
555
575
  /* jshint ignore:start */
556
576
  /**
557
577
  * Provide a user-friendly representation
@@ -587,6 +607,9 @@ BrandRegistrationInstance.prototype[util.inspect.custom] = function
587
607
  *
588
608
  * @constructor Twilio.Messaging.V1.BrandRegistrationContext
589
609
  *
610
+ * @property {Twilio.Messaging.V1.BrandRegistrationContext.BrandVettingList} brandVettings -
611
+ * brandVettings resource
612
+ *
590
613
  * @param {V1} version - Version of the resource
591
614
  * @param {sid} sid - The SID that identifies the resource to fetch
592
615
  */
@@ -597,6 +620,9 @@ BrandRegistrationContext = function BrandRegistrationContext(version, sid) {
597
620
  // Path Solution
598
621
  this._solution = {sid: sid, };
599
622
  this._uri = `/a2p/BrandRegistrations/${sid}`;
623
+
624
+ // Dependents
625
+ this._brandVettings = undefined;
600
626
  };
601
627
 
602
628
  /* jshint ignore:start */
@@ -630,6 +656,16 @@ BrandRegistrationContext.prototype.fetch = function fetch(callback) {
630
656
  return deferred.promise;
631
657
  };
632
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
+
633
669
  /* jshint ignore:start */
634
670
  /**
635
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
+ };