twilio 5.1.1 → 5.2.0

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.
@@ -108,7 +108,8 @@ var Twilio;
108
108
  headers["User-Agent"] += ` ${extension}`;
109
109
  });
110
110
  headers["Accept-Charset"] = "utf-8";
111
- if (opts.method === "post" && !headers["Content-Type"]) {
111
+ if ((opts.method === "post" || opts.method === "put") &&
112
+ !headers["Content-Type"]) {
112
113
  headers["Content-Type"] = "application/x-www-form-urlencoded";
113
114
  }
114
115
  if (!headers["Accept"]) {
@@ -379,7 +379,7 @@ export declare class CallInstance {
379
379
  */
380
380
  duration: string;
381
381
  /**
382
- * The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available.
382
+ * The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available. The price associated with a call only reflects the charge for connectivity. Charges for other call-related features such as Answering Machine Detection, Text-To-Speech, and SIP REFER are not included in this value.
383
383
  */
384
384
  price: string;
385
385
  /**
@@ -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
  };
@@ -61,6 +61,7 @@ interface PortingPortInResource {
61
61
  losing_carrier_information: any;
62
62
  phone_numbers: Array<any>;
63
63
  documents: Array<string>;
64
+ date_created: Date;
64
65
  }
65
66
  export declare class PortingPortInInstance {
66
67
  protected _version: V1;
@@ -111,6 +112,7 @@ export declare class PortingPortInInstance {
111
112
  * The list of documents SID referencing a utility bills
112
113
  */
113
114
  documents: Array<string>;
115
+ dateCreated: Date;
114
116
  private get _proxy();
115
117
  /**
116
118
  * Remove a PortingPortInInstance
@@ -145,6 +147,7 @@ export declare class PortingPortInInstance {
145
147
  losingCarrierInformation: any;
146
148
  phoneNumbers: any[];
147
149
  documents: string[];
150
+ dateCreated: Date;
148
151
  };
149
152
  [inspect.custom](_depth: any, options: InspectOptions): string;
150
153
  }
@@ -73,6 +73,7 @@ class PortingPortInInstance {
73
73
  this.losingCarrierInformation = payload.losing_carrier_information;
74
74
  this.phoneNumbers = payload.phone_numbers;
75
75
  this.documents = payload.documents;
76
+ this.dateCreated = deserialize.iso8601Date(payload.date_created);
76
77
  this._solution = {
77
78
  portInRequestSid: portInRequestSid || this.portInRequestSid,
78
79
  };
@@ -121,6 +122,7 @@ class PortingPortInInstance {
121
122
  losingCarrierInformation: this.losingCarrierInformation,
122
123
  phoneNumbers: this.phoneNumbers,
123
124
  documents: this.documents,
125
+ dateCreated: this.dateCreated,
124
126
  };
125
127
  }
126
128
  [util_1.inspect.custom](_depth, options) {
@@ -52,12 +52,15 @@ interface PortingPortInPhoneNumberResource {
52
52
  date_created: Date;
53
53
  country: string;
54
54
  missing_required_fields: boolean;
55
- status_last_time_updated_timestamp: Date;
55
+ last_updated: Date;
56
56
  phone_number: string;
57
57
  portable: boolean;
58
58
  not_portability_reason: string;
59
- not_portability_reason_code: string;
59
+ not_portability_reason_code: number;
60
60
  port_in_phone_number_status: string;
61
+ port_out_pin: number;
62
+ rejection_reason: string;
63
+ rejection_reason_code: number;
61
64
  }
62
65
  export declare class PortingPortInPhoneNumberInstance {
63
66
  protected _version: V1;
@@ -96,7 +99,7 @@ export declare class PortingPortInPhoneNumberInstance {
96
99
  /**
97
100
  * The timestamp when the status was last updated.
98
101
  */
99
- statusLastTimeUpdatedTimestamp: Date;
102
+ lastUpdated: Date;
100
103
  /**
101
104
  * The phone number.
102
105
  */
@@ -112,11 +115,23 @@ export declare class PortingPortInPhoneNumberInstance {
112
115
  /**
113
116
  * The code of the reason why the phone number is not portable.
114
117
  */
115
- notPortabilityReasonCode: string;
118
+ notPortabilityReasonCode: number;
116
119
  /**
117
120
  * The status of the phone number in the port in request.
118
121
  */
119
122
  portInPhoneNumberStatus: string;
123
+ /**
124
+ * The pin required for the losing carrier to port out the phone number.
125
+ */
126
+ portOutPin: number;
127
+ /**
128
+ * The rejection reason returned by the vendor.
129
+ */
130
+ rejectionReason: string;
131
+ /**
132
+ * The rejection reason code returned by the vendor.
133
+ */
134
+ rejectionReasonCode: number;
120
135
  private get _proxy();
121
136
  /**
122
137
  * Remove a PortingPortInPhoneNumberInstance
@@ -148,12 +163,15 @@ export declare class PortingPortInPhoneNumberInstance {
148
163
  dateCreated: Date;
149
164
  country: string;
150
165
  missingRequiredFields: boolean;
151
- statusLastTimeUpdatedTimestamp: Date;
166
+ lastUpdated: Date;
152
167
  phoneNumber: string;
153
168
  portable: boolean;
154
169
  notPortabilityReason: string;
155
- notPortabilityReasonCode: string;
170
+ notPortabilityReasonCode: number;
156
171
  portInPhoneNumberStatus: string;
172
+ portOutPin: number;
173
+ rejectionReason: string;
174
+ rejectionReasonCode: number;
157
175
  };
158
176
  [inspect.custom](_depth: any, options: InspectOptions): string;
159
177
  }
@@ -73,12 +73,15 @@ class PortingPortInPhoneNumberInstance {
73
73
  this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
74
74
  this.country = payload.country;
75
75
  this.missingRequiredFields = payload.missing_required_fields;
76
- this.statusLastTimeUpdatedTimestamp = deserialize.iso8601DateTime(payload.status_last_time_updated_timestamp);
76
+ this.lastUpdated = deserialize.iso8601DateTime(payload.last_updated);
77
77
  this.phoneNumber = payload.phone_number;
78
78
  this.portable = payload.portable;
79
79
  this.notPortabilityReason = payload.not_portability_reason;
80
- this.notPortabilityReasonCode = payload.not_portability_reason_code;
80
+ this.notPortabilityReasonCode = deserialize.integer(payload.not_portability_reason_code);
81
81
  this.portInPhoneNumberStatus = payload.port_in_phone_number_status;
82
+ this.portOutPin = deserialize.integer(payload.port_out_pin);
83
+ this.rejectionReason = payload.rejection_reason;
84
+ this.rejectionReasonCode = deserialize.integer(payload.rejection_reason_code);
82
85
  this._solution = {
83
86
  portInRequestSid: portInRequestSid || this.portInRequestSid,
84
87
  phoneNumberSid: phoneNumberSid || this.phoneNumberSid,
@@ -125,12 +128,15 @@ class PortingPortInPhoneNumberInstance {
125
128
  dateCreated: this.dateCreated,
126
129
  country: this.country,
127
130
  missingRequiredFields: this.missingRequiredFields,
128
- statusLastTimeUpdatedTimestamp: this.statusLastTimeUpdatedTimestamp,
131
+ lastUpdated: this.lastUpdated,
129
132
  phoneNumber: this.phoneNumber,
130
133
  portable: this.portable,
131
134
  notPortabilityReason: this.notPortabilityReason,
132
135
  notPortabilityReasonCode: this.notPortabilityReasonCode,
133
136
  portInPhoneNumberStatus: this.portInPhoneNumberStatus,
137
+ portOutPin: this.portOutPin,
138
+ rejectionReason: this.rejectionReason,
139
+ rejectionReasonCode: this.rejectionReasonCode,
134
140
  };
135
141
  }
136
142
  [util_1.inspect.custom](_depth, options) {
@@ -59,8 +59,6 @@ interface PortingPortabilityResource {
59
59
  not_portable_reason_code: number;
60
60
  number_type: PortingPortabilityNumberType;
61
61
  country: string;
62
- messaging_carrier: string;
63
- voice_carrier: string;
64
62
  url: string;
65
63
  }
66
64
  export declare class PortingPortabilityInstance {
@@ -97,14 +95,6 @@ export declare class PortingPortabilityInstance {
97
95
  * Country the phone number belongs to.
98
96
  */
99
97
  country: string;
100
- /**
101
- * Current messaging carrier of the phone number
102
- */
103
- messagingCarrier: string;
104
- /**
105
- * Current voice carrier of the phone number
106
- */
107
- voiceCarrier: string;
108
98
  /**
109
99
  * This is the url of the request that you\'re trying to reach out to locate the resource.
110
100
  */
@@ -141,8 +131,6 @@ export declare class PortingPortabilityInstance {
141
131
  notPortableReasonCode: number;
142
132
  numberType: PortingPortabilityNumberType;
143
133
  country: string;
144
- messagingCarrier: string;
145
- voiceCarrier: string;
146
134
  url: string;
147
135
  };
148
136
  [inspect.custom](_depth: any, options: InspectOptions): string;
@@ -74,8 +74,6 @@ class PortingPortabilityInstance {
74
74
  this.notPortableReasonCode = deserialize.integer(payload.not_portable_reason_code);
75
75
  this.numberType = payload.number_type;
76
76
  this.country = payload.country;
77
- this.messagingCarrier = payload.messaging_carrier;
78
- this.voiceCarrier = payload.voice_carrier;
79
77
  this.url = payload.url;
80
78
  this._solution = { phoneNumber: phoneNumber || this.phoneNumber };
81
79
  }
@@ -103,8 +101,6 @@ class PortingPortabilityInstance {
103
101
  notPortableReasonCode: this.notPortableReasonCode,
104
102
  numberType: this.numberType,
105
103
  country: this.country,
106
- messagingCarrier: this.messagingCarrier,
107
- voiceCarrier: this.voiceCarrier,
108
104
  url: this.url,
109
105
  };
110
106
  }
@@ -50,6 +50,8 @@ export interface ComplianceTollfreeInquiriesListInstanceCreateOptions {
50
50
  businessContactPhone?: string;
51
51
  /** Theme id for styling the inquiry form. */
52
52
  themeSetId?: string;
53
+ /** Skip the messaging use case screen of the inquiry form. */
54
+ skipMessagingUseCase?: boolean;
53
55
  }
54
56
  export interface ComplianceTollfreeInquiriesSolution {
55
57
  }
@@ -78,6 +78,8 @@ function ComplianceTollfreeInquiriesListInstance(version) {
78
78
  data["BusinessContactPhone"] = params["businessContactPhone"];
79
79
  if (params["themeSetId"] !== undefined)
80
80
  data["ThemeSetId"] = params["themeSetId"];
81
+ if (params["skipMessagingUseCase"] !== undefined)
82
+ data["SkipMessagingUseCase"] = serialize.bool(params["skipMessagingUseCase"]);
81
83
  const headers = {};
82
84
  headers["Content-Type"] = "application/x-www-form-urlencoded";
83
85
  let operationVersion = version, operationPromise = operationVersion.create({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "twilio",
3
3
  "description": "A Twilio helper library",
4
- "version": "5.1.1",
4
+ "version": "5.2.0",
5
5
  "author": "API Team <api@twilio.com>",
6
6
  "contributors": [
7
7
  {