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,323 +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
- export type SyncMapItemQueryFromBoundType = "inclusive" | "exclusive";
7
- export type SyncMapItemQueryResultOrder = "asc" | "desc";
8
- /**
9
- * Options to pass to remove a SyncMapItemInstance
10
- */
11
- export interface SyncMapItemContextRemoveOptions {
12
- /** The If-Match HTTP request header */
13
- ifMatch?: string;
14
- }
15
- /**
16
- * Options to pass to update a SyncMapItemInstance
17
- */
18
- export interface SyncMapItemContextUpdateOptions {
19
- /** */
20
- data: object;
21
- /** The If-Match HTTP request header */
22
- ifMatch?: string;
23
- }
24
- /**
25
- * Options to pass to create a SyncMapItemInstance
26
- */
27
- export interface SyncMapItemListInstanceCreateOptions {
28
- /** */
29
- key: string;
30
- /** */
31
- data: object;
32
- }
33
- /**
34
- * Options to pass to each
35
- */
36
- export interface SyncMapItemListInstanceEachOptions {
37
- /** */
38
- order?: SyncMapItemQueryResultOrder;
39
- /** */
40
- from?: string;
41
- /** */
42
- bounds?: SyncMapItemQueryFromBoundType;
43
- /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
44
- pageSize?: number;
45
- /** Function to process each record. If this and a positional callback are passed, this one will be used */
46
- callback?: (item: SyncMapItemInstance, done: (err?: Error) => void) => void;
47
- /** Function to be called upon completion of streaming */
48
- done?: Function;
49
- /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
50
- limit?: number;
51
- }
52
- /**
53
- * Options to pass to list
54
- */
55
- export interface SyncMapItemListInstanceOptions {
56
- /** */
57
- order?: SyncMapItemQueryResultOrder;
58
- /** */
59
- from?: string;
60
- /** */
61
- bounds?: SyncMapItemQueryFromBoundType;
62
- /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
63
- pageSize?: number;
64
- /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
65
- limit?: number;
66
- }
67
- /**
68
- * Options to pass to page
69
- */
70
- export interface SyncMapItemListInstancePageOptions {
71
- /** */
72
- order?: SyncMapItemQueryResultOrder;
73
- /** */
74
- from?: string;
75
- /** */
76
- bounds?: SyncMapItemQueryFromBoundType;
77
- /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
78
- pageSize?: number;
79
- /** Page Number, this value is simply for client state */
80
- pageNumber?: number;
81
- /** PageToken provided by the API */
82
- pageToken?: string;
83
- }
84
- export interface SyncMapItemContext {
85
- /**
86
- * Remove a SyncMapItemInstance
87
- *
88
- * @param callback - Callback to handle processed record
89
- *
90
- * @returns Resolves to processed boolean
91
- */
92
- remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
93
- /**
94
- * Remove a SyncMapItemInstance
95
- *
96
- * @param params - Parameter for request
97
- * @param callback - Callback to handle processed record
98
- *
99
- * @returns Resolves to processed SyncMapItemInstance
100
- */
101
- remove(params: SyncMapItemContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
102
- /**
103
- * Fetch a SyncMapItemInstance
104
- *
105
- * @param callback - Callback to handle processed record
106
- *
107
- * @returns Resolves to processed SyncMapItemInstance
108
- */
109
- fetch(callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise<SyncMapItemInstance>;
110
- /**
111
- * Update a SyncMapItemInstance
112
- *
113
- * @param params - Parameter for request
114
- * @param callback - Callback to handle processed record
115
- *
116
- * @returns Resolves to processed SyncMapItemInstance
117
- */
118
- update(params: SyncMapItemContextUpdateOptions, callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise<SyncMapItemInstance>;
119
- /**
120
- * Provide a user-friendly representation
121
- */
122
- toJSON(): any;
123
- [inspect.custom](_depth: any, options: InspectOptions): any;
124
- }
125
- export interface SyncMapItemContextSolution {
126
- serviceSid: string;
127
- mapSid: string;
128
- key: string;
129
- }
130
- export declare class SyncMapItemContextImpl implements SyncMapItemContext {
131
- protected _version: Sync;
132
- protected _solution: SyncMapItemContextSolution;
133
- protected _uri: string;
134
- constructor(_version: Sync, serviceSid: string, mapSid: string, key: string);
135
- remove(params?: SyncMapItemContextRemoveOptions | ((error: Error | null, item?: boolean) => any), callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
136
- fetch(callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise<SyncMapItemInstance>;
137
- update(params: SyncMapItemContextUpdateOptions, callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise<SyncMapItemInstance>;
138
- /**
139
- * Provide a user-friendly representation
140
- *
141
- * @returns Object
142
- */
143
- toJSON(): SyncMapItemContextSolution;
144
- [inspect.custom](_depth: any, options: InspectOptions): string;
145
- }
146
- interface SyncMapItemPayload extends TwilioResponsePayload {
147
- items: SyncMapItemResource[];
148
- }
149
- interface SyncMapItemResource {
150
- key: string;
151
- account_sid: string;
152
- service_sid: string;
153
- map_sid: string;
154
- url: string;
155
- revision: string;
156
- data: Record<string, object>;
157
- date_created: Date;
158
- date_updated: Date;
159
- created_by: string;
160
- }
161
- export declare class SyncMapItemInstance {
162
- protected _version: Sync;
163
- protected _solution: SyncMapItemContextSolution;
164
- protected _context?: SyncMapItemContext;
165
- constructor(_version: Sync, payload: SyncMapItemResource, serviceSid: string, mapSid: string, key?: string);
166
- key: string;
167
- accountSid: string;
168
- serviceSid: string;
169
- mapSid: string;
170
- url: string;
171
- revision: string;
172
- data: Record<string, object>;
173
- dateCreated: Date;
174
- dateUpdated: Date;
175
- createdBy: string;
176
- private get _proxy();
177
- /**
178
- * Remove a SyncMapItemInstance
179
- *
180
- * @param callback - Callback to handle processed record
181
- *
182
- * @returns Resolves to processed boolean
183
- */
184
- remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
185
- /**
186
- * Remove a SyncMapItemInstance
187
- *
188
- * @param params - Parameter for request
189
- * @param callback - Callback to handle processed record
190
- *
191
- * @returns Resolves to processed SyncMapItemInstance
192
- */
193
- remove(params: SyncMapItemContextRemoveOptions, callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
194
- /**
195
- * Fetch a SyncMapItemInstance
196
- *
197
- * @param callback - Callback to handle processed record
198
- *
199
- * @returns Resolves to processed SyncMapItemInstance
200
- */
201
- fetch(callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise<SyncMapItemInstance>;
202
- /**
203
- * Update a SyncMapItemInstance
204
- *
205
- * @param params - Parameter for request
206
- * @param callback - Callback to handle processed record
207
- *
208
- * @returns Resolves to processed SyncMapItemInstance
209
- */
210
- update(params: SyncMapItemContextUpdateOptions, callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise<SyncMapItemInstance>;
211
- /**
212
- * Provide a user-friendly representation
213
- *
214
- * @returns Object
215
- */
216
- toJSON(): {
217
- key: string;
218
- accountSid: string;
219
- serviceSid: string;
220
- mapSid: string;
221
- url: string;
222
- revision: string;
223
- data: Record<string, object>;
224
- dateCreated: Date;
225
- dateUpdated: Date;
226
- createdBy: string;
227
- };
228
- [inspect.custom](_depth: any, options: InspectOptions): string;
229
- }
230
- export interface SyncMapItemSolution {
231
- serviceSid: string;
232
- mapSid: string;
233
- }
234
- export interface SyncMapItemListInstance {
235
- _version: Sync;
236
- _solution: SyncMapItemSolution;
237
- _uri: string;
238
- (key: string): SyncMapItemContext;
239
- get(key: string): SyncMapItemContext;
240
- /**
241
- * Create a SyncMapItemInstance
242
- *
243
- * @param params - Parameter for request
244
- * @param callback - Callback to handle processed record
245
- *
246
- * @returns Resolves to processed SyncMapItemInstance
247
- */
248
- create(params: SyncMapItemListInstanceCreateOptions, callback?: (error: Error | null, item?: SyncMapItemInstance) => any): Promise<SyncMapItemInstance>;
249
- /**
250
- * Streams SyncMapItemInstance records from the API.
251
- *
252
- * This operation lazily loads records as efficiently as possible until the limit
253
- * is reached.
254
- *
255
- * The results are passed into the callback function, so this operation is memory
256
- * efficient.
257
- *
258
- * If a function is passed as the first argument, it will be used as the callback
259
- * function.
260
- *
261
- * @param { SyncMapItemListInstanceEachOptions } [params] - Options for request
262
- * @param { function } [callback] - Function to process each record
263
- */
264
- each(callback?: (item: SyncMapItemInstance, done: (err?: Error) => void) => void): void;
265
- each(params: SyncMapItemListInstanceEachOptions, callback?: (item: SyncMapItemInstance, done: (err?: Error) => void) => void): void;
266
- /**
267
- * Retrieve a single target page of SyncMapItemInstance records from the API.
268
- *
269
- * The request is executed immediately.
270
- *
271
- * @param { string } [targetUrl] - API-generated URL for the requested results page
272
- * @param { function } [callback] - Callback to handle list of records
273
- */
274
- getPage(targetUrl: string, callback?: (error: Error | null, items: SyncMapItemPage) => any): Promise<SyncMapItemPage>;
275
- /**
276
- * Lists SyncMapItemInstance records from the API as a list.
277
- *
278
- * If a function is passed as the first argument, it will be used as the callback
279
- * function.
280
- *
281
- * @param { SyncMapItemListInstanceOptions } [params] - Options for request
282
- * @param { function } [callback] - Callback to handle list of records
283
- */
284
- list(callback?: (error: Error | null, items: SyncMapItemInstance[]) => any): Promise<SyncMapItemInstance[]>;
285
- list(params: SyncMapItemListInstanceOptions, callback?: (error: Error | null, items: SyncMapItemInstance[]) => any): Promise<SyncMapItemInstance[]>;
286
- /**
287
- * Retrieve a single page of SyncMapItemInstance records from the API.
288
- *
289
- * The request is executed immediately.
290
- *
291
- * If a function is passed as the first argument, it will be used as the callback
292
- * function.
293
- *
294
- * @param { SyncMapItemListInstancePageOptions } [params] - Options for request
295
- * @param { function } [callback] - Callback to handle list of records
296
- */
297
- page(callback?: (error: Error | null, items: SyncMapItemPage) => any): Promise<SyncMapItemPage>;
298
- page(params: SyncMapItemListInstancePageOptions, callback?: (error: Error | null, items: SyncMapItemPage) => any): Promise<SyncMapItemPage>;
299
- /**
300
- * Provide a user-friendly representation
301
- */
302
- toJSON(): any;
303
- [inspect.custom](_depth: any, options: InspectOptions): any;
304
- }
305
- export declare function SyncMapItemListInstance(version: Sync, serviceSid: string, mapSid: string): SyncMapItemListInstance;
306
- export declare class SyncMapItemPage extends Page<Sync, SyncMapItemPayload, SyncMapItemResource, SyncMapItemInstance> {
307
- /**
308
- * Initialize the SyncMapItemPage
309
- *
310
- * @param version - Version of the resource
311
- * @param response - Response from the API
312
- * @param solution - Path solution
313
- */
314
- constructor(version: Sync, response: Response<string>, solution: SyncMapItemSolution);
315
- /**
316
- * Build an instance of SyncMapItemInstance
317
- *
318
- * @param payload - Payload response from the API
319
- */
320
- getInstance(payload: SyncMapItemResource): SyncMapItemInstance;
321
- [inspect.custom](depth: any, options: InspectOptions): string;
322
- }
323
- export {};
@@ -1,290 +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.SyncMapItemPage = exports.SyncMapItemListInstance = exports.SyncMapItemInstance = exports.SyncMapItemContextImpl = 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 SyncMapItemContextImpl {
26
- constructor(_version, serviceSid, mapSid, key) {
27
- this._version = _version;
28
- if (!(0, utility_1.isValidPathParam)(serviceSid)) {
29
- throw new Error("Parameter 'serviceSid' is not valid.");
30
- }
31
- if (!(0, utility_1.isValidPathParam)(mapSid)) {
32
- throw new Error("Parameter 'mapSid' is not valid.");
33
- }
34
- if (!(0, utility_1.isValidPathParam)(key)) {
35
- throw new Error("Parameter 'key' is not valid.");
36
- }
37
- this._solution = { serviceSid, mapSid, key };
38
- this._uri = `/Services/${serviceSid}/Maps/${mapSid}/Items/${key}`;
39
- }
40
- remove(params, callback) {
41
- if (params instanceof Function) {
42
- callback = params;
43
- params = {};
44
- }
45
- else {
46
- params = params || {};
47
- }
48
- let data = {};
49
- const headers = {};
50
- if (params["ifMatch"] !== undefined)
51
- headers["If-Match"] = params["ifMatch"];
52
- const instance = this;
53
- let operationVersion = instance._version, operationPromise = operationVersion.remove({
54
- uri: instance._uri,
55
- method: "delete",
56
- params: data,
57
- headers,
58
- });
59
- operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
60
- return operationPromise;
61
- }
62
- fetch(callback) {
63
- const headers = {};
64
- headers["Accept"] = "application/json";
65
- const instance = this;
66
- let operationVersion = instance._version, operationPromise = operationVersion.fetch({
67
- uri: instance._uri,
68
- method: "get",
69
- headers,
70
- });
71
- operationPromise = operationPromise.then((payload) => new SyncMapItemInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.mapSid, instance._solution.key));
72
- operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
73
- return operationPromise;
74
- }
75
- update(params, callback) {
76
- if (params === null || params === undefined) {
77
- throw new Error('Required parameter "params" missing.');
78
- }
79
- if (params["data"] === null || params["data"] === undefined) {
80
- throw new Error("Required parameter \"params['data']\" missing.");
81
- }
82
- let data = {};
83
- data["Data"] = serialize.object(params["data"]);
84
- const headers = {};
85
- headers["Content-Type"] = "application/x-www-form-urlencoded";
86
- headers["Accept"] = "application/json";
87
- if (params["ifMatch"] !== undefined)
88
- headers["If-Match"] = params["ifMatch"];
89
- const instance = this;
90
- let operationVersion = instance._version, operationPromise = operationVersion.update({
91
- uri: instance._uri,
92
- method: "post",
93
- data,
94
- headers,
95
- });
96
- operationPromise = operationPromise.then((payload) => new SyncMapItemInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.mapSid, instance._solution.key));
97
- operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
98
- return operationPromise;
99
- }
100
- /**
101
- * Provide a user-friendly representation
102
- *
103
- * @returns Object
104
- */
105
- toJSON() {
106
- return this._solution;
107
- }
108
- [util_1.inspect.custom](_depth, options) {
109
- return (0, util_1.inspect)(this.toJSON(), options);
110
- }
111
- }
112
- exports.SyncMapItemContextImpl = SyncMapItemContextImpl;
113
- class SyncMapItemInstance {
114
- constructor(_version, payload, serviceSid, mapSid, key) {
115
- this._version = _version;
116
- this.key = payload.key;
117
- this.accountSid = payload.account_sid;
118
- this.serviceSid = payload.service_sid;
119
- this.mapSid = payload.map_sid;
120
- this.url = payload.url;
121
- this.revision = payload.revision;
122
- this.data = payload.data;
123
- this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
124
- this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
125
- this.createdBy = payload.created_by;
126
- this._solution = { serviceSid, mapSid, key: key || this.key };
127
- }
128
- get _proxy() {
129
- this._context =
130
- this._context ||
131
- new SyncMapItemContextImpl(this._version, this._solution.serviceSid, this._solution.mapSid, this._solution.key);
132
- return this._context;
133
- }
134
- remove(params, callback) {
135
- return this._proxy.remove(params, callback);
136
- }
137
- /**
138
- * Fetch a SyncMapItemInstance
139
- *
140
- * @param callback - Callback to handle processed record
141
- *
142
- * @returns Resolves to processed SyncMapItemInstance
143
- */
144
- fetch(callback) {
145
- return this._proxy.fetch(callback);
146
- }
147
- update(params, callback) {
148
- return this._proxy.update(params, callback);
149
- }
150
- /**
151
- * Provide a user-friendly representation
152
- *
153
- * @returns Object
154
- */
155
- toJSON() {
156
- return {
157
- key: this.key,
158
- accountSid: this.accountSid,
159
- serviceSid: this.serviceSid,
160
- mapSid: this.mapSid,
161
- url: this.url,
162
- revision: this.revision,
163
- data: this.data,
164
- dateCreated: this.dateCreated,
165
- dateUpdated: this.dateUpdated,
166
- createdBy: this.createdBy,
167
- };
168
- }
169
- [util_1.inspect.custom](_depth, options) {
170
- return (0, util_1.inspect)(this.toJSON(), options);
171
- }
172
- }
173
- exports.SyncMapItemInstance = SyncMapItemInstance;
174
- function SyncMapItemListInstance(version, serviceSid, mapSid) {
175
- if (!(0, utility_1.isValidPathParam)(serviceSid)) {
176
- throw new Error("Parameter 'serviceSid' is not valid.");
177
- }
178
- if (!(0, utility_1.isValidPathParam)(mapSid)) {
179
- throw new Error("Parameter 'mapSid' is not valid.");
180
- }
181
- const instance = ((key) => instance.get(key));
182
- instance.get = function get(key) {
183
- return new SyncMapItemContextImpl(version, serviceSid, mapSid, key);
184
- };
185
- instance._version = version;
186
- instance._solution = { serviceSid, mapSid };
187
- instance._uri = `/Services/${serviceSid}/Maps/${mapSid}/Items`;
188
- instance.create = function create(params, callback) {
189
- if (params === null || params === undefined) {
190
- throw new Error('Required parameter "params" missing.');
191
- }
192
- if (params["key"] === null || params["key"] === undefined) {
193
- throw new Error("Required parameter \"params['key']\" missing.");
194
- }
195
- if (params["data"] === null || params["data"] === undefined) {
196
- throw new Error("Required parameter \"params['data']\" missing.");
197
- }
198
- let data = {};
199
- data["Key"] = params["key"];
200
- data["Data"] = serialize.object(params["data"]);
201
- const headers = {};
202
- headers["Content-Type"] = "application/x-www-form-urlencoded";
203
- headers["Accept"] = "application/json";
204
- let operationVersion = version, operationPromise = operationVersion.create({
205
- uri: instance._uri,
206
- method: "post",
207
- data,
208
- headers,
209
- });
210
- operationPromise = operationPromise.then((payload) => new SyncMapItemInstance(operationVersion, payload, instance._solution.serviceSid, instance._solution.mapSid));
211
- operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
212
- return operationPromise;
213
- };
214
- instance.page = function page(params, callback) {
215
- if (params instanceof Function) {
216
- callback = params;
217
- params = {};
218
- }
219
- else {
220
- params = params || {};
221
- }
222
- let data = {};
223
- if (params["order"] !== undefined)
224
- data["Order"] = params["order"];
225
- if (params["from"] !== undefined)
226
- data["From"] = params["from"];
227
- if (params["bounds"] !== undefined)
228
- data["Bounds"] = params["bounds"];
229
- if (params["pageSize"] !== undefined)
230
- data["PageSize"] = params["pageSize"];
231
- if (params.pageNumber !== undefined)
232
- data["Page"] = params.pageNumber;
233
- if (params.pageToken !== undefined)
234
- data["PageToken"] = params.pageToken;
235
- const headers = {};
236
- headers["Accept"] = "application/json";
237
- let operationVersion = version, operationPromise = operationVersion.page({
238
- uri: instance._uri,
239
- method: "get",
240
- params: data,
241
- headers,
242
- });
243
- operationPromise = operationPromise.then((payload) => new SyncMapItemPage(operationVersion, payload, instance._solution));
244
- operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
245
- return operationPromise;
246
- };
247
- instance.each = instance._version.each;
248
- instance.list = instance._version.list;
249
- instance.getPage = function getPage(targetUrl, callback) {
250
- const operationPromise = instance._version._domain.twilio.request({
251
- method: "get",
252
- uri: targetUrl,
253
- });
254
- let pagePromise = operationPromise.then((payload) => new SyncMapItemPage(instance._version, payload, instance._solution));
255
- pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
256
- return pagePromise;
257
- };
258
- instance.toJSON = function toJSON() {
259
- return instance._solution;
260
- };
261
- instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
262
- return (0, util_1.inspect)(instance.toJSON(), options);
263
- };
264
- return instance;
265
- }
266
- exports.SyncMapItemListInstance = SyncMapItemListInstance;
267
- class SyncMapItemPage extends Page_1.default {
268
- /**
269
- * Initialize the SyncMapItemPage
270
- *
271
- * @param version - Version of the resource
272
- * @param response - Response from the API
273
- * @param solution - Path solution
274
- */
275
- constructor(version, response, solution) {
276
- super(version, response, solution);
277
- }
278
- /**
279
- * Build an instance of SyncMapItemInstance
280
- *
281
- * @param payload - Payload response from the API
282
- */
283
- getInstance(payload) {
284
- return new SyncMapItemInstance(this._version, payload, this._solution.serviceSid, this._solution.mapSid);
285
- }
286
- [util_1.inspect.custom](depth, options) {
287
- return (0, util_1.inspect)(this.toJSON(), options);
288
- }
289
- }
290
- exports.SyncMapItemPage = SyncMapItemPage;