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