@spaciv/sdk 0.1.19 → 0.1.21

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 (73) hide show
  1. package/.openapi-generator/FILES +8 -0
  2. package/README.md +2 -2
  3. package/dist/apis/FilesApi.d.ts +132 -18
  4. package/dist/apis/FilesApi.js +175 -8
  5. package/dist/apis/ScriptsApi.d.ts +57 -1
  6. package/dist/apis/ScriptsApi.js +82 -0
  7. package/dist/esm/apis/FilesApi.d.ts +132 -18
  8. package/dist/esm/apis/FilesApi.js +176 -9
  9. package/dist/esm/apis/ScriptsApi.d.ts +57 -1
  10. package/dist/esm/apis/ScriptsApi.js +83 -1
  11. package/dist/esm/models/AccountDirectoryPatchBody.d.ts +38 -0
  12. package/dist/esm/models/AccountDirectoryPatchBody.js +43 -0
  13. package/dist/esm/models/AccountDirectoryPostBody.d.ts +38 -0
  14. package/dist/esm/models/AccountDirectoryPostBody.js +45 -0
  15. package/dist/esm/models/AccountFilePatchBody.d.ts +8 -2
  16. package/dist/esm/models/AccountFilePatchBody.js +3 -3
  17. package/dist/esm/models/Directory.d.ts +56 -0
  18. package/dist/esm/models/Directory.js +57 -0
  19. package/dist/esm/models/DirectoryPage.d.ts +39 -0
  20. package/dist/esm/models/DirectoryPage.js +46 -0
  21. package/dist/esm/models/ListPage.d.ts +7 -0
  22. package/dist/esm/models/ListPage.js +3 -0
  23. package/dist/esm/models/ModelRecord.d.ts +7 -1
  24. package/dist/esm/models/ModelRecord.js +2 -0
  25. package/dist/esm/models/ScratchpadOutput.d.ts +69 -0
  26. package/dist/esm/models/ScratchpadOutput.js +64 -0
  27. package/dist/esm/models/ScratchpadOutputFile.d.ts +44 -0
  28. package/dist/esm/models/ScratchpadOutputFile.js +49 -0
  29. package/dist/esm/models/ScratchpadRun.d.ts +127 -0
  30. package/dist/esm/models/ScratchpadRun.js +91 -0
  31. package/dist/esm/models/ScratchpadRunPostReqBody.d.ts +58 -0
  32. package/dist/esm/models/ScratchpadRunPostReqBody.js +53 -0
  33. package/dist/esm/models/index.d.ts +8 -0
  34. package/dist/esm/models/index.js +8 -0
  35. package/dist/models/AccountDirectoryPatchBody.d.ts +38 -0
  36. package/dist/models/AccountDirectoryPatchBody.js +50 -0
  37. package/dist/models/AccountDirectoryPostBody.d.ts +38 -0
  38. package/dist/models/AccountDirectoryPostBody.js +52 -0
  39. package/dist/models/AccountFilePatchBody.d.ts +8 -2
  40. package/dist/models/AccountFilePatchBody.js +3 -3
  41. package/dist/models/Directory.d.ts +56 -0
  42. package/dist/models/Directory.js +64 -0
  43. package/dist/models/DirectoryPage.d.ts +39 -0
  44. package/dist/models/DirectoryPage.js +53 -0
  45. package/dist/models/ListPage.d.ts +7 -0
  46. package/dist/models/ListPage.js +3 -0
  47. package/dist/models/ModelRecord.d.ts +7 -1
  48. package/dist/models/ModelRecord.js +2 -0
  49. package/dist/models/ScratchpadOutput.d.ts +69 -0
  50. package/dist/models/ScratchpadOutput.js +71 -0
  51. package/dist/models/ScratchpadOutputFile.d.ts +44 -0
  52. package/dist/models/ScratchpadOutputFile.js +56 -0
  53. package/dist/models/ScratchpadRun.d.ts +127 -0
  54. package/dist/models/ScratchpadRun.js +99 -0
  55. package/dist/models/ScratchpadRunPostReqBody.d.ts +58 -0
  56. package/dist/models/ScratchpadRunPostReqBody.js +60 -0
  57. package/dist/models/index.d.ts +8 -0
  58. package/dist/models/index.js +8 -0
  59. package/package.json +1 -1
  60. package/src/apis/FilesApi.ts +319 -17
  61. package/src/apis/ScriptsApi.ts +148 -0
  62. package/src/models/AccountDirectoryPatchBody.ts +73 -0
  63. package/src/models/AccountDirectoryPostBody.ts +74 -0
  64. package/src/models/AccountFilePatchBody.ts +11 -4
  65. package/src/models/Directory.ts +101 -0
  66. package/src/models/DirectoryPage.ts +82 -0
  67. package/src/models/ListPage.ts +15 -0
  68. package/src/models/ModelRecord.ts +9 -1
  69. package/src/models/ScratchpadOutput.ts +126 -0
  70. package/src/models/ScratchpadOutputFile.ts +83 -0
  71. package/src/models/ScratchpadRun.ts +203 -0
  72. package/src/models/ScratchpadRunPostReqBody.ts +99 -0
  73. package/src/models/index.ts +8 -0
@@ -15,14 +15,26 @@
15
15
 
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
+ AccountDirectoryPatchBody,
19
+ AccountDirectoryPostBody,
18
20
  AccountFilePatchBody,
21
+ Directory,
22
+ DirectoryPage,
19
23
  ErrorModel,
20
24
  ListPage,
21
25
  ModelRecord,
22
26
  } from '../models/index';
23
27
  import {
28
+ AccountDirectoryPatchBodyFromJSON,
29
+ AccountDirectoryPatchBodyToJSON,
30
+ AccountDirectoryPostBodyFromJSON,
31
+ AccountDirectoryPostBodyToJSON,
24
32
  AccountFilePatchBodyFromJSON,
25
33
  AccountFilePatchBodyToJSON,
34
+ DirectoryFromJSON,
35
+ DirectoryToJSON,
36
+ DirectoryPageFromJSON,
37
+ DirectoryPageToJSON,
26
38
  ErrorModelFromJSON,
27
39
  ErrorModelToJSON,
28
40
  ListPageFromJSON,
@@ -31,11 +43,19 @@ import {
31
43
  ModelRecordToJSON,
32
44
  } from '../models/index';
33
45
 
46
+ export interface FilesApiCreateAccountDirectoriesRequest {
47
+ accountDirectoryPostBody: AccountDirectoryPostBody;
48
+ }
49
+
34
50
  export interface FilesApiCreateAccountFilesRequest {
35
51
  filename?: Blob;
36
52
  name?: string;
37
53
  }
38
54
 
55
+ export interface FilesApiDeleteAccountDirectoriesRequest {
56
+ id: string;
57
+ }
58
+
39
59
  export interface FilesApiDeleteAccountFilesRequest {
40
60
  id: string;
41
61
  }
@@ -44,9 +64,20 @@ export interface FilesApiGetAccountFilesContentRequest {
44
64
  id: string;
45
65
  }
46
66
 
67
+ export interface FilesApiListAccountDirectoriesRequest {
68
+ limit?: number;
69
+ cursor?: string;
70
+ }
71
+
47
72
  export interface FilesApiListAccountFilesRequest {
48
73
  limit?: number;
49
74
  cursor?: string;
75
+ parent?: string;
76
+ }
77
+
78
+ export interface FilesApiUpdateAccountDirectoriesRequest {
79
+ id: string;
80
+ accountDirectoryPatchBody: AccountDirectoryPatchBody;
50
81
  }
51
82
 
52
83
  export interface FilesApiUpdateAccountFilesRequest {
@@ -69,7 +100,23 @@ export interface FilesApiUpdateAccountFilesContentRequest {
69
100
  */
70
101
  export interface FilesApiInterface {
71
102
  /**
72
- * Stores a file against the account and returns the record describing it. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name becomes the record\'s `name`, so it must be non-empty, at most 255 bytes and free of `/` and `\\`. Any media type is accepted; `mimeType` is detected from the file\'s contents rather than from its name or the type the client declared. Maximum file size is 25 MiB, and uploads are rejected if a virus scan fails. The files stored against an account may total at most 1 GiB. An upload that would take the account past that is rejected with 413 and no file is added to the account, though the uploaded bytes may briefly remain in storage until they are cleaned up; deleting files frees their space. A 409 means concurrent uploads kept changing the account\'s usage, and the upload can be retried as it stands. The response body is the same record shape the list operation returns, so a client can add it to a list it already holds instead of refetching. Requires the *Edit file storage* permission.
103
+ * Creates a directory to organise the files stored against the account, at the root or inside another directory, and returns it. Directories can be nested at most 8 deep. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly: a name already taken there by a file or a directory is rejected with 409. Returns 404 if the account has no directory with the given `parentId`. A directory takes up none of the account\'s storage quota. Requires the *Edit file storage* permission.
104
+ * @summary Create a directory in the account\'s files
105
+ * @param {AccountDirectoryPostBody} accountDirectoryPostBody
106
+ * @param {*} [options] Override http request option.
107
+ * @throws {RequiredError}
108
+ * @memberof FilesApiInterface
109
+ */
110
+ createAccountDirectoriesRaw(requestParameters: FilesApiCreateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Directory>>;
111
+
112
+ /**
113
+ * Creates a directory to organise the files stored against the account, at the root or inside another directory, and returns it. Directories can be nested at most 8 deep. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly: a name already taken there by a file or a directory is rejected with 409. Returns 404 if the account has no directory with the given `parentId`. A directory takes up none of the account\'s storage quota. Requires the *Edit file storage* permission.
114
+ * Create a directory in the account\'s files
115
+ */
116
+ createAccountDirectories(requestParameters: FilesApiCreateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Directory>;
117
+
118
+ /**
119
+ * Stores a file against the account and returns the record describing it. Send the request as `multipart/form-data` with a single file field named `file`, and optionally a `parentId` field naming the directory to store it in; without one the file goes in the root, and a `parentId` the account has no directory for is rejected with 404. The uploaded file\'s name, normalised to Unicode NFC, becomes the record\'s `name`, so it must be non-empty and free of `/` and `\\`; a name over 255 bytes is shortened to fit, keeping its extension. Names are unique within a directory among its files and directories, compared exactly, so `Report.pdf` and `report.pdf` can sit side by side: when the name is already taken there, the file is stored under the lowest free numbered name instead, such as `image (2).png`, with the number before the extension, and the response\'s `name` is the name it was stored under. Any media type is accepted; `mimeType` is detected from the file\'s contents rather than from its name or the type the client declared. Maximum file size is 25 MiB, and uploads are rejected if a virus scan fails. The files stored against an account may total at most 1 GiB. An upload that would take the account past that is rejected with 413 and no file is added to the account, though the uploaded bytes may briefly remain in storage until they are cleaned up; deleting files frees their space. A 409 means concurrent uploads kept changing the account\'s usage or taking the names it tried, and the upload can be retried as it stands. The response body is the same record shape the list operation returns, so a client can add it to a list it already holds instead of refetching. Requires the *Edit file storage* permission.
73
120
  * @summary Upload a file to the account
74
121
  * @param {Blob} [filename] filename of the file being uploaded
75
122
  * @param {string} [name] general purpose name for multipart form value
@@ -80,11 +127,27 @@ export interface FilesApiInterface {
80
127
  createAccountFilesRaw(requestParameters: FilesApiCreateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>>;
81
128
 
82
129
  /**
83
- * Stores a file against the account and returns the record describing it. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name becomes the record\'s `name`, so it must be non-empty, at most 255 bytes and free of `/` and `\\`. Any media type is accepted; `mimeType` is detected from the file\'s contents rather than from its name or the type the client declared. Maximum file size is 25 MiB, and uploads are rejected if a virus scan fails. The files stored against an account may total at most 1 GiB. An upload that would take the account past that is rejected with 413 and no file is added to the account, though the uploaded bytes may briefly remain in storage until they are cleaned up; deleting files frees their space. A 409 means concurrent uploads kept changing the account\'s usage, and the upload can be retried as it stands. The response body is the same record shape the list operation returns, so a client can add it to a list it already holds instead of refetching. Requires the *Edit file storage* permission.
130
+ * Stores a file against the account and returns the record describing it. Send the request as `multipart/form-data` with a single file field named `file`, and optionally a `parentId` field naming the directory to store it in; without one the file goes in the root, and a `parentId` the account has no directory for is rejected with 404. The uploaded file\'s name, normalised to Unicode NFC, becomes the record\'s `name`, so it must be non-empty and free of `/` and `\\`; a name over 255 bytes is shortened to fit, keeping its extension. Names are unique within a directory among its files and directories, compared exactly, so `Report.pdf` and `report.pdf` can sit side by side: when the name is already taken there, the file is stored under the lowest free numbered name instead, such as `image (2).png`, with the number before the extension, and the response\'s `name` is the name it was stored under. Any media type is accepted; `mimeType` is detected from the file\'s contents rather than from its name or the type the client declared. Maximum file size is 25 MiB, and uploads are rejected if a virus scan fails. The files stored against an account may total at most 1 GiB. An upload that would take the account past that is rejected with 413 and no file is added to the account, though the uploaded bytes may briefly remain in storage until they are cleaned up; deleting files frees their space. A 409 means concurrent uploads kept changing the account\'s usage or taking the names it tried, and the upload can be retried as it stands. The response body is the same record shape the list operation returns, so a client can add it to a list it already holds instead of refetching. Requires the *Edit file storage* permission.
84
131
  * Upload a file to the account
85
132
  */
86
133
  createAccountFiles(requestParameters: FilesApiCreateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
87
134
 
135
+ /**
136
+ * Deletes an empty directory from the account\'s files. A directory that still holds a file or another directory is rejected with 409 `directory is not empty`: move or delete its contents first. Deleting a directory that is already gone succeeds rather than returning 404. Any other 409 means the directory changed during the request, and the request can be retried. Requires the *Edit file storage* permission.
137
+ * @summary Delete a directory
138
+ * @param {string} id
139
+ * @param {*} [options] Override http request option.
140
+ * @throws {RequiredError}
141
+ * @memberof FilesApiInterface
142
+ */
143
+ deleteAccountDirectoriesRaw(requestParameters: FilesApiDeleteAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>>;
144
+
145
+ /**
146
+ * Deletes an empty directory from the account\'s files. A directory that still holds a file or another directory is rejected with 409 `directory is not empty`: move or delete its contents first. Deleting a directory that is already gone succeeds rather than returning 404. Any other 409 means the directory changed during the request, and the request can be retried. Requires the *Edit file storage* permission.
147
+ * Delete a directory
148
+ */
149
+ deleteAccountDirectories(requestParameters: FilesApiDeleteAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
150
+
88
151
  /**
89
152
  * Permanently deletes a file stored against the account, removing both its record and its stored content. This cannot be undone and any link to the file stops working. The file\'s size stops counting towards the account\'s 1 GiB storage quota once its record is removed. The record is removed before the content, so a request that fails partway can leave the stored content behind; repeating the same request is what clears it. Deleting a file that is already gone succeeds rather than returning 404, so a failed delete should always be retried; that includes a 409, which means concurrent changes to the account\'s files kept changing its storage usage during the request. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400. Requires the *Edit file storage* permission.
90
153
  * @summary Delete an account file
@@ -118,10 +181,28 @@ export interface FilesApiInterface {
118
181
  getAccountFilesContent(requestParameters: FilesApiGetAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
119
182
 
120
183
  /**
121
- * Returns a page of the files stored against the account, most recently uploaded first. Files belonging to other accounts are never returned. When `nextCursor` is present there are more files to fetch; pass it back as `cursor` to retrieve the following page. A page may come back shorter than `limit` while still having a `nextCursor`. A file that has just been uploaded may not appear here immediately, so clients should add the record returned by the upload operation to their list rather than refetching. Requires the *View file storage* permission.
184
+ * Returns a page of every directory in the account\'s files, at any depth, in the order they were created. Each directory gives its parent\'s identifier, so a client that fetches every page can build the whole tree. To list what is inside one directory, list the account\'s files with `parent` instead. When `nextCursor` is present there are more directories to fetch; pass it back as `cursor` to retrieve the following page. Requires the *View file storage* permission.
185
+ * @summary List the account\'s directories
186
+ * @param {number} [limit] Maximum number of directories to return in this page.
187
+ * @param {string} [cursor] Opaque pagination cursor returned as nextCursor by a previous response. A cursor is only valid for the account it was issued to.
188
+ * @param {*} [options] Override http request option.
189
+ * @throws {RequiredError}
190
+ * @memberof FilesApiInterface
191
+ */
192
+ listAccountDirectoriesRaw(requestParameters: FilesApiListAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DirectoryPage>>;
193
+
194
+ /**
195
+ * Returns a page of every directory in the account\'s files, at any depth, in the order they were created. Each directory gives its parent\'s identifier, so a client that fetches every page can build the whole tree. To list what is inside one directory, list the account\'s files with `parent` instead. When `nextCursor` is present there are more directories to fetch; pass it back as `cursor` to retrieve the following page. Requires the *View file storage* permission.
196
+ * List the account\'s directories
197
+ */
198
+ listAccountDirectories(requestParameters: FilesApiListAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DirectoryPage>;
199
+
200
+ /**
201
+ * Without `parent`, returns a page of every file stored against the account, whatever directory it is in, most recently uploaded first. Files belonging to other accounts are never returned. With `parent`, returns a page of what is directly inside that directory, or inside the root when `parent` is `root`: its directories in `directories`, most recently created first, then its files in `files`, most recently uploaded first. Returns 404 if the account has no directory with that identifier. When `nextCursor` is present there are more items to fetch; pass it back as `cursor`, with the same `parent`, to retrieve the following page. A page may come back shorter than `limit` while still having a `nextCursor`. A file that has just been uploaded, moved or renamed may not show its change here immediately, so clients should apply the record returned by the upload or update operation to their list rather than refetching. Requires the *View file storage* permission.
122
202
  * @summary List the account\'s files
123
203
  * @param {number} [limit] Maximum number of files to return in this page.
124
- * @param {string} [cursor] Opaque pagination cursor returned as nextCursor by a previous response. A cursor is only valid for the account it was issued to.
204
+ * @param {string} [cursor] Opaque pagination cursor returned as nextCursor by a previous response. A cursor is only valid for the account, and the parent, it was issued for.
205
+ * @param {string} [parent] List only what is directly inside this directory: a directory identifier, or root for the root. Leave it out to list every file of the account, whatever directory it is in.
125
206
  * @param {*} [options] Override http request option.
126
207
  * @throws {RequiredError}
127
208
  * @memberof FilesApiInterface
@@ -129,14 +210,31 @@ export interface FilesApiInterface {
129
210
  listAccountFilesRaw(requestParameters: FilesApiListAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListPage>>;
130
211
 
131
212
  /**
132
- * Returns a page of the files stored against the account, most recently uploaded first. Files belonging to other accounts are never returned. When `nextCursor` is present there are more files to fetch; pass it back as `cursor` to retrieve the following page. A page may come back shorter than `limit` while still having a `nextCursor`. A file that has just been uploaded may not appear here immediately, so clients should add the record returned by the upload operation to their list rather than refetching. Requires the *View file storage* permission.
213
+ * Without `parent`, returns a page of every file stored against the account, whatever directory it is in, most recently uploaded first. Files belonging to other accounts are never returned. With `parent`, returns a page of what is directly inside that directory, or inside the root when `parent` is `root`: its directories in `directories`, most recently created first, then its files in `files`, most recently uploaded first. Returns 404 if the account has no directory with that identifier. When `nextCursor` is present there are more items to fetch; pass it back as `cursor`, with the same `parent`, to retrieve the following page. A page may come back shorter than `limit` while still having a `nextCursor`. A file that has just been uploaded, moved or renamed may not show its change here immediately, so clients should apply the record returned by the upload or update operation to their list rather than refetching. Requires the *View file storage* permission.
133
214
  * List the account\'s files
134
215
  */
135
216
  listAccountFiles(requestParameters: FilesApiListAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListPage>;
136
217
 
137
218
  /**
138
- * Changes the display name of a file stored against the account and returns the updated record. Only the name changes: the stored content, media type, size and identifier are untouched, so anything already referencing the file keeps working. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400. Returns 404 if the account has no file with this identifier. Requires the *Edit file storage* permission.
139
- * @summary Rename an account file
219
+ * Changes a directory\'s name, moves it into another directory, or both, and returns the updated directory. Give `name`, `parentId` or both; a body with neither is rejected with 400. Everything inside the directory moves with it and keeps its identifier, so anything referencing those files keeps working. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly: a name already taken in the destination by a file or another directory, whether by a rename or a move, is rejected with 409. Moving a directory into itself or into a directory inside it, or so that something inside it would be nested more than 8 deep, is rejected with 400. Returns 404 if the account has no directory with this identifier, or none with the given `parentId`. Any other 409 means the account\'s directories changed during the request, and the request can be retried. Requires the *Edit file storage* permission.
220
+ * @summary Rename or move a directory
221
+ * @param {string} id
222
+ * @param {AccountDirectoryPatchBody} accountDirectoryPatchBody
223
+ * @param {*} [options] Override http request option.
224
+ * @throws {RequiredError}
225
+ * @memberof FilesApiInterface
226
+ */
227
+ updateAccountDirectoriesRaw(requestParameters: FilesApiUpdateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Directory>>;
228
+
229
+ /**
230
+ * Changes a directory\'s name, moves it into another directory, or both, and returns the updated directory. Give `name`, `parentId` or both; a body with neither is rejected with 400. Everything inside the directory moves with it and keeps its identifier, so anything referencing those files keeps working. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly: a name already taken in the destination by a file or another directory, whether by a rename or a move, is rejected with 409. Moving a directory into itself or into a directory inside it, or so that something inside it would be nested more than 8 deep, is rejected with 400. Returns 404 if the account has no directory with this identifier, or none with the given `parentId`. Any other 409 means the account\'s directories changed during the request, and the request can be retried. Requires the *Edit file storage* permission.
231
+ * Rename or move a directory
232
+ */
233
+ updateAccountDirectories(requestParameters: FilesApiUpdateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Directory>;
234
+
235
+ /**
236
+ * Changes the display name of a file stored against the account, moves it into another directory, or both, and returns the updated record. Give `name`, `parentId` or both; a body with neither is rejected with 400. Only the name and directory change: the stored content, media type, size and identifier are untouched, so anything already referencing the file keeps working. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly. Giving a `name` already taken in the destination is rejected with 409. A move that gives only `parentId` never fails for its name: if the file\'s name is taken in the destination, it is stored under the lowest free numbered name instead, such as `lease (2).pdf`, and a name normalising makes longer than 255 bytes is shortened to fit; the response\'s `name` is the name it now has. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400. Returns 404 if the account has no file with this identifier, or no directory with the given `parentId`. Any other 409 means the file was moved by another request at the same time, and the request can be retried. Requires the *Edit file storage* permission.
237
+ * @summary Rename or move an account file
140
238
  * @param {string} id
141
239
  * @param {AccountFilePatchBody} accountFilePatchBody
142
240
  * @param {*} [options] Override http request option.
@@ -146,8 +244,8 @@ export interface FilesApiInterface {
146
244
  updateAccountFilesRaw(requestParameters: FilesApiUpdateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>>;
147
245
 
148
246
  /**
149
- * Changes the display name of a file stored against the account and returns the updated record. Only the name changes: the stored content, media type, size and identifier are untouched, so anything already referencing the file keeps working. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400. Returns 404 if the account has no file with this identifier. Requires the *Edit file storage* permission.
150
- * Rename an account file
247
+ * Changes the display name of a file stored against the account, moves it into another directory, or both, and returns the updated record. Give `name`, `parentId` or both; a body with neither is rejected with 400. Only the name and directory change: the stored content, media type, size and identifier are untouched, so anything already referencing the file keeps working. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly. Giving a `name` already taken in the destination is rejected with 409. A move that gives only `parentId` never fails for its name: if the file\'s name is taken in the destination, it is stored under the lowest free numbered name instead, such as `lease (2).pdf`, and a name normalising makes longer than 255 bytes is shortened to fit; the response\'s `name` is the name it now has. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400. Returns 404 if the account has no file with this identifier, or no directory with the given `parentId`. Any other 409 means the file was moved by another request at the same time, and the request can be retried. Requires the *Edit file storage* permission.
248
+ * Rename or move an account file
151
249
  */
152
250
  updateAccountFiles(requestParameters: FilesApiUpdateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
153
251
 
@@ -178,7 +276,56 @@ export interface FilesApiInterface {
178
276
  export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
179
277
 
180
278
  /**
181
- * Stores a file against the account and returns the record describing it. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name becomes the record\'s `name`, so it must be non-empty, at most 255 bytes and free of `/` and `\\`. Any media type is accepted; `mimeType` is detected from the file\'s contents rather than from its name or the type the client declared. Maximum file size is 25 MiB, and uploads are rejected if a virus scan fails. The files stored against an account may total at most 1 GiB. An upload that would take the account past that is rejected with 413 and no file is added to the account, though the uploaded bytes may briefly remain in storage until they are cleaned up; deleting files frees their space. A 409 means concurrent uploads kept changing the account\'s usage, and the upload can be retried as it stands. The response body is the same record shape the list operation returns, so a client can add it to a list it already holds instead of refetching. Requires the *Edit file storage* permission.
279
+ * Creates a directory to organise the files stored against the account, at the root or inside another directory, and returns it. Directories can be nested at most 8 deep. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly: a name already taken there by a file or a directory is rejected with 409. Returns 404 if the account has no directory with the given `parentId`. A directory takes up none of the account\'s storage quota. Requires the *Edit file storage* permission.
280
+ * Create a directory in the account\'s files
281
+ */
282
+ async createAccountDirectoriesRaw(requestParameters: FilesApiCreateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Directory>> {
283
+ if (requestParameters['accountDirectoryPostBody'] == null) {
284
+ throw new runtime.RequiredError(
285
+ 'accountDirectoryPostBody',
286
+ 'Required parameter "accountDirectoryPostBody" was null or undefined when calling createAccountDirectories().'
287
+ );
288
+ }
289
+
290
+ const queryParameters: any = {};
291
+
292
+ const headerParameters: runtime.HTTPHeaders = {};
293
+
294
+ headerParameters['Content-Type'] = 'application/json';
295
+
296
+ if (this.configuration && this.configuration.accessToken) {
297
+ const token = this.configuration.accessToken;
298
+ const tokenString = await token("accessToken", []);
299
+
300
+ if (tokenString) {
301
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
302
+ }
303
+ }
304
+
305
+ let urlPath = `/v1/account/directories`;
306
+
307
+ const response = await this.request({
308
+ path: urlPath,
309
+ method: 'POST',
310
+ headers: headerParameters,
311
+ query: queryParameters,
312
+ body: AccountDirectoryPostBodyToJSON(requestParameters['accountDirectoryPostBody']),
313
+ }, initOverrides);
314
+
315
+ return new runtime.JSONApiResponse(response, (jsonValue) => DirectoryFromJSON(jsonValue));
316
+ }
317
+
318
+ /**
319
+ * Creates a directory to organise the files stored against the account, at the root or inside another directory, and returns it. Directories can be nested at most 8 deep. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly: a name already taken there by a file or a directory is rejected with 409. Returns 404 if the account has no directory with the given `parentId`. A directory takes up none of the account\'s storage quota. Requires the *Edit file storage* permission.
320
+ * Create a directory in the account\'s files
321
+ */
322
+ async createAccountDirectories(requestParameters: FilesApiCreateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Directory> {
323
+ const response = await this.createAccountDirectoriesRaw(requestParameters, initOverrides);
324
+ return await response.value();
325
+ }
326
+
327
+ /**
328
+ * Stores a file against the account and returns the record describing it. Send the request as `multipart/form-data` with a single file field named `file`, and optionally a `parentId` field naming the directory to store it in; without one the file goes in the root, and a `parentId` the account has no directory for is rejected with 404. The uploaded file\'s name, normalised to Unicode NFC, becomes the record\'s `name`, so it must be non-empty and free of `/` and `\\`; a name over 255 bytes is shortened to fit, keeping its extension. Names are unique within a directory among its files and directories, compared exactly, so `Report.pdf` and `report.pdf` can sit side by side: when the name is already taken there, the file is stored under the lowest free numbered name instead, such as `image (2).png`, with the number before the extension, and the response\'s `name` is the name it was stored under. Any media type is accepted; `mimeType` is detected from the file\'s contents rather than from its name or the type the client declared. Maximum file size is 25 MiB, and uploads are rejected if a virus scan fails. The files stored against an account may total at most 1 GiB. An upload that would take the account past that is rejected with 413 and no file is added to the account, though the uploaded bytes may briefly remain in storage until they are cleaned up; deleting files frees their space. A 409 means concurrent uploads kept changing the account\'s usage or taking the names it tried, and the upload can be retried as it stands. The response body is the same record shape the list operation returns, so a client can add it to a list it already holds instead of refetching. Requires the *Edit file storage* permission.
182
329
  * Upload a file to the account
183
330
  */
184
331
  async createAccountFilesRaw(requestParameters: FilesApiCreateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>> {
@@ -233,7 +380,7 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
233
380
  }
234
381
 
235
382
  /**
236
- * Stores a file against the account and returns the record describing it. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name becomes the record\'s `name`, so it must be non-empty, at most 255 bytes and free of `/` and `\\`. Any media type is accepted; `mimeType` is detected from the file\'s contents rather than from its name or the type the client declared. Maximum file size is 25 MiB, and uploads are rejected if a virus scan fails. The files stored against an account may total at most 1 GiB. An upload that would take the account past that is rejected with 413 and no file is added to the account, though the uploaded bytes may briefly remain in storage until they are cleaned up; deleting files frees their space. A 409 means concurrent uploads kept changing the account\'s usage, and the upload can be retried as it stands. The response body is the same record shape the list operation returns, so a client can add it to a list it already holds instead of refetching. Requires the *Edit file storage* permission.
383
+ * Stores a file against the account and returns the record describing it. Send the request as `multipart/form-data` with a single file field named `file`, and optionally a `parentId` field naming the directory to store it in; without one the file goes in the root, and a `parentId` the account has no directory for is rejected with 404. The uploaded file\'s name, normalised to Unicode NFC, becomes the record\'s `name`, so it must be non-empty and free of `/` and `\\`; a name over 255 bytes is shortened to fit, keeping its extension. Names are unique within a directory among its files and directories, compared exactly, so `Report.pdf` and `report.pdf` can sit side by side: when the name is already taken there, the file is stored under the lowest free numbered name instead, such as `image (2).png`, with the number before the extension, and the response\'s `name` is the name it was stored under. Any media type is accepted; `mimeType` is detected from the file\'s contents rather than from its name or the type the client declared. Maximum file size is 25 MiB, and uploads are rejected if a virus scan fails. The files stored against an account may total at most 1 GiB. An upload that would take the account past that is rejected with 413 and no file is added to the account, though the uploaded bytes may briefly remain in storage until they are cleaned up; deleting files frees their space. A 409 means concurrent uploads kept changing the account\'s usage or taking the names it tried, and the upload can be retried as it stands. The response body is the same record shape the list operation returns, so a client can add it to a list it already holds instead of refetching. Requires the *Edit file storage* permission.
237
384
  * Upload a file to the account
238
385
  */
239
386
  async createAccountFiles(requestParameters: FilesApiCreateAccountFilesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord> {
@@ -241,6 +388,53 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
241
388
  return await response.value();
242
389
  }
243
390
 
391
+ /**
392
+ * Deletes an empty directory from the account\'s files. A directory that still holds a file or another directory is rejected with 409 `directory is not empty`: move or delete its contents first. Deleting a directory that is already gone succeeds rather than returning 404. Any other 409 means the directory changed during the request, and the request can be retried. Requires the *Edit file storage* permission.
393
+ * Delete a directory
394
+ */
395
+ async deleteAccountDirectoriesRaw(requestParameters: FilesApiDeleteAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>> {
396
+ if (requestParameters['id'] == null) {
397
+ throw new runtime.RequiredError(
398
+ 'id',
399
+ 'Required parameter "id" was null or undefined when calling deleteAccountDirectories().'
400
+ );
401
+ }
402
+
403
+ const queryParameters: any = {};
404
+
405
+ const headerParameters: runtime.HTTPHeaders = {};
406
+
407
+ if (this.configuration && this.configuration.accessToken) {
408
+ const token = this.configuration.accessToken;
409
+ const tokenString = await token("accessToken", []);
410
+
411
+ if (tokenString) {
412
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
413
+ }
414
+ }
415
+
416
+ let urlPath = `/v1/account/directories/{id}`;
417
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
418
+
419
+ const response = await this.request({
420
+ path: urlPath,
421
+ method: 'DELETE',
422
+ headers: headerParameters,
423
+ query: queryParameters,
424
+ }, initOverrides);
425
+
426
+ return new runtime.JSONApiResponse<any>(response);
427
+ }
428
+
429
+ /**
430
+ * Deletes an empty directory from the account\'s files. A directory that still holds a file or another directory is rejected with 409 `directory is not empty`: move or delete its contents first. Deleting a directory that is already gone succeeds rather than returning 404. Any other 409 means the directory changed during the request, and the request can be retried. Requires the *Edit file storage* permission.
431
+ * Delete a directory
432
+ */
433
+ async deleteAccountDirectories(requestParameters: FilesApiDeleteAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object> {
434
+ const response = await this.deleteAccountDirectoriesRaw(requestParameters, initOverrides);
435
+ return await response.value();
436
+ }
437
+
244
438
  /**
245
439
  * Permanently deletes a file stored against the account, removing both its record and its stored content. This cannot be undone and any link to the file stops working. The file\'s size stops counting towards the account\'s 1 GiB storage quota once its record is removed. The record is removed before the content, so a request that fails partway can leave the stored content behind; repeating the same request is what clears it. Deleting a file that is already gone succeeds rather than returning 404, so a failed delete should always be retried; that includes a 409, which means concurrent changes to the account\'s files kept changing its storage usage during the request. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400. Requires the *Edit file storage* permission.
246
440
  * Delete an account file
@@ -340,7 +534,54 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
340
534
  }
341
535
 
342
536
  /**
343
- * Returns a page of the files stored against the account, most recently uploaded first. Files belonging to other accounts are never returned. When `nextCursor` is present there are more files to fetch; pass it back as `cursor` to retrieve the following page. A page may come back shorter than `limit` while still having a `nextCursor`. A file that has just been uploaded may not appear here immediately, so clients should add the record returned by the upload operation to their list rather than refetching. Requires the *View file storage* permission.
537
+ * Returns a page of every directory in the account\'s files, at any depth, in the order they were created. Each directory gives its parent\'s identifier, so a client that fetches every page can build the whole tree. To list what is inside one directory, list the account\'s files with `parent` instead. When `nextCursor` is present there are more directories to fetch; pass it back as `cursor` to retrieve the following page. Requires the *View file storage* permission.
538
+ * List the account\'s directories
539
+ */
540
+ async listAccountDirectoriesRaw(requestParameters: FilesApiListAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DirectoryPage>> {
541
+ const queryParameters: any = {};
542
+
543
+ if (requestParameters['limit'] != null) {
544
+ queryParameters['limit'] = requestParameters['limit'];
545
+ }
546
+
547
+ if (requestParameters['cursor'] != null) {
548
+ queryParameters['cursor'] = requestParameters['cursor'];
549
+ }
550
+
551
+ const headerParameters: runtime.HTTPHeaders = {};
552
+
553
+ if (this.configuration && this.configuration.accessToken) {
554
+ const token = this.configuration.accessToken;
555
+ const tokenString = await token("accessToken", []);
556
+
557
+ if (tokenString) {
558
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
559
+ }
560
+ }
561
+
562
+ let urlPath = `/v1/account/directories`;
563
+
564
+ const response = await this.request({
565
+ path: urlPath,
566
+ method: 'GET',
567
+ headers: headerParameters,
568
+ query: queryParameters,
569
+ }, initOverrides);
570
+
571
+ return new runtime.JSONApiResponse(response, (jsonValue) => DirectoryPageFromJSON(jsonValue));
572
+ }
573
+
574
+ /**
575
+ * Returns a page of every directory in the account\'s files, at any depth, in the order they were created. Each directory gives its parent\'s identifier, so a client that fetches every page can build the whole tree. To list what is inside one directory, list the account\'s files with `parent` instead. When `nextCursor` is present there are more directories to fetch; pass it back as `cursor` to retrieve the following page. Requires the *View file storage* permission.
576
+ * List the account\'s directories
577
+ */
578
+ async listAccountDirectories(requestParameters: FilesApiListAccountDirectoriesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DirectoryPage> {
579
+ const response = await this.listAccountDirectoriesRaw(requestParameters, initOverrides);
580
+ return await response.value();
581
+ }
582
+
583
+ /**
584
+ * Without `parent`, returns a page of every file stored against the account, whatever directory it is in, most recently uploaded first. Files belonging to other accounts are never returned. With `parent`, returns a page of what is directly inside that directory, or inside the root when `parent` is `root`: its directories in `directories`, most recently created first, then its files in `files`, most recently uploaded first. Returns 404 if the account has no directory with that identifier. When `nextCursor` is present there are more items to fetch; pass it back as `cursor`, with the same `parent`, to retrieve the following page. A page may come back shorter than `limit` while still having a `nextCursor`. A file that has just been uploaded, moved or renamed may not show its change here immediately, so clients should apply the record returned by the upload or update operation to their list rather than refetching. Requires the *View file storage* permission.
344
585
  * List the account\'s files
345
586
  */
346
587
  async listAccountFilesRaw(requestParameters: FilesApiListAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListPage>> {
@@ -354,6 +595,10 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
354
595
  queryParameters['cursor'] = requestParameters['cursor'];
355
596
  }
356
597
 
598
+ if (requestParameters['parent'] != null) {
599
+ queryParameters['parent'] = requestParameters['parent'];
600
+ }
601
+
357
602
  const headerParameters: runtime.HTTPHeaders = {};
358
603
 
359
604
  if (this.configuration && this.configuration.accessToken) {
@@ -378,7 +623,7 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
378
623
  }
379
624
 
380
625
  /**
381
- * Returns a page of the files stored against the account, most recently uploaded first. Files belonging to other accounts are never returned. When `nextCursor` is present there are more files to fetch; pass it back as `cursor` to retrieve the following page. A page may come back shorter than `limit` while still having a `nextCursor`. A file that has just been uploaded may not appear here immediately, so clients should add the record returned by the upload operation to their list rather than refetching. Requires the *View file storage* permission.
626
+ * Without `parent`, returns a page of every file stored against the account, whatever directory it is in, most recently uploaded first. Files belonging to other accounts are never returned. With `parent`, returns a page of what is directly inside that directory, or inside the root when `parent` is `root`: its directories in `directories`, most recently created first, then its files in `files`, most recently uploaded first. Returns 404 if the account has no directory with that identifier. When `nextCursor` is present there are more items to fetch; pass it back as `cursor`, with the same `parent`, to retrieve the following page. A page may come back shorter than `limit` while still having a `nextCursor`. A file that has just been uploaded, moved or renamed may not show its change here immediately, so clients should apply the record returned by the upload or update operation to their list rather than refetching. Requires the *View file storage* permission.
382
627
  * List the account\'s files
383
628
  */
384
629
  async listAccountFiles(requestParameters: FilesApiListAccountFilesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListPage> {
@@ -387,8 +632,65 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
387
632
  }
388
633
 
389
634
  /**
390
- * Changes the display name of a file stored against the account and returns the updated record. Only the name changes: the stored content, media type, size and identifier are untouched, so anything already referencing the file keeps working. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400. Returns 404 if the account has no file with this identifier. Requires the *Edit file storage* permission.
391
- * Rename an account file
635
+ * Changes a directory\'s name, moves it into another directory, or both, and returns the updated directory. Give `name`, `parentId` or both; a body with neither is rejected with 400. Everything inside the directory moves with it and keeps its identifier, so anything referencing those files keeps working. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly: a name already taken in the destination by a file or another directory, whether by a rename or a move, is rejected with 409. Moving a directory into itself or into a directory inside it, or so that something inside it would be nested more than 8 deep, is rejected with 400. Returns 404 if the account has no directory with this identifier, or none with the given `parentId`. Any other 409 means the account\'s directories changed during the request, and the request can be retried. Requires the *Edit file storage* permission.
636
+ * Rename or move a directory
637
+ */
638
+ async updateAccountDirectoriesRaw(requestParameters: FilesApiUpdateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Directory>> {
639
+ if (requestParameters['id'] == null) {
640
+ throw new runtime.RequiredError(
641
+ 'id',
642
+ 'Required parameter "id" was null or undefined when calling updateAccountDirectories().'
643
+ );
644
+ }
645
+
646
+ if (requestParameters['accountDirectoryPatchBody'] == null) {
647
+ throw new runtime.RequiredError(
648
+ 'accountDirectoryPatchBody',
649
+ 'Required parameter "accountDirectoryPatchBody" was null or undefined when calling updateAccountDirectories().'
650
+ );
651
+ }
652
+
653
+ const queryParameters: any = {};
654
+
655
+ const headerParameters: runtime.HTTPHeaders = {};
656
+
657
+ headerParameters['Content-Type'] = 'application/json';
658
+
659
+ if (this.configuration && this.configuration.accessToken) {
660
+ const token = this.configuration.accessToken;
661
+ const tokenString = await token("accessToken", []);
662
+
663
+ if (tokenString) {
664
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
665
+ }
666
+ }
667
+
668
+ let urlPath = `/v1/account/directories/{id}`;
669
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
670
+
671
+ const response = await this.request({
672
+ path: urlPath,
673
+ method: 'PATCH',
674
+ headers: headerParameters,
675
+ query: queryParameters,
676
+ body: AccountDirectoryPatchBodyToJSON(requestParameters['accountDirectoryPatchBody']),
677
+ }, initOverrides);
678
+
679
+ return new runtime.JSONApiResponse(response, (jsonValue) => DirectoryFromJSON(jsonValue));
680
+ }
681
+
682
+ /**
683
+ * Changes a directory\'s name, moves it into another directory, or both, and returns the updated directory. Give `name`, `parentId` or both; a body with neither is rejected with 400. Everything inside the directory moves with it and keeps its identifier, so anything referencing those files keeps working. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly: a name already taken in the destination by a file or another directory, whether by a rename or a move, is rejected with 409. Moving a directory into itself or into a directory inside it, or so that something inside it would be nested more than 8 deep, is rejected with 400. Returns 404 if the account has no directory with this identifier, or none with the given `parentId`. Any other 409 means the account\'s directories changed during the request, and the request can be retried. Requires the *Edit file storage* permission.
684
+ * Rename or move a directory
685
+ */
686
+ async updateAccountDirectories(requestParameters: FilesApiUpdateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Directory> {
687
+ const response = await this.updateAccountDirectoriesRaw(requestParameters, initOverrides);
688
+ return await response.value();
689
+ }
690
+
691
+ /**
692
+ * Changes the display name of a file stored against the account, moves it into another directory, or both, and returns the updated record. Give `name`, `parentId` or both; a body with neither is rejected with 400. Only the name and directory change: the stored content, media type, size and identifier are untouched, so anything already referencing the file keeps working. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly. Giving a `name` already taken in the destination is rejected with 409. A move that gives only `parentId` never fails for its name: if the file\'s name is taken in the destination, it is stored under the lowest free numbered name instead, such as `lease (2).pdf`, and a name normalising makes longer than 255 bytes is shortened to fit; the response\'s `name` is the name it now has. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400. Returns 404 if the account has no file with this identifier, or no directory with the given `parentId`. Any other 409 means the file was moved by another request at the same time, and the request can be retried. Requires the *Edit file storage* permission.
693
+ * Rename or move an account file
392
694
  */
393
695
  async updateAccountFilesRaw(requestParameters: FilesApiUpdateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>> {
394
696
  if (requestParameters['id'] == null) {
@@ -435,8 +737,8 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
435
737
  }
436
738
 
437
739
  /**
438
- * Changes the display name of a file stored against the account and returns the updated record. Only the name changes: the stored content, media type, size and identifier are untouched, so anything already referencing the file keeps working. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400. Returns 404 if the account has no file with this identifier. Requires the *Edit file storage* permission.
439
- * Rename an account file
740
+ * Changes the display name of a file stored against the account, moves it into another directory, or both, and returns the updated record. Give `name`, `parentId` or both; a body with neither is rejected with 400. Only the name and directory change: the stored content, media type, size and identifier are untouched, so anything already referencing the file keeps working. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly. Giving a `name` already taken in the destination is rejected with 409. A move that gives only `parentId` never fails for its name: if the file\'s name is taken in the destination, it is stored under the lowest free numbered name instead, such as `lease (2).pdf`, and a name normalising makes longer than 255 bytes is shortened to fit; the response\'s `name` is the name it now has. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400. Returns 404 if the account has no file with this identifier, or no directory with the given `parentId`. Any other 409 means the file was moved by another request at the same time, and the request can be retried. Requires the *Edit file storage* permission.
741
+ * Rename or move an account file
440
742
  */
441
743
  async updateAccountFiles(requestParameters: FilesApiUpdateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord> {
442
744
  const response = await this.updateAccountFilesRaw(requestParameters, initOverrides);