twilio 5.5.0 → 5.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/lib/rest/Knowledge.d.ts +4 -0
  2. package/lib/rest/Knowledge.js +8 -0
  3. package/lib/rest/KnowledgeBase.d.ts +13 -0
  4. package/lib/rest/KnowledgeBase.js +31 -0
  5. package/lib/rest/PreviewBase.d.ts +0 -3
  6. package/lib/rest/PreviewBase.js +0 -5
  7. package/lib/rest/Twilio.d.ts +5 -0
  8. package/lib/rest/Twilio.js +5 -0
  9. package/lib/rest/accounts/v1/safelist.d.ts +4 -4
  10. package/lib/rest/api/v2010/account/address/dependentPhoneNumber.d.ts +3 -0
  11. package/lib/rest/api/v2010/account/call/recording.d.ts +6 -0
  12. package/lib/rest/api/v2010/account/call/siprec.d.ts +3 -0
  13. package/lib/rest/api/v2010/account/call/stream.d.ts +3 -0
  14. package/lib/rest/api/v2010/account/call/transcription.d.ts +3 -0
  15. package/lib/rest/api/v2010/account/call.d.ts +3 -0
  16. package/lib/rest/api/v2010/account/conference/participant.d.ts +4 -1
  17. package/lib/rest/api/v2010/account/conference/recording.d.ts +6 -0
  18. package/lib/rest/api/v2010/account/conference.d.ts +7 -1
  19. package/lib/rest/api/v2010/account/incomingPhoneNumber/local.d.ts +6 -0
  20. package/lib/rest/api/v2010/account/incomingPhoneNumber/mobile.d.ts +6 -0
  21. package/lib/rest/api/v2010/account/incomingPhoneNumber/tollFree.d.ts +6 -0
  22. package/lib/rest/api/v2010/account/incomingPhoneNumber.d.ts +6 -0
  23. package/lib/rest/api/v2010/account/message/feedback.d.ts +3 -0
  24. package/lib/rest/api/v2010/account/message.d.ts +9 -0
  25. package/lib/rest/api/v2010/account/message.js +2 -0
  26. package/lib/rest/api/v2010/account/recording/addOnResult.d.ts +3 -0
  27. package/lib/rest/api/v2010/account/recording/transcription.d.ts +3 -0
  28. package/lib/rest/api/v2010/account/recording.d.ts +6 -0
  29. package/lib/rest/api/v2010/account/transcription.d.ts +3 -0
  30. package/lib/rest/api/v2010/account/usage/record/allTime.d.ts +3 -0
  31. package/lib/rest/api/v2010/account/usage/record/daily.d.ts +3 -0
  32. package/lib/rest/api/v2010/account/usage/record/lastMonth.d.ts +3 -0
  33. package/lib/rest/api/v2010/account/usage/record/monthly.d.ts +3 -0
  34. package/lib/rest/api/v2010/account/usage/record/thisMonth.d.ts +3 -0
  35. package/lib/rest/api/v2010/account/usage/record/today.d.ts +3 -0
  36. package/lib/rest/api/v2010/account/usage/record/yearly.d.ts +3 -0
  37. package/lib/rest/api/v2010/account/usage/record/yesterday.d.ts +3 -0
  38. package/lib/rest/api/v2010/account/usage/record.d.ts +3 -0
  39. package/lib/rest/api/v2010/account/usage/trigger.d.ts +6 -0
  40. package/lib/rest/api/v2010/account/usage.d.ts +3 -0
  41. package/lib/rest/api/v2010/account.d.ts +6 -0
  42. package/lib/rest/chat/v2/service/binding.d.ts +3 -0
  43. package/lib/rest/chat/v2/service/channel/webhook.d.ts +3 -0
  44. package/lib/rest/chat/v2/service/user/userBinding.d.ts +3 -0
  45. package/lib/rest/chat/v2/service/user/userChannel.d.ts +3 -0
  46. package/lib/rest/conversations/v1/addressConfiguration.d.ts +3 -0
  47. package/lib/rest/conversations/v1/configuration/webhook.d.ts +6 -0
  48. package/lib/rest/conversations/v1/conversation/webhook.d.ts +3 -0
  49. package/lib/rest/conversations/v1/conversation.d.ts +3 -0
  50. package/lib/rest/conversations/v1/conversationWithParticipants.d.ts +3 -0
  51. package/lib/rest/conversations/v1/service/binding.d.ts +3 -0
  52. package/lib/rest/conversations/v1/service/configuration/webhook.d.ts +3 -0
  53. package/lib/rest/conversations/v1/service/conversation/webhook.d.ts +3 -0
  54. package/lib/rest/conversations/v1/service/conversation.d.ts +3 -0
  55. package/lib/rest/conversations/v1/service/conversationWithParticipants.d.ts +3 -0
  56. package/lib/rest/conversations/v1/service/user/userConversation.d.ts +3 -0
  57. package/lib/rest/conversations/v1/user/userConversation.d.ts +3 -0
  58. package/lib/rest/events/v1/sink.d.ts +6 -0
  59. package/lib/rest/flexApi/v1/configuration.d.ts +3 -0
  60. package/lib/rest/flexApi/v1/flexFlow.d.ts +6 -0
  61. package/lib/rest/flexApi/v1/interaction/interactionChannel/interactionChannelParticipant.d.ts +3 -0
  62. package/lib/rest/flexApi/v1/interaction/interactionChannel.d.ts +3 -0
  63. package/lib/rest/flexApi/v1/provisioningStatus.d.ts +3 -0
  64. package/lib/rest/flexApi/v2/flexUser.d.ts +0 -24
  65. package/lib/rest/flexApi/v2/flexUser.js +0 -12
  66. package/lib/rest/iam/V1.d.ts +5 -0
  67. package/lib/rest/iam/V1.js +6 -0
  68. package/lib/rest/iam/v1/token.d.ts +88 -0
  69. package/lib/rest/iam/v1/token.js +99 -0
  70. package/lib/rest/insights/v1/room/participant.d.ts +2 -2
  71. package/lib/rest/insights/v1/room.d.ts +2 -2
  72. package/lib/rest/intelligence/v2/customOperator.d.ts +3 -0
  73. package/lib/rest/intelligence/v2/operator.d.ts +3 -0
  74. package/lib/rest/intelligence/v2/operatorType.d.ts +9 -0
  75. package/lib/rest/intelligence/v2/prebuiltOperator.d.ts +3 -0
  76. package/lib/rest/intelligence/v2/transcript/operatorResult.d.ts +3 -0
  77. package/lib/rest/intelligence/v2/transcript.d.ts +3 -0
  78. package/lib/rest/knowledge/V1.d.ts +15 -0
  79. package/lib/rest/{preview/Sync.js → knowledge/V1.js} +11 -11
  80. package/lib/rest/knowledge/v1/knowledge/chunk.d.ts +167 -0
  81. package/lib/rest/knowledge/v1/knowledge/chunk.js +131 -0
  82. package/lib/rest/knowledge/v1/knowledge/knowledgeStatus.d.ts +101 -0
  83. package/lib/rest/knowledge/v1/knowledge/knowledgeStatus.js +118 -0
  84. package/lib/rest/knowledge/v1/knowledge.d.ts +406 -0
  85. package/lib/rest/{preview/sync/service/document.js → knowledge/v1/knowledge.js} +102 -91
  86. package/lib/rest/lookups/v1/phoneNumber.d.ts +1 -1
  87. package/lib/rest/messaging/v1/brandRegistration/brandVetting.d.ts +3 -0
  88. package/lib/rest/messaging/v1/brandRegistration.d.ts +9 -0
  89. package/lib/rest/messaging/v1/service.d.ts +3 -0
  90. package/lib/rest/messaging/v1/tollfreeVerification.d.ts +6 -0
  91. package/lib/rest/monitor/v1/event.d.ts +1 -1
  92. package/lib/rest/notify/v1/service/binding.d.ts +3 -0
  93. package/lib/rest/notify/v1/service/notification.d.ts +3 -0
  94. package/lib/rest/numbers/v1/portingPortability.d.ts +3 -0
  95. package/lib/rest/numbers/v1/portingWebhookConfigurationDelete.d.ts +3 -0
  96. package/lib/rest/numbers/v2/authorizationDocument/dependentHostedNumberOrder.d.ts +3 -0
  97. package/lib/rest/numbers/v2/authorizationDocument.d.ts +3 -0
  98. package/lib/rest/numbers/v2/bulkHostedNumberOrder.d.ts +3 -0
  99. package/lib/rest/numbers/v2/bundleClone.d.ts +3 -0
  100. package/lib/rest/numbers/v2/hostedNumberOrder.d.ts +6 -0
  101. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/bundleCopy.d.ts +3 -0
  102. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/evaluation.d.ts +3 -0
  103. package/lib/rest/numbers/v2/regulatoryCompliance/bundle/replaceItems.d.ts +3 -0
  104. package/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts +3 -0
  105. package/lib/rest/numbers/v2/regulatoryCompliance/endUser.d.ts +3 -0
  106. package/lib/rest/numbers/v2/regulatoryCompliance/regulation.d.ts +3 -0
  107. package/lib/rest/numbers/v2/regulatoryCompliance/supportingDocument.d.ts +3 -0
  108. package/lib/rest/numbers/v2/regulatoryCompliance.d.ts +3 -0
  109. package/lib/rest/preview/hosted_numbers/authorizationDocument/dependentHostedNumberOrder.d.ts +6 -0
  110. package/lib/rest/preview/hosted_numbers/authorizationDocument.d.ts +3 -0
  111. package/lib/rest/preview/hosted_numbers/hostedNumberOrder.d.ts +6 -0
  112. package/lib/rest/proxy/v1/service/session/interaction.d.ts +3 -0
  113. package/lib/rest/proxy/v1/service/session/participant/messageInteraction.d.ts +3 -0
  114. package/lib/rest/proxy/v1/service/session.d.ts +6 -0
  115. package/lib/rest/proxy/v1/service.d.ts +6 -0
  116. package/lib/rest/serverless/v1/service/asset/assetVersion.d.ts +3 -0
  117. package/lib/rest/serverless/v1/service/build/buildStatus.d.ts +3 -0
  118. package/lib/rest/serverless/v1/service/build.d.ts +6 -0
  119. package/lib/rest/serverless/v1/service/environment/log.d.ts +3 -0
  120. package/lib/rest/serverless/v1/service/function/functionVersion.d.ts +3 -0
  121. package/lib/rest/studio/v1/flow/engagement/step.d.ts +6 -0
  122. package/lib/rest/studio/v1/flow/engagement/step.js +2 -0
  123. package/lib/rest/studio/v1/flow/engagement.d.ts +3 -0
  124. package/lib/rest/studio/v1/flow/execution/executionStep.d.ts +6 -0
  125. package/lib/rest/studio/v1/flow/execution/executionStep.js +2 -0
  126. package/lib/rest/studio/v1/flow/execution.d.ts +3 -0
  127. package/lib/rest/studio/v1/flow.d.ts +3 -0
  128. package/lib/rest/studio/v2/flow/execution/executionStep.d.ts +6 -0
  129. package/lib/rest/studio/v2/flow/execution/executionStep.js +2 -0
  130. package/lib/rest/studio/v2/flow/execution.d.ts +3 -0
  131. package/lib/rest/studio/v2/flow/flowRevision.d.ts +3 -0
  132. package/lib/rest/studio/v2/flow.d.ts +3 -0
  133. package/lib/rest/supersim/v1/esimProfile.d.ts +3 -0
  134. package/lib/rest/supersim/v1/fleet.d.ts +3 -0
  135. package/lib/rest/supersim/v1/ipCommand.d.ts +9 -0
  136. package/lib/rest/supersim/v1/settingsUpdate.d.ts +3 -0
  137. package/lib/rest/supersim/v1/sim/simIpAddress.d.ts +3 -0
  138. package/lib/rest/supersim/v1/sim.d.ts +3 -0
  139. package/lib/rest/supersim/v1/smsCommand.d.ts +6 -0
  140. package/lib/rest/taskrouter/v1/workspace/task/reservation.d.ts +1 -1
  141. package/lib/rest/taskrouter/v1/workspace/taskQueue.d.ts +3 -0
  142. package/lib/rest/taskrouter/v1/workspace/worker/reservation.d.ts +1 -1
  143. package/lib/rest/trunking/v1/trunk.d.ts +3 -0
  144. package/lib/rest/trusthub/v1/customerProfiles/customerProfilesEvaluations.d.ts +3 -0
  145. package/lib/rest/trusthub/v1/customerProfiles.d.ts +3 -0
  146. package/lib/rest/trusthub/v1/supportingDocument.d.ts +3 -0
  147. package/lib/rest/trusthub/v1/trustProducts/trustProductsEvaluations.d.ts +3 -0
  148. package/lib/rest/trusthub/v1/trustProducts.d.ts +3 -0
  149. package/lib/rest/verify/v2/service/verification.d.ts +6 -0
  150. package/lib/rest/verify/v2/service/verificationCheck.d.ts +3 -0
  151. package/lib/rest/verify/v2/service/webhook.d.ts +6 -0
  152. package/lib/rest/verify/v2/verificationAttempt.d.ts +3 -0
  153. package/lib/rest/video/v1/composition.d.ts +6 -0
  154. package/lib/rest/video/v1/compositionHook.d.ts +3 -0
  155. package/lib/rest/video/v1/recording.d.ts +9 -0
  156. package/lib/rest/video/v1/room/participant/anonymize.d.ts +3 -0
  157. package/lib/rest/video/v1/room/participant/publishedTrack.d.ts +3 -0
  158. package/lib/rest/video/v1/room/participant/subscribedTrack.d.ts +3 -0
  159. package/lib/rest/video/v1/room/participant.d.ts +4 -1
  160. package/lib/rest/video/v1/room/roomRecording.d.ts +9 -0
  161. package/lib/rest/wireless/v1/command.d.ts +12 -0
  162. package/lib/rest/wireless/v1/ratePlan.d.ts +6 -0
  163. package/lib/rest/wireless/v1/ratePlan.js +2 -0
  164. package/lib/rest/wireless/v1/sim.d.ts +6 -0
  165. package/package.json +1 -1
  166. package/lib/rest/preview/Sync.d.ts +0 -15
  167. package/lib/rest/preview/sync/service/document/documentPermission.d.ts +0 -280
  168. package/lib/rest/preview/sync/service/document/documentPermission.js +0 -260
  169. package/lib/rest/preview/sync/service/document.d.ts +0 -295
  170. package/lib/rest/preview/sync/service/syncList/syncListItem.d.ts +0 -321
  171. package/lib/rest/preview/sync/service/syncList/syncListItem.js +0 -286
  172. package/lib/rest/preview/sync/service/syncList/syncListPermission.d.ts +0 -280
  173. package/lib/rest/preview/sync/service/syncList/syncListPermission.js +0 -260
  174. package/lib/rest/preview/sync/service/syncList.d.ts +0 -270
  175. package/lib/rest/preview/sync/service/syncList.js +0 -270
  176. package/lib/rest/preview/sync/service/syncMap/syncMapItem.d.ts +0 -323
  177. package/lib/rest/preview/sync/service/syncMap/syncMapItem.js +0 -290
  178. package/lib/rest/preview/sync/service/syncMap/syncMapPermission.d.ts +0 -280
  179. package/lib/rest/preview/sync/service/syncMap/syncMapPermission.js +0 -260
  180. package/lib/rest/preview/sync/service/syncMap.d.ts +0 -270
  181. package/lib/rest/preview/sync/service/syncMap.js +0 -270
  182. package/lib/rest/preview/sync/service.d.ts +0 -330
  183. package/lib/rest/preview/sync/service.js +0 -316
@@ -1,330 +0,0 @@
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 Sync from "../Sync";
6
- import { DocumentListInstance } from "./service/document";
7
- import { SyncListListInstance } from "./service/syncList";
8
- import { SyncMapListInstance } from "./service/syncMap";
9
- /**
10
- * Options to pass to update a ServiceInstance
11
- */
12
- export interface ServiceContextUpdateOptions {
13
- /** */
14
- webhookUrl?: string;
15
- /** */
16
- friendlyName?: string;
17
- /** */
18
- reachabilityWebhooksEnabled?: boolean;
19
- /** */
20
- aclEnabled?: boolean;
21
- }
22
- /**
23
- * Options to pass to create a ServiceInstance
24
- */
25
- export interface ServiceListInstanceCreateOptions {
26
- /** */
27
- friendlyName?: string;
28
- /** */
29
- webhookUrl?: string;
30
- /** */
31
- reachabilityWebhooksEnabled?: boolean;
32
- /** */
33
- aclEnabled?: boolean;
34
- }
35
- /**
36
- * Options to pass to each
37
- */
38
- export interface ServiceListInstanceEachOptions {
39
- /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
40
- pageSize?: number;
41
- /** Function to process each record. If this and a positional callback are passed, this one will be used */
42
- callback?: (item: ServiceInstance, done: (err?: Error) => void) => void;
43
- /** Function to be called upon completion of streaming */
44
- done?: Function;
45
- /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
46
- limit?: number;
47
- }
48
- /**
49
- * Options to pass to list
50
- */
51
- export interface ServiceListInstanceOptions {
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 ServiceListInstancePageOptions {
61
- /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
62
- pageSize?: number;
63
- /** Page Number, this value is simply for client state */
64
- pageNumber?: number;
65
- /** PageToken provided by the API */
66
- pageToken?: string;
67
- }
68
- export interface ServiceContext {
69
- documents: DocumentListInstance;
70
- syncLists: SyncListListInstance;
71
- syncMaps: SyncMapListInstance;
72
- /**
73
- * Remove a ServiceInstance
74
- *
75
- * @param callback - Callback to handle processed record
76
- *
77
- * @returns Resolves to processed boolean
78
- */
79
- remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
80
- /**
81
- * Fetch a ServiceInstance
82
- *
83
- * @param callback - Callback to handle processed record
84
- *
85
- * @returns Resolves to processed ServiceInstance
86
- */
87
- fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise<ServiceInstance>;
88
- /**
89
- * Update a ServiceInstance
90
- *
91
- * @param callback - Callback to handle processed record
92
- *
93
- * @returns Resolves to processed ServiceInstance
94
- */
95
- update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise<ServiceInstance>;
96
- /**
97
- * Update a ServiceInstance
98
- *
99
- * @param params - Parameter for request
100
- * @param callback - Callback to handle processed record
101
- *
102
- * @returns Resolves to processed ServiceInstance
103
- */
104
- update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise<ServiceInstance>;
105
- /**
106
- * Provide a user-friendly representation
107
- */
108
- toJSON(): any;
109
- [inspect.custom](_depth: any, options: InspectOptions): any;
110
- }
111
- export interface ServiceContextSolution {
112
- sid: string;
113
- }
114
- export declare class ServiceContextImpl implements ServiceContext {
115
- protected _version: Sync;
116
- protected _solution: ServiceContextSolution;
117
- protected _uri: string;
118
- protected _documents?: DocumentListInstance;
119
- protected _syncLists?: SyncListListInstance;
120
- protected _syncMaps?: SyncMapListInstance;
121
- constructor(_version: Sync, sid: string);
122
- get documents(): DocumentListInstance;
123
- get syncLists(): SyncListListInstance;
124
- get syncMaps(): SyncMapListInstance;
125
- remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
126
- fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise<ServiceInstance>;
127
- update(params?: ServiceContextUpdateOptions | ((error: Error | null, item?: ServiceInstance) => any), callback?: (error: Error | null, item?: ServiceInstance) => any): Promise<ServiceInstance>;
128
- /**
129
- * Provide a user-friendly representation
130
- *
131
- * @returns Object
132
- */
133
- toJSON(): ServiceContextSolution;
134
- [inspect.custom](_depth: any, options: InspectOptions): string;
135
- }
136
- interface ServicePayload extends TwilioResponsePayload {
137
- services: ServiceResource[];
138
- }
139
- interface ServiceResource {
140
- sid: string;
141
- account_sid: string;
142
- friendly_name: string;
143
- date_created: Date;
144
- date_updated: Date;
145
- url: string;
146
- webhook_url: string;
147
- reachability_webhooks_enabled: boolean;
148
- acl_enabled: boolean;
149
- links: Record<string, string>;
150
- }
151
- export declare class ServiceInstance {
152
- protected _version: Sync;
153
- protected _solution: ServiceContextSolution;
154
- protected _context?: ServiceContext;
155
- constructor(_version: Sync, payload: ServiceResource, sid?: string);
156
- sid: string;
157
- accountSid: string;
158
- friendlyName: string;
159
- dateCreated: Date;
160
- dateUpdated: Date;
161
- url: string;
162
- webhookUrl: string;
163
- reachabilityWebhooksEnabled: boolean;
164
- aclEnabled: boolean;
165
- links: Record<string, string>;
166
- private get _proxy();
167
- /**
168
- * Remove a ServiceInstance
169
- *
170
- * @param callback - Callback to handle processed record
171
- *
172
- * @returns Resolves to processed boolean
173
- */
174
- remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
175
- /**
176
- * Fetch a ServiceInstance
177
- *
178
- * @param callback - Callback to handle processed record
179
- *
180
- * @returns Resolves to processed ServiceInstance
181
- */
182
- fetch(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise<ServiceInstance>;
183
- /**
184
- * Update a ServiceInstance
185
- *
186
- * @param callback - Callback to handle processed record
187
- *
188
- * @returns Resolves to processed ServiceInstance
189
- */
190
- update(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise<ServiceInstance>;
191
- /**
192
- * Update a ServiceInstance
193
- *
194
- * @param params - Parameter for request
195
- * @param callback - Callback to handle processed record
196
- *
197
- * @returns Resolves to processed ServiceInstance
198
- */
199
- update(params: ServiceContextUpdateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise<ServiceInstance>;
200
- /**
201
- * Access the documents.
202
- */
203
- documents(): DocumentListInstance;
204
- /**
205
- * Access the syncLists.
206
- */
207
- syncLists(): SyncListListInstance;
208
- /**
209
- * Access the syncMaps.
210
- */
211
- syncMaps(): SyncMapListInstance;
212
- /**
213
- * Provide a user-friendly representation
214
- *
215
- * @returns Object
216
- */
217
- toJSON(): {
218
- sid: string;
219
- accountSid: string;
220
- friendlyName: string;
221
- dateCreated: Date;
222
- dateUpdated: Date;
223
- url: string;
224
- webhookUrl: string;
225
- reachabilityWebhooksEnabled: boolean;
226
- aclEnabled: boolean;
227
- links: Record<string, string>;
228
- };
229
- [inspect.custom](_depth: any, options: InspectOptions): string;
230
- }
231
- export interface ServiceSolution {
232
- }
233
- export interface ServiceListInstance {
234
- _version: Sync;
235
- _solution: ServiceSolution;
236
- _uri: string;
237
- (sid: string): ServiceContext;
238
- get(sid: string): ServiceContext;
239
- /**
240
- * Create a ServiceInstance
241
- *
242
- * @param callback - Callback to handle processed record
243
- *
244
- * @returns Resolves to processed ServiceInstance
245
- */
246
- create(callback?: (error: Error | null, item?: ServiceInstance) => any): Promise<ServiceInstance>;
247
- /**
248
- * Create a ServiceInstance
249
- *
250
- * @param params - Parameter for request
251
- * @param callback - Callback to handle processed record
252
- *
253
- * @returns Resolves to processed ServiceInstance
254
- */
255
- create(params: ServiceListInstanceCreateOptions, callback?: (error: Error | null, item?: ServiceInstance) => any): Promise<ServiceInstance>;
256
- /**
257
- * Streams ServiceInstance records from the API.
258
- *
259
- * This operation lazily loads records as efficiently as possible until the limit
260
- * is reached.
261
- *
262
- * The results are passed into the callback function, so this operation is memory
263
- * efficient.
264
- *
265
- * If a function is passed as the first argument, it will be used as the callback
266
- * function.
267
- *
268
- * @param { ServiceListInstanceEachOptions } [params] - Options for request
269
- * @param { function } [callback] - Function to process each record
270
- */
271
- each(callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void;
272
- each(params: ServiceListInstanceEachOptions, callback?: (item: ServiceInstance, done: (err?: Error) => void) => void): void;
273
- /**
274
- * Retrieve a single target page of ServiceInstance records from the API.
275
- *
276
- * The request is executed immediately.
277
- *
278
- * @param { string } [targetUrl] - API-generated URL for the requested results page
279
- * @param { function } [callback] - Callback to handle list of records
280
- */
281
- getPage(targetUrl: string, callback?: (error: Error | null, items: ServicePage) => any): Promise<ServicePage>;
282
- /**
283
- * Lists ServiceInstance records from the API as a list.
284
- *
285
- * If a function is passed as the first argument, it will be used as the callback
286
- * function.
287
- *
288
- * @param { ServiceListInstanceOptions } [params] - Options for request
289
- * @param { function } [callback] - Callback to handle list of records
290
- */
291
- list(callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise<ServiceInstance[]>;
292
- list(params: ServiceListInstanceOptions, callback?: (error: Error | null, items: ServiceInstance[]) => any): Promise<ServiceInstance[]>;
293
- /**
294
- * Retrieve a single page of ServiceInstance records from the API.
295
- *
296
- * The request is executed immediately.
297
- *
298
- * If a function is passed as the first argument, it will be used as the callback
299
- * function.
300
- *
301
- * @param { ServiceListInstancePageOptions } [params] - Options for request
302
- * @param { function } [callback] - Callback to handle list of records
303
- */
304
- page(callback?: (error: Error | null, items: ServicePage) => any): Promise<ServicePage>;
305
- page(params: ServiceListInstancePageOptions, callback?: (error: Error | null, items: ServicePage) => any): Promise<ServicePage>;
306
- /**
307
- * Provide a user-friendly representation
308
- */
309
- toJSON(): any;
310
- [inspect.custom](_depth: any, options: InspectOptions): any;
311
- }
312
- export declare function ServiceListInstance(version: Sync): ServiceListInstance;
313
- export declare class ServicePage extends Page<Sync, ServicePayload, ServiceResource, ServiceInstance> {
314
- /**
315
- * Initialize the ServicePage
316
- *
317
- * @param version - Version of the resource
318
- * @param response - Response from the API
319
- * @param solution - Path solution
320
- */
321
- constructor(version: Sync, response: Response<string>, solution: ServiceSolution);
322
- /**
323
- * Build an instance of ServiceInstance
324
- *
325
- * @param payload - Payload response from the API
326
- */
327
- getInstance(payload: ServiceResource): ServiceInstance;
328
- [inspect.custom](depth: any, options: InspectOptions): string;
329
- }
330
- export {};
@@ -1,316 +0,0 @@
1
- "use strict";
2
- /*
3
- * This code was generated by
4
- * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
- * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
- * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
- *
8
- * Twilio - Preview
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.ServicePage = exports.ServiceListInstance = exports.ServiceInstance = exports.ServiceContextImpl = 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
- const document_1 = require("./service/document");
26
- const syncList_1 = require("./service/syncList");
27
- const syncMap_1 = require("./service/syncMap");
28
- class ServiceContextImpl {
29
- constructor(_version, sid) {
30
- this._version = _version;
31
- if (!(0, utility_1.isValidPathParam)(sid)) {
32
- throw new Error("Parameter 'sid' is not valid.");
33
- }
34
- this._solution = { sid };
35
- this._uri = `/Services/${sid}`;
36
- }
37
- get documents() {
38
- this._documents =
39
- this._documents ||
40
- (0, document_1.DocumentListInstance)(this._version, this._solution.sid);
41
- return this._documents;
42
- }
43
- get syncLists() {
44
- this._syncLists =
45
- this._syncLists ||
46
- (0, syncList_1.SyncListListInstance)(this._version, this._solution.sid);
47
- return this._syncLists;
48
- }
49
- get syncMaps() {
50
- this._syncMaps =
51
- this._syncMaps || (0, syncMap_1.SyncMapListInstance)(this._version, this._solution.sid);
52
- return this._syncMaps;
53
- }
54
- remove(callback) {
55
- const headers = {};
56
- const instance = this;
57
- let operationVersion = instance._version, operationPromise = operationVersion.remove({
58
- uri: instance._uri,
59
- method: "delete",
60
- headers,
61
- });
62
- operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
63
- return operationPromise;
64
- }
65
- fetch(callback) {
66
- const headers = {};
67
- headers["Accept"] = "application/json";
68
- const instance = this;
69
- let operationVersion = instance._version, operationPromise = operationVersion.fetch({
70
- uri: instance._uri,
71
- method: "get",
72
- headers,
73
- });
74
- operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid));
75
- operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
76
- return operationPromise;
77
- }
78
- update(params, callback) {
79
- if (params instanceof Function) {
80
- callback = params;
81
- params = {};
82
- }
83
- else {
84
- params = params || {};
85
- }
86
- let data = {};
87
- if (params["webhookUrl"] !== undefined)
88
- data["WebhookUrl"] = params["webhookUrl"];
89
- if (params["friendlyName"] !== undefined)
90
- data["FriendlyName"] = params["friendlyName"];
91
- if (params["reachabilityWebhooksEnabled"] !== undefined)
92
- data["ReachabilityWebhooksEnabled"] = serialize.bool(params["reachabilityWebhooksEnabled"]);
93
- if (params["aclEnabled"] !== undefined)
94
- data["AclEnabled"] = serialize.bool(params["aclEnabled"]);
95
- const headers = {};
96
- headers["Content-Type"] = "application/x-www-form-urlencoded";
97
- headers["Accept"] = "application/json";
98
- const instance = this;
99
- let operationVersion = instance._version, operationPromise = operationVersion.update({
100
- uri: instance._uri,
101
- method: "post",
102
- data,
103
- headers,
104
- });
105
- operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload, instance._solution.sid));
106
- operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
107
- return operationPromise;
108
- }
109
- /**
110
- * Provide a user-friendly representation
111
- *
112
- * @returns Object
113
- */
114
- toJSON() {
115
- return this._solution;
116
- }
117
- [util_1.inspect.custom](_depth, options) {
118
- return (0, util_1.inspect)(this.toJSON(), options);
119
- }
120
- }
121
- exports.ServiceContextImpl = ServiceContextImpl;
122
- class ServiceInstance {
123
- constructor(_version, payload, sid) {
124
- this._version = _version;
125
- this.sid = payload.sid;
126
- this.accountSid = payload.account_sid;
127
- this.friendlyName = payload.friendly_name;
128
- this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
129
- this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
130
- this.url = payload.url;
131
- this.webhookUrl = payload.webhook_url;
132
- this.reachabilityWebhooksEnabled = payload.reachability_webhooks_enabled;
133
- this.aclEnabled = payload.acl_enabled;
134
- this.links = payload.links;
135
- this._solution = { sid: sid || this.sid };
136
- }
137
- get _proxy() {
138
- this._context =
139
- this._context ||
140
- new ServiceContextImpl(this._version, this._solution.sid);
141
- return this._context;
142
- }
143
- /**
144
- * Remove a ServiceInstance
145
- *
146
- * @param callback - Callback to handle processed record
147
- *
148
- * @returns Resolves to processed boolean
149
- */
150
- remove(callback) {
151
- return this._proxy.remove(callback);
152
- }
153
- /**
154
- * Fetch a ServiceInstance
155
- *
156
- * @param callback - Callback to handle processed record
157
- *
158
- * @returns Resolves to processed ServiceInstance
159
- */
160
- fetch(callback) {
161
- return this._proxy.fetch(callback);
162
- }
163
- update(params, callback) {
164
- return this._proxy.update(params, callback);
165
- }
166
- /**
167
- * Access the documents.
168
- */
169
- documents() {
170
- return this._proxy.documents;
171
- }
172
- /**
173
- * Access the syncLists.
174
- */
175
- syncLists() {
176
- return this._proxy.syncLists;
177
- }
178
- /**
179
- * Access the syncMaps.
180
- */
181
- syncMaps() {
182
- return this._proxy.syncMaps;
183
- }
184
- /**
185
- * Provide a user-friendly representation
186
- *
187
- * @returns Object
188
- */
189
- toJSON() {
190
- return {
191
- sid: this.sid,
192
- accountSid: this.accountSid,
193
- friendlyName: this.friendlyName,
194
- dateCreated: this.dateCreated,
195
- dateUpdated: this.dateUpdated,
196
- url: this.url,
197
- webhookUrl: this.webhookUrl,
198
- reachabilityWebhooksEnabled: this.reachabilityWebhooksEnabled,
199
- aclEnabled: this.aclEnabled,
200
- links: this.links,
201
- };
202
- }
203
- [util_1.inspect.custom](_depth, options) {
204
- return (0, util_1.inspect)(this.toJSON(), options);
205
- }
206
- }
207
- exports.ServiceInstance = ServiceInstance;
208
- function ServiceListInstance(version) {
209
- const instance = ((sid) => instance.get(sid));
210
- instance.get = function get(sid) {
211
- return new ServiceContextImpl(version, sid);
212
- };
213
- instance._version = version;
214
- instance._solution = {};
215
- instance._uri = `/Services`;
216
- instance.create = function create(params, callback) {
217
- if (params instanceof Function) {
218
- callback = params;
219
- params = {};
220
- }
221
- else {
222
- params = params || {};
223
- }
224
- let data = {};
225
- if (params["friendlyName"] !== undefined)
226
- data["FriendlyName"] = params["friendlyName"];
227
- if (params["webhookUrl"] !== undefined)
228
- data["WebhookUrl"] = params["webhookUrl"];
229
- if (params["reachabilityWebhooksEnabled"] !== undefined)
230
- data["ReachabilityWebhooksEnabled"] = serialize.bool(params["reachabilityWebhooksEnabled"]);
231
- if (params["aclEnabled"] !== undefined)
232
- data["AclEnabled"] = serialize.bool(params["aclEnabled"]);
233
- const headers = {};
234
- headers["Content-Type"] = "application/x-www-form-urlencoded";
235
- headers["Accept"] = "application/json";
236
- let operationVersion = version, operationPromise = operationVersion.create({
237
- uri: instance._uri,
238
- method: "post",
239
- data,
240
- headers,
241
- });
242
- operationPromise = operationPromise.then((payload) => new ServiceInstance(operationVersion, payload));
243
- operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
244
- return operationPromise;
245
- };
246
- instance.page = function page(params, callback) {
247
- if (params instanceof Function) {
248
- callback = params;
249
- params = {};
250
- }
251
- else {
252
- params = params || {};
253
- }
254
- let data = {};
255
- if (params["pageSize"] !== undefined)
256
- data["PageSize"] = params["pageSize"];
257
- if (params.pageNumber !== undefined)
258
- data["Page"] = params.pageNumber;
259
- if (params.pageToken !== undefined)
260
- data["PageToken"] = params.pageToken;
261
- const headers = {};
262
- headers["Accept"] = "application/json";
263
- let operationVersion = version, operationPromise = operationVersion.page({
264
- uri: instance._uri,
265
- method: "get",
266
- params: data,
267
- headers,
268
- });
269
- operationPromise = operationPromise.then((payload) => new ServicePage(operationVersion, payload, instance._solution));
270
- operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
271
- return operationPromise;
272
- };
273
- instance.each = instance._version.each;
274
- instance.list = instance._version.list;
275
- instance.getPage = function getPage(targetUrl, callback) {
276
- const operationPromise = instance._version._domain.twilio.request({
277
- method: "get",
278
- uri: targetUrl,
279
- });
280
- let pagePromise = operationPromise.then((payload) => new ServicePage(instance._version, payload, instance._solution));
281
- pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
282
- return pagePromise;
283
- };
284
- instance.toJSON = function toJSON() {
285
- return instance._solution;
286
- };
287
- instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
288
- return (0, util_1.inspect)(instance.toJSON(), options);
289
- };
290
- return instance;
291
- }
292
- exports.ServiceListInstance = ServiceListInstance;
293
- class ServicePage extends Page_1.default {
294
- /**
295
- * Initialize the ServicePage
296
- *
297
- * @param version - Version of the resource
298
- * @param response - Response from the API
299
- * @param solution - Path solution
300
- */
301
- constructor(version, response, solution) {
302
- super(version, response, solution);
303
- }
304
- /**
305
- * Build an instance of ServiceInstance
306
- *
307
- * @param payload - Payload response from the API
308
- */
309
- getInstance(payload) {
310
- return new ServiceInstance(this._version, payload);
311
- }
312
- [util_1.inspect.custom](depth, options) {
313
- return (0, util_1.inspect)(this.toJSON(), options);
314
- }
315
- }
316
- exports.ServicePage = ServicePage;