appwrite_openapi 1.0.0

AUTO-GENERATED client for Appwrite. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
# \StorageApi

All URIs are relative to *https://HOSTNAME/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**storage_create_bucket**](StorageApi.md#storage_create_bucket) | **POST** /storage/buckets | Create bucket
[**storage_create_file**](StorageApi.md#storage_create_file) | **POST** /storage/buckets/{bucketId}/files | Create file
[**storage_delete_bucket**](StorageApi.md#storage_delete_bucket) | **DELETE** /storage/buckets/{bucketId} | Delete bucket
[**storage_delete_file**](StorageApi.md#storage_delete_file) | **DELETE** /storage/buckets/{bucketId}/files/{fileId} | Delete File
[**storage_get_bucket**](StorageApi.md#storage_get_bucket) | **GET** /storage/buckets/{bucketId} | Get bucket
[**storage_get_file**](StorageApi.md#storage_get_file) | **GET** /storage/buckets/{bucketId}/files/{fileId} | Get file
[**storage_get_file_download**](StorageApi.md#storage_get_file_download) | **GET** /storage/buckets/{bucketId}/files/{fileId}/download | Get file for download
[**storage_get_file_preview**](StorageApi.md#storage_get_file_preview) | **GET** /storage/buckets/{bucketId}/files/{fileId}/preview | Get file preview
[**storage_get_file_view**](StorageApi.md#storage_get_file_view) | **GET** /storage/buckets/{bucketId}/files/{fileId}/view | Get file for view
[**storage_list_buckets**](StorageApi.md#storage_list_buckets) | **GET** /storage/buckets | List buckets
[**storage_list_files**](StorageApi.md#storage_list_files) | **GET** /storage/buckets/{bucketId}/files | List files
[**storage_update_bucket**](StorageApi.md#storage_update_bucket) | **PUT** /storage/buckets/{bucketId} | Update bucket
[**storage_update_file**](StorageApi.md#storage_update_file) | **PUT** /storage/buckets/{bucketId}/files/{fileId} | Update file



## storage_create_bucket

> crate::models::Bucket storage_create_bucket(payload)
Create bucket

Create a new storage bucket.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**payload** | Option<[**StorageCreateBucketRequest**](StorageCreateBucketRequest.md)> |  |  |

### Return type

[**crate::models::Bucket**](bucket.md)

### Authorization

[Project](../README.md#Project), [Key](../README.md#Key)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## storage_create_file

> std::path::PathBuf storage_create_file(bucket_id, file_id, file, permissions)
Create file

Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console.  Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.  When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.  If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally. 

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bucket_id** | **String** | Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). | [required] |
**file_id** | **String** | File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. | [required] |
**file** | **std::path::PathBuf** | Binary file. Appwrite SDKs provide helpers to handle file input. [Learn about file input](https://appwrite.io/docs/storage#file-input). | [required] |
**permissions** | Option<[**Vec<String>**](String.md)> | An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). |  |

### Return type

[**std::path::PathBuf**](std::path::PathBuf.md)

### Authorization

[Project](../README.md#Project), [JWT](../README.md#JWT), [Key](../README.md#Key)

### HTTP request headers

- **Content-Type**: multipart/form-data
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## storage_delete_bucket

> storage_delete_bucket(bucket_id)
Delete bucket

Delete a storage bucket by its unique ID.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bucket_id** | **String** | Bucket unique ID. | [required] |

### Return type

 (empty response body)

### Authorization

[Project](../README.md#Project), [Key](../README.md#Key)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## storage_delete_file

> storage_delete_file(bucket_id, file_id)
Delete File

Delete a file by its unique ID. Only users with write permissions have access to delete this resource.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bucket_id** | **String** | Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). | [required] |
**file_id** | **String** | File ID. | [required] |

### Return type

 (empty response body)

### Authorization

[Project](../README.md#Project), [JWT](../README.md#JWT), [Key](../README.md#Key)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## storage_get_bucket

> crate::models::Bucket storage_get_bucket(bucket_id)
Get bucket

Get a storage bucket by its unique ID. This endpoint response returns a JSON object with the storage bucket metadata.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bucket_id** | **String** | Bucket unique ID. | [required] |

### Return type

[**crate::models::Bucket**](bucket.md)

### Authorization

[Project](../README.md#Project), [Key](../README.md#Key)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## storage_get_file

> std::path::PathBuf storage_get_file(bucket_id, file_id)
Get file

Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bucket_id** | **String** | Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). | [required] |
**file_id** | **String** | File ID. | [required] |

### Return type

[**std::path::PathBuf**](std::path::PathBuf.md)

### Authorization

[Project](../README.md#Project), [JWT](../README.md#JWT), [Key](../README.md#Key)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## storage_get_file_download

> std::path::PathBuf storage_get_file_download(bucket_id, file_id)
Get file for download

Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bucket_id** | **String** | Storage bucket ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). | [required] |
**file_id** | **String** | File ID. | [required] |

### Return type

[**std::path::PathBuf**](std::path::PathBuf.md)

### Authorization

[Project](../README.md#Project), [JWT](../README.md#JWT), [Key](../README.md#Key)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: */*

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## storage_get_file_preview

> std::path::PathBuf storage_get_file_preview(bucket_id, file_id, width, height, gravity, quality, border_width, border_color, border_radius, opacity, rotation, background, output)
Get file preview

Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bucket_id** | **String** | Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). | [required] |
**file_id** | **String** | File ID | [required] |
**width** | Option<**i32**> | Resize preview image width, Pass an integer between 0 to 4000. |  |[default to 0]
**height** | Option<**i32**> | Resize preview image height, Pass an integer between 0 to 4000. |  |[default to 0]
**gravity** | Option<**String**> | Image crop gravity. Can be one of center,top-left,top,top-right,left,right,bottom-left,bottom,bottom-right |  |[default to center]
**quality** | Option<**i32**> | Preview image quality. Pass an integer between 0 to 100. Defaults to 100. |  |[default to 100]
**border_width** | Option<**i32**> | Preview image border in pixels. Pass an integer between 0 to 100. Defaults to 0. |  |[default to 0]
**border_color** | Option<**String**> | Preview image border color. Use a valid HEX color, no # is needed for prefix. |  |
**border_radius** | Option<**i32**> | Preview image border radius in pixels. Pass an integer between 0 to 4000. |  |[default to 0]
**opacity** | Option<**f32**> | Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1. |  |[default to 1.0]
**rotation** | Option<**i32**> | Preview image rotation in degrees. Pass an integer between -360 and 360. |  |[default to 0]
**background** | Option<**String**> | Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix. |  |
**output** | Option<**String**> | Output format type (jpeg, jpg, png, gif and webp). |  |

### Return type

[**std::path::PathBuf**](std::path::PathBuf.md)

### Authorization

[Project](../README.md#Project), [JWT](../README.md#JWT), [Key](../README.md#Key)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: image/*

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## storage_get_file_view

> std::path::PathBuf storage_get_file_view(bucket_id, file_id)
Get file for view

Get a file content by its unique ID. This endpoint is similar to the download method but returns with no  'Content-Disposition: attachment' header.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bucket_id** | **String** | Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). | [required] |
**file_id** | **String** | File ID. | [required] |

### Return type

[**std::path::PathBuf**](std::path::PathBuf.md)

### Authorization

[Project](../README.md#Project), [JWT](../README.md#JWT), [Key](../README.md#Key)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: */*

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## storage_list_buckets

> crate::models::BucketList storage_list_buckets(queries, search)
List buckets

Get a list of all the storage buckets. You can use the query params to filter your results.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**queries** | Option<[**Vec<String>**](String.md)> | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus |  |[default to []]
**search** | Option<**String**> | Search term to filter your list results. Max length: 256 chars. |  |

### Return type

[**crate::models::BucketList**](bucketList.md)

### Authorization

[Project](../README.md#Project), [Key](../README.md#Key)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## storage_list_files

> crate::models::FileList storage_list_files(bucket_id, queries, search)
List files

Get a list of all the user files. You can use the query params to filter your results.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bucket_id** | **String** | Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). | [required] |
**queries** | Option<[**Vec<String>**](String.md)> | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded |  |[default to []]
**search** | Option<**String**> | Search term to filter your list results. Max length: 256 chars. |  |

### Return type

[**crate::models::FileList**](fileList.md)

### Authorization

[Project](../README.md#Project), [JWT](../README.md#JWT), [Key](../README.md#Key)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## storage_update_bucket

> crate::models::Bucket storage_update_bucket(bucket_id, payload)
Update bucket

Update a storage bucket by its unique ID.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bucket_id** | **String** | Bucket unique ID. | [required] |
**payload** | Option<[**StorageUpdateBucketRequest**](StorageUpdateBucketRequest.md)> |  |  |

### Return type

[**crate::models::Bucket**](bucket.md)

### Authorization

[Project](../README.md#Project), [Key](../README.md#Key)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## storage_update_file

> std::path::PathBuf storage_update_file(bucket_id, file_id, payload)
Update file

Update a file by its unique ID. Only users with write permissions have access to update this resource.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bucket_id** | **String** | Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). | [required] |
**file_id** | **String** | File unique ID. | [required] |
**payload** | Option<[**StorageUpdateFileRequest**](StorageUpdateFileRequest.md)> |  |  |

### Return type

[**std::path::PathBuf**](std::path::PathBuf.md)

### Authorization

[Project](../README.md#Project), [JWT](../README.md#JWT), [Key](../README.md#Key)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)