twilio 4.9.0 → 4.10.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.
@@ -69,6 +69,12 @@ export interface ConversationListInstanceCreateOptions {
69
69
  * Options to pass to each
70
70
  */
71
71
  export interface ConversationListInstanceEachOptions {
72
+ /** Start date in ISO8601 format for sorting and filtering list of Conversations. */
73
+ startDate?: string;
74
+ /** End date in ISO8601 format for sorting and filtering list of Conversations. */
75
+ endDate?: string;
76
+ /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
77
+ state?: ConversationState;
72
78
  /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
73
79
  pageSize?: number;
74
80
  /** Function to process each record. If this and a positional callback are passed, this one will be used */
@@ -82,6 +88,12 @@ export interface ConversationListInstanceEachOptions {
82
88
  * Options to pass to list
83
89
  */
84
90
  export interface ConversationListInstanceOptions {
91
+ /** Start date in ISO8601 format for sorting and filtering list of Conversations. */
92
+ startDate?: string;
93
+ /** End date in ISO8601 format for sorting and filtering list of Conversations. */
94
+ endDate?: string;
95
+ /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
96
+ state?: ConversationState;
85
97
  /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
86
98
  pageSize?: number;
87
99
  /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
@@ -91,6 +103,12 @@ export interface ConversationListInstanceOptions {
91
103
  * Options to pass to page
92
104
  */
93
105
  export interface ConversationListInstancePageOptions {
106
+ /** Start date in ISO8601 format for sorting and filtering list of Conversations. */
107
+ startDate?: string;
108
+ /** End date in ISO8601 format for sorting and filtering list of Conversations. */
109
+ endDate?: string;
110
+ /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
111
+ state?: ConversationState;
94
112
  /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
95
113
  pageSize?: number;
96
114
  /** Page Number, this value is simply for client state */
@@ -282,6 +282,12 @@ function ConversationListInstance(version) {
282
282
  params = params || {};
283
283
  }
284
284
  let data = {};
285
+ if (params["startDate"] !== undefined)
286
+ data["StartDate"] = params["startDate"];
287
+ if (params["endDate"] !== undefined)
288
+ data["EndDate"] = params["endDate"];
289
+ if (params["state"] !== undefined)
290
+ data["State"] = params["state"];
285
291
  if (params["pageSize"] !== undefined)
286
292
  data["PageSize"] = params["pageSize"];
287
293
  if (params.pageNumber !== undefined)
@@ -69,6 +69,12 @@ export interface ConversationListInstanceCreateOptions {
69
69
  * Options to pass to each
70
70
  */
71
71
  export interface ConversationListInstanceEachOptions {
72
+ /** Start date in ISO8601 format for sorting and filtering list of Conversations. */
73
+ startDate?: string;
74
+ /** End date in ISO8601 format for sorting and filtering list of Conversations. */
75
+ endDate?: string;
76
+ /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
77
+ state?: ConversationState;
72
78
  /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
73
79
  pageSize?: number;
74
80
  /** Function to process each record. If this and a positional callback are passed, this one will be used */
@@ -82,6 +88,12 @@ export interface ConversationListInstanceEachOptions {
82
88
  * Options to pass to list
83
89
  */
84
90
  export interface ConversationListInstanceOptions {
91
+ /** Start date in ISO8601 format for sorting and filtering list of Conversations. */
92
+ startDate?: string;
93
+ /** End date in ISO8601 format for sorting and filtering list of Conversations. */
94
+ endDate?: string;
95
+ /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
96
+ state?: ConversationState;
85
97
  /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
86
98
  pageSize?: number;
87
99
  /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
@@ -91,6 +103,12 @@ export interface ConversationListInstanceOptions {
91
103
  * Options to pass to page
92
104
  */
93
105
  export interface ConversationListInstancePageOptions {
106
+ /** Start date in ISO8601 format for sorting and filtering list of Conversations. */
107
+ startDate?: string;
108
+ /** End date in ISO8601 format for sorting and filtering list of Conversations. */
109
+ endDate?: string;
110
+ /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
111
+ state?: ConversationState;
94
112
  /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
95
113
  pageSize?: number;
96
114
  /** Page Number, this value is simply for client state */
@@ -290,6 +290,12 @@ function ConversationListInstance(version, chatServiceSid) {
290
290
  params = params || {};
291
291
  }
292
292
  let data = {};
293
+ if (params["startDate"] !== undefined)
294
+ data["StartDate"] = params["startDate"];
295
+ if (params["endDate"] !== undefined)
296
+ data["EndDate"] = params["endDate"];
297
+ if (params["state"] !== undefined)
298
+ data["State"] = params["state"];
293
299
  if (params["pageSize"] !== undefined)
294
300
  data["PageSize"] = params["pageSize"];
295
301
  if (params.pageNumber !== undefined)
@@ -49,6 +49,8 @@ export interface CallSummariesListInstanceEachOptions {
49
49
  subaccount?: string;
50
50
  /** */
51
51
  abnormalSession?: boolean;
52
+ /** */
53
+ answeredBy?: CallSummariesAnsweredBy;
52
54
  /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
53
55
  pageSize?: number;
54
56
  /** Function to process each record. If this and a positional callback are passed, this one will be used */
@@ -98,6 +100,8 @@ export interface CallSummariesListInstanceOptions {
98
100
  subaccount?: string;
99
101
  /** */
100
102
  abnormalSession?: boolean;
103
+ /** */
104
+ answeredBy?: CallSummariesAnsweredBy;
101
105
  /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
102
106
  pageSize?: number;
103
107
  /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
@@ -143,6 +147,8 @@ export interface CallSummariesListInstancePageOptions {
143
147
  subaccount?: string;
144
148
  /** */
145
149
  abnormalSession?: boolean;
150
+ /** */
151
+ answeredBy?: CallSummariesAnsweredBy;
146
152
  /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
147
153
  pageSize?: number;
148
154
  /** Page Number, this value is simply for client state */
@@ -71,6 +71,8 @@ function CallSummariesListInstance(version) {
71
71
  data["Subaccount"] = params["subaccount"];
72
72
  if (params["abnormalSession"] !== undefined)
73
73
  data["AbnormalSession"] = serialize.bool(params["abnormalSession"]);
74
+ if (params["answeredBy"] !== undefined)
75
+ data["AnsweredBy"] = params["answeredBy"];
74
76
  if (params["pageSize"] !== undefined)
75
77
  data["PageSize"] = params["pageSize"];
76
78
  if (params.pageNumber !== undefined)
@@ -86,7 +86,6 @@ interface PhoneNumberResource {
86
86
  line_type_intelligence: any;
87
87
  identity_match: any;
88
88
  sms_pumping_risk: any;
89
- disposable_phone_number_risk: any;
90
89
  url: string;
91
90
  }
92
91
  export declare class PhoneNumberInstance {
@@ -146,10 +145,6 @@ export declare class PhoneNumberInstance {
146
145
  * An object that contains information on if a phone number has been currently or previously blocked by Verify Fraud Guard for receiving malicious SMS pumping traffic as well as other signals associated with risky carriers and low conversion rates.
147
146
  */
148
147
  smsPumpingRisk: any;
149
- /**
150
- * An object that contains information on if a mobile phone number could be a disposable or burner number.
151
- */
152
- disposablePhoneNumberRisk: any;
153
148
  /**
154
149
  * The absolute URL of the resource.
155
150
  */
@@ -191,7 +186,6 @@ export declare class PhoneNumberInstance {
191
186
  lineTypeIntelligence: any;
192
187
  identityMatch: any;
193
188
  smsPumpingRisk: any;
194
- disposablePhoneNumberRisk: any;
195
189
  url: string;
196
190
  };
197
191
  [inspect.custom](_depth: any, options: InspectOptions): string;
@@ -101,7 +101,6 @@ class PhoneNumberInstance {
101
101
  this.lineTypeIntelligence = payload.line_type_intelligence;
102
102
  this.identityMatch = payload.identity_match;
103
103
  this.smsPumpingRisk = payload.sms_pumping_risk;
104
- this.disposablePhoneNumberRisk = payload.disposable_phone_number_risk;
105
104
  this.url = payload.url;
106
105
  this._solution = { phoneNumber: phoneNumber || this.phoneNumber };
107
106
  }
@@ -134,7 +133,6 @@ class PhoneNumberInstance {
134
133
  lineTypeIntelligence: this.lineTypeIntelligence,
135
134
  identityMatch: this.identityMatch,
136
135
  smsPumpingRisk: this.smsPumpingRisk,
137
- disposablePhoneNumberRisk: this.disposablePhoneNumberRisk,
138
136
  url: this.url,
139
137
  };
140
138
  }
@@ -0,0 +1,52 @@
1
+ /// <reference types="node" />
2
+ import { inspect, InspectOptions } from "util";
3
+ import V1 from "../../V1";
4
+ export interface BrandRegistrationOtpSolution {
5
+ brandRegistrationSid: string;
6
+ }
7
+ export interface BrandRegistrationOtpListInstance {
8
+ _version: V1;
9
+ _solution: BrandRegistrationOtpSolution;
10
+ _uri: string;
11
+ /**
12
+ * Create a BrandRegistrationOtpInstance
13
+ *
14
+ * @param callback - Callback to handle processed record
15
+ *
16
+ * @returns Resolves to processed BrandRegistrationOtpInstance
17
+ */
18
+ create(callback?: (error: Error | null, item?: BrandRegistrationOtpInstance) => any): Promise<BrandRegistrationOtpInstance>;
19
+ /**
20
+ * Provide a user-friendly representation
21
+ */
22
+ toJSON(): any;
23
+ [inspect.custom](_depth: any, options: InspectOptions): any;
24
+ }
25
+ export declare function BrandRegistrationOtpListInstance(version: V1, brandRegistrationSid: string): BrandRegistrationOtpListInstance;
26
+ interface BrandRegistrationOtpResource {
27
+ account_sid: string;
28
+ brand_registration_sid: string;
29
+ }
30
+ export declare class BrandRegistrationOtpInstance {
31
+ protected _version: V1;
32
+ constructor(_version: V1, payload: BrandRegistrationOtpResource, brandRegistrationSid: string);
33
+ /**
34
+ * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Brand Registration resource.
35
+ */
36
+ accountSid: string;
37
+ /**
38
+ * The unique string to identify Brand Registration of Sole Proprietor Brand
39
+ */
40
+ brandRegistrationSid: string;
41
+ /**
42
+ * Provide a user-friendly representation
43
+ *
44
+ * @returns Object
45
+ */
46
+ toJSON(): {
47
+ accountSid: string;
48
+ brandRegistrationSid: string;
49
+ };
50
+ [inspect.custom](_depth: any, options: InspectOptions): string;
51
+ }
52
+ export {};
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ /*
3
+ * This code was generated by
4
+ * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
+ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
+ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
+ *
8
+ * Twilio - Messaging
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
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.BrandRegistrationOtpInstance = exports.BrandRegistrationOtpListInstance = void 0;
17
+ const util_1 = require("util");
18
+ const deserialize = require("../../../../base/deserialize");
19
+ const serialize = require("../../../../base/serialize");
20
+ const utility_1 = require("../../../../base/utility");
21
+ function BrandRegistrationOtpListInstance(version, brandRegistrationSid) {
22
+ if (!(0, utility_1.isValidPathParam)(brandRegistrationSid)) {
23
+ throw new Error("Parameter 'brandRegistrationSid' is not valid.");
24
+ }
25
+ const instance = {};
26
+ instance._version = version;
27
+ instance._solution = { brandRegistrationSid };
28
+ instance._uri = `/a2p/BrandRegistrations/${brandRegistrationSid}/SmsOtp`;
29
+ instance.create = function create(callback) {
30
+ let operationVersion = version, operationPromise = operationVersion.create({
31
+ uri: instance._uri,
32
+ method: "post",
33
+ });
34
+ operationPromise = operationPromise.then((payload) => new BrandRegistrationOtpInstance(operationVersion, payload, instance._solution.brandRegistrationSid));
35
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
36
+ return operationPromise;
37
+ };
38
+ instance.toJSON = function toJSON() {
39
+ return instance._solution;
40
+ };
41
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
42
+ return (0, util_1.inspect)(instance.toJSON(), options);
43
+ };
44
+ return instance;
45
+ }
46
+ exports.BrandRegistrationOtpListInstance = BrandRegistrationOtpListInstance;
47
+ class BrandRegistrationOtpInstance {
48
+ constructor(_version, payload, brandRegistrationSid) {
49
+ this._version = _version;
50
+ this.accountSid = payload.account_sid;
51
+ this.brandRegistrationSid = payload.brand_registration_sid;
52
+ }
53
+ /**
54
+ * Provide a user-friendly representation
55
+ *
56
+ * @returns Object
57
+ */
58
+ toJSON() {
59
+ return {
60
+ accountSid: this.accountSid,
61
+ brandRegistrationSid: this.brandRegistrationSid,
62
+ };
63
+ }
64
+ [util_1.inspect.custom](_depth, options) {
65
+ return (0, util_1.inspect)(this.toJSON(), options);
66
+ }
67
+ }
68
+ exports.BrandRegistrationOtpInstance = BrandRegistrationOtpInstance;
@@ -3,6 +3,7 @@ import { inspect, InspectOptions } from "util";
3
3
  import Page, { TwilioResponsePayload } from "../../../base/Page";
4
4
  import Response from "../../../http/response";
5
5
  import V1 from "../V1";
6
+ import { BrandRegistrationOtpListInstance } from "./brandRegistration/brandRegistrationOtp";
6
7
  import { BrandVettingListInstance } from "./brandRegistration/brandVetting";
7
8
  export type BrandRegistrationBrandFeedback = "TAX_ID" | "STOCK_SYMBOL" | "NONPROFIT" | "GOVERNMENT_ENTITY" | "OTHERS";
8
9
  export type BrandRegistrationIdentityStatus = "SELF_DECLARED" | "UNVERIFIED" | "VERIFIED" | "VETTED_VERIFIED";
@@ -15,7 +16,7 @@ export interface BrandRegistrationListInstanceCreateOptions {
15
16
  customerProfileBundleSid: string;
16
17
  /** A2P Messaging Profile Bundle Sid. */
17
18
  a2PProfileBundleSid: string;
18
- /** Type of brand being created. One of: \\\"STANDARD\\\", \\\"STARTER\\\". STARTER is for low volume, starter use cases. STANDARD is for all other use cases. */
19
+ /** Type of brand being created. One of: \\\"STANDARD\\\", \\\"SOLE_PROPRIETOR\\\". SOLE_PROPRIETOR is for low volume, SOLE_PROPRIETOR use cases. STANDARD is for all other use cases. */
19
20
  brandType?: string;
20
21
  /** A boolean that specifies whether brand should be a mock or not. If true, brand will be registered as a mock brand. Defaults to false if no value is provided. */
21
22
  mock?: boolean;
@@ -56,6 +57,7 @@ export interface BrandRegistrationListInstancePageOptions {
56
57
  pageToken?: string;
57
58
  }
58
59
  export interface BrandRegistrationContext {
60
+ brandRegistrationOtps: BrandRegistrationOtpListInstance;
59
61
  brandVettings: BrandVettingListInstance;
60
62
  /**
61
63
  * Fetch a BrandRegistrationInstance
@@ -86,8 +88,10 @@ export declare class BrandRegistrationContextImpl implements BrandRegistrationCo
86
88
  protected _version: V1;
87
89
  protected _solution: BrandRegistrationContextSolution;
88
90
  protected _uri: string;
91
+ protected _brandRegistrationOtps?: BrandRegistrationOtpListInstance;
89
92
  protected _brandVettings?: BrandVettingListInstance;
90
93
  constructor(_version: V1, sid: string);
94
+ get brandRegistrationOtps(): BrandRegistrationOtpListInstance;
91
95
  get brandVettings(): BrandVettingListInstance;
92
96
  fetch(callback?: (error: Error | null, item?: BrandRegistrationInstance) => any): Promise<BrandRegistrationInstance>;
93
97
  update(callback?: (error: Error | null, item?: BrandRegistrationInstance) => any): Promise<BrandRegistrationInstance>;
@@ -154,7 +158,7 @@ export declare class BrandRegistrationInstance {
154
158
  */
155
159
  dateUpdated: Date;
156
160
  /**
157
- * Type of brand. One of: \"STANDARD\", \"STARTER\". STARTER is for the low volume, STARTER campaign use case. There can only be one STARTER campaign created per STARTER brand. STANDARD is for all other campaign use cases. Multiple campaign use cases can be created per STANDARD brand.
161
+ * Type of brand. One of: \"STANDARD\", \"SOLE_PROPRIETOR\". SOLE_PROPRIETOR is for the low volume, SOLE_PROPRIETOR campaign use case. There can only be one SOLE_PROPRIETOR campaign created per SOLE_PROPRIETOR brand. STANDARD is for all other campaign use cases. Multiple campaign use cases can be created per STANDARD brand.
158
162
  */
159
163
  brandType: string;
160
164
  status: BrandRegistrationStatus;
@@ -217,6 +221,10 @@ export declare class BrandRegistrationInstance {
217
221
  * @returns Resolves to processed BrandRegistrationInstance
218
222
  */
219
223
  update(callback?: (error: Error | null, item?: BrandRegistrationInstance) => any): Promise<BrandRegistrationInstance>;
224
+ /**
225
+ * Access the brandRegistrationOtps.
226
+ */
227
+ brandRegistrationOtps(): BrandRegistrationOtpListInstance;
220
228
  /**
221
229
  * Access the brandVettings.
222
230
  */
@@ -22,6 +22,7 @@ const Page_1 = __importDefault(require("../../../base/Page"));
22
22
  const deserialize = require("../../../base/deserialize");
23
23
  const serialize = require("../../../base/serialize");
24
24
  const utility_1 = require("../../../base/utility");
25
+ const brandRegistrationOtp_1 = require("./brandRegistration/brandRegistrationOtp");
25
26
  const brandVetting_1 = require("./brandRegistration/brandVetting");
26
27
  class BrandRegistrationContextImpl {
27
28
  constructor(_version, sid) {
@@ -32,6 +33,12 @@ class BrandRegistrationContextImpl {
32
33
  this._solution = { sid };
33
34
  this._uri = `/a2p/BrandRegistrations/${sid}`;
34
35
  }
36
+ get brandRegistrationOtps() {
37
+ this._brandRegistrationOtps =
38
+ this._brandRegistrationOtps ||
39
+ (0, brandRegistrationOtp_1.BrandRegistrationOtpListInstance)(this._version, this._solution.sid);
40
+ return this._brandRegistrationOtps;
41
+ }
35
42
  get brandVettings() {
36
43
  this._brandVettings =
37
44
  this._brandVettings ||
@@ -122,6 +129,12 @@ class BrandRegistrationInstance {
122
129
  update(callback) {
123
130
  return this._proxy.update(callback);
124
131
  }
132
+ /**
133
+ * Access the brandRegistrationOtps.
134
+ */
135
+ brandRegistrationOtps() {
136
+ return this._proxy.brandRegistrationOtps;
137
+ }
125
138
  /**
126
139
  * Access the brandVettings.
127
140
  */
@@ -168,7 +168,7 @@ export declare class UsAppToPersonInstance {
168
168
  */
169
169
  messageSamples: Array<string>;
170
170
  /**
171
- * A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING, STARTER...]. STARTER campaign use cases can only be created by STARTER Brands, and there can only be one STARTER campaign created per STARTER Brand.
171
+ * A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING, SOLE_PROPRIETOR...]. SOLE_PROPRIETOR campaign use cases can only be created by SOLE_PROPRIETOR Brands, and there can only be one SOLE_PROPRIETOR campaign created per SOLE_PROPRIETOR Brand.
172
172
  */
173
173
  usAppToPersonUsecase: string;
174
174
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "twilio",
3
3
  "description": "A Twilio helper library",
4
- "version": "4.9.0",
4
+ "version": "4.10.0",
5
5
  "author": "API Team <api@twilio.com>",
6
6
  "contributors": [
7
7
  {