twilio 4.7.1 → 4.8.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 (231) hide show
  1. package/lib/index.d.ts +52 -36
  2. package/lib/index.js +32 -51
  3. package/lib/rest/api/v2010/account/address/dependentPhoneNumber.d.ts +2 -2
  4. package/lib/rest/api/v2010/account/authorizedConnectApp.d.ts +1 -1
  5. package/lib/rest/api/v2010/account/call/feedback.d.ts +1 -1
  6. package/lib/rest/api/v2010/account/call/feedbackSummary.d.ts +1 -1
  7. package/lib/rest/api/v2010/account/call/payment.d.ts +5 -5
  8. package/lib/rest/api/v2010/account/call/recording.d.ts +2 -2
  9. package/lib/rest/api/v2010/account/call/siprec.d.ts +3 -3
  10. package/lib/rest/api/v2010/account/call/stream.d.ts +3 -3
  11. package/lib/rest/api/v2010/account/call.d.ts +2 -2
  12. package/lib/rest/api/v2010/account/conference/participant.d.ts +1 -1
  13. package/lib/rest/api/v2010/account/conference/recording.d.ts +2 -2
  14. package/lib/rest/api/v2010/account/conference.d.ts +4 -4
  15. package/lib/rest/api/v2010/account/connectApp.d.ts +1 -1
  16. package/lib/rest/api/v2010/account/incomingPhoneNumber/local.d.ts +4 -4
  17. package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.d.ts +4 -4
  18. package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.d.ts +4 -4
  19. package/lib/rest/api/v2010/account/incomingPhoneNumber.d.ts +4 -4
  20. package/lib/rest/api/v2010/account/message/feedback.d.ts +1 -1
  21. package/lib/rest/api/v2010/account/message.d.ts +6 -6
  22. package/lib/rest/api/v2010/account/recording/addOnResult.d.ts +1 -1
  23. package/lib/rest/api/v2010/account/recording/transcription.d.ts +1 -1
  24. package/lib/rest/api/v2010/account/recording.d.ts +2 -2
  25. package/lib/rest/api/v2010/account/transcription.d.ts +1 -1
  26. package/lib/rest/api/v2010/account/usage/record/allTime.d.ts +1 -1
  27. package/lib/rest/api/v2010/account/usage/record/daily.d.ts +1 -1
  28. package/lib/rest/api/v2010/account/usage/record/lastMonth.d.ts +1 -1
  29. package/lib/rest/api/v2010/account/usage/record/monthly.d.ts +1 -1
  30. package/lib/rest/api/v2010/account/usage/record/thisMonth.d.ts +1 -1
  31. package/lib/rest/api/v2010/account/usage/record/today.d.ts +1 -1
  32. package/lib/rest/api/v2010/account/usage/record/yearly.d.ts +1 -1
  33. package/lib/rest/api/v2010/account/usage/record/yesterday.d.ts +1 -1
  34. package/lib/rest/api/v2010/account/usage/record.d.ts +1 -1
  35. package/lib/rest/api/v2010/account/usage/trigger.d.ts +3 -3
  36. package/lib/rest/api/v2010/account/usage.d.ts +1 -0
  37. package/lib/rest/api/v2010/account.d.ts +2 -2
  38. package/lib/rest/autopilot/v1/assistant/modelBuild.d.ts +1 -1
  39. package/lib/rest/chat/v1/credential.d.ts +1 -1
  40. package/lib/rest/chat/v1/service/channel/message.d.ts +1 -1
  41. package/lib/rest/chat/v1/service/channel.d.ts +1 -1
  42. package/lib/rest/chat/v1/service/role.d.ts +1 -1
  43. package/lib/rest/chat/v1/service/user/userChannel.d.ts +1 -1
  44. package/lib/rest/chat/v2/credential.d.ts +1 -1
  45. package/lib/rest/chat/v2/service/binding.d.ts +1 -1
  46. package/lib/rest/chat/v2/service/channel/member.d.ts +1 -1
  47. package/lib/rest/chat/v2/service/channel/message.d.ts +2 -2
  48. package/lib/rest/chat/v2/service/channel/webhook.d.ts +2 -2
  49. package/lib/rest/chat/v2/service/channel.d.ts +2 -2
  50. package/lib/rest/chat/v2/service/role.d.ts +1 -1
  51. package/lib/rest/chat/v2/service/user/userBinding.d.ts +1 -1
  52. package/lib/rest/chat/v2/service/user/userChannel.d.ts +3 -3
  53. package/lib/rest/chat/v2/service/user.d.ts +1 -1
  54. package/lib/rest/chat/v3/channel.d.ts +2 -2
  55. package/lib/rest/content/V1.d.ts +5 -0
  56. package/lib/rest/content/V1.js +7 -0
  57. package/lib/rest/content/v1/legacyContent.d.ts +202 -0
  58. package/lib/rest/content/v1/legacyContent.js +138 -0
  59. package/lib/rest/conversations/v1/addressConfiguration.d.ts +3 -3
  60. package/lib/rest/conversations/v1/configuration/webhook.d.ts +2 -2
  61. package/lib/rest/conversations/v1/conversation/message/deliveryReceipt.d.ts +1 -1
  62. package/lib/rest/conversations/v1/conversation/message.d.ts +2 -2
  63. package/lib/rest/conversations/v1/conversation/participant.d.ts +1 -1
  64. package/lib/rest/conversations/v1/conversation/webhook.d.ts +2 -2
  65. package/lib/rest/conversations/v1/conversation.d.ts +2 -2
  66. package/lib/rest/conversations/v1/credential.d.ts +1 -1
  67. package/lib/rest/conversations/v1/participantConversation.d.ts +1 -1
  68. package/lib/rest/conversations/v1/role.d.ts +1 -1
  69. package/lib/rest/conversations/v1/service/binding.d.ts +1 -1
  70. package/lib/rest/conversations/v1/service/configuration/webhook.d.ts +1 -1
  71. package/lib/rest/conversations/v1/service/conversation/message/deliveryReceipt.d.ts +1 -1
  72. package/lib/rest/conversations/v1/service/conversation/message.d.ts +2 -2
  73. package/lib/rest/conversations/v1/service/conversation/participant.d.ts +1 -1
  74. package/lib/rest/conversations/v1/service/conversation/webhook.d.ts +2 -2
  75. package/lib/rest/conversations/v1/service/conversation.d.ts +2 -2
  76. package/lib/rest/conversations/v1/service/participantConversation.d.ts +1 -1
  77. package/lib/rest/conversations/v1/service/role.d.ts +1 -1
  78. package/lib/rest/conversations/v1/service/user/userConversation.d.ts +2 -2
  79. package/lib/rest/conversations/v1/service/user.d.ts +1 -1
  80. package/lib/rest/conversations/v1/user/userConversation.d.ts +2 -2
  81. package/lib/rest/conversations/v1/user.d.ts +1 -1
  82. package/lib/rest/events/v1/sink.d.ts +2 -2
  83. package/lib/rest/flexApi/V1.d.ts +15 -0
  84. package/lib/rest/flexApi/V1.js +22 -0
  85. package/lib/rest/flexApi/v1/assessments.d.ts +138 -10
  86. package/lib/rest/flexApi/v1/assessments.js +138 -22
  87. package/lib/rest/flexApi/v1/configuration.d.ts +1 -1
  88. package/lib/rest/flexApi/v1/flexFlow.d.ts +2 -2
  89. package/lib/rest/flexApi/v1/insightsAssessmentsComment.d.ts +255 -0
  90. package/lib/rest/flexApi/v1/insightsAssessmentsComment.js +198 -0
  91. package/lib/rest/flexApi/v1/insightsQuestionnaires.d.ts +357 -0
  92. package/lib/rest/flexApi/v1/insightsQuestionnaires.js +280 -0
  93. package/lib/rest/flexApi/v1/insightsQuestionnairesCategory.d.ts +111 -0
  94. package/lib/rest/flexApi/v1/insightsQuestionnairesCategory.js +68 -1
  95. package/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.d.ts +135 -6
  96. package/lib/rest/flexApi/v1/insightsQuestionnairesQuestion.js +80 -13
  97. package/lib/rest/flexApi/v1/insightsSegments.d.ts +341 -0
  98. package/lib/rest/flexApi/v1/insightsSegments.js +223 -0
  99. package/lib/rest/flexApi/v1/insightsSession.d.ts +2 -2
  100. package/lib/rest/flexApi/v1/insightsSession.js +2 -2
  101. package/lib/rest/flexApi/v1/insightsUserRoles.d.ts +2 -2
  102. package/lib/rest/flexApi/v1/insightsUserRoles.js +2 -2
  103. package/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelParticipant.d.ts +2 -2
  104. package/lib/rest/flexApi/v1/interaction/interactionChannel.d.ts +3 -3
  105. package/lib/rest/flexApi/v1/webChannel.d.ts +1 -1
  106. package/lib/rest/frontlineApi/v1/user.d.ts +1 -1
  107. package/lib/rest/insights/v1/call/annotation.d.ts +2 -2
  108. package/lib/rest/insights/v1/call/callSummary.d.ts +4 -4
  109. package/lib/rest/insights/v1/call/event.d.ts +2 -2
  110. package/lib/rest/insights/v1/call/metric.d.ts +2 -2
  111. package/lib/rest/insights/v1/callSummaries.d.ts +6 -6
  112. package/lib/rest/insights/v1/conference/conferenceParticipant.d.ts +6 -6
  113. package/lib/rest/insights/v1/conference.d.ts +5 -5
  114. package/lib/rest/insights/v1/room/participant.d.ts +4 -4
  115. package/lib/rest/insights/v1/room.d.ts +8 -8
  116. package/lib/rest/ipMessaging/v1/credential.d.ts +1 -1
  117. package/lib/rest/ipMessaging/v1/service/channel/message.d.ts +1 -1
  118. package/lib/rest/ipMessaging/v1/service/channel.d.ts +1 -1
  119. package/lib/rest/ipMessaging/v1/service/role.d.ts +1 -1
  120. package/lib/rest/ipMessaging/v1/service/user/userChannel.d.ts +1 -1
  121. package/lib/rest/ipMessaging/v2/credential.d.ts +1 -1
  122. package/lib/rest/ipMessaging/v2/service/binding.d.ts +1 -1
  123. package/lib/rest/ipMessaging/v2/service/channel/member.d.ts +1 -1
  124. package/lib/rest/ipMessaging/v2/service/channel/message.d.ts +2 -2
  125. package/lib/rest/ipMessaging/v2/service/channel/webhook.d.ts +2 -2
  126. package/lib/rest/ipMessaging/v2/service/channel.d.ts +2 -2
  127. package/lib/rest/ipMessaging/v2/service/role.d.ts +1 -1
  128. package/lib/rest/ipMessaging/v2/service/user/userBinding.d.ts +1 -1
  129. package/lib/rest/ipMessaging/v2/service/user/userChannel.d.ts +2 -2
  130. package/lib/rest/ipMessaging/v2/service/user.d.ts +1 -1
  131. package/lib/rest/lookups/v2/phoneNumber.d.ts +13 -1
  132. package/lib/rest/lookups/v2/phoneNumber.js +4 -0
  133. package/lib/rest/media/v1/mediaProcessor.d.ts +3 -3
  134. package/lib/rest/media/v1/mediaRecording.d.ts +3 -3
  135. package/lib/rest/media/v1/playerStreamer.d.ts +4 -4
  136. package/lib/rest/messaging/v1/brandRegistration/brandVetting.d.ts +1 -1
  137. package/lib/rest/messaging/v1/brandRegistration.d.ts +3 -3
  138. package/lib/rest/messaging/v1/service.d.ts +1 -1
  139. package/lib/rest/messaging/v1/tollfreeVerification.d.ts +2 -2
  140. package/lib/rest/microvisor/V1.d.ts +10 -0
  141. package/lib/rest/microvisor/V1.js +14 -0
  142. package/lib/rest/microvisor/v1/accountConfig.d.ts +263 -0
  143. package/lib/rest/microvisor/v1/accountConfig.js +246 -0
  144. package/lib/rest/microvisor/v1/accountSecret.d.ts +257 -0
  145. package/lib/rest/microvisor/v1/accountSecret.js +244 -0
  146. package/lib/rest/microvisor/v1/device/deviceConfig.d.ts +271 -0
  147. package/lib/rest/microvisor/v1/device/deviceConfig.js +254 -0
  148. package/lib/rest/microvisor/v1/device/deviceSecret.d.ts +265 -0
  149. package/lib/rest/microvisor/v1/device/deviceSecret.js +252 -0
  150. package/lib/rest/microvisor/v1/device.d.ts +16 -0
  151. package/lib/rest/microvisor/v1/device.js +26 -0
  152. package/lib/rest/notify/v1/credential.d.ts +1 -1
  153. package/lib/rest/notify/v1/service/binding.d.ts +1 -1
  154. package/lib/rest/notify/v1/service/notification.d.ts +1 -1
  155. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.d.ts +1 -1
  156. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/evaluation.d.ts +1 -1
  157. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.d.ts +1 -1
  158. package/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts +4 -4
  159. package/lib/rest/numbers/v2/regulatoryCompliance/endUser.d.ts +1 -1
  160. package/lib/rest/numbers/v2/regulatoryCompliance/regulation.d.ts +1 -1
  161. package/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.d.ts +1 -1
  162. package/lib/rest/preview/hosted_numbers/authorizationDocument/dependentHostedNumberOrder.d.ts +2 -2
  163. package/lib/rest/preview/hosted_numbers/authorizationDocument.d.ts +1 -1
  164. package/lib/rest/preview/hosted_numbers/hostedNumberOrder.d.ts +2 -2
  165. package/lib/rest/preview/sync/service/syncList/syncListItem.d.ts +2 -2
  166. package/lib/rest/preview/sync/service/syncMap/syncMapItem.d.ts +2 -2
  167. package/lib/rest/preview/understand/assistant/modelBuild.d.ts +1 -1
  168. package/lib/rest/proxy/v1/service/session/interaction.d.ts +2 -2
  169. package/lib/rest/proxy/v1/service/session/participant/messageInteraction.d.ts +2 -2
  170. package/lib/rest/proxy/v1/service/session.d.ts +2 -2
  171. package/lib/rest/proxy/v1/service.d.ts +2 -2
  172. package/lib/rest/serverless/v1/service/asset/assetVersion.d.ts +1 -1
  173. package/lib/rest/serverless/v1/service/build/buildStatus.d.ts +1 -1
  174. package/lib/rest/serverless/v1/service/build.d.ts +2 -2
  175. package/lib/rest/serverless/v1/service/environment/log.d.ts +1 -1
  176. package/lib/rest/serverless/v1/service/function/functionVersion.d.ts +1 -1
  177. package/lib/rest/studio/v1/flow/engagement.d.ts +1 -1
  178. package/lib/rest/studio/v1/flow/execution.d.ts +1 -1
  179. package/lib/rest/studio/v1/flow.d.ts +1 -1
  180. package/lib/rest/studio/v2/flow/execution.d.ts +1 -1
  181. package/lib/rest/studio/v2/flow/flowRevision.d.ts +1 -1
  182. package/lib/rest/studio/v2/flow.d.ts +1 -1
  183. package/lib/rest/studio/v2/flowValidate.d.ts +1 -1
  184. package/lib/rest/supersim/v1/esimProfile.d.ts +1 -1
  185. package/lib/rest/supersim/v1/fleet.d.ts +1 -1
  186. package/lib/rest/supersim/v1/ipCommand.d.ts +3 -3
  187. package/lib/rest/supersim/v1/settingsUpdate.d.ts +1 -1
  188. package/lib/rest/supersim/v1/sim/billingPeriod.d.ts +1 -1
  189. package/lib/rest/supersim/v1/sim/simIpAddress.d.ts +1 -1
  190. package/lib/rest/supersim/v1/sim.d.ts +2 -2
  191. package/lib/rest/supersim/v1/smsCommand.d.ts +5 -5
  192. package/lib/rest/supersim/v1/usageRecord.d.ts +2 -2
  193. package/lib/rest/sync/v1/service/syncList/syncListItem.d.ts +2 -2
  194. package/lib/rest/sync/v1/service/syncMap/syncMapItem.d.ts +2 -2
  195. package/lib/rest/taskrouter/v1/workspace/task/reservation.d.ts +4 -4
  196. package/lib/rest/taskrouter/v1/workspace/task.d.ts +1 -1
  197. package/lib/rest/taskrouter/v1/workspace/taskQueue.d.ts +1 -1
  198. package/lib/rest/taskrouter/v1/workspace/worker/reservation.d.ts +3 -3
  199. package/lib/rest/taskrouter/v1/workspace.d.ts +1 -1
  200. package/lib/rest/trunking/v1/trunk/phoneNumber.d.ts +1 -1
  201. package/lib/rest/trunking/v1/trunk/recording.d.ts +2 -2
  202. package/lib/rest/trunking/v1/trunk.d.ts +2 -2
  203. package/lib/rest/trusthub/v1/customerProfiles/customerProfilesEvaluations.d.ts +1 -1
  204. package/lib/rest/trusthub/v1/customerProfiles.d.ts +1 -1
  205. package/lib/rest/trusthub/v1/supportingDocument.d.ts +1 -1
  206. package/lib/rest/trusthub/v1/trustProducts/trustProductsEvaluations.d.ts +1 -1
  207. package/lib/rest/trusthub/v1/trustProducts.d.ts +1 -1
  208. package/lib/rest/verify/v2/form.d.ts +1 -1
  209. package/lib/rest/verify/v2/service/accessToken.d.ts +1 -1
  210. package/lib/rest/verify/v2/service/entity/challenge.d.ts +4 -4
  211. package/lib/rest/verify/v2/service/entity/factor.d.ts +3 -3
  212. package/lib/rest/verify/v2/service/entity/newFactor.d.ts +4 -4
  213. package/lib/rest/verify/v2/service/verification.d.ts +2 -2
  214. package/lib/rest/verify/v2/service/verificationCheck.d.ts +1 -1
  215. package/lib/rest/verify/v2/service/webhook.d.ts +3 -3
  216. package/lib/rest/verify/v2/verificationAttempt.d.ts +2 -2
  217. package/lib/rest/verify/v2/verificationAttemptsSummary.d.ts +1 -1
  218. package/lib/rest/video/v1/composition.d.ts +2 -2
  219. package/lib/rest/video/v1/compositionHook.d.ts +1 -1
  220. package/lib/rest/video/v1/recording.d.ts +4 -4
  221. package/lib/rest/video/v1/room/participant/anonymize.d.ts +1 -1
  222. package/lib/rest/video/v1/room/participant/publishedTrack.d.ts +1 -1
  223. package/lib/rest/video/v1/room/participant/subscribedTrack.d.ts +1 -1
  224. package/lib/rest/video/v1/room/participant.d.ts +1 -1
  225. package/lib/rest/video/v1/room/roomRecording.d.ts +4 -4
  226. package/lib/rest/video/v1/room.d.ts +3 -3
  227. package/lib/rest/wireless/v1/command.d.ts +4 -4
  228. package/lib/rest/wireless/v1/sim/usageRecord.d.ts +1 -1
  229. package/lib/rest/wireless/v1/sim.d.ts +2 -2
  230. package/lib/rest/wireless/v1/usageRecord.d.ts +1 -1
  231. package/package.json +2 -5
@@ -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,8 @@ interface InsightsQuestionnairesQuestionResource {
101
151
  category: any;
102
152
  answer_set_id: string;
103
153
  allow_na: boolean;
154
+ usage: number;
155
+ answer_set: any;
104
156
  url: string;
105
157
  }
106
158
  export declare class InsightsQuestionnairesQuestionInstance {
@@ -136,6 +188,14 @@ export declare class InsightsQuestionnairesQuestionInstance {
136
188
  * The flag to enable for disable NA for answer.
137
189
  */
138
190
  allowNa: boolean;
191
+ /**
192
+ * Integer value that tells a particular question is used by how many questionnaires
193
+ */
194
+ usage: number;
195
+ /**
196
+ * Set of answers for the question
197
+ */
198
+ answerSet: any;
139
199
  url: string;
140
200
  private get _proxy();
141
201
  /**
@@ -177,6 +237,8 @@ export declare class InsightsQuestionnairesQuestionInstance {
177
237
  category: any;
178
238
  answerSetId: string;
179
239
  allowNa: boolean;
240
+ usage: number;
241
+ answerSet: any;
180
242
  url: string;
181
243
  };
182
244
  [inspect.custom](_depth: any, options: InspectOptions): string;
@@ -198,6 +260,56 @@ export interface InsightsQuestionnairesQuestionListInstance {
198
260
  * @returns Resolves to processed InsightsQuestionnairesQuestionInstance
199
261
  */
200
262
  create(params: InsightsQuestionnairesQuestionListInstanceCreateOptions, callback?: (error: Error | null, item?: InsightsQuestionnairesQuestionInstance) => any): Promise<InsightsQuestionnairesQuestionInstance>;
263
+ /**
264
+ * Streams InsightsQuestionnairesQuestionInstance records from the API.
265
+ *
266
+ * This operation lazily loads records as efficiently as possible until the limit
267
+ * is reached.
268
+ *
269
+ * The results are passed into the callback function, so this operation is memory
270
+ * efficient.
271
+ *
272
+ * If a function is passed as the first argument, it will be used as the callback
273
+ * function.
274
+ *
275
+ * @param { InsightsQuestionnairesQuestionListInstanceEachOptions } [params] - Options for request
276
+ * @param { function } [callback] - Function to process each record
277
+ */
278
+ each(callback?: (item: InsightsQuestionnairesQuestionInstance, done: (err?: Error) => void) => void): void;
279
+ each(params: InsightsQuestionnairesQuestionListInstanceEachOptions, callback?: (item: InsightsQuestionnairesQuestionInstance, done: (err?: Error) => void) => void): void;
280
+ /**
281
+ * Retrieve a single target page of InsightsQuestionnairesQuestionInstance records from the API.
282
+ *
283
+ * The request is executed immediately.
284
+ *
285
+ * @param { string } [targetUrl] - API-generated URL for the requested results page
286
+ * @param { function } [callback] - Callback to handle list of records
287
+ */
288
+ getPage(targetUrl: string, callback?: (error: Error | null, items: InsightsQuestionnairesQuestionPage) => any): Promise<InsightsQuestionnairesQuestionPage>;
289
+ /**
290
+ * Lists InsightsQuestionnairesQuestionInstance records from the API as a list.
291
+ *
292
+ * If a function is passed as the first argument, it will be used as the callback
293
+ * function.
294
+ *
295
+ * @param { InsightsQuestionnairesQuestionListInstanceOptions } [params] - Options for request
296
+ * @param { function } [callback] - Callback to handle list of records
297
+ */
298
+ list(callback?: (error: Error | null, items: InsightsQuestionnairesQuestionInstance[]) => any): Promise<InsightsQuestionnairesQuestionInstance[]>;
299
+ list(params: InsightsQuestionnairesQuestionListInstanceOptions, callback?: (error: Error | null, items: InsightsQuestionnairesQuestionInstance[]) => any): Promise<InsightsQuestionnairesQuestionInstance[]>;
300
+ /**
301
+ * Retrieve a single page of InsightsQuestionnairesQuestionInstance records from the API.
302
+ *
303
+ * The request is executed immediately.
304
+ *
305
+ * If a function is passed as the first argument, it will be used as the callback
306
+ * function.
307
+ *
308
+ * @param { InsightsQuestionnairesQuestionListInstancePageOptions } [params] - Options for request
309
+ * @param { function } [callback] - Callback to handle list of records
310
+ */
311
+ page(callback?: (error: Error | null, items: InsightsQuestionnairesQuestionPage) => any): Promise<InsightsQuestionnairesQuestionPage>;
312
+ page(params: InsightsQuestionnairesQuestionListInstancePageOptions, callback?: (error: Error | null, items: InsightsQuestionnairesQuestionPage) => any): Promise<InsightsQuestionnairesQuestionPage>;
201
313
  /**
202
314
  * Provide a user-friendly representation
203
315
  */
@@ -205,4 +317,21 @@ export interface InsightsQuestionnairesQuestionListInstance {
205
317
  [inspect.custom](_depth: any, options: InspectOptions): any;
206
318
  }
207
319
  export declare function InsightsQuestionnairesQuestionListInstance(version: V1): InsightsQuestionnairesQuestionListInstance;
320
+ export declare class InsightsQuestionnairesQuestionPage extends Page<V1, InsightsQuestionnairesQuestionPayload, InsightsQuestionnairesQuestionResource, InsightsQuestionnairesQuestionInstance> {
321
+ /**
322
+ * Initialize the InsightsQuestionnairesQuestionPage
323
+ *
324
+ * @param version - Version of the resource
325
+ * @param response - Response from the API
326
+ * @param solution - Path solution
327
+ */
328
+ constructor(version: V1, response: Response<string>, solution: InsightsQuestionnairesQuestionSolution);
329
+ /**
330
+ * Build an instance of InsightsQuestionnairesQuestionInstance
331
+ *
332
+ * @param payload - Payload response from the API
333
+ */
334
+ getInstance(payload: InsightsQuestionnairesQuestionResource): InsightsQuestionnairesQuestionInstance;
335
+ [inspect.custom](depth: any, options: InspectOptions): string;
336
+ }
208
337
  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,8 @@ 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);
112
+ this.answerSet = payload.answer_set;
113
113
  this.url = payload.url;
114
114
  this._solution = { questionId: questionId || this.questionId };
115
115
  }
@@ -139,6 +139,8 @@ class InsightsQuestionnairesQuestionInstance {
139
139
  category: this.category,
140
140
  answerSetId: this.answerSetId,
141
141
  allowNa: this.allowNa,
142
+ usage: this.usage,
143
+ answerSet: this.answerSet,
142
144
  url: this.url,
143
145
  };
144
146
  }
@@ -194,6 +196,47 @@ function InsightsQuestionnairesQuestionListInstance(version) {
194
196
  operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
195
197
  return operationPromise;
196
198
  };
199
+ instance.page = function page(params, callback) {
200
+ if (params instanceof Function) {
201
+ callback = params;
202
+ params = {};
203
+ }
204
+ else {
205
+ params = params || {};
206
+ }
207
+ let data = {};
208
+ if (params["categoryId"] !== undefined)
209
+ data["CategoryId"] = serialize.map(params["categoryId"], (e) => e);
210
+ if (params["pageSize"] !== undefined)
211
+ data["PageSize"] = params["pageSize"];
212
+ if (params.pageNumber !== undefined)
213
+ data["Page"] = params.pageNumber;
214
+ if (params.pageToken !== undefined)
215
+ data["PageToken"] = params.pageToken;
216
+ const headers = {};
217
+ if (params["token"] !== undefined)
218
+ headers["Token"] = params["token"];
219
+ let operationVersion = version, operationPromise = operationVersion.page({
220
+ uri: instance._uri,
221
+ method: "get",
222
+ params: data,
223
+ headers,
224
+ });
225
+ operationPromise = operationPromise.then((payload) => new InsightsQuestionnairesQuestionPage(operationVersion, payload, instance._solution));
226
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
227
+ return operationPromise;
228
+ };
229
+ instance.each = instance._version.each;
230
+ instance.list = instance._version.list;
231
+ instance.getPage = function getPage(targetUrl, callback) {
232
+ const operationPromise = instance._version._domain.twilio.request({
233
+ method: "get",
234
+ uri: targetUrl,
235
+ });
236
+ let pagePromise = operationPromise.then((payload) => new InsightsQuestionnairesQuestionPage(instance._version, payload, instance._solution));
237
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
238
+ return pagePromise;
239
+ };
197
240
  instance.toJSON = function toJSON() {
198
241
  return instance._solution;
199
242
  };
@@ -203,3 +246,27 @@ function InsightsQuestionnairesQuestionListInstance(version) {
203
246
  return instance;
204
247
  }
205
248
  exports.InsightsQuestionnairesQuestionListInstance = InsightsQuestionnairesQuestionListInstance;
249
+ class InsightsQuestionnairesQuestionPage extends Page_1.default {
250
+ /**
251
+ * Initialize the InsightsQuestionnairesQuestionPage
252
+ *
253
+ * @param version - Version of the resource
254
+ * @param response - Response from the API
255
+ * @param solution - Path solution
256
+ */
257
+ constructor(version, response, solution) {
258
+ super(version, response, solution);
259
+ }
260
+ /**
261
+ * Build an instance of InsightsQuestionnairesQuestionInstance
262
+ *
263
+ * @param payload - Payload response from the API
264
+ */
265
+ getInstance(payload) {
266
+ return new InsightsQuestionnairesQuestionInstance(this._version, payload);
267
+ }
268
+ [util_1.inspect.custom](depth, options) {
269
+ return (0, util_1.inspect)(this.toJSON(), options);
270
+ }
271
+ }
272
+ exports.InsightsQuestionnairesQuestionPage = InsightsQuestionnairesQuestionPage;