twilio 5.0.4 → 5.1.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 (97) hide show
  1. package/lib/rest/ContentBase.d.ts +3 -0
  2. package/lib/rest/ContentBase.js +5 -0
  3. package/lib/rest/Marketplace.d.ts +4 -0
  4. package/lib/rest/Marketplace.js +8 -0
  5. package/lib/rest/{PreviewMessagingBase.d.ts → MarketplaceBase.d.ts} +4 -4
  6. package/lib/rest/{PreviewMessagingBase.js → MarketplaceBase.js} +5 -5
  7. package/lib/rest/Twilio.d.ts +5 -5
  8. package/lib/rest/Twilio.js +5 -5
  9. package/lib/rest/api/v2010/account/message.d.ts +3 -3
  10. package/lib/rest/content/V2.d.ts +20 -0
  11. package/lib/rest/content/V2.js +43 -0
  12. package/lib/rest/content/v1/content/approvalCreate.d.ts +13 -18
  13. package/lib/rest/content/v1/content/approvalCreate.js +14 -16
  14. package/lib/rest/content/v1/content/approvalFetch.d.ts +5 -5
  15. package/lib/rest/content/v1/content/approvalFetch.js +14 -14
  16. package/lib/rest/content/v1/content.d.ts +11 -159
  17. package/lib/rest/content/v1/content.js +7 -93
  18. package/lib/rest/content/v1/contentAndApprovals.d.ts +1 -1
  19. package/lib/rest/content/v1/legacyContent.d.ts +1 -1
  20. package/lib/rest/content/v2/content.d.ts +250 -0
  21. package/lib/rest/content/v2/content.js +154 -0
  22. package/lib/rest/content/v2/contentAndApprovals.d.ts +244 -0
  23. package/lib/rest/content/v2/contentAndApprovals.js +152 -0
  24. package/lib/rest/flexApi/v1/interaction.d.ts +1 -1
  25. package/lib/rest/flexApi/v1/interaction.js +2 -4
  26. package/lib/rest/flexApi/v1/plugin/pluginVersions.d.ts +4 -1
  27. package/lib/rest/flexApi/v1/plugin/pluginVersions.js +2 -0
  28. package/lib/rest/intelligence/V2.d.ts +30 -0
  29. package/lib/rest/intelligence/V2.js +40 -0
  30. package/lib/rest/intelligence/v2/customOperator.d.ts +330 -0
  31. package/lib/rest/intelligence/v2/customOperator.js +279 -0
  32. package/lib/rest/intelligence/v2/operator.d.ts +263 -0
  33. package/lib/rest/intelligence/v2/operator.js +197 -0
  34. package/lib/rest/intelligence/v2/operatorAttachment.d.ts +112 -0
  35. package/lib/rest/intelligence/v2/operatorAttachment.js +135 -0
  36. package/lib/rest/intelligence/v2/operatorAttachments.d.ts +94 -0
  37. package/lib/rest/intelligence/v2/operatorAttachments.js +110 -0
  38. package/lib/rest/intelligence/v2/operatorType.d.ts +259 -0
  39. package/lib/rest/intelligence/v2/operatorType.js +197 -0
  40. package/lib/rest/intelligence/v2/prebuiltOperator.d.ts +263 -0
  41. package/lib/rest/intelligence/v2/prebuiltOperator.js +197 -0
  42. package/lib/rest/intelligence/v2/service.d.ts +8 -4
  43. package/lib/rest/intelligence/v2/service.js +3 -2
  44. package/lib/rest/marketplace/V1.d.ts +25 -0
  45. package/lib/rest/marketplace/V1.js +51 -0
  46. package/lib/rest/marketplace/v1/availableAddOn/availableAddOnExtension.d.ts +219 -0
  47. package/lib/rest/marketplace/v1/availableAddOn/availableAddOnExtension.js +187 -0
  48. package/lib/rest/marketplace/v1/availableAddOn.d.ts +231 -0
  49. package/lib/rest/marketplace/v1/availableAddOn.js +196 -0
  50. package/lib/rest/marketplace/v1/installedAddOn/installedAddOnExtension.d.ts +251 -0
  51. package/lib/rest/marketplace/v1/installedAddOn/installedAddOnExtension.js +214 -0
  52. package/lib/rest/marketplace/v1/installedAddOn/installedAddOnUsage.d.ts +84 -0
  53. package/lib/rest/marketplace/v1/installedAddOn/installedAddOnUsage.js +86 -0
  54. package/lib/rest/marketplace/v1/installedAddOn.d.ts +340 -0
  55. package/lib/rest/marketplace/v1/installedAddOn.js +294 -0
  56. package/lib/rest/marketplace/v1/moduleDataManagement.d.ts +147 -0
  57. package/lib/rest/{numbers/v1/portingBulkPortability.js → marketplace/v1/moduleDataManagement.js} +62 -45
  58. package/lib/rest/messaging/v1/service.d.ts +0 -6
  59. package/lib/rest/messaging/v1/service.js +0 -2
  60. package/lib/rest/messaging/v1/tollfreeVerification.d.ts +13 -1
  61. package/lib/rest/messaging/v1/tollfreeVerification.js +4 -0
  62. package/lib/rest/numbers/V1.d.ts +20 -10
  63. package/lib/rest/numbers/V1.js +32 -15
  64. package/lib/rest/numbers/v1/portingPortIn.d.ts +74 -0
  65. package/lib/rest/numbers/v1/portingPortIn.js +38 -0
  66. package/lib/rest/numbers/v1/portingPortInPhoneNumber.d.ts +124 -0
  67. package/lib/rest/numbers/v1/portingPortInPhoneNumber.js +87 -1
  68. package/lib/rest/numbers/v1/portingWebhookConfiguration.d.ts +79 -0
  69. package/lib/rest/{previewMessaging/v1/broadcast.js → numbers/v1/portingWebhookConfiguration.js} +19 -32
  70. package/lib/rest/numbers/v1/portingWebhookConfigurationDelete.d.ts +51 -0
  71. package/lib/rest/numbers/v1/portingWebhookConfigurationDelete.js +68 -0
  72. package/lib/rest/numbers/v1/portingWebhookConfigurationFetch.d.ts +75 -0
  73. package/lib/rest/numbers/v1/portingWebhookConfigurationFetch.js +72 -0
  74. package/lib/rest/numbers/v1/signingRequestConfiguration.d.ts +100 -0
  75. package/lib/rest/{previewMessaging/v1/message.js → numbers/v1/signingRequestConfiguration.js} +31 -33
  76. package/lib/rest/taskrouter/v1/workspace/task.d.ts +24 -0
  77. package/lib/rest/taskrouter/v1/workspace/task.js +12 -0
  78. package/lib/rest/trusthub/v1/complianceTollfreeInquiries.d.ts +2 -0
  79. package/lib/rest/trusthub/v1/complianceTollfreeInquiries.js +2 -0
  80. package/lib/rest/trusthub/v1/customerProfiles.d.ts +6 -0
  81. package/lib/rest/trusthub/v1/customerProfiles.js +2 -0
  82. package/lib/rest/trusthub/v1/trustProducts.d.ts +6 -0
  83. package/lib/rest/trusthub/v1/trustProducts.js +2 -0
  84. package/lib/rest/verify/v2/service/verification.d.ts +1 -1
  85. package/lib/rest/verify/v2/service/verificationCheck.d.ts +1 -1
  86. package/lib/rest/verify/v2/service.d.ts +1 -1
  87. package/lib/webhooks/webhooks.js +4 -5
  88. package/package.json +1 -1
  89. package/lib/rest/PreviewMessaging.d.ts +0 -9
  90. package/lib/rest/PreviewMessaging.js +0 -15
  91. package/lib/rest/numbers/v1/portingBulkPortability.d.ts +0 -120
  92. package/lib/rest/numbers/v1/portingPortInFetch.d.ts +0 -142
  93. package/lib/rest/numbers/v1/portingPortInFetch.js +0 -128
  94. package/lib/rest/previewMessaging/V1.d.ts +0 -20
  95. package/lib/rest/previewMessaging/V1.js +0 -42
  96. package/lib/rest/previewMessaging/v1/broadcast.d.ts +0 -108
  97. package/lib/rest/previewMessaging/v1/message.d.ts +0 -178
@@ -1,7 +1,9 @@
1
1
  import Domain from "../base/Domain";
2
2
  import V1 from "./content/V1";
3
+ import V2 from "./content/V2";
3
4
  declare class ContentBase extends Domain {
4
5
  _v1?: V1;
6
+ _v2?: V2;
5
7
  /**
6
8
  * Initialize content domain
7
9
  *
@@ -9,5 +11,6 @@ declare class ContentBase extends Domain {
9
11
  */
10
12
  constructor(twilio: any);
11
13
  get v1(): V1;
14
+ get v2(): V2;
12
15
  }
13
16
  export = ContentBase;
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  };
15
15
  const Domain_1 = __importDefault(require("../base/Domain"));
16
16
  const V1_1 = __importDefault(require("./content/V1"));
17
+ const V2_1 = __importDefault(require("./content/V2"));
17
18
  class ContentBase extends Domain_1.default {
18
19
  /**
19
20
  * Initialize content domain
@@ -27,5 +28,9 @@ class ContentBase extends Domain_1.default {
27
28
  this._v1 = this._v1 || new V1_1.default(this);
28
29
  return this._v1;
29
30
  }
31
+ get v2() {
32
+ this._v2 = this._v2 || new V2_1.default(this);
33
+ return this._v2;
34
+ }
30
35
  }
31
36
  module.exports = ContentBase;
@@ -0,0 +1,4 @@
1
+ import MarketplaceBase from "./MarketplaceBase";
2
+ declare class Marketplace extends MarketplaceBase {
3
+ }
4
+ export = Marketplace;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ const MarketplaceBase_1 = __importDefault(require("./MarketplaceBase"));
6
+ class Marketplace extends MarketplaceBase_1.default {
7
+ }
8
+ module.exports = Marketplace;
@@ -1,13 +1,13 @@
1
1
  import Domain from "../base/Domain";
2
- import V1 from "./previewMessaging/V1";
3
- declare class PreviewMessagingBase extends Domain {
2
+ import V1 from "./marketplace/V1";
3
+ declare class MarketplaceBase extends Domain {
4
4
  _v1?: V1;
5
5
  /**
6
- * Initialize previewMessaging domain
6
+ * Initialize marketplace domain
7
7
  *
8
8
  * @param twilio - The twilio client
9
9
  */
10
10
  constructor(twilio: any);
11
11
  get v1(): V1;
12
12
  }
13
- export = PreviewMessagingBase;
13
+ export = MarketplaceBase;
@@ -13,19 +13,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  return (mod && mod.__esModule) ? mod : { "default": mod };
14
14
  };
15
15
  const Domain_1 = __importDefault(require("../base/Domain"));
16
- const V1_1 = __importDefault(require("./previewMessaging/V1"));
17
- class PreviewMessagingBase extends Domain_1.default {
16
+ const V1_1 = __importDefault(require("./marketplace/V1"));
17
+ class MarketplaceBase extends Domain_1.default {
18
18
  /**
19
- * Initialize previewMessaging domain
19
+ * Initialize marketplace domain
20
20
  *
21
21
  * @param twilio - The twilio client
22
22
  */
23
23
  constructor(twilio) {
24
- super(twilio, "https://preview.messaging.twilio.com");
24
+ super(twilio, "https://marketplace.twilio.com");
25
25
  }
26
26
  get v1() {
27
27
  this._v1 = this._v1 || new V1_1.default(this);
28
28
  return this._v1;
29
29
  }
30
30
  }
31
- module.exports = PreviewMessagingBase;
31
+ module.exports = MarketplaceBase;
@@ -12,7 +12,7 @@ import Insights from "./Insights";
12
12
  import Intelligence from "./Intelligence";
13
13
  import IpMessaging from "./IpMessaging";
14
14
  import Lookups from "./Lookups";
15
- import PreviewMessaging from "./PreviewMessaging";
15
+ import Marketplace from "./Marketplace";
16
16
  import Messaging from "./Messaging";
17
17
  import Microvisor from "./Microvisor";
18
18
  import Monitor from "./Monitor";
@@ -88,8 +88,8 @@ declare class Twilio extends Client {
88
88
  _ipMessaging?: IpMessaging;
89
89
  /** (Twilio.Lookups) - lookups domain */
90
90
  _lookups?: Lookups;
91
- /** (Twilio.PreviewMessaging) - previewMessaging domain */
92
- _previewMessaging?: PreviewMessaging;
91
+ /** (Twilio.Marketplace) - marketplace domain */
92
+ _marketplace?: Marketplace;
93
93
  /** (Twilio.Messaging) - messaging domain */
94
94
  _messaging?: Messaging;
95
95
  /** (Twilio.Microvisor) - microvisor domain */
@@ -170,8 +170,8 @@ declare class Twilio extends Client {
170
170
  get ipMessaging(): IpMessaging;
171
171
  /** Getter for (Twilio.Lookups) domain */
172
172
  get lookups(): Lookups;
173
- /** Getter for (Twilio.PreviewMessaging) domain */
174
- get previewMessaging(): PreviewMessaging;
173
+ /** Getter for (Twilio.Marketplace) domain */
174
+ get marketplace(): Marketplace;
175
175
  /** Getter for (Twilio.Messaging) domain */
176
176
  get messaging(): Messaging;
177
177
  /** Getter for (Twilio.Microvisor) domain */
@@ -45,7 +45,7 @@ class Twilio extends BaseTwilio_1.Client {
45
45
  this.intelligence;
46
46
  this.ipMessaging;
47
47
  this.lookups;
48
- this.previewMessaging;
48
+ this.marketplace;
49
49
  this.messaging;
50
50
  this.microvisor;
51
51
  this.monitor;
@@ -127,10 +127,10 @@ class Twilio extends BaseTwilio_1.Client {
127
127
  get lookups() {
128
128
  return this._lookups ?? (this._lookups = new (require("./Lookups"))(this));
129
129
  }
130
- /** Getter for (Twilio.PreviewMessaging) domain */
131
- get previewMessaging() {
132
- return (this._previewMessaging ??
133
- (this._previewMessaging = new (require("./PreviewMessaging"))(this)));
130
+ /** Getter for (Twilio.Marketplace) domain */
131
+ get marketplace() {
132
+ return (this._marketplace ??
133
+ (this._marketplace = new (require("./Marketplace"))(this)));
134
134
  }
135
135
  /** Getter for (Twilio.Messaging) domain */
136
136
  get messaging() {
@@ -31,13 +31,13 @@ export interface MessageListInstanceCreateOptions {
31
31
  statusCallback?: string;
32
32
  /** The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App\\\'s `message_status_callback` URL. Note that the `status_callback` parameter of a request takes priority over the `application_sid` parameter; if both are included `application_sid` is ignored. */
33
33
  applicationSid?: string;
34
- /** [DEPRECATED] This parameter will no longer have any effect as of 2024-06-03. */
34
+ /** [OBSOLETE] This parameter will no longer have any effect as of 2024-06-03. */
35
35
  maxPrice?: number;
36
36
  /** Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`. */
37
37
  provideFeedback?: boolean;
38
38
  /** Total number of attempts made (including this request) to send the message regardless of the provider used */
39
39
  attempt?: number;
40
- /** The maximum length in seconds that the Message can remain in Twilio\\\'s outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `14400`. Default value is `14400`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html) */
40
+ /** The maximum length in seconds that the Message can remain in Twilio\\\'s outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `36000`. Default value is `36000`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html) */
41
41
  validityPeriod?: number;
42
42
  /** Reserved */
43
43
  forceDelivery?: boolean;
@@ -274,7 +274,7 @@ export declare class MessageInstance {
274
274
  numMedia: string;
275
275
  status: MessageStatus;
276
276
  /**
277
- * The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) associated with the Message resource. The value is `null` if a Messaging Service was not used.
277
+ * The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) associated with the Message resource. A unique default value is assigned if a Messaging Service is not used.
278
278
  */
279
279
  messagingServiceSid: string;
280
280
  /**
@@ -0,0 +1,20 @@
1
+ import ContentBase from "../ContentBase";
2
+ import Version from "../../base/Version";
3
+ import { ContentListInstance } from "./v2/content";
4
+ import { ContentAndApprovalsListInstance } from "./v2/contentAndApprovals";
5
+ export default class V2 extends Version {
6
+ /**
7
+ * Initialize the V2 version of Content
8
+ *
9
+ * @param domain - The Twilio (Twilio.Content) domain
10
+ */
11
+ constructor(domain: ContentBase);
12
+ /** contents - { Twilio.Content.V2.ContentListInstance } resource */
13
+ protected _contents?: ContentListInstance;
14
+ /** contentAndApprovals - { Twilio.Content.V2.ContentAndApprovalsListInstance } resource */
15
+ protected _contentAndApprovals?: ContentAndApprovalsListInstance;
16
+ /** Getter for contents resource */
17
+ get contents(): ContentListInstance;
18
+ /** Getter for contentAndApprovals resource */
19
+ get contentAndApprovals(): ContentAndApprovalsListInstance;
20
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ /*
3
+ * This code was generated by
4
+ * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
+ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
+ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
+ *
8
+ * Twilio - Content
9
+ * This is the public Twilio REST API.
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator.
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ const Version_1 = __importDefault(require("../../base/Version"));
20
+ const content_1 = require("./v2/content");
21
+ const contentAndApprovals_1 = require("./v2/contentAndApprovals");
22
+ class V2 extends Version_1.default {
23
+ /**
24
+ * Initialize the V2 version of Content
25
+ *
26
+ * @param domain - The Twilio (Twilio.Content) domain
27
+ */
28
+ constructor(domain) {
29
+ super(domain, "v2");
30
+ }
31
+ /** Getter for contents resource */
32
+ get contents() {
33
+ this._contents = this._contents || (0, content_1.ContentListInstance)(this);
34
+ return this._contents;
35
+ }
36
+ /** Getter for contentAndApprovals resource */
37
+ get contentAndApprovals() {
38
+ this._contentAndApprovals =
39
+ this._contentAndApprovals || (0, contentAndApprovals_1.ContentAndApprovalsListInstance)(this);
40
+ return this._contentAndApprovals;
41
+ }
42
+ }
43
+ exports.default = V2;
@@ -1,33 +1,28 @@
1
1
  /// <reference types="node" />
2
2
  import { inspect, InspectOptions } from "util";
3
3
  import V1 from "../../V1";
4
- /**
5
- * Content approval request body
6
- */
7
- export declare class ContentApprovalRequest {
8
- /**
9
- * Name of the template.
10
- */
11
- "name": string;
12
- /**
13
- * A WhatsApp recognized template category.
14
- */
15
- "category": string;
16
- }
17
4
  /**
18
5
  * Options to pass to create a ApprovalCreateInstance
19
6
  */
20
7
  export interface ApprovalCreateListInstanceCreateOptions {
21
8
  /** */
22
- contentApprovalRequest: ContentApprovalRequest;
9
+ body?: object;
23
10
  }
24
11
  export interface ApprovalCreateSolution {
25
- contentSid: string;
12
+ sid: string;
26
13
  }
27
14
  export interface ApprovalCreateListInstance {
28
15
  _version: V1;
29
16
  _solution: ApprovalCreateSolution;
30
17
  _uri: string;
18
+ /**
19
+ * Create a ApprovalCreateInstance
20
+ *
21
+ * @param callback - Callback to handle processed record
22
+ *
23
+ * @returns Resolves to processed ApprovalCreateInstance
24
+ */
25
+ create(callback?: (error: Error | null, item?: ApprovalCreateInstance) => any): Promise<ApprovalCreateInstance>;
31
26
  /**
32
27
  * Create a ApprovalCreateInstance
33
28
  *
@@ -36,14 +31,14 @@ export interface ApprovalCreateListInstance {
36
31
  *
37
32
  * @returns Resolves to processed ApprovalCreateInstance
38
33
  */
39
- create(params: ContentApprovalRequest, callback?: (error: Error | null, item?: ApprovalCreateInstance) => any): Promise<ApprovalCreateInstance>;
34
+ create(params: object, callback?: (error: Error | null, item?: ApprovalCreateInstance) => any): Promise<ApprovalCreateInstance>;
40
35
  /**
41
36
  * Provide a user-friendly representation
42
37
  */
43
38
  toJSON(): any;
44
39
  [inspect.custom](_depth: any, options: InspectOptions): any;
45
40
  }
46
- export declare function ApprovalCreateListInstance(version: V1, contentSid: string): ApprovalCreateListInstance;
41
+ export declare function ApprovalCreateListInstance(version: V1, sid: string): ApprovalCreateListInstance;
47
42
  interface ApprovalCreateResource {
48
43
  name: string;
49
44
  category: string;
@@ -54,7 +49,7 @@ interface ApprovalCreateResource {
54
49
  }
55
50
  export declare class ApprovalCreateInstance {
56
51
  protected _version: V1;
57
- constructor(_version: V1, payload: ApprovalCreateResource, contentSid: string);
52
+ constructor(_version: V1, payload: ApprovalCreateResource, sid: string);
58
53
  name: string;
59
54
  category: string;
60
55
  contentType: string;
@@ -13,28 +13,26 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.ApprovalCreateInstance = exports.ApprovalCreateListInstance = exports.ContentApprovalRequest = void 0;
16
+ exports.ApprovalCreateInstance = exports.ApprovalCreateListInstance = void 0;
17
17
  const util_1 = require("util");
18
18
  const deserialize = require("../../../../base/deserialize");
19
19
  const serialize = require("../../../../base/serialize");
20
20
  const utility_1 = require("../../../../base/utility");
21
- /**
22
- * Content approval request body
23
- */
24
- class ContentApprovalRequest {
25
- }
26
- exports.ContentApprovalRequest = ContentApprovalRequest;
27
- function ApprovalCreateListInstance(version, contentSid) {
28
- if (!(0, utility_1.isValidPathParam)(contentSid)) {
29
- throw new Error("Parameter 'contentSid' is not valid.");
21
+ function ApprovalCreateListInstance(version, sid) {
22
+ if (!(0, utility_1.isValidPathParam)(sid)) {
23
+ throw new Error("Parameter 'sid' is not valid.");
30
24
  }
31
25
  const instance = {};
32
26
  instance._version = version;
33
- instance._solution = { contentSid };
34
- instance._uri = `/Content/${contentSid}/ApprovalRequests/whatsapp`;
27
+ instance._solution = { sid };
28
+ instance._uri = `/Content/${sid}/ApprovalRequests/whatsapp`;
35
29
  instance.create = function create(params, callback) {
36
- if (params === null || params === undefined) {
37
- throw new Error('Required parameter "params" missing.');
30
+ if (params instanceof Function) {
31
+ callback = params;
32
+ params = {};
33
+ }
34
+ else {
35
+ params = params || {};
38
36
  }
39
37
  let data = {};
40
38
  data = params;
@@ -46,7 +44,7 @@ function ApprovalCreateListInstance(version, contentSid) {
46
44
  data,
47
45
  headers,
48
46
  });
49
- operationPromise = operationPromise.then((payload) => new ApprovalCreateInstance(operationVersion, payload, instance._solution.contentSid));
47
+ operationPromise = operationPromise.then((payload) => new ApprovalCreateInstance(operationVersion, payload, instance._solution.sid));
50
48
  operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
51
49
  return operationPromise;
52
50
  };
@@ -60,7 +58,7 @@ function ApprovalCreateListInstance(version, contentSid) {
60
58
  }
61
59
  exports.ApprovalCreateListInstance = ApprovalCreateListInstance;
62
60
  class ApprovalCreateInstance {
63
- constructor(_version, payload, contentSid) {
61
+ constructor(_version, payload, sid) {
64
62
  this._version = _version;
65
63
  this.name = payload.name;
66
64
  this.category = payload.category;
@@ -17,13 +17,13 @@ export interface ApprovalFetchContext {
17
17
  [inspect.custom](_depth: any, options: InspectOptions): any;
18
18
  }
19
19
  export interface ApprovalFetchContextSolution {
20
- contentSid: string;
20
+ sid: string;
21
21
  }
22
22
  export declare class ApprovalFetchContextImpl implements ApprovalFetchContext {
23
23
  protected _version: V1;
24
24
  protected _solution: ApprovalFetchContextSolution;
25
25
  protected _uri: string;
26
- constructor(_version: V1, contentSid: string);
26
+ constructor(_version: V1, sid: string);
27
27
  fetch(callback?: (error: Error | null, item?: ApprovalFetchInstance) => any): Promise<ApprovalFetchInstance>;
28
28
  /**
29
29
  * Provide a user-friendly representation
@@ -43,7 +43,7 @@ export declare class ApprovalFetchInstance {
43
43
  protected _version: V1;
44
44
  protected _solution: ApprovalFetchContextSolution;
45
45
  protected _context?: ApprovalFetchContext;
46
- constructor(_version: V1, payload: ApprovalFetchResource, contentSid: string);
46
+ constructor(_version: V1, payload: ApprovalFetchResource, sid: string);
47
47
  /**
48
48
  * The unique string that that we created to identify the Content resource.
49
49
  */
@@ -83,7 +83,7 @@ export declare class ApprovalFetchInstance {
83
83
  [inspect.custom](_depth: any, options: InspectOptions): string;
84
84
  }
85
85
  export interface ApprovalFetchSolution {
86
- contentSid: string;
86
+ sid: string;
87
87
  }
88
88
  export interface ApprovalFetchListInstance {
89
89
  _version: V1;
@@ -97,5 +97,5 @@ export interface ApprovalFetchListInstance {
97
97
  toJSON(): any;
98
98
  [inspect.custom](_depth: any, options: InspectOptions): any;
99
99
  }
100
- export declare function ApprovalFetchListInstance(version: V1, contentSid: string): ApprovalFetchListInstance;
100
+ export declare function ApprovalFetchListInstance(version: V1, sid: string): ApprovalFetchListInstance;
101
101
  export {};
@@ -19,13 +19,13 @@ const deserialize = require("../../../../base/deserialize");
19
19
  const serialize = require("../../../../base/serialize");
20
20
  const utility_1 = require("../../../../base/utility");
21
21
  class ApprovalFetchContextImpl {
22
- constructor(_version, contentSid) {
22
+ constructor(_version, sid) {
23
23
  this._version = _version;
24
- if (!(0, utility_1.isValidPathParam)(contentSid)) {
25
- throw new Error("Parameter 'contentSid' is not valid.");
24
+ if (!(0, utility_1.isValidPathParam)(sid)) {
25
+ throw new Error("Parameter 'sid' is not valid.");
26
26
  }
27
- this._solution = { contentSid };
28
- this._uri = `/Content/${contentSid}/ApprovalRequests`;
27
+ this._solution = { sid };
28
+ this._uri = `/Content/${sid}/ApprovalRequests`;
29
29
  }
30
30
  fetch(callback) {
31
31
  const instance = this;
@@ -33,7 +33,7 @@ class ApprovalFetchContextImpl {
33
33
  uri: instance._uri,
34
34
  method: "get",
35
35
  });
36
- operationPromise = operationPromise.then((payload) => new ApprovalFetchInstance(operationVersion, payload, instance._solution.contentSid));
36
+ operationPromise = operationPromise.then((payload) => new ApprovalFetchInstance(operationVersion, payload, instance._solution.sid));
37
37
  operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
38
38
  return operationPromise;
39
39
  }
@@ -51,18 +51,18 @@ class ApprovalFetchContextImpl {
51
51
  }
52
52
  exports.ApprovalFetchContextImpl = ApprovalFetchContextImpl;
53
53
  class ApprovalFetchInstance {
54
- constructor(_version, payload, contentSid) {
54
+ constructor(_version, payload, sid) {
55
55
  this._version = _version;
56
56
  this.sid = payload.sid;
57
57
  this.accountSid = payload.account_sid;
58
58
  this.whatsapp = payload.whatsapp;
59
59
  this.url = payload.url;
60
- this._solution = { contentSid };
60
+ this._solution = { sid };
61
61
  }
62
62
  get _proxy() {
63
63
  this._context =
64
64
  this._context ||
65
- new ApprovalFetchContextImpl(this._version, this._solution.contentSid);
65
+ new ApprovalFetchContextImpl(this._version, this._solution.sid);
66
66
  return this._context;
67
67
  }
68
68
  /**
@@ -93,16 +93,16 @@ class ApprovalFetchInstance {
93
93
  }
94
94
  }
95
95
  exports.ApprovalFetchInstance = ApprovalFetchInstance;
96
- function ApprovalFetchListInstance(version, contentSid) {
97
- if (!(0, utility_1.isValidPathParam)(contentSid)) {
98
- throw new Error("Parameter 'contentSid' is not valid.");
96
+ function ApprovalFetchListInstance(version, sid) {
97
+ if (!(0, utility_1.isValidPathParam)(sid)) {
98
+ throw new Error("Parameter 'sid' is not valid.");
99
99
  }
100
100
  const instance = (() => instance.get());
101
101
  instance.get = function get() {
102
- return new ApprovalFetchContextImpl(version, contentSid);
102
+ return new ApprovalFetchContextImpl(version, sid);
103
103
  };
104
104
  instance._version = version;
105
- instance._solution = { contentSid };
105
+ instance._solution = { sid };
106
106
  instance._uri = ``;
107
107
  instance.toJSON = function toJSON() {
108
108
  return instance._solution;