twilio 4.8.0 → 4.9.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.
Files changed (111) hide show
  1. package/lib/base/BaseTwilio.d.ts +1 -0
  2. package/lib/jwt/AccessToken.d.ts +168 -173
  3. package/lib/jwt/AccessToken.js +180 -185
  4. package/lib/rest/api/v2010/account/address/dependentPhoneNumber.d.ts +15 -20
  5. package/lib/rest/api/v2010/account/application.d.ts +15 -20
  6. package/lib/rest/api/v2010/account/call/feedback.d.ts +5 -5
  7. package/lib/rest/api/v2010/account/call/feedbackSummary.d.ts +4 -4
  8. package/lib/rest/api/v2010/account/call/notification.d.ts +3 -4
  9. package/lib/rest/api/v2010/account/call/payment.d.ts +10 -10
  10. package/lib/rest/api/v2010/account/call/recording.d.ts +9 -9
  11. package/lib/rest/api/v2010/account/conference/recording.d.ts +9 -9
  12. package/lib/rest/api/v2010/account/connectApp.d.ts +3 -4
  13. package/lib/rest/api/v2010/account/incomingPhoneNumber/local.d.ts +33 -38
  14. package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.d.ts +33 -38
  15. package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.d.ts +33 -38
  16. package/lib/rest/api/v2010/account/incomingPhoneNumber.d.ts +15 -20
  17. package/lib/rest/api/v2010/account/message/feedback.d.ts +5 -5
  18. package/lib/rest/api/v2010/account/notification.d.ts +3 -4
  19. package/lib/rest/api/v2010/account/queue.d.ts +3 -3
  20. package/lib/rest/api/v2010/account/recording/addOnResult.d.ts +4 -4
  21. package/lib/rest/api/v2010/account/recording/transcription.d.ts +4 -4
  22. package/lib/rest/api/v2010/account/shortCode.d.ts +6 -8
  23. package/lib/rest/api/v2010/account/sip/domain.d.ts +9 -12
  24. package/lib/rest/api/v2010/account/usage/record/allTime.d.ts +7 -7
  25. package/lib/rest/api/v2010/account/usage/record/daily.d.ts +7 -7
  26. package/lib/rest/api/v2010/account/usage/record/lastMonth.d.ts +7 -7
  27. package/lib/rest/api/v2010/account/usage/record/monthly.d.ts +7 -7
  28. package/lib/rest/api/v2010/account/usage/record/thisMonth.d.ts +7 -7
  29. package/lib/rest/api/v2010/account/usage/record/today.d.ts +7 -7
  30. package/lib/rest/api/v2010/account/usage/record/yearly.d.ts +7 -7
  31. package/lib/rest/api/v2010/account/usage/record/yesterday.d.ts +7 -7
  32. package/lib/rest/api/v2010/account/usage/record.d.ts +7 -7
  33. package/lib/rest/api/v2010/account/usage/trigger.d.ts +27 -28
  34. package/lib/rest/api/v2010/account/usage.d.ts +1 -1
  35. package/lib/rest/chat/v2/service/channel/webhook.d.ts +5 -5
  36. package/lib/rest/content/V1.d.ts +5 -0
  37. package/lib/rest/content/V1.js +7 -0
  38. package/lib/rest/content/v1/contentAndApprovals.d.ts +190 -0
  39. package/lib/rest/content/v1/contentAndApprovals.js +134 -0
  40. package/lib/rest/conversations/v1/addressConfiguration.d.ts +8 -8
  41. package/lib/rest/conversations/v1/configuration/webhook.d.ts +9 -9
  42. package/lib/rest/conversations/v1/conversation/message/deliveryReceipt.d.ts +4 -4
  43. package/lib/rest/conversations/v1/conversation/message.d.ts +8 -8
  44. package/lib/rest/conversations/v1/conversation/participant.d.ts +4 -4
  45. package/lib/rest/conversations/v1/conversation/webhook.d.ts +5 -5
  46. package/lib/rest/conversations/v1/service/binding.d.ts +7 -7
  47. package/lib/rest/conversations/v1/service/configuration/webhook.d.ts +4 -4
  48. package/lib/rest/conversations/v1/service/conversation/message/deliveryReceipt.d.ts +4 -4
  49. package/lib/rest/conversations/v1/service/conversation/message.d.ts +8 -8
  50. package/lib/rest/conversations/v1/service/conversation/participant.d.ts +4 -4
  51. package/lib/rest/conversations/v1/service/conversation/webhook.d.ts +5 -5
  52. package/lib/rest/conversations/v1/service/conversation.d.ts +10 -10
  53. package/lib/rest/conversations/v1/service/participantConversation.d.ts +4 -4
  54. package/lib/rest/conversations/v1/service/role.d.ts +5 -5
  55. package/lib/rest/conversations/v1/service/user/userConversation.d.ts +9 -9
  56. package/lib/rest/conversations/v1/service/user.d.ts +4 -4
  57. package/lib/rest/flexApi/V1.d.ts +5 -0
  58. package/lib/rest/flexApi/V1.js +7 -0
  59. package/lib/rest/flexApi/v1/assessments.d.ts +117 -0
  60. package/lib/rest/flexApi/v1/assessments.js +70 -1
  61. package/lib/rest/flexApi/v1/insightsConversations.d.ts +172 -0
  62. package/lib/rest/flexApi/v1/insightsConversations.js +128 -0
  63. package/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.d.ts +2 -2
  64. package/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.js +2 -4
  65. package/lib/rest/insights/v1/call/callSummary.d.ts +17 -17
  66. package/lib/rest/insights/v1/room/participant.d.ts +16 -16
  67. package/lib/rest/insights/v1/room.d.ts +41 -42
  68. package/lib/rest/ipMessaging/v2/service/channel/webhook.d.ts +5 -5
  69. package/lib/rest/media/v1/mediaProcessor.d.ts +3 -4
  70. package/lib/rest/media/v1/mediaRecording.d.ts +3 -4
  71. package/lib/rest/media/v1/playerStreamer.d.ts +3 -4
  72. package/lib/rest/messaging/V1.d.ts +10 -0
  73. package/lib/rest/messaging/V1.js +16 -0
  74. package/lib/rest/messaging/v1/brandRegistration.d.ts +12 -12
  75. package/lib/rest/messaging/v1/domainCerts.d.ts +4 -4
  76. package/lib/rest/messaging/v1/domainCerts.js +2 -2
  77. package/lib/rest/messaging/v1/domainConfigMessagingService.d.ts +121 -0
  78. package/lib/rest/messaging/v1/domainConfigMessagingService.js +122 -0
  79. package/lib/rest/messaging/v1/linkshorteningMessagingService.d.ts +109 -0
  80. package/lib/rest/messaging/v1/linkshorteningMessagingService.js +135 -0
  81. package/lib/rest/messaging/v1/service.d.ts +6 -8
  82. package/lib/rest/microvisor/v1/app/appManifest.d.ts +101 -0
  83. package/lib/rest/microvisor/v1/app/appManifest.js +115 -0
  84. package/lib/rest/microvisor/v1/app.d.ts +11 -0
  85. package/lib/rest/microvisor/v1/app.js +15 -0
  86. package/lib/rest/monitor/v1/alert.d.ts +3 -4
  87. package/lib/rest/preview/wireless/sim.d.ts +12 -16
  88. package/lib/rest/supersim/v1/esimProfile.d.ts +14 -0
  89. package/lib/rest/supersim/v1/esimProfile.js +6 -0
  90. package/lib/rest/supersim/v1/fleet.d.ts +6 -8
  91. package/lib/rest/taskrouter/v1/workspace/task/reservation.d.ts +14 -14
  92. package/lib/rest/taskrouter/v1/workspace/worker/reservation.d.ts +12 -12
  93. package/lib/rest/trunking/v1/trunk/phoneNumber.d.ts +15 -20
  94. package/lib/rest/trunking/v1/trunk.d.ts +3 -4
  95. package/lib/rest/trusthub/v1/customerProfiles/customerProfilesEvaluations.d.ts +4 -4
  96. package/lib/rest/trusthub/v1/customerProfiles.d.ts +8 -8
  97. package/lib/rest/trusthub/v1/trustProducts/trustProductsEvaluations.d.ts +4 -4
  98. package/lib/rest/trusthub/v1/trustProducts.d.ts +8 -8
  99. package/lib/rest/verify/v2/service/verification.d.ts +1 -1
  100. package/lib/rest/video/v1/composition.d.ts +3 -4
  101. package/lib/rest/video/v1/compositionHook.d.ts +3 -4
  102. package/lib/rest/video/v1/recording.d.ts +3 -4
  103. package/lib/rest/video/v1/room/participant/anonymize.d.ts +4 -4
  104. package/lib/rest/video/v1/room/participant/publishedTrack.d.ts +4 -4
  105. package/lib/rest/video/v1/room/participant/subscribedTrack.d.ts +4 -4
  106. package/lib/rest/video/v1/room/participant.d.ts +8 -8
  107. package/lib/rest/video/v1/room.d.ts +3 -4
  108. package/lib/rest/voice/v1/byocTrunk.d.ts +9 -12
  109. package/lib/rest/wireless/v1/sim.d.ts +15 -20
  110. package/lib/rest/wireless/v1/usageRecord.d.ts +4 -4
  111. package/package.json +1 -1
@@ -4,20 +4,20 @@ import Page, { TwilioResponsePayload } from "../../../../base/Page";
4
4
  import Response from "../../../../http/response";
5
5
  import V1 from "../../V1";
6
6
  import { UserConversationListInstance } from "./user/userConversation";
7
- export type ServiceUserWebhookEnabledType = "true" | "false";
7
+ export type UserWebhookEnabledType = "true" | "false";
8
8
  /**
9
9
  * Options to pass to remove a UserInstance
10
10
  */
11
11
  export interface UserContextRemoveOptions {
12
12
  /** The X-Twilio-Webhook-Enabled HTTP request header */
13
- xTwilioWebhookEnabled?: ServiceUserWebhookEnabledType;
13
+ xTwilioWebhookEnabled?: UserWebhookEnabledType;
14
14
  }
15
15
  /**
16
16
  * Options to pass to update a UserInstance
17
17
  */
18
18
  export interface UserContextUpdateOptions {
19
19
  /** The X-Twilio-Webhook-Enabled HTTP request header */
20
- xTwilioWebhookEnabled?: ServiceUserWebhookEnabledType;
20
+ xTwilioWebhookEnabled?: UserWebhookEnabledType;
21
21
  /** The string that you assigned to describe the resource. */
22
22
  friendlyName?: string;
23
23
  /** The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. */
@@ -32,7 +32,7 @@ export interface UserListInstanceCreateOptions {
32
32
  /** The application-defined string that uniquely identifies the resource\\\'s User within the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource). This value is often a username or an email address, and is case-sensitive. */
33
33
  identity: string;
34
34
  /** The X-Twilio-Webhook-Enabled HTTP request header */
35
- xTwilioWebhookEnabled?: ServiceUserWebhookEnabledType;
35
+ xTwilioWebhookEnabled?: UserWebhookEnabledType;
36
36
  /** The string that you assigned to describe the resource. */
37
37
  friendlyName?: string;
38
38
  /** The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. */
@@ -5,6 +5,7 @@ import { ChannelListInstance } from "./v1/channel";
5
5
  import { ConfigurationListInstance } from "./v1/configuration";
6
6
  import { FlexFlowListInstance } from "./v1/flexFlow";
7
7
  import { InsightsAssessmentsCommentListInstance } from "./v1/insightsAssessmentsComment";
8
+ import { InsightsConversationsListInstance } from "./v1/insightsConversations";
8
9
  import { InsightsQuestionnairesListInstance } from "./v1/insightsQuestionnaires";
9
10
  import { InsightsQuestionnairesCategoryListInstance } from "./v1/insightsQuestionnairesCategory";
10
11
  import { InsightsQuestionnairesQuestionListInstance } from "./v1/insightsQuestionnairesQuestion";
@@ -32,6 +33,8 @@ export default class V1 extends Version {
32
33
  protected _flexFlow?: FlexFlowListInstance;
33
34
  /** insightsAssessmentsComment - { Twilio.FlexApi.V1.InsightsAssessmentsCommentListInstance } resource */
34
35
  protected _insightsAssessmentsComment?: InsightsAssessmentsCommentListInstance;
36
+ /** insightsConversations - { Twilio.FlexApi.V1.InsightsConversationsListInstance } resource */
37
+ protected _insightsConversations?: InsightsConversationsListInstance;
35
38
  /** insightsQuestionnaires - { Twilio.FlexApi.V1.InsightsQuestionnairesListInstance } resource */
36
39
  protected _insightsQuestionnaires?: InsightsQuestionnairesListInstance;
37
40
  /** insightsQuestionnairesCategory - { Twilio.FlexApi.V1.InsightsQuestionnairesCategoryListInstance } resource */
@@ -62,6 +65,8 @@ export default class V1 extends Version {
62
65
  get flexFlow(): FlexFlowListInstance;
63
66
  /** Getter for insightsAssessmentsComment resource */
64
67
  get insightsAssessmentsComment(): InsightsAssessmentsCommentListInstance;
68
+ /** Getter for insightsConversations resource */
69
+ get insightsConversations(): InsightsConversationsListInstance;
65
70
  /** Getter for insightsQuestionnaires resource */
66
71
  get insightsQuestionnaires(): InsightsQuestionnairesListInstance;
67
72
  /** Getter for insightsQuestionnairesCategory resource */
@@ -22,6 +22,7 @@ const channel_1 = require("./v1/channel");
22
22
  const configuration_1 = require("./v1/configuration");
23
23
  const flexFlow_1 = require("./v1/flexFlow");
24
24
  const insightsAssessmentsComment_1 = require("./v1/insightsAssessmentsComment");
25
+ const insightsConversations_1 = require("./v1/insightsConversations");
25
26
  const insightsQuestionnaires_1 = require("./v1/insightsQuestionnaires");
26
27
  const insightsQuestionnairesCategory_1 = require("./v1/insightsQuestionnairesCategory");
27
28
  const insightsQuestionnairesQuestion_1 = require("./v1/insightsQuestionnairesQuestion");
@@ -69,6 +70,12 @@ class V1 extends Version_1.default {
69
70
  (0, insightsAssessmentsComment_1.InsightsAssessmentsCommentListInstance)(this);
70
71
  return this._insightsAssessmentsComment;
71
72
  }
73
+ /** Getter for insightsConversations resource */
74
+ get insightsConversations() {
75
+ this._insightsConversations =
76
+ this._insightsConversations || (0, insightsConversations_1.InsightsConversationsListInstance)(this);
77
+ return this._insightsConversations;
78
+ }
72
79
  /** Getter for insightsQuestionnaires resource */
73
80
  get insightsQuestionnaires() {
74
81
  this._insightsQuestionnaires =
@@ -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 update a AssessmentsInstance
@@ -45,6 +47,51 @@ export interface AssessmentsListInstanceCreateOptions {
45
47
  /** The Token HTTP request header */
46
48
  token?: string;
47
49
  }
50
+ /**
51
+ * Options to pass to each
52
+ */
53
+ export interface AssessmentsListInstanceEachOptions {
54
+ /** The Token HTTP request header */
55
+ token?: string;
56
+ /** The id of the segment. */
57
+ segmentId?: string;
58
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
59
+ pageSize?: number;
60
+ /** Function to process each record. If this and a positional callback are passed, this one will be used */
61
+ callback?: (item: AssessmentsInstance, done: (err?: Error) => void) => void;
62
+ /** Function to be called upon completion of streaming */
63
+ done?: Function;
64
+ /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
65
+ limit?: number;
66
+ }
67
+ /**
68
+ * Options to pass to list
69
+ */
70
+ export interface AssessmentsListInstanceOptions {
71
+ /** The Token HTTP request header */
72
+ token?: string;
73
+ /** The id of the segment. */
74
+ segmentId?: string;
75
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
76
+ pageSize?: number;
77
+ /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
78
+ limit?: number;
79
+ }
80
+ /**
81
+ * Options to pass to page
82
+ */
83
+ export interface AssessmentsListInstancePageOptions {
84
+ /** The Token HTTP request header */
85
+ token?: string;
86
+ /** The id of the segment. */
87
+ segmentId?: string;
88
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
89
+ pageSize?: number;
90
+ /** Page Number, this value is simply for client state */
91
+ pageNumber?: number;
92
+ /** PageToken provided by the API */
93
+ pageToken?: string;
94
+ }
48
95
  export interface AssessmentsContext {
49
96
  /**
50
97
  * Update a AssessmentsInstance
@@ -78,6 +125,9 @@ export declare class AssessmentsContextImpl implements AssessmentsContext {
78
125
  toJSON(): AssessmentsContextSolution;
79
126
  [inspect.custom](_depth: any, options: InspectOptions): string;
80
127
  }
128
+ interface AssessmentsPayload extends TwilioResponsePayload {
129
+ assessments: AssessmentsResource[];
130
+ }
81
131
  interface AssessmentsResource {
82
132
  account_sid: string;
83
133
  assessment_id: string;
@@ -199,6 +249,56 @@ export interface AssessmentsListInstance {
199
249
  * @returns Resolves to processed AssessmentsInstance
200
250
  */
201
251
  create(params: AssessmentsListInstanceCreateOptions, callback?: (error: Error | null, item?: AssessmentsInstance) => any): Promise<AssessmentsInstance>;
252
+ /**
253
+ * Streams AssessmentsInstance records from the API.
254
+ *
255
+ * This operation lazily loads records as efficiently as possible until the limit
256
+ * is reached.
257
+ *
258
+ * The results are passed into the callback function, so this operation is memory
259
+ * efficient.
260
+ *
261
+ * If a function is passed as the first argument, it will be used as the callback
262
+ * function.
263
+ *
264
+ * @param { AssessmentsListInstanceEachOptions } [params] - Options for request
265
+ * @param { function } [callback] - Function to process each record
266
+ */
267
+ each(callback?: (item: AssessmentsInstance, done: (err?: Error) => void) => void): void;
268
+ each(params: AssessmentsListInstanceEachOptions, callback?: (item: AssessmentsInstance, done: (err?: Error) => void) => void): void;
269
+ /**
270
+ * Retrieve a single target page of AssessmentsInstance records from the API.
271
+ *
272
+ * The request is executed immediately.
273
+ *
274
+ * @param { string } [targetUrl] - API-generated URL for the requested results page
275
+ * @param { function } [callback] - Callback to handle list of records
276
+ */
277
+ getPage(targetUrl: string, callback?: (error: Error | null, items: AssessmentsPage) => any): Promise<AssessmentsPage>;
278
+ /**
279
+ * Lists AssessmentsInstance records from the API as a list.
280
+ *
281
+ * If a function is passed as the first argument, it will be used as the callback
282
+ * function.
283
+ *
284
+ * @param { AssessmentsListInstanceOptions } [params] - Options for request
285
+ * @param { function } [callback] - Callback to handle list of records
286
+ */
287
+ list(callback?: (error: Error | null, items: AssessmentsInstance[]) => any): Promise<AssessmentsInstance[]>;
288
+ list(params: AssessmentsListInstanceOptions, callback?: (error: Error | null, items: AssessmentsInstance[]) => any): Promise<AssessmentsInstance[]>;
289
+ /**
290
+ * Retrieve a single page of AssessmentsInstance records from the API.
291
+ *
292
+ * The request is executed immediately.
293
+ *
294
+ * If a function is passed as the first argument, it will be used as the callback
295
+ * function.
296
+ *
297
+ * @param { AssessmentsListInstancePageOptions } [params] - Options for request
298
+ * @param { function } [callback] - Callback to handle list of records
299
+ */
300
+ page(callback?: (error: Error | null, items: AssessmentsPage) => any): Promise<AssessmentsPage>;
301
+ page(params: AssessmentsListInstancePageOptions, callback?: (error: Error | null, items: AssessmentsPage) => any): Promise<AssessmentsPage>;
202
302
  /**
203
303
  * Provide a user-friendly representation
204
304
  */
@@ -206,4 +306,21 @@ export interface AssessmentsListInstance {
206
306
  [inspect.custom](_depth: any, options: InspectOptions): any;
207
307
  }
208
308
  export declare function AssessmentsListInstance(version: V1): AssessmentsListInstance;
309
+ export declare class AssessmentsPage extends Page<V1, AssessmentsPayload, AssessmentsResource, AssessmentsInstance> {
310
+ /**
311
+ * Initialize the AssessmentsPage
312
+ *
313
+ * @param version - Version of the resource
314
+ * @param response - Response from the API
315
+ * @param solution - Path solution
316
+ */
317
+ constructor(version: V1, response: Response<string>, solution: AssessmentsSolution);
318
+ /**
319
+ * Build an instance of AssessmentsInstance
320
+ *
321
+ * @param payload - Payload response from the API
322
+ */
323
+ getInstance(payload: AssessmentsResource): AssessmentsInstance;
324
+ [inspect.custom](depth: any, options: InspectOptions): string;
325
+ }
209
326
  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.AssessmentsListInstance = exports.AssessmentsInstance = exports.AssessmentsContextImpl = void 0;
19
+ exports.AssessmentsPage = exports.AssessmentsListInstance = exports.AssessmentsInstance = exports.AssessmentsContextImpl = 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");
@@ -205,6 +209,47 @@ function AssessmentsListInstance(version) {
205
209
  operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
206
210
  return operationPromise;
207
211
  };
212
+ instance.page = function page(params, callback) {
213
+ if (params instanceof Function) {
214
+ callback = params;
215
+ params = {};
216
+ }
217
+ else {
218
+ params = params || {};
219
+ }
220
+ let data = {};
221
+ if (params["segmentId"] !== undefined)
222
+ data["SegmentId"] = params["segmentId"];
223
+ if (params["pageSize"] !== undefined)
224
+ data["PageSize"] = params["pageSize"];
225
+ if (params.pageNumber !== undefined)
226
+ data["Page"] = params.pageNumber;
227
+ if (params.pageToken !== undefined)
228
+ data["PageToken"] = params.pageToken;
229
+ const headers = {};
230
+ if (params["token"] !== undefined)
231
+ headers["Token"] = params["token"];
232
+ let operationVersion = version, operationPromise = operationVersion.page({
233
+ uri: instance._uri,
234
+ method: "get",
235
+ params: data,
236
+ headers,
237
+ });
238
+ operationPromise = operationPromise.then((payload) => new AssessmentsPage(operationVersion, payload, instance._solution));
239
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
240
+ return operationPromise;
241
+ };
242
+ instance.each = instance._version.each;
243
+ instance.list = instance._version.list;
244
+ instance.getPage = function getPage(targetUrl, callback) {
245
+ const operationPromise = instance._version._domain.twilio.request({
246
+ method: "get",
247
+ uri: targetUrl,
248
+ });
249
+ let pagePromise = operationPromise.then((payload) => new AssessmentsPage(instance._version, payload, instance._solution));
250
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
251
+ return pagePromise;
252
+ };
208
253
  instance.toJSON = function toJSON() {
209
254
  return instance._solution;
210
255
  };
@@ -214,3 +259,27 @@ function AssessmentsListInstance(version) {
214
259
  return instance;
215
260
  }
216
261
  exports.AssessmentsListInstance = AssessmentsListInstance;
262
+ class AssessmentsPage extends Page_1.default {
263
+ /**
264
+ * Initialize the AssessmentsPage
265
+ *
266
+ * @param version - Version of the resource
267
+ * @param response - Response from the API
268
+ * @param solution - Path solution
269
+ */
270
+ constructor(version, response, solution) {
271
+ super(version, response, solution);
272
+ }
273
+ /**
274
+ * Build an instance of AssessmentsInstance
275
+ *
276
+ * @param payload - Payload response from the API
277
+ */
278
+ getInstance(payload) {
279
+ return new AssessmentsInstance(this._version, payload);
280
+ }
281
+ [util_1.inspect.custom](depth, options) {
282
+ return (0, util_1.inspect)(this.toJSON(), options);
283
+ }
284
+ }
285
+ exports.AssessmentsPage = AssessmentsPage;
@@ -0,0 +1,172 @@
1
+ /// <reference types="node" />
2
+ import { inspect, InspectOptions } from "util";
3
+ import Page, { TwilioResponsePayload } from "../../../base/Page";
4
+ import Response from "../../../http/response";
5
+ import V1 from "../V1";
6
+ /**
7
+ * Options to pass to each
8
+ */
9
+ export interface InsightsConversationsListInstanceEachOptions {
10
+ /** The Token HTTP request header */
11
+ token?: string;
12
+ /** Unique Id of the segment for which conversation details needs to be fetched */
13
+ segmentId?: string;
14
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
15
+ pageSize?: number;
16
+ /** Function to process each record. If this and a positional callback are passed, this one will be used */
17
+ callback?: (item: InsightsConversationsInstance, done: (err?: Error) => void) => void;
18
+ /** Function to be called upon completion of streaming */
19
+ done?: Function;
20
+ /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
21
+ limit?: number;
22
+ }
23
+ /**
24
+ * Options to pass to list
25
+ */
26
+ export interface InsightsConversationsListInstanceOptions {
27
+ /** The Token HTTP request header */
28
+ token?: string;
29
+ /** Unique Id of the segment for which conversation details needs to be fetched */
30
+ segmentId?: string;
31
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
32
+ pageSize?: number;
33
+ /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
34
+ limit?: number;
35
+ }
36
+ /**
37
+ * Options to pass to page
38
+ */
39
+ export interface InsightsConversationsListInstancePageOptions {
40
+ /** The Token HTTP request header */
41
+ token?: string;
42
+ /** Unique Id of the segment for which conversation details needs to be fetched */
43
+ segmentId?: string;
44
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
45
+ pageSize?: number;
46
+ /** Page Number, this value is simply for client state */
47
+ pageNumber?: number;
48
+ /** PageToken provided by the API */
49
+ pageToken?: string;
50
+ }
51
+ export interface InsightsConversationsSolution {
52
+ }
53
+ export interface InsightsConversationsListInstance {
54
+ _version: V1;
55
+ _solution: InsightsConversationsSolution;
56
+ _uri: string;
57
+ /**
58
+ * Streams InsightsConversationsInstance records from the API.
59
+ *
60
+ * This operation lazily loads records as efficiently as possible until the limit
61
+ * is reached.
62
+ *
63
+ * The results are passed into the callback function, so this operation is memory
64
+ * efficient.
65
+ *
66
+ * If a function is passed as the first argument, it will be used as the callback
67
+ * function.
68
+ *
69
+ * @param { InsightsConversationsListInstanceEachOptions } [params] - Options for request
70
+ * @param { function } [callback] - Function to process each record
71
+ */
72
+ each(callback?: (item: InsightsConversationsInstance, done: (err?: Error) => void) => void): void;
73
+ each(params: InsightsConversationsListInstanceEachOptions, callback?: (item: InsightsConversationsInstance, done: (err?: Error) => void) => void): void;
74
+ /**
75
+ * Retrieve a single target page of InsightsConversationsInstance records from the API.
76
+ *
77
+ * The request is executed immediately.
78
+ *
79
+ * @param { string } [targetUrl] - API-generated URL for the requested results page
80
+ * @param { function } [callback] - Callback to handle list of records
81
+ */
82
+ getPage(targetUrl: string, callback?: (error: Error | null, items: InsightsConversationsPage) => any): Promise<InsightsConversationsPage>;
83
+ /**
84
+ * Lists InsightsConversationsInstance records from the API as a list.
85
+ *
86
+ * If a function is passed as the first argument, it will be used as the callback
87
+ * function.
88
+ *
89
+ * @param { InsightsConversationsListInstanceOptions } [params] - Options for request
90
+ * @param { function } [callback] - Callback to handle list of records
91
+ */
92
+ list(callback?: (error: Error | null, items: InsightsConversationsInstance[]) => any): Promise<InsightsConversationsInstance[]>;
93
+ list(params: InsightsConversationsListInstanceOptions, callback?: (error: Error | null, items: InsightsConversationsInstance[]) => any): Promise<InsightsConversationsInstance[]>;
94
+ /**
95
+ * Retrieve a single page of InsightsConversationsInstance records from the API.
96
+ *
97
+ * The request is executed immediately.
98
+ *
99
+ * If a function is passed as the first argument, it will be used as the callback
100
+ * function.
101
+ *
102
+ * @param { InsightsConversationsListInstancePageOptions } [params] - Options for request
103
+ * @param { function } [callback] - Callback to handle list of records
104
+ */
105
+ page(callback?: (error: Error | null, items: InsightsConversationsPage) => any): Promise<InsightsConversationsPage>;
106
+ page(params: InsightsConversationsListInstancePageOptions, callback?: (error: Error | null, items: InsightsConversationsPage) => any): Promise<InsightsConversationsPage>;
107
+ /**
108
+ * Provide a user-friendly representation
109
+ */
110
+ toJSON(): any;
111
+ [inspect.custom](_depth: any, options: InspectOptions): any;
112
+ }
113
+ export declare function InsightsConversationsListInstance(version: V1): InsightsConversationsListInstance;
114
+ interface InsightsConversationsPayload extends TwilioResponsePayload {
115
+ conversations: InsightsConversationsResource[];
116
+ }
117
+ interface InsightsConversationsResource {
118
+ account_id: string;
119
+ conversation_id: string;
120
+ segment_count: number;
121
+ segments: Array<any>;
122
+ }
123
+ export declare class InsightsConversationsInstance {
124
+ protected _version: V1;
125
+ constructor(_version: V1, payload: InsightsConversationsResource);
126
+ /**
127
+ * The id of the account.
128
+ */
129
+ accountId: string;
130
+ /**
131
+ * The unique id of the conversation
132
+ */
133
+ conversationId: string;
134
+ /**
135
+ * The count of segments for a conversation
136
+ */
137
+ segmentCount: number;
138
+ /**
139
+ * The Segments of a conversation
140
+ */
141
+ segments: Array<any>;
142
+ /**
143
+ * Provide a user-friendly representation
144
+ *
145
+ * @returns Object
146
+ */
147
+ toJSON(): {
148
+ accountId: string;
149
+ conversationId: string;
150
+ segmentCount: number;
151
+ segments: any[];
152
+ };
153
+ [inspect.custom](_depth: any, options: InspectOptions): string;
154
+ }
155
+ export declare class InsightsConversationsPage extends Page<V1, InsightsConversationsPayload, InsightsConversationsResource, InsightsConversationsInstance> {
156
+ /**
157
+ * Initialize the InsightsConversationsPage
158
+ *
159
+ * @param version - Version of the resource
160
+ * @param response - Response from the API
161
+ * @param solution - Path solution
162
+ */
163
+ constructor(version: V1, response: Response<string>, solution: InsightsConversationsSolution);
164
+ /**
165
+ * Build an instance of InsightsConversationsInstance
166
+ *
167
+ * @param payload - Payload response from the API
168
+ */
169
+ getInstance(payload: InsightsConversationsResource): InsightsConversationsInstance;
170
+ [inspect.custom](depth: any, options: InspectOptions): string;
171
+ }
172
+ export {};
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ /*
3
+ * This code was generated by
4
+ * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
+ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
+ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
+ *
8
+ * Twilio - Flex
9
+ * This is the public Twilio REST API.
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator.
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.InsightsConversationsPage = exports.InsightsConversationsInstance = exports.InsightsConversationsListInstance = void 0;
20
+ const util_1 = require("util");
21
+ const Page_1 = __importDefault(require("../../../base/Page"));
22
+ const deserialize = require("../../../base/deserialize");
23
+ const serialize = require("../../../base/serialize");
24
+ function InsightsConversationsListInstance(version) {
25
+ const instance = {};
26
+ instance._version = version;
27
+ instance._solution = {};
28
+ instance._uri = `/Insights/Conversations`;
29
+ instance.page = function page(params, callback) {
30
+ if (params instanceof Function) {
31
+ callback = params;
32
+ params = {};
33
+ }
34
+ else {
35
+ params = params || {};
36
+ }
37
+ let data = {};
38
+ if (params["segmentId"] !== undefined)
39
+ data["SegmentId"] = params["segmentId"];
40
+ if (params["pageSize"] !== undefined)
41
+ data["PageSize"] = params["pageSize"];
42
+ if (params.pageNumber !== undefined)
43
+ data["Page"] = params.pageNumber;
44
+ if (params.pageToken !== undefined)
45
+ data["PageToken"] = params.pageToken;
46
+ const headers = {};
47
+ if (params["token"] !== undefined)
48
+ headers["Token"] = params["token"];
49
+ let operationVersion = version, operationPromise = operationVersion.page({
50
+ uri: instance._uri,
51
+ method: "get",
52
+ params: data,
53
+ headers,
54
+ });
55
+ operationPromise = operationPromise.then((payload) => new InsightsConversationsPage(operationVersion, payload, instance._solution));
56
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
57
+ return operationPromise;
58
+ };
59
+ instance.each = instance._version.each;
60
+ instance.list = instance._version.list;
61
+ instance.getPage = function getPage(targetUrl, callback) {
62
+ const operationPromise = instance._version._domain.twilio.request({
63
+ method: "get",
64
+ uri: targetUrl,
65
+ });
66
+ let pagePromise = operationPromise.then((payload) => new InsightsConversationsPage(instance._version, payload, instance._solution));
67
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
68
+ return pagePromise;
69
+ };
70
+ instance.toJSON = function toJSON() {
71
+ return instance._solution;
72
+ };
73
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
74
+ return (0, util_1.inspect)(instance.toJSON(), options);
75
+ };
76
+ return instance;
77
+ }
78
+ exports.InsightsConversationsListInstance = InsightsConversationsListInstance;
79
+ class InsightsConversationsInstance {
80
+ constructor(_version, payload) {
81
+ this._version = _version;
82
+ this.accountId = payload.account_id;
83
+ this.conversationId = payload.conversation_id;
84
+ this.segmentCount = deserialize.integer(payload.segment_count);
85
+ this.segments = payload.segments;
86
+ }
87
+ /**
88
+ * Provide a user-friendly representation
89
+ *
90
+ * @returns Object
91
+ */
92
+ toJSON() {
93
+ return {
94
+ accountId: this.accountId,
95
+ conversationId: this.conversationId,
96
+ segmentCount: this.segmentCount,
97
+ segments: this.segments,
98
+ };
99
+ }
100
+ [util_1.inspect.custom](_depth, options) {
101
+ return (0, util_1.inspect)(this.toJSON(), options);
102
+ }
103
+ }
104
+ exports.InsightsConversationsInstance = InsightsConversationsInstance;
105
+ class InsightsConversationsPage extends Page_1.default {
106
+ /**
107
+ * Initialize the InsightsConversationsPage
108
+ *
109
+ * @param version - Version of the resource
110
+ * @param response - Response from the API
111
+ * @param solution - Path solution
112
+ */
113
+ constructor(version, response, solution) {
114
+ super(version, response, solution);
115
+ }
116
+ /**
117
+ * Build an instance of InsightsConversationsInstance
118
+ *
119
+ * @param payload - Payload response from the API
120
+ */
121
+ getInstance(payload) {
122
+ return new InsightsConversationsInstance(this._version, payload);
123
+ }
124
+ [util_1.inspect.custom](depth, options) {
125
+ return (0, util_1.inspect)(this.toJSON(), options);
126
+ }
127
+ }
128
+ exports.InsightsConversationsPage = InsightsConversationsPage;
@@ -35,14 +35,14 @@ export interface InsightsQuestionnairesQuestionListInstanceCreateOptions {
35
35
  categoryId: string;
36
36
  /** The question. */
37
37
  question: string;
38
- /** The description for the question. */
39
- description: string;
40
38
  /** The answer_set for the question. */
41
39
  answerSetId: string;
42
40
  /** The flag to enable for disable NA for answer. */
43
41
  allowNa: boolean;
44
42
  /** The Token HTTP request header */
45
43
  token?: string;
44
+ /** The description for the question. */
45
+ description?: string;
46
46
  }
47
47
  /**
48
48
  * Options to pass to each
@@ -167,9 +167,6 @@ function InsightsQuestionnairesQuestionListInstance(version) {
167
167
  if (params["question"] === null || params["question"] === undefined) {
168
168
  throw new Error("Required parameter \"params['question']\" missing.");
169
169
  }
170
- if (params["description"] === null || params["description"] === undefined) {
171
- throw new Error("Required parameter \"params['description']\" missing.");
172
- }
173
170
  if (params["answerSetId"] === null || params["answerSetId"] === undefined) {
174
171
  throw new Error("Required parameter \"params['answerSetId']\" missing.");
175
172
  }
@@ -179,9 +176,10 @@ function InsightsQuestionnairesQuestionListInstance(version) {
179
176
  let data = {};
180
177
  data["CategoryId"] = params["categoryId"];
181
178
  data["Question"] = params["question"];
182
- data["Description"] = params["description"];
183
179
  data["AnswerSetId"] = params["answerSetId"];
184
180
  data["AllowNa"] = serialize.bool(params["allowNa"]);
181
+ if (params["description"] !== undefined)
182
+ data["Description"] = params["description"];
185
183
  const headers = {};
186
184
  headers["Content-Type"] = "application/x-www-form-urlencoded";
187
185
  if (params["token"] !== undefined)