Skip to content

Commit 4b6ce2b

Browse files
author
stlc-bot
committed
Delete the files a folder owns when the folder or the file is removed (#33001)
Stainless-Generated-From: eefd9be86cba8f2fa9fc19b39da635fe9c86ed0c
1 parent 23ae0ed commit 4b6ce2b

6 files changed

Lines changed: 13 additions & 3 deletions

File tree

‎llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/beta/directories/DirectoryDeleteParams.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import java.util.Objects
1111
import java.util.Optional
1212
import kotlin.jvm.optionals.getOrNull
1313

14-
/** Permanently delete a directory. */
14+
/** Permanently delete a directory, and the files in it that no other directory or index uses. */
1515
class DirectoryDeleteParams
1616
private constructor(
1717
private val directoryId: String?,

‎llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/beta/directories/files/FileDeleteParams.kt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import kotlin.jvm.optionals.getOrNull
1515
/**
1616
* Delete a directory file by `directory_file_id`; to resolve from `unique_id`, list with a filter
1717
* first.
18+
*
19+
* The uploaded file is deleted with it unless another directory or index still uses it.
1820
*/
1921
class FileDeleteParams
2022
private constructor(

‎llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/beta/DirectoryServiceAsync.kt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ interface DirectoryServiceAsync {
104104
fun list(requestOptions: RequestOptions): CompletableFuture<DirectoryListPageAsync> =
105105
list(DirectoryListParams.none(), requestOptions)
106106

107-
/** Permanently delete a directory. */
107+
/**
108+
* Permanently delete a directory, and the files in it that no other directory or index uses.
109+
*/
108110
fun delete(directoryId: String): CompletableFuture<Void?> =
109111
delete(directoryId, DirectoryDeleteParams.none())
110112

‎llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/beta/directories/FileServiceAsync.kt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ interface FileServiceAsync {
100100
/**
101101
* Delete a directory file by `directory_file_id`; to resolve from `unique_id`, list with a
102102
* filter first.
103+
*
104+
* The uploaded file is deleted with it unless another directory or index still uses it.
103105
*/
104106
fun delete(directoryFileId: String, params: FileDeleteParams): CompletableFuture<Void?> =
105107
delete(directoryFileId, params, RequestOptions.none())

‎llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/beta/DirectoryService.kt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ interface DirectoryService {
9999
fun list(requestOptions: RequestOptions): DirectoryListPage =
100100
list(DirectoryListParams.none(), requestOptions)
101101

102-
/** Permanently delete a directory. */
102+
/**
103+
* Permanently delete a directory, and the files in it that no other directory or index uses.
104+
*/
103105
fun delete(directoryId: String) = delete(directoryId, DirectoryDeleteParams.none())
104106

105107
/** @see delete */

‎llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/beta/directories/FileService.kt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ interface FileService {
8888
/**
8989
* Delete a directory file by `directory_file_id`; to resolve from `unique_id`, list with a
9090
* filter first.
91+
*
92+
* The uploaded file is deleted with it unless another directory or index still uses it.
9193
*/
9294
fun delete(directoryFileId: String, params: FileDeleteParams) =
9395
delete(directoryFileId, params, RequestOptions.none())

0 commit comments

Comments
 (0)