From 777ddc4c3ff07d4d0c1d53998cf65b3d27b4d0a0 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Fri, 28 Aug 2026 22:06:00 +0000 Subject: [PATCH 01/11] Build SDK Stainless-Generated-From: a4c7a204887ef9443571db630c5edc91be8b184c --- README.md | 2 +- .../llamacloud/models/configurations/ExtractV2Parameters.kt | 6 +++--- .../llamacloud/models/extract/ExtractConfiguration.kt | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d090833..a023e55 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Maven Central](https://img.shields.io/maven-central/v/ai.llamaindex.llamacloud/llama-cloud)](https://central.sonatype.com/artifact/ai.llamaindex.llamacloud/llama-cloud/1.6.0) -[![javadoc](https://javadoc.io/badge2/ai.llamaindex.llamacloud/llama-cloud/1.6.0/javadoc.svg)](https://javadoc.io/doc/ai.llamaindex.llamacloud/llama-cloud/1.5.1) +[![javadoc](https://javadoc.io/badge2/ai.llamaindex.llamacloud/llama-cloud/1.6.0/javadoc.svg)](https://javadoc.io/doc/ai.llamaindex.llamacloud/llama-cloud/1.6.0) diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/configurations/ExtractV2Parameters.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/configurations/ExtractV2Parameters.kt index 5494722..2c2abb7 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/configurations/ExtractV2Parameters.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/configurations/ExtractV2Parameters.kt @@ -224,7 +224,7 @@ private constructor( /** * Extract tier: cost_effective (5 credits/page), agentic (15 credits/page), agentic_plus (50 - * credits/page), or turbo (35 credits/page, experimental) + * credits/page), or turbo (35 credits/page) * * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -675,7 +675,7 @@ private constructor( /** * Extract tier: cost_effective (5 credits/page), agentic (15 credits/page), agentic_plus - * (50 credits/page), or turbo (35 credits/page, experimental) + * (50 credits/page), or turbo (35 credits/page) */ fun tier(tier: Tier) = tier(JsonField.of(tier)) @@ -1087,7 +1087,7 @@ private constructor( /** * Extract tier: cost_effective (5 credits/page), agentic (15 credits/page), agentic_plus (50 - * credits/page), or turbo (35 credits/page, experimental) + * credits/page), or turbo (35 credits/page) */ class Tier @JsonCreator private constructor(private val value: JsonField) : Enum { diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractConfiguration.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractConfiguration.kt index 2348429..4e7552e 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractConfiguration.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractConfiguration.kt @@ -208,7 +208,7 @@ private constructor( /** * Extract tier: cost_effective (5 credits/page), agentic (15 credits/page), agentic_plus (50 - * credits/page), or turbo (35 credits/page, experimental) + * credits/page), or turbo (35 credits/page) * * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -643,7 +643,7 @@ private constructor( /** * Extract tier: cost_effective (5 credits/page), agentic (15 credits/page), agentic_plus - * (50 credits/page), or turbo (35 credits/page, experimental) + * (50 credits/page), or turbo (35 credits/page) */ fun tier(tier: Tier) = tier(JsonField.of(tier)) @@ -1048,7 +1048,7 @@ private constructor( /** * Extract tier: cost_effective (5 credits/page), agentic (15 credits/page), agentic_plus (50 - * credits/page), or turbo (35 credits/page, experimental) + * credits/page), or turbo (35 credits/page) */ class Tier @JsonCreator private constructor(private val value: JsonField) : Enum { From ea3a32b0e9dad1cfca81fcf25f5348a5b26b00db Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Sun, 30 Aug 2026 00:41:41 +0000 Subject: [PATCH 02/11] Build SDK Stainless-Generated-From: c5a76f577096bce236e24ae7f646c7884adab31d --- .../llamacloud/models/pipelines/PipelineListParams.kt | 6 +++++- .../llamacloud/services/async/PipelineServiceAsync.kt | 6 +++++- .../llamacloud/services/blocking/PipelineService.kt | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineListParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineListParams.kt index 3a5c3d9..f3e1ff4 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineListParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineListParams.kt @@ -9,7 +9,11 @@ import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull -/** Search for pipelines by name, type, or project. */ +/** + * Search for pipelines by name, type, or project. + * + * Deprecated: use `GET /api/v2/pipelines`, which is paginated. + */ @Deprecated("deprecated") class PipelineListParams private constructor( diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/PipelineServiceAsync.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/PipelineServiceAsync.kt index f3ae8ad..5c4175a 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/PipelineServiceAsync.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/PipelineServiceAsync.kt @@ -158,7 +158,11 @@ interface PipelineServiceAsync { fun update(pipelineId: String, requestOptions: RequestOptions): CompletableFuture = update(pipelineId, PipelineUpdateParams.none(), requestOptions) - /** Search for pipelines by name, type, or project. */ + /** + * Search for pipelines by name, type, or project. + * + * Deprecated: use `GET /api/v2/pipelines`, which is paginated. + */ @Deprecated("deprecated") fun list(): CompletableFuture> = list(PipelineListParams.none()) diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/PipelineService.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/PipelineService.kt index b67bf75..d826739 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/PipelineService.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/PipelineService.kt @@ -151,7 +151,11 @@ interface PipelineService { fun update(pipelineId: String, requestOptions: RequestOptions): Pipeline = update(pipelineId, PipelineUpdateParams.none(), requestOptions) - /** Search for pipelines by name, type, or project. */ + /** + * Search for pipelines by name, type, or project. + * + * Deprecated: use `GET /api/v2/pipelines`, which is paginated. + */ @Deprecated("deprecated") fun list(): List = list(PipelineListParams.none()) /** @see list */ From 1d5623a5050020224cac53a77e24899728849ed0 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Sun, 30 Aug 2026 06:09:59 +0000 Subject: [PATCH 03/11] Reject a file ordering the query cannot perform (#25596) Stainless-Generated-From: 1bf3881cf18645082310e25ef00987ec3d62f408 --- .../llamacloud/models/files/FileListParams.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/files/FileListParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/files/FileListParams.kt index b945566..07020a2 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/files/FileListParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/files/FileListParams.kt @@ -44,8 +44,9 @@ private constructor( fun fileName(): Optional = Optional.ofNullable(fileName) /** - * A comma-separated list of fields to order by, sorted in ascending order. Use 'field_name - * desc' to specify descending order. + * Order the results. One of 'name' (ascending), 'id' (ascending) or 'created_at' (descending). + * An explicit asc/desc modifier and multi-field ordering are not supported; anything else is + * rejected. */ fun orderBy(): Optional = Optional.ofNullable(orderBy) @@ -152,8 +153,9 @@ private constructor( fun fileName(fileName: Optional) = fileName(fileName.getOrNull()) /** - * A comma-separated list of fields to order by, sorted in ascending order. Use 'field_name - * desc' to specify descending order. + * Order the results. One of 'name' (ascending), 'id' (ascending) or 'created_at' + * (descending). An explicit asc/desc modifier and multi-field ordering are not supported; + * anything else is rejected. */ fun orderBy(orderBy: String?) = apply { this.orderBy = orderBy } From 73d197777467ea3c02a16c6775159532d3cc2107 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Sun, 30 Aug 2026 06:33:14 +0000 Subject: [PATCH 04/11] Bound the pagination params that had no range (#25594) Stainless-Generated-From: f8c9f5eefb562f72e1c8dcd6058b77b06b1aa457 --- .../models/configurations/ConfigurationListParamsTest.kt | 6 +++--- .../llamacloud/models/extract/ExtractListParamsTest.kt | 6 +++--- .../llamacloud/models/parsing/ParsingListParamsTest.kt | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/configurations/ConfigurationListParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/configurations/ConfigurationListParamsTest.kt index efa2093..e192bad 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/configurations/ConfigurationListParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/configurations/ConfigurationListParamsTest.kt @@ -14,7 +14,7 @@ internal class ConfigurationListParamsTest { .latestOnly(true) .name("name") .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pageSize(0L) + .pageSize(1L) .pageToken("page_token") .addProductType(ConfigurationListParams.ProductType.CLASSIFY_V2) .addProductType(ConfigurationListParams.ProductType.EXTRACT_V2) @@ -29,7 +29,7 @@ internal class ConfigurationListParamsTest { .latestOnly(true) .name("name") .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pageSize(0L) + .pageSize(1L) .pageToken("page_token") .addProductType(ConfigurationListParams.ProductType.CLASSIFY_V2) .addProductType(ConfigurationListParams.ProductType.EXTRACT_V2) @@ -44,7 +44,7 @@ internal class ConfigurationListParamsTest { .put("latest_only", "true") .put("name", "name") .put("organization_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .put("page_size", "0") + .put("page_size", "1") .put("page_token", "page_token") .put("product_type", "classify_v2") .put("product_type", "extract_v2") diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractListParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractListParamsTest.kt index 2f3ff0e..0bc4163 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractListParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractListParamsTest.kt @@ -22,7 +22,7 @@ internal class ExtractListParamsTest { .addJobId("string") .addJobId("string") .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pageSize(0L) + .pageSize(1L) .pageToken("page_token") .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .status(ExtractListParams.Status.CANCELLED) @@ -43,7 +43,7 @@ internal class ExtractListParamsTest { .addJobId("string") .addJobId("string") .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pageSize(0L) + .pageSize(1L) .pageToken("page_token") .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .status(ExtractListParams.Status.CANCELLED) @@ -64,7 +64,7 @@ internal class ExtractListParamsTest { .put("job_ids", "string") .put("job_ids", "string") .put("organization_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .put("page_size", "0") + .put("page_size", "1") .put("page_token", "page_token") .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .put("status", "CANCELLED") diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/parsing/ParsingListParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/parsing/ParsingListParamsTest.kt index 5cf5523..98875fa 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/parsing/ParsingListParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/parsing/ParsingListParamsTest.kt @@ -17,7 +17,7 @@ internal class ParsingListParamsTest { .addJobId("string") .addJobId("string") .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pageSize(0L) + .pageSize(1L) .pageToken("page_token") .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .status(ParsingListParams.Status.CANCELLED) @@ -33,7 +33,7 @@ internal class ParsingListParamsTest { .addJobId("string") .addJobId("string") .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pageSize(0L) + .pageSize(1L) .pageToken("page_token") .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .status(ParsingListParams.Status.CANCELLED) @@ -49,7 +49,7 @@ internal class ParsingListParamsTest { .put("job_ids", "string") .put("job_ids", "string") .put("organization_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .put("page_size", "0") + .put("page_size", "1") .put("page_token", "page_token") .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .put("status", "CANCELLED") From ef01cf1f9a845e08cfeb8c86210663a718d2ea49 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Sun, 30 Aug 2026 08:08:17 +0000 Subject: [PATCH 05/11] LI-9325: scope data-source and data-sink by-id routes to the requested project (#25476) Stainless-Generated-From: 7b61f91c1e5cf347222079a8639b1d30909a0e77 --- .../models/datasinks/DataSinkDeleteParams.kt | 30 +- .../models/datasinks/DataSinkGetParams.kt | 30 +- .../models/datasinks/DataSinkUpdateParams.kt | 24 +- .../datasources/DataSourceDeleteParams.kt | 23 +- .../models/datasources/DataSourceGetParams.kt | 24 +- .../datasources/DataSourceUpdateParams.kt | 24 +- .../models/pipelines/PipelineDeleteParams.kt | 30 +- .../models/pipelines/PipelineGetParams.kt | 30 +- .../pipelines/PipelineGetStatusParams.kt | 17 +- .../models/pipelines/PipelineUpdateParams.kt | 24 +- .../DataSourceGetDataSourcesParams.kt | 24 +- .../datasources/DataSourceGetStatusParams.kt | 24 +- .../datasources/DataSourceSyncParams.kt | 31 +- .../DataSourceUpdateDataSourcesParams.kt | 24 +- .../datasources/DataSourceUpdateParams.kt | 31 +- .../documents/DocumentCreateParams.kt | 24 +- .../documents/DocumentDeleteParams.kt | 23 +- .../documents/DocumentGetChunksParams.kt | 24 +- .../pipelines/documents/DocumentGetParams.kt | 24 +- .../DocumentGetStatusCountsParams.kt | 16 +- .../documents/DocumentGetStatusParams.kt | 24 +- .../pipelines/documents/DocumentListParams.kt | 16 +- .../pipelines/documents/DocumentSyncParams.kt | 23 +- .../documents/DocumentUpsertParams.kt | 24 +- .../pipelines/files/FileCreateParams.kt | 24 +- .../pipelines/files/FileDeleteParams.kt | 23 +- .../files/FileGetStatusCountsParams.kt | 16 +- .../pipelines/files/FileGetStatusParams.kt | 24 +- .../models/pipelines/files/FileListParams.kt | 16 +- .../pipelines/files/FileUpdateParams.kt | 24 +- .../metadata/MetadataCreateParams.kt | 24 +- .../metadata/MetadataDeleteAllParams.kt | 30 +- .../models/pipelines/sync/SyncCancelParams.kt | 30 +- .../models/pipelines/sync/SyncCreateParams.kt | 30 +- .../datasinks/DataSinkDeleteParamsTest.kt | 36 ++- .../models/datasinks/DataSinkGetParamsTest.kt | 34 +- .../datasinks/DataSinkUpdateParamsTest.kt | 41 +++ .../datasources/DataSourceDeleteParamsTest.kt | 32 ++ .../datasources/DataSourceGetParamsTest.kt | 36 ++- .../datasources/DataSourceUpdateParamsTest.kt | 46 +++ .../pipelines/PipelineDeleteParamsTest.kt | 36 ++- .../models/pipelines/PipelineGetParamsTest.kt | 34 +- .../pipelines/PipelineGetStatusParamsTest.kt | 10 +- .../pipelines/PipelineUpdateParamsTest.kt | 291 ++++++++++++++++++ .../DataSourceGetDataSourcesParamsTest.kt | 32 ++ .../DataSourceGetStatusParamsTest.kt | 34 ++ .../datasources/DataSourceSyncParamsTest.kt | 36 +++ .../DataSourceUpdateDataSourcesParamsTest.kt | 44 +++ .../datasources/DataSourceUpdateParamsTest.kt | 36 +++ .../documents/DocumentCreateParamsTest.kt | 57 ++++ .../documents/DocumentDeleteParamsTest.kt | 34 ++ .../documents/DocumentGetChunksParamsTest.kt | 34 ++ .../documents/DocumentGetParamsTest.kt | 34 ++ .../DocumentGetStatusCountsParamsTest.kt | 3 + .../documents/DocumentGetStatusParamsTest.kt | 34 ++ .../documents/DocumentListParamsTest.kt | 3 + .../documents/DocumentSyncParamsTest.kt | 34 ++ .../documents/DocumentUpsertParamsTest.kt | 57 ++++ .../pipelines/files/FileCreateParamsTest.kt | 48 +++ .../pipelines/files/FileDeleteParamsTest.kt | 34 ++ .../files/FileGetStatusCountsParamsTest.kt | 3 + .../files/FileGetStatusParamsTest.kt | 34 ++ .../pipelines/files/FileListParamsTest.kt | 3 + .../pipelines/files/FileUpdateParamsTest.kt | 40 +++ .../metadata/MetadataCreateParamsTest.kt | 61 ++++ .../metadata/MetadataDeleteAllParamsTest.kt | 36 ++- .../pipelines/sync/SyncCancelParamsTest.kt | 34 +- .../pipelines/sync/SyncCreateParamsTest.kt | 34 +- .../async/DataSinkServiceAsyncTest.kt | 19 +- .../async/DataSourceServiceAsyncTest.kt | 19 +- .../async/PipelineServiceAsyncTest.kt | 20 +- .../pipelines/DataSourceServiceAsyncTest.kt | 12 +- .../pipelines/DocumentServiceAsyncTest.kt | 8 + .../async/pipelines/FileServiceAsyncTest.kt | 5 + .../pipelines/MetadataServiceAsyncTest.kt | 10 +- .../async/pipelines/SyncServiceAsyncTest.kt | 18 +- .../services/blocking/DataSinkServiceTest.kt | 18 +- .../blocking/DataSourceServiceTest.kt | 18 +- .../services/blocking/PipelineServiceTest.kt | 19 +- .../pipelines/DataSourceServiceTest.kt | 12 +- .../blocking/pipelines/DocumentServiceTest.kt | 8 + .../blocking/pipelines/FileServiceTest.kt | 5 + .../blocking/pipelines/MetadataServiceTest.kt | 9 +- .../blocking/pipelines/SyncServiceTest.kt | 18 +- 84 files changed, 2322 insertions(+), 120 deletions(-) diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkDeleteParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkDeleteParams.kt index 65d9a33..7e9d7ff 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkDeleteParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkDeleteParams.kt @@ -15,6 +15,7 @@ import kotlin.jvm.optionals.getOrNull class DataSinkDeleteParams private constructor( private val dataSinkId: String?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, @@ -22,6 +23,8 @@ private constructor( fun dataSinkId(): Optional = Optional.ofNullable(dataSinkId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional body properties to send with the request. */ fun _additionalBodyProperties(): Map = additionalBodyProperties @@ -45,6 +48,7 @@ private constructor( class Builder internal constructor() { private var dataSinkId: String? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() private var additionalBodyProperties: MutableMap = mutableMapOf() @@ -52,6 +56,7 @@ private constructor( @JvmSynthetic internal fun from(dataSinkDeleteParams: DataSinkDeleteParams) = apply { dataSinkId = dataSinkDeleteParams.dataSinkId + projectId = dataSinkDeleteParams.projectId additionalHeaders = dataSinkDeleteParams.additionalHeaders.toBuilder() additionalQueryParams = dataSinkDeleteParams.additionalQueryParams.toBuilder() additionalBodyProperties = dataSinkDeleteParams.additionalBodyProperties.toMutableMap() @@ -62,6 +67,11 @@ private constructor( /** Alias for calling [Builder.dataSinkId] with `dataSinkId.orElse(null)`. */ fun dataSinkId(dataSinkId: Optional) = dataSinkId(dataSinkId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -190,6 +200,7 @@ private constructor( fun build(): DataSinkDeleteParams = DataSinkDeleteParams( dataSinkId, + projectId, additionalHeaders.build(), additionalQueryParams.build(), additionalBodyProperties.toImmutable(), @@ -207,7 +218,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -216,14 +233,21 @@ private constructor( return other is DataSinkDeleteParams && dataSinkId == other.dataSinkId && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties } override fun hashCode(): Int = - Objects.hash(dataSinkId, additionalHeaders, additionalQueryParams, additionalBodyProperties) + Objects.hash( + dataSinkId, + projectId, + additionalHeaders, + additionalQueryParams, + additionalBodyProperties, + ) override fun toString() = - "DataSinkDeleteParams{dataSinkId=$dataSinkId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "DataSinkDeleteParams{dataSinkId=$dataSinkId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkGetParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkGetParams.kt index 6db5573..d517359 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkGetParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkGetParams.kt @@ -13,12 +13,15 @@ import kotlin.jvm.optionals.getOrNull class DataSinkGetParams private constructor( private val dataSinkId: String?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { fun dataSinkId(): Optional = Optional.ofNullable(dataSinkId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -39,12 +42,14 @@ private constructor( class Builder internal constructor() { private var dataSinkId: String? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic internal fun from(dataSinkGetParams: DataSinkGetParams) = apply { dataSinkId = dataSinkGetParams.dataSinkId + projectId = dataSinkGetParams.projectId additionalHeaders = dataSinkGetParams.additionalHeaders.toBuilder() additionalQueryParams = dataSinkGetParams.additionalQueryParams.toBuilder() } @@ -54,6 +59,11 @@ private constructor( /** Alias for calling [Builder.dataSinkId] with `dataSinkId.orElse(null)`. */ fun dataSinkId(dataSinkId: Optional) = dataSinkId(dataSinkId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -158,7 +168,12 @@ private constructor( * Further updates to this [Builder] will not mutate the returned instance. */ fun build(): DataSinkGetParams = - DataSinkGetParams(dataSinkId, additionalHeaders.build(), additionalQueryParams.build()) + DataSinkGetParams( + dataSinkId, + projectId, + additionalHeaders.build(), + additionalQueryParams.build(), + ) } fun _pathParam(index: Int): String = @@ -169,7 +184,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -178,13 +199,14 @@ private constructor( return other is DataSinkGetParams && dataSinkId == other.dataSinkId && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(dataSinkId, additionalHeaders, additionalQueryParams) + Objects.hash(dataSinkId, projectId, additionalHeaders, additionalQueryParams) override fun toString() = - "DataSinkGetParams{dataSinkId=$dataSinkId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "DataSinkGetParams{dataSinkId=$dataSinkId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkUpdateParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkUpdateParams.kt index d089c53..d6c6f3e 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkUpdateParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkUpdateParams.kt @@ -44,6 +44,7 @@ import kotlin.jvm.optionals.getOrNull class DataSinkUpdateParams private constructor( private val dataSinkId: String?, + private val projectId: String?, private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -51,6 +52,8 @@ private constructor( fun dataSinkId(): Optional = Optional.ofNullable(dataSinkId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -121,6 +124,7 @@ private constructor( class Builder internal constructor() { private var dataSinkId: String? = null + private var projectId: String? = null private var body: Body.Builder = Body.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -128,6 +132,7 @@ private constructor( @JvmSynthetic internal fun from(dataSinkUpdateParams: DataSinkUpdateParams) = apply { dataSinkId = dataSinkUpdateParams.dataSinkId + projectId = dataSinkUpdateParams.projectId body = dataSinkUpdateParams.body.toBuilder() additionalHeaders = dataSinkUpdateParams.additionalHeaders.toBuilder() additionalQueryParams = dataSinkUpdateParams.additionalQueryParams.toBuilder() @@ -138,6 +143,11 @@ private constructor( /** Alias for calling [Builder.dataSinkId] with `dataSinkId.orElse(null)`. */ fun dataSinkId(dataSinkId: Optional) = dataSinkId(dataSinkId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + /** * Sets the entire request body. * @@ -380,6 +390,7 @@ private constructor( fun build(): DataSinkUpdateParams = DataSinkUpdateParams( dataSinkId, + projectId, body.build(), additionalHeaders.build(), additionalQueryParams.build(), @@ -396,7 +407,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() /** Schema for updating a data sink. */ class Body @@ -1627,14 +1644,15 @@ private constructor( return other is DataSinkUpdateParams && dataSinkId == other.dataSinkId && + projectId == other.projectId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(dataSinkId, body, additionalHeaders, additionalQueryParams) + Objects.hash(dataSinkId, projectId, body, additionalHeaders, additionalQueryParams) override fun toString() = - "DataSinkUpdateParams{dataSinkId=$dataSinkId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "DataSinkUpdateParams{dataSinkId=$dataSinkId, projectId=$projectId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceDeleteParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceDeleteParams.kt index 6a511a5..45ddd2d 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceDeleteParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceDeleteParams.kt @@ -15,6 +15,7 @@ import kotlin.jvm.optionals.getOrNull class DataSourceDeleteParams private constructor( private val dataSourceId: String?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, @@ -22,6 +23,8 @@ private constructor( fun dataSourceId(): Optional = Optional.ofNullable(dataSourceId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional body properties to send with the request. */ fun _additionalBodyProperties(): Map = additionalBodyProperties @@ -45,6 +48,7 @@ private constructor( class Builder internal constructor() { private var dataSourceId: String? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() private var additionalBodyProperties: MutableMap = mutableMapOf() @@ -52,6 +56,7 @@ private constructor( @JvmSynthetic internal fun from(dataSourceDeleteParams: DataSourceDeleteParams) = apply { dataSourceId = dataSourceDeleteParams.dataSourceId + projectId = dataSourceDeleteParams.projectId additionalHeaders = dataSourceDeleteParams.additionalHeaders.toBuilder() additionalQueryParams = dataSourceDeleteParams.additionalQueryParams.toBuilder() additionalBodyProperties = @@ -63,6 +68,11 @@ private constructor( /** Alias for calling [Builder.dataSourceId] with `dataSourceId.orElse(null)`. */ fun dataSourceId(dataSourceId: Optional) = dataSourceId(dataSourceId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -191,6 +201,7 @@ private constructor( fun build(): DataSourceDeleteParams = DataSourceDeleteParams( dataSourceId, + projectId, additionalHeaders.build(), additionalQueryParams.build(), additionalBodyProperties.toImmutable(), @@ -208,7 +219,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -217,6 +234,7 @@ private constructor( return other is DataSourceDeleteParams && dataSourceId == other.dataSourceId && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties @@ -225,11 +243,12 @@ private constructor( override fun hashCode(): Int = Objects.hash( dataSourceId, + projectId, additionalHeaders, additionalQueryParams, additionalBodyProperties, ) override fun toString() = - "DataSourceDeleteParams{dataSourceId=$dataSourceId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "DataSourceDeleteParams{dataSourceId=$dataSourceId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceGetParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceGetParams.kt index a1d7761..2d1a889 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceGetParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceGetParams.kt @@ -13,12 +13,15 @@ import kotlin.jvm.optionals.getOrNull class DataSourceGetParams private constructor( private val dataSourceId: String?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { fun dataSourceId(): Optional = Optional.ofNullable(dataSourceId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -39,12 +42,14 @@ private constructor( class Builder internal constructor() { private var dataSourceId: String? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic internal fun from(dataSourceGetParams: DataSourceGetParams) = apply { dataSourceId = dataSourceGetParams.dataSourceId + projectId = dataSourceGetParams.projectId additionalHeaders = dataSourceGetParams.additionalHeaders.toBuilder() additionalQueryParams = dataSourceGetParams.additionalQueryParams.toBuilder() } @@ -54,6 +59,11 @@ private constructor( /** Alias for calling [Builder.dataSourceId] with `dataSourceId.orElse(null)`. */ fun dataSourceId(dataSourceId: Optional) = dataSourceId(dataSourceId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -160,6 +170,7 @@ private constructor( fun build(): DataSourceGetParams = DataSourceGetParams( dataSourceId, + projectId, additionalHeaders.build(), additionalQueryParams.build(), ) @@ -173,7 +184,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -182,13 +199,14 @@ private constructor( return other is DataSourceGetParams && dataSourceId == other.dataSourceId && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(dataSourceId, additionalHeaders, additionalQueryParams) + Objects.hash(dataSourceId, projectId, additionalHeaders, additionalQueryParams) override fun toString() = - "DataSourceGetParams{dataSourceId=$dataSourceId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "DataSourceGetParams{dataSourceId=$dataSourceId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceUpdateParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceUpdateParams.kt index b4f6722..4e1445b 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceUpdateParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceUpdateParams.kt @@ -48,6 +48,7 @@ import kotlin.jvm.optionals.getOrNull class DataSourceUpdateParams private constructor( private val dataSourceId: String?, + private val projectId: String?, private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -55,6 +56,8 @@ private constructor( fun dataSourceId(): Optional = Optional.ofNullable(dataSourceId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -140,6 +143,7 @@ private constructor( class Builder internal constructor() { private var dataSourceId: String? = null + private var projectId: String? = null private var body: Body.Builder = Body.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -147,6 +151,7 @@ private constructor( @JvmSynthetic internal fun from(dataSourceUpdateParams: DataSourceUpdateParams) = apply { dataSourceId = dataSourceUpdateParams.dataSourceId + projectId = dataSourceUpdateParams.projectId body = dataSourceUpdateParams.body.toBuilder() additionalHeaders = dataSourceUpdateParams.additionalHeaders.toBuilder() additionalQueryParams = dataSourceUpdateParams.additionalQueryParams.toBuilder() @@ -157,6 +162,11 @@ private constructor( /** Alias for calling [Builder.dataSourceId] with `dataSourceId.orElse(null)`. */ fun dataSourceId(dataSourceId: Optional) = dataSourceId(dataSourceId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + /** * Sets the entire request body. * @@ -450,6 +460,7 @@ private constructor( fun build(): DataSourceUpdateParams = DataSourceUpdateParams( dataSourceId, + projectId, body.build(), additionalHeaders.build(), additionalQueryParams.build(), @@ -466,7 +477,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() /** Schema for updating a data source. */ class Body @@ -1872,14 +1889,15 @@ private constructor( return other is DataSourceUpdateParams && dataSourceId == other.dataSourceId && + projectId == other.projectId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(dataSourceId, body, additionalHeaders, additionalQueryParams) + Objects.hash(dataSourceId, projectId, body, additionalHeaders, additionalQueryParams) override fun toString() = - "DataSourceUpdateParams{dataSourceId=$dataSourceId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "DataSourceUpdateParams{dataSourceId=$dataSourceId, projectId=$projectId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineDeleteParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineDeleteParams.kt index b35ae1c..d750fdd 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineDeleteParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineDeleteParams.kt @@ -20,6 +20,7 @@ import kotlin.jvm.optionals.getOrNull class PipelineDeleteParams private constructor( private val pipelineId: String?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, @@ -27,6 +28,8 @@ private constructor( fun pipelineId(): Optional = Optional.ofNullable(pipelineId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional body properties to send with the request. */ fun _additionalBodyProperties(): Map = additionalBodyProperties @@ -50,6 +53,7 @@ private constructor( class Builder internal constructor() { private var pipelineId: String? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() private var additionalBodyProperties: MutableMap = mutableMapOf() @@ -57,6 +61,7 @@ private constructor( @JvmSynthetic internal fun from(pipelineDeleteParams: PipelineDeleteParams) = apply { pipelineId = pipelineDeleteParams.pipelineId + projectId = pipelineDeleteParams.projectId additionalHeaders = pipelineDeleteParams.additionalHeaders.toBuilder() additionalQueryParams = pipelineDeleteParams.additionalQueryParams.toBuilder() additionalBodyProperties = pipelineDeleteParams.additionalBodyProperties.toMutableMap() @@ -67,6 +72,11 @@ private constructor( /** Alias for calling [Builder.pipelineId] with `pipelineId.orElse(null)`. */ fun pipelineId(pipelineId: Optional) = pipelineId(pipelineId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -195,6 +205,7 @@ private constructor( fun build(): PipelineDeleteParams = PipelineDeleteParams( pipelineId, + projectId, additionalHeaders.build(), additionalQueryParams.build(), additionalBodyProperties.toImmutable(), @@ -212,7 +223,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -221,14 +238,21 @@ private constructor( return other is PipelineDeleteParams && pipelineId == other.pipelineId && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties } override fun hashCode(): Int = - Objects.hash(pipelineId, additionalHeaders, additionalQueryParams, additionalBodyProperties) + Objects.hash( + pipelineId, + projectId, + additionalHeaders, + additionalQueryParams, + additionalBodyProperties, + ) override fun toString() = - "PipelineDeleteParams{pipelineId=$pipelineId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "PipelineDeleteParams{pipelineId=$pipelineId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineGetParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineGetParams.kt index 9bbc0ce..48a4010 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineGetParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineGetParams.kt @@ -14,12 +14,15 @@ import kotlin.jvm.optionals.getOrNull class PipelineGetParams private constructor( private val pipelineId: String?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { fun pipelineId(): Optional = Optional.ofNullable(pipelineId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -40,12 +43,14 @@ private constructor( class Builder internal constructor() { private var pipelineId: String? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic internal fun from(pipelineGetParams: PipelineGetParams) = apply { pipelineId = pipelineGetParams.pipelineId + projectId = pipelineGetParams.projectId additionalHeaders = pipelineGetParams.additionalHeaders.toBuilder() additionalQueryParams = pipelineGetParams.additionalQueryParams.toBuilder() } @@ -55,6 +60,11 @@ private constructor( /** Alias for calling [Builder.pipelineId] with `pipelineId.orElse(null)`. */ fun pipelineId(pipelineId: Optional) = pipelineId(pipelineId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -159,7 +169,12 @@ private constructor( * Further updates to this [Builder] will not mutate the returned instance. */ fun build(): PipelineGetParams = - PipelineGetParams(pipelineId, additionalHeaders.build(), additionalQueryParams.build()) + PipelineGetParams( + pipelineId, + projectId, + additionalHeaders.build(), + additionalQueryParams.build(), + ) } fun _pathParam(index: Int): String = @@ -170,7 +185,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -179,13 +200,14 @@ private constructor( return other is PipelineGetParams && pipelineId == other.pipelineId && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(pipelineId, additionalHeaders, additionalQueryParams) + Objects.hash(pipelineId, projectId, additionalHeaders, additionalQueryParams) override fun toString() = - "PipelineGetParams{pipelineId=$pipelineId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "PipelineGetParams{pipelineId=$pipelineId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineGetStatusParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineGetStatusParams.kt index b7e7f9b..83c8565 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineGetStatusParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineGetStatusParams.kt @@ -20,6 +20,7 @@ class PipelineGetStatusParams private constructor( private val pipelineId: String?, private val fullDetails: Boolean?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -28,6 +29,8 @@ private constructor( fun fullDetails(): Optional = Optional.ofNullable(fullDetails) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -49,6 +52,7 @@ private constructor( private var pipelineId: String? = null private var fullDetails: Boolean? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -56,6 +60,7 @@ private constructor( internal fun from(pipelineGetStatusParams: PipelineGetStatusParams) = apply { pipelineId = pipelineGetStatusParams.pipelineId fullDetails = pipelineGetStatusParams.fullDetails + projectId = pipelineGetStatusParams.projectId additionalHeaders = pipelineGetStatusParams.additionalHeaders.toBuilder() additionalQueryParams = pipelineGetStatusParams.additionalQueryParams.toBuilder() } @@ -77,6 +82,11 @@ private constructor( /** Alias for calling [Builder.fullDetails] with `fullDetails.orElse(null)`. */ fun fullDetails(fullDetails: Optional) = fullDetails(fullDetails.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -184,6 +194,7 @@ private constructor( PipelineGetStatusParams( pipelineId, fullDetails, + projectId, additionalHeaders.build(), additionalQueryParams.build(), ) @@ -201,6 +212,7 @@ private constructor( QueryParams.builder() .apply { fullDetails?.let { put("full_details", it.toString()) } + projectId?.let { put("project_id", it) } putAll(additionalQueryParams) } .build() @@ -213,13 +225,14 @@ private constructor( return other is PipelineGetStatusParams && pipelineId == other.pipelineId && fullDetails == other.fullDetails && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(pipelineId, fullDetails, additionalHeaders, additionalQueryParams) + Objects.hash(pipelineId, fullDetails, projectId, additionalHeaders, additionalQueryParams) override fun toString() = - "PipelineGetStatusParams{pipelineId=$pipelineId, fullDetails=$fullDetails, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "PipelineGetStatusParams{pipelineId=$pipelineId, fullDetails=$fullDetails, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineUpdateParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineUpdateParams.kt index 10284db..5bfb026 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineUpdateParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineUpdateParams.kt @@ -35,6 +35,7 @@ import kotlin.jvm.optionals.getOrNull class PipelineUpdateParams private constructor( private val pipelineId: String?, + private val projectId: String?, private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -42,6 +43,8 @@ private constructor( fun pipelineId(): Optional = Optional.ofNullable(pipelineId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** * Schema for creating a data sink. * @@ -254,6 +257,7 @@ private constructor( class Builder internal constructor() { private var pipelineId: String? = null + private var projectId: String? = null private var body: Body.Builder = Body.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -261,6 +265,7 @@ private constructor( @JvmSynthetic internal fun from(pipelineUpdateParams: PipelineUpdateParams) = apply { pipelineId = pipelineUpdateParams.pipelineId + projectId = pipelineUpdateParams.projectId body = pipelineUpdateParams.body.toBuilder() additionalHeaders = pipelineUpdateParams.additionalHeaders.toBuilder() additionalQueryParams = pipelineUpdateParams.additionalQueryParams.toBuilder() @@ -271,6 +276,11 @@ private constructor( /** Alias for calling [Builder.pipelineId] with `pipelineId.orElse(null)`. */ fun pipelineId(pipelineId: Optional) = pipelineId(pipelineId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + /** * Sets the entire request body. * @@ -722,6 +732,7 @@ private constructor( fun build(): PipelineUpdateParams = PipelineUpdateParams( pipelineId, + projectId, body.build(), additionalHeaders.build(), additionalQueryParams.build(), @@ -738,7 +749,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() /** Schema for updating a pipeline. */ class Body @@ -2157,14 +2174,15 @@ private constructor( return other is PipelineUpdateParams && pipelineId == other.pipelineId && + projectId == other.projectId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(pipelineId, body, additionalHeaders, additionalQueryParams) + Objects.hash(pipelineId, projectId, body, additionalHeaders, additionalQueryParams) override fun toString() = - "PipelineUpdateParams{pipelineId=$pipelineId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "PipelineUpdateParams{pipelineId=$pipelineId, projectId=$projectId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceGetDataSourcesParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceGetDataSourcesParams.kt index 0e9d03d..f25eaa1 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceGetDataSourcesParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceGetDataSourcesParams.kt @@ -14,12 +14,15 @@ import kotlin.jvm.optionals.getOrNull class DataSourceGetDataSourcesParams private constructor( private val pipelineId: String?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { fun pipelineId(): Optional = Optional.ofNullable(pipelineId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -43,12 +46,14 @@ private constructor( class Builder internal constructor() { private var pipelineId: String? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic internal fun from(dataSourceGetDataSourcesParams: DataSourceGetDataSourcesParams) = apply { pipelineId = dataSourceGetDataSourcesParams.pipelineId + projectId = dataSourceGetDataSourcesParams.projectId additionalHeaders = dataSourceGetDataSourcesParams.additionalHeaders.toBuilder() additionalQueryParams = dataSourceGetDataSourcesParams.additionalQueryParams.toBuilder() } @@ -58,6 +63,11 @@ private constructor( /** Alias for calling [Builder.pipelineId] with `pipelineId.orElse(null)`. */ fun pipelineId(pipelineId: Optional) = pipelineId(pipelineId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -164,6 +174,7 @@ private constructor( fun build(): DataSourceGetDataSourcesParams = DataSourceGetDataSourcesParams( pipelineId, + projectId, additionalHeaders.build(), additionalQueryParams.build(), ) @@ -177,7 +188,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -186,13 +203,14 @@ private constructor( return other is DataSourceGetDataSourcesParams && pipelineId == other.pipelineId && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(pipelineId, additionalHeaders, additionalQueryParams) + Objects.hash(pipelineId, projectId, additionalHeaders, additionalQueryParams) override fun toString() = - "DataSourceGetDataSourcesParams{pipelineId=$pipelineId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "DataSourceGetDataSourcesParams{pipelineId=$pipelineId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceGetStatusParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceGetStatusParams.kt index fccc069..3dc13dd 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceGetStatusParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceGetStatusParams.kt @@ -16,6 +16,7 @@ class DataSourceGetStatusParams private constructor( private val pipelineId: String, private val dataSourceId: String?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -24,6 +25,8 @@ private constructor( fun dataSourceId(): Optional = Optional.ofNullable(dataSourceId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -50,6 +53,7 @@ private constructor( private var pipelineId: String? = null private var dataSourceId: String? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -57,6 +61,7 @@ private constructor( internal fun from(dataSourceGetStatusParams: DataSourceGetStatusParams) = apply { pipelineId = dataSourceGetStatusParams.pipelineId dataSourceId = dataSourceGetStatusParams.dataSourceId + projectId = dataSourceGetStatusParams.projectId additionalHeaders = dataSourceGetStatusParams.additionalHeaders.toBuilder() additionalQueryParams = dataSourceGetStatusParams.additionalQueryParams.toBuilder() } @@ -68,6 +73,11 @@ private constructor( /** Alias for calling [Builder.dataSourceId] with `dataSourceId.orElse(null)`. */ fun dataSourceId(dataSourceId: Optional) = dataSourceId(dataSourceId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -182,6 +192,7 @@ private constructor( DataSourceGetStatusParams( checkRequired("pipelineId", pipelineId), dataSourceId, + projectId, additionalHeaders.build(), additionalQueryParams.build(), ) @@ -196,7 +207,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -206,13 +223,14 @@ private constructor( return other is DataSourceGetStatusParams && pipelineId == other.pipelineId && dataSourceId == other.dataSourceId && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(pipelineId, dataSourceId, additionalHeaders, additionalQueryParams) + Objects.hash(pipelineId, dataSourceId, projectId, additionalHeaders, additionalQueryParams) override fun toString() = - "DataSourceGetStatusParams{pipelineId=$pipelineId, dataSourceId=$dataSourceId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "DataSourceGetStatusParams{pipelineId=$pipelineId, dataSourceId=$dataSourceId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceSyncParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceSyncParams.kt index 7d79a71..036cd10 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceSyncParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceSyncParams.kt @@ -28,6 +28,7 @@ class DataSourceSyncParams private constructor( private val pipelineId: String, private val dataSourceId: String?, + private val projectId: String?, private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -37,6 +38,8 @@ private constructor( fun dataSourceId(): Optional = Optional.ofNullable(dataSourceId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -78,6 +81,7 @@ private constructor( private var pipelineId: String? = null private var dataSourceId: String? = null + private var projectId: String? = null private var body: Body.Builder = Body.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -86,6 +90,7 @@ private constructor( internal fun from(dataSourceSyncParams: DataSourceSyncParams) = apply { pipelineId = dataSourceSyncParams.pipelineId dataSourceId = dataSourceSyncParams.dataSourceId + projectId = dataSourceSyncParams.projectId body = dataSourceSyncParams.body.toBuilder() additionalHeaders = dataSourceSyncParams.additionalHeaders.toBuilder() additionalQueryParams = dataSourceSyncParams.additionalQueryParams.toBuilder() @@ -98,6 +103,11 @@ private constructor( /** Alias for calling [Builder.dataSourceId] with `dataSourceId.orElse(null)`. */ fun dataSourceId(dataSourceId: Optional) = dataSourceId(dataSourceId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + /** * Sets the entire request body. * @@ -268,6 +278,7 @@ private constructor( DataSourceSyncParams( checkRequired("pipelineId", pipelineId), dataSourceId, + projectId, body.build(), additionalHeaders.build(), additionalQueryParams.build(), @@ -285,7 +296,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() /** * Request model for syncing pipeline data sources. @@ -482,14 +499,22 @@ private constructor( return other is DataSourceSyncParams && pipelineId == other.pipelineId && dataSourceId == other.dataSourceId && + projectId == other.projectId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(pipelineId, dataSourceId, body, additionalHeaders, additionalQueryParams) + Objects.hash( + pipelineId, + dataSourceId, + projectId, + body, + additionalHeaders, + additionalQueryParams, + ) override fun toString() = - "DataSourceSyncParams{pipelineId=$pipelineId, dataSourceId=$dataSourceId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "DataSourceSyncParams{pipelineId=$pipelineId, dataSourceId=$dataSourceId, projectId=$projectId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceUpdateDataSourcesParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceUpdateDataSourcesParams.kt index 6551b0e..bff3f3b 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceUpdateDataSourcesParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceUpdateDataSourcesParams.kt @@ -26,6 +26,7 @@ import kotlin.jvm.optionals.getOrNull class DataSourceUpdateDataSourcesParams private constructor( private val pipelineId: String?, + private val projectId: String?, private val body: List, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -33,6 +34,8 @@ private constructor( fun pipelineId(): Optional = Optional.ofNullable(pipelineId) + fun projectId(): Optional = Optional.ofNullable(projectId) + fun body(): List = body /** Additional headers to send with the request. */ @@ -61,6 +64,7 @@ private constructor( class Builder internal constructor() { private var pipelineId: String? = null + private var projectId: String? = null private var body: MutableList? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -69,6 +73,7 @@ private constructor( internal fun from(dataSourceUpdateDataSourcesParams: DataSourceUpdateDataSourcesParams) = apply { pipelineId = dataSourceUpdateDataSourcesParams.pipelineId + projectId = dataSourceUpdateDataSourcesParams.projectId body = dataSourceUpdateDataSourcesParams.body.toMutableList() additionalHeaders = dataSourceUpdateDataSourcesParams.additionalHeaders.toBuilder() additionalQueryParams = @@ -80,6 +85,11 @@ private constructor( /** Alias for calling [Builder.pipelineId] with `pipelineId.orElse(null)`. */ fun pipelineId(pipelineId: Optional) = pipelineId(pipelineId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun body(body: List) = apply { this.body = body.toMutableList() } /** @@ -204,6 +214,7 @@ private constructor( fun build(): DataSourceUpdateDataSourcesParams = DataSourceUpdateDataSourcesParams( pipelineId, + projectId, checkRequired("body", body).toImmutable(), additionalHeaders.build(), additionalQueryParams.build(), @@ -220,7 +231,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() /** Schema for creating an association between a data source and a pipeline. */ class Body @@ -467,14 +484,15 @@ private constructor( return other is DataSourceUpdateDataSourcesParams && pipelineId == other.pipelineId && + projectId == other.projectId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(pipelineId, body, additionalHeaders, additionalQueryParams) + Objects.hash(pipelineId, projectId, body, additionalHeaders, additionalQueryParams) override fun toString() = - "DataSourceUpdateDataSourcesParams{pipelineId=$pipelineId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "DataSourceUpdateDataSourcesParams{pipelineId=$pipelineId, projectId=$projectId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceUpdateParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceUpdateParams.kt index 584d1e9..c2c300f 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceUpdateParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceUpdateParams.kt @@ -26,6 +26,7 @@ class DataSourceUpdateParams private constructor( private val pipelineId: String, private val dataSourceId: String?, + private val projectId: String?, private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -35,6 +36,8 @@ private constructor( fun dataSourceId(): Optional = Optional.ofNullable(dataSourceId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** * The interval at which the data source should be synced. * @@ -78,6 +81,7 @@ private constructor( private var pipelineId: String? = null private var dataSourceId: String? = null + private var projectId: String? = null private var body: Body.Builder = Body.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -86,6 +90,7 @@ private constructor( internal fun from(dataSourceUpdateParams: DataSourceUpdateParams) = apply { pipelineId = dataSourceUpdateParams.pipelineId dataSourceId = dataSourceUpdateParams.dataSourceId + projectId = dataSourceUpdateParams.projectId body = dataSourceUpdateParams.body.toBuilder() additionalHeaders = dataSourceUpdateParams.additionalHeaders.toBuilder() additionalQueryParams = dataSourceUpdateParams.additionalQueryParams.toBuilder() @@ -98,6 +103,11 @@ private constructor( /** Alias for calling [Builder.dataSourceId] with `dataSourceId.orElse(null)`. */ fun dataSourceId(dataSourceId: Optional) = dataSourceId(dataSourceId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + /** * Sets the entire request body. * @@ -264,6 +274,7 @@ private constructor( DataSourceUpdateParams( checkRequired("pipelineId", pipelineId), dataSourceId, + projectId, body.build(), additionalHeaders.build(), additionalQueryParams.build(), @@ -281,7 +292,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() /** Schema for updating an association between a data source and a pipeline. */ class Body @@ -462,14 +479,22 @@ private constructor( return other is DataSourceUpdateParams && pipelineId == other.pipelineId && dataSourceId == other.dataSourceId && + projectId == other.projectId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(pipelineId, dataSourceId, body, additionalHeaders, additionalQueryParams) + Objects.hash( + pipelineId, + dataSourceId, + projectId, + body, + additionalHeaders, + additionalQueryParams, + ) override fun toString() = - "DataSourceUpdateParams{pipelineId=$pipelineId, dataSourceId=$dataSourceId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "DataSourceUpdateParams{pipelineId=$pipelineId, dataSourceId=$dataSourceId, projectId=$projectId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentCreateParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentCreateParams.kt index b21bc96..94d77c2 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentCreateParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentCreateParams.kt @@ -16,6 +16,7 @@ import kotlin.jvm.optionals.getOrNull class DocumentCreateParams private constructor( private val pipelineId: String?, + private val projectId: String?, private val body: List, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -23,6 +24,8 @@ private constructor( fun pipelineId(): Optional = Optional.ofNullable(pipelineId) + fun projectId(): Optional = Optional.ofNullable(projectId) + fun body(): List = body /** Additional headers to send with the request. */ @@ -50,6 +53,7 @@ private constructor( class Builder internal constructor() { private var pipelineId: String? = null + private var projectId: String? = null private var body: MutableList? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -57,6 +61,7 @@ private constructor( @JvmSynthetic internal fun from(documentCreateParams: DocumentCreateParams) = apply { pipelineId = documentCreateParams.pipelineId + projectId = documentCreateParams.projectId body = documentCreateParams.body.toMutableList() additionalHeaders = documentCreateParams.additionalHeaders.toBuilder() additionalQueryParams = documentCreateParams.additionalQueryParams.toBuilder() @@ -67,6 +72,11 @@ private constructor( /** Alias for calling [Builder.pipelineId] with `pipelineId.orElse(null)`. */ fun pipelineId(pipelineId: Optional) = pipelineId(pipelineId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun body(body: List) = apply { this.body = body.toMutableList() } /** @@ -191,6 +201,7 @@ private constructor( fun build(): DocumentCreateParams = DocumentCreateParams( pipelineId, + projectId, checkRequired("body", body).toImmutable(), additionalHeaders.build(), additionalQueryParams.build(), @@ -207,7 +218,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -216,14 +233,15 @@ private constructor( return other is DocumentCreateParams && pipelineId == other.pipelineId && + projectId == other.projectId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(pipelineId, body, additionalHeaders, additionalQueryParams) + Objects.hash(pipelineId, projectId, body, additionalHeaders, additionalQueryParams) override fun toString() = - "DocumentCreateParams{pipelineId=$pipelineId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "DocumentCreateParams{pipelineId=$pipelineId, projectId=$projectId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentDeleteParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentDeleteParams.kt index 00a25c3..b40f9d5 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentDeleteParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentDeleteParams.kt @@ -18,6 +18,7 @@ class DocumentDeleteParams private constructor( private val pipelineId: String, private val documentId: String?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, @@ -27,6 +28,8 @@ private constructor( fun documentId(): Optional = Optional.ofNullable(documentId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional body properties to send with the request. */ fun _additionalBodyProperties(): Map = additionalBodyProperties @@ -56,6 +59,7 @@ private constructor( private var pipelineId: String? = null private var documentId: String? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() private var additionalBodyProperties: MutableMap = mutableMapOf() @@ -64,6 +68,7 @@ private constructor( internal fun from(documentDeleteParams: DocumentDeleteParams) = apply { pipelineId = documentDeleteParams.pipelineId documentId = documentDeleteParams.documentId + projectId = documentDeleteParams.projectId additionalHeaders = documentDeleteParams.additionalHeaders.toBuilder() additionalQueryParams = documentDeleteParams.additionalQueryParams.toBuilder() additionalBodyProperties = documentDeleteParams.additionalBodyProperties.toMutableMap() @@ -76,6 +81,11 @@ private constructor( /** Alias for calling [Builder.documentId] with `documentId.orElse(null)`. */ fun documentId(documentId: Optional) = documentId(documentId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -212,6 +222,7 @@ private constructor( DocumentDeleteParams( checkRequired("pipelineId", pipelineId), documentId, + projectId, additionalHeaders.build(), additionalQueryParams.build(), additionalBodyProperties.toImmutable(), @@ -230,7 +241,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -240,6 +257,7 @@ private constructor( return other is DocumentDeleteParams && pipelineId == other.pipelineId && documentId == other.documentId && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties @@ -249,11 +267,12 @@ private constructor( Objects.hash( pipelineId, documentId, + projectId, additionalHeaders, additionalQueryParams, additionalBodyProperties, ) override fun toString() = - "DocumentDeleteParams{pipelineId=$pipelineId, documentId=$documentId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "DocumentDeleteParams{pipelineId=$pipelineId, documentId=$documentId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetChunksParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetChunksParams.kt index 3f98660..c73570c 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetChunksParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetChunksParams.kt @@ -16,6 +16,7 @@ class DocumentGetChunksParams private constructor( private val pipelineId: String, private val documentId: String?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -24,6 +25,8 @@ private constructor( fun documentId(): Optional = Optional.ofNullable(documentId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -50,6 +53,7 @@ private constructor( private var pipelineId: String? = null private var documentId: String? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -57,6 +61,7 @@ private constructor( internal fun from(documentGetChunksParams: DocumentGetChunksParams) = apply { pipelineId = documentGetChunksParams.pipelineId documentId = documentGetChunksParams.documentId + projectId = documentGetChunksParams.projectId additionalHeaders = documentGetChunksParams.additionalHeaders.toBuilder() additionalQueryParams = documentGetChunksParams.additionalQueryParams.toBuilder() } @@ -68,6 +73,11 @@ private constructor( /** Alias for calling [Builder.documentId] with `documentId.orElse(null)`. */ fun documentId(documentId: Optional) = documentId(documentId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -182,6 +192,7 @@ private constructor( DocumentGetChunksParams( checkRequired("pipelineId", pipelineId), documentId, + projectId, additionalHeaders.build(), additionalQueryParams.build(), ) @@ -196,7 +207,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -206,13 +223,14 @@ private constructor( return other is DocumentGetChunksParams && pipelineId == other.pipelineId && documentId == other.documentId && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(pipelineId, documentId, additionalHeaders, additionalQueryParams) + Objects.hash(pipelineId, documentId, projectId, additionalHeaders, additionalQueryParams) override fun toString() = - "DocumentGetChunksParams{pipelineId=$pipelineId, documentId=$documentId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "DocumentGetChunksParams{pipelineId=$pipelineId, documentId=$documentId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetParams.kt index 36f6c3e..3f93416 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetParams.kt @@ -16,6 +16,7 @@ class DocumentGetParams private constructor( private val pipelineId: String, private val documentId: String?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -24,6 +25,8 @@ private constructor( fun documentId(): Optional = Optional.ofNullable(documentId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -50,6 +53,7 @@ private constructor( private var pipelineId: String? = null private var documentId: String? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -57,6 +61,7 @@ private constructor( internal fun from(documentGetParams: DocumentGetParams) = apply { pipelineId = documentGetParams.pipelineId documentId = documentGetParams.documentId + projectId = documentGetParams.projectId additionalHeaders = documentGetParams.additionalHeaders.toBuilder() additionalQueryParams = documentGetParams.additionalQueryParams.toBuilder() } @@ -68,6 +73,11 @@ private constructor( /** Alias for calling [Builder.documentId] with `documentId.orElse(null)`. */ fun documentId(documentId: Optional) = documentId(documentId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -182,6 +192,7 @@ private constructor( DocumentGetParams( checkRequired("pipelineId", pipelineId), documentId, + projectId, additionalHeaders.build(), additionalQueryParams.build(), ) @@ -196,7 +207,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -206,13 +223,14 @@ private constructor( return other is DocumentGetParams && pipelineId == other.pipelineId && documentId == other.documentId && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(pipelineId, documentId, additionalHeaders, additionalQueryParams) + Objects.hash(pipelineId, documentId, projectId, additionalHeaders, additionalQueryParams) override fun toString() = - "DocumentGetParams{pipelineId=$pipelineId, documentId=$documentId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "DocumentGetParams{pipelineId=$pipelineId, documentId=$documentId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetStatusCountsParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetStatusCountsParams.kt index e57753b..0d02d37 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetStatusCountsParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetStatusCountsParams.kt @@ -24,6 +24,7 @@ private constructor( private val dataSourceId: String?, private val fileId: String?, private val onlyDirectUpload: Boolean?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -36,6 +37,8 @@ private constructor( fun onlyDirectUpload(): Optional = Optional.ofNullable(onlyDirectUpload) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -62,6 +65,7 @@ private constructor( private var dataSourceId: String? = null private var fileId: String? = null private var onlyDirectUpload: Boolean? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -71,6 +75,7 @@ private constructor( dataSourceId = documentGetStatusCountsParams.dataSourceId fileId = documentGetStatusCountsParams.fileId onlyDirectUpload = documentGetStatusCountsParams.onlyDirectUpload + projectId = documentGetStatusCountsParams.projectId additionalHeaders = documentGetStatusCountsParams.additionalHeaders.toBuilder() additionalQueryParams = documentGetStatusCountsParams.additionalQueryParams.toBuilder() } @@ -106,6 +111,11 @@ private constructor( fun onlyDirectUpload(onlyDirectUpload: Optional) = onlyDirectUpload(onlyDirectUpload.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -215,6 +225,7 @@ private constructor( dataSourceId, fileId, onlyDirectUpload, + projectId, additionalHeaders.build(), additionalQueryParams.build(), ) @@ -234,6 +245,7 @@ private constructor( dataSourceId?.let { put("data_source_id", it) } fileId?.let { put("file_id", it) } onlyDirectUpload?.let { put("only_direct_upload", it.toString()) } + projectId?.let { put("project_id", it) } putAll(additionalQueryParams) } .build() @@ -248,6 +260,7 @@ private constructor( dataSourceId == other.dataSourceId && fileId == other.fileId && onlyDirectUpload == other.onlyDirectUpload && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } @@ -258,10 +271,11 @@ private constructor( dataSourceId, fileId, onlyDirectUpload, + projectId, additionalHeaders, additionalQueryParams, ) override fun toString() = - "DocumentGetStatusCountsParams{pipelineId=$pipelineId, dataSourceId=$dataSourceId, fileId=$fileId, onlyDirectUpload=$onlyDirectUpload, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "DocumentGetStatusCountsParams{pipelineId=$pipelineId, dataSourceId=$dataSourceId, fileId=$fileId, onlyDirectUpload=$onlyDirectUpload, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetStatusParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetStatusParams.kt index 3129d23..2e8bae5 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetStatusParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetStatusParams.kt @@ -16,6 +16,7 @@ class DocumentGetStatusParams private constructor( private val pipelineId: String, private val documentId: String?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -24,6 +25,8 @@ private constructor( fun documentId(): Optional = Optional.ofNullable(documentId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -50,6 +53,7 @@ private constructor( private var pipelineId: String? = null private var documentId: String? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -57,6 +61,7 @@ private constructor( internal fun from(documentGetStatusParams: DocumentGetStatusParams) = apply { pipelineId = documentGetStatusParams.pipelineId documentId = documentGetStatusParams.documentId + projectId = documentGetStatusParams.projectId additionalHeaders = documentGetStatusParams.additionalHeaders.toBuilder() additionalQueryParams = documentGetStatusParams.additionalQueryParams.toBuilder() } @@ -68,6 +73,11 @@ private constructor( /** Alias for calling [Builder.documentId] with `documentId.orElse(null)`. */ fun documentId(documentId: Optional) = documentId(documentId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -182,6 +192,7 @@ private constructor( DocumentGetStatusParams( checkRequired("pipelineId", pipelineId), documentId, + projectId, additionalHeaders.build(), additionalQueryParams.build(), ) @@ -196,7 +207,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -206,13 +223,14 @@ private constructor( return other is DocumentGetStatusParams && pipelineId == other.pipelineId && documentId == other.documentId && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(pipelineId, documentId, additionalHeaders, additionalQueryParams) + Objects.hash(pipelineId, documentId, projectId, additionalHeaders, additionalQueryParams) override fun toString() = - "DocumentGetStatusParams{pipelineId=$pipelineId, documentId=$documentId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "DocumentGetStatusParams{pipelineId=$pipelineId, documentId=$documentId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentListParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentListParams.kt index fec2b64..cdf7ee2 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentListParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentListParams.kt @@ -22,6 +22,7 @@ private constructor( private val limit: Long?, private val onlyApiDataSourceDocuments: Boolean?, private val onlyDirectUpload: Boolean?, + private val projectId: String?, private val skip: Long?, private val statusRefreshPolicy: StatusRefreshPolicy?, private val additionalHeaders: Headers, @@ -39,6 +40,8 @@ private constructor( fun onlyDirectUpload(): Optional = Optional.ofNullable(onlyDirectUpload) + fun projectId(): Optional = Optional.ofNullable(projectId) + fun skip(): Optional = Optional.ofNullable(skip) fun statusRefreshPolicy(): Optional = @@ -68,6 +71,7 @@ private constructor( private var limit: Long? = null private var onlyApiDataSourceDocuments: Boolean? = null private var onlyDirectUpload: Boolean? = null + private var projectId: String? = null private var skip: Long? = null private var statusRefreshPolicy: StatusRefreshPolicy? = null private var additionalHeaders: Headers.Builder = Headers.builder() @@ -80,6 +84,7 @@ private constructor( limit = documentListParams.limit onlyApiDataSourceDocuments = documentListParams.onlyApiDataSourceDocuments onlyDirectUpload = documentListParams.onlyDirectUpload + projectId = documentListParams.projectId skip = documentListParams.skip statusRefreshPolicy = documentListParams.statusRefreshPolicy additionalHeaders = documentListParams.additionalHeaders.toBuilder() @@ -143,6 +148,11 @@ private constructor( fun onlyDirectUpload(onlyDirectUpload: Optional) = onlyDirectUpload(onlyDirectUpload.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun skip(skip: Long?) = apply { this.skip = skip } /** @@ -275,6 +285,7 @@ private constructor( limit, onlyApiDataSourceDocuments, onlyDirectUpload, + projectId, skip, statusRefreshPolicy, additionalHeaders.build(), @@ -299,6 +310,7 @@ private constructor( put("only_api_data_source_documents", it.toString()) } onlyDirectUpload?.let { put("only_direct_upload", it.toString()) } + projectId?.let { put("project_id", it) } skip?.let { put("skip", it.toString()) } statusRefreshPolicy?.let { put("status_refresh_policy", it.toString()) } putAll(additionalQueryParams) @@ -457,6 +469,7 @@ private constructor( limit == other.limit && onlyApiDataSourceDocuments == other.onlyApiDataSourceDocuments && onlyDirectUpload == other.onlyDirectUpload && + projectId == other.projectId && skip == other.skip && statusRefreshPolicy == other.statusRefreshPolicy && additionalHeaders == other.additionalHeaders && @@ -470,6 +483,7 @@ private constructor( limit, onlyApiDataSourceDocuments, onlyDirectUpload, + projectId, skip, statusRefreshPolicy, additionalHeaders, @@ -477,5 +491,5 @@ private constructor( ) override fun toString() = - "DocumentListParams{pipelineId=$pipelineId, fileId=$fileId, limit=$limit, onlyApiDataSourceDocuments=$onlyApiDataSourceDocuments, onlyDirectUpload=$onlyDirectUpload, skip=$skip, statusRefreshPolicy=$statusRefreshPolicy, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "DocumentListParams{pipelineId=$pipelineId, fileId=$fileId, limit=$limit, onlyApiDataSourceDocuments=$onlyApiDataSourceDocuments, onlyDirectUpload=$onlyDirectUpload, projectId=$projectId, skip=$skip, statusRefreshPolicy=$statusRefreshPolicy, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentSyncParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentSyncParams.kt index 3e887f6..9d5c08e 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentSyncParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentSyncParams.kt @@ -18,6 +18,7 @@ class DocumentSyncParams private constructor( private val pipelineId: String, private val documentId: String?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, @@ -27,6 +28,8 @@ private constructor( fun documentId(): Optional = Optional.ofNullable(documentId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional body properties to send with the request. */ fun _additionalBodyProperties(): Map = additionalBodyProperties @@ -56,6 +59,7 @@ private constructor( private var pipelineId: String? = null private var documentId: String? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() private var additionalBodyProperties: MutableMap = mutableMapOf() @@ -64,6 +68,7 @@ private constructor( internal fun from(documentSyncParams: DocumentSyncParams) = apply { pipelineId = documentSyncParams.pipelineId documentId = documentSyncParams.documentId + projectId = documentSyncParams.projectId additionalHeaders = documentSyncParams.additionalHeaders.toBuilder() additionalQueryParams = documentSyncParams.additionalQueryParams.toBuilder() additionalBodyProperties = documentSyncParams.additionalBodyProperties.toMutableMap() @@ -76,6 +81,11 @@ private constructor( /** Alias for calling [Builder.documentId] with `documentId.orElse(null)`. */ fun documentId(documentId: Optional) = documentId(documentId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -212,6 +222,7 @@ private constructor( DocumentSyncParams( checkRequired("pipelineId", pipelineId), documentId, + projectId, additionalHeaders.build(), additionalQueryParams.build(), additionalBodyProperties.toImmutable(), @@ -230,7 +241,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -240,6 +257,7 @@ private constructor( return other is DocumentSyncParams && pipelineId == other.pipelineId && documentId == other.documentId && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties @@ -249,11 +267,12 @@ private constructor( Objects.hash( pipelineId, documentId, + projectId, additionalHeaders, additionalQueryParams, additionalBodyProperties, ) override fun toString() = - "DocumentSyncParams{pipelineId=$pipelineId, documentId=$documentId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "DocumentSyncParams{pipelineId=$pipelineId, documentId=$documentId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentUpsertParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentUpsertParams.kt index 30327ac..8587e41 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentUpsertParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentUpsertParams.kt @@ -16,6 +16,7 @@ import kotlin.jvm.optionals.getOrNull class DocumentUpsertParams private constructor( private val pipelineId: String?, + private val projectId: String?, private val body: List, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -23,6 +24,8 @@ private constructor( fun pipelineId(): Optional = Optional.ofNullable(pipelineId) + fun projectId(): Optional = Optional.ofNullable(projectId) + fun body(): List = body /** Additional headers to send with the request. */ @@ -50,6 +53,7 @@ private constructor( class Builder internal constructor() { private var pipelineId: String? = null + private var projectId: String? = null private var body: MutableList? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -57,6 +61,7 @@ private constructor( @JvmSynthetic internal fun from(documentUpsertParams: DocumentUpsertParams) = apply { pipelineId = documentUpsertParams.pipelineId + projectId = documentUpsertParams.projectId body = documentUpsertParams.body.toMutableList() additionalHeaders = documentUpsertParams.additionalHeaders.toBuilder() additionalQueryParams = documentUpsertParams.additionalQueryParams.toBuilder() @@ -67,6 +72,11 @@ private constructor( /** Alias for calling [Builder.pipelineId] with `pipelineId.orElse(null)`. */ fun pipelineId(pipelineId: Optional) = pipelineId(pipelineId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun body(body: List) = apply { this.body = body.toMutableList() } /** @@ -191,6 +201,7 @@ private constructor( fun build(): DocumentUpsertParams = DocumentUpsertParams( pipelineId, + projectId, checkRequired("body", body).toImmutable(), additionalHeaders.build(), additionalQueryParams.build(), @@ -207,7 +218,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -216,14 +233,15 @@ private constructor( return other is DocumentUpsertParams && pipelineId == other.pipelineId && + projectId == other.projectId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(pipelineId, body, additionalHeaders, additionalQueryParams) + Objects.hash(pipelineId, projectId, body, additionalHeaders, additionalQueryParams) override fun toString() = - "DocumentUpsertParams{pipelineId=$pipelineId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "DocumentUpsertParams{pipelineId=$pipelineId, projectId=$projectId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileCreateParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileCreateParams.kt index 33629af..aefcb74 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileCreateParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileCreateParams.kt @@ -26,6 +26,7 @@ import kotlin.jvm.optionals.getOrNull class FileCreateParams private constructor( private val pipelineId: String?, + private val projectId: String?, private val body: List, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -33,6 +34,8 @@ private constructor( fun pipelineId(): Optional = Optional.ofNullable(pipelineId) + fun projectId(): Optional = Optional.ofNullable(projectId) + fun body(): List = body /** Additional headers to send with the request. */ @@ -60,6 +63,7 @@ private constructor( class Builder internal constructor() { private var pipelineId: String? = null + private var projectId: String? = null private var body: MutableList? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -67,6 +71,7 @@ private constructor( @JvmSynthetic internal fun from(fileCreateParams: FileCreateParams) = apply { pipelineId = fileCreateParams.pipelineId + projectId = fileCreateParams.projectId body = fileCreateParams.body.toMutableList() additionalHeaders = fileCreateParams.additionalHeaders.toBuilder() additionalQueryParams = fileCreateParams.additionalQueryParams.toBuilder() @@ -77,6 +82,11 @@ private constructor( /** Alias for calling [Builder.pipelineId] with `pipelineId.orElse(null)`. */ fun pipelineId(pipelineId: Optional) = pipelineId(pipelineId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun body(body: List) = apply { this.body = body.toMutableList() } /** @@ -201,6 +211,7 @@ private constructor( fun build(): FileCreateParams = FileCreateParams( pipelineId, + projectId, checkRequired("body", body).toImmutable(), additionalHeaders.build(), additionalQueryParams.build(), @@ -217,7 +228,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() /** Schema for creating a file that is associated with a pipeline. */ class Body @@ -560,14 +577,15 @@ private constructor( return other is FileCreateParams && pipelineId == other.pipelineId && + projectId == other.projectId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(pipelineId, body, additionalHeaders, additionalQueryParams) + Objects.hash(pipelineId, projectId, body, additionalHeaders, additionalQueryParams) override fun toString() = - "FileCreateParams{pipelineId=$pipelineId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "FileCreateParams{pipelineId=$pipelineId, projectId=$projectId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileDeleteParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileDeleteParams.kt index 92f8361..e5c0529 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileDeleteParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileDeleteParams.kt @@ -18,6 +18,7 @@ class FileDeleteParams private constructor( private val pipelineId: String, private val fileId: String?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, @@ -27,6 +28,8 @@ private constructor( fun fileId(): Optional = Optional.ofNullable(fileId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional body properties to send with the request. */ fun _additionalBodyProperties(): Map = additionalBodyProperties @@ -56,6 +59,7 @@ private constructor( private var pipelineId: String? = null private var fileId: String? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() private var additionalBodyProperties: MutableMap = mutableMapOf() @@ -64,6 +68,7 @@ private constructor( internal fun from(fileDeleteParams: FileDeleteParams) = apply { pipelineId = fileDeleteParams.pipelineId fileId = fileDeleteParams.fileId + projectId = fileDeleteParams.projectId additionalHeaders = fileDeleteParams.additionalHeaders.toBuilder() additionalQueryParams = fileDeleteParams.additionalQueryParams.toBuilder() additionalBodyProperties = fileDeleteParams.additionalBodyProperties.toMutableMap() @@ -76,6 +81,11 @@ private constructor( /** Alias for calling [Builder.fileId] with `fileId.orElse(null)`. */ fun fileId(fileId: Optional) = fileId(fileId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -212,6 +222,7 @@ private constructor( FileDeleteParams( checkRequired("pipelineId", pipelineId), fileId, + projectId, additionalHeaders.build(), additionalQueryParams.build(), additionalBodyProperties.toImmutable(), @@ -230,7 +241,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -240,6 +257,7 @@ private constructor( return other is FileDeleteParams && pipelineId == other.pipelineId && fileId == other.fileId && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties @@ -249,11 +267,12 @@ private constructor( Objects.hash( pipelineId, fileId, + projectId, additionalHeaders, additionalQueryParams, additionalBodyProperties, ) override fun toString() = - "FileDeleteParams{pipelineId=$pipelineId, fileId=$fileId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "FileDeleteParams{pipelineId=$pipelineId, fileId=$fileId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileGetStatusCountsParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileGetStatusCountsParams.kt index 69de88a..4739906 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileGetStatusCountsParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileGetStatusCountsParams.kt @@ -16,6 +16,7 @@ private constructor( private val pipelineId: String?, private val dataSourceId: String?, private val onlyManuallyUploaded: Boolean?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -26,6 +27,8 @@ private constructor( fun onlyManuallyUploaded(): Optional = Optional.ofNullable(onlyManuallyUploaded) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -50,6 +53,7 @@ private constructor( private var pipelineId: String? = null private var dataSourceId: String? = null private var onlyManuallyUploaded: Boolean? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -58,6 +62,7 @@ private constructor( pipelineId = fileGetStatusCountsParams.pipelineId dataSourceId = fileGetStatusCountsParams.dataSourceId onlyManuallyUploaded = fileGetStatusCountsParams.onlyManuallyUploaded + projectId = fileGetStatusCountsParams.projectId additionalHeaders = fileGetStatusCountsParams.additionalHeaders.toBuilder() additionalQueryParams = fileGetStatusCountsParams.additionalQueryParams.toBuilder() } @@ -91,6 +96,11 @@ private constructor( fun onlyManuallyUploaded(onlyManuallyUploaded: Optional) = onlyManuallyUploaded(onlyManuallyUploaded.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -199,6 +209,7 @@ private constructor( pipelineId, dataSourceId, onlyManuallyUploaded, + projectId, additionalHeaders.build(), additionalQueryParams.build(), ) @@ -217,6 +228,7 @@ private constructor( .apply { dataSourceId?.let { put("data_source_id", it) } onlyManuallyUploaded?.let { put("only_manually_uploaded", it.toString()) } + projectId?.let { put("project_id", it) } putAll(additionalQueryParams) } .build() @@ -230,6 +242,7 @@ private constructor( pipelineId == other.pipelineId && dataSourceId == other.dataSourceId && onlyManuallyUploaded == other.onlyManuallyUploaded && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } @@ -239,10 +252,11 @@ private constructor( pipelineId, dataSourceId, onlyManuallyUploaded, + projectId, additionalHeaders, additionalQueryParams, ) override fun toString() = - "FileGetStatusCountsParams{pipelineId=$pipelineId, dataSourceId=$dataSourceId, onlyManuallyUploaded=$onlyManuallyUploaded, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "FileGetStatusCountsParams{pipelineId=$pipelineId, dataSourceId=$dataSourceId, onlyManuallyUploaded=$onlyManuallyUploaded, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileGetStatusParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileGetStatusParams.kt index 4aa0b51..07eb695 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileGetStatusParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileGetStatusParams.kt @@ -16,6 +16,7 @@ class FileGetStatusParams private constructor( private val pipelineId: String, private val fileId: String?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -24,6 +25,8 @@ private constructor( fun fileId(): Optional = Optional.ofNullable(fileId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -50,6 +53,7 @@ private constructor( private var pipelineId: String? = null private var fileId: String? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -57,6 +61,7 @@ private constructor( internal fun from(fileGetStatusParams: FileGetStatusParams) = apply { pipelineId = fileGetStatusParams.pipelineId fileId = fileGetStatusParams.fileId + projectId = fileGetStatusParams.projectId additionalHeaders = fileGetStatusParams.additionalHeaders.toBuilder() additionalQueryParams = fileGetStatusParams.additionalQueryParams.toBuilder() } @@ -68,6 +73,11 @@ private constructor( /** Alias for calling [Builder.fileId] with `fileId.orElse(null)`. */ fun fileId(fileId: Optional) = fileId(fileId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -182,6 +192,7 @@ private constructor( FileGetStatusParams( checkRequired("pipelineId", pipelineId), fileId, + projectId, additionalHeaders.build(), additionalQueryParams.build(), ) @@ -196,7 +207,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -206,13 +223,14 @@ private constructor( return other is FileGetStatusParams && pipelineId == other.pipelineId && fileId == other.fileId && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(pipelineId, fileId, additionalHeaders, additionalQueryParams) + Objects.hash(pipelineId, fileId, projectId, additionalHeaders, additionalQueryParams) override fun toString() = - "FileGetStatusParams{pipelineId=$pipelineId, fileId=$fileId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "FileGetStatusParams{pipelineId=$pipelineId, fileId=$fileId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileListParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileListParams.kt index 58f3e66..2ee4306 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileListParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileListParams.kt @@ -25,6 +25,7 @@ private constructor( private val offset: Long?, private val onlyManuallyUploaded: Boolean?, private val orderBy: String?, + private val projectId: String?, private val statuses: List?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -44,6 +45,8 @@ private constructor( fun orderBy(): Optional = Optional.ofNullable(orderBy) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Filter by file statuses */ fun statuses(): Optional> = Optional.ofNullable(statuses) @@ -73,6 +76,7 @@ private constructor( private var offset: Long? = null private var onlyManuallyUploaded: Boolean? = null private var orderBy: String? = null + private var projectId: String? = null private var statuses: MutableList? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -86,6 +90,7 @@ private constructor( offset = fileListParams.offset onlyManuallyUploaded = fileListParams.onlyManuallyUploaded orderBy = fileListParams.orderBy + projectId = fileListParams.projectId statuses = fileListParams.statuses?.toMutableList() additionalHeaders = fileListParams.additionalHeaders.toBuilder() additionalQueryParams = fileListParams.additionalQueryParams.toBuilder() @@ -157,6 +162,11 @@ private constructor( /** Alias for calling [Builder.orderBy] with `orderBy.orElse(null)`. */ fun orderBy(orderBy: Optional) = orderBy(orderBy.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + /** Filter by file statuses */ fun statuses(statuses: List?) = apply { this.statuses = statuses?.toMutableList() } @@ -284,6 +294,7 @@ private constructor( offset, onlyManuallyUploaded, orderBy, + projectId, statuses?.toImmutable(), additionalHeaders.build(), additionalQueryParams.build(), @@ -307,6 +318,7 @@ private constructor( offset?.let { put("offset", it.toString()) } onlyManuallyUploaded?.let { put("only_manually_uploaded", it.toString()) } orderBy?.let { put("order_by", it) } + projectId?.let { put("project_id", it) } statuses?.forEach { put("statuses", it.toString()) } putAll(additionalQueryParams) } @@ -479,6 +491,7 @@ private constructor( offset == other.offset && onlyManuallyUploaded == other.onlyManuallyUploaded && orderBy == other.orderBy && + projectId == other.projectId && statuses == other.statuses && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams @@ -493,11 +506,12 @@ private constructor( offset, onlyManuallyUploaded, orderBy, + projectId, statuses, additionalHeaders, additionalQueryParams, ) override fun toString() = - "FileListParams{pipelineId=$pipelineId, dataSourceId=$dataSourceId, fileNameContains=$fileNameContains, limit=$limit, offset=$offset, onlyManuallyUploaded=$onlyManuallyUploaded, orderBy=$orderBy, statuses=$statuses, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "FileListParams{pipelineId=$pipelineId, dataSourceId=$dataSourceId, fileNameContains=$fileNameContains, limit=$limit, offset=$offset, onlyManuallyUploaded=$onlyManuallyUploaded, orderBy=$orderBy, projectId=$projectId, statuses=$statuses, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileUpdateParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileUpdateParams.kt index 87125ff..0a1bf99 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileUpdateParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileUpdateParams.kt @@ -27,6 +27,7 @@ class FileUpdateParams private constructor( private val pipelineId: String, private val fileId: String?, + private val projectId: String?, private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -36,6 +37,8 @@ private constructor( fun fileId(): Optional = Optional.ofNullable(fileId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** * Custom metadata for the file * @@ -79,6 +82,7 @@ private constructor( private var pipelineId: String? = null private var fileId: String? = null + private var projectId: String? = null private var body: Body.Builder = Body.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -87,6 +91,7 @@ private constructor( internal fun from(fileUpdateParams: FileUpdateParams) = apply { pipelineId = fileUpdateParams.pipelineId fileId = fileUpdateParams.fileId + projectId = fileUpdateParams.projectId body = fileUpdateParams.body.toBuilder() additionalHeaders = fileUpdateParams.additionalHeaders.toBuilder() additionalQueryParams = fileUpdateParams.additionalQueryParams.toBuilder() @@ -99,6 +104,11 @@ private constructor( /** Alias for calling [Builder.fileId] with `fileId.orElse(null)`. */ fun fileId(fileId: Optional) = fileId(fileId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + /** * Sets the entire request body. * @@ -261,6 +271,7 @@ private constructor( FileUpdateParams( checkRequired("pipelineId", pipelineId), fileId, + projectId, body.build(), additionalHeaders.build(), additionalQueryParams.build(), @@ -278,7 +289,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() /** Request to update a pipeline file. */ class Body @@ -562,14 +579,15 @@ private constructor( return other is FileUpdateParams && pipelineId == other.pipelineId && fileId == other.fileId && + projectId == other.projectId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(pipelineId, fileId, body, additionalHeaders, additionalQueryParams) + Objects.hash(pipelineId, fileId, projectId, body, additionalHeaders, additionalQueryParams) override fun toString() = - "FileUpdateParams{pipelineId=$pipelineId, fileId=$fileId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "FileUpdateParams{pipelineId=$pipelineId, fileId=$fileId, projectId=$projectId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/metadata/MetadataCreateParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/metadata/MetadataCreateParams.kt index 1e18138..095a378 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/metadata/MetadataCreateParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/metadata/MetadataCreateParams.kt @@ -28,6 +28,7 @@ import kotlin.jvm.optionals.getOrNull class MetadataCreateParams private constructor( private val pipelineId: String?, + private val projectId: String?, private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, @@ -35,6 +36,8 @@ private constructor( fun pipelineId(): Optional = Optional.ofNullable(pipelineId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -75,6 +78,7 @@ private constructor( class Builder internal constructor() { private var pipelineId: String? = null + private var projectId: String? = null private var body: Body.Builder = Body.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -82,6 +86,7 @@ private constructor( @JvmSynthetic internal fun from(metadataCreateParams: MetadataCreateParams) = apply { pipelineId = metadataCreateParams.pipelineId + projectId = metadataCreateParams.projectId body = metadataCreateParams.body.toBuilder() additionalHeaders = metadataCreateParams.additionalHeaders.toBuilder() additionalQueryParams = metadataCreateParams.additionalQueryParams.toBuilder() @@ -92,6 +97,11 @@ private constructor( /** Alias for calling [Builder.pipelineId] with `pipelineId.orElse(null)`. */ fun pipelineId(pipelineId: Optional) = pipelineId(pipelineId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + /** * Sets the entire request body. * @@ -250,6 +260,7 @@ private constructor( fun build(): MetadataCreateParams = MetadataCreateParams( pipelineId, + projectId, body.build(), additionalHeaders.build(), additionalQueryParams.build(), @@ -269,7 +280,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() class Body private constructor( @@ -441,14 +458,15 @@ private constructor( return other is MetadataCreateParams && pipelineId == other.pipelineId && + projectId == other.projectId && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams } override fun hashCode(): Int = - Objects.hash(pipelineId, body, additionalHeaders, additionalQueryParams) + Objects.hash(pipelineId, projectId, body, additionalHeaders, additionalQueryParams) override fun toString() = - "MetadataCreateParams{pipelineId=$pipelineId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "MetadataCreateParams{pipelineId=$pipelineId, projectId=$projectId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/metadata/MetadataDeleteAllParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/metadata/MetadataDeleteAllParams.kt index 0597db0..c8adfda 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/metadata/MetadataDeleteAllParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/metadata/MetadataDeleteAllParams.kt @@ -16,6 +16,7 @@ import kotlin.jvm.optionals.getOrNull class MetadataDeleteAllParams private constructor( private val pipelineId: String?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, @@ -23,6 +24,8 @@ private constructor( fun pipelineId(): Optional = Optional.ofNullable(pipelineId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional body properties to send with the request. */ fun _additionalBodyProperties(): Map = additionalBodyProperties @@ -46,6 +49,7 @@ private constructor( class Builder internal constructor() { private var pipelineId: String? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() private var additionalBodyProperties: MutableMap = mutableMapOf() @@ -53,6 +57,7 @@ private constructor( @JvmSynthetic internal fun from(metadataDeleteAllParams: MetadataDeleteAllParams) = apply { pipelineId = metadataDeleteAllParams.pipelineId + projectId = metadataDeleteAllParams.projectId additionalHeaders = metadataDeleteAllParams.additionalHeaders.toBuilder() additionalQueryParams = metadataDeleteAllParams.additionalQueryParams.toBuilder() additionalBodyProperties = @@ -64,6 +69,11 @@ private constructor( /** Alias for calling [Builder.pipelineId] with `pipelineId.orElse(null)`. */ fun pipelineId(pipelineId: Optional) = pipelineId(pipelineId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -192,6 +202,7 @@ private constructor( fun build(): MetadataDeleteAllParams = MetadataDeleteAllParams( pipelineId, + projectId, additionalHeaders.build(), additionalQueryParams.build(), additionalBodyProperties.toImmutable(), @@ -209,7 +220,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -218,14 +235,21 @@ private constructor( return other is MetadataDeleteAllParams && pipelineId == other.pipelineId && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties } override fun hashCode(): Int = - Objects.hash(pipelineId, additionalHeaders, additionalQueryParams, additionalBodyProperties) + Objects.hash( + pipelineId, + projectId, + additionalHeaders, + additionalQueryParams, + additionalBodyProperties, + ) override fun toString() = - "MetadataDeleteAllParams{pipelineId=$pipelineId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "MetadataDeleteAllParams{pipelineId=$pipelineId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/sync/SyncCancelParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/sync/SyncCancelParams.kt index aea0594..21e1221 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/sync/SyncCancelParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/sync/SyncCancelParams.kt @@ -16,6 +16,7 @@ import kotlin.jvm.optionals.getOrNull class SyncCancelParams private constructor( private val pipelineId: String?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, @@ -23,6 +24,8 @@ private constructor( fun pipelineId(): Optional = Optional.ofNullable(pipelineId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional body properties to send with the request. */ fun _additionalBodyProperties(): Map = additionalBodyProperties @@ -46,6 +49,7 @@ private constructor( class Builder internal constructor() { private var pipelineId: String? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() private var additionalBodyProperties: MutableMap = mutableMapOf() @@ -53,6 +57,7 @@ private constructor( @JvmSynthetic internal fun from(syncCancelParams: SyncCancelParams) = apply { pipelineId = syncCancelParams.pipelineId + projectId = syncCancelParams.projectId additionalHeaders = syncCancelParams.additionalHeaders.toBuilder() additionalQueryParams = syncCancelParams.additionalQueryParams.toBuilder() additionalBodyProperties = syncCancelParams.additionalBodyProperties.toMutableMap() @@ -63,6 +68,11 @@ private constructor( /** Alias for calling [Builder.pipelineId] with `pipelineId.orElse(null)`. */ fun pipelineId(pipelineId: Optional) = pipelineId(pipelineId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -191,6 +201,7 @@ private constructor( fun build(): SyncCancelParams = SyncCancelParams( pipelineId, + projectId, additionalHeaders.build(), additionalQueryParams.build(), additionalBodyProperties.toImmutable(), @@ -208,7 +219,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -217,14 +234,21 @@ private constructor( return other is SyncCancelParams && pipelineId == other.pipelineId && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties } override fun hashCode(): Int = - Objects.hash(pipelineId, additionalHeaders, additionalQueryParams, additionalBodyProperties) + Objects.hash( + pipelineId, + projectId, + additionalHeaders, + additionalQueryParams, + additionalBodyProperties, + ) override fun toString() = - "SyncCancelParams{pipelineId=$pipelineId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "SyncCancelParams{pipelineId=$pipelineId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/sync/SyncCreateParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/sync/SyncCreateParams.kt index a5bc4d6..b84d282 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/sync/SyncCreateParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/pipelines/sync/SyncCreateParams.kt @@ -21,6 +21,7 @@ import kotlin.jvm.optionals.getOrNull class SyncCreateParams private constructor( private val pipelineId: String?, + private val projectId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, @@ -28,6 +29,8 @@ private constructor( fun pipelineId(): Optional = Optional.ofNullable(pipelineId) + fun projectId(): Optional = Optional.ofNullable(projectId) + /** Additional body properties to send with the request. */ fun _additionalBodyProperties(): Map = additionalBodyProperties @@ -51,6 +54,7 @@ private constructor( class Builder internal constructor() { private var pipelineId: String? = null + private var projectId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() private var additionalBodyProperties: MutableMap = mutableMapOf() @@ -58,6 +62,7 @@ private constructor( @JvmSynthetic internal fun from(syncCreateParams: SyncCreateParams) = apply { pipelineId = syncCreateParams.pipelineId + projectId = syncCreateParams.projectId additionalHeaders = syncCreateParams.additionalHeaders.toBuilder() additionalQueryParams = syncCreateParams.additionalQueryParams.toBuilder() additionalBodyProperties = syncCreateParams.additionalBodyProperties.toMutableMap() @@ -68,6 +73,11 @@ private constructor( /** Alias for calling [Builder.pipelineId] with `pipelineId.orElse(null)`. */ fun pipelineId(pipelineId: Optional) = pipelineId(pipelineId.getOrNull()) + fun projectId(projectId: String?) = apply { this.projectId = projectId } + + /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ + fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -196,6 +206,7 @@ private constructor( fun build(): SyncCreateParams = SyncCreateParams( pipelineId, + projectId, additionalHeaders.build(), additionalQueryParams.build(), additionalBodyProperties.toImmutable(), @@ -213,7 +224,13 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + projectId?.let { put("project_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { @@ -222,14 +239,21 @@ private constructor( return other is SyncCreateParams && pipelineId == other.pipelineId && + projectId == other.projectId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties } override fun hashCode(): Int = - Objects.hash(pipelineId, additionalHeaders, additionalQueryParams, additionalBodyProperties) + Objects.hash( + pipelineId, + projectId, + additionalHeaders, + additionalQueryParams, + additionalBodyProperties, + ) override fun toString() = - "SyncCreateParams{pipelineId=$pipelineId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "SyncCreateParams{pipelineId=$pipelineId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkDeleteParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkDeleteParamsTest.kt index bec3fac..f83850e 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkDeleteParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkDeleteParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.datasinks +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -9,7 +10,10 @@ internal class DataSinkDeleteParamsTest { @Test fun create() { - DataSinkDeleteParams.builder().dataSinkId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() + DataSinkDeleteParams.builder() + .dataSinkId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() } @Test @@ -23,4 +27,34 @@ internal class DataSinkDeleteParamsTest { // out-of-bound path param assertThat(params._pathParam(1)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + DataSinkDeleteParams.builder() + .dataSinkId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + DataSinkDeleteParams.builder() + .dataSinkId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkGetParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkGetParamsTest.kt index f6af70d..5f2f544 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkGetParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkGetParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.datasinks +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -9,7 +10,10 @@ internal class DataSinkGetParamsTest { @Test fun create() { - DataSinkGetParams.builder().dataSinkId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() + DataSinkGetParams.builder() + .dataSinkId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() } @Test @@ -21,4 +25,32 @@ internal class DataSinkGetParamsTest { // out-of-bound path param assertThat(params._pathParam(1)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + DataSinkGetParams.builder() + .dataSinkId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + DataSinkGetParams.builder().dataSinkId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkUpdateParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkUpdateParamsTest.kt index 474b272..9d4a781 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkUpdateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasinks/DataSinkUpdateParamsTest.kt @@ -3,6 +3,7 @@ package ai.llamaindex.llamacloud.models.datasinks import ai.llamaindex.llamacloud.core.JsonValue +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -12,6 +13,7 @@ internal class DataSinkUpdateParamsTest { fun create() { DataSinkUpdateParams.builder() .dataSinkId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .sinkType(DataSinkUpdateParams.SinkType.ASTRA_DB) .component( DataSinkUpdateParams.Component.UnionMember0.builder() @@ -35,11 +37,50 @@ internal class DataSinkUpdateParamsTest { assertThat(params._pathParam(1)).isEqualTo("") } + @Test + fun queryParams() { + val params = + DataSinkUpdateParams.builder() + .dataSinkId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .sinkType(DataSinkUpdateParams.SinkType.ASTRA_DB) + .component( + DataSinkUpdateParams.Component.UnionMember0.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .name("name") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + DataSinkUpdateParams.builder() + .dataSinkId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .sinkType(DataSinkUpdateParams.SinkType.ASTRA_DB) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } + @Test fun body() { val params = DataSinkUpdateParams.builder() .dataSinkId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .sinkType(DataSinkUpdateParams.SinkType.ASTRA_DB) .component( DataSinkUpdateParams.Component.UnionMember0.builder() diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceDeleteParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceDeleteParamsTest.kt index ee58c03..283c5d2 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceDeleteParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceDeleteParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.datasources +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -11,6 +12,7 @@ internal class DataSourceDeleteParamsTest { fun create() { DataSourceDeleteParams.builder() .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } @@ -25,4 +27,34 @@ internal class DataSourceDeleteParamsTest { // out-of-bound path param assertThat(params._pathParam(1)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + DataSourceDeleteParams.builder() + .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + DataSourceDeleteParams.builder() + .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceGetParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceGetParamsTest.kt index a803039..fb712ea 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceGetParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceGetParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.datasources +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -9,7 +10,10 @@ internal class DataSourceGetParamsTest { @Test fun create() { - DataSourceGetParams.builder().dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() + DataSourceGetParams.builder() + .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() } @Test @@ -23,4 +27,34 @@ internal class DataSourceGetParamsTest { // out-of-bound path param assertThat(params._pathParam(1)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + DataSourceGetParams.builder() + .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + DataSourceGetParams.builder() + .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceUpdateParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceUpdateParamsTest.kt index 4f1bc85..bdfe4f8 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceUpdateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/datasources/DataSourceUpdateParamsTest.kt @@ -3,6 +3,7 @@ package ai.llamaindex.llamacloud.models.datasources import ai.llamaindex.llamacloud.core.JsonValue +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -12,6 +13,7 @@ internal class DataSourceUpdateParamsTest { fun create() { DataSourceUpdateParams.builder() .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .sourceType(DataSourceUpdateParams.SourceType.AZURE_STORAGE_BLOB) .component( DataSourceUpdateParams.Component.UnionMember0.builder() @@ -40,11 +42,55 @@ internal class DataSourceUpdateParamsTest { assertThat(params._pathParam(1)).isEqualTo("") } + @Test + fun queryParams() { + val params = + DataSourceUpdateParams.builder() + .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .sourceType(DataSourceUpdateParams.SourceType.AZURE_STORAGE_BLOB) + .component( + DataSourceUpdateParams.Component.UnionMember0.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .customMetadata( + DataSourceUpdateParams.CustomMetadata.builder() + .putAdditionalProperty("foo", JsonValue.from(mapOf("foo" to "bar"))) + .build() + ) + .name("name") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + DataSourceUpdateParams.builder() + .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .sourceType(DataSourceUpdateParams.SourceType.AZURE_STORAGE_BLOB) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } + @Test fun body() { val params = DataSourceUpdateParams.builder() .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .sourceType(DataSourceUpdateParams.SourceType.AZURE_STORAGE_BLOB) .component( DataSourceUpdateParams.Component.UnionMember0.builder() diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineDeleteParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineDeleteParamsTest.kt index 36d43dd..71f6a85 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineDeleteParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineDeleteParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.pipelines +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -9,7 +10,10 @@ internal class PipelineDeleteParamsTest { @Test fun create() { - PipelineDeleteParams.builder().pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() + PipelineDeleteParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() } @Test @@ -23,4 +27,34 @@ internal class PipelineDeleteParamsTest { // out-of-bound path param assertThat(params._pathParam(1)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + PipelineDeleteParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + PipelineDeleteParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineGetParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineGetParamsTest.kt index fe2e8b5..5813c62 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineGetParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineGetParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.pipelines +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -9,7 +10,10 @@ internal class PipelineGetParamsTest { @Test fun create() { - PipelineGetParams.builder().pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() + PipelineGetParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() } @Test @@ -21,4 +25,32 @@ internal class PipelineGetParamsTest { // out-of-bound path param assertThat(params._pathParam(1)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + PipelineGetParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + PipelineGetParams.builder().pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineGetStatusParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineGetStatusParamsTest.kt index ffc676b..1d855ad 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineGetStatusParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineGetStatusParamsTest.kt @@ -13,6 +13,7 @@ internal class PipelineGetStatusParamsTest { PipelineGetStatusParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fullDetails(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } @@ -34,11 +35,18 @@ internal class PipelineGetStatusParamsTest { PipelineGetStatusParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fullDetails(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val queryParams = params._queryParams() - assertThat(queryParams).isEqualTo(QueryParams.builder().put("full_details", "true").build()) + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("full_details", "true") + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) } @Test diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineUpdateParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineUpdateParamsTest.kt index 2abb0fc..b751906 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineUpdateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/PipelineUpdateParamsTest.kt @@ -3,6 +3,7 @@ package ai.llamaindex.llamacloud.models.pipelines import ai.llamaindex.llamacloud.core.JsonValue +import ai.llamaindex.llamacloud.core.http.QueryParams import ai.llamaindex.llamacloud.models.parsing.FailPageMode import ai.llamaindex.llamacloud.models.parsing.ParsingLanguages import ai.llamaindex.llamacloud.models.parsing.ParsingMode @@ -15,6 +16,7 @@ internal class PipelineUpdateParamsTest { fun create() { PipelineUpdateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dataSink( DataSinkCreate.builder() .component( @@ -284,11 +286,300 @@ internal class PipelineUpdateParamsTest { assertThat(params._pathParam(1)).isEqualTo("") } + @Test + fun queryParams() { + val params = + PipelineUpdateParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dataSink( + DataSinkCreate.builder() + .component( + DataSinkCreate.Component.UnionMember0.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .name("name") + .sinkType(DataSinkCreate.SinkType.ASTRA_DB) + .build() + ) + .dataSinkId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .embeddingConfig( + AzureOpenAIEmbeddingConfig.builder() + .component( + AzureOpenAIEmbedding.builder() + .additionalKwargs( + AzureOpenAIEmbedding.AdditionalKwargs.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .apiBase("api_base") + .apiKey("api_key") + .apiVersion("api_version") + .azureDeployment("azure_deployment") + .azureEndpoint("azure_endpoint") + .className("class_name") + .defaultHeaders( + AzureOpenAIEmbedding.DefaultHeaders.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .dimensions(0L) + .embedBatchSize(1L) + .maxRetries(0L) + .modelName("model_name") + .numWorkers(0L) + .reuseClient(true) + .timeout(0.0) + .build() + ) + .type(AzureOpenAIEmbeddingConfig.Type.AZURE_EMBEDDING) + .build() + ) + .embeddingModelConfigId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .llamaParseParameters( + LlamaParseParameters.builder() + .adaptiveLongTable(true) + .aggressiveTableExtraction(true) + .annotateLineNumbers(true) + .annotateLinks(true) + .annotateRevisions(true) + .autoMode(true) + .autoModeConfigurationJson("auto_mode_configuration_json") + .autoModeTriggerOnImageInPage(true) + .autoModeTriggerOnRegexpInPage("auto_mode_trigger_on_regexp_in_page") + .autoModeTriggerOnTableInPage(true) + .autoModeTriggerOnTextInPage("auto_mode_trigger_on_text_in_page") + .azureOpenAIApiVersion("azure_openai_api_version") + .azureOpenAIDeploymentName("azure_openai_deployment_name") + .azureOpenAIEndpoint("azure_openai_endpoint") + .azureOpenAIKey("azure_openai_key") + .bboxBottom(0.0) + .bboxLeft(0.0) + .bboxRight(0.0) + .bboxTop(0.0) + .boundingBox("bounding_box") + .compactMarkdownTable(true) + .complementalFormattingInstruction("complemental_formatting_instruction") + .confidenceScoreEffort("confidence_score_effort") + .contentGuidelineInstruction("content_guideline_instruction") + .continuousMode(true) + .disableImageExtraction(true) + .disableOcr(true) + .disableReconstruction(true) + .doNotCache(true) + .doNotUnrollColumns(true) + .enableCostOptimizer(true) + .extractCharts(true) + .extractLayout(true) + .extractPrintedPageNumber(true) + .fastMode(true) + .formattingInstruction("formatting_instruction") + .gpt4oApiKey("gpt4o_api_key") + .gpt4oMode(true) + .guessXlsxSheetName(true) + .hideFooters(true) + .hideHeaders(true) + .highResOcr(true) + .htmlMakeAllElementsVisible(true) + .htmlRemoveFixedElements(true) + .htmlRemoveNavigationElements(true) + .httpProxy("http_proxy") + .ignoreDocumentElementsForLayoutDetection(true) + .addImagesToSave(LlamaParseParameters.ImagesToSave.EMBEDDED) + .inlineImagesInMarkdown(true) + .inputS3Path("input_s3_path") + .inputS3Region("input_s3_region") + .inputUrl("input_url") + .internalIsScreenshotJob(true) + .invalidateCache(true) + .isFormattingInstruction(true) + .jobTimeoutExtraTimePerPageInSeconds(0.0) + .jobTimeoutInSeconds(0.0) + .keepPageSeparatorWhenMergingTables(true) + .addLanguage(ParsingLanguages.ABQ) + .layoutAware(true) + .lineLevelBoundingBox(true) + .markdownTableMultilineHeaderSeparator( + "markdown_table_multiline_header_separator" + ) + .maxPages(0L) + .maxPagesEnforced(0L) + .mergeTablesAcrossPagesInMarkdown(true) + .model("model") + .outlinedTableExtraction(true) + .outputPdfOfDocument(true) + .outputS3PathPrefix("output_s3_path_prefix") + .outputS3Region("output_s3_region") + .outputTablesAsHtml(true) + .pageErrorTolerance(0.0) + .pageFooterPrefix("page_footer_prefix") + .pageFooterSuffix("page_footer_suffix") + .pageHeaderPrefix("page_header_prefix") + .pageHeaderSuffix("page_header_suffix") + .pagePrefix("page_prefix") + .pageSeparator("page_separator") + .pageSuffix("page_suffix") + .parseMode(ParsingMode.PARSE_DOCUMENT_WITH_AGENT) + .parsingInstruction("parsing_instruction") + .preciseBoundingBox(true) + .premiumMode(true) + .presentationOutOfBoundsContent(true) + .presentationSkipEmbeddedData(true) + .preserveLayoutAlignmentAcrossPages(true) + .preserveVerySmallText(true) + .preset("preset") + .priority(LlamaParseParameters.Priority.CRITICAL) + .projectId("project_id") + .removeHiddenText(true) + .replaceFailedPageMode(FailPageMode.BLANK_PAGE) + .replaceFailedPageWithErrorMessagePrefix( + "replace_failed_page_with_error_message_prefix" + ) + .replaceFailedPageWithErrorMessageSuffix( + "replace_failed_page_with_error_message_suffix" + ) + .saveImages(true) + .skipDiagonalText(true) + .specializedChartParsingAgentic(true) + .specializedChartParsingEfficient(true) + .specializedChartParsingPlus(true) + .specializedImageParsing(true) + .spreadsheetExtractSubTables(true) + .spreadsheetForceFormulaComputation(true) + .spreadsheetIncludeHiddenSheets(true) + .strictModeBuggyFont(true) + .strictModeImageExtraction(true) + .strictModeImageOcr(true) + .strictModeReconstruction(true) + .structuredOutput(true) + .structuredOutputJsonSchema("structured_output_json_schema") + .structuredOutputJsonSchemaName("structured_output_json_schema_name") + .systemPrompt("system_prompt") + .systemPromptAppend("system_prompt_append") + .takeScreenshot(true) + .targetPages("target_pages") + .tier("tier") + .useVendorMultimodalModel(true) + .userPrompt("user_prompt") + .vendorMultimodalApiKey("vendor_multimodal_api_key") + .vendorMultimodalModelName("vendor_multimodal_model_name") + .version("version") + .addWebhookConfiguration( + LlamaParseParameters.WebhookConfiguration.builder() + .addWebhookEvent( + LlamaParseParameters.WebhookConfiguration.WebhookEvent + .PARSE_SUCCESS + ) + .addWebhookEvent( + LlamaParseParameters.WebhookConfiguration.WebhookEvent + .PARSE_ERROR + ) + .webhookHeaders( + LlamaParseParameters.WebhookConfiguration.WebhookHeaders + .builder() + .putAdditionalProperty( + "Authorization", + JsonValue.from("Bearer sk-..."), + ) + .build() + ) + .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") + .webhookUrl("https://example.com/webhooks/llamacloud") + .build() + ) + .webhookUrl("webhook_url") + .build() + ) + .managedPipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .metadataConfig( + PipelineMetadataConfig.builder() + .addExcludedEmbedMetadataKey("string") + .addExcludedLlmMetadataKey("string") + .build() + ) + .name("name") + .presetRetrievalParameters( + PresetRetrievalParams.builder() + .alpha(0.0) + .className("class_name") + .denseSimilarityCutoff(0.0) + .denseSimilarityTopK(1L) + .enableReranking(true) + .filesTopK(1L) + .rerankTopN(1L) + .retrievalMode(RetrievalMode.AUTO_ROUTED) + .retrieveImageNodes(true) + .retrievePageFigureNodes(true) + .retrievePageScreenshotNodes(true) + .searchFilters( + MetadataFilters.builder() + .addFilter( + MetadataFilters.Filter.MetadataFilter.builder() + .key("key") + .value(0.0) + .operator( + MetadataFilters.Filter.MetadataFilter.Operator + .NOT_EQUALS + ) + .build() + ) + .condition(MetadataFilters.Condition.AND) + .build() + ) + .searchFiltersInferenceSchema( + PresetRetrievalParams.SearchFiltersInferenceSchema.builder() + .putAdditionalProperty("foo", JsonValue.from(mapOf("foo" to "bar"))) + .build() + ) + .sparseSimilarityTopK(1L) + .build() + ) + .sparseModelConfig( + SparseModelConfig.builder() + .className("class_name") + .modelType(SparseModelConfig.ModelType.AUTO) + .build() + ) + .status("status") + .transformConfig( + AutoTransformConfig.builder() + .chunkOverlap(0L) + .chunkSize(1L) + .mode(AutoTransformConfig.Mode.AUTO) + .build() + ) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + PipelineUpdateParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } + @Test fun body() { val params = PipelineUpdateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dataSink( DataSinkCreate.builder() .component( diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceGetDataSourcesParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceGetDataSourcesParamsTest.kt index c79ef51..2f5f71d 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceGetDataSourcesParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceGetDataSourcesParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.pipelines.datasources +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -11,6 +12,7 @@ internal class DataSourceGetDataSourcesParamsTest { fun create() { DataSourceGetDataSourcesParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } @@ -25,4 +27,34 @@ internal class DataSourceGetDataSourcesParamsTest { // out-of-bound path param assertThat(params._pathParam(1)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + DataSourceGetDataSourcesParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + DataSourceGetDataSourcesParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceGetStatusParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceGetStatusParamsTest.kt index ffff5a6..441e8d5 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceGetStatusParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceGetStatusParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.pipelines.datasources +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -12,6 +13,7 @@ internal class DataSourceGetStatusParamsTest { DataSourceGetStatusParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } @@ -28,4 +30,36 @@ internal class DataSourceGetStatusParamsTest { // out-of-bound path param assertThat(params._pathParam(2)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + DataSourceGetStatusParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + DataSourceGetStatusParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceSyncParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceSyncParamsTest.kt index 3346197..c998268 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceSyncParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceSyncParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.pipelines.datasources +import ai.llamaindex.llamacloud.core.http.QueryParams import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -13,6 +14,7 @@ internal class DataSourceSyncParamsTest { DataSourceSyncParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addPipelineFileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } @@ -31,12 +33,46 @@ internal class DataSourceSyncParamsTest { assertThat(params._pathParam(2)).isEqualTo("") } + @Test + fun queryParams() { + val params = + DataSourceSyncParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .addPipelineFileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + DataSourceSyncParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } + @Test fun body() { val params = DataSourceSyncParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addPipelineFileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceUpdateDataSourcesParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceUpdateDataSourcesParamsTest.kt index 9f7642f..2968e59 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceUpdateDataSourcesParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceUpdateDataSourcesParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.pipelines.datasources +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -11,6 +12,7 @@ internal class DataSourceUpdateDataSourcesParamsTest { fun create() { DataSourceUpdateDataSourcesParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addBody( DataSourceUpdateDataSourcesParams.Body.builder() .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -37,11 +39,53 @@ internal class DataSourceUpdateDataSourcesParamsTest { assertThat(params._pathParam(1)).isEqualTo("") } + @Test + fun queryParams() { + val params = + DataSourceUpdateDataSourcesParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .addBody( + DataSourceUpdateDataSourcesParams.Body.builder() + .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .syncInterval(0.0) + .build() + ) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + DataSourceUpdateDataSourcesParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .addBody( + DataSourceUpdateDataSourcesParams.Body.builder() + .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } + @Test fun body() { val params = DataSourceUpdateDataSourcesParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addBody( DataSourceUpdateDataSourcesParams.Body.builder() .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceUpdateParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceUpdateParamsTest.kt index b6cad1e..9cb61a5 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceUpdateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/datasources/DataSourceUpdateParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.pipelines.datasources +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -12,6 +13,7 @@ internal class DataSourceUpdateParamsTest { DataSourceUpdateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .syncInterval(0.0) .build() } @@ -30,12 +32,46 @@ internal class DataSourceUpdateParamsTest { assertThat(params._pathParam(2)).isEqualTo("") } + @Test + fun queryParams() { + val params = + DataSourceUpdateParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .syncInterval(0.0) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + DataSourceUpdateParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } + @Test fun body() { val params = DataSourceUpdateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .syncInterval(0.0) .build() diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentCreateParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentCreateParamsTest.kt index 969ec98..70ff58c 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentCreateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentCreateParamsTest.kt @@ -3,6 +3,7 @@ package ai.llamaindex.llamacloud.models.pipelines.documents import ai.llamaindex.llamacloud.core.JsonValue +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -12,6 +13,7 @@ internal class DocumentCreateParamsTest { fun create() { DocumentCreateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addBody( CloudDocumentCreate.builder() .metadata( @@ -51,11 +53,66 @@ internal class DocumentCreateParamsTest { assertThat(params._pathParam(1)).isEqualTo("") } + @Test + fun queryParams() { + val params = + DocumentCreateParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .addBody( + CloudDocumentCreate.builder() + .metadata( + CloudDocumentCreate.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .text("text") + .id("id") + .addExcludedEmbedMetadataKey("string") + .addExcludedLlmMetadataKey("string") + .addPagePosition(0L) + .build() + ) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + DocumentCreateParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .addBody( + CloudDocumentCreate.builder() + .metadata( + CloudDocumentCreate.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .text("text") + .build() + ) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } + @Test fun body() { val params = DocumentCreateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addBody( CloudDocumentCreate.builder() .metadata( diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentDeleteParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentDeleteParamsTest.kt index cdea32f..882d5c3 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentDeleteParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentDeleteParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.pipelines.documents +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -12,6 +13,7 @@ internal class DocumentDeleteParamsTest { DocumentDeleteParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } @@ -28,4 +30,36 @@ internal class DocumentDeleteParamsTest { // out-of-bound path param assertThat(params._pathParam(2)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + DocumentDeleteParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + DocumentDeleteParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentId("document_id") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetChunksParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetChunksParamsTest.kt index e794a81..10b10a3 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetChunksParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetChunksParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.pipelines.documents +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -12,6 +13,7 @@ internal class DocumentGetChunksParamsTest { DocumentGetChunksParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } @@ -28,4 +30,36 @@ internal class DocumentGetChunksParamsTest { // out-of-bound path param assertThat(params._pathParam(2)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + DocumentGetChunksParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + DocumentGetChunksParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentId("document_id") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetParamsTest.kt index a187979..7c75199 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.pipelines.documents +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -12,6 +13,7 @@ internal class DocumentGetParamsTest { DocumentGetParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } @@ -28,4 +30,36 @@ internal class DocumentGetParamsTest { // out-of-bound path param assertThat(params._pathParam(2)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + DocumentGetParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + DocumentGetParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentId("document_id") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetStatusCountsParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetStatusCountsParamsTest.kt index 054d4de..c7a3b86 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetStatusCountsParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetStatusCountsParamsTest.kt @@ -15,6 +15,7 @@ internal class DocumentGetStatusCountsParamsTest { .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .onlyDirectUpload(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } @@ -38,6 +39,7 @@ internal class DocumentGetStatusCountsParamsTest { .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .onlyDirectUpload(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val queryParams = params._queryParams() @@ -48,6 +50,7 @@ internal class DocumentGetStatusCountsParamsTest { .put("data_source_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .put("file_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .put("only_direct_upload", "true") + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetStatusParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetStatusParamsTest.kt index 4689375..4683015 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetStatusParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentGetStatusParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.pipelines.documents +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -12,6 +13,7 @@ internal class DocumentGetStatusParamsTest { DocumentGetStatusParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } @@ -28,4 +30,36 @@ internal class DocumentGetStatusParamsTest { // out-of-bound path param assertThat(params._pathParam(2)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + DocumentGetStatusParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + DocumentGetStatusParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentId("document_id") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentListParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentListParamsTest.kt index 6d7052c..15c2fd8 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentListParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentListParamsTest.kt @@ -16,6 +16,7 @@ internal class DocumentListParamsTest { .limit(0L) .onlyApiDataSourceDocuments(true) .onlyDirectUpload(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .skip(0L) .statusRefreshPolicy(DocumentListParams.StatusRefreshPolicy.CACHED) .build() @@ -40,6 +41,7 @@ internal class DocumentListParamsTest { .limit(0L) .onlyApiDataSourceDocuments(true) .onlyDirectUpload(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .skip(0L) .statusRefreshPolicy(DocumentListParams.StatusRefreshPolicy.CACHED) .build() @@ -53,6 +55,7 @@ internal class DocumentListParamsTest { .put("limit", "0") .put("only_api_data_source_documents", "true") .put("only_direct_upload", "true") + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .put("skip", "0") .put("status_refresh_policy", "cached") .build() diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentSyncParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentSyncParamsTest.kt index f5f139e..9af02ee 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentSyncParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentSyncParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.pipelines.documents +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -12,6 +13,7 @@ internal class DocumentSyncParamsTest { DocumentSyncParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } @@ -28,4 +30,36 @@ internal class DocumentSyncParamsTest { // out-of-bound path param assertThat(params._pathParam(2)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + DocumentSyncParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + DocumentSyncParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .documentId("document_id") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentUpsertParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentUpsertParamsTest.kt index cc4ad47..2dd328d 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentUpsertParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/documents/DocumentUpsertParamsTest.kt @@ -3,6 +3,7 @@ package ai.llamaindex.llamacloud.models.pipelines.documents import ai.llamaindex.llamacloud.core.JsonValue +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -12,6 +13,7 @@ internal class DocumentUpsertParamsTest { fun create() { DocumentUpsertParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addBody( CloudDocumentCreate.builder() .metadata( @@ -51,11 +53,66 @@ internal class DocumentUpsertParamsTest { assertThat(params._pathParam(1)).isEqualTo("") } + @Test + fun queryParams() { + val params = + DocumentUpsertParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .addBody( + CloudDocumentCreate.builder() + .metadata( + CloudDocumentCreate.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .text("text") + .id("id") + .addExcludedEmbedMetadataKey("string") + .addExcludedLlmMetadataKey("string") + .addPagePosition(0L) + .build() + ) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + DocumentUpsertParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .addBody( + CloudDocumentCreate.builder() + .metadata( + CloudDocumentCreate.Metadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .text("text") + .build() + ) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } + @Test fun body() { val params = DocumentUpsertParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addBody( CloudDocumentCreate.builder() .metadata( diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileCreateParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileCreateParamsTest.kt index c18a78a..4f6b069 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileCreateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileCreateParamsTest.kt @@ -3,6 +3,7 @@ package ai.llamaindex.llamacloud.models.pipelines.files import ai.llamaindex.llamacloud.core.JsonValue +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -12,6 +13,7 @@ internal class FileCreateParamsTest { fun create() { FileCreateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addBody( FileCreateParams.Body.builder() .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -42,11 +44,57 @@ internal class FileCreateParamsTest { assertThat(params._pathParam(1)).isEqualTo("") } + @Test + fun queryParams() { + val params = + FileCreateParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .addBody( + FileCreateParams.Body.builder() + .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .customMetadata( + FileCreateParams.Body.CustomMetadata.builder() + .putAdditionalProperty("foo", JsonValue.from(mapOf("foo" to "bar"))) + .build() + ) + .build() + ) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + FileCreateParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .addBody( + FileCreateParams.Body.builder() + .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } + @Test fun body() { val params = FileCreateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addBody( FileCreateParams.Body.builder() .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileDeleteParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileDeleteParamsTest.kt index ca0efa8..bbc1ce8 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileDeleteParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileDeleteParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.pipelines.files +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -12,6 +13,7 @@ internal class FileDeleteParamsTest { FileDeleteParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } @@ -28,4 +30,36 @@ internal class FileDeleteParamsTest { // out-of-bound path param assertThat(params._pathParam(2)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + FileDeleteParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + FileDeleteParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileGetStatusCountsParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileGetStatusCountsParamsTest.kt index 2a331e7..0348bda 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileGetStatusCountsParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileGetStatusCountsParamsTest.kt @@ -14,6 +14,7 @@ internal class FileGetStatusCountsParamsTest { .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .onlyManuallyUploaded(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } @@ -36,6 +37,7 @@ internal class FileGetStatusCountsParamsTest { .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .onlyManuallyUploaded(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val queryParams = params._queryParams() @@ -45,6 +47,7 @@ internal class FileGetStatusCountsParamsTest { QueryParams.builder() .put("data_source_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .put("only_manually_uploaded", "true") + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileGetStatusParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileGetStatusParamsTest.kt index f991f51..13438b5 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileGetStatusParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileGetStatusParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.pipelines.files +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -12,6 +13,7 @@ internal class FileGetStatusParamsTest { FileGetStatusParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } @@ -28,4 +30,36 @@ internal class FileGetStatusParamsTest { // out-of-bound path param assertThat(params._pathParam(2)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + FileGetStatusParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + FileGetStatusParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileListParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileListParamsTest.kt index 7c28b20..e18e8a5 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileListParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileListParamsTest.kt @@ -18,6 +18,7 @@ internal class FileListParamsTest { .offset(0L) .onlyManuallyUploaded(true) .orderBy("order_by") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addStatus(FileListParams.Status.CANCELLED) .addStatus(FileListParams.Status.ERROR) .build() @@ -44,6 +45,7 @@ internal class FileListParamsTest { .offset(0L) .onlyManuallyUploaded(true) .orderBy("order_by") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addStatus(FileListParams.Status.CANCELLED) .addStatus(FileListParams.Status.ERROR) .build() @@ -59,6 +61,7 @@ internal class FileListParamsTest { .put("offset", "0") .put("only_manually_uploaded", "true") .put("order_by", "order_by") + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .put("statuses", "CANCELLED") .put("statuses", "ERROR") .build() diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileUpdateParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileUpdateParamsTest.kt index 179d1ff..b52cc03 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileUpdateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/files/FileUpdateParamsTest.kt @@ -3,6 +3,7 @@ package ai.llamaindex.llamacloud.models.pipelines.files import ai.llamaindex.llamacloud.core.JsonValue +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -13,6 +14,7 @@ internal class FileUpdateParamsTest { FileUpdateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .customMetadata( FileUpdateParams.CustomMetadata.builder() .putAdditionalProperty("foo", JsonValue.from(mapOf("foo" to "bar"))) @@ -35,12 +37,50 @@ internal class FileUpdateParamsTest { assertThat(params._pathParam(2)).isEqualTo("") } + @Test + fun queryParams() { + val params = + FileUpdateParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .customMetadata( + FileUpdateParams.CustomMetadata.builder() + .putAdditionalProperty("foo", JsonValue.from(mapOf("foo" to "bar"))) + .build() + ) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + FileUpdateParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } + @Test fun body() { val params = FileUpdateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .customMetadata( FileUpdateParams.CustomMetadata.builder() .putAdditionalProperty("foo", JsonValue.from(mapOf("foo" to "bar"))) diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/metadata/MetadataCreateParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/metadata/MetadataCreateParamsTest.kt index e277f5e..8a5d1b3 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/metadata/MetadataCreateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/metadata/MetadataCreateParamsTest.kt @@ -3,6 +3,7 @@ package ai.llamaindex.llamacloud.models.pipelines.metadata import ai.llamaindex.llamacloud.core.MultipartField +import ai.llamaindex.llamacloud.core.http.QueryParams import java.io.InputStream import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -13,6 +14,7 @@ internal class MetadataCreateParamsTest { fun create() { MetadataCreateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .uploadFile("Example data".byteInputStream()) .build() } @@ -30,8 +32,67 @@ internal class MetadataCreateParamsTest { assertThat(params._pathParam(1)).isEqualTo("") } + @Test + fun queryParams() { + val params = + MetadataCreateParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .uploadFile("Example data".byteInputStream()) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + MetadataCreateParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .uploadFile("Example data".byteInputStream()) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } + @Test fun body() { + val params = + MetadataCreateParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .uploadFile("Example data".byteInputStream()) + .build() + + val body = params._body() + + assertThat(body.filterValues { !it.value.isNull() }) + .usingRecursiveComparison() + // TODO(AssertJ): Replace this and the `mapValues` below with: + // https://github.com/assertj/assertj/issues/3165 + .withEqualsForType( + { a, b -> a.readBytes() contentEquals b.readBytes() }, + InputStream::class.java, + ) + .isEqualTo( + mapOf("upload_file" to MultipartField.of("Example data".byteInputStream())) + .mapValues { (_, field) -> + field.map { (it as? ByteArray)?.inputStream() ?: it } + } + ) + } + + @Test + fun bodyWithoutOptionalFields() { val params = MetadataCreateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/metadata/MetadataDeleteAllParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/metadata/MetadataDeleteAllParamsTest.kt index f705438..0012952 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/metadata/MetadataDeleteAllParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/metadata/MetadataDeleteAllParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.pipelines.metadata +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -9,7 +10,10 @@ internal class MetadataDeleteAllParamsTest { @Test fun create() { - MetadataDeleteAllParams.builder().pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() + MetadataDeleteAllParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() } @Test @@ -23,4 +27,34 @@ internal class MetadataDeleteAllParamsTest { // out-of-bound path param assertThat(params._pathParam(1)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + MetadataDeleteAllParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + MetadataDeleteAllParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/sync/SyncCancelParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/sync/SyncCancelParamsTest.kt index ffaf017..674e43d 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/sync/SyncCancelParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/sync/SyncCancelParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.pipelines.sync +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -9,7 +10,10 @@ internal class SyncCancelParamsTest { @Test fun create() { - SyncCancelParams.builder().pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() + SyncCancelParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() } @Test @@ -21,4 +25,32 @@ internal class SyncCancelParamsTest { // out-of-bound path param assertThat(params._pathParam(1)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + SyncCancelParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + SyncCancelParams.builder().pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/sync/SyncCreateParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/sync/SyncCreateParamsTest.kt index 774b1a2..9992c96 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/sync/SyncCreateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/pipelines/sync/SyncCreateParamsTest.kt @@ -2,6 +2,7 @@ package ai.llamaindex.llamacloud.models.pipelines.sync +import ai.llamaindex.llamacloud.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -9,7 +10,10 @@ internal class SyncCreateParamsTest { @Test fun create() { - SyncCreateParams.builder().pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() + SyncCreateParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() } @Test @@ -21,4 +25,32 @@ internal class SyncCreateParamsTest { // out-of-bound path param assertThat(params._pathParam(1)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + SyncCreateParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = + SyncCreateParams.builder().pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/DataSinkServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/DataSinkServiceAsyncTest.kt index 58280cc..8589c35 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/DataSinkServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/DataSinkServiceAsyncTest.kt @@ -5,6 +5,8 @@ package ai.llamaindex.llamacloud.services.async import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClientAsync import ai.llamaindex.llamacloud.core.JsonValue import ai.llamaindex.llamacloud.models.datasinks.DataSinkCreateParams +import ai.llamaindex.llamacloud.models.datasinks.DataSinkDeleteParams +import ai.llamaindex.llamacloud.models.datasinks.DataSinkGetParams import ai.llamaindex.llamacloud.models.datasinks.DataSinkListParams import ai.llamaindex.llamacloud.models.datasinks.DataSinkUpdateParams import ai.llamaindex.llamacloud.models.pipelines.DataSinkCreate @@ -52,6 +54,7 @@ internal class DataSinkServiceAsyncTest { dataSinkServiceAsync.update( DataSinkUpdateParams.builder() .dataSinkId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .sinkType(DataSinkUpdateParams.SinkType.ASTRA_DB) .component( DataSinkUpdateParams.Component.UnionMember0.builder() @@ -90,7 +93,13 @@ internal class DataSinkServiceAsyncTest { val client = LlamaCloudOkHttpClientAsync.builder().apiKey("My API Key").build() val dataSinkServiceAsync = client.dataSinks() - val future = dataSinkServiceAsync.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + val future = + dataSinkServiceAsync.delete( + DataSinkDeleteParams.builder() + .dataSinkId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) val response = future.get() } @@ -101,7 +110,13 @@ internal class DataSinkServiceAsyncTest { val client = LlamaCloudOkHttpClientAsync.builder().apiKey("My API Key").build() val dataSinkServiceAsync = client.dataSinks() - val dataSinkFuture = dataSinkServiceAsync.get("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + val dataSinkFuture = + dataSinkServiceAsync.get( + DataSinkGetParams.builder() + .dataSinkId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) val dataSink = dataSinkFuture.get() dataSink.validate() diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/DataSourceServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/DataSourceServiceAsyncTest.kt index c47972d..3fe7c1b 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/DataSourceServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/DataSourceServiceAsyncTest.kt @@ -5,6 +5,8 @@ package ai.llamaindex.llamacloud.services.async import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClientAsync import ai.llamaindex.llamacloud.core.JsonValue import ai.llamaindex.llamacloud.models.datasources.DataSourceCreateParams +import ai.llamaindex.llamacloud.models.datasources.DataSourceDeleteParams +import ai.llamaindex.llamacloud.models.datasources.DataSourceGetParams import ai.llamaindex.llamacloud.models.datasources.DataSourceListParams import ai.llamaindex.llamacloud.models.datasources.DataSourceUpdateParams import org.junit.jupiter.api.Disabled @@ -52,6 +54,7 @@ internal class DataSourceServiceAsyncTest { dataSourceServiceAsync.update( DataSourceUpdateParams.builder() .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .sourceType(DataSourceUpdateParams.SourceType.AZURE_STORAGE_BLOB) .component( DataSourceUpdateParams.Component.UnionMember0.builder() @@ -95,7 +98,13 @@ internal class DataSourceServiceAsyncTest { val client = LlamaCloudOkHttpClientAsync.builder().apiKey("My API Key").build() val dataSourceServiceAsync = client.dataSources() - val future = dataSourceServiceAsync.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + val future = + dataSourceServiceAsync.delete( + DataSourceDeleteParams.builder() + .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) val response = future.get() } @@ -106,7 +115,13 @@ internal class DataSourceServiceAsyncTest { val client = LlamaCloudOkHttpClientAsync.builder().apiKey("My API Key").build() val dataSourceServiceAsync = client.dataSources() - val dataSourceFuture = dataSourceServiceAsync.get("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + val dataSourceFuture = + dataSourceServiceAsync.get( + DataSourceGetParams.builder() + .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) val dataSource = dataSourceFuture.get() dataSource.validate() diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/PipelineServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/PipelineServiceAsyncTest.kt index ff7b5c0..c3d3f43 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/PipelineServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/PipelineServiceAsyncTest.kt @@ -15,6 +15,8 @@ import ai.llamaindex.llamacloud.models.pipelines.LlamaParseParameters import ai.llamaindex.llamacloud.models.pipelines.MetadataFilters import ai.llamaindex.llamacloud.models.pipelines.PipelineCreate import ai.llamaindex.llamacloud.models.pipelines.PipelineCreateParams +import ai.llamaindex.llamacloud.models.pipelines.PipelineDeleteParams +import ai.llamaindex.llamacloud.models.pipelines.PipelineGetParams import ai.llamaindex.llamacloud.models.pipelines.PipelineGetStatusParams import ai.llamaindex.llamacloud.models.pipelines.PipelineListParams import ai.llamaindex.llamacloud.models.pipelines.PipelineMetadataConfig @@ -393,6 +395,7 @@ internal class PipelineServiceAsyncTest { pipelineServiceAsync.update( PipelineUpdateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dataSink( DataSinkCreate.builder() .component( @@ -690,7 +693,13 @@ internal class PipelineServiceAsyncTest { val client = LlamaCloudOkHttpClientAsync.builder().apiKey("My API Key").build() val pipelineServiceAsync = client.pipelines() - val future = pipelineServiceAsync.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + val future = + pipelineServiceAsync.delete( + PipelineDeleteParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) val response = future.get() } @@ -701,7 +710,13 @@ internal class PipelineServiceAsyncTest { val client = LlamaCloudOkHttpClientAsync.builder().apiKey("My API Key").build() val pipelineServiceAsync = client.pipelines() - val pipelineFuture = pipelineServiceAsync.get("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + val pipelineFuture = + pipelineServiceAsync.get( + PipelineGetParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) val pipeline = pipelineFuture.get() pipeline.validate() @@ -718,6 +733,7 @@ internal class PipelineServiceAsyncTest { PipelineGetStatusParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fullDetails(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/DataSourceServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/DataSourceServiceAsyncTest.kt index fe677b2..3db04ce 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/DataSourceServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/DataSourceServiceAsyncTest.kt @@ -3,6 +3,7 @@ package ai.llamaindex.llamacloud.services.async.pipelines import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClientAsync +import ai.llamaindex.llamacloud.models.pipelines.datasources.DataSourceGetDataSourcesParams import ai.llamaindex.llamacloud.models.pipelines.datasources.DataSourceGetStatusParams import ai.llamaindex.llamacloud.models.pipelines.datasources.DataSourceSyncParams import ai.llamaindex.llamacloud.models.pipelines.datasources.DataSourceUpdateDataSourcesParams @@ -23,6 +24,7 @@ internal class DataSourceServiceAsyncTest { DataSourceUpdateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .syncInterval(0.0) .build() ) @@ -38,7 +40,12 @@ internal class DataSourceServiceAsyncTest { val dataSourceServiceAsync = client.pipelines().dataSources() val pipelineDataSourcesFuture = - dataSourceServiceAsync.getDataSources("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + dataSourceServiceAsync.getDataSources( + DataSourceGetDataSourcesParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) val pipelineDataSources = pipelineDataSourcesFuture.get() pipelineDataSources.forEach { it.validate() } @@ -55,6 +62,7 @@ internal class DataSourceServiceAsyncTest { DataSourceGetStatusParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -73,6 +81,7 @@ internal class DataSourceServiceAsyncTest { DataSourceSyncParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addPipelineFileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -91,6 +100,7 @@ internal class DataSourceServiceAsyncTest { dataSourceServiceAsync.updateDataSources( DataSourceUpdateDataSourcesParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addBody( DataSourceUpdateDataSourcesParams.Body.builder() .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/DocumentServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/DocumentServiceAsyncTest.kt index f596d03..fb81f66 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/DocumentServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/DocumentServiceAsyncTest.kt @@ -28,6 +28,7 @@ internal class DocumentServiceAsyncTest { documentServiceAsync.create( DocumentCreateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addBody( CloudDocumentCreate.builder() .metadata( @@ -72,6 +73,7 @@ internal class DocumentServiceAsyncTest { DocumentDeleteParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -89,6 +91,7 @@ internal class DocumentServiceAsyncTest { DocumentGetParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -107,6 +110,7 @@ internal class DocumentServiceAsyncTest { DocumentGetChunksParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -125,6 +129,7 @@ internal class DocumentServiceAsyncTest { DocumentGetStatusParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -145,6 +150,7 @@ internal class DocumentServiceAsyncTest { .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .onlyDirectUpload(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -163,6 +169,7 @@ internal class DocumentServiceAsyncTest { DocumentSyncParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -180,6 +187,7 @@ internal class DocumentServiceAsyncTest { documentServiceAsync.upsert( DocumentUpsertParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addBody( CloudDocumentCreate.builder() .metadata( diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/FileServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/FileServiceAsyncTest.kt index f78e76a..7a2a2e9 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/FileServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/FileServiceAsyncTest.kt @@ -24,6 +24,7 @@ internal class FileServiceAsyncTest { fileServiceAsync.create( FileCreateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addBody( FileCreateParams.Body.builder() .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -55,6 +56,7 @@ internal class FileServiceAsyncTest { FileUpdateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .customMetadata( FileUpdateParams.CustomMetadata.builder() .putAdditionalProperty("foo", JsonValue.from(mapOf("foo" to "bar"))) @@ -90,6 +92,7 @@ internal class FileServiceAsyncTest { FileDeleteParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -107,6 +110,7 @@ internal class FileServiceAsyncTest { FileGetStatusParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -126,6 +130,7 @@ internal class FileServiceAsyncTest { .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .onlyManuallyUploaded(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/MetadataServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/MetadataServiceAsyncTest.kt index 8bea1ad..21ae8e9 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/MetadataServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/MetadataServiceAsyncTest.kt @@ -4,6 +4,7 @@ package ai.llamaindex.llamacloud.services.async.pipelines import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClientAsync import ai.llamaindex.llamacloud.models.pipelines.metadata.MetadataCreateParams +import ai.llamaindex.llamacloud.models.pipelines.metadata.MetadataDeleteAllParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test @@ -19,6 +20,7 @@ internal class MetadataServiceAsyncTest { metadataServiceAsync.create( MetadataCreateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .uploadFile("Example data".byteInputStream()) .build() ) @@ -33,7 +35,13 @@ internal class MetadataServiceAsyncTest { val client = LlamaCloudOkHttpClientAsync.builder().apiKey("My API Key").build() val metadataServiceAsync = client.pipelines().metadata() - val future = metadataServiceAsync.deleteAll("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + val future = + metadataServiceAsync.deleteAll( + MetadataDeleteAllParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) val response = future.get() } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/SyncServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/SyncServiceAsyncTest.kt index 0c5c402..b447a29 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/SyncServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/pipelines/SyncServiceAsyncTest.kt @@ -3,6 +3,8 @@ package ai.llamaindex.llamacloud.services.async.pipelines import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClientAsync +import ai.llamaindex.llamacloud.models.pipelines.sync.SyncCancelParams +import ai.llamaindex.llamacloud.models.pipelines.sync.SyncCreateParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test @@ -14,7 +16,13 @@ internal class SyncServiceAsyncTest { val client = LlamaCloudOkHttpClientAsync.builder().apiKey("My API Key").build() val syncServiceAsync = client.pipelines().sync() - val pipelineFuture = syncServiceAsync.create("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + val pipelineFuture = + syncServiceAsync.create( + SyncCreateParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) val pipeline = pipelineFuture.get() pipeline.validate() @@ -26,7 +34,13 @@ internal class SyncServiceAsyncTest { val client = LlamaCloudOkHttpClientAsync.builder().apiKey("My API Key").build() val syncServiceAsync = client.pipelines().sync() - val pipelineFuture = syncServiceAsync.cancel("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + val pipelineFuture = + syncServiceAsync.cancel( + SyncCancelParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) val pipeline = pipelineFuture.get() pipeline.validate() diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/DataSinkServiceTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/DataSinkServiceTest.kt index cbf2b49..201607c 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/DataSinkServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/DataSinkServiceTest.kt @@ -5,6 +5,8 @@ package ai.llamaindex.llamacloud.services.blocking import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient import ai.llamaindex.llamacloud.core.JsonValue import ai.llamaindex.llamacloud.models.datasinks.DataSinkCreateParams +import ai.llamaindex.llamacloud.models.datasinks.DataSinkDeleteParams +import ai.llamaindex.llamacloud.models.datasinks.DataSinkGetParams import ai.llamaindex.llamacloud.models.datasinks.DataSinkListParams import ai.llamaindex.llamacloud.models.datasinks.DataSinkUpdateParams import ai.llamaindex.llamacloud.models.pipelines.DataSinkCreate @@ -51,6 +53,7 @@ internal class DataSinkServiceTest { dataSinkService.update( DataSinkUpdateParams.builder() .dataSinkId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .sinkType(DataSinkUpdateParams.SinkType.ASTRA_DB) .component( DataSinkUpdateParams.Component.UnionMember0.builder() @@ -87,7 +90,12 @@ internal class DataSinkServiceTest { val client = LlamaCloudOkHttpClient.builder().apiKey("My API Key").build() val dataSinkService = client.dataSinks() - dataSinkService.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + dataSinkService.delete( + DataSinkDeleteParams.builder() + .dataSinkId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) } @Disabled("Mock server tests are disabled") @@ -96,7 +104,13 @@ internal class DataSinkServiceTest { val client = LlamaCloudOkHttpClient.builder().apiKey("My API Key").build() val dataSinkService = client.dataSinks() - val dataSink = dataSinkService.get("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + val dataSink = + dataSinkService.get( + DataSinkGetParams.builder() + .dataSinkId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) dataSink.validate() } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/DataSourceServiceTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/DataSourceServiceTest.kt index a24b6fa..c960f54 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/DataSourceServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/DataSourceServiceTest.kt @@ -5,6 +5,8 @@ package ai.llamaindex.llamacloud.services.blocking import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient import ai.llamaindex.llamacloud.core.JsonValue import ai.llamaindex.llamacloud.models.datasources.DataSourceCreateParams +import ai.llamaindex.llamacloud.models.datasources.DataSourceDeleteParams +import ai.llamaindex.llamacloud.models.datasources.DataSourceGetParams import ai.llamaindex.llamacloud.models.datasources.DataSourceListParams import ai.llamaindex.llamacloud.models.datasources.DataSourceUpdateParams import org.junit.jupiter.api.Disabled @@ -51,6 +53,7 @@ internal class DataSourceServiceTest { dataSourceService.update( DataSourceUpdateParams.builder() .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .sourceType(DataSourceUpdateParams.SourceType.AZURE_STORAGE_BLOB) .component( DataSourceUpdateParams.Component.UnionMember0.builder() @@ -92,7 +95,12 @@ internal class DataSourceServiceTest { val client = LlamaCloudOkHttpClient.builder().apiKey("My API Key").build() val dataSourceService = client.dataSources() - dataSourceService.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + dataSourceService.delete( + DataSourceDeleteParams.builder() + .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) } @Disabled("Mock server tests are disabled") @@ -101,7 +109,13 @@ internal class DataSourceServiceTest { val client = LlamaCloudOkHttpClient.builder().apiKey("My API Key").build() val dataSourceService = client.dataSources() - val dataSource = dataSourceService.get("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + val dataSource = + dataSourceService.get( + DataSourceGetParams.builder() + .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) dataSource.validate() } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/PipelineServiceTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/PipelineServiceTest.kt index 9cd260f..9ff9fda 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/PipelineServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/PipelineServiceTest.kt @@ -15,6 +15,8 @@ import ai.llamaindex.llamacloud.models.pipelines.LlamaParseParameters import ai.llamaindex.llamacloud.models.pipelines.MetadataFilters import ai.llamaindex.llamacloud.models.pipelines.PipelineCreate import ai.llamaindex.llamacloud.models.pipelines.PipelineCreateParams +import ai.llamaindex.llamacloud.models.pipelines.PipelineDeleteParams +import ai.llamaindex.llamacloud.models.pipelines.PipelineGetParams import ai.llamaindex.llamacloud.models.pipelines.PipelineGetStatusParams import ai.llamaindex.llamacloud.models.pipelines.PipelineListParams import ai.llamaindex.llamacloud.models.pipelines.PipelineMetadataConfig @@ -391,6 +393,7 @@ internal class PipelineServiceTest { pipelineService.update( PipelineUpdateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dataSink( DataSinkCreate.builder() .component( @@ -686,7 +689,12 @@ internal class PipelineServiceTest { val client = LlamaCloudOkHttpClient.builder().apiKey("My API Key").build() val pipelineService = client.pipelines() - pipelineService.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + pipelineService.delete( + PipelineDeleteParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) } @Disabled("Mock server tests are disabled") @@ -695,7 +703,13 @@ internal class PipelineServiceTest { val client = LlamaCloudOkHttpClient.builder().apiKey("My API Key").build() val pipelineService = client.pipelines() - val pipeline = pipelineService.get("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + val pipeline = + pipelineService.get( + PipelineGetParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) pipeline.validate() } @@ -711,6 +725,7 @@ internal class PipelineServiceTest { PipelineGetStatusParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fullDetails(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/DataSourceServiceTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/DataSourceServiceTest.kt index 30185a5..fdf4308 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/DataSourceServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/DataSourceServiceTest.kt @@ -3,6 +3,7 @@ package ai.llamaindex.llamacloud.services.blocking.pipelines import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient +import ai.llamaindex.llamacloud.models.pipelines.datasources.DataSourceGetDataSourcesParams import ai.llamaindex.llamacloud.models.pipelines.datasources.DataSourceGetStatusParams import ai.llamaindex.llamacloud.models.pipelines.datasources.DataSourceSyncParams import ai.llamaindex.llamacloud.models.pipelines.datasources.DataSourceUpdateDataSourcesParams @@ -23,6 +24,7 @@ internal class DataSourceServiceTest { DataSourceUpdateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .syncInterval(0.0) .build() ) @@ -37,7 +39,12 @@ internal class DataSourceServiceTest { val dataSourceService = client.pipelines().dataSources() val pipelineDataSources = - dataSourceService.getDataSources("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + dataSourceService.getDataSources( + DataSourceGetDataSourcesParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) pipelineDataSources.forEach { it.validate() } } @@ -53,6 +60,7 @@ internal class DataSourceServiceTest { DataSourceGetStatusParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -70,6 +78,7 @@ internal class DataSourceServiceTest { DataSourceSyncParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addPipelineFileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -87,6 +96,7 @@ internal class DataSourceServiceTest { dataSourceService.updateDataSources( DataSourceUpdateDataSourcesParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addBody( DataSourceUpdateDataSourcesParams.Body.builder() .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/DocumentServiceTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/DocumentServiceTest.kt index cc5aa64..4a0c985 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/DocumentServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/DocumentServiceTest.kt @@ -28,6 +28,7 @@ internal class DocumentServiceTest { documentService.create( DocumentCreateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addBody( CloudDocumentCreate.builder() .metadata( @@ -69,6 +70,7 @@ internal class DocumentServiceTest { DocumentDeleteParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) } @@ -84,6 +86,7 @@ internal class DocumentServiceTest { DocumentGetParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -101,6 +104,7 @@ internal class DocumentServiceTest { DocumentGetChunksParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -118,6 +122,7 @@ internal class DocumentServiceTest { DocumentGetStatusParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -137,6 +142,7 @@ internal class DocumentServiceTest { .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .onlyDirectUpload(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -154,6 +160,7 @@ internal class DocumentServiceTest { DocumentSyncParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .documentId("document_id") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -170,6 +177,7 @@ internal class DocumentServiceTest { documentService.upsert( DocumentUpsertParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addBody( CloudDocumentCreate.builder() .metadata( diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/FileServiceTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/FileServiceTest.kt index 5387471..763a76a 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/FileServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/FileServiceTest.kt @@ -24,6 +24,7 @@ internal class FileServiceTest { fileService.create( FileCreateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .addBody( FileCreateParams.Body.builder() .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -54,6 +55,7 @@ internal class FileServiceTest { FileUpdateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .customMetadata( FileUpdateParams.CustomMetadata.builder() .putAdditionalProperty("foo", JsonValue.from(mapOf("foo" to "bar"))) @@ -86,6 +88,7 @@ internal class FileServiceTest { FileDeleteParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) } @@ -101,6 +104,7 @@ internal class FileServiceTest { FileGetStatusParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) @@ -119,6 +123,7 @@ internal class FileServiceTest { .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .dataSourceId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .onlyManuallyUploaded(true) + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/MetadataServiceTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/MetadataServiceTest.kt index e1bbd14..6a4b5e0 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/MetadataServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/MetadataServiceTest.kt @@ -4,6 +4,7 @@ package ai.llamaindex.llamacloud.services.blocking.pipelines import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient import ai.llamaindex.llamacloud.models.pipelines.metadata.MetadataCreateParams +import ai.llamaindex.llamacloud.models.pipelines.metadata.MetadataDeleteAllParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test @@ -19,6 +20,7 @@ internal class MetadataServiceTest { metadataService.create( MetadataCreateParams.builder() .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .uploadFile("Example data".byteInputStream()) .build() ) @@ -32,6 +34,11 @@ internal class MetadataServiceTest { val client = LlamaCloudOkHttpClient.builder().apiKey("My API Key").build() val metadataService = client.pipelines().metadata() - metadataService.deleteAll("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + metadataService.deleteAll( + MetadataDeleteAllParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/SyncServiceTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/SyncServiceTest.kt index 05601d2..60f37ac 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/SyncServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/pipelines/SyncServiceTest.kt @@ -3,6 +3,8 @@ package ai.llamaindex.llamacloud.services.blocking.pipelines import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient +import ai.llamaindex.llamacloud.models.pipelines.sync.SyncCancelParams +import ai.llamaindex.llamacloud.models.pipelines.sync.SyncCreateParams import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test @@ -14,7 +16,13 @@ internal class SyncServiceTest { val client = LlamaCloudOkHttpClient.builder().apiKey("My API Key").build() val syncService = client.pipelines().sync() - val pipeline = syncService.create("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + val pipeline = + syncService.create( + SyncCreateParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) pipeline.validate() } @@ -25,7 +33,13 @@ internal class SyncServiceTest { val client = LlamaCloudOkHttpClient.builder().apiKey("My API Key").build() val syncService = client.pipelines().sync() - val pipeline = syncService.cancel("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + val pipeline = + syncService.cancel( + SyncCancelParams.builder() + .pipelineId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) pipeline.validate() } From 8fee5346804426093ebba510686c5bb4d25798a9 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Mon, 31 Aug 2026 00:41:43 +0000 Subject: [PATCH 06/11] Build SDK Stainless-Generated-From: 6cefc0953e9b298dd4992d713ada3c519fc1695c --- .../configurations/ExtractV2Parameters.kt | 179 ++++++++++++++++-- .../models/extract/ExtractConfiguration.kt | 179 ++++++++++++++++-- .../configurations/ExtractV2ParametersTest.kt | 6 +- .../extract/ExtractConfigurationTest.kt | 6 +- .../models/extract/ExtractCreateParamsTest.kt | 8 +- .../models/extract/ExtractV2JobCreateTest.kt | 6 +- .../extract/ExtractV2JobQueryResponseTest.kt | 6 +- .../models/extract/ExtractV2JobTest.kt | 6 +- .../services/async/ExtractServiceAsyncTest.kt | 2 +- .../services/blocking/ExtractServiceTest.kt | 2 +- 10 files changed, 357 insertions(+), 43 deletions(-) diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/configurations/ExtractV2Parameters.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/configurations/ExtractV2Parameters.kt index 2c2abb7..79ceaa9 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/configurations/ExtractV2Parameters.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/configurations/ExtractV2Parameters.kt @@ -32,7 +32,7 @@ private constructor( private val extractionTarget: JsonField, private val maxPages: JsonField, private val parseConfigId: JsonField, - private val parseTier: JsonField, + private val parseTier: JsonField, private val sheetNames: JsonField>, private val spreadsheetMode: JsonField, private val systemPrompt: JsonField, @@ -64,7 +64,9 @@ private constructor( @JsonProperty("parse_config_id") @ExcludeMissing parseConfigId: JsonField = JsonMissing.of(), - @JsonProperty("parse_tier") @ExcludeMissing parseTier: JsonField = JsonMissing.of(), + @JsonProperty("parse_tier") + @ExcludeMissing + parseTier: JsonField = JsonMissing.of(), @JsonProperty("sheet_names") @ExcludeMissing sheetNames: JsonField> = JsonMissing.of(), @@ -182,7 +184,7 @@ private constructor( * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun parseTier(): Optional = parseTier.getOptional("parse_tier") + fun parseTier(): Optional = parseTier.getOptional("parse_tier") /** * Optional worksheet names to extract when spreadsheet_mode is on. Overrides target_pages for @@ -310,7 +312,7 @@ private constructor( * * Unlike [parseTier], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("parse_tier") @ExcludeMissing fun _parseTier(): JsonField = parseTier + @JsonProperty("parse_tier") @ExcludeMissing fun _parseTier(): JsonField = parseTier /** * Returns the raw JSON value of [sheetNames]. @@ -398,7 +400,7 @@ private constructor( private var extractionTarget: JsonField = JsonMissing.of() private var maxPages: JsonField = JsonMissing.of() private var parseConfigId: JsonField = JsonMissing.of() - private var parseTier: JsonField = JsonMissing.of() + private var parseTier: JsonField = JsonMissing.of() private var sheetNames: JsonField>? = null private var spreadsheetMode: JsonField = JsonMissing.of() private var systemPrompt: JsonField = JsonMissing.of() @@ -570,19 +572,19 @@ private constructor( * extract does not support parse configuration or produce a parse output; use another tier * if your workflow requires parsed text. */ - fun parseTier(parseTier: String?) = parseTier(JsonField.ofNullable(parseTier)) + fun parseTier(parseTier: ParseTier?) = parseTier(JsonField.ofNullable(parseTier)) /** Alias for calling [Builder.parseTier] with `parseTier.orElse(null)`. */ - fun parseTier(parseTier: Optional) = parseTier(parseTier.getOrNull()) + fun parseTier(parseTier: Optional) = parseTier(parseTier.getOrNull()) /** * Sets [Builder.parseTier] to an arbitrary JSON value. * - * You should usually call [Builder.parseTier] with a well-typed [String] value instead. + * You should usually call [Builder.parseTier] with a well-typed [ParseTier] value instead. * This method is primarily for setting the field to an undocumented or not yet supported * value. */ - fun parseTier(parseTier: JsonField) = apply { this.parseTier = parseTier } + fun parseTier(parseTier: JsonField) = apply { this.parseTier = parseTier } /** * Optional worksheet names to extract when spreadsheet_mode is on. Overrides target_pages @@ -782,7 +784,7 @@ private constructor( extractionTarget().ifPresent { it.validate() } maxPages() parseConfigId() - parseTier() + parseTier().ifPresent { it.validate() } sheetNames() spreadsheetMode() systemPrompt() @@ -815,7 +817,7 @@ private constructor( (extractionTarget.asKnown().getOrNull()?.validity() ?: 0) + (if (maxPages.asKnown().isPresent) 1 else 0) + (if (parseConfigId.asKnown().isPresent) 1 else 0) + - (if (parseTier.asKnown().isPresent) 1 else 0) + + (parseTier.asKnown().getOrNull()?.validity() ?: 0) + (sheetNames.asKnown().getOrNull()?.size ?: 0) + (if (spreadsheetMode.asKnown().isPresent) 1 else 0) + (if (systemPrompt.asKnown().isPresent) 1 else 0) + @@ -1085,6 +1087,161 @@ private constructor( override fun toString() = value.toString() } + /** + * Parse tier to use before extraction. Defaults to the extract tier if not specified. Turbo + * extract does not support parse configuration or produce a parse output; use another tier if + * your workflow requires parsed text. + */ + class ParseTier @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val AGENTIC = of("agentic") + + @JvmField val AGENTIC_PLUS = of("agentic_plus") + + @JvmField val COST_EFFECTIVE = of("cost_effective") + + @JvmField val FAST = of("fast") + + @JvmStatic fun of(value: String) = ParseTier(JsonField.of(value)) + } + + /** An enum containing [ParseTier]'s known values. */ + enum class Known { + AGENTIC, + AGENTIC_PLUS, + COST_EFFECTIVE, + FAST, + } + + /** + * An enum containing [ParseTier]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ParseTier] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + AGENTIC, + AGENTIC_PLUS, + COST_EFFECTIVE, + FAST, + /** + * An enum member indicating that [ParseTier] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + AGENTIC -> Value.AGENTIC + AGENTIC_PLUS -> Value.AGENTIC_PLUS + COST_EFFECTIVE -> Value.COST_EFFECTIVE + FAST -> Value.FAST + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws LlamaCloudInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + AGENTIC -> Known.AGENTIC + AGENTIC_PLUS -> Known.AGENTIC_PLUS + COST_EFFECTIVE -> Known.COST_EFFECTIVE + FAST -> Known.FAST + else -> throw LlamaCloudInvalidDataException("Unknown ParseTier: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws LlamaCloudInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + LlamaCloudInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LlamaCloudInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): ParseTier = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LlamaCloudInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ParseTier && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** * Extract tier: cost_effective (5 credits/page), agentic (15 credits/page), agentic_plus (50 * credits/page), or turbo (35 credits/page) diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractConfiguration.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractConfiguration.kt index 4e7552e..eeb70f9 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractConfiguration.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractConfiguration.kt @@ -31,7 +31,7 @@ private constructor( private val extractionTarget: JsonField, private val maxPages: JsonField, private val parseConfigId: JsonField, - private val parseTier: JsonField, + private val parseTier: JsonField, private val sheetNames: JsonField>, private val spreadsheetMode: JsonField, private val systemPrompt: JsonField, @@ -62,7 +62,9 @@ private constructor( @JsonProperty("parse_config_id") @ExcludeMissing parseConfigId: JsonField = JsonMissing.of(), - @JsonProperty("parse_tier") @ExcludeMissing parseTier: JsonField = JsonMissing.of(), + @JsonProperty("parse_tier") + @ExcludeMissing + parseTier: JsonField = JsonMissing.of(), @JsonProperty("sheet_names") @ExcludeMissing sheetNames: JsonField> = JsonMissing.of(), @@ -166,7 +168,7 @@ private constructor( * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun parseTier(): Optional = parseTier.getOptional("parse_tier") + fun parseTier(): Optional = parseTier.getOptional("parse_tier") /** * Optional worksheet names to extract when spreadsheet_mode is on. Overrides target_pages for @@ -294,7 +296,7 @@ private constructor( * * Unlike [parseTier], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("parse_tier") @ExcludeMissing fun _parseTier(): JsonField = parseTier + @JsonProperty("parse_tier") @ExcludeMissing fun _parseTier(): JsonField = parseTier /** * Returns the raw JSON value of [sheetNames]. @@ -381,7 +383,7 @@ private constructor( private var extractionTarget: JsonField = JsonMissing.of() private var maxPages: JsonField = JsonMissing.of() private var parseConfigId: JsonField = JsonMissing.of() - private var parseTier: JsonField = JsonMissing.of() + private var parseTier: JsonField = JsonMissing.of() private var sheetNames: JsonField>? = null private var spreadsheetMode: JsonField = JsonMissing.of() private var systemPrompt: JsonField = JsonMissing.of() @@ -538,19 +540,19 @@ private constructor( * extract does not support parse configuration or produce a parse output; use another tier * if your workflow requires parsed text. */ - fun parseTier(parseTier: String?) = parseTier(JsonField.ofNullable(parseTier)) + fun parseTier(parseTier: ParseTier?) = parseTier(JsonField.ofNullable(parseTier)) /** Alias for calling [Builder.parseTier] with `parseTier.orElse(null)`. */ - fun parseTier(parseTier: Optional) = parseTier(parseTier.getOrNull()) + fun parseTier(parseTier: Optional) = parseTier(parseTier.getOrNull()) /** * Sets [Builder.parseTier] to an arbitrary JSON value. * - * You should usually call [Builder.parseTier] with a well-typed [String] value instead. + * You should usually call [Builder.parseTier] with a well-typed [ParseTier] value instead. * This method is primarily for setting the field to an undocumented or not yet supported * value. */ - fun parseTier(parseTier: JsonField) = apply { this.parseTier = parseTier } + fun parseTier(parseTier: JsonField) = apply { this.parseTier = parseTier } /** * Optional worksheet names to extract when spreadsheet_mode is on. Overrides target_pages @@ -744,7 +746,7 @@ private constructor( extractionTarget().ifPresent { it.validate() } maxPages() parseConfigId() - parseTier() + parseTier().ifPresent { it.validate() } sheetNames() spreadsheetMode() systemPrompt() @@ -776,7 +778,7 @@ private constructor( (extractionTarget.asKnown().getOrNull()?.validity() ?: 0) + (if (maxPages.asKnown().isPresent) 1 else 0) + (if (parseConfigId.asKnown().isPresent) 1 else 0) + - (if (parseTier.asKnown().isPresent) 1 else 0) + + (parseTier.asKnown().getOrNull()?.validity() ?: 0) + (sheetNames.asKnown().getOrNull()?.size ?: 0) + (if (spreadsheetMode.asKnown().isPresent) 1 else 0) + (if (systemPrompt.asKnown().isPresent) 1 else 0) + @@ -1046,6 +1048,161 @@ private constructor( override fun toString() = value.toString() } + /** + * Parse tier to use before extraction. Defaults to the extract tier if not specified. Turbo + * extract does not support parse configuration or produce a parse output; use another tier if + * your workflow requires parsed text. + */ + class ParseTier @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val AGENTIC = of("agentic") + + @JvmField val AGENTIC_PLUS = of("agentic_plus") + + @JvmField val COST_EFFECTIVE = of("cost_effective") + + @JvmField val FAST = of("fast") + + @JvmStatic fun of(value: String) = ParseTier(JsonField.of(value)) + } + + /** An enum containing [ParseTier]'s known values. */ + enum class Known { + AGENTIC, + AGENTIC_PLUS, + COST_EFFECTIVE, + FAST, + } + + /** + * An enum containing [ParseTier]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ParseTier] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + AGENTIC, + AGENTIC_PLUS, + COST_EFFECTIVE, + FAST, + /** + * An enum member indicating that [ParseTier] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + AGENTIC -> Value.AGENTIC + AGENTIC_PLUS -> Value.AGENTIC_PLUS + COST_EFFECTIVE -> Value.COST_EFFECTIVE + FAST -> Value.FAST + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws LlamaCloudInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + AGENTIC -> Known.AGENTIC + AGENTIC_PLUS -> Known.AGENTIC_PLUS + COST_EFFECTIVE -> Known.COST_EFFECTIVE + FAST -> Known.FAST + else -> throw LlamaCloudInvalidDataException("Unknown ParseTier: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws LlamaCloudInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + LlamaCloudInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing fields. + * + * @throws LlamaCloudInvalidDataException if any value type in this object doesn't match its + * expected type. + */ + fun validate(): ParseTier = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: LlamaCloudInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ParseTier && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** * Extract tier: cost_effective (5 credits/page), agentic (15 credits/page), agentic_plus (50 * credits/page), or turbo (35 credits/page) diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/configurations/ExtractV2ParametersTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/configurations/ExtractV2ParametersTest.kt index 4cb735c..e6f5ef6 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/configurations/ExtractV2ParametersTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/configurations/ExtractV2ParametersTest.kt @@ -26,7 +26,7 @@ internal class ExtractV2ParametersTest { .extractionTarget(ExtractV2Parameters.ExtractionTarget.PER_DOC) .maxPages(10L) .parseConfigId("cfg-11111111-2222-3333-4444-555555555555") - .parseTier("fast") + .parseTier(ExtractV2Parameters.ParseTier.FAST) .addSheetName("Sheet 1") .addSheetName("Q4 Summary") .spreadsheetMode(true) @@ -52,7 +52,7 @@ internal class ExtractV2ParametersTest { assertThat(extractV2Parameters.maxPages()).contains(10L) assertThat(extractV2Parameters.parseConfigId()) .contains("cfg-11111111-2222-3333-4444-555555555555") - assertThat(extractV2Parameters.parseTier()).contains("fast") + assertThat(extractV2Parameters.parseTier()).contains(ExtractV2Parameters.ParseTier.FAST) assertThat(extractV2Parameters.sheetNames().getOrNull()) .containsExactly("Sheet 1", "Q4 Summary") assertThat(extractV2Parameters.spreadsheetMode()).contains(true) @@ -81,7 +81,7 @@ internal class ExtractV2ParametersTest { .extractionTarget(ExtractV2Parameters.ExtractionTarget.PER_DOC) .maxPages(10L) .parseConfigId("cfg-11111111-2222-3333-4444-555555555555") - .parseTier("fast") + .parseTier(ExtractV2Parameters.ParseTier.FAST) .addSheetName("Sheet 1") .addSheetName("Q4 Summary") .spreadsheetMode(true) diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractConfigurationTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractConfigurationTest.kt index 50b9087..3143c21 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractConfigurationTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractConfigurationTest.kt @@ -26,7 +26,7 @@ internal class ExtractConfigurationTest { .extractionTarget(ExtractConfiguration.ExtractionTarget.PER_DOC) .maxPages(10L) .parseConfigId("cfg-11111111-2222-3333-4444-555555555555") - .parseTier("fast") + .parseTier(ExtractConfiguration.ParseTier.FAST) .addSheetName("Sheet 1") .addSheetName("Q4 Summary") .spreadsheetMode(true) @@ -52,7 +52,7 @@ internal class ExtractConfigurationTest { assertThat(extractConfiguration.maxPages()).contains(10L) assertThat(extractConfiguration.parseConfigId()) .contains("cfg-11111111-2222-3333-4444-555555555555") - assertThat(extractConfiguration.parseTier()).contains("fast") + assertThat(extractConfiguration.parseTier()).contains(ExtractConfiguration.ParseTier.FAST) assertThat(extractConfiguration.sheetNames().getOrNull()) .containsExactly("Sheet 1", "Q4 Summary") assertThat(extractConfiguration.spreadsheetMode()).contains(true) @@ -81,7 +81,7 @@ internal class ExtractConfigurationTest { .extractionTarget(ExtractConfiguration.ExtractionTarget.PER_DOC) .maxPages(10L) .parseConfigId("cfg-11111111-2222-3333-4444-555555555555") - .parseTier("fast") + .parseTier(ExtractConfiguration.ParseTier.FAST) .addSheetName("Sheet 1") .addSheetName("Q4 Summary") .spreadsheetMode(true) diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractCreateParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractCreateParamsTest.kt index af3cd12..be5d11e 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractCreateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractCreateParamsTest.kt @@ -40,7 +40,7 @@ internal class ExtractCreateParamsTest { .extractionTarget(ExtractConfiguration.ExtractionTarget.PER_DOC) .maxPages(10L) .parseConfigId("cfg-11111111-2222-3333-4444-555555555555") - .parseTier("fast") + .parseTier(ExtractConfiguration.ParseTier.FAST) .addSheetName("Sheet 1") .addSheetName("Q4 Summary") .spreadsheetMode(true) @@ -116,7 +116,7 @@ internal class ExtractCreateParamsTest { .extractionTarget(ExtractConfiguration.ExtractionTarget.PER_DOC) .maxPages(10L) .parseConfigId("cfg-11111111-2222-3333-4444-555555555555") - .parseTier("fast") + .parseTier(ExtractConfiguration.ParseTier.FAST) .addSheetName("Sheet 1") .addSheetName("Q4 Summary") .spreadsheetMode(true) @@ -219,7 +219,7 @@ internal class ExtractCreateParamsTest { .extractionTarget(ExtractConfiguration.ExtractionTarget.PER_DOC) .maxPages(10L) .parseConfigId("cfg-11111111-2222-3333-4444-555555555555") - .parseTier("fast") + .parseTier(ExtractConfiguration.ParseTier.FAST) .addSheetName("Sheet 1") .addSheetName("Q4 Summary") .spreadsheetMode(true) @@ -289,7 +289,7 @@ internal class ExtractCreateParamsTest { .extractionTarget(ExtractConfiguration.ExtractionTarget.PER_DOC) .maxPages(10L) .parseConfigId("cfg-11111111-2222-3333-4444-555555555555") - .parseTier("fast") + .parseTier(ExtractConfiguration.ParseTier.FAST) .addSheetName("Sheet 1") .addSheetName("Q4 Summary") .spreadsheetMode(true) diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2JobCreateTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2JobCreateTest.kt index e6d77ba..2f4f02e 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2JobCreateTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2JobCreateTest.kt @@ -39,7 +39,7 @@ internal class ExtractV2JobCreateTest { .extractionTarget(ExtractConfiguration.ExtractionTarget.PER_DOC) .maxPages(10L) .parseConfigId("cfg-11111111-2222-3333-4444-555555555555") - .parseTier("fast") + .parseTier(ExtractConfiguration.ParseTier.FAST) .addSheetName("Sheet 1") .addSheetName("Q4 Summary") .spreadsheetMode(true) @@ -103,7 +103,7 @@ internal class ExtractV2JobCreateTest { .extractionTarget(ExtractConfiguration.ExtractionTarget.PER_DOC) .maxPages(10L) .parseConfigId("cfg-11111111-2222-3333-4444-555555555555") - .parseTier("fast") + .parseTier(ExtractConfiguration.ParseTier.FAST) .addSheetName("Sheet 1") .addSheetName("Q4 Summary") .spreadsheetMode(true) @@ -169,7 +169,7 @@ internal class ExtractV2JobCreateTest { .extractionTarget(ExtractConfiguration.ExtractionTarget.PER_DOC) .maxPages(10L) .parseConfigId("cfg-11111111-2222-3333-4444-555555555555") - .parseTier("fast") + .parseTier(ExtractConfiguration.ParseTier.FAST) .addSheetName("Sheet 1") .addSheetName("Q4 Summary") .spreadsheetMode(true) diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2JobQueryResponseTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2JobQueryResponseTest.kt index ac77e50..ca9610a 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2JobQueryResponseTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2JobQueryResponseTest.kt @@ -39,7 +39,7 @@ internal class ExtractV2JobQueryResponseTest { .extractionTarget(ExtractConfiguration.ExtractionTarget.PER_DOC) .maxPages(10L) .parseConfigId("cfg-11111111-2222-3333-4444-555555555555") - .parseTier("fast") + .parseTier(ExtractConfiguration.ParseTier.FAST) .addSheetName("Sheet 1") .addSheetName("Q4 Summary") .spreadsheetMode(true) @@ -189,7 +189,7 @@ internal class ExtractV2JobQueryResponseTest { .extractionTarget(ExtractConfiguration.ExtractionTarget.PER_DOC) .maxPages(10L) .parseConfigId("cfg-11111111-2222-3333-4444-555555555555") - .parseTier("fast") + .parseTier(ExtractConfiguration.ParseTier.FAST) .addSheetName("Sheet 1") .addSheetName("Q4 Summary") .spreadsheetMode(true) @@ -343,7 +343,7 @@ internal class ExtractV2JobQueryResponseTest { .extractionTarget(ExtractConfiguration.ExtractionTarget.PER_DOC) .maxPages(10L) .parseConfigId("cfg-11111111-2222-3333-4444-555555555555") - .parseTier("fast") + .parseTier(ExtractConfiguration.ParseTier.FAST) .addSheetName("Sheet 1") .addSheetName("Q4 Summary") .spreadsheetMode(true) diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2JobTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2JobTest.kt index 3536131..5f8d134 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2JobTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2JobTest.kt @@ -34,7 +34,7 @@ internal class ExtractV2JobTest { .extractionTarget(ExtractConfiguration.ExtractionTarget.PER_DOC) .maxPages(10L) .parseConfigId("cfg-11111111-2222-3333-4444-555555555555") - .parseTier("fast") + .parseTier(ExtractConfiguration.ParseTier.FAST) .addSheetName("Sheet 1") .addSheetName("Q4 Summary") .spreadsheetMode(true) @@ -174,7 +174,7 @@ internal class ExtractV2JobTest { .extractionTarget(ExtractConfiguration.ExtractionTarget.PER_DOC) .maxPages(10L) .parseConfigId("cfg-11111111-2222-3333-4444-555555555555") - .parseTier("fast") + .parseTier(ExtractConfiguration.ParseTier.FAST) .addSheetName("Sheet 1") .addSheetName("Q4 Summary") .spreadsheetMode(true) @@ -320,7 +320,7 @@ internal class ExtractV2JobTest { .extractionTarget(ExtractConfiguration.ExtractionTarget.PER_DOC) .maxPages(10L) .parseConfigId("cfg-11111111-2222-3333-4444-555555555555") - .parseTier("fast") + .parseTier(ExtractConfiguration.ParseTier.FAST) .addSheetName("Sheet 1") .addSheetName("Q4 Summary") .spreadsheetMode(true) diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/ExtractServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/ExtractServiceAsyncTest.kt index b9824ee..fbfbd2e 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/ExtractServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/ExtractServiceAsyncTest.kt @@ -60,7 +60,7 @@ internal class ExtractServiceAsyncTest { .extractionTarget(ExtractConfiguration.ExtractionTarget.PER_DOC) .maxPages(10L) .parseConfigId("cfg-11111111-2222-3333-4444-555555555555") - .parseTier("fast") + .parseTier(ExtractConfiguration.ParseTier.FAST) .addSheetName("Sheet 1") .addSheetName("Q4 Summary") .spreadsheetMode(true) diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/ExtractServiceTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/ExtractServiceTest.kt index 7faf7d9..ab7348a 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/ExtractServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/ExtractServiceTest.kt @@ -60,7 +60,7 @@ internal class ExtractServiceTest { .extractionTarget(ExtractConfiguration.ExtractionTarget.PER_DOC) .maxPages(10L) .parseConfigId("cfg-11111111-2222-3333-4444-555555555555") - .parseTier("fast") + .parseTier(ExtractConfiguration.ParseTier.FAST) .addSheetName("Sheet 1") .addSheetName("Q4 Summary") .spreadsheetMode(true) From 99d9bd251b4de46d092d06ff4fe893a73bb927e3 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Mon, 31 Aug 2026 09:55:52 +0000 Subject: [PATCH 07/11] LI-9368: refuse a retrieval count below one at the request boundary (#25638) Stainless-Generated-From: 98b1ce1f90be49f9ea4955e8cbf5d898c1c41c86 --- .../models/beta/retrieval/RetrievalRetrieveParams.kt | 8 ++++---- .../models/beta/retrieval/RetrievalRetrieveParamsTest.kt | 8 ++++---- .../services/async/beta/RetrievalServiceAsyncTest.kt | 2 +- .../services/blocking/beta/RetrievalServiceTest.kt | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/beta/retrieval/RetrievalRetrieveParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/beta/retrieval/RetrievalRetrieveParams.kt index e7cb8bb..86aa1e1 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/beta/retrieval/RetrievalRetrieveParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/beta/retrieval/RetrievalRetrieveParams.kt @@ -115,7 +115,7 @@ private constructor( fun staticFilters(): Optional = body.staticFilters() /** - * Maximum number of results to return. + * Maximum number of results to return. Values above 500 are capped at 500. * * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -422,7 +422,7 @@ private constructor( body.staticFilters(staticFilters) } - /** Maximum number of results to return. */ + /** Maximum number of results to return. Values above 500 are capped at 500. */ fun topK(topK: Long?) = apply { body.topK(topK) } /** @@ -748,7 +748,7 @@ private constructor( fun staticFilters(): Optional = staticFilters.getOptional("static_filters") /** - * Maximum number of results to return. + * Maximum number of results to return. Values above 500 are capped at 500. * * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -1064,7 +1064,7 @@ private constructor( this.staticFilters = staticFilters } - /** Maximum number of results to return. */ + /** Maximum number of results to return. Values above 500 are capped at 500. */ fun topK(topK: Long?) = topK(JsonField.ofNullable(topK)) /** diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/beta/retrieval/RetrievalRetrieveParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/beta/retrieval/RetrievalRetrieveParamsTest.kt index 481a507..c3103b1 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/beta/retrieval/RetrievalRetrieveParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/beta/retrieval/RetrievalRetrieveParamsTest.kt @@ -25,7 +25,7 @@ internal class RetrievalRetrieveParamsTest { .build() ) .fullTextPipelineWeight(0.0) - .numCandidates(0L) + .numCandidates(1L) .rerank(RetrievalRetrieveParams.Rerank.builder().enabled(true).topN(5L).build()) .scoreThreshold(0.0) .staticFilters( @@ -63,7 +63,7 @@ internal class RetrievalRetrieveParamsTest { .build() ) .fullTextPipelineWeight(0.0) - .numCandidates(0L) + .numCandidates(1L) .rerank(RetrievalRetrieveParams.Rerank.builder().enabled(true).topN(5L).build()) .scoreThreshold(0.0) .staticFilters( @@ -125,7 +125,7 @@ internal class RetrievalRetrieveParamsTest { .build() ) .fullTextPipelineWeight(0.0) - .numCandidates(0L) + .numCandidates(1L) .rerank(RetrievalRetrieveParams.Rerank.builder().enabled(true).topN(5L).build()) .scoreThreshold(0.0) .staticFilters( @@ -160,7 +160,7 @@ internal class RetrievalRetrieveParamsTest { .build() ) assertThat(body.fullTextPipelineWeight()).contains(0.0) - assertThat(body.numCandidates()).contains(0L) + assertThat(body.numCandidates()).contains(1L) assertThat(body.rerank()) .contains(RetrievalRetrieveParams.Rerank.builder().enabled(true).topN(5L).build()) assertThat(body.scoreThreshold()).contains(0.0) diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/beta/RetrievalServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/beta/RetrievalServiceAsyncTest.kt index 227f712..83fd837 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/beta/RetrievalServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/beta/RetrievalServiceAsyncTest.kt @@ -35,7 +35,7 @@ internal class RetrievalServiceAsyncTest { .build() ) .fullTextPipelineWeight(0.0) - .numCandidates(0L) + .numCandidates(1L) .rerank(RetrievalRetrieveParams.Rerank.builder().enabled(true).topN(5L).build()) .scoreThreshold(0.0) .staticFilters( diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/beta/RetrievalServiceTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/beta/RetrievalServiceTest.kt index 4693448..04eebb3 100644 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/beta/RetrievalServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/beta/RetrievalServiceTest.kt @@ -35,7 +35,7 @@ internal class RetrievalServiceTest { .build() ) .fullTextPipelineWeight(0.0) - .numCandidates(0L) + .numCandidates(1L) .rerank(RetrievalRetrieveParams.Rerank.builder().enabled(true).topN(5L).build()) .scoreThreshold(0.0) .staticFilters( From 2aa6de08312f44591fcf6b90d239de3cbf8f357b Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Mon, 31 Aug 2026 10:31:06 +0000 Subject: [PATCH 08/11] LI-9369: refuse a webhook subscription to no events (#25639) Stainless-Generated-From: a5b25e61f39591ccb28df3b20be9476ee11eb994 --- .../llamacloud/models/extract/ExtractV2Job.kt | 84 +++++++++---------- .../webhookconfigs/WebhookConfigCreate.kt | 8 +- .../WebhookConfigUpdateParams.kt | 8 +- 3 files changed, 52 insertions(+), 48 deletions(-) diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2Job.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2Job.kt index f145cdf..02488c0 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2Job.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2Job.kt @@ -560,13 +560,13 @@ private constructor( /** * Alias for calling [extractResult] with - * `ExtractResult.ofUnnamedSchemaWithArrayParent0s(unnamedSchemaWithArrayParent0s)`. + * `ExtractResult.ofUnnamedSchemaWithArrayParent2s(unnamedSchemaWithArrayParent2s)`. */ - fun extractResultOfUnnamedSchemaWithArrayParent0s( - unnamedSchemaWithArrayParent0s: List + fun extractResultOfUnnamedSchemaWithArrayParent2s( + unnamedSchemaWithArrayParent2s: List ) = extractResult( - ExtractResult.ofUnnamedSchemaWithArrayParent0s(unnamedSchemaWithArrayParent0s) + ExtractResult.ofUnnamedSchemaWithArrayParent2s(unnamedSchemaWithArrayParent2s) ) /** Job-level metadata. */ @@ -727,23 +727,23 @@ private constructor( class ExtractResult private constructor( private val unionMember0: UnionMember0? = null, - private val unnamedSchemaWithArrayParent0s: List? = null, + private val unnamedSchemaWithArrayParent2s: List? = null, private val _json: JsonValue? = null, ) { fun unionMember0(): Optional = Optional.ofNullable(unionMember0) - fun unnamedSchemaWithArrayParent0s(): Optional> = - Optional.ofNullable(unnamedSchemaWithArrayParent0s) + fun unnamedSchemaWithArrayParent2s(): Optional> = + Optional.ofNullable(unnamedSchemaWithArrayParent2s) fun isUnionMember0(): Boolean = unionMember0 != null - fun isUnnamedSchemaWithArrayParent0s(): Boolean = unnamedSchemaWithArrayParent0s != null + fun isUnnamedSchemaWithArrayParent2s(): Boolean = unnamedSchemaWithArrayParent2s != null fun asUnionMember0(): UnionMember0 = unionMember0.getOrThrow("unionMember0") - fun asUnnamedSchemaWithArrayParent0s(): List = - unnamedSchemaWithArrayParent0s.getOrThrow("unnamedSchemaWithArrayParent0s") + fun asUnnamedSchemaWithArrayParent2s(): List = + unnamedSchemaWithArrayParent2s.getOrThrow("unnamedSchemaWithArrayParent2s") fun _json(): Optional = Optional.ofNullable(_json) @@ -779,8 +779,8 @@ private constructor( fun accept(visitor: Visitor): T = when { unionMember0 != null -> visitor.visitUnionMember0(unionMember0) - unnamedSchemaWithArrayParent0s != null -> - visitor.visitUnnamedSchemaWithArrayParent0s(unnamedSchemaWithArrayParent0s) + unnamedSchemaWithArrayParent2s != null -> + visitor.visitUnnamedSchemaWithArrayParent2s(unnamedSchemaWithArrayParent2s) else -> visitor.unknown(_json) } @@ -806,10 +806,10 @@ private constructor( unionMember0.validate() } - override fun visitUnnamedSchemaWithArrayParent0s( - unnamedSchemaWithArrayParent0s: List + override fun visitUnnamedSchemaWithArrayParent2s( + unnamedSchemaWithArrayParent2s: List ) { - unnamedSchemaWithArrayParent0s.forEach { it.validate() } + unnamedSchemaWithArrayParent2s.forEach { it.validate() } } } ) @@ -837,9 +837,9 @@ private constructor( override fun visitUnionMember0(unionMember0: UnionMember0) = unionMember0.validity() - override fun visitUnnamedSchemaWithArrayParent0s( - unnamedSchemaWithArrayParent0s: List - ) = unnamedSchemaWithArrayParent0s.sumOf { it.validity().toInt() } + override fun visitUnnamedSchemaWithArrayParent2s( + unnamedSchemaWithArrayParent2s: List + ) = unnamedSchemaWithArrayParent2s.sumOf { it.validity().toInt() } override fun unknown(json: JsonValue?) = 0 } @@ -852,16 +852,16 @@ private constructor( return other is ExtractResult && unionMember0 == other.unionMember0 && - unnamedSchemaWithArrayParent0s == other.unnamedSchemaWithArrayParent0s + unnamedSchemaWithArrayParent2s == other.unnamedSchemaWithArrayParent2s } - override fun hashCode(): Int = Objects.hash(unionMember0, unnamedSchemaWithArrayParent0s) + override fun hashCode(): Int = Objects.hash(unionMember0, unnamedSchemaWithArrayParent2s) override fun toString(): String = when { unionMember0 != null -> "ExtractResult{unionMember0=$unionMember0}" - unnamedSchemaWithArrayParent0s != null -> - "ExtractResult{unnamedSchemaWithArrayParent0s=$unnamedSchemaWithArrayParent0s}" + unnamedSchemaWithArrayParent2s != null -> + "ExtractResult{unnamedSchemaWithArrayParent2s=$unnamedSchemaWithArrayParent2s}" _json != null -> "ExtractResult{_unknown=$_json}" else -> throw IllegalStateException("Invalid ExtractResult") } @@ -873,11 +873,11 @@ private constructor( ExtractResult(unionMember0 = unionMember0) @JvmStatic - fun ofUnnamedSchemaWithArrayParent0s( - unnamedSchemaWithArrayParent0s: List + fun ofUnnamedSchemaWithArrayParent2s( + unnamedSchemaWithArrayParent2s: List ) = ExtractResult( - unnamedSchemaWithArrayParent0s = unnamedSchemaWithArrayParent0s.toImmutable() + unnamedSchemaWithArrayParent2s = unnamedSchemaWithArrayParent2s.toImmutable() ) } @@ -889,8 +889,8 @@ private constructor( fun visitUnionMember0(unionMember0: UnionMember0): T - fun visitUnnamedSchemaWithArrayParent0s( - unnamedSchemaWithArrayParent0s: List + fun visitUnnamedSchemaWithArrayParent2s( + unnamedSchemaWithArrayParent2s: List ): T /** @@ -920,10 +920,10 @@ private constructor( }, tryDeserialize( node, - jacksonTypeRef>(), + jacksonTypeRef>(), ) ?.let { - ExtractResult(unnamedSchemaWithArrayParent0s = it, _json = json) + ExtractResult(unnamedSchemaWithArrayParent2s = it, _json = json) }, ) .filterNotNull() @@ -951,8 +951,8 @@ private constructor( ) { when { value.unionMember0 != null -> generator.writeObject(value.unionMember0) - value.unnamedSchemaWithArrayParent0s != null -> - generator.writeObject(value.unnamedSchemaWithArrayParent0s) + value.unnamedSchemaWithArrayParent2s != null -> + generator.writeObject(value.unnamedSchemaWithArrayParent2s) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid ExtractResult") } @@ -1071,7 +1071,7 @@ private constructor( override fun toString() = "UnionMember0{additionalProperties=$additionalProperties}" } - class UnnamedSchemaWithArrayParent0 + class UnnamedSchemaWithArrayParent2 @JsonCreator private constructor( @com.fasterxml.jackson.annotation.JsonValue @@ -1088,21 +1088,21 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [UnnamedSchemaWithArrayParent0]. + * [UnnamedSchemaWithArrayParent2]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [UnnamedSchemaWithArrayParent0]. */ + /** A builder for [UnnamedSchemaWithArrayParent2]. */ class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unnamedSchemaWithArrayParent0: UnnamedSchemaWithArrayParent0) = + internal fun from(unnamedSchemaWithArrayParent2: UnnamedSchemaWithArrayParent2) = apply { additionalProperties = - unnamedSchemaWithArrayParent0.additionalProperties.toMutableMap() + unnamedSchemaWithArrayParent2.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -1128,12 +1128,12 @@ private constructor( } /** - * Returns an immutable instance of [UnnamedSchemaWithArrayParent0]. + * Returns an immutable instance of [UnnamedSchemaWithArrayParent2]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): UnnamedSchemaWithArrayParent0 = - UnnamedSchemaWithArrayParent0(additionalProperties.toImmutable()) + fun build(): UnnamedSchemaWithArrayParent2 = + UnnamedSchemaWithArrayParent2(additionalProperties.toImmutable()) } private var validated: Boolean = false @@ -1148,7 +1148,7 @@ private constructor( * @throws LlamaCloudInvalidDataException if any value type in this object doesn't match * its expected type. */ - fun validate(): UnnamedSchemaWithArrayParent0 = apply { + fun validate(): UnnamedSchemaWithArrayParent2 = apply { if (validated) { return@apply } @@ -1179,7 +1179,7 @@ private constructor( return true } - return other is UnnamedSchemaWithArrayParent0 && + return other is UnnamedSchemaWithArrayParent2 && additionalProperties == other.additionalProperties } @@ -1188,7 +1188,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnnamedSchemaWithArrayParent0{additionalProperties=$additionalProperties}" + "UnnamedSchemaWithArrayParent2{additionalProperties=$additionalProperties}" } } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/webhookconfigs/WebhookConfigCreate.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/webhookconfigs/WebhookConfigCreate.kt index a72aa5c..6f2537d 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/webhookconfigs/WebhookConfigCreate.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/webhookconfigs/WebhookConfigCreate.kt @@ -71,7 +71,8 @@ private constructor( fun webhookUrl(): String = webhookUrl.getRequired("webhook_url") /** - * Events to subscribe to. If null, all events are delivered. + * Events to subscribe to. If null, all events are delivered. An empty list subscribes to + * nothing and is rejected. * * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -207,7 +208,10 @@ private constructor( */ fun webhookUrl(webhookUrl: JsonField) = apply { this.webhookUrl = webhookUrl } - /** Events to subscribe to. If null, all events are delivered. */ + /** + * Events to subscribe to. If null, all events are delivered. An empty list subscribes to + * nothing and is rejected. + */ fun webhookEvents(webhookEvents: List?) = webhookEvents(JsonField.ofNullable(webhookEvents)) diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/webhookconfigs/WebhookConfigUpdateParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/webhookconfigs/WebhookConfigUpdateParams.kt index 6c05081..db797af 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/webhookconfigs/WebhookConfigUpdateParams.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/webhookconfigs/WebhookConfigUpdateParams.kt @@ -40,7 +40,7 @@ private constructor( fun projectId(): Optional = Optional.ofNullable(projectId) /** - * Updated event subscriptions. + * Updated event subscriptions. Omit to leave unchanged; [] is rejected. * * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -186,7 +186,7 @@ private constructor( */ fun body(body: Body) = apply { this.body = body.toBuilder() } - /** Updated event subscriptions. */ + /** Updated event subscriptions. Omit to leave unchanged; [] is rejected. */ fun webhookEvents(webhookEvents: List?) = apply { body.webhookEvents(webhookEvents) } @@ -486,7 +486,7 @@ private constructor( ) /** - * Updated event subscriptions. + * Updated event subscriptions. Omit to leave unchanged; [] is rejected. * * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -616,7 +616,7 @@ private constructor( additionalProperties = body.additionalProperties.toMutableMap() } - /** Updated event subscriptions. */ + /** Updated event subscriptions. Omit to leave unchanged; [] is rejected. */ fun webhookEvents(webhookEvents: List?) = webhookEvents(JsonField.ofNullable(webhookEvents)) From fdcb3b68ee5ab27aa6544056b7885f3c0802b4c4 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Mon, 31 Aug 2026 11:03:07 +0000 Subject: [PATCH 09/11] LI-9370: make the chunk_overlap bound real, and fence the typo that disabled it (#25642) Stainless-Generated-From: 9d11a1ff6caf74f8e8bee99b47f6761ed05f016e --- .../llamacloud/models/extract/ExtractV2Job.kt | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2Job.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2Job.kt index 02488c0..f145cdf 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2Job.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/extract/ExtractV2Job.kt @@ -560,13 +560,13 @@ private constructor( /** * Alias for calling [extractResult] with - * `ExtractResult.ofUnnamedSchemaWithArrayParent2s(unnamedSchemaWithArrayParent2s)`. + * `ExtractResult.ofUnnamedSchemaWithArrayParent0s(unnamedSchemaWithArrayParent0s)`. */ - fun extractResultOfUnnamedSchemaWithArrayParent2s( - unnamedSchemaWithArrayParent2s: List + fun extractResultOfUnnamedSchemaWithArrayParent0s( + unnamedSchemaWithArrayParent0s: List ) = extractResult( - ExtractResult.ofUnnamedSchemaWithArrayParent2s(unnamedSchemaWithArrayParent2s) + ExtractResult.ofUnnamedSchemaWithArrayParent0s(unnamedSchemaWithArrayParent0s) ) /** Job-level metadata. */ @@ -727,23 +727,23 @@ private constructor( class ExtractResult private constructor( private val unionMember0: UnionMember0? = null, - private val unnamedSchemaWithArrayParent2s: List? = null, + private val unnamedSchemaWithArrayParent0s: List? = null, private val _json: JsonValue? = null, ) { fun unionMember0(): Optional = Optional.ofNullable(unionMember0) - fun unnamedSchemaWithArrayParent2s(): Optional> = - Optional.ofNullable(unnamedSchemaWithArrayParent2s) + fun unnamedSchemaWithArrayParent0s(): Optional> = + Optional.ofNullable(unnamedSchemaWithArrayParent0s) fun isUnionMember0(): Boolean = unionMember0 != null - fun isUnnamedSchemaWithArrayParent2s(): Boolean = unnamedSchemaWithArrayParent2s != null + fun isUnnamedSchemaWithArrayParent0s(): Boolean = unnamedSchemaWithArrayParent0s != null fun asUnionMember0(): UnionMember0 = unionMember0.getOrThrow("unionMember0") - fun asUnnamedSchemaWithArrayParent2s(): List = - unnamedSchemaWithArrayParent2s.getOrThrow("unnamedSchemaWithArrayParent2s") + fun asUnnamedSchemaWithArrayParent0s(): List = + unnamedSchemaWithArrayParent0s.getOrThrow("unnamedSchemaWithArrayParent0s") fun _json(): Optional = Optional.ofNullable(_json) @@ -779,8 +779,8 @@ private constructor( fun accept(visitor: Visitor): T = when { unionMember0 != null -> visitor.visitUnionMember0(unionMember0) - unnamedSchemaWithArrayParent2s != null -> - visitor.visitUnnamedSchemaWithArrayParent2s(unnamedSchemaWithArrayParent2s) + unnamedSchemaWithArrayParent0s != null -> + visitor.visitUnnamedSchemaWithArrayParent0s(unnamedSchemaWithArrayParent0s) else -> visitor.unknown(_json) } @@ -806,10 +806,10 @@ private constructor( unionMember0.validate() } - override fun visitUnnamedSchemaWithArrayParent2s( - unnamedSchemaWithArrayParent2s: List + override fun visitUnnamedSchemaWithArrayParent0s( + unnamedSchemaWithArrayParent0s: List ) { - unnamedSchemaWithArrayParent2s.forEach { it.validate() } + unnamedSchemaWithArrayParent0s.forEach { it.validate() } } } ) @@ -837,9 +837,9 @@ private constructor( override fun visitUnionMember0(unionMember0: UnionMember0) = unionMember0.validity() - override fun visitUnnamedSchemaWithArrayParent2s( - unnamedSchemaWithArrayParent2s: List - ) = unnamedSchemaWithArrayParent2s.sumOf { it.validity().toInt() } + override fun visitUnnamedSchemaWithArrayParent0s( + unnamedSchemaWithArrayParent0s: List + ) = unnamedSchemaWithArrayParent0s.sumOf { it.validity().toInt() } override fun unknown(json: JsonValue?) = 0 } @@ -852,16 +852,16 @@ private constructor( return other is ExtractResult && unionMember0 == other.unionMember0 && - unnamedSchemaWithArrayParent2s == other.unnamedSchemaWithArrayParent2s + unnamedSchemaWithArrayParent0s == other.unnamedSchemaWithArrayParent0s } - override fun hashCode(): Int = Objects.hash(unionMember0, unnamedSchemaWithArrayParent2s) + override fun hashCode(): Int = Objects.hash(unionMember0, unnamedSchemaWithArrayParent0s) override fun toString(): String = when { unionMember0 != null -> "ExtractResult{unionMember0=$unionMember0}" - unnamedSchemaWithArrayParent2s != null -> - "ExtractResult{unnamedSchemaWithArrayParent2s=$unnamedSchemaWithArrayParent2s}" + unnamedSchemaWithArrayParent0s != null -> + "ExtractResult{unnamedSchemaWithArrayParent0s=$unnamedSchemaWithArrayParent0s}" _json != null -> "ExtractResult{_unknown=$_json}" else -> throw IllegalStateException("Invalid ExtractResult") } @@ -873,11 +873,11 @@ private constructor( ExtractResult(unionMember0 = unionMember0) @JvmStatic - fun ofUnnamedSchemaWithArrayParent2s( - unnamedSchemaWithArrayParent2s: List + fun ofUnnamedSchemaWithArrayParent0s( + unnamedSchemaWithArrayParent0s: List ) = ExtractResult( - unnamedSchemaWithArrayParent2s = unnamedSchemaWithArrayParent2s.toImmutable() + unnamedSchemaWithArrayParent0s = unnamedSchemaWithArrayParent0s.toImmutable() ) } @@ -889,8 +889,8 @@ private constructor( fun visitUnionMember0(unionMember0: UnionMember0): T - fun visitUnnamedSchemaWithArrayParent2s( - unnamedSchemaWithArrayParent2s: List + fun visitUnnamedSchemaWithArrayParent0s( + unnamedSchemaWithArrayParent0s: List ): T /** @@ -920,10 +920,10 @@ private constructor( }, tryDeserialize( node, - jacksonTypeRef>(), + jacksonTypeRef>(), ) ?.let { - ExtractResult(unnamedSchemaWithArrayParent2s = it, _json = json) + ExtractResult(unnamedSchemaWithArrayParent0s = it, _json = json) }, ) .filterNotNull() @@ -951,8 +951,8 @@ private constructor( ) { when { value.unionMember0 != null -> generator.writeObject(value.unionMember0) - value.unnamedSchemaWithArrayParent2s != null -> - generator.writeObject(value.unnamedSchemaWithArrayParent2s) + value.unnamedSchemaWithArrayParent0s != null -> + generator.writeObject(value.unnamedSchemaWithArrayParent0s) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid ExtractResult") } @@ -1071,7 +1071,7 @@ private constructor( override fun toString() = "UnionMember0{additionalProperties=$additionalProperties}" } - class UnnamedSchemaWithArrayParent2 + class UnnamedSchemaWithArrayParent0 @JsonCreator private constructor( @com.fasterxml.jackson.annotation.JsonValue @@ -1088,21 +1088,21 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [UnnamedSchemaWithArrayParent2]. + * [UnnamedSchemaWithArrayParent0]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [UnnamedSchemaWithArrayParent2]. */ + /** A builder for [UnnamedSchemaWithArrayParent0]. */ class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unnamedSchemaWithArrayParent2: UnnamedSchemaWithArrayParent2) = + internal fun from(unnamedSchemaWithArrayParent0: UnnamedSchemaWithArrayParent0) = apply { additionalProperties = - unnamedSchemaWithArrayParent2.additionalProperties.toMutableMap() + unnamedSchemaWithArrayParent0.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -1128,12 +1128,12 @@ private constructor( } /** - * Returns an immutable instance of [UnnamedSchemaWithArrayParent2]. + * Returns an immutable instance of [UnnamedSchemaWithArrayParent0]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): UnnamedSchemaWithArrayParent2 = - UnnamedSchemaWithArrayParent2(additionalProperties.toImmutable()) + fun build(): UnnamedSchemaWithArrayParent0 = + UnnamedSchemaWithArrayParent0(additionalProperties.toImmutable()) } private var validated: Boolean = false @@ -1148,7 +1148,7 @@ private constructor( * @throws LlamaCloudInvalidDataException if any value type in this object doesn't match * its expected type. */ - fun validate(): UnnamedSchemaWithArrayParent2 = apply { + fun validate(): UnnamedSchemaWithArrayParent0 = apply { if (validated) { return@apply } @@ -1179,7 +1179,7 @@ private constructor( return true } - return other is UnnamedSchemaWithArrayParent2 && + return other is UnnamedSchemaWithArrayParent0 && additionalProperties == other.additionalProperties } @@ -1188,7 +1188,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnnamedSchemaWithArrayParent2{additionalProperties=$additionalProperties}" + "UnnamedSchemaWithArrayParent0{additionalProperties=$additionalProperties}" } } From 900a22a4e7d56fcaa8c7d1aca0ce78a89d2966d5 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Tue, 1 Sep 2026 00:41:11 +0000 Subject: [PATCH 10/11] Build SDK Stainless-Generated-From: c4b28402a9240edd7cdd5b9c95dd44d6c62de486 --- .stats.yml | 2 +- .../models/classifier/jobs/JobCreateParams.kt | 1656 ----------------- .../models/classifier/jobs/JobGetParams.kt | 234 --- .../classifier/jobs/JobGetResultsParams.kt | 234 --- .../classifier/jobs/JobGetResultsResponse.kt | 963 ---------- .../models/classifier/jobs/JobListPage.kt | 131 -- .../classifier/jobs/JobListPageAsync.kt | 145 -- .../classifier/jobs/JobListPageResponse.kt | 303 --- .../models/classifier/jobs/JobListParams.kt | 249 --- .../async/classifier/JobServiceAsync.kt | 263 --- .../async/classifier/JobServiceAsyncImpl.kt | 204 -- .../blocking/classifier/JobService.kt | 260 --- .../blocking/classifier/JobServiceImpl.kt | 181 -- .../classifier/jobs/JobCreateParamsTest.kt | 222 --- .../classifier/jobs/JobGetParamsTest.kt | 59 - .../jobs/JobGetResultsParamsTest.kt | 63 - .../jobs/JobGetResultsResponseTest.kt | 91 - .../jobs/JobListPageResponseTest.kt | 130 -- .../classifier/jobs/JobListParamsTest.kt | 52 - .../async/classifier/JobServiceAsyncTest.kt | 116 -- .../blocking/classifier/JobServiceTest.kt | 112 -- 21 files changed, 1 insertion(+), 5669 deletions(-) delete mode 100644 llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobCreateParams.kt delete mode 100644 llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetParams.kt delete mode 100644 llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetResultsParams.kt delete mode 100644 llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetResultsResponse.kt delete mode 100644 llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListPage.kt delete mode 100644 llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListPageAsync.kt delete mode 100644 llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListPageResponse.kt delete mode 100644 llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListParams.kt delete mode 100644 llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobCreateParamsTest.kt delete mode 100644 llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetParamsTest.kt delete mode 100644 llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetResultsParamsTest.kt delete mode 100644 llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetResultsResponseTest.kt delete mode 100644 llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListPageResponseTest.kt delete mode 100644 llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListParamsTest.kt delete mode 100644 llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/classifier/JobServiceAsyncTest.kt delete mode 100644 llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/classifier/JobServiceTest.kt diff --git a/.stats.yml b/.stats.yml index f9d1086..a77bc26 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 140 +configured_endpoints: 136 diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobCreateParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobCreateParams.kt deleted file mode 100644 index 2e79c29..0000000 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobCreateParams.kt +++ /dev/null @@ -1,1656 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.models.classifier.jobs - -import ai.llamaindex.llamacloud.core.Enum -import ai.llamaindex.llamacloud.core.ExcludeMissing -import ai.llamaindex.llamacloud.core.JsonField -import ai.llamaindex.llamacloud.core.JsonMissing -import ai.llamaindex.llamacloud.core.JsonValue -import ai.llamaindex.llamacloud.core.Params -import ai.llamaindex.llamacloud.core.checkKnown -import ai.llamaindex.llamacloud.core.checkRequired -import ai.llamaindex.llamacloud.core.http.Headers -import ai.llamaindex.llamacloud.core.http.QueryParams -import ai.llamaindex.llamacloud.core.toImmutable -import ai.llamaindex.llamacloud.errors.LlamaCloudInvalidDataException -import com.fasterxml.jackson.annotation.JsonAnyGetter -import com.fasterxml.jackson.annotation.JsonAnySetter -import com.fasterxml.jackson.annotation.JsonCreator -import com.fasterxml.jackson.annotation.JsonProperty -import java.util.Collections -import java.util.Objects -import java.util.Optional -import kotlin.jvm.optionals.getOrNull - -/** Create a classify job. Experimental: not production-ready and subject to change. */ -@Deprecated("Please use `client.classify.create()`") -class JobCreateParams -private constructor( - private val organizationId: String?, - private val projectId: String?, - private val body: Body, - private val additionalHeaders: Headers, - private val additionalQueryParams: QueryParams, -) : Params { - - fun organizationId(): Optional = Optional.ofNullable(organizationId) - - fun projectId(): Optional = Optional.ofNullable(projectId) - - /** - * The IDs of the files to classify - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun fileIds(): List = body.fileIds() - - /** - * The rules to classify the files - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun rules(): List = body.rules() - - /** - * The classification mode to use - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun mode(): Optional = body.mode() - - /** - * The configuration for the parsing job - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun parsingConfiguration(): Optional = body.parsingConfiguration() - - /** - * List of webhook configurations for notifications - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun webhookConfigurations(): Optional> = body.webhookConfigurations() - - /** - * Returns the raw JSON value of [fileIds]. - * - * Unlike [fileIds], this method doesn't throw if the JSON field has an unexpected type. - */ - fun _fileIds(): JsonField> = body._fileIds() - - /** - * Returns the raw JSON value of [rules]. - * - * Unlike [rules], this method doesn't throw if the JSON field has an unexpected type. - */ - fun _rules(): JsonField> = body._rules() - - /** - * Returns the raw JSON value of [mode]. - * - * Unlike [mode], this method doesn't throw if the JSON field has an unexpected type. - */ - fun _mode(): JsonField = body._mode() - - /** - * Returns the raw JSON value of [parsingConfiguration]. - * - * Unlike [parsingConfiguration], this method doesn't throw if the JSON field has an unexpected - * type. - */ - fun _parsingConfiguration(): JsonField = - body._parsingConfiguration() - - /** - * Returns the raw JSON value of [webhookConfigurations]. - * - * Unlike [webhookConfigurations], this method doesn't throw if the JSON field has an unexpected - * type. - */ - fun _webhookConfigurations(): JsonField> = - body._webhookConfigurations() - - fun _additionalBodyProperties(): Map = body._additionalProperties() - - /** Additional headers to send with the request. */ - fun _additionalHeaders(): Headers = additionalHeaders - - /** Additional query param to send with the request. */ - fun _additionalQueryParams(): QueryParams = additionalQueryParams - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of [JobCreateParams]. - * - * The following fields are required: - * ```java - * .fileIds() - * .rules() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [JobCreateParams]. */ - class Builder internal constructor() { - - private var organizationId: String? = null - private var projectId: String? = null - private var body: Body.Builder = Body.builder() - private var additionalHeaders: Headers.Builder = Headers.builder() - private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - - @JvmSynthetic - internal fun from(jobCreateParams: JobCreateParams) = apply { - organizationId = jobCreateParams.organizationId - projectId = jobCreateParams.projectId - body = jobCreateParams.body.toBuilder() - additionalHeaders = jobCreateParams.additionalHeaders.toBuilder() - additionalQueryParams = jobCreateParams.additionalQueryParams.toBuilder() - } - - fun organizationId(organizationId: String?) = apply { this.organizationId = organizationId } - - /** Alias for calling [Builder.organizationId] with `organizationId.orElse(null)`. */ - fun organizationId(organizationId: Optional) = - organizationId(organizationId.getOrNull()) - - fun projectId(projectId: String?) = apply { this.projectId = projectId } - - /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ - fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) - - /** - * Sets the entire request body. - * - * This is generally only useful if you are already constructing the body separately. - * Otherwise, it's more convenient to use the top-level setters instead: - * - [fileIds] - * - [rules] - * - [mode] - * - [parsingConfiguration] - * - [webhookConfigurations] - * - etc. - */ - fun body(body: Body) = apply { this.body = body.toBuilder() } - - /** The IDs of the files to classify */ - fun fileIds(fileIds: List) = apply { body.fileIds(fileIds) } - - /** - * Sets [Builder.fileIds] to an arbitrary JSON value. - * - * You should usually call [Builder.fileIds] with a well-typed `List` value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun fileIds(fileIds: JsonField>) = apply { body.fileIds(fileIds) } - - /** - * Adds a single [String] to [fileIds]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - fun addFileId(fileId: String) = apply { body.addFileId(fileId) } - - /** The rules to classify the files */ - fun rules(rules: List) = apply { body.rules(rules) } - - /** - * Sets [Builder.rules] to an arbitrary JSON value. - * - * You should usually call [Builder.rules] with a well-typed `List` value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun rules(rules: JsonField>) = apply { body.rules(rules) } - - /** - * Adds a single [ClassifierRule] to [rules]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - fun addRule(rule: ClassifierRule) = apply { body.addRule(rule) } - - /** The classification mode to use */ - fun mode(mode: Mode) = apply { body.mode(mode) } - - /** - * Sets [Builder.mode] to an arbitrary JSON value. - * - * You should usually call [Builder.mode] with a well-typed [Mode] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun mode(mode: JsonField) = apply { body.mode(mode) } - - /** The configuration for the parsing job */ - fun parsingConfiguration(parsingConfiguration: ClassifyParsingConfiguration) = apply { - body.parsingConfiguration(parsingConfiguration) - } - - /** - * Sets [Builder.parsingConfiguration] to an arbitrary JSON value. - * - * You should usually call [Builder.parsingConfiguration] with a well-typed - * [ClassifyParsingConfiguration] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun parsingConfiguration(parsingConfiguration: JsonField) = - apply { - body.parsingConfiguration(parsingConfiguration) - } - - /** List of webhook configurations for notifications */ - fun webhookConfigurations(webhookConfigurations: List) = apply { - body.webhookConfigurations(webhookConfigurations) - } - - /** - * Sets [Builder.webhookConfigurations] to an arbitrary JSON value. - * - * You should usually call [Builder.webhookConfigurations] with a well-typed - * `List` value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun webhookConfigurations(webhookConfigurations: JsonField>) = - apply { - body.webhookConfigurations(webhookConfigurations) - } - - /** - * Adds a single [WebhookConfiguration] to [webhookConfigurations]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - fun addWebhookConfiguration(webhookConfiguration: WebhookConfiguration) = apply { - body.addWebhookConfiguration(webhookConfiguration) - } - - fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - body.additionalProperties(additionalBodyProperties) - } - - fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - body.putAdditionalProperty(key, value) - } - - fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { - body.putAllAdditionalProperties(additionalBodyProperties) - } - - fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } - - fun removeAllAdditionalBodyProperties(keys: Set) = apply { - body.removeAllAdditionalProperties(keys) - } - - fun additionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.clear() - putAllAdditionalHeaders(additionalHeaders) - } - - fun additionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.clear() - putAllAdditionalHeaders(additionalHeaders) - } - - fun putAdditionalHeader(name: String, value: String) = apply { - additionalHeaders.put(name, value) - } - - fun putAdditionalHeaders(name: String, values: Iterable) = apply { - additionalHeaders.put(name, values) - } - - fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.putAll(additionalHeaders) - } - - fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.putAll(additionalHeaders) - } - - fun replaceAdditionalHeaders(name: String, value: String) = apply { - additionalHeaders.replace(name, value) - } - - fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { - additionalHeaders.replace(name, values) - } - - fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.replaceAll(additionalHeaders) - } - - fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.replaceAll(additionalHeaders) - } - - fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } - - fun removeAllAdditionalHeaders(names: Set) = apply { - additionalHeaders.removeAll(names) - } - - fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.clear() - putAllAdditionalQueryParams(additionalQueryParams) - } - - fun additionalQueryParams(additionalQueryParams: Map>) = apply { - this.additionalQueryParams.clear() - putAllAdditionalQueryParams(additionalQueryParams) - } - - fun putAdditionalQueryParam(key: String, value: String) = apply { - additionalQueryParams.put(key, value) - } - - fun putAdditionalQueryParams(key: String, values: Iterable) = apply { - additionalQueryParams.put(key, values) - } - - fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.putAll(additionalQueryParams) - } - - fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = - apply { - this.additionalQueryParams.putAll(additionalQueryParams) - } - - fun replaceAdditionalQueryParams(key: String, value: String) = apply { - additionalQueryParams.replace(key, value) - } - - fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { - additionalQueryParams.replace(key, values) - } - - fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.replaceAll(additionalQueryParams) - } - - fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = - apply { - this.additionalQueryParams.replaceAll(additionalQueryParams) - } - - fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } - - fun removeAllAdditionalQueryParams(keys: Set) = apply { - additionalQueryParams.removeAll(keys) - } - - /** - * Returns an immutable instance of [JobCreateParams]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .fileIds() - * .rules() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): JobCreateParams = - JobCreateParams( - organizationId, - projectId, - body.build(), - additionalHeaders.build(), - additionalQueryParams.build(), - ) - } - - fun _body(): Body = body - - override fun _headers(): Headers = additionalHeaders - - override fun _queryParams(): QueryParams = - QueryParams.builder() - .apply { - organizationId?.let { put("organization_id", it) } - projectId?.let { put("project_id", it) } - putAll(additionalQueryParams) - } - .build() - - /** A classify job. */ - class Body - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val fileIds: JsonField>, - private val rules: JsonField>, - private val mode: JsonField, - private val parsingConfiguration: JsonField, - private val webhookConfigurations: JsonField>, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("file_ids") - @ExcludeMissing - fileIds: JsonField> = JsonMissing.of(), - @JsonProperty("rules") - @ExcludeMissing - rules: JsonField> = JsonMissing.of(), - @JsonProperty("mode") @ExcludeMissing mode: JsonField = JsonMissing.of(), - @JsonProperty("parsing_configuration") - @ExcludeMissing - parsingConfiguration: JsonField = JsonMissing.of(), - @JsonProperty("webhook_configurations") - @ExcludeMissing - webhookConfigurations: JsonField> = JsonMissing.of(), - ) : this(fileIds, rules, mode, parsingConfiguration, webhookConfigurations, mutableMapOf()) - - /** - * The IDs of the files to classify - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun fileIds(): List = fileIds.getRequired("file_ids") - - /** - * The rules to classify the files - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun rules(): List = rules.getRequired("rules") - - /** - * The classification mode to use - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun mode(): Optional = mode.getOptional("mode") - - /** - * The configuration for the parsing job - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun parsingConfiguration(): Optional = - parsingConfiguration.getOptional("parsing_configuration") - - /** - * List of webhook configurations for notifications - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun webhookConfigurations(): Optional> = - webhookConfigurations.getOptional("webhook_configurations") - - /** - * Returns the raw JSON value of [fileIds]. - * - * Unlike [fileIds], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("file_ids") @ExcludeMissing fun _fileIds(): JsonField> = fileIds - - /** - * Returns the raw JSON value of [rules]. - * - * Unlike [rules], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("rules") @ExcludeMissing fun _rules(): JsonField> = rules - - /** - * Returns the raw JSON value of [mode]. - * - * Unlike [mode], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("mode") @ExcludeMissing fun _mode(): JsonField = mode - - /** - * Returns the raw JSON value of [parsingConfiguration]. - * - * Unlike [parsingConfiguration], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("parsing_configuration") - @ExcludeMissing - fun _parsingConfiguration(): JsonField = parsingConfiguration - - /** - * Returns the raw JSON value of [webhookConfigurations]. - * - * Unlike [webhookConfigurations], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("webhook_configurations") - @ExcludeMissing - fun _webhookConfigurations(): JsonField> = webhookConfigurations - - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of [Body]. - * - * The following fields are required: - * ```java - * .fileIds() - * .rules() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [Body]. */ - class Builder internal constructor() { - - private var fileIds: JsonField>? = null - private var rules: JsonField>? = null - private var mode: JsonField = JsonMissing.of() - private var parsingConfiguration: JsonField = - JsonMissing.of() - private var webhookConfigurations: JsonField>? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(body: Body) = apply { - fileIds = body.fileIds.map { it.toMutableList() } - rules = body.rules.map { it.toMutableList() } - mode = body.mode - parsingConfiguration = body.parsingConfiguration - webhookConfigurations = body.webhookConfigurations.map { it.toMutableList() } - additionalProperties = body.additionalProperties.toMutableMap() - } - - /** The IDs of the files to classify */ - fun fileIds(fileIds: List) = fileIds(JsonField.of(fileIds)) - - /** - * Sets [Builder.fileIds] to an arbitrary JSON value. - * - * You should usually call [Builder.fileIds] with a well-typed `List` value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun fileIds(fileIds: JsonField>) = apply { - this.fileIds = fileIds.map { it.toMutableList() } - } - - /** - * Adds a single [String] to [fileIds]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - fun addFileId(fileId: String) = apply { - fileIds = - (fileIds ?: JsonField.of(mutableListOf())).also { - checkKnown("fileIds", it).add(fileId) - } - } - - /** The rules to classify the files */ - fun rules(rules: List) = rules(JsonField.of(rules)) - - /** - * Sets [Builder.rules] to an arbitrary JSON value. - * - * You should usually call [Builder.rules] with a well-typed `List` - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun rules(rules: JsonField>) = apply { - this.rules = rules.map { it.toMutableList() } - } - - /** - * Adds a single [ClassifierRule] to [rules]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - fun addRule(rule: ClassifierRule) = apply { - rules = - (rules ?: JsonField.of(mutableListOf())).also { - checkKnown("rules", it).add(rule) - } - } - - /** The classification mode to use */ - fun mode(mode: Mode) = mode(JsonField.of(mode)) - - /** - * Sets [Builder.mode] to an arbitrary JSON value. - * - * You should usually call [Builder.mode] with a well-typed [Mode] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun mode(mode: JsonField) = apply { this.mode = mode } - - /** The configuration for the parsing job */ - fun parsingConfiguration(parsingConfiguration: ClassifyParsingConfiguration) = - parsingConfiguration(JsonField.of(parsingConfiguration)) - - /** - * Sets [Builder.parsingConfiguration] to an arbitrary JSON value. - * - * You should usually call [Builder.parsingConfiguration] with a well-typed - * [ClassifyParsingConfiguration] value instead. This method is primarily for setting - * the field to an undocumented or not yet supported value. - */ - fun parsingConfiguration( - parsingConfiguration: JsonField - ) = apply { this.parsingConfiguration = parsingConfiguration } - - /** List of webhook configurations for notifications */ - fun webhookConfigurations(webhookConfigurations: List) = - webhookConfigurations(JsonField.of(webhookConfigurations)) - - /** - * Sets [Builder.webhookConfigurations] to an arbitrary JSON value. - * - * You should usually call [Builder.webhookConfigurations] with a well-typed - * `List` value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun webhookConfigurations( - webhookConfigurations: JsonField> - ) = apply { - this.webhookConfigurations = webhookConfigurations.map { it.toMutableList() } - } - - /** - * Adds a single [WebhookConfiguration] to [webhookConfigurations]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - fun addWebhookConfiguration(webhookConfiguration: WebhookConfiguration) = apply { - webhookConfigurations = - (webhookConfigurations ?: JsonField.of(mutableListOf())).also { - checkKnown("webhookConfigurations", it).add(webhookConfiguration) - } - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [Body]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .fileIds() - * .rules() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): Body = - Body( - checkRequired("fileIds", fileIds).map { it.toImmutable() }, - checkRequired("rules", rules).map { it.toImmutable() }, - mode, - parsingConfiguration, - (webhookConfigurations ?: JsonMissing.of()).map { it.toImmutable() }, - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - /** - * Validates that the types of all values in this object match their expected types - * recursively. - * - * This method is _not_ forwards compatible with new types from the API for existing fields. - * - * @throws LlamaCloudInvalidDataException if any value type in this object doesn't match its - * expected type. - */ - fun validate(): Body = apply { - if (validated) { - return@apply - } - - fileIds() - rules().forEach { it.validate() } - mode().ifPresent { it.validate() } - parsingConfiguration().ifPresent { it.validate() } - webhookConfigurations().ifPresent { it.forEach { it.validate() } } - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LlamaCloudInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - (fileIds.asKnown().getOrNull()?.size ?: 0) + - (rules.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + - (mode.asKnown().getOrNull()?.validity() ?: 0) + - (parsingConfiguration.asKnown().getOrNull()?.validity() ?: 0) + - (webhookConfigurations.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Body && - fileIds == other.fileIds && - rules == other.rules && - mode == other.mode && - parsingConfiguration == other.parsingConfiguration && - webhookConfigurations == other.webhookConfigurations && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash( - fileIds, - rules, - mode, - parsingConfiguration, - webhookConfigurations, - additionalProperties, - ) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "Body{fileIds=$fileIds, rules=$rules, mode=$mode, parsingConfiguration=$parsingConfiguration, webhookConfigurations=$webhookConfigurations, additionalProperties=$additionalProperties}" - } - - /** The classification mode to use */ - class Mode @JsonCreator private constructor(private val value: JsonField) : Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is on an - * older version than the API, then the API may respond with new members that the SDK is - * unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - @JvmField val FAST = of("FAST") - - @JvmField val MULTIMODAL = of("MULTIMODAL") - - @JvmStatic fun of(value: String) = Mode(JsonField.of(value)) - } - - /** An enum containing [Mode]'s known values. */ - enum class Known { - FAST, - MULTIMODAL, - } - - /** - * An enum containing [Mode]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Mode] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if the - * SDK is on an older version than the API, then the API may respond with new members that - * the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - FAST, - MULTIMODAL, - /** An enum member indicating that [Mode] was instantiated with an unknown value. */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] - * if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you want - * to throw for the unknown case. - */ - fun value(): Value = - when (this) { - FAST -> Value.FAST - MULTIMODAL -> Value.MULTIMODAL - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and don't - * want to throw for the unknown case. - * - * @throws LlamaCloudInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - FAST -> Known.FAST - MULTIMODAL -> Known.MULTIMODAL - else -> throw LlamaCloudInvalidDataException("Unknown Mode: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for debugging - * and generally doesn't throw. - * - * @throws LlamaCloudInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - LlamaCloudInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - /** - * Validates that the types of all values in this object match their expected types - * recursively. - * - * This method is _not_ forwards compatible with new types from the API for existing fields. - * - * @throws LlamaCloudInvalidDataException if any value type in this object doesn't match its - * expected type. - */ - fun validate(): Mode = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LlamaCloudInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Mode && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - - /** - * Webhook configuration for receiving parsing job notifications. - * - * Webhooks are called when specified events occur during job processing. Configure multiple - * webhook configurations to send to different endpoints. - */ - class WebhookConfiguration - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val webhookEvents: JsonField>, - private val webhookHeaders: JsonField, - private val webhookOutputFormat: JsonField, - private val webhookSigningSecret: JsonField, - private val webhookUrl: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("webhook_events") - @ExcludeMissing - webhookEvents: JsonField> = JsonMissing.of(), - @JsonProperty("webhook_headers") - @ExcludeMissing - webhookHeaders: JsonField = JsonMissing.of(), - @JsonProperty("webhook_output_format") - @ExcludeMissing - webhookOutputFormat: JsonField = JsonMissing.of(), - @JsonProperty("webhook_signing_secret") - @ExcludeMissing - webhookSigningSecret: JsonField = JsonMissing.of(), - @JsonProperty("webhook_url") - @ExcludeMissing - webhookUrl: JsonField = JsonMissing.of(), - ) : this( - webhookEvents, - webhookHeaders, - webhookOutputFormat, - webhookSigningSecret, - webhookUrl, - mutableMapOf(), - ) - - /** - * Events that trigger this webhook. Options: 'parse.success' (job completed), 'parse.error' - * (job failed), 'parse.partial_success' (some pages failed), 'parse.pending', - * 'parse.running', 'parse.cancelled'. If not specified, webhook fires for all events - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun webhookEvents(): Optional> = webhookEvents.getOptional("webhook_events") - - /** - * Custom HTTP headers to include in webhook requests. Use for authentication tokens or - * custom routing. Example: {'Authorization': 'Bearer xyz'} - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun webhookHeaders(): Optional = - webhookHeaders.getOptional("webhook_headers") - - /** - * Format of the webhook payload body. 'string' (default) sends the payload as a - * JSON-encoded string; 'json' sends it as a JSON object. - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun webhookOutputFormat(): Optional = - webhookOutputFormat.getOptional("webhook_output_format") - - /** - * Shared signing secret used to sign webhook deliveries. When set, each request includes an - * HMAC-SHA256 signature of the request body in the 'LC-Signature' header (value - * 'sha256='). Recompute the HMAC over the raw request body with this secret to verify - * the delivery is authentic. - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun webhookSigningSecret(): Optional = - webhookSigningSecret.getOptional("webhook_signing_secret") - - /** - * HTTPS URL to receive webhook POST requests. Must be publicly accessible - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun webhookUrl(): Optional = webhookUrl.getOptional("webhook_url") - - /** - * Returns the raw JSON value of [webhookEvents]. - * - * Unlike [webhookEvents], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("webhook_events") - @ExcludeMissing - fun _webhookEvents(): JsonField> = webhookEvents - - /** - * Returns the raw JSON value of [webhookHeaders]. - * - * Unlike [webhookHeaders], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("webhook_headers") - @ExcludeMissing - fun _webhookHeaders(): JsonField = webhookHeaders - - /** - * Returns the raw JSON value of [webhookOutputFormat]. - * - * Unlike [webhookOutputFormat], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("webhook_output_format") - @ExcludeMissing - fun _webhookOutputFormat(): JsonField = webhookOutputFormat - - /** - * Returns the raw JSON value of [webhookSigningSecret]. - * - * Unlike [webhookSigningSecret], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("webhook_signing_secret") - @ExcludeMissing - fun _webhookSigningSecret(): JsonField = webhookSigningSecret - - /** - * Returns the raw JSON value of [webhookUrl]. - * - * Unlike [webhookUrl], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("webhook_url") - @ExcludeMissing - fun _webhookUrl(): JsonField = webhookUrl - - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) - - fun toBuilder() = Builder().from(this) - - companion object { - - /** Returns a mutable builder for constructing an instance of [WebhookConfiguration]. */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [WebhookConfiguration]. */ - class Builder internal constructor() { - - private var webhookEvents: JsonField>? = null - private var webhookHeaders: JsonField = JsonMissing.of() - private var webhookOutputFormat: JsonField = JsonMissing.of() - private var webhookSigningSecret: JsonField = JsonMissing.of() - private var webhookUrl: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(webhookConfiguration: WebhookConfiguration) = apply { - webhookEvents = webhookConfiguration.webhookEvents.map { it.toMutableList() } - webhookHeaders = webhookConfiguration.webhookHeaders - webhookOutputFormat = webhookConfiguration.webhookOutputFormat - webhookSigningSecret = webhookConfiguration.webhookSigningSecret - webhookUrl = webhookConfiguration.webhookUrl - additionalProperties = webhookConfiguration.additionalProperties.toMutableMap() - } - - /** - * Events that trigger this webhook. Options: 'parse.success' (job completed), - * 'parse.error' (job failed), 'parse.partial_success' (some pages failed), - * 'parse.pending', 'parse.running', 'parse.cancelled'. If not specified, webhook fires - * for all events - */ - fun webhookEvents(webhookEvents: List?) = - webhookEvents(JsonField.ofNullable(webhookEvents)) - - /** Alias for calling [Builder.webhookEvents] with `webhookEvents.orElse(null)`. */ - fun webhookEvents(webhookEvents: Optional>) = - webhookEvents(webhookEvents.getOrNull()) - - /** - * Sets [Builder.webhookEvents] to an arbitrary JSON value. - * - * You should usually call [Builder.webhookEvents] with a well-typed `List` - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun webhookEvents(webhookEvents: JsonField>) = apply { - this.webhookEvents = webhookEvents.map { it.toMutableList() } - } - - /** - * Adds a single [String] to [webhookEvents]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - fun addWebhookEvent(webhookEvent: String) = apply { - webhookEvents = - (webhookEvents ?: JsonField.of(mutableListOf())).also { - checkKnown("webhookEvents", it).add(webhookEvent) - } - } - - /** - * Custom HTTP headers to include in webhook requests. Use for authentication tokens or - * custom routing. Example: {'Authorization': 'Bearer xyz'} - */ - fun webhookHeaders(webhookHeaders: WebhookHeaders?) = - webhookHeaders(JsonField.ofNullable(webhookHeaders)) - - /** Alias for calling [Builder.webhookHeaders] with `webhookHeaders.orElse(null)`. */ - fun webhookHeaders(webhookHeaders: Optional) = - webhookHeaders(webhookHeaders.getOrNull()) - - /** - * Sets [Builder.webhookHeaders] to an arbitrary JSON value. - * - * You should usually call [Builder.webhookHeaders] with a well-typed [WebhookHeaders] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun webhookHeaders(webhookHeaders: JsonField) = apply { - this.webhookHeaders = webhookHeaders - } - - /** - * Format of the webhook payload body. 'string' (default) sends the payload as a - * JSON-encoded string; 'json' sends it as a JSON object. - */ - fun webhookOutputFormat(webhookOutputFormat: WebhookOutputFormat?) = - webhookOutputFormat(JsonField.ofNullable(webhookOutputFormat)) - - /** - * Alias for calling [Builder.webhookOutputFormat] with - * `webhookOutputFormat.orElse(null)`. - */ - fun webhookOutputFormat(webhookOutputFormat: Optional) = - webhookOutputFormat(webhookOutputFormat.getOrNull()) - - /** - * Sets [Builder.webhookOutputFormat] to an arbitrary JSON value. - * - * You should usually call [Builder.webhookOutputFormat] with a well-typed - * [WebhookOutputFormat] value instead. This method is primarily for setting the field - * to an undocumented or not yet supported value. - */ - fun webhookOutputFormat(webhookOutputFormat: JsonField) = apply { - this.webhookOutputFormat = webhookOutputFormat - } - - /** - * Shared signing secret used to sign webhook deliveries. When set, each request - * includes an HMAC-SHA256 signature of the request body in the 'LC-Signature' header - * (value 'sha256='). Recompute the HMAC over the raw request body with this secret - * to verify the delivery is authentic. - */ - fun webhookSigningSecret(webhookSigningSecret: String?) = - webhookSigningSecret(JsonField.ofNullable(webhookSigningSecret)) - - /** - * Alias for calling [Builder.webhookSigningSecret] with - * `webhookSigningSecret.orElse(null)`. - */ - fun webhookSigningSecret(webhookSigningSecret: Optional) = - webhookSigningSecret(webhookSigningSecret.getOrNull()) - - /** - * Sets [Builder.webhookSigningSecret] to an arbitrary JSON value. - * - * You should usually call [Builder.webhookSigningSecret] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun webhookSigningSecret(webhookSigningSecret: JsonField) = apply { - this.webhookSigningSecret = webhookSigningSecret - } - - /** HTTPS URL to receive webhook POST requests. Must be publicly accessible */ - fun webhookUrl(webhookUrl: String?) = webhookUrl(JsonField.ofNullable(webhookUrl)) - - /** Alias for calling [Builder.webhookUrl] with `webhookUrl.orElse(null)`. */ - fun webhookUrl(webhookUrl: Optional) = webhookUrl(webhookUrl.getOrNull()) - - /** - * Sets [Builder.webhookUrl] to an arbitrary JSON value. - * - * You should usually call [Builder.webhookUrl] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun webhookUrl(webhookUrl: JsonField) = apply { this.webhookUrl = webhookUrl } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [WebhookConfiguration]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): WebhookConfiguration = - WebhookConfiguration( - (webhookEvents ?: JsonMissing.of()).map { it.toImmutable() }, - webhookHeaders, - webhookOutputFormat, - webhookSigningSecret, - webhookUrl, - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - /** - * Validates that the types of all values in this object match their expected types - * recursively. - * - * This method is _not_ forwards compatible with new types from the API for existing fields. - * - * @throws LlamaCloudInvalidDataException if any value type in this object doesn't match its - * expected type. - */ - fun validate(): WebhookConfiguration = apply { - if (validated) { - return@apply - } - - webhookEvents() - webhookHeaders().ifPresent { it.validate() } - webhookOutputFormat().ifPresent { it.validate() } - webhookSigningSecret() - webhookUrl() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LlamaCloudInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - (webhookEvents.asKnown().getOrNull()?.size ?: 0) + - (webhookHeaders.asKnown().getOrNull()?.validity() ?: 0) + - (webhookOutputFormat.asKnown().getOrNull()?.validity() ?: 0) + - (if (webhookSigningSecret.asKnown().isPresent) 1 else 0) + - (if (webhookUrl.asKnown().isPresent) 1 else 0) - - /** - * Custom HTTP headers to include in webhook requests. Use for authentication tokens or - * custom routing. Example: {'Authorization': 'Bearer xyz'} - */ - class WebhookHeaders - @JsonCreator - private constructor( - @com.fasterxml.jackson.annotation.JsonValue - private val additionalProperties: Map - ) { - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun toBuilder() = Builder().from(this) - - companion object { - - /** Returns a mutable builder for constructing an instance of [WebhookHeaders]. */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [WebhookHeaders]. */ - class Builder internal constructor() { - - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(webhookHeaders: WebhookHeaders) = apply { - additionalProperties = webhookHeaders.additionalProperties.toMutableMap() - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [WebhookHeaders]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): WebhookHeaders = WebhookHeaders(additionalProperties.toImmutable()) - } - - private var validated: Boolean = false - - /** - * Validates that the types of all values in this object match their expected types - * recursively. - * - * This method is _not_ forwards compatible with new types from the API for existing - * fields. - * - * @throws LlamaCloudInvalidDataException if any value type in this object doesn't match - * its expected type. - */ - fun validate(): WebhookHeaders = apply { - if (validated) { - return@apply - } - - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LlamaCloudInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - additionalProperties.count { (_, value) -> !value.isNull() && !value.isMissing() } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is WebhookHeaders && additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - - override fun hashCode(): Int = hashCode - - override fun toString() = "WebhookHeaders{additionalProperties=$additionalProperties}" - } - - /** - * Format of the webhook payload body. 'string' (default) sends the payload as a - * JSON-encoded string; 'json' sends it as a JSON object. - */ - class WebhookOutputFormat - @JsonCreator - private constructor(private val value: JsonField) : Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - @JvmField val JSON = of("json") - - @JvmField val STRING = of("string") - - @JvmStatic fun of(value: String) = WebhookOutputFormat(JsonField.of(value)) - } - - /** An enum containing [WebhookOutputFormat]'s known values. */ - enum class Known { - JSON, - STRING, - } - - /** - * An enum containing [WebhookOutputFormat]'s known values, as well as an [_UNKNOWN] - * member. - * - * An instance of [WebhookOutputFormat] can contain an unknown value in a couple of - * cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - JSON, - STRING, - /** - * An enum member indicating that [WebhookOutputFormat] was instantiated with an - * unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - JSON -> Value.JSON - STRING -> Value.STRING - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws LlamaCloudInvalidDataException if this class instance's value is a not a - * known member. - */ - fun known(): Known = - when (this) { - JSON -> Known.JSON - STRING -> Known.STRING - else -> - throw LlamaCloudInvalidDataException("Unknown WebhookOutputFormat: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws LlamaCloudInvalidDataException if this class instance's value does not have - * the expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - LlamaCloudInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - /** - * Validates that the types of all values in this object match their expected types - * recursively. - * - * This method is _not_ forwards compatible with new types from the API for existing - * fields. - * - * @throws LlamaCloudInvalidDataException if any value type in this object doesn't match - * its expected type. - */ - fun validate(): WebhookOutputFormat = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LlamaCloudInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is WebhookOutputFormat && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is WebhookConfiguration && - webhookEvents == other.webhookEvents && - webhookHeaders == other.webhookHeaders && - webhookOutputFormat == other.webhookOutputFormat && - webhookSigningSecret == other.webhookSigningSecret && - webhookUrl == other.webhookUrl && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash( - webhookEvents, - webhookHeaders, - webhookOutputFormat, - webhookSigningSecret, - webhookUrl, - additionalProperties, - ) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookSigningSecret=$webhookSigningSecret, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is JobCreateParams && - organizationId == other.organizationId && - projectId == other.projectId && - body == other.body && - additionalHeaders == other.additionalHeaders && - additionalQueryParams == other.additionalQueryParams - } - - override fun hashCode(): Int = - Objects.hash(organizationId, projectId, body, additionalHeaders, additionalQueryParams) - - override fun toString() = - "JobCreateParams{organizationId=$organizationId, projectId=$projectId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" -} diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetParams.kt deleted file mode 100644 index f2c7297..0000000 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetParams.kt +++ /dev/null @@ -1,234 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.models.classifier.jobs - -import ai.llamaindex.llamacloud.core.Params -import ai.llamaindex.llamacloud.core.http.Headers -import ai.llamaindex.llamacloud.core.http.QueryParams -import java.util.Objects -import java.util.Optional -import kotlin.jvm.optionals.getOrNull - -/** Get a classify job. Experimental: not production-ready and subject to change. */ -@Deprecated("Please use `client.classify.get()`") -class JobGetParams -private constructor( - private val classifyJobId: String?, - private val organizationId: String?, - private val projectId: String?, - private val additionalHeaders: Headers, - private val additionalQueryParams: QueryParams, -) : Params { - - fun classifyJobId(): Optional = Optional.ofNullable(classifyJobId) - - fun organizationId(): Optional = Optional.ofNullable(organizationId) - - fun projectId(): Optional = Optional.ofNullable(projectId) - - /** Additional headers to send with the request. */ - fun _additionalHeaders(): Headers = additionalHeaders - - /** Additional query param to send with the request. */ - fun _additionalQueryParams(): QueryParams = additionalQueryParams - - fun toBuilder() = Builder().from(this) - - companion object { - - @JvmStatic fun none(): JobGetParams = builder().build() - - /** Returns a mutable builder for constructing an instance of [JobGetParams]. */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [JobGetParams]. */ - class Builder internal constructor() { - - private var classifyJobId: String? = null - private var organizationId: String? = null - private var projectId: String? = null - private var additionalHeaders: Headers.Builder = Headers.builder() - private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - - @JvmSynthetic - internal fun from(jobGetParams: JobGetParams) = apply { - classifyJobId = jobGetParams.classifyJobId - organizationId = jobGetParams.organizationId - projectId = jobGetParams.projectId - additionalHeaders = jobGetParams.additionalHeaders.toBuilder() - additionalQueryParams = jobGetParams.additionalQueryParams.toBuilder() - } - - fun classifyJobId(classifyJobId: String?) = apply { this.classifyJobId = classifyJobId } - - /** Alias for calling [Builder.classifyJobId] with `classifyJobId.orElse(null)`. */ - fun classifyJobId(classifyJobId: Optional) = - classifyJobId(classifyJobId.getOrNull()) - - fun organizationId(organizationId: String?) = apply { this.organizationId = organizationId } - - /** Alias for calling [Builder.organizationId] with `organizationId.orElse(null)`. */ - fun organizationId(organizationId: Optional) = - organizationId(organizationId.getOrNull()) - - fun projectId(projectId: String?) = apply { this.projectId = projectId } - - /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ - fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) - - fun additionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.clear() - putAllAdditionalHeaders(additionalHeaders) - } - - fun additionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.clear() - putAllAdditionalHeaders(additionalHeaders) - } - - fun putAdditionalHeader(name: String, value: String) = apply { - additionalHeaders.put(name, value) - } - - fun putAdditionalHeaders(name: String, values: Iterable) = apply { - additionalHeaders.put(name, values) - } - - fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.putAll(additionalHeaders) - } - - fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.putAll(additionalHeaders) - } - - fun replaceAdditionalHeaders(name: String, value: String) = apply { - additionalHeaders.replace(name, value) - } - - fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { - additionalHeaders.replace(name, values) - } - - fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.replaceAll(additionalHeaders) - } - - fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.replaceAll(additionalHeaders) - } - - fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } - - fun removeAllAdditionalHeaders(names: Set) = apply { - additionalHeaders.removeAll(names) - } - - fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.clear() - putAllAdditionalQueryParams(additionalQueryParams) - } - - fun additionalQueryParams(additionalQueryParams: Map>) = apply { - this.additionalQueryParams.clear() - putAllAdditionalQueryParams(additionalQueryParams) - } - - fun putAdditionalQueryParam(key: String, value: String) = apply { - additionalQueryParams.put(key, value) - } - - fun putAdditionalQueryParams(key: String, values: Iterable) = apply { - additionalQueryParams.put(key, values) - } - - fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.putAll(additionalQueryParams) - } - - fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = - apply { - this.additionalQueryParams.putAll(additionalQueryParams) - } - - fun replaceAdditionalQueryParams(key: String, value: String) = apply { - additionalQueryParams.replace(key, value) - } - - fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { - additionalQueryParams.replace(key, values) - } - - fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.replaceAll(additionalQueryParams) - } - - fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = - apply { - this.additionalQueryParams.replaceAll(additionalQueryParams) - } - - fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } - - fun removeAllAdditionalQueryParams(keys: Set) = apply { - additionalQueryParams.removeAll(keys) - } - - /** - * Returns an immutable instance of [JobGetParams]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): JobGetParams = - JobGetParams( - classifyJobId, - organizationId, - projectId, - additionalHeaders.build(), - additionalQueryParams.build(), - ) - } - - fun _pathParam(index: Int): String = - when (index) { - 0 -> classifyJobId ?: "" - else -> "" - } - - override fun _headers(): Headers = additionalHeaders - - override fun _queryParams(): QueryParams = - QueryParams.builder() - .apply { - organizationId?.let { put("organization_id", it) } - projectId?.let { put("project_id", it) } - putAll(additionalQueryParams) - } - .build() - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is JobGetParams && - classifyJobId == other.classifyJobId && - organizationId == other.organizationId && - projectId == other.projectId && - additionalHeaders == other.additionalHeaders && - additionalQueryParams == other.additionalQueryParams - } - - override fun hashCode(): Int = - Objects.hash( - classifyJobId, - organizationId, - projectId, - additionalHeaders, - additionalQueryParams, - ) - - override fun toString() = - "JobGetParams{classifyJobId=$classifyJobId, organizationId=$organizationId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" -} diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetResultsParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetResultsParams.kt deleted file mode 100644 index acc0c34..0000000 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetResultsParams.kt +++ /dev/null @@ -1,234 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.models.classifier.jobs - -import ai.llamaindex.llamacloud.core.Params -import ai.llamaindex.llamacloud.core.http.Headers -import ai.llamaindex.llamacloud.core.http.QueryParams -import java.util.Objects -import java.util.Optional -import kotlin.jvm.optionals.getOrNull - -/** Get the results of a classify job. Experimental: not production-ready and subject to change. */ -@Deprecated("Please use `client.classify.get()`") -class JobGetResultsParams -private constructor( - private val classifyJobId: String?, - private val organizationId: String?, - private val projectId: String?, - private val additionalHeaders: Headers, - private val additionalQueryParams: QueryParams, -) : Params { - - fun classifyJobId(): Optional = Optional.ofNullable(classifyJobId) - - fun organizationId(): Optional = Optional.ofNullable(organizationId) - - fun projectId(): Optional = Optional.ofNullable(projectId) - - /** Additional headers to send with the request. */ - fun _additionalHeaders(): Headers = additionalHeaders - - /** Additional query param to send with the request. */ - fun _additionalQueryParams(): QueryParams = additionalQueryParams - - fun toBuilder() = Builder().from(this) - - companion object { - - @JvmStatic fun none(): JobGetResultsParams = builder().build() - - /** Returns a mutable builder for constructing an instance of [JobGetResultsParams]. */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [JobGetResultsParams]. */ - class Builder internal constructor() { - - private var classifyJobId: String? = null - private var organizationId: String? = null - private var projectId: String? = null - private var additionalHeaders: Headers.Builder = Headers.builder() - private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - - @JvmSynthetic - internal fun from(jobGetResultsParams: JobGetResultsParams) = apply { - classifyJobId = jobGetResultsParams.classifyJobId - organizationId = jobGetResultsParams.organizationId - projectId = jobGetResultsParams.projectId - additionalHeaders = jobGetResultsParams.additionalHeaders.toBuilder() - additionalQueryParams = jobGetResultsParams.additionalQueryParams.toBuilder() - } - - fun classifyJobId(classifyJobId: String?) = apply { this.classifyJobId = classifyJobId } - - /** Alias for calling [Builder.classifyJobId] with `classifyJobId.orElse(null)`. */ - fun classifyJobId(classifyJobId: Optional) = - classifyJobId(classifyJobId.getOrNull()) - - fun organizationId(organizationId: String?) = apply { this.organizationId = organizationId } - - /** Alias for calling [Builder.organizationId] with `organizationId.orElse(null)`. */ - fun organizationId(organizationId: Optional) = - organizationId(organizationId.getOrNull()) - - fun projectId(projectId: String?) = apply { this.projectId = projectId } - - /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ - fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) - - fun additionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.clear() - putAllAdditionalHeaders(additionalHeaders) - } - - fun additionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.clear() - putAllAdditionalHeaders(additionalHeaders) - } - - fun putAdditionalHeader(name: String, value: String) = apply { - additionalHeaders.put(name, value) - } - - fun putAdditionalHeaders(name: String, values: Iterable) = apply { - additionalHeaders.put(name, values) - } - - fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.putAll(additionalHeaders) - } - - fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.putAll(additionalHeaders) - } - - fun replaceAdditionalHeaders(name: String, value: String) = apply { - additionalHeaders.replace(name, value) - } - - fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { - additionalHeaders.replace(name, values) - } - - fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.replaceAll(additionalHeaders) - } - - fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.replaceAll(additionalHeaders) - } - - fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } - - fun removeAllAdditionalHeaders(names: Set) = apply { - additionalHeaders.removeAll(names) - } - - fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.clear() - putAllAdditionalQueryParams(additionalQueryParams) - } - - fun additionalQueryParams(additionalQueryParams: Map>) = apply { - this.additionalQueryParams.clear() - putAllAdditionalQueryParams(additionalQueryParams) - } - - fun putAdditionalQueryParam(key: String, value: String) = apply { - additionalQueryParams.put(key, value) - } - - fun putAdditionalQueryParams(key: String, values: Iterable) = apply { - additionalQueryParams.put(key, values) - } - - fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.putAll(additionalQueryParams) - } - - fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = - apply { - this.additionalQueryParams.putAll(additionalQueryParams) - } - - fun replaceAdditionalQueryParams(key: String, value: String) = apply { - additionalQueryParams.replace(key, value) - } - - fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { - additionalQueryParams.replace(key, values) - } - - fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.replaceAll(additionalQueryParams) - } - - fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = - apply { - this.additionalQueryParams.replaceAll(additionalQueryParams) - } - - fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } - - fun removeAllAdditionalQueryParams(keys: Set) = apply { - additionalQueryParams.removeAll(keys) - } - - /** - * Returns an immutable instance of [JobGetResultsParams]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): JobGetResultsParams = - JobGetResultsParams( - classifyJobId, - organizationId, - projectId, - additionalHeaders.build(), - additionalQueryParams.build(), - ) - } - - fun _pathParam(index: Int): String = - when (index) { - 0 -> classifyJobId ?: "" - else -> "" - } - - override fun _headers(): Headers = additionalHeaders - - override fun _queryParams(): QueryParams = - QueryParams.builder() - .apply { - organizationId?.let { put("organization_id", it) } - projectId?.let { put("project_id", it) } - putAll(additionalQueryParams) - } - .build() - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is JobGetResultsParams && - classifyJobId == other.classifyJobId && - organizationId == other.organizationId && - projectId == other.projectId && - additionalHeaders == other.additionalHeaders && - additionalQueryParams == other.additionalQueryParams - } - - override fun hashCode(): Int = - Objects.hash( - classifyJobId, - organizationId, - projectId, - additionalHeaders, - additionalQueryParams, - ) - - override fun toString() = - "JobGetResultsParams{classifyJobId=$classifyJobId, organizationId=$organizationId, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" -} diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetResultsResponse.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetResultsResponse.kt deleted file mode 100644 index 6167215..0000000 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetResultsResponse.kt +++ /dev/null @@ -1,963 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.models.classifier.jobs - -import ai.llamaindex.llamacloud.core.ExcludeMissing -import ai.llamaindex.llamacloud.core.JsonField -import ai.llamaindex.llamacloud.core.JsonMissing -import ai.llamaindex.llamacloud.core.JsonValue -import ai.llamaindex.llamacloud.core.checkKnown -import ai.llamaindex.llamacloud.core.checkRequired -import ai.llamaindex.llamacloud.core.toImmutable -import ai.llamaindex.llamacloud.errors.LlamaCloudInvalidDataException -import com.fasterxml.jackson.annotation.JsonAnyGetter -import com.fasterxml.jackson.annotation.JsonAnySetter -import com.fasterxml.jackson.annotation.JsonCreator -import com.fasterxml.jackson.annotation.JsonProperty -import java.time.OffsetDateTime -import java.util.Collections -import java.util.Objects -import java.util.Optional -import kotlin.jvm.optionals.getOrNull - -/** Response model for the classify endpoint following AIP-132 pagination standard. */ -class JobGetResultsResponse -@JsonCreator(mode = JsonCreator.Mode.DISABLED) -private constructor( - private val items: JsonField>, - private val nextPageToken: JsonField, - private val totalSize: JsonField, - private val additionalProperties: MutableMap, -) { - - @JsonCreator - private constructor( - @JsonProperty("items") @ExcludeMissing items: JsonField> = JsonMissing.of(), - @JsonProperty("next_page_token") - @ExcludeMissing - nextPageToken: JsonField = JsonMissing.of(), - @JsonProperty("total_size") @ExcludeMissing totalSize: JsonField = JsonMissing.of(), - ) : this(items, nextPageToken, totalSize, mutableMapOf()) - - /** - * The list of items. - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun items(): List = items.getRequired("items") - - /** - * A token, which can be sent as page_token to retrieve the next page. If this field is omitted, - * there are no subsequent pages. - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun nextPageToken(): Optional = nextPageToken.getOptional("next_page_token") - - /** - * The total number of items available. This is only populated when specifically requested. The - * value may be an estimate and can be used for display purposes only. - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun totalSize(): Optional = totalSize.getOptional("total_size") - - /** - * Returns the raw JSON value of [items]. - * - * Unlike [items], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("items") @ExcludeMissing fun _items(): JsonField> = items - - /** - * Returns the raw JSON value of [nextPageToken]. - * - * Unlike [nextPageToken], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("next_page_token") - @ExcludeMissing - fun _nextPageToken(): JsonField = nextPageToken - - /** - * Returns the raw JSON value of [totalSize]. - * - * Unlike [totalSize], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("total_size") @ExcludeMissing fun _totalSize(): JsonField = totalSize - - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of [JobGetResultsResponse]. - * - * The following fields are required: - * ```java - * .items() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [JobGetResultsResponse]. */ - class Builder internal constructor() { - - private var items: JsonField>? = null - private var nextPageToken: JsonField = JsonMissing.of() - private var totalSize: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(jobGetResultsResponse: JobGetResultsResponse) = apply { - items = jobGetResultsResponse.items.map { it.toMutableList() } - nextPageToken = jobGetResultsResponse.nextPageToken - totalSize = jobGetResultsResponse.totalSize - additionalProperties = jobGetResultsResponse.additionalProperties.toMutableMap() - } - - /** The list of items. */ - fun items(items: List) = items(JsonField.of(items)) - - /** - * Sets [Builder.items] to an arbitrary JSON value. - * - * You should usually call [Builder.items] with a well-typed `List` value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun items(items: JsonField>) = apply { - this.items = items.map { it.toMutableList() } - } - - /** - * Adds a single [Item] to [items]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - fun addItem(item: Item) = apply { - items = - (items ?: JsonField.of(mutableListOf())).also { checkKnown("items", it).add(item) } - } - - /** - * A token, which can be sent as page_token to retrieve the next page. If this field is - * omitted, there are no subsequent pages. - */ - fun nextPageToken(nextPageToken: String?) = - nextPageToken(JsonField.ofNullable(nextPageToken)) - - /** Alias for calling [Builder.nextPageToken] with `nextPageToken.orElse(null)`. */ - fun nextPageToken(nextPageToken: Optional) = - nextPageToken(nextPageToken.getOrNull()) - - /** - * Sets [Builder.nextPageToken] to an arbitrary JSON value. - * - * You should usually call [Builder.nextPageToken] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun nextPageToken(nextPageToken: JsonField) = apply { - this.nextPageToken = nextPageToken - } - - /** - * The total number of items available. This is only populated when specifically requested. - * The value may be an estimate and can be used for display purposes only. - */ - fun totalSize(totalSize: Long?) = totalSize(JsonField.ofNullable(totalSize)) - - /** - * Alias for [Builder.totalSize]. - * - * This unboxed primitive overload exists for backwards compatibility. - */ - fun totalSize(totalSize: Long) = totalSize(totalSize as Long?) - - /** Alias for calling [Builder.totalSize] with `totalSize.orElse(null)`. */ - fun totalSize(totalSize: Optional) = totalSize(totalSize.getOrNull()) - - /** - * Sets [Builder.totalSize] to an arbitrary JSON value. - * - * You should usually call [Builder.totalSize] with a well-typed [Long] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun totalSize(totalSize: JsonField) = apply { this.totalSize = totalSize } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [JobGetResultsResponse]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .items() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): JobGetResultsResponse = - JobGetResultsResponse( - checkRequired("items", items).map { it.toImmutable() }, - nextPageToken, - totalSize, - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - /** - * Validates that the types of all values in this object match their expected types recursively. - * - * This method is _not_ forwards compatible with new types from the API for existing fields. - * - * @throws LlamaCloudInvalidDataException if any value type in this object doesn't match its - * expected type. - */ - fun validate(): JobGetResultsResponse = apply { - if (validated) { - return@apply - } - - items().forEach { it.validate() } - nextPageToken() - totalSize() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LlamaCloudInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - (items.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + - (if (nextPageToken.asKnown().isPresent) 1 else 0) + - (if (totalSize.asKnown().isPresent) 1 else 0) - - /** A file classification. */ - class Item - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val id: JsonField, - private val classifyJobId: JsonField, - private val createdAt: JsonField, - private val fileId: JsonField, - private val result: JsonField, - private val updatedAt: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), - @JsonProperty("classify_job_id") - @ExcludeMissing - classifyJobId: JsonField = JsonMissing.of(), - @JsonProperty("created_at") - @ExcludeMissing - createdAt: JsonField = JsonMissing.of(), - @JsonProperty("file_id") @ExcludeMissing fileId: JsonField = JsonMissing.of(), - @JsonProperty("result") @ExcludeMissing result: JsonField = JsonMissing.of(), - @JsonProperty("updated_at") - @ExcludeMissing - updatedAt: JsonField = JsonMissing.of(), - ) : this(id, classifyJobId, createdAt, fileId, result, updatedAt, mutableMapOf()) - - /** - * Unique identifier - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun id(): String = id.getRequired("id") - - /** - * The ID of the classify job - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun classifyJobId(): String = classifyJobId.getRequired("classify_job_id") - - /** - * Creation datetime - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun createdAt(): Optional = createdAt.getOptional("created_at") - - /** - * The ID of the classified file - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun fileId(): Optional = fileId.getOptional("file_id") - - /** - * Result of classifying a single file. - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun result(): Optional = result.getOptional("result") - - /** - * Update datetime - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun updatedAt(): Optional = updatedAt.getOptional("updated_at") - - /** - * Returns the raw JSON value of [id]. - * - * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id - - /** - * Returns the raw JSON value of [classifyJobId]. - * - * Unlike [classifyJobId], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("classify_job_id") - @ExcludeMissing - fun _classifyJobId(): JsonField = classifyJobId - - /** - * Returns the raw JSON value of [createdAt]. - * - * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("created_at") - @ExcludeMissing - fun _createdAt(): JsonField = createdAt - - /** - * Returns the raw JSON value of [fileId]. - * - * Unlike [fileId], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("file_id") @ExcludeMissing fun _fileId(): JsonField = fileId - - /** - * Returns the raw JSON value of [result]. - * - * Unlike [result], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("result") @ExcludeMissing fun _result(): JsonField = result - - /** - * Returns the raw JSON value of [updatedAt]. - * - * Unlike [updatedAt], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("updated_at") - @ExcludeMissing - fun _updatedAt(): JsonField = updatedAt - - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of [Item]. - * - * The following fields are required: - * ```java - * .id() - * .classifyJobId() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [Item]. */ - class Builder internal constructor() { - - private var id: JsonField? = null - private var classifyJobId: JsonField? = null - private var createdAt: JsonField = JsonMissing.of() - private var fileId: JsonField = JsonMissing.of() - private var result: JsonField = JsonMissing.of() - private var updatedAt: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(item: Item) = apply { - id = item.id - classifyJobId = item.classifyJobId - createdAt = item.createdAt - fileId = item.fileId - result = item.result - updatedAt = item.updatedAt - additionalProperties = item.additionalProperties.toMutableMap() - } - - /** Unique identifier */ - fun id(id: String) = id(JsonField.of(id)) - - /** - * Sets [Builder.id] to an arbitrary JSON value. - * - * You should usually call [Builder.id] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun id(id: JsonField) = apply { this.id = id } - - /** The ID of the classify job */ - fun classifyJobId(classifyJobId: String) = classifyJobId(JsonField.of(classifyJobId)) - - /** - * Sets [Builder.classifyJobId] to an arbitrary JSON value. - * - * You should usually call [Builder.classifyJobId] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun classifyJobId(classifyJobId: JsonField) = apply { - this.classifyJobId = classifyJobId - } - - /** Creation datetime */ - fun createdAt(createdAt: OffsetDateTime?) = createdAt(JsonField.ofNullable(createdAt)) - - /** Alias for calling [Builder.createdAt] with `createdAt.orElse(null)`. */ - fun createdAt(createdAt: Optional) = createdAt(createdAt.getOrNull()) - - /** - * Sets [Builder.createdAt] to an arbitrary JSON value. - * - * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun createdAt(createdAt: JsonField) = apply { - this.createdAt = createdAt - } - - /** The ID of the classified file */ - fun fileId(fileId: String?) = fileId(JsonField.ofNullable(fileId)) - - /** Alias for calling [Builder.fileId] with `fileId.orElse(null)`. */ - fun fileId(fileId: Optional) = fileId(fileId.getOrNull()) - - /** - * Sets [Builder.fileId] to an arbitrary JSON value. - * - * You should usually call [Builder.fileId] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun fileId(fileId: JsonField) = apply { this.fileId = fileId } - - /** Result of classifying a single file. */ - fun result(result: Result?) = result(JsonField.ofNullable(result)) - - /** Alias for calling [Builder.result] with `result.orElse(null)`. */ - fun result(result: Optional) = result(result.getOrNull()) - - /** - * Sets [Builder.result] to an arbitrary JSON value. - * - * You should usually call [Builder.result] with a well-typed [Result] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun result(result: JsonField) = apply { this.result = result } - - /** Update datetime */ - fun updatedAt(updatedAt: OffsetDateTime?) = updatedAt(JsonField.ofNullable(updatedAt)) - - /** Alias for calling [Builder.updatedAt] with `updatedAt.orElse(null)`. */ - fun updatedAt(updatedAt: Optional) = updatedAt(updatedAt.getOrNull()) - - /** - * Sets [Builder.updatedAt] to an arbitrary JSON value. - * - * You should usually call [Builder.updatedAt] with a well-typed [OffsetDateTime] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun updatedAt(updatedAt: JsonField) = apply { - this.updatedAt = updatedAt - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [Item]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .id() - * .classifyJobId() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): Item = - Item( - checkRequired("id", id), - checkRequired("classifyJobId", classifyJobId), - createdAt, - fileId, - result, - updatedAt, - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - /** - * Validates that the types of all values in this object match their expected types - * recursively. - * - * This method is _not_ forwards compatible with new types from the API for existing fields. - * - * @throws LlamaCloudInvalidDataException if any value type in this object doesn't match its - * expected type. - */ - fun validate(): Item = apply { - if (validated) { - return@apply - } - - id() - classifyJobId() - createdAt() - fileId() - result().ifPresent { it.validate() } - updatedAt() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LlamaCloudInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - (if (id.asKnown().isPresent) 1 else 0) + - (if (classifyJobId.asKnown().isPresent) 1 else 0) + - (if (createdAt.asKnown().isPresent) 1 else 0) + - (if (fileId.asKnown().isPresent) 1 else 0) + - (result.asKnown().getOrNull()?.validity() ?: 0) + - (if (updatedAt.asKnown().isPresent) 1 else 0) - - /** Result of classifying a single file. */ - class Result - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val confidence: JsonField, - private val reasoning: JsonField, - private val type: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("confidence") - @ExcludeMissing - confidence: JsonField = JsonMissing.of(), - @JsonProperty("reasoning") - @ExcludeMissing - reasoning: JsonField = JsonMissing.of(), - @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), - ) : this(confidence, reasoning, type, mutableMapOf()) - - /** - * Confidence score of the classification (0.0-1.0) - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). - */ - fun confidence(): Double = confidence.getRequired("confidence") - - /** - * Step-by-step explanation of why this classification was chosen and the confidence - * score assigned - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). - */ - fun reasoning(): String = reasoning.getRequired("reasoning") - - /** - * The document type that best matches, or null if no match. - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun type(): Optional = type.getOptional("type") - - /** - * Returns the raw JSON value of [confidence]. - * - * Unlike [confidence], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("confidence") - @ExcludeMissing - fun _confidence(): JsonField = confidence - - /** - * Returns the raw JSON value of [reasoning]. - * - * Unlike [reasoning], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("reasoning") - @ExcludeMissing - fun _reasoning(): JsonField = reasoning - - /** - * Returns the raw JSON value of [type]. - * - * Unlike [type], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type - - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of [Result]. - * - * The following fields are required: - * ```java - * .confidence() - * .reasoning() - * .type() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [Result]. */ - class Builder internal constructor() { - - private var confidence: JsonField? = null - private var reasoning: JsonField? = null - private var type: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(result: Result) = apply { - confidence = result.confidence - reasoning = result.reasoning - type = result.type - additionalProperties = result.additionalProperties.toMutableMap() - } - - /** Confidence score of the classification (0.0-1.0) */ - fun confidence(confidence: Double) = confidence(JsonField.of(confidence)) - - /** - * Sets [Builder.confidence] to an arbitrary JSON value. - * - * You should usually call [Builder.confidence] with a well-typed [Double] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun confidence(confidence: JsonField) = apply { - this.confidence = confidence - } - - /** - * Step-by-step explanation of why this classification was chosen and the confidence - * score assigned - */ - fun reasoning(reasoning: String) = reasoning(JsonField.of(reasoning)) - - /** - * Sets [Builder.reasoning] to an arbitrary JSON value. - * - * You should usually call [Builder.reasoning] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun reasoning(reasoning: JsonField) = apply { this.reasoning = reasoning } - - /** The document type that best matches, or null if no match. */ - fun type(type: String?) = type(JsonField.ofNullable(type)) - - /** Alias for calling [Builder.type] with `type.orElse(null)`. */ - fun type(type: Optional) = type(type.getOrNull()) - - /** - * Sets [Builder.type] to an arbitrary JSON value. - * - * You should usually call [Builder.type] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun type(type: JsonField) = apply { this.type = type } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [Result]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .confidence() - * .reasoning() - * .type() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): Result = - Result( - checkRequired("confidence", confidence), - checkRequired("reasoning", reasoning), - checkRequired("type", type), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - /** - * Validates that the types of all values in this object match their expected types - * recursively. - * - * This method is _not_ forwards compatible with new types from the API for existing - * fields. - * - * @throws LlamaCloudInvalidDataException if any value type in this object doesn't match - * its expected type. - */ - fun validate(): Result = apply { - if (validated) { - return@apply - } - - confidence() - reasoning() - type() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LlamaCloudInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - (if (confidence.asKnown().isPresent) 1 else 0) + - (if (reasoning.asKnown().isPresent) 1 else 0) + - (if (type.asKnown().isPresent) 1 else 0) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Result && - confidence == other.confidence && - reasoning == other.reasoning && - type == other.type && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash(confidence, reasoning, type, additionalProperties) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "Result{confidence=$confidence, reasoning=$reasoning, type=$type, additionalProperties=$additionalProperties}" - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Item && - id == other.id && - classifyJobId == other.classifyJobId && - createdAt == other.createdAt && - fileId == other.fileId && - result == other.result && - updatedAt == other.updatedAt && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash( - id, - classifyJobId, - createdAt, - fileId, - result, - updatedAt, - additionalProperties, - ) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "Item{id=$id, classifyJobId=$classifyJobId, createdAt=$createdAt, fileId=$fileId, result=$result, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is JobGetResultsResponse && - items == other.items && - nextPageToken == other.nextPageToken && - totalSize == other.totalSize && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash(items, nextPageToken, totalSize, additionalProperties) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "JobGetResultsResponse{items=$items, nextPageToken=$nextPageToken, totalSize=$totalSize, additionalProperties=$additionalProperties}" -} diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListPage.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListPage.kt deleted file mode 100644 index b7e109f..0000000 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListPage.kt +++ /dev/null @@ -1,131 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.models.classifier.jobs - -import ai.llamaindex.llamacloud.core.AutoPager -import ai.llamaindex.llamacloud.core.Page -import ai.llamaindex.llamacloud.core.checkRequired -import ai.llamaindex.llamacloud.services.blocking.classifier.JobService -import java.util.Objects -import java.util.Optional -import kotlin.jvm.optionals.getOrNull - -/** @see JobService.list */ -@Deprecated("Please use `client.classify.list()`") -class JobListPage -private constructor( - private val service: JobService, - private val params: JobListParams, - private val response: JobListPageResponse, -) : Page { - - /** - * Delegates to [JobListPageResponse], but gracefully handles missing data. - * - * @see JobListPageResponse.items - */ - override fun items(): List = - response._items().getOptional("items").getOrNull() ?: emptyList() - - /** - * Delegates to [JobListPageResponse], but gracefully handles missing data. - * - * @see JobListPageResponse.nextPageToken - */ - fun nextPageToken(): Optional = response._nextPageToken().getOptional("next_page_token") - - override fun hasNextPage(): Boolean = items().isNotEmpty() && nextPageToken().isPresent - - fun nextPageParams(): JobListParams { - val nextCursor = - nextPageToken().getOrNull() - ?: throw IllegalStateException("Cannot construct next page params") - return params.toBuilder().pageToken(nextCursor).build() - } - - override fun nextPage(): JobListPage = service.list(nextPageParams()) - - fun autoPager(): AutoPager = AutoPager.from(this) - - /** The parameters that were used to request this page. */ - fun params(): JobListParams = params - - /** The response that this page was parsed from. */ - fun response(): JobListPageResponse = response - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of [JobListPage]. - * - * The following fields are required: - * ```java - * .service() - * .params() - * .response() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [JobListPage]. */ - class Builder internal constructor() { - - private var service: JobService? = null - private var params: JobListParams? = null - private var response: JobListPageResponse? = null - - @JvmSynthetic - internal fun from(jobListPage: JobListPage) = apply { - service = jobListPage.service - params = jobListPage.params - response = jobListPage.response - } - - fun service(service: JobService) = apply { this.service = service } - - /** The parameters that were used to request this page. */ - fun params(params: JobListParams) = apply { this.params = params } - - /** The response that this page was parsed from. */ - fun response(response: JobListPageResponse) = apply { this.response = response } - - /** - * Returns an immutable instance of [JobListPage]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .service() - * .params() - * .response() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): JobListPage = - JobListPage( - checkRequired("service", service), - checkRequired("params", params), - checkRequired("response", response), - ) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is JobListPage && - service == other.service && - params == other.params && - response == other.response - } - - override fun hashCode(): Int = Objects.hash(service, params, response) - - override fun toString() = "JobListPage{service=$service, params=$params, response=$response}" -} diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListPageAsync.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListPageAsync.kt deleted file mode 100644 index 45149e6..0000000 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListPageAsync.kt +++ /dev/null @@ -1,145 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.models.classifier.jobs - -import ai.llamaindex.llamacloud.core.AutoPagerAsync -import ai.llamaindex.llamacloud.core.PageAsync -import ai.llamaindex.llamacloud.core.checkRequired -import ai.llamaindex.llamacloud.services.async.classifier.JobServiceAsync -import java.util.Objects -import java.util.Optional -import java.util.concurrent.CompletableFuture -import java.util.concurrent.Executor -import kotlin.jvm.optionals.getOrNull - -/** @see JobServiceAsync.list */ -@Deprecated("Please use `client.classify.list()`") -class JobListPageAsync -private constructor( - private val service: JobServiceAsync, - private val streamHandlerExecutor: Executor, - private val params: JobListParams, - private val response: JobListPageResponse, -) : PageAsync { - - /** - * Delegates to [JobListPageResponse], but gracefully handles missing data. - * - * @see JobListPageResponse.items - */ - override fun items(): List = - response._items().getOptional("items").getOrNull() ?: emptyList() - - /** - * Delegates to [JobListPageResponse], but gracefully handles missing data. - * - * @see JobListPageResponse.nextPageToken - */ - fun nextPageToken(): Optional = response._nextPageToken().getOptional("next_page_token") - - override fun hasNextPage(): Boolean = items().isNotEmpty() && nextPageToken().isPresent - - fun nextPageParams(): JobListParams { - val nextCursor = - nextPageToken().getOrNull() - ?: throw IllegalStateException("Cannot construct next page params") - return params.toBuilder().pageToken(nextCursor).build() - } - - override fun nextPage(): CompletableFuture = service.list(nextPageParams()) - - fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) - - /** The parameters that were used to request this page. */ - fun params(): JobListParams = params - - /** The response that this page was parsed from. */ - fun response(): JobListPageResponse = response - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of [JobListPageAsync]. - * - * The following fields are required: - * ```java - * .service() - * .streamHandlerExecutor() - * .params() - * .response() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [JobListPageAsync]. */ - class Builder internal constructor() { - - private var service: JobServiceAsync? = null - private var streamHandlerExecutor: Executor? = null - private var params: JobListParams? = null - private var response: JobListPageResponse? = null - - @JvmSynthetic - internal fun from(jobListPageAsync: JobListPageAsync) = apply { - service = jobListPageAsync.service - streamHandlerExecutor = jobListPageAsync.streamHandlerExecutor - params = jobListPageAsync.params - response = jobListPageAsync.response - } - - fun service(service: JobServiceAsync) = apply { this.service = service } - - fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { - this.streamHandlerExecutor = streamHandlerExecutor - } - - /** The parameters that were used to request this page. */ - fun params(params: JobListParams) = apply { this.params = params } - - /** The response that this page was parsed from. */ - fun response(response: JobListPageResponse) = apply { this.response = response } - - /** - * Returns an immutable instance of [JobListPageAsync]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .service() - * .streamHandlerExecutor() - * .params() - * .response() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): JobListPageAsync = - JobListPageAsync( - checkRequired("service", service), - checkRequired("streamHandlerExecutor", streamHandlerExecutor), - checkRequired("params", params), - checkRequired("response", response), - ) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is JobListPageAsync && - service == other.service && - streamHandlerExecutor == other.streamHandlerExecutor && - params == other.params && - response == other.response - } - - override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) - - override fun toString() = - "JobListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" -} diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListPageResponse.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListPageResponse.kt deleted file mode 100644 index abfc4f1..0000000 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListPageResponse.kt +++ /dev/null @@ -1,303 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.models.classifier.jobs - -import ai.llamaindex.llamacloud.core.ExcludeMissing -import ai.llamaindex.llamacloud.core.JsonField -import ai.llamaindex.llamacloud.core.JsonMissing -import ai.llamaindex.llamacloud.core.JsonValue -import ai.llamaindex.llamacloud.core.checkKnown -import ai.llamaindex.llamacloud.core.checkRequired -import ai.llamaindex.llamacloud.core.toImmutable -import ai.llamaindex.llamacloud.errors.LlamaCloudInvalidDataException -import com.fasterxml.jackson.annotation.JsonAnyGetter -import com.fasterxml.jackson.annotation.JsonAnySetter -import com.fasterxml.jackson.annotation.JsonCreator -import com.fasterxml.jackson.annotation.JsonProperty -import java.util.Collections -import java.util.Objects -import java.util.Optional -import kotlin.jvm.optionals.getOrNull - -/** Paginated list of classify jobs. */ -class JobListPageResponse -@JsonCreator(mode = JsonCreator.Mode.DISABLED) -private constructor( - private val items: JsonField>, - private val nextPageToken: JsonField, - private val totalSize: JsonField, - private val additionalProperties: MutableMap, -) { - - @JsonCreator - private constructor( - @JsonProperty("items") - @ExcludeMissing - items: JsonField> = JsonMissing.of(), - @JsonProperty("next_page_token") - @ExcludeMissing - nextPageToken: JsonField = JsonMissing.of(), - @JsonProperty("total_size") @ExcludeMissing totalSize: JsonField = JsonMissing.of(), - ) : this(items, nextPageToken, totalSize, mutableMapOf()) - - /** - * The list of items. - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun items(): List = items.getRequired("items") - - /** - * A token, which can be sent as page_token to retrieve the next page. If this field is omitted, - * there are no subsequent pages. - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun nextPageToken(): Optional = nextPageToken.getOptional("next_page_token") - - /** - * The total number of items available. This is only populated when specifically requested. The - * value may be an estimate and can be used for display purposes only. - * - * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun totalSize(): Optional = totalSize.getOptional("total_size") - - /** - * Returns the raw JSON value of [items]. - * - * Unlike [items], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("items") @ExcludeMissing fun _items(): JsonField> = items - - /** - * Returns the raw JSON value of [nextPageToken]. - * - * Unlike [nextPageToken], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("next_page_token") - @ExcludeMissing - fun _nextPageToken(): JsonField = nextPageToken - - /** - * Returns the raw JSON value of [totalSize]. - * - * Unlike [totalSize], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("total_size") @ExcludeMissing fun _totalSize(): JsonField = totalSize - - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of [JobListPageResponse]. - * - * The following fields are required: - * ```java - * .items() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [JobListPageResponse]. */ - class Builder internal constructor() { - - private var items: JsonField>? = null - private var nextPageToken: JsonField = JsonMissing.of() - private var totalSize: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(jobListPageResponse: JobListPageResponse) = apply { - items = jobListPageResponse.items.map { it.toMutableList() } - nextPageToken = jobListPageResponse.nextPageToken - totalSize = jobListPageResponse.totalSize - additionalProperties = jobListPageResponse.additionalProperties.toMutableMap() - } - - /** The list of items. */ - fun items(items: List) = items(JsonField.of(items)) - - /** - * Sets [Builder.items] to an arbitrary JSON value. - * - * You should usually call [Builder.items] with a well-typed `List` value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun items(items: JsonField>) = apply { - this.items = items.map { it.toMutableList() } - } - - /** - * Adds a single [ClassifyJob] to [items]. - * - * @throws IllegalStateException if the field was previously set to a non-list. - */ - fun addItem(item: ClassifyJob) = apply { - items = - (items ?: JsonField.of(mutableListOf())).also { checkKnown("items", it).add(item) } - } - - /** - * A token, which can be sent as page_token to retrieve the next page. If this field is - * omitted, there are no subsequent pages. - */ - fun nextPageToken(nextPageToken: String?) = - nextPageToken(JsonField.ofNullable(nextPageToken)) - - /** Alias for calling [Builder.nextPageToken] with `nextPageToken.orElse(null)`. */ - fun nextPageToken(nextPageToken: Optional) = - nextPageToken(nextPageToken.getOrNull()) - - /** - * Sets [Builder.nextPageToken] to an arbitrary JSON value. - * - * You should usually call [Builder.nextPageToken] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun nextPageToken(nextPageToken: JsonField) = apply { - this.nextPageToken = nextPageToken - } - - /** - * The total number of items available. This is only populated when specifically requested. - * The value may be an estimate and can be used for display purposes only. - */ - fun totalSize(totalSize: Long?) = totalSize(JsonField.ofNullable(totalSize)) - - /** - * Alias for [Builder.totalSize]. - * - * This unboxed primitive overload exists for backwards compatibility. - */ - fun totalSize(totalSize: Long) = totalSize(totalSize as Long?) - - /** Alias for calling [Builder.totalSize] with `totalSize.orElse(null)`. */ - fun totalSize(totalSize: Optional) = totalSize(totalSize.getOrNull()) - - /** - * Sets [Builder.totalSize] to an arbitrary JSON value. - * - * You should usually call [Builder.totalSize] with a well-typed [Long] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. - */ - fun totalSize(totalSize: JsonField) = apply { this.totalSize = totalSize } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [JobListPageResponse]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .items() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): JobListPageResponse = - JobListPageResponse( - checkRequired("items", items).map { it.toImmutable() }, - nextPageToken, - totalSize, - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - /** - * Validates that the types of all values in this object match their expected types recursively. - * - * This method is _not_ forwards compatible with new types from the API for existing fields. - * - * @throws LlamaCloudInvalidDataException if any value type in this object doesn't match its - * expected type. - */ - fun validate(): JobListPageResponse = apply { - if (validated) { - return@apply - } - - items().forEach { it.validate() } - nextPageToken() - totalSize() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: LlamaCloudInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - (items.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + - (if (nextPageToken.asKnown().isPresent) 1 else 0) + - (if (totalSize.asKnown().isPresent) 1 else 0) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is JobListPageResponse && - items == other.items && - nextPageToken == other.nextPageToken && - totalSize == other.totalSize && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash(items, nextPageToken, totalSize, additionalProperties) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "JobListPageResponse{items=$items, nextPageToken=$nextPageToken, totalSize=$totalSize, additionalProperties=$additionalProperties}" -} diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListParams.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListParams.kt deleted file mode 100644 index bfd9aa1..0000000 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListParams.kt +++ /dev/null @@ -1,249 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.models.classifier.jobs - -import ai.llamaindex.llamacloud.core.Params -import ai.llamaindex.llamacloud.core.http.Headers -import ai.llamaindex.llamacloud.core.http.QueryParams -import java.util.Objects -import java.util.Optional -import kotlin.jvm.optionals.getOrNull - -/** List classify jobs. Experimental: not production-ready and subject to change. */ -@Deprecated("Please use `client.classify.list()`") -class JobListParams -private constructor( - private val organizationId: String?, - private val pageSize: Long?, - private val pageToken: String?, - private val projectId: String?, - private val additionalHeaders: Headers, - private val additionalQueryParams: QueryParams, -) : Params { - - fun organizationId(): Optional = Optional.ofNullable(organizationId) - - fun pageSize(): Optional = Optional.ofNullable(pageSize) - - fun pageToken(): Optional = Optional.ofNullable(pageToken) - - fun projectId(): Optional = Optional.ofNullable(projectId) - - /** Additional headers to send with the request. */ - fun _additionalHeaders(): Headers = additionalHeaders - - /** Additional query param to send with the request. */ - fun _additionalQueryParams(): QueryParams = additionalQueryParams - - fun toBuilder() = Builder().from(this) - - companion object { - - @JvmStatic fun none(): JobListParams = builder().build() - - /** Returns a mutable builder for constructing an instance of [JobListParams]. */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [JobListParams]. */ - class Builder internal constructor() { - - private var organizationId: String? = null - private var pageSize: Long? = null - private var pageToken: String? = null - private var projectId: String? = null - private var additionalHeaders: Headers.Builder = Headers.builder() - private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - - @JvmSynthetic - internal fun from(jobListParams: JobListParams) = apply { - organizationId = jobListParams.organizationId - pageSize = jobListParams.pageSize - pageToken = jobListParams.pageToken - projectId = jobListParams.projectId - additionalHeaders = jobListParams.additionalHeaders.toBuilder() - additionalQueryParams = jobListParams.additionalQueryParams.toBuilder() - } - - fun organizationId(organizationId: String?) = apply { this.organizationId = organizationId } - - /** Alias for calling [Builder.organizationId] with `organizationId.orElse(null)`. */ - fun organizationId(organizationId: Optional) = - organizationId(organizationId.getOrNull()) - - fun pageSize(pageSize: Long?) = apply { this.pageSize = pageSize } - - /** - * Alias for [Builder.pageSize]. - * - * This unboxed primitive overload exists for backwards compatibility. - */ - fun pageSize(pageSize: Long) = pageSize(pageSize as Long?) - - /** Alias for calling [Builder.pageSize] with `pageSize.orElse(null)`. */ - fun pageSize(pageSize: Optional) = pageSize(pageSize.getOrNull()) - - fun pageToken(pageToken: String?) = apply { this.pageToken = pageToken } - - /** Alias for calling [Builder.pageToken] with `pageToken.orElse(null)`. */ - fun pageToken(pageToken: Optional) = pageToken(pageToken.getOrNull()) - - fun projectId(projectId: String?) = apply { this.projectId = projectId } - - /** Alias for calling [Builder.projectId] with `projectId.orElse(null)`. */ - fun projectId(projectId: Optional) = projectId(projectId.getOrNull()) - - fun additionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.clear() - putAllAdditionalHeaders(additionalHeaders) - } - - fun additionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.clear() - putAllAdditionalHeaders(additionalHeaders) - } - - fun putAdditionalHeader(name: String, value: String) = apply { - additionalHeaders.put(name, value) - } - - fun putAdditionalHeaders(name: String, values: Iterable) = apply { - additionalHeaders.put(name, values) - } - - fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.putAll(additionalHeaders) - } - - fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.putAll(additionalHeaders) - } - - fun replaceAdditionalHeaders(name: String, value: String) = apply { - additionalHeaders.replace(name, value) - } - - fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { - additionalHeaders.replace(name, values) - } - - fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.replaceAll(additionalHeaders) - } - - fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.replaceAll(additionalHeaders) - } - - fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } - - fun removeAllAdditionalHeaders(names: Set) = apply { - additionalHeaders.removeAll(names) - } - - fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.clear() - putAllAdditionalQueryParams(additionalQueryParams) - } - - fun additionalQueryParams(additionalQueryParams: Map>) = apply { - this.additionalQueryParams.clear() - putAllAdditionalQueryParams(additionalQueryParams) - } - - fun putAdditionalQueryParam(key: String, value: String) = apply { - additionalQueryParams.put(key, value) - } - - fun putAdditionalQueryParams(key: String, values: Iterable) = apply { - additionalQueryParams.put(key, values) - } - - fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.putAll(additionalQueryParams) - } - - fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = - apply { - this.additionalQueryParams.putAll(additionalQueryParams) - } - - fun replaceAdditionalQueryParams(key: String, value: String) = apply { - additionalQueryParams.replace(key, value) - } - - fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { - additionalQueryParams.replace(key, values) - } - - fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.replaceAll(additionalQueryParams) - } - - fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = - apply { - this.additionalQueryParams.replaceAll(additionalQueryParams) - } - - fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } - - fun removeAllAdditionalQueryParams(keys: Set) = apply { - additionalQueryParams.removeAll(keys) - } - - /** - * Returns an immutable instance of [JobListParams]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): JobListParams = - JobListParams( - organizationId, - pageSize, - pageToken, - projectId, - additionalHeaders.build(), - additionalQueryParams.build(), - ) - } - - override fun _headers(): Headers = additionalHeaders - - override fun _queryParams(): QueryParams = - QueryParams.builder() - .apply { - organizationId?.let { put("organization_id", it) } - pageSize?.let { put("page_size", it.toString()) } - pageToken?.let { put("page_token", it) } - projectId?.let { put("project_id", it) } - putAll(additionalQueryParams) - } - .build() - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is JobListParams && - organizationId == other.organizationId && - pageSize == other.pageSize && - pageToken == other.pageToken && - projectId == other.projectId && - additionalHeaders == other.additionalHeaders && - additionalQueryParams == other.additionalQueryParams - } - - override fun hashCode(): Int = - Objects.hash( - organizationId, - pageSize, - pageToken, - projectId, - additionalHeaders, - additionalQueryParams, - ) - - override fun toString() = - "JobListParams{organizationId=$organizationId, pageSize=$pageSize, pageToken=$pageToken, projectId=$projectId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" -} diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/classifier/JobServiceAsync.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/classifier/JobServiceAsync.kt index 613d1ec..cc18c9a 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/classifier/JobServiceAsync.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/classifier/JobServiceAsync.kt @@ -3,16 +3,6 @@ package ai.llamaindex.llamacloud.services.async.classifier import ai.llamaindex.llamacloud.core.ClientOptions -import ai.llamaindex.llamacloud.core.RequestOptions -import ai.llamaindex.llamacloud.core.http.HttpResponseFor -import ai.llamaindex.llamacloud.models.classifier.jobs.ClassifyJob -import ai.llamaindex.llamacloud.models.classifier.jobs.JobCreateParams -import ai.llamaindex.llamacloud.models.classifier.jobs.JobGetParams -import ai.llamaindex.llamacloud.models.classifier.jobs.JobGetResultsParams -import ai.llamaindex.llamacloud.models.classifier.jobs.JobGetResultsResponse -import ai.llamaindex.llamacloud.models.classifier.jobs.JobListPageAsync -import ai.llamaindex.llamacloud.models.classifier.jobs.JobListParams -import java.util.concurrent.CompletableFuture import java.util.function.Consumer interface JobServiceAsync { @@ -29,121 +19,6 @@ interface JobServiceAsync { */ fun withOptions(modifier: Consumer): JobServiceAsync - /** Create a classify job. Experimental: not production-ready and subject to change. */ - @Deprecated("Please use `client.classify.create()`") - fun create(params: JobCreateParams): CompletableFuture = - create(params, RequestOptions.none()) - - /** @see create */ - @Deprecated("Please use `client.classify.create()`") - fun create( - params: JobCreateParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** List classify jobs. Experimental: not production-ready and subject to change. */ - @Deprecated("Please use `client.classify.list()`") - fun list(): CompletableFuture = list(JobListParams.none()) - - /** @see list */ - @Deprecated("Please use `client.classify.list()`") - fun list( - params: JobListParams = JobListParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** @see list */ - @Deprecated("Please use `client.classify.list()`") - fun list(params: JobListParams = JobListParams.none()): CompletableFuture = - list(params, RequestOptions.none()) - - /** @see list */ - @Deprecated("Please use `client.classify.list()`") - fun list(requestOptions: RequestOptions): CompletableFuture = - list(JobListParams.none(), requestOptions) - - /** Get a classify job. Experimental: not production-ready and subject to change. */ - @Deprecated("Please use `client.classify.get()`") - fun get(classifyJobId: String): CompletableFuture = - get(classifyJobId, JobGetParams.none()) - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - fun get( - classifyJobId: String, - params: JobGetParams = JobGetParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture = - get(params.toBuilder().classifyJobId(classifyJobId).build(), requestOptions) - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - fun get( - classifyJobId: String, - params: JobGetParams = JobGetParams.none(), - ): CompletableFuture = get(classifyJobId, params, RequestOptions.none()) - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - fun get( - params: JobGetParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - fun get(params: JobGetParams): CompletableFuture = - get(params, RequestOptions.none()) - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - fun get(classifyJobId: String, requestOptions: RequestOptions): CompletableFuture = - get(classifyJobId, JobGetParams.none(), requestOptions) - - /** - * Get the results of a classify job. Experimental: not production-ready and subject to change. - */ - @Deprecated("Please use `client.classify.get()`") - fun getResults(classifyJobId: String): CompletableFuture = - getResults(classifyJobId, JobGetResultsParams.none()) - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - fun getResults( - classifyJobId: String, - params: JobGetResultsParams = JobGetResultsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture = - getResults(params.toBuilder().classifyJobId(classifyJobId).build(), requestOptions) - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - fun getResults( - classifyJobId: String, - params: JobGetResultsParams = JobGetResultsParams.none(), - ): CompletableFuture = - getResults(classifyJobId, params, RequestOptions.none()) - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - fun getResults( - params: JobGetResultsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - fun getResults(params: JobGetResultsParams): CompletableFuture = - getResults(params, RequestOptions.none()) - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - fun getResults( - classifyJobId: String, - requestOptions: RequestOptions, - ): CompletableFuture = - getResults(classifyJobId, JobGetResultsParams.none(), requestOptions) - /** A view of [JobServiceAsync] that provides access to raw HTTP responses for each method. */ interface WithRawResponse { @@ -153,143 +28,5 @@ interface JobServiceAsync { * The original service is not modified. */ fun withOptions(modifier: Consumer): JobServiceAsync.WithRawResponse - - /** - * Returns a raw HTTP response for `post /api/v1/classifier/jobs`, but is otherwise the same - * as [JobServiceAsync.create]. - */ - @Deprecated("Please use `client.classify.create()`") - fun create(params: JobCreateParams): CompletableFuture> = - create(params, RequestOptions.none()) - - /** @see create */ - @Deprecated("Please use `client.classify.create()`") - fun create( - params: JobCreateParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** - * Returns a raw HTTP response for `get /api/v1/classifier/jobs`, but is otherwise the same - * as [JobServiceAsync.list]. - */ - @Deprecated("Please use `client.classify.list()`") - fun list(): CompletableFuture> = - list(JobListParams.none()) - - /** @see list */ - @Deprecated("Please use `client.classify.list()`") - fun list( - params: JobListParams = JobListParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** @see list */ - @Deprecated("Please use `client.classify.list()`") - fun list( - params: JobListParams = JobListParams.none() - ): CompletableFuture> = - list(params, RequestOptions.none()) - - /** @see list */ - @Deprecated("Please use `client.classify.list()`") - fun list( - requestOptions: RequestOptions - ): CompletableFuture> = - list(JobListParams.none(), requestOptions) - - /** - * Returns a raw HTTP response for `get /api/v1/classifier/jobs/{classify_job_id}`, but is - * otherwise the same as [JobServiceAsync.get]. - */ - @Deprecated("Please use `client.classify.get()`") - fun get(classifyJobId: String): CompletableFuture> = - get(classifyJobId, JobGetParams.none()) - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - fun get( - classifyJobId: String, - params: JobGetParams = JobGetParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> = - get(params.toBuilder().classifyJobId(classifyJobId).build(), requestOptions) - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - fun get( - classifyJobId: String, - params: JobGetParams = JobGetParams.none(), - ): CompletableFuture> = - get(classifyJobId, params, RequestOptions.none()) - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - fun get( - params: JobGetParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - fun get(params: JobGetParams): CompletableFuture> = - get(params, RequestOptions.none()) - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - fun get( - classifyJobId: String, - requestOptions: RequestOptions, - ): CompletableFuture> = - get(classifyJobId, JobGetParams.none(), requestOptions) - - /** - * Returns a raw HTTP response for `get /api/v1/classifier/jobs/{classify_job_id}/results`, - * but is otherwise the same as [JobServiceAsync.getResults]. - */ - @Deprecated("Please use `client.classify.get()`") - fun getResults( - classifyJobId: String - ): CompletableFuture> = - getResults(classifyJobId, JobGetResultsParams.none()) - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - fun getResults( - classifyJobId: String, - params: JobGetResultsParams = JobGetResultsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> = - getResults(params.toBuilder().classifyJobId(classifyJobId).build(), requestOptions) - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - fun getResults( - classifyJobId: String, - params: JobGetResultsParams = JobGetResultsParams.none(), - ): CompletableFuture> = - getResults(classifyJobId, params, RequestOptions.none()) - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - fun getResults( - params: JobGetResultsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - fun getResults( - params: JobGetResultsParams - ): CompletableFuture> = - getResults(params, RequestOptions.none()) - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - fun getResults( - classifyJobId: String, - requestOptions: RequestOptions, - ): CompletableFuture> = - getResults(classifyJobId, JobGetResultsParams.none(), requestOptions) } } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/classifier/JobServiceAsyncImpl.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/classifier/JobServiceAsyncImpl.kt index e6cd098..e016f5d 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/classifier/JobServiceAsyncImpl.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/classifier/JobServiceAsyncImpl.kt @@ -3,30 +3,7 @@ package ai.llamaindex.llamacloud.services.async.classifier import ai.llamaindex.llamacloud.core.ClientOptions -import ai.llamaindex.llamacloud.core.RequestOptions -import ai.llamaindex.llamacloud.core.checkRequired -import ai.llamaindex.llamacloud.core.handlers.errorBodyHandler -import ai.llamaindex.llamacloud.core.handlers.errorHandler -import ai.llamaindex.llamacloud.core.handlers.jsonHandler -import ai.llamaindex.llamacloud.core.http.HttpMethod -import ai.llamaindex.llamacloud.core.http.HttpRequest -import ai.llamaindex.llamacloud.core.http.HttpResponse -import ai.llamaindex.llamacloud.core.http.HttpResponse.Handler -import ai.llamaindex.llamacloud.core.http.HttpResponseFor -import ai.llamaindex.llamacloud.core.http.json -import ai.llamaindex.llamacloud.core.http.parseable -import ai.llamaindex.llamacloud.core.prepareAsync -import ai.llamaindex.llamacloud.models.classifier.jobs.ClassifyJob -import ai.llamaindex.llamacloud.models.classifier.jobs.JobCreateParams -import ai.llamaindex.llamacloud.models.classifier.jobs.JobGetParams -import ai.llamaindex.llamacloud.models.classifier.jobs.JobGetResultsParams -import ai.llamaindex.llamacloud.models.classifier.jobs.JobGetResultsResponse -import ai.llamaindex.llamacloud.models.classifier.jobs.JobListPageAsync -import ai.llamaindex.llamacloud.models.classifier.jobs.JobListPageResponse -import ai.llamaindex.llamacloud.models.classifier.jobs.JobListParams -import java.util.concurrent.CompletableFuture import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull class JobServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : JobServiceAsync { @@ -40,195 +17,14 @@ class JobServiceAsyncImpl internal constructor(private val clientOptions: Client override fun withOptions(modifier: Consumer): JobServiceAsync = JobServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - @Deprecated("Please use `client.classify.create()`") - override fun create( - params: JobCreateParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // post /api/v1/classifier/jobs - withRawResponse().create(params, requestOptions).thenApply { it.parse() } - - @Deprecated("Please use `client.classify.list()`") - override fun list( - params: JobListParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // get /api/v1/classifier/jobs - withRawResponse().list(params, requestOptions).thenApply { it.parse() } - - @Deprecated("Please use `client.classify.get()`") - override fun get( - params: JobGetParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // get /api/v1/classifier/jobs/{classify_job_id} - withRawResponse().get(params, requestOptions).thenApply { it.parse() } - - @Deprecated("Please use `client.classify.get()`") - override fun getResults( - params: JobGetResultsParams, - requestOptions: RequestOptions, - ): CompletableFuture = - // get /api/v1/classifier/jobs/{classify_job_id}/results - withRawResponse().getResults(params, requestOptions).thenApply { it.parse() } - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : JobServiceAsync.WithRawResponse { - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - override fun withOptions( modifier: Consumer ): JobServiceAsync.WithRawResponse = JobServiceAsyncImpl.WithRawResponseImpl( clientOptions.toBuilder().apply(modifier::accept).build() ) - - private val createHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - @Deprecated("Please use `client.classify.create()`") - override fun create( - params: JobCreateParams, - requestOptions: RequestOptions, - ): CompletableFuture> { - val request = - HttpRequest.builder() - .method(HttpMethod.POST) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("api", "v1", "classifier", "jobs") - .body(json(clientOptions.jsonMapper, params._body())) - .build() - .prepareAsync(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - return request - .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } - .thenApply { response -> - errorHandler.handle(response).parseable { - response - .use { createHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - } - - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - @Deprecated("Please use `client.classify.list()`") - override fun list( - params: JobListParams, - requestOptions: RequestOptions, - ): CompletableFuture> { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("api", "v1", "classifier", "jobs") - .build() - .prepareAsync(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - return request - .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } - .thenApply { response -> - errorHandler.handle(response).parseable { - response - .use { listHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - .let { - JobListPageAsync.builder() - .service(JobServiceAsyncImpl(clientOptions)) - .streamHandlerExecutor(clientOptions.streamHandlerExecutor) - .params(params) - .response(it) - .build() - } - } - } - } - - private val getHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - @Deprecated("Please use `client.classify.get()`") - override fun get( - params: JobGetParams, - requestOptions: RequestOptions, - ): CompletableFuture> { - // We check here instead of in the params builder because this can be specified - // positionally or in the params class. - checkRequired("classifyJobId", params.classifyJobId().getOrNull()) - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("api", "v1", "classifier", "jobs", params._pathParam(0)) - .build() - .prepareAsync(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - return request - .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } - .thenApply { response -> - errorHandler.handle(response).parseable { - response - .use { getHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - } - - private val getResultsHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - @Deprecated("Please use `client.classify.get()`") - override fun getResults( - params: JobGetResultsParams, - requestOptions: RequestOptions, - ): CompletableFuture> { - // We check here instead of in the params builder because this can be specified - // positionally or in the params class. - checkRequired("classifyJobId", params.classifyJobId().getOrNull()) - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments( - "api", - "v1", - "classifier", - "jobs", - params._pathParam(0), - "results", - ) - .build() - .prepareAsync(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - return request - .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } - .thenApply { response -> - errorHandler.handle(response).parseable { - response - .use { getResultsHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - } } } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/classifier/JobService.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/classifier/JobService.kt index 24e2e83..a7e2b13 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/classifier/JobService.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/classifier/JobService.kt @@ -3,16 +3,6 @@ package ai.llamaindex.llamacloud.services.blocking.classifier import ai.llamaindex.llamacloud.core.ClientOptions -import ai.llamaindex.llamacloud.core.RequestOptions -import ai.llamaindex.llamacloud.core.http.HttpResponseFor -import ai.llamaindex.llamacloud.models.classifier.jobs.ClassifyJob -import ai.llamaindex.llamacloud.models.classifier.jobs.JobCreateParams -import ai.llamaindex.llamacloud.models.classifier.jobs.JobGetParams -import ai.llamaindex.llamacloud.models.classifier.jobs.JobGetResultsParams -import ai.llamaindex.llamacloud.models.classifier.jobs.JobGetResultsResponse -import ai.llamaindex.llamacloud.models.classifier.jobs.JobListPage -import ai.llamaindex.llamacloud.models.classifier.jobs.JobListParams -import com.google.errorprone.annotations.MustBeClosed import java.util.function.Consumer interface JobService { @@ -29,111 +19,6 @@ interface JobService { */ fun withOptions(modifier: Consumer): JobService - /** Create a classify job. Experimental: not production-ready and subject to change. */ - @Deprecated("Please use `client.classify.create()`") - fun create(params: JobCreateParams): ClassifyJob = create(params, RequestOptions.none()) - - /** @see create */ - @Deprecated("Please use `client.classify.create()`") - fun create( - params: JobCreateParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): ClassifyJob - - /** List classify jobs. Experimental: not production-ready and subject to change. */ - @Deprecated("Please use `client.classify.list()`") - fun list(): JobListPage = list(JobListParams.none()) - - /** @see list */ - @Deprecated("Please use `client.classify.list()`") - fun list( - params: JobListParams = JobListParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): JobListPage - - /** @see list */ - @Deprecated("Please use `client.classify.list()`") - fun list(params: JobListParams = JobListParams.none()): JobListPage = - list(params, RequestOptions.none()) - - /** @see list */ - @Deprecated("Please use `client.classify.list()`") - fun list(requestOptions: RequestOptions): JobListPage = - list(JobListParams.none(), requestOptions) - - /** Get a classify job. Experimental: not production-ready and subject to change. */ - @Deprecated("Please use `client.classify.get()`") - fun get(classifyJobId: String): ClassifyJob = get(classifyJobId, JobGetParams.none()) - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - fun get( - classifyJobId: String, - params: JobGetParams = JobGetParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): ClassifyJob = get(params.toBuilder().classifyJobId(classifyJobId).build(), requestOptions) - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - fun get(classifyJobId: String, params: JobGetParams = JobGetParams.none()): ClassifyJob = - get(classifyJobId, params, RequestOptions.none()) - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - fun get( - params: JobGetParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): ClassifyJob - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - fun get(params: JobGetParams): ClassifyJob = get(params, RequestOptions.none()) - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - fun get(classifyJobId: String, requestOptions: RequestOptions): ClassifyJob = - get(classifyJobId, JobGetParams.none(), requestOptions) - - /** - * Get the results of a classify job. Experimental: not production-ready and subject to change. - */ - @Deprecated("Please use `client.classify.get()`") - fun getResults(classifyJobId: String): JobGetResultsResponse = - getResults(classifyJobId, JobGetResultsParams.none()) - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - fun getResults( - classifyJobId: String, - params: JobGetResultsParams = JobGetResultsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): JobGetResultsResponse = - getResults(params.toBuilder().classifyJobId(classifyJobId).build(), requestOptions) - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - fun getResults( - classifyJobId: String, - params: JobGetResultsParams = JobGetResultsParams.none(), - ): JobGetResultsResponse = getResults(classifyJobId, params, RequestOptions.none()) - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - fun getResults( - params: JobGetResultsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): JobGetResultsResponse - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - fun getResults(params: JobGetResultsParams): JobGetResultsResponse = - getResults(params, RequestOptions.none()) - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - fun getResults(classifyJobId: String, requestOptions: RequestOptions): JobGetResultsResponse = - getResults(classifyJobId, JobGetResultsParams.none(), requestOptions) - /** A view of [JobService] that provides access to raw HTTP responses for each method. */ interface WithRawResponse { @@ -143,150 +28,5 @@ interface JobService { * The original service is not modified. */ fun withOptions(modifier: Consumer): JobService.WithRawResponse - - /** - * Returns a raw HTTP response for `post /api/v1/classifier/jobs`, but is otherwise the same - * as [JobService.create]. - */ - @Deprecated("Please use `client.classify.create()`") - @MustBeClosed - fun create(params: JobCreateParams): HttpResponseFor = - create(params, RequestOptions.none()) - - /** @see create */ - @Deprecated("Please use `client.classify.create()`") - @MustBeClosed - fun create( - params: JobCreateParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** - * Returns a raw HTTP response for `get /api/v1/classifier/jobs`, but is otherwise the same - * as [JobService.list]. - */ - @Deprecated("Please use `client.classify.list()`") - @MustBeClosed - fun list(): HttpResponseFor = list(JobListParams.none()) - - /** @see list */ - @Deprecated("Please use `client.classify.list()`") - @MustBeClosed - fun list( - params: JobListParams = JobListParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see list */ - @Deprecated("Please use `client.classify.list()`") - @MustBeClosed - fun list(params: JobListParams = JobListParams.none()): HttpResponseFor = - list(params, RequestOptions.none()) - - /** @see list */ - @Deprecated("Please use `client.classify.list()`") - @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = - list(JobListParams.none(), requestOptions) - - /** - * Returns a raw HTTP response for `get /api/v1/classifier/jobs/{classify_job_id}`, but is - * otherwise the same as [JobService.get]. - */ - @Deprecated("Please use `client.classify.get()`") - @MustBeClosed - fun get(classifyJobId: String): HttpResponseFor = - get(classifyJobId, JobGetParams.none()) - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - @MustBeClosed - fun get( - classifyJobId: String, - params: JobGetParams = JobGetParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - get(params.toBuilder().classifyJobId(classifyJobId).build(), requestOptions) - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - @MustBeClosed - fun get( - classifyJobId: String, - params: JobGetParams = JobGetParams.none(), - ): HttpResponseFor = get(classifyJobId, params, RequestOptions.none()) - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - @MustBeClosed - fun get( - params: JobGetParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - @MustBeClosed - fun get(params: JobGetParams): HttpResponseFor = - get(params, RequestOptions.none()) - - /** @see get */ - @Deprecated("Please use `client.classify.get()`") - @MustBeClosed - fun get( - classifyJobId: String, - requestOptions: RequestOptions, - ): HttpResponseFor = get(classifyJobId, JobGetParams.none(), requestOptions) - - /** - * Returns a raw HTTP response for `get /api/v1/classifier/jobs/{classify_job_id}/results`, - * but is otherwise the same as [JobService.getResults]. - */ - @Deprecated("Please use `client.classify.get()`") - @MustBeClosed - fun getResults(classifyJobId: String): HttpResponseFor = - getResults(classifyJobId, JobGetResultsParams.none()) - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - @MustBeClosed - fun getResults( - classifyJobId: String, - params: JobGetResultsParams = JobGetResultsParams.none(), - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor = - getResults(params.toBuilder().classifyJobId(classifyJobId).build(), requestOptions) - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - @MustBeClosed - fun getResults( - classifyJobId: String, - params: JobGetResultsParams = JobGetResultsParams.none(), - ): HttpResponseFor = - getResults(classifyJobId, params, RequestOptions.none()) - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - @MustBeClosed - fun getResults( - params: JobGetResultsParams, - requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - @MustBeClosed - fun getResults(params: JobGetResultsParams): HttpResponseFor = - getResults(params, RequestOptions.none()) - - /** @see getResults */ - @Deprecated("Please use `client.classify.get()`") - @MustBeClosed - fun getResults( - classifyJobId: String, - requestOptions: RequestOptions, - ): HttpResponseFor = - getResults(classifyJobId, JobGetResultsParams.none(), requestOptions) } } diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/classifier/JobServiceImpl.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/classifier/JobServiceImpl.kt index e112387..04e2ef3 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/classifier/JobServiceImpl.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/classifier/JobServiceImpl.kt @@ -3,29 +3,7 @@ package ai.llamaindex.llamacloud.services.blocking.classifier import ai.llamaindex.llamacloud.core.ClientOptions -import ai.llamaindex.llamacloud.core.RequestOptions -import ai.llamaindex.llamacloud.core.checkRequired -import ai.llamaindex.llamacloud.core.handlers.errorBodyHandler -import ai.llamaindex.llamacloud.core.handlers.errorHandler -import ai.llamaindex.llamacloud.core.handlers.jsonHandler -import ai.llamaindex.llamacloud.core.http.HttpMethod -import ai.llamaindex.llamacloud.core.http.HttpRequest -import ai.llamaindex.llamacloud.core.http.HttpResponse -import ai.llamaindex.llamacloud.core.http.HttpResponse.Handler -import ai.llamaindex.llamacloud.core.http.HttpResponseFor -import ai.llamaindex.llamacloud.core.http.json -import ai.llamaindex.llamacloud.core.http.parseable -import ai.llamaindex.llamacloud.core.prepare -import ai.llamaindex.llamacloud.models.classifier.jobs.ClassifyJob -import ai.llamaindex.llamacloud.models.classifier.jobs.JobCreateParams -import ai.llamaindex.llamacloud.models.classifier.jobs.JobGetParams -import ai.llamaindex.llamacloud.models.classifier.jobs.JobGetResultsParams -import ai.llamaindex.llamacloud.models.classifier.jobs.JobGetResultsResponse -import ai.llamaindex.llamacloud.models.classifier.jobs.JobListPage -import ai.llamaindex.llamacloud.models.classifier.jobs.JobListPageResponse -import ai.llamaindex.llamacloud.models.classifier.jobs.JobListParams import java.util.function.Consumer -import kotlin.jvm.optionals.getOrNull class JobServiceImpl internal constructor(private val clientOptions: ClientOptions) : JobService { @@ -38,173 +16,14 @@ class JobServiceImpl internal constructor(private val clientOptions: ClientOptio override fun withOptions(modifier: Consumer): JobService = JobServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - @Deprecated("Please use `client.classify.create()`") - override fun create(params: JobCreateParams, requestOptions: RequestOptions): ClassifyJob = - // post /api/v1/classifier/jobs - withRawResponse().create(params, requestOptions).parse() - - @Deprecated("Please use `client.classify.list()`") - override fun list(params: JobListParams, requestOptions: RequestOptions): JobListPage = - // get /api/v1/classifier/jobs - withRawResponse().list(params, requestOptions).parse() - - @Deprecated("Please use `client.classify.get()`") - override fun get(params: JobGetParams, requestOptions: RequestOptions): ClassifyJob = - // get /api/v1/classifier/jobs/{classify_job_id} - withRawResponse().get(params, requestOptions).parse() - - @Deprecated("Please use `client.classify.get()`") - override fun getResults( - params: JobGetResultsParams, - requestOptions: RequestOptions, - ): JobGetResultsResponse = - // get /api/v1/classifier/jobs/{classify_job_id}/results - withRawResponse().getResults(params, requestOptions).parse() - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : JobService.WithRawResponse { - private val errorHandler: Handler = - errorHandler(errorBodyHandler(clientOptions.jsonMapper)) - override fun withOptions( modifier: Consumer ): JobService.WithRawResponse = JobServiceImpl.WithRawResponseImpl( clientOptions.toBuilder().apply(modifier::accept).build() ) - - private val createHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - @Deprecated("Please use `client.classify.create()`") - override fun create( - params: JobCreateParams, - requestOptions: RequestOptions, - ): HttpResponseFor { - val request = - HttpRequest.builder() - .method(HttpMethod.POST) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("api", "v1", "classifier", "jobs") - .body(json(clientOptions.jsonMapper, params._body())) - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return errorHandler.handle(response).parseable { - response - .use { createHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - @Deprecated("Please use `client.classify.list()`") - override fun list( - params: JobListParams, - requestOptions: RequestOptions, - ): HttpResponseFor { - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("api", "v1", "classifier", "jobs") - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return errorHandler.handle(response).parseable { - response - .use { listHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - .let { - JobListPage.builder() - .service(JobServiceImpl(clientOptions)) - .params(params) - .response(it) - .build() - } - } - } - - private val getHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - @Deprecated("Please use `client.classify.get()`") - override fun get( - params: JobGetParams, - requestOptions: RequestOptions, - ): HttpResponseFor { - // We check here instead of in the params builder because this can be specified - // positionally or in the params class. - checkRequired("classifyJobId", params.classifyJobId().getOrNull()) - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments("api", "v1", "classifier", "jobs", params._pathParam(0)) - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return errorHandler.handle(response).parseable { - response - .use { getHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } - - private val getResultsHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - - @Deprecated("Please use `client.classify.get()`") - override fun getResults( - params: JobGetResultsParams, - requestOptions: RequestOptions, - ): HttpResponseFor { - // We check here instead of in the params builder because this can be specified - // positionally or in the params class. - checkRequired("classifyJobId", params.classifyJobId().getOrNull()) - val request = - HttpRequest.builder() - .method(HttpMethod.GET) - .baseUrl(clientOptions.baseUrl()) - .addPathSegments( - "api", - "v1", - "classifier", - "jobs", - params._pathParam(0), - "results", - ) - .build() - .prepare(clientOptions, params) - val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) - val response = clientOptions.httpClient.execute(request, requestOptions) - return errorHandler.handle(response).parseable { - response - .use { getResultsHandler.handle(it) } - .also { - if (requestOptions.responseValidation!!) { - it.validate() - } - } - } - } } } diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobCreateParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobCreateParamsTest.kt deleted file mode 100644 index 40c743b..0000000 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobCreateParamsTest.kt +++ /dev/null @@ -1,222 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.models.classifier.jobs - -import ai.llamaindex.llamacloud.core.JsonValue -import ai.llamaindex.llamacloud.core.http.QueryParams -import ai.llamaindex.llamacloud.models.parsing.ParsingLanguages -import kotlin.jvm.optionals.getOrNull -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class JobCreateParamsTest { - - @Test - fun create() { - JobCreateParams.builder() - .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .addFileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .addRule( - ClassifierRule.builder() - .description("contains invoice number, line items, and total amount") - .type("invoice") - .build() - ) - .mode(JobCreateParams.Mode.FAST) - .parsingConfiguration( - ClassifyParsingConfiguration.builder() - .lang(ParsingLanguages.ABQ) - .maxPages(0L) - .addTargetPage(0L) - .build() - ) - .addWebhookConfiguration( - JobCreateParams.WebhookConfiguration.builder() - .addWebhookEvent("parse.success") - .addWebhookEvent("parse.error") - .webhookHeaders( - JobCreateParams.WebhookConfiguration.WebhookHeaders.builder() - .putAdditionalProperty("foo", JsonValue.from("bar")) - .build() - ) - .webhookOutputFormat( - JobCreateParams.WebhookConfiguration.WebhookOutputFormat.JSON - ) - .webhookSigningSecret("webhook_signing_secret") - .webhookUrl("https:") - .build() - ) - .build() - } - - @Test - fun queryParams() { - val params = - JobCreateParams.builder() - .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .addFileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .addRule( - ClassifierRule.builder() - .description("contains invoice number, line items, and total amount") - .type("invoice") - .build() - ) - .mode(JobCreateParams.Mode.FAST) - .parsingConfiguration( - ClassifyParsingConfiguration.builder() - .lang(ParsingLanguages.ABQ) - .maxPages(0L) - .addTargetPage(0L) - .build() - ) - .addWebhookConfiguration( - JobCreateParams.WebhookConfiguration.builder() - .addWebhookEvent("parse.success") - .addWebhookEvent("parse.error") - .webhookHeaders( - JobCreateParams.WebhookConfiguration.WebhookHeaders.builder() - .putAdditionalProperty("foo", JsonValue.from("bar")) - .build() - ) - .webhookOutputFormat( - JobCreateParams.WebhookConfiguration.WebhookOutputFormat.JSON - ) - .webhookSigningSecret("webhook_signing_secret") - .webhookUrl("https:") - .build() - ) - .build() - - val queryParams = params._queryParams() - - assertThat(queryParams) - .isEqualTo( - QueryParams.builder() - .put("organization_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - } - - @Test - fun queryParamsWithoutOptionalFields() { - val params = - JobCreateParams.builder() - .addFileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .addRule( - ClassifierRule.builder() - .description("contains invoice number, line items, and total amount") - .type("invoice") - .build() - ) - .build() - - val queryParams = params._queryParams() - - assertThat(queryParams).isEqualTo(QueryParams.builder().build()) - } - - @Test - fun body() { - val params = - JobCreateParams.builder() - .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .addFileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .addRule( - ClassifierRule.builder() - .description("contains invoice number, line items, and total amount") - .type("invoice") - .build() - ) - .mode(JobCreateParams.Mode.FAST) - .parsingConfiguration( - ClassifyParsingConfiguration.builder() - .lang(ParsingLanguages.ABQ) - .maxPages(0L) - .addTargetPage(0L) - .build() - ) - .addWebhookConfiguration( - JobCreateParams.WebhookConfiguration.builder() - .addWebhookEvent("parse.success") - .addWebhookEvent("parse.error") - .webhookHeaders( - JobCreateParams.WebhookConfiguration.WebhookHeaders.builder() - .putAdditionalProperty("foo", JsonValue.from("bar")) - .build() - ) - .webhookOutputFormat( - JobCreateParams.WebhookConfiguration.WebhookOutputFormat.JSON - ) - .webhookSigningSecret("webhook_signing_secret") - .webhookUrl("https:") - .build() - ) - .build() - - val body = params._body() - - assertThat(body.fileIds()).containsExactly("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - assertThat(body.rules()) - .containsExactly( - ClassifierRule.builder() - .description("contains invoice number, line items, and total amount") - .type("invoice") - .build() - ) - assertThat(body.mode()).contains(JobCreateParams.Mode.FAST) - assertThat(body.parsingConfiguration()) - .contains( - ClassifyParsingConfiguration.builder() - .lang(ParsingLanguages.ABQ) - .maxPages(0L) - .addTargetPage(0L) - .build() - ) - assertThat(body.webhookConfigurations().getOrNull()) - .containsExactly( - JobCreateParams.WebhookConfiguration.builder() - .addWebhookEvent("parse.success") - .addWebhookEvent("parse.error") - .webhookHeaders( - JobCreateParams.WebhookConfiguration.WebhookHeaders.builder() - .putAdditionalProperty("foo", JsonValue.from("bar")) - .build() - ) - .webhookOutputFormat( - JobCreateParams.WebhookConfiguration.WebhookOutputFormat.JSON - ) - .webhookSigningSecret("webhook_signing_secret") - .webhookUrl("https:") - .build() - ) - } - - @Test - fun bodyWithoutOptionalFields() { - val params = - JobCreateParams.builder() - .addFileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .addRule( - ClassifierRule.builder() - .description("contains invoice number, line items, and total amount") - .type("invoice") - .build() - ) - .build() - - val body = params._body() - - assertThat(body.fileIds()).containsExactly("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - assertThat(body.rules()) - .containsExactly( - ClassifierRule.builder() - .description("contains invoice number, line items, and total amount") - .type("invoice") - .build() - ) - } -} diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetParamsTest.kt deleted file mode 100644 index 893ff47..0000000 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetParamsTest.kt +++ /dev/null @@ -1,59 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.models.classifier.jobs - -import ai.llamaindex.llamacloud.core.http.QueryParams -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class JobGetParamsTest { - - @Test - fun create() { - JobGetParams.builder() - .classifyJobId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - } - - @Test - fun pathParams() { - val params = - JobGetParams.builder().classifyJobId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() - - assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - // out-of-bound path param - assertThat(params._pathParam(1)).isEqualTo("") - } - - @Test - fun queryParams() { - val params = - JobGetParams.builder() - .classifyJobId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - - val queryParams = params._queryParams() - - assertThat(queryParams) - .isEqualTo( - QueryParams.builder() - .put("organization_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - } - - @Test - fun queryParamsWithoutOptionalFields() { - val params = - JobGetParams.builder().classifyJobId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e").build() - - val queryParams = params._queryParams() - - assertThat(queryParams).isEqualTo(QueryParams.builder().build()) - } -} diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetResultsParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetResultsParamsTest.kt deleted file mode 100644 index dc09ce5..0000000 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetResultsParamsTest.kt +++ /dev/null @@ -1,63 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.models.classifier.jobs - -import ai.llamaindex.llamacloud.core.http.QueryParams -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class JobGetResultsParamsTest { - - @Test - fun create() { - JobGetResultsParams.builder() - .classifyJobId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - } - - @Test - fun pathParams() { - val params = - JobGetResultsParams.builder() - .classifyJobId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - - assertThat(params._pathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - // out-of-bound path param - assertThat(params._pathParam(1)).isEqualTo("") - } - - @Test - fun queryParams() { - val params = - JobGetResultsParams.builder() - .classifyJobId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - - val queryParams = params._queryParams() - - assertThat(queryParams) - .isEqualTo( - QueryParams.builder() - .put("organization_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - } - - @Test - fun queryParamsWithoutOptionalFields() { - val params = - JobGetResultsParams.builder() - .classifyJobId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - - val queryParams = params._queryParams() - - assertThat(queryParams).isEqualTo(QueryParams.builder().build()) - } -} diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetResultsResponseTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetResultsResponseTest.kt deleted file mode 100644 index 8e55a03..0000000 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobGetResultsResponseTest.kt +++ /dev/null @@ -1,91 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.models.classifier.jobs - -import ai.llamaindex.llamacloud.core.jsonMapper -import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import java.time.OffsetDateTime -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class JobGetResultsResponseTest { - - @Test - fun create() { - val jobGetResultsResponse = - JobGetResultsResponse.builder() - .addItem( - JobGetResultsResponse.Item.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .classifyJobId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .result( - JobGetResultsResponse.Item.Result.builder() - .confidence(0.0) - .reasoning("reasoning") - .type("type") - .build() - ) - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .nextPageToken("next_page_token") - .totalSize(0L) - .build() - - assertThat(jobGetResultsResponse.items()) - .containsExactly( - JobGetResultsResponse.Item.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .classifyJobId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .result( - JobGetResultsResponse.Item.Result.builder() - .confidence(0.0) - .reasoning("reasoning") - .type("type") - .build() - ) - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - assertThat(jobGetResultsResponse.nextPageToken()).contains("next_page_token") - assertThat(jobGetResultsResponse.totalSize()).contains(0L) - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val jobGetResultsResponse = - JobGetResultsResponse.builder() - .addItem( - JobGetResultsResponse.Item.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .classifyJobId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .fileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .result( - JobGetResultsResponse.Item.Result.builder() - .confidence(0.0) - .reasoning("reasoning") - .type("type") - .build() - ) - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .nextPageToken("next_page_token") - .totalSize(0L) - .build() - - val roundtrippedJobGetResultsResponse = - jsonMapper.readValue( - jsonMapper.writeValueAsString(jobGetResultsResponse), - jacksonTypeRef(), - ) - - assertThat(roundtrippedJobGetResultsResponse).isEqualTo(jobGetResultsResponse) - } -} diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListPageResponseTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListPageResponseTest.kt deleted file mode 100644 index 4e3f6cc..0000000 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListPageResponseTest.kt +++ /dev/null @@ -1,130 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.models.classifier.jobs - -import ai.llamaindex.llamacloud.core.jsonMapper -import ai.llamaindex.llamacloud.models.parsing.ParsingLanguages -import ai.llamaindex.llamacloud.models.parsing.StatusEnum -import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import java.time.OffsetDateTime -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class JobListPageResponseTest { - - @Test - fun create() { - val jobListPageResponse = - JobListPageResponse.builder() - .addItem( - ClassifyJob.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .addRule( - ClassifierRule.builder() - .description( - "contains invoice number, line items, and total amount" - ) - .type("invoice") - .build() - ) - .status(StatusEnum.CANCELLED) - .userId("user_id") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .effectiveAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .errorMessage("error_message") - .jobRecordId("job_record_id") - .mode(ClassifyJob.Mode.FAST) - .parsingConfiguration( - ClassifyParsingConfiguration.builder() - .lang(ParsingLanguages.ABQ) - .maxPages(0L) - .addTargetPage(0L) - .build() - ) - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .nextPageToken("next_page_token") - .totalSize(0L) - .build() - - assertThat(jobListPageResponse.items()) - .containsExactly( - ClassifyJob.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .addRule( - ClassifierRule.builder() - .description("contains invoice number, line items, and total amount") - .type("invoice") - .build() - ) - .status(StatusEnum.CANCELLED) - .userId("user_id") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .effectiveAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .errorMessage("error_message") - .jobRecordId("job_record_id") - .mode(ClassifyJob.Mode.FAST) - .parsingConfiguration( - ClassifyParsingConfiguration.builder() - .lang(ParsingLanguages.ABQ) - .maxPages(0L) - .addTargetPage(0L) - .build() - ) - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - assertThat(jobListPageResponse.nextPageToken()).contains("next_page_token") - assertThat(jobListPageResponse.totalSize()).contains(0L) - } - - @Test - fun roundtrip() { - val jsonMapper = jsonMapper() - val jobListPageResponse = - JobListPageResponse.builder() - .addItem( - ClassifyJob.builder() - .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .addRule( - ClassifierRule.builder() - .description( - "contains invoice number, line items, and total amount" - ) - .type("invoice") - .build() - ) - .status(StatusEnum.CANCELLED) - .userId("user_id") - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .effectiveAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .errorMessage("error_message") - .jobRecordId("job_record_id") - .mode(ClassifyJob.Mode.FAST) - .parsingConfiguration( - ClassifyParsingConfiguration.builder() - .lang(ParsingLanguages.ABQ) - .maxPages(0L) - .addTargetPage(0L) - .build() - ) - .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .nextPageToken("next_page_token") - .totalSize(0L) - .build() - - val roundtrippedJobListPageResponse = - jsonMapper.readValue( - jsonMapper.writeValueAsString(jobListPageResponse), - jacksonTypeRef(), - ) - - assertThat(roundtrippedJobListPageResponse).isEqualTo(jobListPageResponse) - } -} diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListParamsTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListParamsTest.kt deleted file mode 100644 index 3c7dd2a..0000000 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/models/classifier/jobs/JobListParamsTest.kt +++ /dev/null @@ -1,52 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.models.classifier.jobs - -import ai.llamaindex.llamacloud.core.http.QueryParams -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -internal class JobListParamsTest { - - @Test - fun create() { - JobListParams.builder() - .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pageSize(0L) - .pageToken("page_token") - .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - } - - @Test - fun queryParams() { - val params = - JobListParams.builder() - .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .pageSize(0L) - .pageToken("page_token") - .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - - val queryParams = params._queryParams() - - assertThat(queryParams) - .isEqualTo( - QueryParams.builder() - .put("organization_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .put("page_size", "0") - .put("page_token", "page_token") - .put("project_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - } - - @Test - fun queryParamsWithoutOptionalFields() { - val params = JobListParams.builder().build() - - val queryParams = params._queryParams() - - assertThat(queryParams).isEqualTo(QueryParams.builder().build()) - } -} diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/classifier/JobServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/classifier/JobServiceAsyncTest.kt deleted file mode 100644 index 10a1af3..0000000 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/async/classifier/JobServiceAsyncTest.kt +++ /dev/null @@ -1,116 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.services.async.classifier - -import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClientAsync -import ai.llamaindex.llamacloud.core.JsonValue -import ai.llamaindex.llamacloud.models.classifier.jobs.ClassifierRule -import ai.llamaindex.llamacloud.models.classifier.jobs.ClassifyParsingConfiguration -import ai.llamaindex.llamacloud.models.classifier.jobs.JobCreateParams -import ai.llamaindex.llamacloud.models.classifier.jobs.JobGetParams -import ai.llamaindex.llamacloud.models.classifier.jobs.JobGetResultsParams -import ai.llamaindex.llamacloud.models.parsing.ParsingLanguages -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class JobServiceAsyncTest { - - @Disabled("Mock server tests are disabled") - @Test - fun create() { - val client = LlamaCloudOkHttpClientAsync.builder().apiKey("My API Key").build() - val jobServiceAsync = client.classifier().jobs() - - val classifyJobFuture = - jobServiceAsync.create( - JobCreateParams.builder() - .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .addFileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .addRule( - ClassifierRule.builder() - .description("contains invoice number, line items, and total amount") - .type("invoice") - .build() - ) - .mode(JobCreateParams.Mode.FAST) - .parsingConfiguration( - ClassifyParsingConfiguration.builder() - .lang(ParsingLanguages.ABQ) - .maxPages(0L) - .addTargetPage(0L) - .build() - ) - .addWebhookConfiguration( - JobCreateParams.WebhookConfiguration.builder() - .addWebhookEvent("parse.success") - .addWebhookEvent("parse.error") - .webhookHeaders( - JobCreateParams.WebhookConfiguration.WebhookHeaders.builder() - .putAdditionalProperty("foo", JsonValue.from("bar")) - .build() - ) - .webhookOutputFormat( - JobCreateParams.WebhookConfiguration.WebhookOutputFormat.JSON - ) - .webhookSigningSecret("webhook_signing_secret") - .webhookUrl("https:") - .build() - ) - .build() - ) - - val classifyJob = classifyJobFuture.get() - classifyJob.validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun list() { - val client = LlamaCloudOkHttpClientAsync.builder().apiKey("My API Key").build() - val jobServiceAsync = client.classifier().jobs() - - val pageFuture = jobServiceAsync.list() - - val page = pageFuture.get() - page.response().validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun get() { - val client = LlamaCloudOkHttpClientAsync.builder().apiKey("My API Key").build() - val jobServiceAsync = client.classifier().jobs() - - val classifyJobFuture = - jobServiceAsync.get( - JobGetParams.builder() - .classifyJobId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - - val classifyJob = classifyJobFuture.get() - classifyJob.validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun getResults() { - val client = LlamaCloudOkHttpClientAsync.builder().apiKey("My API Key").build() - val jobServiceAsync = client.classifier().jobs() - - val responseFuture = - jobServiceAsync.getResults( - JobGetResultsParams.builder() - .classifyJobId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - - val response = responseFuture.get() - response.validate() - } -} diff --git a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/classifier/JobServiceTest.kt b/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/classifier/JobServiceTest.kt deleted file mode 100644 index 1e729ee..0000000 --- a/llama-cloud-core/src/test/kotlin/ai/llamaindex/llamacloud/services/blocking/classifier/JobServiceTest.kt +++ /dev/null @@ -1,112 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.services.blocking.classifier - -import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient -import ai.llamaindex.llamacloud.core.JsonValue -import ai.llamaindex.llamacloud.models.classifier.jobs.ClassifierRule -import ai.llamaindex.llamacloud.models.classifier.jobs.ClassifyParsingConfiguration -import ai.llamaindex.llamacloud.models.classifier.jobs.JobCreateParams -import ai.llamaindex.llamacloud.models.classifier.jobs.JobGetParams -import ai.llamaindex.llamacloud.models.classifier.jobs.JobGetResultsParams -import ai.llamaindex.llamacloud.models.parsing.ParsingLanguages -import org.junit.jupiter.api.Disabled -import org.junit.jupiter.api.Test - -internal class JobServiceTest { - - @Disabled("Mock server tests are disabled") - @Test - fun create() { - val client = LlamaCloudOkHttpClient.builder().apiKey("My API Key").build() - val jobService = client.classifier().jobs() - - val classifyJob = - jobService.create( - JobCreateParams.builder() - .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .addFileId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .addRule( - ClassifierRule.builder() - .description("contains invoice number, line items, and total amount") - .type("invoice") - .build() - ) - .mode(JobCreateParams.Mode.FAST) - .parsingConfiguration( - ClassifyParsingConfiguration.builder() - .lang(ParsingLanguages.ABQ) - .maxPages(0L) - .addTargetPage(0L) - .build() - ) - .addWebhookConfiguration( - JobCreateParams.WebhookConfiguration.builder() - .addWebhookEvent("parse.success") - .addWebhookEvent("parse.error") - .webhookHeaders( - JobCreateParams.WebhookConfiguration.WebhookHeaders.builder() - .putAdditionalProperty("foo", JsonValue.from("bar")) - .build() - ) - .webhookOutputFormat( - JobCreateParams.WebhookConfiguration.WebhookOutputFormat.JSON - ) - .webhookSigningSecret("webhook_signing_secret") - .webhookUrl("https:") - .build() - ) - .build() - ) - - classifyJob.validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun list() { - val client = LlamaCloudOkHttpClient.builder().apiKey("My API Key").build() - val jobService = client.classifier().jobs() - - val page = jobService.list() - - page.response().validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun get() { - val client = LlamaCloudOkHttpClient.builder().apiKey("My API Key").build() - val jobService = client.classifier().jobs() - - val classifyJob = - jobService.get( - JobGetParams.builder() - .classifyJobId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - - classifyJob.validate() - } - - @Disabled("Mock server tests are disabled") - @Test - fun getResults() { - val client = LlamaCloudOkHttpClient.builder().apiKey("My API Key").build() - val jobService = client.classifier().jobs() - - val response = - jobService.getResults( - JobGetResultsParams.builder() - .classifyJobId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .organizationId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .build() - ) - - response.validate() - } -} From f7c83a165c67821e2ab5719dd7c4d91a06269ed9 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Tue, 1 Sep 2026 00:43:23 +0000 Subject: [PATCH 11/11] LI-9329: drop the retired Sheets resources and the stale Verify withholding Stainless-Generated-From: 0b3961b7f2af102ce6fed6f8a770946985e55145 --- .../llamacloud/client/LlamaCloudClient.kt | 5 --- .../client/LlamaCloudClientAsync.kt | 5 --- .../client/LlamaCloudClientAsyncImpl.kt | 14 -------- .../llamacloud/client/LlamaCloudClientImpl.kt | 12 ------- .../services/async/BetaServiceAsync.kt | 5 --- .../services/async/BetaServiceAsyncImpl.kt | 12 ------- .../services/async/SheetServiceAsync.kt | 34 ------------------- .../services/async/SheetServiceAsyncImpl.kt | 30 ---------------- .../services/async/beta/SheetServiceAsync.kt | 34 ------------------- .../async/beta/SheetServiceAsyncImpl.kt | 30 ---------------- .../services/blocking/BetaService.kt | 5 --- .../services/blocking/BetaServiceImpl.kt | 12 ------- .../services/blocking/SheetService.kt | 32 ----------------- .../services/blocking/SheetServiceImpl.kt | 30 ---------------- .../services/blocking/beta/SheetService.kt | 32 ----------------- .../blocking/beta/SheetServiceImpl.kt | 30 ---------------- .../proguard/ProGuardCompatibilityTest.kt | 1 - 17 files changed, 323 deletions(-) delete mode 100644 llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/SheetServiceAsync.kt delete mode 100644 llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/SheetServiceAsyncImpl.kt delete mode 100644 llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/beta/SheetServiceAsync.kt delete mode 100644 llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/beta/SheetServiceAsyncImpl.kt delete mode 100644 llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/SheetService.kt delete mode 100644 llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/SheetServiceImpl.kt delete mode 100644 llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/beta/SheetService.kt delete mode 100644 llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/beta/SheetServiceImpl.kt diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/client/LlamaCloudClient.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/client/LlamaCloudClient.kt index 77ad4dd..529b30f 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/client/LlamaCloudClient.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/client/LlamaCloudClient.kt @@ -17,7 +17,6 @@ import ai.llamaindex.llamacloud.services.blocking.ParsingService import ai.llamaindex.llamacloud.services.blocking.PipelineService import ai.llamaindex.llamacloud.services.blocking.ProjectService import ai.llamaindex.llamacloud.services.blocking.RetrieverService -import ai.llamaindex.llamacloud.services.blocking.SheetService import ai.llamaindex.llamacloud.services.blocking.SplitService import ai.llamaindex.llamacloud.services.blocking.V2ProjectService import ai.llamaindex.llamacloud.services.blocking.WebhookConfigService @@ -61,8 +60,6 @@ interface LlamaCloudClient { fun files(): FileService - fun sheets(): SheetService - fun split(): SplitService fun parsing(): ParsingService @@ -120,8 +117,6 @@ interface LlamaCloudClient { fun files(): FileService.WithRawResponse - fun sheets(): SheetService.WithRawResponse - fun split(): SplitService.WithRawResponse fun parsing(): ParsingService.WithRawResponse diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/client/LlamaCloudClientAsync.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/client/LlamaCloudClientAsync.kt index a8d90c0..3089c92 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/client/LlamaCloudClientAsync.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/client/LlamaCloudClientAsync.kt @@ -17,7 +17,6 @@ import ai.llamaindex.llamacloud.services.async.ParsingServiceAsync import ai.llamaindex.llamacloud.services.async.PipelineServiceAsync import ai.llamaindex.llamacloud.services.async.ProjectServiceAsync import ai.llamaindex.llamacloud.services.async.RetrieverServiceAsync -import ai.llamaindex.llamacloud.services.async.SheetServiceAsync import ai.llamaindex.llamacloud.services.async.SplitServiceAsync import ai.llamaindex.llamacloud.services.async.V2ProjectServiceAsync import ai.llamaindex.llamacloud.services.async.WebhookConfigServiceAsync @@ -61,8 +60,6 @@ interface LlamaCloudClientAsync { fun files(): FileServiceAsync - fun sheets(): SheetServiceAsync - fun split(): SplitServiceAsync fun parsing(): ParsingServiceAsync @@ -124,8 +121,6 @@ interface LlamaCloudClientAsync { fun files(): FileServiceAsync.WithRawResponse - fun sheets(): SheetServiceAsync.WithRawResponse - fun split(): SplitServiceAsync.WithRawResponse fun parsing(): ParsingServiceAsync.WithRawResponse diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/client/LlamaCloudClientAsyncImpl.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/client/LlamaCloudClientAsyncImpl.kt index 2cf79cd..ffb71a2 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/client/LlamaCloudClientAsyncImpl.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/client/LlamaCloudClientAsyncImpl.kt @@ -32,8 +32,6 @@ import ai.llamaindex.llamacloud.services.async.ProjectServiceAsync import ai.llamaindex.llamacloud.services.async.ProjectServiceAsyncImpl import ai.llamaindex.llamacloud.services.async.RetrieverServiceAsync import ai.llamaindex.llamacloud.services.async.RetrieverServiceAsyncImpl -import ai.llamaindex.llamacloud.services.async.SheetServiceAsync -import ai.llamaindex.llamacloud.services.async.SheetServiceAsyncImpl import ai.llamaindex.llamacloud.services.async.SplitServiceAsync import ai.llamaindex.llamacloud.services.async.SplitServiceAsyncImpl import ai.llamaindex.llamacloud.services.async.V2ProjectServiceAsync @@ -61,10 +59,6 @@ class LlamaCloudClientAsyncImpl(private val clientOptions: ClientOptions) : Llam private val files: FileServiceAsync by lazy { FileServiceAsyncImpl(clientOptionsWithUserAgent) } - private val sheets: SheetServiceAsync by lazy { - SheetServiceAsyncImpl(clientOptionsWithUserAgent) - } - private val split: SplitServiceAsync by lazy { SplitServiceAsyncImpl(clientOptionsWithUserAgent) } @@ -136,8 +130,6 @@ class LlamaCloudClientAsyncImpl(private val clientOptions: ClientOptions) : Llam override fun files(): FileServiceAsync = files - override fun sheets(): SheetServiceAsync = sheets - override fun split(): SplitServiceAsync = split override fun parsing(): ParsingServiceAsync = parsing @@ -179,10 +171,6 @@ class LlamaCloudClientAsyncImpl(private val clientOptions: ClientOptions) : Llam FileServiceAsyncImpl.WithRawResponseImpl(clientOptions) } - private val sheets: SheetServiceAsync.WithRawResponse by lazy { - SheetServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - private val split: SplitServiceAsync.WithRawResponse by lazy { SplitServiceAsyncImpl.WithRawResponseImpl(clientOptions) } @@ -256,8 +244,6 @@ class LlamaCloudClientAsyncImpl(private val clientOptions: ClientOptions) : Llam override fun files(): FileServiceAsync.WithRawResponse = files - override fun sheets(): SheetServiceAsync.WithRawResponse = sheets - override fun split(): SplitServiceAsync.WithRawResponse = split override fun parsing(): ParsingServiceAsync.WithRawResponse = parsing diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/client/LlamaCloudClientImpl.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/client/LlamaCloudClientImpl.kt index 0a4639e..f452787 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/client/LlamaCloudClientImpl.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/client/LlamaCloudClientImpl.kt @@ -32,8 +32,6 @@ import ai.llamaindex.llamacloud.services.blocking.ProjectService import ai.llamaindex.llamacloud.services.blocking.ProjectServiceImpl import ai.llamaindex.llamacloud.services.blocking.RetrieverService import ai.llamaindex.llamacloud.services.blocking.RetrieverServiceImpl -import ai.llamaindex.llamacloud.services.blocking.SheetService -import ai.llamaindex.llamacloud.services.blocking.SheetServiceImpl import ai.llamaindex.llamacloud.services.blocking.SplitService import ai.llamaindex.llamacloud.services.blocking.SplitServiceImpl import ai.llamaindex.llamacloud.services.blocking.V2ProjectService @@ -61,8 +59,6 @@ class LlamaCloudClientImpl(private val clientOptions: ClientOptions) : LlamaClou private val files: FileService by lazy { FileServiceImpl(clientOptionsWithUserAgent) } - private val sheets: SheetService by lazy { SheetServiceImpl(clientOptionsWithUserAgent) } - private val split: SplitService by lazy { SplitServiceImpl(clientOptionsWithUserAgent) } private val parsing: ParsingService by lazy { ParsingServiceImpl(clientOptionsWithUserAgent) } @@ -124,8 +120,6 @@ class LlamaCloudClientImpl(private val clientOptions: ClientOptions) : LlamaClou override fun files(): FileService = files - override fun sheets(): SheetService = sheets - override fun split(): SplitService = split override fun parsing(): ParsingService = parsing @@ -167,10 +161,6 @@ class LlamaCloudClientImpl(private val clientOptions: ClientOptions) : LlamaClou FileServiceImpl.WithRawResponseImpl(clientOptions) } - private val sheets: SheetService.WithRawResponse by lazy { - SheetServiceImpl.WithRawResponseImpl(clientOptions) - } - private val split: SplitService.WithRawResponse by lazy { SplitServiceImpl.WithRawResponseImpl(clientOptions) } @@ -244,8 +234,6 @@ class LlamaCloudClientImpl(private val clientOptions: ClientOptions) : LlamaClou override fun files(): FileService.WithRawResponse = files - override fun sheets(): SheetService.WithRawResponse = sheets - override fun split(): SplitService.WithRawResponse = split override fun parsing(): ParsingService.WithRawResponse = parsing diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/BetaServiceAsync.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/BetaServiceAsync.kt index cfa3966..2a26cc6 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/BetaServiceAsync.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/BetaServiceAsync.kt @@ -8,7 +8,6 @@ import ai.llamaindex.llamacloud.services.async.beta.ChatServiceAsync import ai.llamaindex.llamacloud.services.async.beta.DirectoryServiceAsync import ai.llamaindex.llamacloud.services.async.beta.IndexServiceAsync import ai.llamaindex.llamacloud.services.async.beta.RetrievalServiceAsync -import ai.llamaindex.llamacloud.services.async.beta.SheetServiceAsync import ai.llamaindex.llamacloud.services.async.beta.SplitServiceAsync import java.util.function.Consumer @@ -34,8 +33,6 @@ interface BetaServiceAsync { fun agentData(): AgentDataServiceAsync - fun sheets(): SheetServiceAsync - fun directories(): DirectoryServiceAsync fun split(): SplitServiceAsync @@ -58,8 +55,6 @@ interface BetaServiceAsync { fun agentData(): AgentDataServiceAsync.WithRawResponse - fun sheets(): SheetServiceAsync.WithRawResponse - fun directories(): DirectoryServiceAsync.WithRawResponse fun split(): SplitServiceAsync.WithRawResponse diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/BetaServiceAsyncImpl.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/BetaServiceAsyncImpl.kt index f42b009..c5b982e 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/BetaServiceAsyncImpl.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/BetaServiceAsyncImpl.kt @@ -13,8 +13,6 @@ import ai.llamaindex.llamacloud.services.async.beta.IndexServiceAsync import ai.llamaindex.llamacloud.services.async.beta.IndexServiceAsyncImpl import ai.llamaindex.llamacloud.services.async.beta.RetrievalServiceAsync import ai.llamaindex.llamacloud.services.async.beta.RetrievalServiceAsyncImpl -import ai.llamaindex.llamacloud.services.async.beta.SheetServiceAsync -import ai.llamaindex.llamacloud.services.async.beta.SheetServiceAsyncImpl import ai.llamaindex.llamacloud.services.async.beta.SplitServiceAsync import ai.llamaindex.llamacloud.services.async.beta.SplitServiceAsyncImpl import java.util.function.Consumer @@ -38,8 +36,6 @@ class BetaServiceAsyncImpl internal constructor(private val clientOptions: Clien AgentDataServiceAsyncImpl(clientOptions) } - private val sheets: SheetServiceAsync by lazy { SheetServiceAsyncImpl(clientOptions) } - private val directories: DirectoryServiceAsync by lazy { DirectoryServiceAsyncImpl(clientOptions) } @@ -59,8 +55,6 @@ class BetaServiceAsyncImpl internal constructor(private val clientOptions: Clien override fun agentData(): AgentDataServiceAsync = agentData - override fun sheets(): SheetServiceAsync = sheets - override fun directories(): DirectoryServiceAsync = directories override fun split(): SplitServiceAsync = split @@ -84,10 +78,6 @@ class BetaServiceAsyncImpl internal constructor(private val clientOptions: Clien AgentDataServiceAsyncImpl.WithRawResponseImpl(clientOptions) } - private val sheets: SheetServiceAsync.WithRawResponse by lazy { - SheetServiceAsyncImpl.WithRawResponseImpl(clientOptions) - } - private val directories: DirectoryServiceAsync.WithRawResponse by lazy { DirectoryServiceAsyncImpl.WithRawResponseImpl(clientOptions) } @@ -111,8 +101,6 @@ class BetaServiceAsyncImpl internal constructor(private val clientOptions: Clien override fun agentData(): AgentDataServiceAsync.WithRawResponse = agentData - override fun sheets(): SheetServiceAsync.WithRawResponse = sheets - override fun directories(): DirectoryServiceAsync.WithRawResponse = directories override fun split(): SplitServiceAsync.WithRawResponse = split diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/SheetServiceAsync.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/SheetServiceAsync.kt deleted file mode 100644 index e4812cc..0000000 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/SheetServiceAsync.kt +++ /dev/null @@ -1,34 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.services.async - -import ai.llamaindex.llamacloud.core.ClientOptions -import java.util.function.Consumer - -interface SheetServiceAsync { - - /** - * Returns a view of this service that provides access to raw HTTP responses for each method. - */ - fun withRawResponse(): WithRawResponse - - /** - * Returns a view of this service with the given option modifications applied. - * - * The original service is not modified. - */ - fun withOptions(modifier: Consumer): SheetServiceAsync - - /** A view of [SheetServiceAsync] that provides access to raw HTTP responses for each method. */ - interface WithRawResponse { - - /** - * Returns a view of this service with the given option modifications applied. - * - * The original service is not modified. - */ - fun withOptions( - modifier: Consumer - ): SheetServiceAsync.WithRawResponse - } -} diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/SheetServiceAsyncImpl.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/SheetServiceAsyncImpl.kt deleted file mode 100644 index 80d3203..0000000 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/SheetServiceAsyncImpl.kt +++ /dev/null @@ -1,30 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.services.async - -import ai.llamaindex.llamacloud.core.ClientOptions -import java.util.function.Consumer - -class SheetServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : - SheetServiceAsync { - - private val withRawResponse: SheetServiceAsync.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): SheetServiceAsync.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): SheetServiceAsync = - SheetServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - SheetServiceAsync.WithRawResponse { - - override fun withOptions( - modifier: Consumer - ): SheetServiceAsync.WithRawResponse = - SheetServiceAsyncImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - } -} diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/beta/SheetServiceAsync.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/beta/SheetServiceAsync.kt deleted file mode 100644 index ce32e59..0000000 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/beta/SheetServiceAsync.kt +++ /dev/null @@ -1,34 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.services.async.beta - -import ai.llamaindex.llamacloud.core.ClientOptions -import java.util.function.Consumer - -interface SheetServiceAsync { - - /** - * Returns a view of this service that provides access to raw HTTP responses for each method. - */ - fun withRawResponse(): WithRawResponse - - /** - * Returns a view of this service with the given option modifications applied. - * - * The original service is not modified. - */ - fun withOptions(modifier: Consumer): SheetServiceAsync - - /** A view of [SheetServiceAsync] that provides access to raw HTTP responses for each method. */ - interface WithRawResponse { - - /** - * Returns a view of this service with the given option modifications applied. - * - * The original service is not modified. - */ - fun withOptions( - modifier: Consumer - ): SheetServiceAsync.WithRawResponse - } -} diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/beta/SheetServiceAsyncImpl.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/beta/SheetServiceAsyncImpl.kt deleted file mode 100644 index e8c4237..0000000 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/async/beta/SheetServiceAsyncImpl.kt +++ /dev/null @@ -1,30 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.services.async.beta - -import ai.llamaindex.llamacloud.core.ClientOptions -import java.util.function.Consumer - -class SheetServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : - SheetServiceAsync { - - private val withRawResponse: SheetServiceAsync.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): SheetServiceAsync.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): SheetServiceAsync = - SheetServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - SheetServiceAsync.WithRawResponse { - - override fun withOptions( - modifier: Consumer - ): SheetServiceAsync.WithRawResponse = - SheetServiceAsyncImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - } -} diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/BetaService.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/BetaService.kt index 64b26b5..f13f8fb 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/BetaService.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/BetaService.kt @@ -8,7 +8,6 @@ import ai.llamaindex.llamacloud.services.blocking.beta.ChatService import ai.llamaindex.llamacloud.services.blocking.beta.DirectoryService import ai.llamaindex.llamacloud.services.blocking.beta.IndexService import ai.llamaindex.llamacloud.services.blocking.beta.RetrievalService -import ai.llamaindex.llamacloud.services.blocking.beta.SheetService import ai.llamaindex.llamacloud.services.blocking.beta.SplitService import java.util.function.Consumer @@ -34,8 +33,6 @@ interface BetaService { fun agentData(): AgentDataService - fun sheets(): SheetService - fun directories(): DirectoryService fun split(): SplitService @@ -58,8 +55,6 @@ interface BetaService { fun agentData(): AgentDataService.WithRawResponse - fun sheets(): SheetService.WithRawResponse - fun directories(): DirectoryService.WithRawResponse fun split(): SplitService.WithRawResponse diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/BetaServiceImpl.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/BetaServiceImpl.kt index 8a720ef..107cc52 100644 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/BetaServiceImpl.kt +++ b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/BetaServiceImpl.kt @@ -13,8 +13,6 @@ import ai.llamaindex.llamacloud.services.blocking.beta.IndexService import ai.llamaindex.llamacloud.services.blocking.beta.IndexServiceImpl import ai.llamaindex.llamacloud.services.blocking.beta.RetrievalService import ai.llamaindex.llamacloud.services.blocking.beta.RetrievalServiceImpl -import ai.llamaindex.llamacloud.services.blocking.beta.SheetService -import ai.llamaindex.llamacloud.services.blocking.beta.SheetServiceImpl import ai.llamaindex.llamacloud.services.blocking.beta.SplitService import ai.llamaindex.llamacloud.services.blocking.beta.SplitServiceImpl import java.util.function.Consumer @@ -33,8 +31,6 @@ class BetaServiceImpl internal constructor(private val clientOptions: ClientOpti private val agentData: AgentDataService by lazy { AgentDataServiceImpl(clientOptions) } - private val sheets: SheetService by lazy { SheetServiceImpl(clientOptions) } - private val directories: DirectoryService by lazy { DirectoryServiceImpl(clientOptions) } private val split: SplitService by lazy { SplitServiceImpl(clientOptions) } @@ -52,8 +48,6 @@ class BetaServiceImpl internal constructor(private val clientOptions: ClientOpti override fun agentData(): AgentDataService = agentData - override fun sheets(): SheetService = sheets - override fun directories(): DirectoryService = directories override fun split(): SplitService = split @@ -77,10 +71,6 @@ class BetaServiceImpl internal constructor(private val clientOptions: ClientOpti AgentDataServiceImpl.WithRawResponseImpl(clientOptions) } - private val sheets: SheetService.WithRawResponse by lazy { - SheetServiceImpl.WithRawResponseImpl(clientOptions) - } - private val directories: DirectoryService.WithRawResponse by lazy { DirectoryServiceImpl.WithRawResponseImpl(clientOptions) } @@ -104,8 +94,6 @@ class BetaServiceImpl internal constructor(private val clientOptions: ClientOpti override fun agentData(): AgentDataService.WithRawResponse = agentData - override fun sheets(): SheetService.WithRawResponse = sheets - override fun directories(): DirectoryService.WithRawResponse = directories override fun split(): SplitService.WithRawResponse = split diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/SheetService.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/SheetService.kt deleted file mode 100644 index bf7a636..0000000 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/SheetService.kt +++ /dev/null @@ -1,32 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.services.blocking - -import ai.llamaindex.llamacloud.core.ClientOptions -import java.util.function.Consumer - -interface SheetService { - - /** - * Returns a view of this service that provides access to raw HTTP responses for each method. - */ - fun withRawResponse(): WithRawResponse - - /** - * Returns a view of this service with the given option modifications applied. - * - * The original service is not modified. - */ - fun withOptions(modifier: Consumer): SheetService - - /** A view of [SheetService] that provides access to raw HTTP responses for each method. */ - interface WithRawResponse { - - /** - * Returns a view of this service with the given option modifications applied. - * - * The original service is not modified. - */ - fun withOptions(modifier: Consumer): SheetService.WithRawResponse - } -} diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/SheetServiceImpl.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/SheetServiceImpl.kt deleted file mode 100644 index 6b40e6e..0000000 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/SheetServiceImpl.kt +++ /dev/null @@ -1,30 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.services.blocking - -import ai.llamaindex.llamacloud.core.ClientOptions -import java.util.function.Consumer - -class SheetServiceImpl internal constructor(private val clientOptions: ClientOptions) : - SheetService { - - private val withRawResponse: SheetService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): SheetService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): SheetService = - SheetServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - SheetService.WithRawResponse { - - override fun withOptions( - modifier: Consumer - ): SheetService.WithRawResponse = - SheetServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - } -} diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/beta/SheetService.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/beta/SheetService.kt deleted file mode 100644 index eb363a3..0000000 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/beta/SheetService.kt +++ /dev/null @@ -1,32 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.services.blocking.beta - -import ai.llamaindex.llamacloud.core.ClientOptions -import java.util.function.Consumer - -interface SheetService { - - /** - * Returns a view of this service that provides access to raw HTTP responses for each method. - */ - fun withRawResponse(): WithRawResponse - - /** - * Returns a view of this service with the given option modifications applied. - * - * The original service is not modified. - */ - fun withOptions(modifier: Consumer): SheetService - - /** A view of [SheetService] that provides access to raw HTTP responses for each method. */ - interface WithRawResponse { - - /** - * Returns a view of this service with the given option modifications applied. - * - * The original service is not modified. - */ - fun withOptions(modifier: Consumer): SheetService.WithRawResponse - } -} diff --git a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/beta/SheetServiceImpl.kt b/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/beta/SheetServiceImpl.kt deleted file mode 100644 index 8b50a3b..0000000 --- a/llama-cloud-core/src/main/kotlin/ai/llamaindex/llamacloud/services/blocking/beta/SheetServiceImpl.kt +++ /dev/null @@ -1,30 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package ai.llamaindex.llamacloud.services.blocking.beta - -import ai.llamaindex.llamacloud.core.ClientOptions -import java.util.function.Consumer - -class SheetServiceImpl internal constructor(private val clientOptions: ClientOptions) : - SheetService { - - private val withRawResponse: SheetService.WithRawResponse by lazy { - WithRawResponseImpl(clientOptions) - } - - override fun withRawResponse(): SheetService.WithRawResponse = withRawResponse - - override fun withOptions(modifier: Consumer): SheetService = - SheetServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) - - class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - SheetService.WithRawResponse { - - override fun withOptions( - modifier: Consumer - ): SheetService.WithRawResponse = - SheetServiceImpl.WithRawResponseImpl( - clientOptions.toBuilder().apply(modifier::accept).build() - ) - } -} diff --git a/llama-cloud-proguard-test/src/test/kotlin/ai/llamaindex/llamacloud/proguard/ProGuardCompatibilityTest.kt b/llama-cloud-proguard-test/src/test/kotlin/ai/llamaindex/llamacloud/proguard/ProGuardCompatibilityTest.kt index f4a5fe0..d9bb3f1 100644 --- a/llama-cloud-proguard-test/src/test/kotlin/ai/llamaindex/llamacloud/proguard/ProGuardCompatibilityTest.kt +++ b/llama-cloud-proguard-test/src/test/kotlin/ai/llamaindex/llamacloud/proguard/ProGuardCompatibilityTest.kt @@ -51,7 +51,6 @@ internal class ProGuardCompatibilityTest { assertThat(client).isNotNull() assertThat(client.files()).isNotNull() - assertThat(client.sheets()).isNotNull() assertThat(client.split()).isNotNull() assertThat(client.parsing()).isNotNull() assertThat(client.extract()).isNotNull()