twilio 5.1.1 → 5.2.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 (37) hide show
  1. package/lib/base/BaseTwilio.js +2 -1
  2. package/lib/rest/PreviewIam.d.ts +4 -0
  3. package/lib/rest/PreviewIam.js +8 -0
  4. package/lib/rest/PreviewIamBase.d.ts +10 -0
  5. package/lib/rest/PreviewIamBase.js +26 -0
  6. package/lib/rest/Twilio.d.ts +5 -0
  7. package/lib/rest/Twilio.js +6 -0
  8. package/lib/rest/api/v2010/account/call/transcription.d.ts +572 -0
  9. package/lib/rest/api/v2010/account/call/transcription.js +578 -0
  10. package/lib/rest/api/v2010/account/call.d.ts +9 -1
  11. package/lib/rest/api/v2010/account/call.js +13 -0
  12. package/lib/rest/api/v2010/account/recording.d.ts +1 -1
  13. package/lib/rest/content/v1/content/approvalCreate.d.ts +18 -13
  14. package/lib/rest/content/v1/content/approvalCreate.js +16 -14
  15. package/lib/rest/content/v1/content/approvalFetch.d.ts +5 -5
  16. package/lib/rest/content/v1/content/approvalFetch.js +14 -14
  17. package/lib/rest/content/v1/content.d.ts +159 -11
  18. package/lib/rest/content/v1/content.js +93 -7
  19. package/lib/rest/content/v1/contentAndApprovals.d.ts +1 -1
  20. package/lib/rest/content/v1/legacyContent.d.ts +1 -1
  21. package/lib/rest/events/v1/eventType.d.ts +12 -0
  22. package/lib/rest/events/v1/eventType.js +4 -0
  23. package/lib/rest/marketplace/v1/installedAddOn/installedAddOnUsage.d.ts +9 -9
  24. package/lib/rest/marketplace/v1/installedAddOn/installedAddOnUsage.js +7 -7
  25. package/lib/rest/numbers/v1/portingPortIn.d.ts +3 -0
  26. package/lib/rest/numbers/v1/portingPortIn.js +2 -0
  27. package/lib/rest/numbers/v1/portingPortInPhoneNumber.d.ts +24 -6
  28. package/lib/rest/numbers/v1/portingPortInPhoneNumber.js +9 -3
  29. package/lib/rest/numbers/v1/portingPortability.d.ts +0 -12
  30. package/lib/rest/numbers/v1/portingPortability.js +0 -4
  31. package/lib/rest/numbers/v2/regulatoryCompliance/regulation.d.ts +32 -1
  32. package/lib/rest/numbers/v2/regulatoryCompliance/regulation.js +18 -10
  33. package/lib/rest/trusthub/v1/complianceTollfreeInquiries.d.ts +2 -0
  34. package/lib/rest/trusthub/v1/complianceTollfreeInquiries.js +2 -0
  35. package/lib/twiml/VoiceResponse.d.ts +113 -0
  36. package/lib/twiml/VoiceResponse.js +43 -0
  37. package/package.json +1 -1
@@ -28,6 +28,7 @@ const payment_1 = require("./call/payment");
28
28
  const recording_1 = require("./call/recording");
29
29
  const siprec_1 = require("./call/siprec");
30
30
  const stream_1 = require("./call/stream");
31
+ const transcription_1 = require("./call/transcription");
31
32
  const userDefinedMessage_1 = require("./call/userDefinedMessage");
32
33
  const userDefinedMessageSubscription_1 = require("./call/userDefinedMessageSubscription");
33
34
  class CallContextImpl {
@@ -78,6 +79,12 @@ class CallContextImpl {
78
79
  (0, stream_1.StreamListInstance)(this._version, this._solution.accountSid, this._solution.sid);
79
80
  return this._streams;
80
81
  }
82
+ get transcriptions() {
83
+ this._transcriptions =
84
+ this._transcriptions ||
85
+ (0, transcription_1.TranscriptionListInstance)(this._version, this._solution.accountSid, this._solution.sid);
86
+ return this._transcriptions;
87
+ }
81
88
  get userDefinedMessages() {
82
89
  this._userDefinedMessages =
83
90
  this._userDefinedMessages ||
@@ -258,6 +265,12 @@ class CallInstance {
258
265
  streams() {
259
266
  return this._proxy.streams;
260
267
  }
268
+ /**
269
+ * Access the transcriptions.
270
+ */
271
+ transcriptions() {
272
+ return this._proxy.transcriptions;
273
+ }
261
274
  /**
262
275
  * Access the userDefinedMessages.
263
276
  */
@@ -215,7 +215,7 @@ export declare class RecordingInstance {
215
215
  priceUnit: string;
216
216
  status: RecordingStatus;
217
217
  /**
218
- * The number of channels in the final recording file. Can be: `1` or `2`. You can split a call with two legs into two separate recording channels if you record using [TwiML Dial](https://www.twilio.com/docs/voice/twiml/dial#record) or the [Outbound Rest API](https://www.twilio.com/docs/voice/make-calls#manage-your-outbound-call).
218
+ * The number of channels in the final recording file. Can be: `1` or `2`.
219
219
  */
220
220
  channels: number;
221
221
  source: RecordingSource;
@@ -1,28 +1,33 @@
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
+ }
4
17
  /**
5
18
  * Options to pass to create a ApprovalCreateInstance
6
19
  */
7
20
  export interface ApprovalCreateListInstanceCreateOptions {
8
21
  /** */
9
- body?: object;
22
+ contentApprovalRequest: ContentApprovalRequest;
10
23
  }
11
24
  export interface ApprovalCreateSolution {
12
- sid: string;
25
+ contentSid: string;
13
26
  }
14
27
  export interface ApprovalCreateListInstance {
15
28
  _version: V1;
16
29
  _solution: ApprovalCreateSolution;
17
30
  _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>;
26
31
  /**
27
32
  * Create a ApprovalCreateInstance
28
33
  *
@@ -31,14 +36,14 @@ export interface ApprovalCreateListInstance {
31
36
  *
32
37
  * @returns Resolves to processed ApprovalCreateInstance
33
38
  */
34
- create(params: object, callback?: (error: Error | null, item?: ApprovalCreateInstance) => any): Promise<ApprovalCreateInstance>;
39
+ create(params: ContentApprovalRequest, callback?: (error: Error | null, item?: ApprovalCreateInstance) => any): Promise<ApprovalCreateInstance>;
35
40
  /**
36
41
  * Provide a user-friendly representation
37
42
  */
38
43
  toJSON(): any;
39
44
  [inspect.custom](_depth: any, options: InspectOptions): any;
40
45
  }
41
- export declare function ApprovalCreateListInstance(version: V1, sid: string): ApprovalCreateListInstance;
46
+ export declare function ApprovalCreateListInstance(version: V1, contentSid: string): ApprovalCreateListInstance;
42
47
  interface ApprovalCreateResource {
43
48
  name: string;
44
49
  category: string;
@@ -49,7 +54,7 @@ interface ApprovalCreateResource {
49
54
  }
50
55
  export declare class ApprovalCreateInstance {
51
56
  protected _version: V1;
52
- constructor(_version: V1, payload: ApprovalCreateResource, sid: string);
57
+ constructor(_version: V1, payload: ApprovalCreateResource, contentSid: string);
53
58
  name: string;
54
59
  category: string;
55
60
  contentType: string;
@@ -13,26 +13,28 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.ApprovalCreateInstance = exports.ApprovalCreateListInstance = void 0;
16
+ exports.ApprovalCreateInstance = exports.ApprovalCreateListInstance = exports.ContentApprovalRequest = 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
- function ApprovalCreateListInstance(version, sid) {
22
- if (!(0, utility_1.isValidPathParam)(sid)) {
23
- throw new Error("Parameter 'sid' is not valid.");
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.");
24
30
  }
25
31
  const instance = {};
26
32
  instance._version = version;
27
- instance._solution = { sid };
28
- instance._uri = `/Content/${sid}/ApprovalRequests/whatsapp`;
33
+ instance._solution = { contentSid };
34
+ instance._uri = `/Content/${contentSid}/ApprovalRequests/whatsapp`;
29
35
  instance.create = function create(params, callback) {
30
- if (params instanceof Function) {
31
- callback = params;
32
- params = {};
33
- }
34
- else {
35
- params = params || {};
36
+ if (params === null || params === undefined) {
37
+ throw new Error('Required parameter "params" missing.');
36
38
  }
37
39
  let data = {};
38
40
  data = params;
@@ -44,7 +46,7 @@ function ApprovalCreateListInstance(version, sid) {
44
46
  data,
45
47
  headers,
46
48
  });
47
- operationPromise = operationPromise.then((payload) => new ApprovalCreateInstance(operationVersion, payload, instance._solution.sid));
49
+ operationPromise = operationPromise.then((payload) => new ApprovalCreateInstance(operationVersion, payload, instance._solution.contentSid));
48
50
  operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
49
51
  return operationPromise;
50
52
  };
@@ -58,7 +60,7 @@ function ApprovalCreateListInstance(version, sid) {
58
60
  }
59
61
  exports.ApprovalCreateListInstance = ApprovalCreateListInstance;
60
62
  class ApprovalCreateInstance {
61
- constructor(_version, payload, sid) {
63
+ constructor(_version, payload, contentSid) {
62
64
  this._version = _version;
63
65
  this.name = payload.name;
64
66
  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
- sid: string;
20
+ contentSid: 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, sid: string);
26
+ constructor(_version: V1, contentSid: 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, sid: string);
46
+ constructor(_version: V1, payload: ApprovalFetchResource, contentSid: 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
- sid: string;
86
+ contentSid: 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, sid: string): ApprovalFetchListInstance;
100
+ export declare function ApprovalFetchListInstance(version: V1, contentSid: 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, sid) {
22
+ constructor(_version, contentSid) {
23
23
  this._version = _version;
24
- if (!(0, utility_1.isValidPathParam)(sid)) {
25
- throw new Error("Parameter 'sid' is not valid.");
24
+ if (!(0, utility_1.isValidPathParam)(contentSid)) {
25
+ throw new Error("Parameter 'contentSid' is not valid.");
26
26
  }
27
- this._solution = { sid };
28
- this._uri = `/Content/${sid}/ApprovalRequests`;
27
+ this._solution = { contentSid };
28
+ this._uri = `/Content/${contentSid}/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.sid));
36
+ operationPromise = operationPromise.then((payload) => new ApprovalFetchInstance(operationVersion, payload, instance._solution.contentSid));
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, sid) {
54
+ constructor(_version, payload, contentSid) {
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 = { sid };
60
+ this._solution = { contentSid };
61
61
  }
62
62
  get _proxy() {
63
63
  this._context =
64
64
  this._context ||
65
- new ApprovalFetchContextImpl(this._version, this._solution.sid);
65
+ new ApprovalFetchContextImpl(this._version, this._solution.contentSid);
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, sid) {
97
- if (!(0, utility_1.isValidPathParam)(sid)) {
98
- throw new Error("Parameter 'sid' is not valid.");
96
+ function ApprovalFetchListInstance(version, contentSid) {
97
+ if (!(0, utility_1.isValidPathParam)(contentSid)) {
98
+ throw new Error("Parameter 'contentSid' is not valid.");
99
99
  }
100
100
  const instance = (() => instance.get());
101
101
  instance.get = function get() {
102
- return new ApprovalFetchContextImpl(version, sid);
102
+ return new ApprovalFetchContextImpl(version, contentSid);
103
103
  };
104
104
  instance._version = version;
105
- instance._solution = { sid };
105
+ instance._solution = { contentSid };
106
106
  instance._uri = ``;
107
107
  instance.toJSON = function toJSON() {
108
108
  return instance._solution;
@@ -5,12 +5,168 @@ import Response from "../../../http/response";
5
5
  import V1 from "../V1";
6
6
  import { ApprovalCreateListInstance } from "./content/approvalCreate";
7
7
  import { ApprovalFetchListInstance } from "./content/approvalFetch";
8
+ export declare class AuthenticationAction {
9
+ "type": AuthenticationActionType;
10
+ "copyCodeText": string;
11
+ }
12
+ export type AuthenticationActionType = "COPY_CODE";
13
+ export declare class CallToActionAction {
14
+ "type": CallToActionActionType;
15
+ "title": string;
16
+ "url"?: string;
17
+ "phone"?: string;
18
+ "id"?: string;
19
+ }
20
+ export type CallToActionActionType = "URL" | "PHONE_NUMBER";
21
+ export declare class CardAction {
22
+ "type": CardActionType;
23
+ "title": string;
24
+ "url"?: string;
25
+ "phone"?: string;
26
+ "id"?: string;
27
+ }
28
+ export type CardActionType = "URL" | "PHONE_NUMBER" | "QUICK_REPLY";
29
+ export declare class CatalogItem {
30
+ "id"?: string;
31
+ "sectionTitle"?: string;
32
+ "name"?: string;
33
+ "mediaUrl"?: string;
34
+ "price"?: number;
35
+ "description"?: string;
36
+ }
37
+ /**
38
+ * Content creation request body
39
+ */
40
+ export declare class ContentCreateRequest {
41
+ /**
42
+ * User defined name of the content
43
+ */
44
+ "friendlyName"?: string;
45
+ /**
46
+ * Key value pairs of variable name to value
47
+ */
48
+ "variables"?: {
49
+ [key: string]: string;
50
+ };
51
+ /**
52
+ * Language code for the content
53
+ */
54
+ "language": string;
55
+ "types": Types;
56
+ }
57
+ export declare class ListItem {
58
+ "id": string;
59
+ "item": string;
60
+ "description"?: string;
61
+ }
62
+ export declare class QuickReplyAction {
63
+ "type": QuickReplyActionType;
64
+ "title": string;
65
+ "id"?: string;
66
+ }
67
+ export type QuickReplyActionType = "QUICK_REPLY";
68
+ /**
69
+ * twilio/call-to-action buttons let recipients tap to trigger actions such as launching a website or making a phone call.
70
+ */
71
+ export declare class TwilioCallToAction {
72
+ "body"?: string;
73
+ "actions"?: Array<CallToActionAction>;
74
+ }
75
+ /**
76
+ * twilio/card is a structured template which can be used to send a series of related information. It must include a title and at least one additional field.
77
+ */
78
+ export declare class TwilioCard {
79
+ "title": string;
80
+ "subtitle"?: string;
81
+ "media"?: Array<string>;
82
+ "actions"?: Array<CardAction>;
83
+ }
84
+ /**
85
+ * twilio/catalog type lets recipients view list of catalog products, ask questions about products, order products.
86
+ */
87
+ export declare class TwilioCatalog {
88
+ "title"?: string;
89
+ "body": string;
90
+ "subtitle"?: string;
91
+ "id"?: string;
92
+ "items"?: Array<CatalogItem>;
93
+ "dynamicItems"?: string;
94
+ }
95
+ /**
96
+ * twilio/list-picker includes a menu of up to 10 options, which offers a simple way for users to make a selection.
97
+ */
98
+ export declare class TwilioListPicker {
99
+ "body": string;
100
+ "button": string;
101
+ "items": Array<ListItem>;
102
+ }
103
+ /**
104
+ * twilio/location type contains a location pin and an optional label, which can be used to enhance delivery notifications or connect recipients to physical experiences you offer.
105
+ */
106
+ export declare class TwilioLocation {
107
+ "latitude": number;
108
+ "longitude": number;
109
+ "label"?: string;
110
+ }
111
+ /**
112
+ * twilio/media is used to send file attachments, or to send long text via MMS in the US and Canada. As such, the twilio/media type must contain at least ONE of text or media content.
113
+ */
114
+ export declare class TwilioMedia {
115
+ "body"?: string;
116
+ "media": Array<string>;
117
+ }
118
+ /**
119
+ * twilio/quick-reply templates let recipients tap, rather than type, to respond to the message.
120
+ */
121
+ export declare class TwilioQuickReply {
122
+ "body": string;
123
+ "actions": Array<QuickReplyAction>;
124
+ }
125
+ /**
126
+ * Type containing only plain text-based content
127
+ */
128
+ export declare class TwilioText {
129
+ "body": string;
130
+ }
131
+ /**
132
+ * Content types
133
+ */
134
+ export declare class Types {
135
+ "twilioText"?: TwilioText | null;
136
+ "twilioMedia"?: TwilioMedia | null;
137
+ "twilioLocation"?: TwilioLocation | null;
138
+ "twilioListPicker"?: TwilioListPicker | null;
139
+ "twilioCallToAction"?: TwilioCallToAction | null;
140
+ "twilioQuickReply"?: TwilioQuickReply | null;
141
+ "twilioCard"?: TwilioCard | null;
142
+ "twilioCatalog"?: TwilioCatalog | null;
143
+ "whatsappCard"?: WhatsappCard | null;
144
+ "whatsappAuthentication"?: WhatsappAuthentication | null;
145
+ }
146
+ /**
147
+ * whatsApp/authentication templates let companies deliver WA approved one-time-password button.
148
+ */
149
+ export declare class WhatsappAuthentication {
150
+ "addSecurityRecommendation"?: boolean;
151
+ "codeExpirationMinutes"?: number;
152
+ "actions": Array<AuthenticationAction>;
153
+ }
154
+ /**
155
+ * whatsapp/card is a structured template which can be used to send a series of related information. It must include a body and at least one additional field.
156
+ */
157
+ export declare class WhatsappCard {
158
+ "body": string;
159
+ "footer"?: string;
160
+ "media"?: Array<string>;
161
+ "headerText"?: string;
162
+ "actions"?: Array<CardAction>;
163
+ }
8
164
  /**
9
165
  * Options to pass to create a ContentInstance
10
166
  */
11
167
  export interface ContentListInstanceCreateOptions {
12
168
  /** */
13
- body?: object;
169
+ contentCreateRequest: ContentCreateRequest;
14
170
  }
15
171
  /**
16
172
  * Options to pass to each
@@ -141,7 +297,7 @@ export declare class ContentInstance {
141
297
  */
142
298
  variables: any;
143
299
  /**
144
- * The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource.
300
+ * The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource.
145
301
  */
146
302
  types: any;
147
303
  /**
@@ -204,14 +360,6 @@ export interface ContentListInstance {
204
360
  _uri: string;
205
361
  (sid: string): ContentContext;
206
362
  get(sid: string): ContentContext;
207
- /**
208
- * Create a ContentInstance
209
- *
210
- * @param callback - Callback to handle processed record
211
- *
212
- * @returns Resolves to processed ContentInstance
213
- */
214
- create(callback?: (error: Error | null, item?: ContentInstance) => any): Promise<ContentInstance>;
215
363
  /**
216
364
  * Create a ContentInstance
217
365
  *
@@ -220,7 +368,7 @@ export interface ContentListInstance {
220
368
  *
221
369
  * @returns Resolves to processed ContentInstance
222
370
  */
223
- create(params: object, callback?: (error: Error | null, item?: ContentInstance) => any): Promise<ContentInstance>;
371
+ create(params: ContentCreateRequest, callback?: (error: Error | null, item?: ContentInstance) => any): Promise<ContentInstance>;
224
372
  /**
225
373
  * Streams ContentInstance records from the API.
226
374
  *
@@ -16,7 +16,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  return (mod && mod.__esModule) ? mod : { "default": mod };
17
17
  };
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.ContentPage = exports.ContentListInstance = exports.ContentInstance = exports.ContentContextImpl = void 0;
19
+ exports.ContentPage = exports.ContentListInstance = exports.ContentInstance = exports.ContentContextImpl = exports.WhatsappCard = exports.WhatsappAuthentication = exports.Types = exports.TwilioText = exports.TwilioQuickReply = exports.TwilioMedia = exports.TwilioLocation = exports.TwilioListPicker = exports.TwilioCatalog = exports.TwilioCard = exports.TwilioCallToAction = exports.QuickReplyAction = exports.ListItem = exports.ContentCreateRequest = exports.CatalogItem = exports.CardAction = exports.CallToActionAction = exports.AuthenticationAction = void 0;
20
20
  const util_1 = require("util");
21
21
  const Page_1 = __importDefault(require("../../../base/Page"));
22
22
  const deserialize = require("../../../base/deserialize");
@@ -24,6 +24,96 @@ const serialize = require("../../../base/serialize");
24
24
  const utility_1 = require("../../../base/utility");
25
25
  const approvalCreate_1 = require("./content/approvalCreate");
26
26
  const approvalFetch_1 = require("./content/approvalFetch");
27
+ class AuthenticationAction {
28
+ }
29
+ exports.AuthenticationAction = AuthenticationAction;
30
+ class CallToActionAction {
31
+ }
32
+ exports.CallToActionAction = CallToActionAction;
33
+ class CardAction {
34
+ }
35
+ exports.CardAction = CardAction;
36
+ class CatalogItem {
37
+ }
38
+ exports.CatalogItem = CatalogItem;
39
+ /**
40
+ * Content creation request body
41
+ */
42
+ class ContentCreateRequest {
43
+ }
44
+ exports.ContentCreateRequest = ContentCreateRequest;
45
+ class ListItem {
46
+ }
47
+ exports.ListItem = ListItem;
48
+ class QuickReplyAction {
49
+ }
50
+ exports.QuickReplyAction = QuickReplyAction;
51
+ /**
52
+ * twilio/call-to-action buttons let recipients tap to trigger actions such as launching a website or making a phone call.
53
+ */
54
+ class TwilioCallToAction {
55
+ }
56
+ exports.TwilioCallToAction = TwilioCallToAction;
57
+ /**
58
+ * twilio/card is a structured template which can be used to send a series of related information. It must include a title and at least one additional field.
59
+ */
60
+ class TwilioCard {
61
+ }
62
+ exports.TwilioCard = TwilioCard;
63
+ /**
64
+ * twilio/catalog type lets recipients view list of catalog products, ask questions about products, order products.
65
+ */
66
+ class TwilioCatalog {
67
+ }
68
+ exports.TwilioCatalog = TwilioCatalog;
69
+ /**
70
+ * twilio/list-picker includes a menu of up to 10 options, which offers a simple way for users to make a selection.
71
+ */
72
+ class TwilioListPicker {
73
+ }
74
+ exports.TwilioListPicker = TwilioListPicker;
75
+ /**
76
+ * twilio/location type contains a location pin and an optional label, which can be used to enhance delivery notifications or connect recipients to physical experiences you offer.
77
+ */
78
+ class TwilioLocation {
79
+ }
80
+ exports.TwilioLocation = TwilioLocation;
81
+ /**
82
+ * twilio/media is used to send file attachments, or to send long text via MMS in the US and Canada. As such, the twilio/media type must contain at least ONE of text or media content.
83
+ */
84
+ class TwilioMedia {
85
+ }
86
+ exports.TwilioMedia = TwilioMedia;
87
+ /**
88
+ * twilio/quick-reply templates let recipients tap, rather than type, to respond to the message.
89
+ */
90
+ class TwilioQuickReply {
91
+ }
92
+ exports.TwilioQuickReply = TwilioQuickReply;
93
+ /**
94
+ * Type containing only plain text-based content
95
+ */
96
+ class TwilioText {
97
+ }
98
+ exports.TwilioText = TwilioText;
99
+ /**
100
+ * Content types
101
+ */
102
+ class Types {
103
+ }
104
+ exports.Types = Types;
105
+ /**
106
+ * whatsApp/authentication templates let companies deliver WA approved one-time-password button.
107
+ */
108
+ class WhatsappAuthentication {
109
+ }
110
+ exports.WhatsappAuthentication = WhatsappAuthentication;
111
+ /**
112
+ * whatsapp/card is a structured template which can be used to send a series of related information. It must include a body and at least one additional field.
113
+ */
114
+ class WhatsappCard {
115
+ }
116
+ exports.WhatsappCard = WhatsappCard;
27
117
  class ContentContextImpl {
28
118
  constructor(_version, sid) {
29
119
  this._version = _version;
@@ -163,12 +253,8 @@ function ContentListInstance(version) {
163
253
  instance._solution = {};
164
254
  instance._uri = `/Content`;
165
255
  instance.create = function create(params, callback) {
166
- if (params instanceof Function) {
167
- callback = params;
168
- params = {};
169
- }
170
- else {
171
- params = params || {};
256
+ if (params === null || params === undefined) {
257
+ throw new Error('Required parameter "params" missing.');
172
258
  }
173
259
  let data = {};
174
260
  data = params;
@@ -145,7 +145,7 @@ export declare class ContentAndApprovalsInstance {
145
145
  */
146
146
  variables: any;
147
147
  /**
148
- * The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource.
148
+ * The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource.
149
149
  */
150
150
  types: any;
151
151
  /**
@@ -147,7 +147,7 @@ export declare class LegacyContentInstance {
147
147
  */
148
148
  variables: any;
149
149
  /**
150
- * The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource.
150
+ * The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource.
151
151
  */
152
152
  types: any;
153
153
  /**
@@ -83,6 +83,8 @@ interface EventTypeResource {
83
83
  date_created: Date;
84
84
  date_updated: Date;
85
85
  description: string;
86
+ status: string;
87
+ documentation_url: string;
86
88
  url: string;
87
89
  links: Record<string, string>;
88
90
  }
@@ -111,6 +113,14 @@ export declare class EventTypeInstance {
111
113
  * A human readable description for this Event Type.
112
114
  */
113
115
  description: string;
116
+ /**
117
+ * A string that describes how this Event Type can be used. For example: `available`, `deprecated`, `restricted`, `discontinued`. When the status is `available`, the Event Type can be used normally.
118
+ */
119
+ status: string;
120
+ /**
121
+ * The URL to the documentation or to the most relevant Twilio Changelog entry of this Event Type.
122
+ */
123
+ documentationUrl: string;
114
124
  /**
115
125
  * The URL of this resource.
116
126
  */
@@ -136,6 +146,8 @@ export declare class EventTypeInstance {
136
146
  dateCreated: Date;
137
147
  dateUpdated: Date;
138
148
  description: string;
149
+ status: string;
150
+ documentationUrl: string;
139
151
  url: string;
140
152
  links: Record<string, string>;
141
153
  };
@@ -62,6 +62,8 @@ class EventTypeInstance {
62
62
  this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
63
63
  this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
64
64
  this.description = payload.description;
65
+ this.status = payload.status;
66
+ this.documentationUrl = payload.documentation_url;
65
67
  this.url = payload.url;
66
68
  this.links = payload.links;
67
69
  this._solution = { type: type || this.type };
@@ -94,6 +96,8 @@ class EventTypeInstance {
94
96
  dateCreated: this.dateCreated,
95
97
  dateUpdated: this.dateUpdated,
96
98
  description: this.description,
99
+ status: this.status,
100
+ documentationUrl: this.documentationUrl,
97
101
  url: this.url,
98
102
  links: this.links,
99
103
  };