@appwrite.io/console 0.0.1

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 (228) hide show
  1. package/.github/workflows/publish.yml +18 -0
  2. package/CHANGELOG.md +1 -0
  3. package/LICENSE +12 -0
  4. package/README.md +111 -0
  5. package/dist/cjs/package.json +3 -0
  6. package/dist/esm/package.json +3 -0
  7. package/docs/examples/account/create-anonymous-session.md +18 -0
  8. package/docs/examples/account/create-email-session.md +18 -0
  9. package/docs/examples/account/create-j-w-t.md +18 -0
  10. package/docs/examples/account/create-magic-u-r-l-session.md +18 -0
  11. package/docs/examples/account/create-o-auth2session.md +14 -0
  12. package/docs/examples/account/create-phone-session.md +18 -0
  13. package/docs/examples/account/create-phone-verification.md +18 -0
  14. package/docs/examples/account/create-recovery.md +18 -0
  15. package/docs/examples/account/create-verification.md +18 -0
  16. package/docs/examples/account/create.md +18 -0
  17. package/docs/examples/account/delete-session.md +18 -0
  18. package/docs/examples/account/delete-sessions.md +18 -0
  19. package/docs/examples/account/get-prefs.md +18 -0
  20. package/docs/examples/account/get-session.md +18 -0
  21. package/docs/examples/account/get.md +18 -0
  22. package/docs/examples/account/list-logs.md +18 -0
  23. package/docs/examples/account/list-sessions.md +18 -0
  24. package/docs/examples/account/update-email.md +18 -0
  25. package/docs/examples/account/update-magic-u-r-l-session.md +18 -0
  26. package/docs/examples/account/update-name.md +18 -0
  27. package/docs/examples/account/update-password.md +18 -0
  28. package/docs/examples/account/update-phone-session.md +18 -0
  29. package/docs/examples/account/update-phone-verification.md +18 -0
  30. package/docs/examples/account/update-phone.md +18 -0
  31. package/docs/examples/account/update-prefs.md +18 -0
  32. package/docs/examples/account/update-recovery.md +18 -0
  33. package/docs/examples/account/update-session.md +18 -0
  34. package/docs/examples/account/update-status.md +18 -0
  35. package/docs/examples/account/update-verification.md +18 -0
  36. package/docs/examples/avatars/get-browser.md +14 -0
  37. package/docs/examples/avatars/get-credit-card.md +14 -0
  38. package/docs/examples/avatars/get-favicon.md +14 -0
  39. package/docs/examples/avatars/get-flag.md +14 -0
  40. package/docs/examples/avatars/get-image.md +14 -0
  41. package/docs/examples/avatars/get-initials.md +14 -0
  42. package/docs/examples/avatars/get-q-r.md +14 -0
  43. package/docs/examples/databases/create-boolean-attribute.md +18 -0
  44. package/docs/examples/databases/create-collection.md +18 -0
  45. package/docs/examples/databases/create-datetime-attribute.md +18 -0
  46. package/docs/examples/databases/create-document.md +18 -0
  47. package/docs/examples/databases/create-email-attribute.md +18 -0
  48. package/docs/examples/databases/create-enum-attribute.md +18 -0
  49. package/docs/examples/databases/create-float-attribute.md +18 -0
  50. package/docs/examples/databases/create-index.md +18 -0
  51. package/docs/examples/databases/create-integer-attribute.md +18 -0
  52. package/docs/examples/databases/create-ip-attribute.md +18 -0
  53. package/docs/examples/databases/create-string-attribute.md +18 -0
  54. package/docs/examples/databases/create-url-attribute.md +18 -0
  55. package/docs/examples/databases/create.md +18 -0
  56. package/docs/examples/databases/delete-attribute.md +18 -0
  57. package/docs/examples/databases/delete-collection.md +18 -0
  58. package/docs/examples/databases/delete-document.md +18 -0
  59. package/docs/examples/databases/delete-index.md +18 -0
  60. package/docs/examples/databases/delete.md +18 -0
  61. package/docs/examples/databases/get-attribute.md +18 -0
  62. package/docs/examples/databases/get-collection-usage.md +18 -0
  63. package/docs/examples/databases/get-collection.md +18 -0
  64. package/docs/examples/databases/get-database-usage.md +18 -0
  65. package/docs/examples/databases/get-document.md +18 -0
  66. package/docs/examples/databases/get-index.md +18 -0
  67. package/docs/examples/databases/get-usage.md +18 -0
  68. package/docs/examples/databases/get.md +18 -0
  69. package/docs/examples/databases/list-attributes.md +18 -0
  70. package/docs/examples/databases/list-collection-logs.md +18 -0
  71. package/docs/examples/databases/list-collections.md +18 -0
  72. package/docs/examples/databases/list-document-logs.md +18 -0
  73. package/docs/examples/databases/list-documents.md +18 -0
  74. package/docs/examples/databases/list-indexes.md +18 -0
  75. package/docs/examples/databases/list-logs.md +18 -0
  76. package/docs/examples/databases/list.md +18 -0
  77. package/docs/examples/databases/update-collection.md +18 -0
  78. package/docs/examples/databases/update-document.md +18 -0
  79. package/docs/examples/databases/update.md +18 -0
  80. package/docs/examples/functions/create-build.md +18 -0
  81. package/docs/examples/functions/create-deployment.md +18 -0
  82. package/docs/examples/functions/create-execution.md +18 -0
  83. package/docs/examples/functions/create-variable.md +18 -0
  84. package/docs/examples/functions/create.md +18 -0
  85. package/docs/examples/functions/delete-deployment.md +18 -0
  86. package/docs/examples/functions/delete-variable.md +18 -0
  87. package/docs/examples/functions/delete.md +18 -0
  88. package/docs/examples/functions/get-deployment.md +18 -0
  89. package/docs/examples/functions/get-execution.md +18 -0
  90. package/docs/examples/functions/get-function-usage.md +18 -0
  91. package/docs/examples/functions/get-usage.md +18 -0
  92. package/docs/examples/functions/get-variable.md +18 -0
  93. package/docs/examples/functions/get.md +18 -0
  94. package/docs/examples/functions/list-deployments.md +18 -0
  95. package/docs/examples/functions/list-executions.md +18 -0
  96. package/docs/examples/functions/list-runtimes.md +18 -0
  97. package/docs/examples/functions/list-variables.md +18 -0
  98. package/docs/examples/functions/list.md +18 -0
  99. package/docs/examples/functions/update-deployment.md +18 -0
  100. package/docs/examples/functions/update-variable.md +18 -0
  101. package/docs/examples/functions/update.md +18 -0
  102. package/docs/examples/graphql/mutation.md +18 -0
  103. package/docs/examples/graphql/query.md +18 -0
  104. package/docs/examples/health/get-antivirus.md +18 -0
  105. package/docs/examples/health/get-cache.md +18 -0
  106. package/docs/examples/health/get-d-b.md +18 -0
  107. package/docs/examples/health/get-queue-certificates.md +18 -0
  108. package/docs/examples/health/get-queue-functions.md +18 -0
  109. package/docs/examples/health/get-queue-logs.md +18 -0
  110. package/docs/examples/health/get-queue-webhooks.md +18 -0
  111. package/docs/examples/health/get-storage-local.md +18 -0
  112. package/docs/examples/health/get-time.md +18 -0
  113. package/docs/examples/health/get.md +18 -0
  114. package/docs/examples/locale/get.md +18 -0
  115. package/docs/examples/locale/list-continents.md +18 -0
  116. package/docs/examples/locale/list-countries-e-u.md +18 -0
  117. package/docs/examples/locale/list-countries-phones.md +18 -0
  118. package/docs/examples/locale/list-countries.md +18 -0
  119. package/docs/examples/locale/list-currencies.md +18 -0
  120. package/docs/examples/locale/list-languages.md +18 -0
  121. package/docs/examples/projects/create-domain.md +18 -0
  122. package/docs/examples/projects/create-key.md +18 -0
  123. package/docs/examples/projects/create-platform.md +18 -0
  124. package/docs/examples/projects/create-webhook.md +18 -0
  125. package/docs/examples/projects/create.md +18 -0
  126. package/docs/examples/projects/delete-domain.md +18 -0
  127. package/docs/examples/projects/delete-key.md +18 -0
  128. package/docs/examples/projects/delete-platform.md +18 -0
  129. package/docs/examples/projects/delete-webhook.md +18 -0
  130. package/docs/examples/projects/delete.md +18 -0
  131. package/docs/examples/projects/get-domain.md +18 -0
  132. package/docs/examples/projects/get-key.md +18 -0
  133. package/docs/examples/projects/get-platform.md +18 -0
  134. package/docs/examples/projects/get-usage.md +18 -0
  135. package/docs/examples/projects/get-webhook.md +18 -0
  136. package/docs/examples/projects/get.md +18 -0
  137. package/docs/examples/projects/list-domains.md +18 -0
  138. package/docs/examples/projects/list-keys.md +18 -0
  139. package/docs/examples/projects/list-platforms.md +18 -0
  140. package/docs/examples/projects/list-webhooks.md +18 -0
  141. package/docs/examples/projects/list.md +18 -0
  142. package/docs/examples/projects/update-auth-duration.md +18 -0
  143. package/docs/examples/projects/update-auth-limit.md +18 -0
  144. package/docs/examples/projects/update-auth-sessions-limit.md +18 -0
  145. package/docs/examples/projects/update-auth-status.md +18 -0
  146. package/docs/examples/projects/update-domain-verification.md +18 -0
  147. package/docs/examples/projects/update-key.md +18 -0
  148. package/docs/examples/projects/update-o-auth2.md +18 -0
  149. package/docs/examples/projects/update-platform.md +18 -0
  150. package/docs/examples/projects/update-service-status.md +18 -0
  151. package/docs/examples/projects/update-webhook-signature.md +18 -0
  152. package/docs/examples/projects/update-webhook.md +18 -0
  153. package/docs/examples/projects/update.md +18 -0
  154. package/docs/examples/storage/create-bucket.md +18 -0
  155. package/docs/examples/storage/create-file.md +18 -0
  156. package/docs/examples/storage/delete-bucket.md +18 -0
  157. package/docs/examples/storage/delete-file.md +18 -0
  158. package/docs/examples/storage/get-bucket-usage.md +18 -0
  159. package/docs/examples/storage/get-bucket.md +18 -0
  160. package/docs/examples/storage/get-file-download.md +14 -0
  161. package/docs/examples/storage/get-file-preview.md +14 -0
  162. package/docs/examples/storage/get-file-view.md +14 -0
  163. package/docs/examples/storage/get-file.md +18 -0
  164. package/docs/examples/storage/get-usage.md +18 -0
  165. package/docs/examples/storage/list-buckets.md +18 -0
  166. package/docs/examples/storage/list-files.md +18 -0
  167. package/docs/examples/storage/update-bucket.md +18 -0
  168. package/docs/examples/storage/update-file.md +18 -0
  169. package/docs/examples/teams/create-membership.md +18 -0
  170. package/docs/examples/teams/create.md +18 -0
  171. package/docs/examples/teams/delete-membership.md +18 -0
  172. package/docs/examples/teams/delete.md +18 -0
  173. package/docs/examples/teams/get-membership.md +18 -0
  174. package/docs/examples/teams/get.md +18 -0
  175. package/docs/examples/teams/list-logs.md +18 -0
  176. package/docs/examples/teams/list-memberships.md +18 -0
  177. package/docs/examples/teams/list.md +18 -0
  178. package/docs/examples/teams/update-membership-roles.md +18 -0
  179. package/docs/examples/teams/update-membership-status.md +18 -0
  180. package/docs/examples/teams/update.md +18 -0
  181. package/docs/examples/users/create-argon2user.md +18 -0
  182. package/docs/examples/users/create-bcrypt-user.md +18 -0
  183. package/docs/examples/users/create-m-d5user.md +18 -0
  184. package/docs/examples/users/create-p-h-pass-user.md +18 -0
  185. package/docs/examples/users/create-s-h-a-user.md +18 -0
  186. package/docs/examples/users/create-scrypt-modified-user.md +18 -0
  187. package/docs/examples/users/create-scrypt-user.md +18 -0
  188. package/docs/examples/users/create.md +18 -0
  189. package/docs/examples/users/delete-session.md +18 -0
  190. package/docs/examples/users/delete-sessions.md +18 -0
  191. package/docs/examples/users/delete.md +18 -0
  192. package/docs/examples/users/get-prefs.md +18 -0
  193. package/docs/examples/users/get-usage.md +18 -0
  194. package/docs/examples/users/get.md +18 -0
  195. package/docs/examples/users/list-logs.md +18 -0
  196. package/docs/examples/users/list-memberships.md +18 -0
  197. package/docs/examples/users/list-sessions.md +18 -0
  198. package/docs/examples/users/list.md +18 -0
  199. package/docs/examples/users/update-email-verification.md +18 -0
  200. package/docs/examples/users/update-email.md +18 -0
  201. package/docs/examples/users/update-name.md +18 -0
  202. package/docs/examples/users/update-password.md +18 -0
  203. package/docs/examples/users/update-phone-verification.md +18 -0
  204. package/docs/examples/users/update-phone.md +18 -0
  205. package/docs/examples/users/update-prefs.md +18 -0
  206. package/docs/examples/users/update-status.md +18 -0
  207. package/package.json +40 -0
  208. package/rollup.config.js +31 -0
  209. package/src/client.ts +472 -0
  210. package/src/id.ts +9 -0
  211. package/src/index.ts +17 -0
  212. package/src/models.ts +2540 -0
  213. package/src/permission.ts +22 -0
  214. package/src/query.ts +56 -0
  215. package/src/role.ts +34 -0
  216. package/src/service.ts +30 -0
  217. package/src/services/account.ts +1009 -0
  218. package/src/services/avatars.ts +351 -0
  219. package/src/services/databases.ts +1525 -0
  220. package/src/services/functions.ts +814 -0
  221. package/src/services/graphql.ts +68 -0
  222. package/src/services/health.ts +202 -0
  223. package/src/services/locale.ts +150 -0
  224. package/src/services/projects.ts +1235 -0
  225. package/src/services/storage.ts +691 -0
  226. package/src/services/teams.ts +445 -0
  227. package/src/services/users.ts +1020 -0
  228. package/tsconfig.json +24 -0
@@ -0,0 +1,1235 @@
1
+ import { Service } from '../service';
2
+ import { AppwriteException, Client } from '../client';
3
+ import type { Models } from '../models';
4
+ import type { UploadProgress, Payload } from '../client';
5
+
6
+ export class Projects extends Service {
7
+
8
+ constructor(client: Client)
9
+ {
10
+ super(client);
11
+ }
12
+
13
+ /**
14
+ * List Projects
15
+ *
16
+ *
17
+ * @param {string[]} queries
18
+ * @param {string} search
19
+ * @throws {AppwriteException}
20
+ * @returns {Promise}
21
+ */
22
+ async list(queries?: string[], search?: string): Promise<Models.ProjectList> {
23
+ let path = '/projects';
24
+ let payload: Payload = {};
25
+
26
+ if (typeof queries !== 'undefined') {
27
+ payload['queries'] = queries;
28
+ }
29
+
30
+ if (typeof search !== 'undefined') {
31
+ payload['search'] = search;
32
+ }
33
+
34
+ const uri = new URL(this.client.config.endpoint + path);
35
+ return await this.client.call('get', uri, {
36
+ 'content-type': 'application/json',
37
+ }, payload);
38
+ }
39
+
40
+ /**
41
+ * Create Project
42
+ *
43
+ *
44
+ * @param {string} projectId
45
+ * @param {string} name
46
+ * @param {string} teamId
47
+ * @param {string} region
48
+ * @param {string} description
49
+ * @param {string} logo
50
+ * @param {string} url
51
+ * @param {string} legalName
52
+ * @param {string} legalCountry
53
+ * @param {string} legalState
54
+ * @param {string} legalCity
55
+ * @param {string} legalAddress
56
+ * @param {string} legalTaxId
57
+ * @throws {AppwriteException}
58
+ * @returns {Promise}
59
+ */
60
+ async create(projectId: string, name: string, teamId: string, region?: string, description?: string, logo?: string, url?: string, legalName?: string, legalCountry?: string, legalState?: string, legalCity?: string, legalAddress?: string, legalTaxId?: string): Promise<Models.Project> {
61
+ if (typeof projectId === 'undefined') {
62
+ throw new AppwriteException('Missing required parameter: "projectId"');
63
+ }
64
+
65
+ if (typeof name === 'undefined') {
66
+ throw new AppwriteException('Missing required parameter: "name"');
67
+ }
68
+
69
+ if (typeof teamId === 'undefined') {
70
+ throw new AppwriteException('Missing required parameter: "teamId"');
71
+ }
72
+
73
+ let path = '/projects';
74
+ let payload: Payload = {};
75
+
76
+ if (typeof projectId !== 'undefined') {
77
+ payload['projectId'] = projectId;
78
+ }
79
+
80
+ if (typeof name !== 'undefined') {
81
+ payload['name'] = name;
82
+ }
83
+
84
+ if (typeof teamId !== 'undefined') {
85
+ payload['teamId'] = teamId;
86
+ }
87
+
88
+ if (typeof region !== 'undefined') {
89
+ payload['region'] = region;
90
+ }
91
+
92
+ if (typeof description !== 'undefined') {
93
+ payload['description'] = description;
94
+ }
95
+
96
+ if (typeof logo !== 'undefined') {
97
+ payload['logo'] = logo;
98
+ }
99
+
100
+ if (typeof url !== 'undefined') {
101
+ payload['url'] = url;
102
+ }
103
+
104
+ if (typeof legalName !== 'undefined') {
105
+ payload['legalName'] = legalName;
106
+ }
107
+
108
+ if (typeof legalCountry !== 'undefined') {
109
+ payload['legalCountry'] = legalCountry;
110
+ }
111
+
112
+ if (typeof legalState !== 'undefined') {
113
+ payload['legalState'] = legalState;
114
+ }
115
+
116
+ if (typeof legalCity !== 'undefined') {
117
+ payload['legalCity'] = legalCity;
118
+ }
119
+
120
+ if (typeof legalAddress !== 'undefined') {
121
+ payload['legalAddress'] = legalAddress;
122
+ }
123
+
124
+ if (typeof legalTaxId !== 'undefined') {
125
+ payload['legalTaxId'] = legalTaxId;
126
+ }
127
+
128
+ const uri = new URL(this.client.config.endpoint + path);
129
+ return await this.client.call('post', uri, {
130
+ 'content-type': 'application/json',
131
+ }, payload);
132
+ }
133
+
134
+ /**
135
+ * Get Project
136
+ *
137
+ *
138
+ * @param {string} projectId
139
+ * @throws {AppwriteException}
140
+ * @returns {Promise}
141
+ */
142
+ async get(projectId: string): Promise<Models.Project> {
143
+ if (typeof projectId === 'undefined') {
144
+ throw new AppwriteException('Missing required parameter: "projectId"');
145
+ }
146
+
147
+ let path = '/projects/{projectId}'.replace('{projectId}', projectId);
148
+ let payload: Payload = {};
149
+
150
+ const uri = new URL(this.client.config.endpoint + path);
151
+ return await this.client.call('get', uri, {
152
+ 'content-type': 'application/json',
153
+ }, payload);
154
+ }
155
+
156
+ /**
157
+ * Update Project
158
+ *
159
+ *
160
+ * @param {string} projectId
161
+ * @param {string} name
162
+ * @param {string} description
163
+ * @param {string} logo
164
+ * @param {string} url
165
+ * @param {string} legalName
166
+ * @param {string} legalCountry
167
+ * @param {string} legalState
168
+ * @param {string} legalCity
169
+ * @param {string} legalAddress
170
+ * @param {string} legalTaxId
171
+ * @throws {AppwriteException}
172
+ * @returns {Promise}
173
+ */
174
+ async update(projectId: string, name: string, description?: string, logo?: string, url?: string, legalName?: string, legalCountry?: string, legalState?: string, legalCity?: string, legalAddress?: string, legalTaxId?: string): Promise<Models.Project> {
175
+ if (typeof projectId === 'undefined') {
176
+ throw new AppwriteException('Missing required parameter: "projectId"');
177
+ }
178
+
179
+ if (typeof name === 'undefined') {
180
+ throw new AppwriteException('Missing required parameter: "name"');
181
+ }
182
+
183
+ let path = '/projects/{projectId}'.replace('{projectId}', projectId);
184
+ let payload: Payload = {};
185
+
186
+ if (typeof name !== 'undefined') {
187
+ payload['name'] = name;
188
+ }
189
+
190
+ if (typeof description !== 'undefined') {
191
+ payload['description'] = description;
192
+ }
193
+
194
+ if (typeof logo !== 'undefined') {
195
+ payload['logo'] = logo;
196
+ }
197
+
198
+ if (typeof url !== 'undefined') {
199
+ payload['url'] = url;
200
+ }
201
+
202
+ if (typeof legalName !== 'undefined') {
203
+ payload['legalName'] = legalName;
204
+ }
205
+
206
+ if (typeof legalCountry !== 'undefined') {
207
+ payload['legalCountry'] = legalCountry;
208
+ }
209
+
210
+ if (typeof legalState !== 'undefined') {
211
+ payload['legalState'] = legalState;
212
+ }
213
+
214
+ if (typeof legalCity !== 'undefined') {
215
+ payload['legalCity'] = legalCity;
216
+ }
217
+
218
+ if (typeof legalAddress !== 'undefined') {
219
+ payload['legalAddress'] = legalAddress;
220
+ }
221
+
222
+ if (typeof legalTaxId !== 'undefined') {
223
+ payload['legalTaxId'] = legalTaxId;
224
+ }
225
+
226
+ const uri = new URL(this.client.config.endpoint + path);
227
+ return await this.client.call('patch', uri, {
228
+ 'content-type': 'application/json',
229
+ }, payload);
230
+ }
231
+
232
+ /**
233
+ * Delete Project
234
+ *
235
+ *
236
+ * @param {string} projectId
237
+ * @param {string} password
238
+ * @throws {AppwriteException}
239
+ * @returns {Promise}
240
+ */
241
+ async delete(projectId: string, password: string): Promise<{}> {
242
+ if (typeof projectId === 'undefined') {
243
+ throw new AppwriteException('Missing required parameter: "projectId"');
244
+ }
245
+
246
+ if (typeof password === 'undefined') {
247
+ throw new AppwriteException('Missing required parameter: "password"');
248
+ }
249
+
250
+ let path = '/projects/{projectId}'.replace('{projectId}', projectId);
251
+ let payload: Payload = {};
252
+
253
+ if (typeof password !== 'undefined') {
254
+ payload['password'] = password;
255
+ }
256
+
257
+ const uri = new URL(this.client.config.endpoint + path);
258
+ return await this.client.call('delete', uri, {
259
+ 'content-type': 'application/json',
260
+ }, payload);
261
+ }
262
+
263
+ /**
264
+ * Update Project Authentication Duration
265
+ *
266
+ *
267
+ * @param {string} projectId
268
+ * @param {number} duration
269
+ * @throws {AppwriteException}
270
+ * @returns {Promise}
271
+ */
272
+ async updateAuthDuration(projectId: string, duration: number): Promise<Models.Project> {
273
+ if (typeof projectId === 'undefined') {
274
+ throw new AppwriteException('Missing required parameter: "projectId"');
275
+ }
276
+
277
+ if (typeof duration === 'undefined') {
278
+ throw new AppwriteException('Missing required parameter: "duration"');
279
+ }
280
+
281
+ let path = '/projects/{projectId}/auth/duration'.replace('{projectId}', projectId);
282
+ let payload: Payload = {};
283
+
284
+ if (typeof duration !== 'undefined') {
285
+ payload['duration'] = duration;
286
+ }
287
+
288
+ const uri = new URL(this.client.config.endpoint + path);
289
+ return await this.client.call('patch', uri, {
290
+ 'content-type': 'application/json',
291
+ }, payload);
292
+ }
293
+
294
+ /**
295
+ * Update Project users limit
296
+ *
297
+ *
298
+ * @param {string} projectId
299
+ * @param {number} limit
300
+ * @throws {AppwriteException}
301
+ * @returns {Promise}
302
+ */
303
+ async updateAuthLimit(projectId: string, limit: number): Promise<Models.Project> {
304
+ if (typeof projectId === 'undefined') {
305
+ throw new AppwriteException('Missing required parameter: "projectId"');
306
+ }
307
+
308
+ if (typeof limit === 'undefined') {
309
+ throw new AppwriteException('Missing required parameter: "limit"');
310
+ }
311
+
312
+ let path = '/projects/{projectId}/auth/limit'.replace('{projectId}', projectId);
313
+ let payload: Payload = {};
314
+
315
+ if (typeof limit !== 'undefined') {
316
+ payload['limit'] = limit;
317
+ }
318
+
319
+ const uri = new URL(this.client.config.endpoint + path);
320
+ return await this.client.call('patch', uri, {
321
+ 'content-type': 'application/json',
322
+ }, payload);
323
+ }
324
+
325
+ /**
326
+ * Update Project user sessions limit
327
+ *
328
+ *
329
+ * @param {string} projectId
330
+ * @param {number} limit
331
+ * @throws {AppwriteException}
332
+ * @returns {Promise}
333
+ */
334
+ async updateAuthSessionsLimit(projectId: string, limit: number): Promise<Models.Project> {
335
+ if (typeof projectId === 'undefined') {
336
+ throw new AppwriteException('Missing required parameter: "projectId"');
337
+ }
338
+
339
+ if (typeof limit === 'undefined') {
340
+ throw new AppwriteException('Missing required parameter: "limit"');
341
+ }
342
+
343
+ let path = '/projects/{projectId}/auth/max-sessions'.replace('{projectId}', projectId);
344
+ let payload: Payload = {};
345
+
346
+ if (typeof limit !== 'undefined') {
347
+ payload['limit'] = limit;
348
+ }
349
+
350
+ const uri = new URL(this.client.config.endpoint + path);
351
+ return await this.client.call('patch', uri, {
352
+ 'content-type': 'application/json',
353
+ }, payload);
354
+ }
355
+
356
+ /**
357
+ * Update Project auth method status. Use this endpoint to enable or disable a given auth method for this project.
358
+ *
359
+ *
360
+ * @param {string} projectId
361
+ * @param {string} method
362
+ * @param {boolean} status
363
+ * @throws {AppwriteException}
364
+ * @returns {Promise}
365
+ */
366
+ async updateAuthStatus(projectId: string, method: string, status: boolean): Promise<Models.Project> {
367
+ if (typeof projectId === 'undefined') {
368
+ throw new AppwriteException('Missing required parameter: "projectId"');
369
+ }
370
+
371
+ if (typeof method === 'undefined') {
372
+ throw new AppwriteException('Missing required parameter: "method"');
373
+ }
374
+
375
+ if (typeof status === 'undefined') {
376
+ throw new AppwriteException('Missing required parameter: "status"');
377
+ }
378
+
379
+ let path = '/projects/{projectId}/auth/{method}'.replace('{projectId}', projectId).replace('{method}', method);
380
+ let payload: Payload = {};
381
+
382
+ if (typeof status !== 'undefined') {
383
+ payload['status'] = status;
384
+ }
385
+
386
+ const uri = new URL(this.client.config.endpoint + path);
387
+ return await this.client.call('patch', uri, {
388
+ 'content-type': 'application/json',
389
+ }, payload);
390
+ }
391
+
392
+ /**
393
+ * List Domains
394
+ *
395
+ *
396
+ * @param {string} projectId
397
+ * @throws {AppwriteException}
398
+ * @returns {Promise}
399
+ */
400
+ async listDomains(projectId: string): Promise<Models.DomainList> {
401
+ if (typeof projectId === 'undefined') {
402
+ throw new AppwriteException('Missing required parameter: "projectId"');
403
+ }
404
+
405
+ let path = '/projects/{projectId}/domains'.replace('{projectId}', projectId);
406
+ let payload: Payload = {};
407
+
408
+ const uri = new URL(this.client.config.endpoint + path);
409
+ return await this.client.call('get', uri, {
410
+ 'content-type': 'application/json',
411
+ }, payload);
412
+ }
413
+
414
+ /**
415
+ * Create Domain
416
+ *
417
+ *
418
+ * @param {string} projectId
419
+ * @param {string} domain
420
+ * @throws {AppwriteException}
421
+ * @returns {Promise}
422
+ */
423
+ async createDomain(projectId: string, domain: string): Promise<Models.Domain> {
424
+ if (typeof projectId === 'undefined') {
425
+ throw new AppwriteException('Missing required parameter: "projectId"');
426
+ }
427
+
428
+ if (typeof domain === 'undefined') {
429
+ throw new AppwriteException('Missing required parameter: "domain"');
430
+ }
431
+
432
+ let path = '/projects/{projectId}/domains'.replace('{projectId}', projectId);
433
+ let payload: Payload = {};
434
+
435
+ if (typeof domain !== 'undefined') {
436
+ payload['domain'] = domain;
437
+ }
438
+
439
+ const uri = new URL(this.client.config.endpoint + path);
440
+ return await this.client.call('post', uri, {
441
+ 'content-type': 'application/json',
442
+ }, payload);
443
+ }
444
+
445
+ /**
446
+ * Get Domain
447
+ *
448
+ *
449
+ * @param {string} projectId
450
+ * @param {string} domainId
451
+ * @throws {AppwriteException}
452
+ * @returns {Promise}
453
+ */
454
+ async getDomain(projectId: string, domainId: string): Promise<Models.Domain> {
455
+ if (typeof projectId === 'undefined') {
456
+ throw new AppwriteException('Missing required parameter: "projectId"');
457
+ }
458
+
459
+ if (typeof domainId === 'undefined') {
460
+ throw new AppwriteException('Missing required parameter: "domainId"');
461
+ }
462
+
463
+ let path = '/projects/{projectId}/domains/{domainId}'.replace('{projectId}', projectId).replace('{domainId}', domainId);
464
+ let payload: Payload = {};
465
+
466
+ const uri = new URL(this.client.config.endpoint + path);
467
+ return await this.client.call('get', uri, {
468
+ 'content-type': 'application/json',
469
+ }, payload);
470
+ }
471
+
472
+ /**
473
+ * Delete Domain
474
+ *
475
+ *
476
+ * @param {string} projectId
477
+ * @param {string} domainId
478
+ * @throws {AppwriteException}
479
+ * @returns {Promise}
480
+ */
481
+ async deleteDomain(projectId: string, domainId: string): Promise<{}> {
482
+ if (typeof projectId === 'undefined') {
483
+ throw new AppwriteException('Missing required parameter: "projectId"');
484
+ }
485
+
486
+ if (typeof domainId === 'undefined') {
487
+ throw new AppwriteException('Missing required parameter: "domainId"');
488
+ }
489
+
490
+ let path = '/projects/{projectId}/domains/{domainId}'.replace('{projectId}', projectId).replace('{domainId}', domainId);
491
+ let payload: Payload = {};
492
+
493
+ const uri = new URL(this.client.config.endpoint + path);
494
+ return await this.client.call('delete', uri, {
495
+ 'content-type': 'application/json',
496
+ }, payload);
497
+ }
498
+
499
+ /**
500
+ * Update Domain Verification Status
501
+ *
502
+ *
503
+ * @param {string} projectId
504
+ * @param {string} domainId
505
+ * @throws {AppwriteException}
506
+ * @returns {Promise}
507
+ */
508
+ async updateDomainVerification(projectId: string, domainId: string): Promise<Models.Domain> {
509
+ if (typeof projectId === 'undefined') {
510
+ throw new AppwriteException('Missing required parameter: "projectId"');
511
+ }
512
+
513
+ if (typeof domainId === 'undefined') {
514
+ throw new AppwriteException('Missing required parameter: "domainId"');
515
+ }
516
+
517
+ let path = '/projects/{projectId}/domains/{domainId}/verification'.replace('{projectId}', projectId).replace('{domainId}', domainId);
518
+ let payload: Payload = {};
519
+
520
+ const uri = new URL(this.client.config.endpoint + path);
521
+ return await this.client.call('patch', uri, {
522
+ 'content-type': 'application/json',
523
+ }, payload);
524
+ }
525
+
526
+ /**
527
+ * List Keys
528
+ *
529
+ *
530
+ * @param {string} projectId
531
+ * @throws {AppwriteException}
532
+ * @returns {Promise}
533
+ */
534
+ async listKeys(projectId: string): Promise<Models.KeyList> {
535
+ if (typeof projectId === 'undefined') {
536
+ throw new AppwriteException('Missing required parameter: "projectId"');
537
+ }
538
+
539
+ let path = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
540
+ let payload: Payload = {};
541
+
542
+ const uri = new URL(this.client.config.endpoint + path);
543
+ return await this.client.call('get', uri, {
544
+ 'content-type': 'application/json',
545
+ }, payload);
546
+ }
547
+
548
+ /**
549
+ * Create Key
550
+ *
551
+ *
552
+ * @param {string} projectId
553
+ * @param {string} name
554
+ * @param {string[]} scopes
555
+ * @param {string} expire
556
+ * @throws {AppwriteException}
557
+ * @returns {Promise}
558
+ */
559
+ async createKey(projectId: string, name: string, scopes: string[], expire?: string): Promise<Models.Key> {
560
+ if (typeof projectId === 'undefined') {
561
+ throw new AppwriteException('Missing required parameter: "projectId"');
562
+ }
563
+
564
+ if (typeof name === 'undefined') {
565
+ throw new AppwriteException('Missing required parameter: "name"');
566
+ }
567
+
568
+ if (typeof scopes === 'undefined') {
569
+ throw new AppwriteException('Missing required parameter: "scopes"');
570
+ }
571
+
572
+ let path = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
573
+ let payload: Payload = {};
574
+
575
+ if (typeof name !== 'undefined') {
576
+ payload['name'] = name;
577
+ }
578
+
579
+ if (typeof scopes !== 'undefined') {
580
+ payload['scopes'] = scopes;
581
+ }
582
+
583
+ if (typeof expire !== 'undefined') {
584
+ payload['expire'] = expire;
585
+ }
586
+
587
+ const uri = new URL(this.client.config.endpoint + path);
588
+ return await this.client.call('post', uri, {
589
+ 'content-type': 'application/json',
590
+ }, payload);
591
+ }
592
+
593
+ /**
594
+ * Get Key
595
+ *
596
+ *
597
+ * @param {string} projectId
598
+ * @param {string} keyId
599
+ * @throws {AppwriteException}
600
+ * @returns {Promise}
601
+ */
602
+ async getKey(projectId: string, keyId: string): Promise<Models.Key> {
603
+ if (typeof projectId === 'undefined') {
604
+ throw new AppwriteException('Missing required parameter: "projectId"');
605
+ }
606
+
607
+ if (typeof keyId === 'undefined') {
608
+ throw new AppwriteException('Missing required parameter: "keyId"');
609
+ }
610
+
611
+ let path = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
612
+ let payload: Payload = {};
613
+
614
+ const uri = new URL(this.client.config.endpoint + path);
615
+ return await this.client.call('get', uri, {
616
+ 'content-type': 'application/json',
617
+ }, payload);
618
+ }
619
+
620
+ /**
621
+ * Update Key
622
+ *
623
+ *
624
+ * @param {string} projectId
625
+ * @param {string} keyId
626
+ * @param {string} name
627
+ * @param {string[]} scopes
628
+ * @param {string} expire
629
+ * @throws {AppwriteException}
630
+ * @returns {Promise}
631
+ */
632
+ async updateKey(projectId: string, keyId: string, name: string, scopes: string[], expire?: string): Promise<Models.Key> {
633
+ if (typeof projectId === 'undefined') {
634
+ throw new AppwriteException('Missing required parameter: "projectId"');
635
+ }
636
+
637
+ if (typeof keyId === 'undefined') {
638
+ throw new AppwriteException('Missing required parameter: "keyId"');
639
+ }
640
+
641
+ if (typeof name === 'undefined') {
642
+ throw new AppwriteException('Missing required parameter: "name"');
643
+ }
644
+
645
+ if (typeof scopes === 'undefined') {
646
+ throw new AppwriteException('Missing required parameter: "scopes"');
647
+ }
648
+
649
+ let path = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
650
+ let payload: Payload = {};
651
+
652
+ if (typeof name !== 'undefined') {
653
+ payload['name'] = name;
654
+ }
655
+
656
+ if (typeof scopes !== 'undefined') {
657
+ payload['scopes'] = scopes;
658
+ }
659
+
660
+ if (typeof expire !== 'undefined') {
661
+ payload['expire'] = expire;
662
+ }
663
+
664
+ const uri = new URL(this.client.config.endpoint + path);
665
+ return await this.client.call('put', uri, {
666
+ 'content-type': 'application/json',
667
+ }, payload);
668
+ }
669
+
670
+ /**
671
+ * Delete Key
672
+ *
673
+ *
674
+ * @param {string} projectId
675
+ * @param {string} keyId
676
+ * @throws {AppwriteException}
677
+ * @returns {Promise}
678
+ */
679
+ async deleteKey(projectId: string, keyId: string): Promise<{}> {
680
+ if (typeof projectId === 'undefined') {
681
+ throw new AppwriteException('Missing required parameter: "projectId"');
682
+ }
683
+
684
+ if (typeof keyId === 'undefined') {
685
+ throw new AppwriteException('Missing required parameter: "keyId"');
686
+ }
687
+
688
+ let path = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
689
+ let payload: Payload = {};
690
+
691
+ const uri = new URL(this.client.config.endpoint + path);
692
+ return await this.client.call('delete', uri, {
693
+ 'content-type': 'application/json',
694
+ }, payload);
695
+ }
696
+
697
+ /**
698
+ * Update Project OAuth2
699
+ *
700
+ *
701
+ * @param {string} projectId
702
+ * @param {string} provider
703
+ * @param {string} appId
704
+ * @param {string} secret
705
+ * @param {boolean} enabled
706
+ * @throws {AppwriteException}
707
+ * @returns {Promise}
708
+ */
709
+ async updateOAuth2(projectId: string, provider: string, appId?: string, secret?: string, enabled?: boolean): Promise<Models.Project> {
710
+ if (typeof projectId === 'undefined') {
711
+ throw new AppwriteException('Missing required parameter: "projectId"');
712
+ }
713
+
714
+ if (typeof provider === 'undefined') {
715
+ throw new AppwriteException('Missing required parameter: "provider"');
716
+ }
717
+
718
+ let path = '/projects/{projectId}/oauth2'.replace('{projectId}', projectId);
719
+ let payload: Payload = {};
720
+
721
+ if (typeof provider !== 'undefined') {
722
+ payload['provider'] = provider;
723
+ }
724
+
725
+ if (typeof appId !== 'undefined') {
726
+ payload['appId'] = appId;
727
+ }
728
+
729
+ if (typeof secret !== 'undefined') {
730
+ payload['secret'] = secret;
731
+ }
732
+
733
+ if (typeof enabled !== 'undefined') {
734
+ payload['enabled'] = enabled;
735
+ }
736
+
737
+ const uri = new URL(this.client.config.endpoint + path);
738
+ return await this.client.call('patch', uri, {
739
+ 'content-type': 'application/json',
740
+ }, payload);
741
+ }
742
+
743
+ /**
744
+ * List Platforms
745
+ *
746
+ *
747
+ * @param {string} projectId
748
+ * @throws {AppwriteException}
749
+ * @returns {Promise}
750
+ */
751
+ async listPlatforms(projectId: string): Promise<Models.PlatformList> {
752
+ if (typeof projectId === 'undefined') {
753
+ throw new AppwriteException('Missing required parameter: "projectId"');
754
+ }
755
+
756
+ let path = '/projects/{projectId}/platforms'.replace('{projectId}', projectId);
757
+ let payload: Payload = {};
758
+
759
+ const uri = new URL(this.client.config.endpoint + path);
760
+ return await this.client.call('get', uri, {
761
+ 'content-type': 'application/json',
762
+ }, payload);
763
+ }
764
+
765
+ /**
766
+ * Create Platform
767
+ *
768
+ *
769
+ * @param {string} projectId
770
+ * @param {string} type
771
+ * @param {string} name
772
+ * @param {string} key
773
+ * @param {string} store
774
+ * @param {string} hostname
775
+ * @throws {AppwriteException}
776
+ * @returns {Promise}
777
+ */
778
+ async createPlatform(projectId: string, type: string, name: string, key?: string, store?: string, hostname?: string): Promise<Models.Platform> {
779
+ if (typeof projectId === 'undefined') {
780
+ throw new AppwriteException('Missing required parameter: "projectId"');
781
+ }
782
+
783
+ if (typeof type === 'undefined') {
784
+ throw new AppwriteException('Missing required parameter: "type"');
785
+ }
786
+
787
+ if (typeof name === 'undefined') {
788
+ throw new AppwriteException('Missing required parameter: "name"');
789
+ }
790
+
791
+ let path = '/projects/{projectId}/platforms'.replace('{projectId}', projectId);
792
+ let payload: Payload = {};
793
+
794
+ if (typeof type !== 'undefined') {
795
+ payload['type'] = type;
796
+ }
797
+
798
+ if (typeof name !== 'undefined') {
799
+ payload['name'] = name;
800
+ }
801
+
802
+ if (typeof key !== 'undefined') {
803
+ payload['key'] = key;
804
+ }
805
+
806
+ if (typeof store !== 'undefined') {
807
+ payload['store'] = store;
808
+ }
809
+
810
+ if (typeof hostname !== 'undefined') {
811
+ payload['hostname'] = hostname;
812
+ }
813
+
814
+ const uri = new URL(this.client.config.endpoint + path);
815
+ return await this.client.call('post', uri, {
816
+ 'content-type': 'application/json',
817
+ }, payload);
818
+ }
819
+
820
+ /**
821
+ * Get Platform
822
+ *
823
+ *
824
+ * @param {string} projectId
825
+ * @param {string} platformId
826
+ * @throws {AppwriteException}
827
+ * @returns {Promise}
828
+ */
829
+ async getPlatform(projectId: string, platformId: string): Promise<Models.Platform> {
830
+ if (typeof projectId === 'undefined') {
831
+ throw new AppwriteException('Missing required parameter: "projectId"');
832
+ }
833
+
834
+ if (typeof platformId === 'undefined') {
835
+ throw new AppwriteException('Missing required parameter: "platformId"');
836
+ }
837
+
838
+ let path = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);
839
+ let payload: Payload = {};
840
+
841
+ const uri = new URL(this.client.config.endpoint + path);
842
+ return await this.client.call('get', uri, {
843
+ 'content-type': 'application/json',
844
+ }, payload);
845
+ }
846
+
847
+ /**
848
+ * Update Platform
849
+ *
850
+ *
851
+ * @param {string} projectId
852
+ * @param {string} platformId
853
+ * @param {string} name
854
+ * @param {string} key
855
+ * @param {string} store
856
+ * @param {string} hostname
857
+ * @throws {AppwriteException}
858
+ * @returns {Promise}
859
+ */
860
+ async updatePlatform(projectId: string, platformId: string, name: string, key?: string, store?: string, hostname?: string): Promise<Models.Platform> {
861
+ if (typeof projectId === 'undefined') {
862
+ throw new AppwriteException('Missing required parameter: "projectId"');
863
+ }
864
+
865
+ if (typeof platformId === 'undefined') {
866
+ throw new AppwriteException('Missing required parameter: "platformId"');
867
+ }
868
+
869
+ if (typeof name === 'undefined') {
870
+ throw new AppwriteException('Missing required parameter: "name"');
871
+ }
872
+
873
+ let path = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);
874
+ let payload: Payload = {};
875
+
876
+ if (typeof name !== 'undefined') {
877
+ payload['name'] = name;
878
+ }
879
+
880
+ if (typeof key !== 'undefined') {
881
+ payload['key'] = key;
882
+ }
883
+
884
+ if (typeof store !== 'undefined') {
885
+ payload['store'] = store;
886
+ }
887
+
888
+ if (typeof hostname !== 'undefined') {
889
+ payload['hostname'] = hostname;
890
+ }
891
+
892
+ const uri = new URL(this.client.config.endpoint + path);
893
+ return await this.client.call('put', uri, {
894
+ 'content-type': 'application/json',
895
+ }, payload);
896
+ }
897
+
898
+ /**
899
+ * Delete Platform
900
+ *
901
+ *
902
+ * @param {string} projectId
903
+ * @param {string} platformId
904
+ * @throws {AppwriteException}
905
+ * @returns {Promise}
906
+ */
907
+ async deletePlatform(projectId: string, platformId: string): Promise<{}> {
908
+ if (typeof projectId === 'undefined') {
909
+ throw new AppwriteException('Missing required parameter: "projectId"');
910
+ }
911
+
912
+ if (typeof platformId === 'undefined') {
913
+ throw new AppwriteException('Missing required parameter: "platformId"');
914
+ }
915
+
916
+ let path = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);
917
+ let payload: Payload = {};
918
+
919
+ const uri = new URL(this.client.config.endpoint + path);
920
+ return await this.client.call('delete', uri, {
921
+ 'content-type': 'application/json',
922
+ }, payload);
923
+ }
924
+
925
+ /**
926
+ * Update service status
927
+ *
928
+ *
929
+ * @param {string} projectId
930
+ * @param {string} service
931
+ * @param {boolean} status
932
+ * @throws {AppwriteException}
933
+ * @returns {Promise}
934
+ */
935
+ async updateServiceStatus(projectId: string, service: string, status: boolean): Promise<Models.Project> {
936
+ if (typeof projectId === 'undefined') {
937
+ throw new AppwriteException('Missing required parameter: "projectId"');
938
+ }
939
+
940
+ if (typeof service === 'undefined') {
941
+ throw new AppwriteException('Missing required parameter: "service"');
942
+ }
943
+
944
+ if (typeof status === 'undefined') {
945
+ throw new AppwriteException('Missing required parameter: "status"');
946
+ }
947
+
948
+ let path = '/projects/{projectId}/service'.replace('{projectId}', projectId);
949
+ let payload: Payload = {};
950
+
951
+ if (typeof service !== 'undefined') {
952
+ payload['service'] = service;
953
+ }
954
+
955
+ if (typeof status !== 'undefined') {
956
+ payload['status'] = status;
957
+ }
958
+
959
+ const uri = new URL(this.client.config.endpoint + path);
960
+ return await this.client.call('patch', uri, {
961
+ 'content-type': 'application/json',
962
+ }, payload);
963
+ }
964
+
965
+ /**
966
+ * Get usage stats for a project
967
+ *
968
+ *
969
+ * @param {string} projectId
970
+ * @param {string} range
971
+ * @throws {AppwriteException}
972
+ * @returns {Promise}
973
+ */
974
+ async getUsage(projectId: string, range?: string): Promise<Models.UsageProject> {
975
+ if (typeof projectId === 'undefined') {
976
+ throw new AppwriteException('Missing required parameter: "projectId"');
977
+ }
978
+
979
+ let path = '/projects/{projectId}/usage'.replace('{projectId}', projectId);
980
+ let payload: Payload = {};
981
+
982
+ if (typeof range !== 'undefined') {
983
+ payload['range'] = range;
984
+ }
985
+
986
+ const uri = new URL(this.client.config.endpoint + path);
987
+ return await this.client.call('get', uri, {
988
+ 'content-type': 'application/json',
989
+ }, payload);
990
+ }
991
+
992
+ /**
993
+ * List Webhooks
994
+ *
995
+ *
996
+ * @param {string} projectId
997
+ * @throws {AppwriteException}
998
+ * @returns {Promise}
999
+ */
1000
+ async listWebhooks(projectId: string): Promise<Models.WebhookList> {
1001
+ if (typeof projectId === 'undefined') {
1002
+ throw new AppwriteException('Missing required parameter: "projectId"');
1003
+ }
1004
+
1005
+ let path = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId);
1006
+ let payload: Payload = {};
1007
+
1008
+ const uri = new URL(this.client.config.endpoint + path);
1009
+ return await this.client.call('get', uri, {
1010
+ 'content-type': 'application/json',
1011
+ }, payload);
1012
+ }
1013
+
1014
+ /**
1015
+ * Create Webhook
1016
+ *
1017
+ *
1018
+ * @param {string} projectId
1019
+ * @param {string} name
1020
+ * @param {string[]} events
1021
+ * @param {string} url
1022
+ * @param {boolean} security
1023
+ * @param {string} httpUser
1024
+ * @param {string} httpPass
1025
+ * @throws {AppwriteException}
1026
+ * @returns {Promise}
1027
+ */
1028
+ async createWebhook(projectId: string, name: string, events: string[], url: string, security: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook> {
1029
+ if (typeof projectId === 'undefined') {
1030
+ throw new AppwriteException('Missing required parameter: "projectId"');
1031
+ }
1032
+
1033
+ if (typeof name === 'undefined') {
1034
+ throw new AppwriteException('Missing required parameter: "name"');
1035
+ }
1036
+
1037
+ if (typeof events === 'undefined') {
1038
+ throw new AppwriteException('Missing required parameter: "events"');
1039
+ }
1040
+
1041
+ if (typeof url === 'undefined') {
1042
+ throw new AppwriteException('Missing required parameter: "url"');
1043
+ }
1044
+
1045
+ if (typeof security === 'undefined') {
1046
+ throw new AppwriteException('Missing required parameter: "security"');
1047
+ }
1048
+
1049
+ let path = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId);
1050
+ let payload: Payload = {};
1051
+
1052
+ if (typeof name !== 'undefined') {
1053
+ payload['name'] = name;
1054
+ }
1055
+
1056
+ if (typeof events !== 'undefined') {
1057
+ payload['events'] = events;
1058
+ }
1059
+
1060
+ if (typeof url !== 'undefined') {
1061
+ payload['url'] = url;
1062
+ }
1063
+
1064
+ if (typeof security !== 'undefined') {
1065
+ payload['security'] = security;
1066
+ }
1067
+
1068
+ if (typeof httpUser !== 'undefined') {
1069
+ payload['httpUser'] = httpUser;
1070
+ }
1071
+
1072
+ if (typeof httpPass !== 'undefined') {
1073
+ payload['httpPass'] = httpPass;
1074
+ }
1075
+
1076
+ const uri = new URL(this.client.config.endpoint + path);
1077
+ return await this.client.call('post', uri, {
1078
+ 'content-type': 'application/json',
1079
+ }, payload);
1080
+ }
1081
+
1082
+ /**
1083
+ * Get Webhook
1084
+ *
1085
+ *
1086
+ * @param {string} projectId
1087
+ * @param {string} webhookId
1088
+ * @throws {AppwriteException}
1089
+ * @returns {Promise}
1090
+ */
1091
+ async getWebhook(projectId: string, webhookId: string): Promise<Models.Webhook> {
1092
+ if (typeof projectId === 'undefined') {
1093
+ throw new AppwriteException('Missing required parameter: "projectId"');
1094
+ }
1095
+
1096
+ if (typeof webhookId === 'undefined') {
1097
+ throw new AppwriteException('Missing required parameter: "webhookId"');
1098
+ }
1099
+
1100
+ let path = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1101
+ let payload: Payload = {};
1102
+
1103
+ const uri = new URL(this.client.config.endpoint + path);
1104
+ return await this.client.call('get', uri, {
1105
+ 'content-type': 'application/json',
1106
+ }, payload);
1107
+ }
1108
+
1109
+ /**
1110
+ * Update Webhook
1111
+ *
1112
+ *
1113
+ * @param {string} projectId
1114
+ * @param {string} webhookId
1115
+ * @param {string} name
1116
+ * @param {string[]} events
1117
+ * @param {string} url
1118
+ * @param {boolean} security
1119
+ * @param {string} httpUser
1120
+ * @param {string} httpPass
1121
+ * @throws {AppwriteException}
1122
+ * @returns {Promise}
1123
+ */
1124
+ async updateWebhook(projectId: string, webhookId: string, name: string, events: string[], url: string, security: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook> {
1125
+ if (typeof projectId === 'undefined') {
1126
+ throw new AppwriteException('Missing required parameter: "projectId"');
1127
+ }
1128
+
1129
+ if (typeof webhookId === 'undefined') {
1130
+ throw new AppwriteException('Missing required parameter: "webhookId"');
1131
+ }
1132
+
1133
+ if (typeof name === 'undefined') {
1134
+ throw new AppwriteException('Missing required parameter: "name"');
1135
+ }
1136
+
1137
+ if (typeof events === 'undefined') {
1138
+ throw new AppwriteException('Missing required parameter: "events"');
1139
+ }
1140
+
1141
+ if (typeof url === 'undefined') {
1142
+ throw new AppwriteException('Missing required parameter: "url"');
1143
+ }
1144
+
1145
+ if (typeof security === 'undefined') {
1146
+ throw new AppwriteException('Missing required parameter: "security"');
1147
+ }
1148
+
1149
+ let path = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1150
+ let payload: Payload = {};
1151
+
1152
+ if (typeof name !== 'undefined') {
1153
+ payload['name'] = name;
1154
+ }
1155
+
1156
+ if (typeof events !== 'undefined') {
1157
+ payload['events'] = events;
1158
+ }
1159
+
1160
+ if (typeof url !== 'undefined') {
1161
+ payload['url'] = url;
1162
+ }
1163
+
1164
+ if (typeof security !== 'undefined') {
1165
+ payload['security'] = security;
1166
+ }
1167
+
1168
+ if (typeof httpUser !== 'undefined') {
1169
+ payload['httpUser'] = httpUser;
1170
+ }
1171
+
1172
+ if (typeof httpPass !== 'undefined') {
1173
+ payload['httpPass'] = httpPass;
1174
+ }
1175
+
1176
+ const uri = new URL(this.client.config.endpoint + path);
1177
+ return await this.client.call('put', uri, {
1178
+ 'content-type': 'application/json',
1179
+ }, payload);
1180
+ }
1181
+
1182
+ /**
1183
+ * Delete Webhook
1184
+ *
1185
+ *
1186
+ * @param {string} projectId
1187
+ * @param {string} webhookId
1188
+ * @throws {AppwriteException}
1189
+ * @returns {Promise}
1190
+ */
1191
+ async deleteWebhook(projectId: string, webhookId: string): Promise<{}> {
1192
+ if (typeof projectId === 'undefined') {
1193
+ throw new AppwriteException('Missing required parameter: "projectId"');
1194
+ }
1195
+
1196
+ if (typeof webhookId === 'undefined') {
1197
+ throw new AppwriteException('Missing required parameter: "webhookId"');
1198
+ }
1199
+
1200
+ let path = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1201
+ let payload: Payload = {};
1202
+
1203
+ const uri = new URL(this.client.config.endpoint + path);
1204
+ return await this.client.call('delete', uri, {
1205
+ 'content-type': 'application/json',
1206
+ }, payload);
1207
+ }
1208
+
1209
+ /**
1210
+ * Update Webhook Signature Key
1211
+ *
1212
+ *
1213
+ * @param {string} projectId
1214
+ * @param {string} webhookId
1215
+ * @throws {AppwriteException}
1216
+ * @returns {Promise}
1217
+ */
1218
+ async updateWebhookSignature(projectId: string, webhookId: string): Promise<Models.Webhook> {
1219
+ if (typeof projectId === 'undefined') {
1220
+ throw new AppwriteException('Missing required parameter: "projectId"');
1221
+ }
1222
+
1223
+ if (typeof webhookId === 'undefined') {
1224
+ throw new AppwriteException('Missing required parameter: "webhookId"');
1225
+ }
1226
+
1227
+ let path = '/projects/{projectId}/webhooks/{webhookId}/signature'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1228
+ let payload: Payload = {};
1229
+
1230
+ const uri = new URL(this.client.config.endpoint + path);
1231
+ return await this.client.call('patch', uri, {
1232
+ 'content-type': 'application/json',
1233
+ }, payload);
1234
+ }
1235
+ };