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
@@ -0,0 +1,263 @@
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 update a AccountConfigInstance
8
+ */
9
+ export interface AccountConfigContextUpdateOptions {
10
+ /** The config value; up to 4096 characters. */
11
+ value: string;
12
+ }
13
+ /**
14
+ * Options to pass to create a AccountConfigInstance
15
+ */
16
+ export interface AccountConfigListInstanceCreateOptions {
17
+ /** The config key; up to 100 characters. */
18
+ key: string;
19
+ /** The config value; up to 4096 characters. */
20
+ value: string;
21
+ }
22
+ /**
23
+ * Options to pass to each
24
+ */
25
+ export interface AccountConfigListInstanceEachOptions {
26
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
27
+ pageSize?: number;
28
+ /** Function to process each record. If this and a positional callback are passed, this one will be used */
29
+ callback?: (item: AccountConfigInstance, done: (err?: Error) => void) => void;
30
+ /** Function to be called upon completion of streaming */
31
+ done?: Function;
32
+ /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
33
+ limit?: number;
34
+ }
35
+ /**
36
+ * Options to pass to list
37
+ */
38
+ export interface AccountConfigListInstanceOptions {
39
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
40
+ pageSize?: number;
41
+ /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
42
+ limit?: number;
43
+ }
44
+ /**
45
+ * Options to pass to page
46
+ */
47
+ export interface AccountConfigListInstancePageOptions {
48
+ /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
49
+ pageSize?: number;
50
+ /** Page Number, this value is simply for client state */
51
+ pageNumber?: number;
52
+ /** PageToken provided by the API */
53
+ pageToken?: string;
54
+ }
55
+ export interface AccountConfigContext {
56
+ /**
57
+ * Remove a AccountConfigInstance
58
+ *
59
+ * @param callback - Callback to handle processed record
60
+ *
61
+ * @returns Resolves to processed boolean
62
+ */
63
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
64
+ /**
65
+ * Fetch a AccountConfigInstance
66
+ *
67
+ * @param callback - Callback to handle processed record
68
+ *
69
+ * @returns Resolves to processed AccountConfigInstance
70
+ */
71
+ fetch(callback?: (error: Error | null, item?: AccountConfigInstance) => any): Promise<AccountConfigInstance>;
72
+ /**
73
+ * Update a AccountConfigInstance
74
+ *
75
+ * @param params - Parameter for request
76
+ * @param callback - Callback to handle processed record
77
+ *
78
+ * @returns Resolves to processed AccountConfigInstance
79
+ */
80
+ update(params: AccountConfigContextUpdateOptions, callback?: (error: Error | null, item?: AccountConfigInstance) => any): Promise<AccountConfigInstance>;
81
+ /**
82
+ * Provide a user-friendly representation
83
+ */
84
+ toJSON(): any;
85
+ [inspect.custom](_depth: any, options: InspectOptions): any;
86
+ }
87
+ export interface AccountConfigContextSolution {
88
+ key: string;
89
+ }
90
+ export declare class AccountConfigContextImpl implements AccountConfigContext {
91
+ protected _version: V1;
92
+ protected _solution: AccountConfigContextSolution;
93
+ protected _uri: string;
94
+ constructor(_version: V1, key: string);
95
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
96
+ fetch(callback?: (error: Error | null, item?: AccountConfigInstance) => any): Promise<AccountConfigInstance>;
97
+ update(params: AccountConfigContextUpdateOptions, callback?: (error: Error | null, item?: AccountConfigInstance) => any): Promise<AccountConfigInstance>;
98
+ /**
99
+ * Provide a user-friendly representation
100
+ *
101
+ * @returns Object
102
+ */
103
+ toJSON(): AccountConfigContextSolution;
104
+ [inspect.custom](_depth: any, options: InspectOptions): string;
105
+ }
106
+ interface AccountConfigPayload extends TwilioResponsePayload {
107
+ configs: AccountConfigResource[];
108
+ }
109
+ interface AccountConfigResource {
110
+ key: string;
111
+ date_updated: Date;
112
+ value: string;
113
+ url: string;
114
+ }
115
+ export declare class AccountConfigInstance {
116
+ protected _version: V1;
117
+ protected _solution: AccountConfigContextSolution;
118
+ protected _context?: AccountConfigContext;
119
+ constructor(_version: V1, payload: AccountConfigResource, key?: string);
120
+ /**
121
+ * The config key; up to 100 characters.
122
+ */
123
+ key: string;
124
+ dateUpdated: Date;
125
+ /**
126
+ * The config value; up to 4096 characters.
127
+ */
128
+ value: string;
129
+ /**
130
+ * The absolute URL of the Config.
131
+ */
132
+ url: string;
133
+ private get _proxy();
134
+ /**
135
+ * Remove a AccountConfigInstance
136
+ *
137
+ * @param callback - Callback to handle processed record
138
+ *
139
+ * @returns Resolves to processed boolean
140
+ */
141
+ remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
142
+ /**
143
+ * Fetch a AccountConfigInstance
144
+ *
145
+ * @param callback - Callback to handle processed record
146
+ *
147
+ * @returns Resolves to processed AccountConfigInstance
148
+ */
149
+ fetch(callback?: (error: Error | null, item?: AccountConfigInstance) => any): Promise<AccountConfigInstance>;
150
+ /**
151
+ * Update a AccountConfigInstance
152
+ *
153
+ * @param params - Parameter for request
154
+ * @param callback - Callback to handle processed record
155
+ *
156
+ * @returns Resolves to processed AccountConfigInstance
157
+ */
158
+ update(params: AccountConfigContextUpdateOptions, callback?: (error: Error | null, item?: AccountConfigInstance) => any): Promise<AccountConfigInstance>;
159
+ /**
160
+ * Provide a user-friendly representation
161
+ *
162
+ * @returns Object
163
+ */
164
+ toJSON(): {
165
+ key: string;
166
+ dateUpdated: Date;
167
+ value: string;
168
+ url: string;
169
+ };
170
+ [inspect.custom](_depth: any, options: InspectOptions): string;
171
+ }
172
+ export interface AccountConfigSolution {
173
+ }
174
+ export interface AccountConfigListInstance {
175
+ _version: V1;
176
+ _solution: AccountConfigSolution;
177
+ _uri: string;
178
+ (key: string): AccountConfigContext;
179
+ get(key: string): AccountConfigContext;
180
+ /**
181
+ * Create a AccountConfigInstance
182
+ *
183
+ * @param params - Parameter for request
184
+ * @param callback - Callback to handle processed record
185
+ *
186
+ * @returns Resolves to processed AccountConfigInstance
187
+ */
188
+ create(params: AccountConfigListInstanceCreateOptions, callback?: (error: Error | null, item?: AccountConfigInstance) => any): Promise<AccountConfigInstance>;
189
+ /**
190
+ * Streams AccountConfigInstance records from the API.
191
+ *
192
+ * This operation lazily loads records as efficiently as possible until the limit
193
+ * is reached.
194
+ *
195
+ * The results are passed into the callback function, so this operation is memory
196
+ * efficient.
197
+ *
198
+ * If a function is passed as the first argument, it will be used as the callback
199
+ * function.
200
+ *
201
+ * @param { AccountConfigListInstanceEachOptions } [params] - Options for request
202
+ * @param { function } [callback] - Function to process each record
203
+ */
204
+ each(callback?: (item: AccountConfigInstance, done: (err?: Error) => void) => void): void;
205
+ each(params: AccountConfigListInstanceEachOptions, callback?: (item: AccountConfigInstance, done: (err?: Error) => void) => void): void;
206
+ /**
207
+ * Retrieve a single target page of AccountConfigInstance records from the API.
208
+ *
209
+ * The request is executed immediately.
210
+ *
211
+ * @param { string } [targetUrl] - API-generated URL for the requested results page
212
+ * @param { function } [callback] - Callback to handle list of records
213
+ */
214
+ getPage(targetUrl: string, callback?: (error: Error | null, items: AccountConfigPage) => any): Promise<AccountConfigPage>;
215
+ /**
216
+ * Lists AccountConfigInstance records from the API as a list.
217
+ *
218
+ * If a function is passed as the first argument, it will be used as the callback
219
+ * function.
220
+ *
221
+ * @param { AccountConfigListInstanceOptions } [params] - Options for request
222
+ * @param { function } [callback] - Callback to handle list of records
223
+ */
224
+ list(callback?: (error: Error | null, items: AccountConfigInstance[]) => any): Promise<AccountConfigInstance[]>;
225
+ list(params: AccountConfigListInstanceOptions, callback?: (error: Error | null, items: AccountConfigInstance[]) => any): Promise<AccountConfigInstance[]>;
226
+ /**
227
+ * Retrieve a single page of AccountConfigInstance records from the API.
228
+ *
229
+ * The request is executed immediately.
230
+ *
231
+ * If a function is passed as the first argument, it will be used as the callback
232
+ * function.
233
+ *
234
+ * @param { AccountConfigListInstancePageOptions } [params] - Options for request
235
+ * @param { function } [callback] - Callback to handle list of records
236
+ */
237
+ page(callback?: (error: Error | null, items: AccountConfigPage) => any): Promise<AccountConfigPage>;
238
+ page(params: AccountConfigListInstancePageOptions, callback?: (error: Error | null, items: AccountConfigPage) => any): Promise<AccountConfigPage>;
239
+ /**
240
+ * Provide a user-friendly representation
241
+ */
242
+ toJSON(): any;
243
+ [inspect.custom](_depth: any, options: InspectOptions): any;
244
+ }
245
+ export declare function AccountConfigListInstance(version: V1): AccountConfigListInstance;
246
+ export declare class AccountConfigPage extends Page<V1, AccountConfigPayload, AccountConfigResource, AccountConfigInstance> {
247
+ /**
248
+ * Initialize the AccountConfigPage
249
+ *
250
+ * @param version - Version of the resource
251
+ * @param response - Response from the API
252
+ * @param solution - Path solution
253
+ */
254
+ constructor(version: V1, response: Response<string>, solution: AccountConfigSolution);
255
+ /**
256
+ * Build an instance of AccountConfigInstance
257
+ *
258
+ * @param payload - Payload response from the API
259
+ */
260
+ getInstance(payload: AccountConfigResource): AccountConfigInstance;
261
+ [inspect.custom](depth: any, options: InspectOptions): string;
262
+ }
263
+ export {};
@@ -0,0 +1,246 @@
1
+ "use strict";
2
+ /*
3
+ * This code was generated by
4
+ * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
+ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
+ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
+ *
8
+ * Twilio - Microvisor
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.AccountConfigPage = exports.AccountConfigListInstance = exports.AccountConfigInstance = exports.AccountConfigContextImpl = 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
+ const utility_1 = require("../../../base/utility");
25
+ class AccountConfigContextImpl {
26
+ constructor(_version, key) {
27
+ this._version = _version;
28
+ if (!(0, utility_1.isValidPathParam)(key)) {
29
+ throw new Error("Parameter 'key' is not valid.");
30
+ }
31
+ this._solution = { key };
32
+ this._uri = `/Configs/${key}`;
33
+ }
34
+ remove(callback) {
35
+ const instance = this;
36
+ let operationVersion = instance._version, operationPromise = operationVersion.remove({
37
+ uri: instance._uri,
38
+ method: "delete",
39
+ });
40
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
41
+ return operationPromise;
42
+ }
43
+ fetch(callback) {
44
+ const instance = this;
45
+ let operationVersion = instance._version, operationPromise = operationVersion.fetch({
46
+ uri: instance._uri,
47
+ method: "get",
48
+ });
49
+ operationPromise = operationPromise.then((payload) => new AccountConfigInstance(operationVersion, payload, instance._solution.key));
50
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
51
+ return operationPromise;
52
+ }
53
+ update(params, callback) {
54
+ if (params === null || params === undefined) {
55
+ throw new Error('Required parameter "params" missing.');
56
+ }
57
+ if (params["value"] === null || params["value"] === undefined) {
58
+ throw new Error("Required parameter \"params['value']\" missing.");
59
+ }
60
+ let data = {};
61
+ data["Value"] = params["value"];
62
+ const headers = {};
63
+ headers["Content-Type"] = "application/x-www-form-urlencoded";
64
+ const instance = this;
65
+ let operationVersion = instance._version, operationPromise = operationVersion.update({
66
+ uri: instance._uri,
67
+ method: "post",
68
+ data,
69
+ headers,
70
+ });
71
+ operationPromise = operationPromise.then((payload) => new AccountConfigInstance(operationVersion, payload, instance._solution.key));
72
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
73
+ return operationPromise;
74
+ }
75
+ /**
76
+ * Provide a user-friendly representation
77
+ *
78
+ * @returns Object
79
+ */
80
+ toJSON() {
81
+ return this._solution;
82
+ }
83
+ [util_1.inspect.custom](_depth, options) {
84
+ return (0, util_1.inspect)(this.toJSON(), options);
85
+ }
86
+ }
87
+ exports.AccountConfigContextImpl = AccountConfigContextImpl;
88
+ class AccountConfigInstance {
89
+ constructor(_version, payload, key) {
90
+ this._version = _version;
91
+ this.key = payload.key;
92
+ this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
93
+ this.value = payload.value;
94
+ this.url = payload.url;
95
+ this._solution = { key: key || this.key };
96
+ }
97
+ get _proxy() {
98
+ this._context =
99
+ this._context ||
100
+ new AccountConfigContextImpl(this._version, this._solution.key);
101
+ return this._context;
102
+ }
103
+ /**
104
+ * Remove a AccountConfigInstance
105
+ *
106
+ * @param callback - Callback to handle processed record
107
+ *
108
+ * @returns Resolves to processed boolean
109
+ */
110
+ remove(callback) {
111
+ return this._proxy.remove(callback);
112
+ }
113
+ /**
114
+ * Fetch a AccountConfigInstance
115
+ *
116
+ * @param callback - Callback to handle processed record
117
+ *
118
+ * @returns Resolves to processed AccountConfigInstance
119
+ */
120
+ fetch(callback) {
121
+ return this._proxy.fetch(callback);
122
+ }
123
+ update(params, callback) {
124
+ return this._proxy.update(params, callback);
125
+ }
126
+ /**
127
+ * Provide a user-friendly representation
128
+ *
129
+ * @returns Object
130
+ */
131
+ toJSON() {
132
+ return {
133
+ key: this.key,
134
+ dateUpdated: this.dateUpdated,
135
+ value: this.value,
136
+ url: this.url,
137
+ };
138
+ }
139
+ [util_1.inspect.custom](_depth, options) {
140
+ return (0, util_1.inspect)(this.toJSON(), options);
141
+ }
142
+ }
143
+ exports.AccountConfigInstance = AccountConfigInstance;
144
+ function AccountConfigListInstance(version) {
145
+ const instance = ((key) => instance.get(key));
146
+ instance.get = function get(key) {
147
+ return new AccountConfigContextImpl(version, key);
148
+ };
149
+ instance._version = version;
150
+ instance._solution = {};
151
+ instance._uri = `/Configs`;
152
+ instance.create = function create(params, callback) {
153
+ if (params === null || params === undefined) {
154
+ throw new Error('Required parameter "params" missing.');
155
+ }
156
+ if (params["key"] === null || params["key"] === undefined) {
157
+ throw new Error("Required parameter \"params['key']\" missing.");
158
+ }
159
+ if (params["value"] === null || params["value"] === undefined) {
160
+ throw new Error("Required parameter \"params['value']\" missing.");
161
+ }
162
+ let data = {};
163
+ data["Key"] = params["key"];
164
+ data["Value"] = params["value"];
165
+ const headers = {};
166
+ headers["Content-Type"] = "application/x-www-form-urlencoded";
167
+ let operationVersion = version, operationPromise = operationVersion.create({
168
+ uri: instance._uri,
169
+ method: "post",
170
+ data,
171
+ headers,
172
+ });
173
+ operationPromise = operationPromise.then((payload) => new AccountConfigInstance(operationVersion, payload));
174
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
175
+ return operationPromise;
176
+ };
177
+ instance.page = function page(params, callback) {
178
+ if (params instanceof Function) {
179
+ callback = params;
180
+ params = {};
181
+ }
182
+ else {
183
+ params = params || {};
184
+ }
185
+ let data = {};
186
+ if (params["pageSize"] !== undefined)
187
+ data["PageSize"] = params["pageSize"];
188
+ if (params.pageNumber !== undefined)
189
+ data["Page"] = params.pageNumber;
190
+ if (params.pageToken !== undefined)
191
+ data["PageToken"] = params.pageToken;
192
+ const headers = {};
193
+ let operationVersion = version, operationPromise = operationVersion.page({
194
+ uri: instance._uri,
195
+ method: "get",
196
+ params: data,
197
+ headers,
198
+ });
199
+ operationPromise = operationPromise.then((payload) => new AccountConfigPage(operationVersion, payload, instance._solution));
200
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
201
+ return operationPromise;
202
+ };
203
+ instance.each = instance._version.each;
204
+ instance.list = instance._version.list;
205
+ instance.getPage = function getPage(targetUrl, callback) {
206
+ const operationPromise = instance._version._domain.twilio.request({
207
+ method: "get",
208
+ uri: targetUrl,
209
+ });
210
+ let pagePromise = operationPromise.then((payload) => new AccountConfigPage(instance._version, payload, instance._solution));
211
+ pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
212
+ return pagePromise;
213
+ };
214
+ instance.toJSON = function toJSON() {
215
+ return instance._solution;
216
+ };
217
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
218
+ return (0, util_1.inspect)(instance.toJSON(), options);
219
+ };
220
+ return instance;
221
+ }
222
+ exports.AccountConfigListInstance = AccountConfigListInstance;
223
+ class AccountConfigPage extends Page_1.default {
224
+ /**
225
+ * Initialize the AccountConfigPage
226
+ *
227
+ * @param version - Version of the resource
228
+ * @param response - Response from the API
229
+ * @param solution - Path solution
230
+ */
231
+ constructor(version, response, solution) {
232
+ super(version, response, solution);
233
+ }
234
+ /**
235
+ * Build an instance of AccountConfigInstance
236
+ *
237
+ * @param payload - Payload response from the API
238
+ */
239
+ getInstance(payload) {
240
+ return new AccountConfigInstance(this._version, payload);
241
+ }
242
+ [util_1.inspect.custom](depth, options) {
243
+ return (0, util_1.inspect)(this.toJSON(), options);
244
+ }
245
+ }
246
+ exports.AccountConfigPage = AccountConfigPage;