twilio 4.7.1 → 4.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/lib/rest/content/V1.d.ts +5 -0
  2. package/lib/rest/content/V1.js +7 -0
  3. package/lib/rest/content/v1/legacyContent.d.ts +202 -0
  4. package/lib/rest/content/v1/legacyContent.js +138 -0
  5. package/lib/rest/flexApi/V1.d.ts +15 -0
  6. package/lib/rest/flexApi/V1.js +22 -0
  7. package/lib/rest/flexApi/v1/insightsAssessmentsComment.d.ts +255 -0
  8. package/lib/rest/flexApi/v1/insightsAssessmentsComment.js +198 -0
  9. package/lib/rest/flexApi/v1/insightsQuestionnaires.d.ts +357 -0
  10. package/lib/rest/flexApi/v1/insightsQuestionnaires.js +280 -0
  11. package/lib/rest/flexApi/v1/insightsQuestionnairesCategory.d.ts +111 -0
  12. package/lib/rest/flexApi/v1/insightsQuestionnairesCategory.js +68 -1
  13. package/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.d.ts +129 -6
  14. package/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.js +78 -13
  15. package/lib/rest/flexApi/v1/insightsSegments.d.ts +224 -0
  16. package/lib/rest/flexApi/v1/insightsSegments.js +154 -0
  17. package/lib/rest/flexApi/v1/insightsSession.d.ts +2 -2
  18. package/lib/rest/flexApi/v1/insightsSession.js +2 -2
  19. package/lib/rest/flexApi/v1/insightsUserRoles.d.ts +2 -2
  20. package/lib/rest/flexApi/v1/insightsUserRoles.js +2 -2
  21. package/lib/rest/lookups/v2/phoneNumber.d.ts +12 -0
  22. package/lib/rest/lookups/v2/phoneNumber.js +4 -0
  23. package/lib/rest/microvisor/V1.d.ts +10 -0
  24. package/lib/rest/microvisor/V1.js +14 -0
  25. package/lib/rest/microvisor/v1/accountConfig.d.ts +237 -0
  26. package/lib/rest/microvisor/v1/accountConfig.js +221 -0
  27. package/lib/rest/microvisor/v1/accountSecret.d.ts +231 -0
  28. package/lib/rest/microvisor/v1/accountSecret.js +219 -0
  29. package/lib/rest/microvisor/v1/device/deviceConfig.d.ts +245 -0
  30. package/lib/rest/microvisor/v1/device/deviceConfig.js +229 -0
  31. package/lib/rest/microvisor/v1/device/deviceSecret.d.ts +239 -0
  32. package/lib/rest/microvisor/v1/device/deviceSecret.js +227 -0
  33. package/lib/rest/microvisor/v1/device.d.ts +16 -0
  34. package/lib/rest/microvisor/v1/device.js +26 -0
  35. package/lib/rest/supersim/v1/smsCommand.d.ts +3 -3
  36. package/package.json +1 -1
@@ -1,5 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { inspect, InspectOptions } from "util";
3
+ import Page, { TwilioResponsePayload } from "../../../base/Page";
4
+ import Response from "../../../http/response";
3
5
  import V1 from "../V1";
4
6
  /**
5
7
  * Options to pass to remove a InsightsQuestionnairesCategoryInstance
@@ -26,6 +28,45 @@ export interface InsightsQuestionnairesCategoryListInstanceCreateOptions {
26
28
  /** The Token HTTP request header */
27
29
  token?: string;
28
30
  }
31
+ /**
32
+ * Options to pass to each
33
+ */
34
+ export interface InsightsQuestionnairesCategoryListInstanceEachOptions {
35
+ /** The Token HTTP request header */
36
+ token?: string;
37
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
38
+ pageSize?: number;
39
+ /** Function to process each record. If this and a positional callback are passed, this one will be used */
40
+ callback?: (item: InsightsQuestionnairesCategoryInstance, done: (err?: Error) => void) => void;
41
+ /** Function to be called upon completion of streaming */
42
+ done?: Function;
43
+ /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
44
+ limit?: number;
45
+ }
46
+ /**
47
+ * Options to pass to list
48
+ */
49
+ export interface InsightsQuestionnairesCategoryListInstanceOptions {
50
+ /** The Token HTTP request header */
51
+ token?: string;
52
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
53
+ pageSize?: number;
54
+ /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
55
+ limit?: number;
56
+ }
57
+ /**
58
+ * Options to pass to page
59
+ */
60
+ export interface InsightsQuestionnairesCategoryListInstancePageOptions {
61
+ /** The Token HTTP request header */
62
+ token?: string;
63
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
64
+ pageSize?: number;
65
+ /** Page Number, this value is simply for client state */
66
+ pageNumber?: number;
67
+ /** PageToken provided by the API */
68
+ pageToken?: string;
69
+ }
29
70
  export interface InsightsQuestionnairesCategoryContext {
30
71
  /**
31
72
  * Remove a InsightsQuestionnairesCategoryInstance
@@ -77,6 +118,9 @@ export declare class InsightsQuestionnairesCategoryContextImpl implements Insigh
77
118
  toJSON(): InsightsQuestionnairesCategoryContextSolution;
78
119
  [inspect.custom](_depth: any, options: InspectOptions): string;
79
120
  }
121
+ interface InsightsQuestionnairesCategoryPayload extends TwilioResponsePayload {
122
+ categories: InsightsQuestionnairesCategoryResource[];
123
+ }
80
124
  interface InsightsQuestionnairesCategoryResource {
81
125
  account_sid: string;
82
126
  category_id: string;
@@ -158,6 +202,56 @@ export interface InsightsQuestionnairesCategoryListInstance {
158
202
  * @returns Resolves to processed InsightsQuestionnairesCategoryInstance
159
203
  */
160
204
  create(params: InsightsQuestionnairesCategoryListInstanceCreateOptions, callback?: (error: Error | null, item?: InsightsQuestionnairesCategoryInstance) => any): Promise<InsightsQuestionnairesCategoryInstance>;
205
+ /**
206
+ * Streams InsightsQuestionnairesCategoryInstance records from the API.
207
+ *
208
+ * This operation lazily loads records as efficiently as possible until the limit
209
+ * is reached.
210
+ *
211
+ * The results are passed into the callback function, so this operation is memory
212
+ * efficient.
213
+ *
214
+ * If a function is passed as the first argument, it will be used as the callback
215
+ * function.
216
+ *
217
+ * @param { InsightsQuestionnairesCategoryListInstanceEachOptions } [params] - Options for request
218
+ * @param { function } [callback] - Function to process each record
219
+ */
220
+ each(callback?: (item: InsightsQuestionnairesCategoryInstance, done: (err?: Error) => void) => void): void;
221
+ each(params: InsightsQuestionnairesCategoryListInstanceEachOptions, callback?: (item: InsightsQuestionnairesCategoryInstance, done: (err?: Error) => void) => void): void;
222
+ /**
223
+ * Retrieve a single target page of InsightsQuestionnairesCategoryInstance records from the API.
224
+ *
225
+ * The request is executed immediately.
226
+ *
227
+ * @param { string } [targetUrl] - API-generated URL for the requested results page
228
+ * @param { function } [callback] - Callback to handle list of records
229
+ */
230
+ getPage(targetUrl: string, callback?: (error: Error | null, items: InsightsQuestionnairesCategoryPage) => any): Promise<InsightsQuestionnairesCategoryPage>;
231
+ /**
232
+ * Lists InsightsQuestionnairesCategoryInstance records from the API as a list.
233
+ *
234
+ * If a function is passed as the first argument, it will be used as the callback
235
+ * function.
236
+ *
237
+ * @param { InsightsQuestionnairesCategoryListInstanceOptions } [params] - Options for request
238
+ * @param { function } [callback] - Callback to handle list of records
239
+ */
240
+ list(callback?: (error: Error | null, items: InsightsQuestionnairesCategoryInstance[]) => any): Promise<InsightsQuestionnairesCategoryInstance[]>;
241
+ list(params: InsightsQuestionnairesCategoryListInstanceOptions, callback?: (error: Error | null, items: InsightsQuestionnairesCategoryInstance[]) => any): Promise<InsightsQuestionnairesCategoryInstance[]>;
242
+ /**
243
+ * Retrieve a single page of InsightsQuestionnairesCategoryInstance records from the API.
244
+ *
245
+ * The request is executed immediately.
246
+ *
247
+ * If a function is passed as the first argument, it will be used as the callback
248
+ * function.
249
+ *
250
+ * @param { InsightsQuestionnairesCategoryListInstancePageOptions } [params] - Options for request
251
+ * @param { function } [callback] - Callback to handle list of records
252
+ */
253
+ page(callback?: (error: Error | null, items: InsightsQuestionnairesCategoryPage) => any): Promise<InsightsQuestionnairesCategoryPage>;
254
+ page(params: InsightsQuestionnairesCategoryListInstancePageOptions, callback?: (error: Error | null, items: InsightsQuestionnairesCategoryPage) => any): Promise<InsightsQuestionnairesCategoryPage>;
161
255
  /**
162
256
  * Provide a user-friendly representation
163
257
  */
@@ -165,4 +259,21 @@ export interface InsightsQuestionnairesCategoryListInstance {
165
259
  [inspect.custom](_depth: any, options: InspectOptions): any;
166
260
  }
167
261
  export declare function InsightsQuestionnairesCategoryListInstance(version: V1): InsightsQuestionnairesCategoryListInstance;
262
+ export declare class InsightsQuestionnairesCategoryPage extends Page<V1, InsightsQuestionnairesCategoryPayload, InsightsQuestionnairesCategoryResource, InsightsQuestionnairesCategoryInstance> {
263
+ /**
264
+ * Initialize the InsightsQuestionnairesCategoryPage
265
+ *
266
+ * @param version - Version of the resource
267
+ * @param response - Response from the API
268
+ * @param solution - Path solution
269
+ */
270
+ constructor(version: V1, response: Response<string>, solution: InsightsQuestionnairesCategorySolution);
271
+ /**
272
+ * Build an instance of InsightsQuestionnairesCategoryInstance
273
+ *
274
+ * @param payload - Payload response from the API
275
+ */
276
+ getInstance(payload: InsightsQuestionnairesCategoryResource): InsightsQuestionnairesCategoryInstance;
277
+ [inspect.custom](depth: any, options: InspectOptions): string;
278
+ }
168
279
  export {};
@@ -12,9 +12,13 @@
12
12
  * https://openapi-generator.tech
13
13
  * Do not edit the class manually.
14
14
  */
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
15
18
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.InsightsQuestionnairesCategoryListInstance = exports.InsightsQuestionnairesCategoryInstance = exports.InsightsQuestionnairesCategoryContextImpl = void 0;
19
+ exports.InsightsQuestionnairesCategoryPage = exports.InsightsQuestionnairesCategoryListInstance = exports.InsightsQuestionnairesCategoryInstance = exports.InsightsQuestionnairesCategoryContextImpl = void 0;
17
20
  const util_1 = require("util");
21
+ const Page_1 = __importDefault(require("../../../base/Page"));
18
22
  const deserialize = require("../../../base/deserialize");
19
23
  const serialize = require("../../../base/serialize");
20
24
  const utility_1 = require("../../../base/utility");
@@ -156,6 +160,45 @@ function InsightsQuestionnairesCategoryListInstance(version) {
156
160
  operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
157
161
  return operationPromise;
158
162
  };
163
+ instance.page = function page(params, callback) {
164
+ if (params instanceof Function) {
165
+ callback = params;
166
+ params = {};
167
+ }
168
+ else {
169
+ params = params || {};
170
+ }
171
+ let data = {};
172
+ if (params["pageSize"] !== undefined)
173
+ data["PageSize"] = params["pageSize"];
174
+ if (params.pageNumber !== undefined)
175
+ data["Page"] = params.pageNumber;
176
+ if (params.pageToken !== undefined)
177
+ data["PageToken"] = params.pageToken;
178
+ const headers = {};
179
+ if (params["token"] !== undefined)
180
+ headers["Token"] = params["token"];
181
+ let operationVersion = version, operationPromise = operationVersion.page({
182
+ uri: instance._uri,
183
+ method: "get",
184
+ params: data,
185
+ headers,
186
+ });
187
+ operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesCategoryPage(operationVersion, payload, instance._solution));
188
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
189
+ return operationPromise;
190
+ };
191
+ instance.each = instance._version.each;
192
+ instance.list = instance._version.list;
193
+ instance.getPage = function getPage(targetUrl, callback) {
194
+ const operationPromise = instance._version._domain.twilio.request({
195
+ method: "get",
196
+ uri: targetUrl,
197
+ });
198
+ let pagePromise = operationPromise.then((payload) => new InsightsQuestionnairesCategoryPage(instance._version, payload, instance._solution));
199
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
200
+ return pagePromise;
201
+ };
159
202
  instance.toJSON = function toJSON() {
160
203
  return instance._solution;
161
204
  };
@@ -165,3 +208,27 @@ function InsightsQuestionnairesCategoryListInstance(version) {
165
208
  return instance;
166
209
  }
167
210
  exports.InsightsQuestionnairesCategoryListInstance = InsightsQuestionnairesCategoryListInstance;
211
+ class InsightsQuestionnairesCategoryPage extends Page_1.default {
212
+ /**
213
+ * Initialize the InsightsQuestionnairesCategoryPage
214
+ *
215
+ * @param version - Version of the resource
216
+ * @param response - Response from the API
217
+ * @param solution - Path solution
218
+ */
219
+ constructor(version, response, solution) {
220
+ super(version, response, solution);
221
+ }
222
+ /**
223
+ * Build an instance of InsightsQuestionnairesCategoryInstance
224
+ *
225
+ * @param payload - Payload response from the API
226
+ */
227
+ getInstance(payload) {
228
+ return new InsightsQuestionnairesCategoryInstance(this._version, payload);
229
+ }
230
+ [util_1.inspect.custom](depth, options) {
231
+ return (0, util_1.inspect)(this.toJSON(), options);
232
+ }
233
+ }
234
+ exports.InsightsQuestionnairesCategoryPage = InsightsQuestionnairesCategoryPage;
@@ -1,5 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { inspect, InspectOptions } from "util";
3
+ import Page, { TwilioResponsePayload } from "../../../base/Page";
4
+ import Response from "../../../http/response";
3
5
  import V1 from "../V1";
4
6
  /**
5
7
  * Options to pass to remove a InsightsQuestionnairesQuestionInstance
@@ -12,18 +14,18 @@ export interface InsightsQuestionnairesQuestionContextRemoveOptions {
12
14
  * Options to pass to update a InsightsQuestionnairesQuestionInstance
13
15
  */
14
16
  export interface InsightsQuestionnairesQuestionContextUpdateOptions {
15
- /** The question. */
16
- question: string;
17
- /** The description for the question. */
18
- description: string;
19
- /** The answer_set for the question. */
20
- answerSetId: string;
21
17
  /** The flag to enable for disable NA for answer. */
22
18
  allowNa: boolean;
23
19
  /** The Token HTTP request header */
24
20
  token?: string;
25
21
  /** The ID of the category */
26
22
  categoryId?: string;
23
+ /** The question. */
24
+ question?: string;
25
+ /** The description for the question. */
26
+ description?: string;
27
+ /** The answer_set for the question. */
28
+ answerSetId?: string;
27
29
  }
28
30
  /**
29
31
  * Options to pass to create a InsightsQuestionnairesQuestionInstance
@@ -42,6 +44,51 @@ export interface InsightsQuestionnairesQuestionListInstanceCreateOptions {
42
44
  /** The Token HTTP request header */
43
45
  token?: string;
44
46
  }
47
+ /**
48
+ * Options to pass to each
49
+ */
50
+ export interface InsightsQuestionnairesQuestionListInstanceEachOptions {
51
+ /** The Token HTTP request header */
52
+ token?: string;
53
+ /** The list of category IDs */
54
+ categoryId?: Array<string>;
55
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
56
+ pageSize?: number;
57
+ /** Function to process each record. If this and a positional callback are passed, this one will be used */
58
+ callback?: (item: InsightsQuestionnairesQuestionInstance, done: (err?: Error) => void) => void;
59
+ /** Function to be called upon completion of streaming */
60
+ done?: Function;
61
+ /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
62
+ limit?: number;
63
+ }
64
+ /**
65
+ * Options to pass to list
66
+ */
67
+ export interface InsightsQuestionnairesQuestionListInstanceOptions {
68
+ /** The Token HTTP request header */
69
+ token?: string;
70
+ /** The list of category IDs */
71
+ categoryId?: Array<string>;
72
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
73
+ pageSize?: number;
74
+ /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
75
+ limit?: number;
76
+ }
77
+ /**
78
+ * Options to pass to page
79
+ */
80
+ export interface InsightsQuestionnairesQuestionListInstancePageOptions {
81
+ /** The Token HTTP request header */
82
+ token?: string;
83
+ /** The list of category IDs */
84
+ categoryId?: Array<string>;
85
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
86
+ pageSize?: number;
87
+ /** Page Number, this value is simply for client state */
88
+ pageNumber?: number;
89
+ /** PageToken provided by the API */
90
+ pageToken?: string;
91
+ }
45
92
  export interface InsightsQuestionnairesQuestionContext {
46
93
  /**
47
94
  * Remove a InsightsQuestionnairesQuestionInstance
@@ -93,6 +140,9 @@ export declare class InsightsQuestionnairesQuestionContextImpl implements Insigh
93
140
  toJSON(): InsightsQuestionnairesQuestionContextSolution;
94
141
  [inspect.custom](_depth: any, options: InspectOptions): string;
95
142
  }
143
+ interface InsightsQuestionnairesQuestionPayload extends TwilioResponsePayload {
144
+ questions: InsightsQuestionnairesQuestionResource[];
145
+ }
96
146
  interface InsightsQuestionnairesQuestionResource {
97
147
  account_sid: string;
98
148
  question_id: string;
@@ -101,6 +151,7 @@ interface InsightsQuestionnairesQuestionResource {
101
151
  category: any;
102
152
  answer_set_id: string;
103
153
  allow_na: boolean;
154
+ usage: number;
104
155
  url: string;
105
156
  }
106
157
  export declare class InsightsQuestionnairesQuestionInstance {
@@ -136,6 +187,10 @@ export declare class InsightsQuestionnairesQuestionInstance {
136
187
  * The flag to enable for disable NA for answer.
137
188
  */
138
189
  allowNa: boolean;
190
+ /**
191
+ * Integer value that tells a particular question is used by how many questionnaires
192
+ */
193
+ usage: number;
139
194
  url: string;
140
195
  private get _proxy();
141
196
  /**
@@ -177,6 +232,7 @@ export declare class InsightsQuestionnairesQuestionInstance {
177
232
  category: any;
178
233
  answerSetId: string;
179
234
  allowNa: boolean;
235
+ usage: number;
180
236
  url: string;
181
237
  };
182
238
  [inspect.custom](_depth: any, options: InspectOptions): string;
@@ -198,6 +254,56 @@ export interface InsightsQuestionnairesQuestionListInstance {
198
254
  * @returns Resolves to processed InsightsQuestionnairesQuestionInstance
199
255
  */
200
256
  create(params: InsightsQuestionnairesQuestionListInstanceCreateOptions, callback?: (error: Error | null, item?: InsightsQuestionnairesQuestionInstance) => any): Promise<InsightsQuestionnairesQuestionInstance>;
257
+ /**
258
+ * Streams InsightsQuestionnairesQuestionInstance records from the API.
259
+ *
260
+ * This operation lazily loads records as efficiently as possible until the limit
261
+ * is reached.
262
+ *
263
+ * The results are passed into the callback function, so this operation is memory
264
+ * efficient.
265
+ *
266
+ * If a function is passed as the first argument, it will be used as the callback
267
+ * function.
268
+ *
269
+ * @param { InsightsQuestionnairesQuestionListInstanceEachOptions } [params] - Options for request
270
+ * @param { function } [callback] - Function to process each record
271
+ */
272
+ each(callback?: (item: InsightsQuestionnairesQuestionInstance, done: (err?: Error) => void) => void): void;
273
+ each(params: InsightsQuestionnairesQuestionListInstanceEachOptions, callback?: (item: InsightsQuestionnairesQuestionInstance, done: (err?: Error) => void) => void): void;
274
+ /**
275
+ * Retrieve a single target page of InsightsQuestionnairesQuestionInstance records from the API.
276
+ *
277
+ * The request is executed immediately.
278
+ *
279
+ * @param { string } [targetUrl] - API-generated URL for the requested results page
280
+ * @param { function } [callback] - Callback to handle list of records
281
+ */
282
+ getPage(targetUrl: string, callback?: (error: Error | null, items: InsightsQuestionnairesQuestionPage) => any): Promise<InsightsQuestionnairesQuestionPage>;
283
+ /**
284
+ * Lists InsightsQuestionnairesQuestionInstance records from the API as a list.
285
+ *
286
+ * If a function is passed as the first argument, it will be used as the callback
287
+ * function.
288
+ *
289
+ * @param { InsightsQuestionnairesQuestionListInstanceOptions } [params] - Options for request
290
+ * @param { function } [callback] - Callback to handle list of records
291
+ */
292
+ list(callback?: (error: Error | null, items: InsightsQuestionnairesQuestionInstance[]) => any): Promise<InsightsQuestionnairesQuestionInstance[]>;
293
+ list(params: InsightsQuestionnairesQuestionListInstanceOptions, callback?: (error: Error | null, items: InsightsQuestionnairesQuestionInstance[]) => any): Promise<InsightsQuestionnairesQuestionInstance[]>;
294
+ /**
295
+ * Retrieve a single page of InsightsQuestionnairesQuestionInstance records from the API.
296
+ *
297
+ * The request is executed immediately.
298
+ *
299
+ * If a function is passed as the first argument, it will be used as the callback
300
+ * function.
301
+ *
302
+ * @param { InsightsQuestionnairesQuestionListInstancePageOptions } [params] - Options for request
303
+ * @param { function } [callback] - Callback to handle list of records
304
+ */
305
+ page(callback?: (error: Error | null, items: InsightsQuestionnairesQuestionPage) => any): Promise<InsightsQuestionnairesQuestionPage>;
306
+ page(params: InsightsQuestionnairesQuestionListInstancePageOptions, callback?: (error: Error | null, items: InsightsQuestionnairesQuestionPage) => any): Promise<InsightsQuestionnairesQuestionPage>;
201
307
  /**
202
308
  * Provide a user-friendly representation
203
309
  */
@@ -205,4 +311,21 @@ export interface InsightsQuestionnairesQuestionListInstance {
205
311
  [inspect.custom](_depth: any, options: InspectOptions): any;
206
312
  }
207
313
  export declare function InsightsQuestionnairesQuestionListInstance(version: V1): InsightsQuestionnairesQuestionListInstance;
314
+ export declare class InsightsQuestionnairesQuestionPage extends Page<V1, InsightsQuestionnairesQuestionPayload, InsightsQuestionnairesQuestionResource, InsightsQuestionnairesQuestionInstance> {
315
+ /**
316
+ * Initialize the InsightsQuestionnairesQuestionPage
317
+ *
318
+ * @param version - Version of the resource
319
+ * @param response - Response from the API
320
+ * @param solution - Path solution
321
+ */
322
+ constructor(version: V1, response: Response<string>, solution: InsightsQuestionnairesQuestionSolution);
323
+ /**
324
+ * Build an instance of InsightsQuestionnairesQuestionInstance
325
+ *
326
+ * @param payload - Payload response from the API
327
+ */
328
+ getInstance(payload: InsightsQuestionnairesQuestionResource): InsightsQuestionnairesQuestionInstance;
329
+ [inspect.custom](depth: any, options: InspectOptions): string;
330
+ }
208
331
  export {};
@@ -12,9 +12,13 @@
12
12
  * https://openapi-generator.tech
13
13
  * Do not edit the class manually.
14
14
  */
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
15
18
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.InsightsQuestionnairesQuestionListInstance = exports.InsightsQuestionnairesQuestionInstance = exports.InsightsQuestionnairesQuestionContextImpl = void 0;
19
+ exports.InsightsQuestionnairesQuestionPage = exports.InsightsQuestionnairesQuestionListInstance = exports.InsightsQuestionnairesQuestionInstance = exports.InsightsQuestionnairesQuestionContextImpl = void 0;
17
20
  const util_1 = require("util");
21
+ const Page_1 = __importDefault(require("../../../base/Page"));
18
22
  const deserialize = require("../../../base/deserialize");
19
23
  const serialize = require("../../../base/serialize");
20
24
  const utility_1 = require("../../../base/utility");
@@ -53,25 +57,19 @@ class InsightsQuestionnairesQuestionContextImpl {
53
57
  if (params === null || params === undefined) {
54
58
  throw new Error('Required parameter "params" missing.');
55
59
  }
56
- if (params["question"] === null || params["question"] === undefined) {
57
- throw new Error("Required parameter \"params['question']\" missing.");
58
- }
59
- if (params["description"] === null || params["description"] === undefined) {
60
- throw new Error("Required parameter \"params['description']\" missing.");
61
- }
62
- if (params["answerSetId"] === null || params["answerSetId"] === undefined) {
63
- throw new Error("Required parameter \"params['answerSetId']\" missing.");
64
- }
65
60
  if (params["allowNa"] === null || params["allowNa"] === undefined) {
66
61
  throw new Error("Required parameter \"params['allowNa']\" missing.");
67
62
  }
68
63
  let data = {};
69
- data["Question"] = params["question"];
70
- data["Description"] = params["description"];
71
- data["AnswerSetId"] = params["answerSetId"];
72
64
  data["AllowNa"] = serialize.bool(params["allowNa"]);
73
65
  if (params["categoryId"] !== undefined)
74
66
  data["CategoryId"] = params["categoryId"];
67
+ if (params["question"] !== undefined)
68
+ data["Question"] = params["question"];
69
+ if (params["description"] !== undefined)
70
+ data["Description"] = params["description"];
71
+ if (params["answerSetId"] !== undefined)
72
+ data["AnswerSetId"] = params["answerSetId"];
75
73
  const headers = {};
76
74
  headers["Content-Type"] = "application/x-www-form-urlencoded";
77
75
  if (params["token"] !== undefined)
@@ -110,6 +108,7 @@ class InsightsQuestionnairesQuestionInstance {
110
108
  this.category = payload.category;
111
109
  this.answerSetId = payload.answer_set_id;
112
110
  this.allowNa = payload.allow_na;
111
+ this.usage = deserialize.integer(payload.usage);
113
112
  this.url = payload.url;
114
113
  this._solution = { questionId: questionId || this.questionId };
115
114
  }
@@ -139,6 +138,7 @@ class InsightsQuestionnairesQuestionInstance {
139
138
  category: this.category,
140
139
  answerSetId: this.answerSetId,
141
140
  allowNa: this.allowNa,
141
+ usage: this.usage,
142
142
  url: this.url,
143
143
  };
144
144
  }
@@ -194,6 +194,47 @@ function InsightsQuestionnairesQuestionListInstance(version) {
194
194
  operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
195
195
  return operationPromise;
196
196
  };
197
+ instance.page = function page(params, callback) {
198
+ if (params instanceof Function) {
199
+ callback = params;
200
+ params = {};
201
+ }
202
+ else {
203
+ params = params || {};
204
+ }
205
+ let data = {};
206
+ if (params["categoryId"] !== undefined)
207
+ data["CategoryId"] = serialize.map(params["categoryId"], (e) => e);
208
+ if (params["pageSize"] !== undefined)
209
+ data["PageSize"] = params["pageSize"];
210
+ if (params.pageNumber !== undefined)
211
+ data["Page"] = params.pageNumber;
212
+ if (params.pageToken !== undefined)
213
+ data["PageToken"] = params.pageToken;
214
+ const headers = {};
215
+ if (params["token"] !== undefined)
216
+ headers["Token"] = params["token"];
217
+ let operationVersion = version, operationPromise = operationVersion.page({
218
+ uri: instance._uri,
219
+ method: "get",
220
+ params: data,
221
+ headers,
222
+ });
223
+ operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesQuestionPage(operationVersion, payload, instance._solution));
224
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
225
+ return operationPromise;
226
+ };
227
+ instance.each = instance._version.each;
228
+ instance.list = instance._version.list;
229
+ instance.getPage = function getPage(targetUrl, callback) {
230
+ const operationPromise = instance._version._domain.twilio.request({
231
+ method: "get",
232
+ uri: targetUrl,
233
+ });
234
+ let pagePromise = operationPromise.then((payload) => new InsightsQuestionnairesQuestionPage(instance._version, payload, instance._solution));
235
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
236
+ return pagePromise;
237
+ };
197
238
  instance.toJSON = function toJSON() {
198
239
  return instance._solution;
199
240
  };
@@ -203,3 +244,27 @@ function InsightsQuestionnairesQuestionListInstance(version) {
203
244
  return instance;
204
245
  }
205
246
  exports.InsightsQuestionnairesQuestionListInstance = InsightsQuestionnairesQuestionListInstance;
247
+ class InsightsQuestionnairesQuestionPage extends Page_1.default {
248
+ /**
249
+ * Initialize the InsightsQuestionnairesQuestionPage
250
+ *
251
+ * @param version - Version of the resource
252
+ * @param response - Response from the API
253
+ * @param solution - Path solution
254
+ */
255
+ constructor(version, response, solution) {
256
+ super(version, response, solution);
257
+ }
258
+ /**
259
+ * Build an instance of InsightsQuestionnairesQuestionInstance
260
+ *
261
+ * @param payload - Payload response from the API
262
+ */
263
+ getInstance(payload) {
264
+ return new InsightsQuestionnairesQuestionInstance(this._version, payload);
265
+ }
266
+ [util_1.inspect.custom](depth, options) {
267
+ return (0, util_1.inspect)(this.toJSON(), options);
268
+ }
269
+ }
270
+ exports.InsightsQuestionnairesQuestionPage = InsightsQuestionnairesQuestionPage;