From 960996cc20645633ab72079fa2eb87f1b329f96e Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Fri, 26 Jun 2026 03:15:11 +0000 Subject: [PATCH 01/10] Add cost_effective 2026-06-26: degenerate-early-stop fallback + side-by-side table rule (#21115) Stainless-Generated-From: 330715882bb854fbaf79e9eef4dfea3e70f9a7f6 --- .../configurations/ParseV2Parameters.kt | 24 ++++++++++++---- .../api/models/parsing/ParsingCreateParams.kt | 28 +++++++++++++------ 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2Parameters.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2Parameters.kt index b795bbe..17e0697 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2Parameters.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2Parameters.kt @@ -137,7 +137,7 @@ private constructor( * * Current `latest` by tier: * - `fast`: `2025-12-11` - * - `cost_effective`: `2026-06-18` + * - `cost_effective`: `2026-06-26` * - `agentic`: `2026-06-18` * - `agentic_plus`: `2026-06-18` * @@ -453,7 +453,7 @@ private constructor( * * Current `latest` by tier: * - `fast`: `2025-12-11` - * - `cost_effective`: `2026-06-18` + * - `cost_effective`: `2026-06-26` * - `agentic`: `2026-06-18` * - `agentic_plus`: `2026-06-18` * @@ -947,7 +947,7 @@ private constructor( * * Current `latest` by tier: * - `fast`: `2025-12-11` - * - `cost_effective`: `2026-06-18` + * - `cost_effective`: `2026-06-26` * - `agentic`: `2026-06-18` * - `agentic_plus`: `2026-06-18` * @@ -969,6 +969,8 @@ private constructor( @JvmField val LATEST = of("latest") + @JvmField val _2026_06_26 = of("2026-06-26") + @JvmField val _2026_06_18 = of("2026-06-18") @JvmField val _2025_12_11 = of("2025-12-11") @@ -979,6 +981,7 @@ private constructor( /** An enum containing [Version]'s known values. */ enum class Known { LATEST, + _2026_06_26, _2026_06_18, _2025_12_11, } @@ -994,6 +997,7 @@ private constructor( */ enum class Value { LATEST, + _2026_06_26, _2026_06_18, _2025_12_11, /** An enum member indicating that [Version] was instantiated with an unknown value. */ @@ -1010,6 +1014,7 @@ private constructor( fun value(): Value = when (this) { LATEST -> Value.LATEST + _2026_06_26 -> Value._2026_06_26 _2026_06_18 -> Value._2026_06_18 _2025_12_11 -> Value._2025_12_11 else -> Value._UNKNOWN @@ -1027,6 +1032,7 @@ private constructor( fun known(): Known = when (this) { LATEST -> Known.LATEST + _2026_06_26 -> Known._2026_06_26 _2026_06_18 -> Known._2026_06_18 _2025_12_11 -> Known._2025_12_11 else -> throw LlamaCloudInvalidDataException("Unknown Version: $value") @@ -9377,7 +9383,7 @@ private constructor( * * Current `latest` by tier: * - `fast`: `2025-12-11` - * - `cost_effective`: `2026-06-18` + * - `cost_effective`: `2026-06-26` * - `agentic`: `2026-06-18` * - `agentic_plus`: `2026-06-18` * @@ -9881,7 +9887,7 @@ private constructor( * * Current `latest` by tier: * - `fast`: `2025-12-11` - * - `cost_effective`: `2026-06-18` + * - `cost_effective`: `2026-06-26` * - `agentic`: `2026-06-18` * - `agentic_plus`: `2026-06-18` * @@ -11495,7 +11501,7 @@ private constructor( * * Current `latest` by tier: * - `fast`: `2025-12-11` - * - `cost_effective`: `2026-06-18` + * - `cost_effective`: `2026-06-26` * - `agentic`: `2026-06-18` * - `agentic_plus`: `2026-06-18` * @@ -11520,6 +11526,8 @@ private constructor( @JvmField val LATEST = of("latest") + @JvmField val _2026_06_26 = of("2026-06-26") + @JvmField val _2026_06_18 = of("2026-06-18") @JvmField val _2025_12_11 = of("2025-12-11") @@ -11530,6 +11538,7 @@ private constructor( /** An enum containing [Version]'s known values. */ enum class Known { LATEST, + _2026_06_26, _2026_06_18, _2025_12_11, } @@ -11545,6 +11554,7 @@ private constructor( */ enum class Value { LATEST, + _2026_06_26, _2026_06_18, _2025_12_11, /** @@ -11564,6 +11574,7 @@ private constructor( fun value(): Value = when (this) { LATEST -> Value.LATEST + _2026_06_26 -> Value._2026_06_26 _2026_06_18 -> Value._2026_06_18 _2025_12_11 -> Value._2025_12_11 else -> Value._UNKNOWN @@ -11581,6 +11592,7 @@ private constructor( fun known(): Known = when (this) { LATEST -> Known.LATEST + _2026_06_26 -> Known._2026_06_26 _2026_06_18 -> Known._2026_06_18 _2025_12_11 -> Known._2025_12_11 else -> throw LlamaCloudInvalidDataException("Unknown Version: $value") diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParams.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParams.kt index a8f9b45..698b39a 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParams.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParams.kt @@ -76,7 +76,7 @@ private constructor( * * Current `latest` by tier: * - `fast`: `2025-12-11` - * - `cost_effective`: `2026-06-18` + * - `cost_effective`: `2026-06-26` * - `agentic`: `2026-06-18` * - `agentic_plus`: `2026-06-18` * @@ -431,7 +431,7 @@ private constructor( * * Current `latest` by tier: * - `fast`: `2025-12-11` - * - `cost_effective`: `2026-06-18` + * - `cost_effective`: `2026-06-26` * - `agentic`: `2026-06-18` * - `agentic_plus`: `2026-06-18` * @@ -984,7 +984,7 @@ private constructor( * * Current `latest` by tier: * - `fast`: `2025-12-11` - * - `cost_effective`: `2026-06-18` + * - `cost_effective`: `2026-06-26` * - `agentic`: `2026-06-18` * - `agentic_plus`: `2026-06-18` * @@ -1375,7 +1375,7 @@ private constructor( * * Current `latest` by tier: * - `fast`: `2025-12-11` - * - `cost_effective`: `2026-06-18` + * - `cost_effective`: `2026-06-26` * - `agentic`: `2026-06-18` * - `agentic_plus`: `2026-06-18` * @@ -2009,7 +2009,7 @@ private constructor( * * Current `latest` by tier: * - `fast`: `2025-12-11` - * - `cost_effective`: `2026-06-18` + * - `cost_effective`: `2026-06-26` * - `agentic`: `2026-06-18` * - `agentic_plus`: `2026-06-18` * @@ -2031,6 +2031,8 @@ private constructor( @JvmField val LATEST = of("latest") + @JvmField val _2026_06_26 = of("2026-06-26") + @JvmField val _2026_06_18 = of("2026-06-18") @JvmField val _2025_12_11 = of("2025-12-11") @@ -2041,6 +2043,7 @@ private constructor( /** An enum containing [Version]'s known values. */ enum class Known { LATEST, + _2026_06_26, _2026_06_18, _2025_12_11, } @@ -2056,6 +2059,7 @@ private constructor( */ enum class Value { LATEST, + _2026_06_26, _2026_06_18, _2025_12_11, /** An enum member indicating that [Version] was instantiated with an unknown value. */ @@ -2072,6 +2076,7 @@ private constructor( fun value(): Value = when (this) { LATEST -> Value.LATEST + _2026_06_26 -> Value._2026_06_26 _2026_06_18 -> Value._2026_06_18 _2025_12_11 -> Value._2025_12_11 else -> Value._UNKNOWN @@ -2089,6 +2094,7 @@ private constructor( fun known(): Known = when (this) { LATEST -> Known.LATEST + _2026_06_26 -> Known._2026_06_26 _2026_06_18 -> Known._2026_06_18 _2025_12_11 -> Known._2025_12_11 else -> throw LlamaCloudInvalidDataException("Unknown Version: $value") @@ -10439,7 +10445,7 @@ private constructor( * * Current `latest` by tier: * - `fast`: `2025-12-11` - * - `cost_effective`: `2026-06-18` + * - `cost_effective`: `2026-06-26` * - `agentic`: `2026-06-18` * - `agentic_plus`: `2026-06-18` * @@ -10943,7 +10949,7 @@ private constructor( * * Current `latest` by tier: * - `fast`: `2025-12-11` - * - `cost_effective`: `2026-06-18` + * - `cost_effective`: `2026-06-26` * - `agentic`: `2026-06-18` * - `agentic_plus`: `2026-06-18` * @@ -12557,7 +12563,7 @@ private constructor( * * Current `latest` by tier: * - `fast`: `2025-12-11` - * - `cost_effective`: `2026-06-18` + * - `cost_effective`: `2026-06-26` * - `agentic`: `2026-06-18` * - `agentic_plus`: `2026-06-18` * @@ -12582,6 +12588,8 @@ private constructor( @JvmField val LATEST = of("latest") + @JvmField val _2026_06_26 = of("2026-06-26") + @JvmField val _2026_06_18 = of("2026-06-18") @JvmField val _2025_12_11 = of("2025-12-11") @@ -12592,6 +12600,7 @@ private constructor( /** An enum containing [Version]'s known values. */ enum class Known { LATEST, + _2026_06_26, _2026_06_18, _2025_12_11, } @@ -12607,6 +12616,7 @@ private constructor( */ enum class Value { LATEST, + _2026_06_26, _2026_06_18, _2025_12_11, /** @@ -12626,6 +12636,7 @@ private constructor( fun value(): Value = when (this) { LATEST -> Value.LATEST + _2026_06_26 -> Value._2026_06_26 _2026_06_18 -> Value._2026_06_18 _2025_12_11 -> Value._2025_12_11 else -> Value._UNKNOWN @@ -12643,6 +12654,7 @@ private constructor( fun known(): Known = when (this) { LATEST -> Known.LATEST + _2026_06_26 -> Known._2026_06_26 _2026_06_18 -> Known._2026_06_18 _2025_12_11 -> Known._2025_12_11 else -> throw LlamaCloudInvalidDataException("Unknown Version: $value") From 28b65a9a8a2f178af9c8c44437a3c0d28900045c Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Fri, 26 Jun 2026 18:28:25 +0000 Subject: [PATCH 02/10] feat(index): add output_directory_id to IndexResponse (#21149) Stainless-Generated-From: abbc4d1601e1c743455990cb7e55799220dece51 --- .../beta/indexes/IndexCreateResponse.kt | 49 ++++++++++++++++++- .../models/beta/indexes/IndexGetResponse.kt | 49 ++++++++++++++++++- .../models/beta/indexes/IndexListResponse.kt | 49 ++++++++++++++++++- .../beta/indexes/IndexCreateResponseTest.kt | 3 ++ .../beta/indexes/IndexGetResponseTest.kt | 3 ++ .../beta/indexes/IndexListPageResponseTest.kt | 3 ++ .../beta/indexes/IndexListResponseTest.kt | 3 ++ .../api/proguard/ProGuardCompatibilityTest.kt | 1 + 8 files changed, 157 insertions(+), 3 deletions(-) diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexCreateResponse.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexCreateResponse.kt index ea455f1..c096155 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexCreateResponse.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexCreateResponse.kt @@ -26,6 +26,7 @@ private constructor( private val id: JsonField, private val exportConfigId: JsonField, private val name: JsonField, + private val outputDirectoryId: JsonField, private val projectId: JsonField, private val sourceDirectoryId: JsonField, private val syncConfigId: JsonField, @@ -45,6 +46,9 @@ private constructor( @ExcludeMissing exportConfigId: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("output_directory_id") + @ExcludeMissing + outputDirectoryId: JsonField = JsonMissing.of(), @JsonProperty("project_id") @ExcludeMissing projectId: JsonField = JsonMissing.of(), @JsonProperty("source_directory_id") @ExcludeMissing @@ -72,6 +76,7 @@ private constructor( id, exportConfigId, name, + outputDirectoryId, projectId, sourceDirectoryId, syncConfigId, @@ -108,6 +113,14 @@ private constructor( */ fun name(): String = name.getRequired("name") + /** + * ID of the output directory holding the indexed 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 outputDirectoryId(): String = outputDirectoryId.getRequired("output_directory_id") + /** * Project this index belongs to. * @@ -203,6 +216,16 @@ private constructor( */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + /** + * Returns the raw JSON value of [outputDirectoryId]. + * + * Unlike [outputDirectoryId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("output_directory_id") + @ExcludeMissing + fun _outputDirectoryId(): JsonField = outputDirectoryId + /** * Returns the raw JSON value of [projectId]. * @@ -301,6 +324,7 @@ private constructor( * .id() * .exportConfigId() * .name() + * .outputDirectoryId() * .projectId() * .sourceDirectoryId() * .syncConfigId() @@ -315,6 +339,7 @@ private constructor( private var id: JsonField? = null private var exportConfigId: JsonField? = null private var name: JsonField? = null + private var outputDirectoryId: JsonField? = null private var projectId: JsonField? = null private var sourceDirectoryId: JsonField? = null private var syncConfigId: JsonField? = null @@ -331,6 +356,7 @@ private constructor( id = indexCreateResponse.id exportConfigId = indexCreateResponse.exportConfigId name = indexCreateResponse.name + outputDirectoryId = indexCreateResponse.outputDirectoryId projectId = indexCreateResponse.projectId sourceDirectoryId = indexCreateResponse.sourceDirectoryId syncConfigId = indexCreateResponse.syncConfigId @@ -379,6 +405,21 @@ private constructor( */ fun name(name: JsonField) = apply { this.name = name } + /** ID of the output directory holding the indexed files. */ + fun outputDirectoryId(outputDirectoryId: String) = + outputDirectoryId(JsonField.of(outputDirectoryId)) + + /** + * Sets [Builder.outputDirectoryId] to an arbitrary JSON value. + * + * You should usually call [Builder.outputDirectoryId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun outputDirectoryId(outputDirectoryId: JsonField) = apply { + this.outputDirectoryId = outputDirectoryId + } + /** Project this index belongs to. */ fun projectId(projectId: String) = projectId(JsonField.of(projectId)) @@ -544,6 +585,7 @@ private constructor( * .id() * .exportConfigId() * .name() + * .outputDirectoryId() * .projectId() * .sourceDirectoryId() * .syncConfigId() @@ -556,6 +598,7 @@ private constructor( checkRequired("id", id), checkRequired("exportConfigId", exportConfigId), checkRequired("name", name), + checkRequired("outputDirectoryId", outputDirectoryId), checkRequired("projectId", projectId), checkRequired("sourceDirectoryId", sourceDirectoryId), checkRequired("syncConfigId", syncConfigId), @@ -587,6 +630,7 @@ private constructor( id() exportConfigId() name() + outputDirectoryId() projectId() sourceDirectoryId() syncConfigId() @@ -617,6 +661,7 @@ private constructor( (if (id.asKnown().isPresent) 1 else 0) + (if (exportConfigId.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + + (if (outputDirectoryId.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + (if (sourceDirectoryId.asKnown().isPresent) 1 else 0) + (if (syncConfigId.asKnown().isPresent) 1 else 0) + @@ -745,6 +790,7 @@ private constructor( id == other.id && exportConfigId == other.exportConfigId && name == other.name && + outputDirectoryId == other.outputDirectoryId && projectId == other.projectId && sourceDirectoryId == other.sourceDirectoryId && syncConfigId == other.syncConfigId && @@ -762,6 +808,7 @@ private constructor( id, exportConfigId, name, + outputDirectoryId, projectId, sourceDirectoryId, syncConfigId, @@ -778,5 +825,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "IndexCreateResponse{id=$id, exportConfigId=$exportConfigId, name=$name, projectId=$projectId, sourceDirectoryId=$sourceDirectoryId, syncConfigId=$syncConfigId, createdAt=$createdAt, description=$description, lastExportedAt=$lastExportedAt, lastSyncedAt=$lastSyncedAt, metadata=$metadata, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" + "IndexCreateResponse{id=$id, exportConfigId=$exportConfigId, name=$name, outputDirectoryId=$outputDirectoryId, projectId=$projectId, sourceDirectoryId=$sourceDirectoryId, syncConfigId=$syncConfigId, createdAt=$createdAt, description=$description, lastExportedAt=$lastExportedAt, lastSyncedAt=$lastSyncedAt, metadata=$metadata, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" } diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexGetResponse.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexGetResponse.kt index 7ebac05..030d5a3 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexGetResponse.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexGetResponse.kt @@ -26,6 +26,7 @@ private constructor( private val id: JsonField, private val exportConfigId: JsonField, private val name: JsonField, + private val outputDirectoryId: JsonField, private val projectId: JsonField, private val sourceDirectoryId: JsonField, private val syncConfigId: JsonField, @@ -45,6 +46,9 @@ private constructor( @ExcludeMissing exportConfigId: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("output_directory_id") + @ExcludeMissing + outputDirectoryId: JsonField = JsonMissing.of(), @JsonProperty("project_id") @ExcludeMissing projectId: JsonField = JsonMissing.of(), @JsonProperty("source_directory_id") @ExcludeMissing @@ -72,6 +76,7 @@ private constructor( id, exportConfigId, name, + outputDirectoryId, projectId, sourceDirectoryId, syncConfigId, @@ -108,6 +113,14 @@ private constructor( */ fun name(): String = name.getRequired("name") + /** + * ID of the output directory holding the indexed 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 outputDirectoryId(): String = outputDirectoryId.getRequired("output_directory_id") + /** * Project this index belongs to. * @@ -203,6 +216,16 @@ private constructor( */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + /** + * Returns the raw JSON value of [outputDirectoryId]. + * + * Unlike [outputDirectoryId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("output_directory_id") + @ExcludeMissing + fun _outputDirectoryId(): JsonField = outputDirectoryId + /** * Returns the raw JSON value of [projectId]. * @@ -301,6 +324,7 @@ private constructor( * .id() * .exportConfigId() * .name() + * .outputDirectoryId() * .projectId() * .sourceDirectoryId() * .syncConfigId() @@ -315,6 +339,7 @@ private constructor( private var id: JsonField? = null private var exportConfigId: JsonField? = null private var name: JsonField? = null + private var outputDirectoryId: JsonField? = null private var projectId: JsonField? = null private var sourceDirectoryId: JsonField? = null private var syncConfigId: JsonField? = null @@ -331,6 +356,7 @@ private constructor( id = indexGetResponse.id exportConfigId = indexGetResponse.exportConfigId name = indexGetResponse.name + outputDirectoryId = indexGetResponse.outputDirectoryId projectId = indexGetResponse.projectId sourceDirectoryId = indexGetResponse.sourceDirectoryId syncConfigId = indexGetResponse.syncConfigId @@ -379,6 +405,21 @@ private constructor( */ fun name(name: JsonField) = apply { this.name = name } + /** ID of the output directory holding the indexed files. */ + fun outputDirectoryId(outputDirectoryId: String) = + outputDirectoryId(JsonField.of(outputDirectoryId)) + + /** + * Sets [Builder.outputDirectoryId] to an arbitrary JSON value. + * + * You should usually call [Builder.outputDirectoryId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun outputDirectoryId(outputDirectoryId: JsonField) = apply { + this.outputDirectoryId = outputDirectoryId + } + /** Project this index belongs to. */ fun projectId(projectId: String) = projectId(JsonField.of(projectId)) @@ -544,6 +585,7 @@ private constructor( * .id() * .exportConfigId() * .name() + * .outputDirectoryId() * .projectId() * .sourceDirectoryId() * .syncConfigId() @@ -556,6 +598,7 @@ private constructor( checkRequired("id", id), checkRequired("exportConfigId", exportConfigId), checkRequired("name", name), + checkRequired("outputDirectoryId", outputDirectoryId), checkRequired("projectId", projectId), checkRequired("sourceDirectoryId", sourceDirectoryId), checkRequired("syncConfigId", syncConfigId), @@ -587,6 +630,7 @@ private constructor( id() exportConfigId() name() + outputDirectoryId() projectId() sourceDirectoryId() syncConfigId() @@ -617,6 +661,7 @@ private constructor( (if (id.asKnown().isPresent) 1 else 0) + (if (exportConfigId.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + + (if (outputDirectoryId.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + (if (sourceDirectoryId.asKnown().isPresent) 1 else 0) + (if (syncConfigId.asKnown().isPresent) 1 else 0) + @@ -745,6 +790,7 @@ private constructor( id == other.id && exportConfigId == other.exportConfigId && name == other.name && + outputDirectoryId == other.outputDirectoryId && projectId == other.projectId && sourceDirectoryId == other.sourceDirectoryId && syncConfigId == other.syncConfigId && @@ -762,6 +808,7 @@ private constructor( id, exportConfigId, name, + outputDirectoryId, projectId, sourceDirectoryId, syncConfigId, @@ -778,5 +825,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "IndexGetResponse{id=$id, exportConfigId=$exportConfigId, name=$name, projectId=$projectId, sourceDirectoryId=$sourceDirectoryId, syncConfigId=$syncConfigId, createdAt=$createdAt, description=$description, lastExportedAt=$lastExportedAt, lastSyncedAt=$lastSyncedAt, metadata=$metadata, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" + "IndexGetResponse{id=$id, exportConfigId=$exportConfigId, name=$name, outputDirectoryId=$outputDirectoryId, projectId=$projectId, sourceDirectoryId=$sourceDirectoryId, syncConfigId=$syncConfigId, createdAt=$createdAt, description=$description, lastExportedAt=$lastExportedAt, lastSyncedAt=$lastSyncedAt, metadata=$metadata, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" } diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexListResponse.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexListResponse.kt index 1bf8e97..bff74d3 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexListResponse.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexListResponse.kt @@ -26,6 +26,7 @@ private constructor( private val id: JsonField, private val exportConfigId: JsonField, private val name: JsonField, + private val outputDirectoryId: JsonField, private val projectId: JsonField, private val sourceDirectoryId: JsonField, private val syncConfigId: JsonField, @@ -45,6 +46,9 @@ private constructor( @ExcludeMissing exportConfigId: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("output_directory_id") + @ExcludeMissing + outputDirectoryId: JsonField = JsonMissing.of(), @JsonProperty("project_id") @ExcludeMissing projectId: JsonField = JsonMissing.of(), @JsonProperty("source_directory_id") @ExcludeMissing @@ -72,6 +76,7 @@ private constructor( id, exportConfigId, name, + outputDirectoryId, projectId, sourceDirectoryId, syncConfigId, @@ -108,6 +113,14 @@ private constructor( */ fun name(): String = name.getRequired("name") + /** + * ID of the output directory holding the indexed 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 outputDirectoryId(): String = outputDirectoryId.getRequired("output_directory_id") + /** * Project this index belongs to. * @@ -203,6 +216,16 @@ private constructor( */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + /** + * Returns the raw JSON value of [outputDirectoryId]. + * + * Unlike [outputDirectoryId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("output_directory_id") + @ExcludeMissing + fun _outputDirectoryId(): JsonField = outputDirectoryId + /** * Returns the raw JSON value of [projectId]. * @@ -301,6 +324,7 @@ private constructor( * .id() * .exportConfigId() * .name() + * .outputDirectoryId() * .projectId() * .sourceDirectoryId() * .syncConfigId() @@ -315,6 +339,7 @@ private constructor( private var id: JsonField? = null private var exportConfigId: JsonField? = null private var name: JsonField? = null + private var outputDirectoryId: JsonField? = null private var projectId: JsonField? = null private var sourceDirectoryId: JsonField? = null private var syncConfigId: JsonField? = null @@ -331,6 +356,7 @@ private constructor( id = indexListResponse.id exportConfigId = indexListResponse.exportConfigId name = indexListResponse.name + outputDirectoryId = indexListResponse.outputDirectoryId projectId = indexListResponse.projectId sourceDirectoryId = indexListResponse.sourceDirectoryId syncConfigId = indexListResponse.syncConfigId @@ -379,6 +405,21 @@ private constructor( */ fun name(name: JsonField) = apply { this.name = name } + /** ID of the output directory holding the indexed files. */ + fun outputDirectoryId(outputDirectoryId: String) = + outputDirectoryId(JsonField.of(outputDirectoryId)) + + /** + * Sets [Builder.outputDirectoryId] to an arbitrary JSON value. + * + * You should usually call [Builder.outputDirectoryId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun outputDirectoryId(outputDirectoryId: JsonField) = apply { + this.outputDirectoryId = outputDirectoryId + } + /** Project this index belongs to. */ fun projectId(projectId: String) = projectId(JsonField.of(projectId)) @@ -544,6 +585,7 @@ private constructor( * .id() * .exportConfigId() * .name() + * .outputDirectoryId() * .projectId() * .sourceDirectoryId() * .syncConfigId() @@ -556,6 +598,7 @@ private constructor( checkRequired("id", id), checkRequired("exportConfigId", exportConfigId), checkRequired("name", name), + checkRequired("outputDirectoryId", outputDirectoryId), checkRequired("projectId", projectId), checkRequired("sourceDirectoryId", sourceDirectoryId), checkRequired("syncConfigId", syncConfigId), @@ -587,6 +630,7 @@ private constructor( id() exportConfigId() name() + outputDirectoryId() projectId() sourceDirectoryId() syncConfigId() @@ -617,6 +661,7 @@ private constructor( (if (id.asKnown().isPresent) 1 else 0) + (if (exportConfigId.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + + (if (outputDirectoryId.asKnown().isPresent) 1 else 0) + (if (projectId.asKnown().isPresent) 1 else 0) + (if (sourceDirectoryId.asKnown().isPresent) 1 else 0) + (if (syncConfigId.asKnown().isPresent) 1 else 0) + @@ -745,6 +790,7 @@ private constructor( id == other.id && exportConfigId == other.exportConfigId && name == other.name && + outputDirectoryId == other.outputDirectoryId && projectId == other.projectId && sourceDirectoryId == other.sourceDirectoryId && syncConfigId == other.syncConfigId && @@ -762,6 +808,7 @@ private constructor( id, exportConfigId, name, + outputDirectoryId, projectId, sourceDirectoryId, syncConfigId, @@ -778,5 +825,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "IndexListResponse{id=$id, exportConfigId=$exportConfigId, name=$name, projectId=$projectId, sourceDirectoryId=$sourceDirectoryId, syncConfigId=$syncConfigId, createdAt=$createdAt, description=$description, lastExportedAt=$lastExportedAt, lastSyncedAt=$lastSyncedAt, metadata=$metadata, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" + "IndexListResponse{id=$id, exportConfigId=$exportConfigId, name=$name, outputDirectoryId=$outputDirectoryId, projectId=$projectId, sourceDirectoryId=$sourceDirectoryId, syncConfigId=$syncConfigId, createdAt=$createdAt, description=$description, lastExportedAt=$lastExportedAt, lastSyncedAt=$lastSyncedAt, metadata=$metadata, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" } diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexCreateResponseTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexCreateResponseTest.kt index 480adb8..e6877cf 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexCreateResponseTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexCreateResponseTest.kt @@ -18,6 +18,7 @@ internal class IndexCreateResponseTest { .id("id") .exportConfigId("export_config_id") .name("name") + .outputDirectoryId("output_directory_id") .projectId("project_id") .sourceDirectoryId("source_directory_id") .syncConfigId("sync_config_id") @@ -36,6 +37,7 @@ internal class IndexCreateResponseTest { assertThat(indexCreateResponse.id()).isEqualTo("id") assertThat(indexCreateResponse.exportConfigId()).isEqualTo("export_config_id") assertThat(indexCreateResponse.name()).isEqualTo("name") + assertThat(indexCreateResponse.outputDirectoryId()).isEqualTo("output_directory_id") assertThat(indexCreateResponse.projectId()).isEqualTo("project_id") assertThat(indexCreateResponse.sourceDirectoryId()).isEqualTo("source_directory_id") assertThat(indexCreateResponse.syncConfigId()).isEqualTo("sync_config_id") @@ -64,6 +66,7 @@ internal class IndexCreateResponseTest { .id("id") .exportConfigId("export_config_id") .name("name") + .outputDirectoryId("output_directory_id") .projectId("project_id") .sourceDirectoryId("source_directory_id") .syncConfigId("sync_config_id") diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexGetResponseTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexGetResponseTest.kt index 73725fc..5f50c5b 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexGetResponseTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexGetResponseTest.kt @@ -18,6 +18,7 @@ internal class IndexGetResponseTest { .id("id") .exportConfigId("export_config_id") .name("name") + .outputDirectoryId("output_directory_id") .projectId("project_id") .sourceDirectoryId("source_directory_id") .syncConfigId("sync_config_id") @@ -36,6 +37,7 @@ internal class IndexGetResponseTest { assertThat(indexGetResponse.id()).isEqualTo("id") assertThat(indexGetResponse.exportConfigId()).isEqualTo("export_config_id") assertThat(indexGetResponse.name()).isEqualTo("name") + assertThat(indexGetResponse.outputDirectoryId()).isEqualTo("output_directory_id") assertThat(indexGetResponse.projectId()).isEqualTo("project_id") assertThat(indexGetResponse.sourceDirectoryId()).isEqualTo("source_directory_id") assertThat(indexGetResponse.syncConfigId()).isEqualTo("sync_config_id") @@ -64,6 +66,7 @@ internal class IndexGetResponseTest { .id("id") .exportConfigId("export_config_id") .name("name") + .outputDirectoryId("output_directory_id") .projectId("project_id") .sourceDirectoryId("source_directory_id") .syncConfigId("sync_config_id") diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexListPageResponseTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexListPageResponseTest.kt index 77cde56..5ef7a65 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexListPageResponseTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexListPageResponseTest.kt @@ -20,6 +20,7 @@ internal class IndexListPageResponseTest { .id("id") .exportConfigId("export_config_id") .name("name") + .outputDirectoryId("output_directory_id") .projectId("project_id") .sourceDirectoryId("source_directory_id") .syncConfigId("sync_config_id") @@ -45,6 +46,7 @@ internal class IndexListPageResponseTest { .id("id") .exportConfigId("export_config_id") .name("name") + .outputDirectoryId("output_directory_id") .projectId("project_id") .sourceDirectoryId("source_directory_id") .syncConfigId("sync_config_id") @@ -74,6 +76,7 @@ internal class IndexListPageResponseTest { .id("id") .exportConfigId("export_config_id") .name("name") + .outputDirectoryId("output_directory_id") .projectId("project_id") .sourceDirectoryId("source_directory_id") .syncConfigId("sync_config_id") diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexListResponseTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexListResponseTest.kt index 86d4a79..f9ffe9c 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexListResponseTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/indexes/IndexListResponseTest.kt @@ -18,6 +18,7 @@ internal class IndexListResponseTest { .id("id") .exportConfigId("export_config_id") .name("name") + .outputDirectoryId("output_directory_id") .projectId("project_id") .sourceDirectoryId("source_directory_id") .syncConfigId("sync_config_id") @@ -36,6 +37,7 @@ internal class IndexListResponseTest { assertThat(indexListResponse.id()).isEqualTo("id") assertThat(indexListResponse.exportConfigId()).isEqualTo("export_config_id") assertThat(indexListResponse.name()).isEqualTo("name") + assertThat(indexListResponse.outputDirectoryId()).isEqualTo("output_directory_id") assertThat(indexListResponse.projectId()).isEqualTo("project_id") assertThat(indexListResponse.sourceDirectoryId()).isEqualTo("source_directory_id") assertThat(indexListResponse.syncConfigId()).isEqualTo("sync_config_id") @@ -64,6 +66,7 @@ internal class IndexListResponseTest { .id("id") .exportConfigId("export_config_id") .name("name") + .outputDirectoryId("output_directory_id") .projectId("project_id") .sourceDirectoryId("source_directory_id") .syncConfigId("sync_config_id") diff --git a/llama-cloud-proguard-test/src/test/kotlin/com/llamacloud_prod/api/proguard/ProGuardCompatibilityTest.kt b/llama-cloud-proguard-test/src/test/kotlin/com/llamacloud_prod/api/proguard/ProGuardCompatibilityTest.kt index 9fce0c5..9198de6 100644 --- a/llama-cloud-proguard-test/src/test/kotlin/com/llamacloud_prod/api/proguard/ProGuardCompatibilityTest.kt +++ b/llama-cloud-proguard-test/src/test/kotlin/com/llamacloud_prod/api/proguard/ProGuardCompatibilityTest.kt @@ -74,6 +74,7 @@ internal class ProGuardCompatibilityTest { .id("id") .exportConfigId("export_config_id") .name("name") + .outputDirectoryId("output_directory_id") .projectId("project_id") .sourceDirectoryId("source_directory_id") .syncConfigId("sync_config_id") From a3add10dc613aa233bcbe88bf73c49b907fc9881 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Fri, 26 Jun 2026 20:01:53 +0000 Subject: [PATCH 03/10] Add HMAC signing for outbound webhooks (#21145) Stainless-Generated-From: d6f22be8336a869c5e2479fd0b86dfec027b4036 --- .../models/beta/batch/BatchCreateParams.kt | 63 +++++++++++++++- .../JobItemGetProcessingResultsResponse.kt | 66 ++++++++++++++++- .../models/beta/sheets/SheetCreateParams.kt | 71 ++++++++++++++++++- .../api/models/beta/sheets/SheetsJob.kt | 71 ++++++++++++++++++- .../models/classifier/jobs/JobCreateParams.kt | 71 ++++++++++++++++++- .../models/classify/ClassifyCreateRequest.kt | 71 ++++++++++++++++++- .../configurations/ParseV2Parameters.kt | 71 ++++++++++++++++++- .../api/models/extract/ExtractV2JobCreate.kt | 71 ++++++++++++++++++- .../api/models/parsing/ParsingCreateParams.kt | 71 ++++++++++++++++++- .../models/pipelines/LlamaParseParameters.kt | 71 ++++++++++++++++++- .../api/models/sheets/SheetCreateParams.kt | 71 ++++++++++++++++++- .../beta/batch/BatchCreateParamsTest.kt | 5 ++ ...JobItemGetProcessingResultsResponseTest.kt | 3 + .../beta/sheets/SheetCreateParamsTest.kt | 4 ++ .../beta/sheets/SheetListPageResponseTest.kt | 3 + .../api/models/beta/sheets/SheetsJobTest.kt | 3 + .../classifier/jobs/JobCreateParamsTest.kt | 4 ++ .../classify/ClassifyCreateParamsTest.kt | 4 ++ .../classify/ClassifyCreateRequestTest.kt | 3 + .../configurations/ParseV2ParametersTest.kt | 3 + .../models/extract/ExtractCreateParamsTest.kt | 4 ++ .../models/extract/ExtractV2JobCreateTest.kt | 3 + .../models/parsing/ParsingCreateParamsTest.kt | 4 ++ .../pipelines/LlamaParseParametersTest.kt | 3 + .../pipelines/PipelineCreateParamsTest.kt | 4 ++ .../models/pipelines/PipelineCreateTest.kt | 3 + .../api/models/pipelines/PipelineTest.kt | 3 + .../pipelines/PipelineUpdateParamsTest.kt | 3 + .../pipelines/PipelineUpsertParamsTest.kt | 4 ++ .../models/sheets/SheetCreateParamsTest.kt | 4 ++ .../sheets/SheetListPageResponseTest.kt | 3 + .../api/services/ServiceParamsTest.kt | 1 + .../async/ClassifyServiceAsyncTest.kt | 1 + .../services/async/ExtractServiceAsyncTest.kt | 1 + .../services/async/ParsingServiceAsyncTest.kt | 1 + .../async/PipelineServiceAsyncTest.kt | 3 + .../services/async/SheetServiceAsyncTest.kt | 1 + .../async/beta/BatchServiceAsyncTest.kt | 1 + .../async/beta/SheetServiceAsyncTest.kt | 1 + .../async/classifier/JobServiceAsyncTest.kt | 1 + .../services/blocking/ClassifyServiceTest.kt | 1 + .../services/blocking/ExtractServiceTest.kt | 1 + .../services/blocking/ParsingServiceTest.kt | 1 + .../services/blocking/PipelineServiceTest.kt | 3 + .../api/services/blocking/SheetServiceTest.kt | 1 + .../blocking/beta/BatchServiceTest.kt | 1 + .../blocking/beta/SheetServiceTest.kt | 1 + .../blocking/classifier/JobServiceTest.kt | 1 + 48 files changed, 839 insertions(+), 20 deletions(-) diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/batch/BatchCreateParams.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/batch/BatchCreateParams.kt index ea2a607..c9cf31c 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/batch/BatchCreateParams.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/batch/BatchCreateParams.kt @@ -9335,6 +9335,7 @@ 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, ) { @@ -9350,6 +9351,9 @@ private constructor( @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(), @@ -9357,6 +9361,7 @@ private constructor( webhookEvents, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, mutableMapOf(), ) @@ -9389,6 +9394,18 @@ private constructor( 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") + /** * URL to receive webhook POST notifications * @@ -9427,6 +9444,16 @@ private constructor( @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]. * @@ -9464,6 +9491,7 @@ private 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() @@ -9474,6 +9502,7 @@ private constructor( webhookConfiguration.webhookEvents.map { it.toMutableList() } webhookHeaders = webhookConfiguration.webhookHeaders webhookOutputFormat = webhookConfiguration.webhookOutputFormat + webhookSigningSecret = webhookConfiguration.webhookSigningSecret webhookUrl = webhookConfiguration.webhookUrl additionalProperties = webhookConfiguration.additionalProperties.toMutableMap() @@ -9561,6 +9590,33 @@ private constructor( 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 + } + /** URL to receive webhook POST notifications */ fun webhookUrl(webhookUrl: String?) = webhookUrl(JsonField.ofNullable(webhookUrl)) @@ -9614,6 +9670,7 @@ private constructor( (webhookEvents ?: JsonMissing.of()).map { it.toImmutable() }, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties.toMutableMap(), ) @@ -9639,6 +9696,7 @@ private constructor( webhookEvents().ifPresent { it.forEach { it.validate() } } webhookHeaders().ifPresent { it.validate() } webhookOutputFormat() + webhookSigningSecret() webhookUrl() validated = true } @@ -9663,6 +9721,7 @@ private constructor( ?: 0) + (webhookHeaders.asKnown().getOrNull()?.validity() ?: 0) + (if (webhookOutputFormat.asKnown().isPresent) 1 else 0) + + (if (webhookSigningSecret.asKnown().isPresent) 1 else 0) + (if (webhookUrl.asKnown().isPresent) 1 else 0) class WebhookEvent @@ -10103,6 +10162,7 @@ private constructor( webhookEvents == other.webhookEvents && webhookHeaders == other.webhookHeaders && webhookOutputFormat == other.webhookOutputFormat && + webhookSigningSecret == other.webhookSigningSecret && webhookUrl == other.webhookUrl && additionalProperties == other.additionalProperties } @@ -10112,6 +10172,7 @@ private constructor( webhookEvents, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties, ) @@ -10120,7 +10181,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" + "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookSigningSecret=$webhookSigningSecret, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/batch/jobitems/JobItemGetProcessingResultsResponse.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/batch/jobitems/JobItemGetProcessingResultsResponse.kt index 0cf8178..850dd92 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/batch/jobitems/JobItemGetProcessingResultsResponse.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/batch/jobitems/JobItemGetProcessingResultsResponse.kt @@ -9430,6 +9430,7 @@ 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, ) { @@ -9445,6 +9446,9 @@ private constructor( @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(), @@ -9452,6 +9456,7 @@ private constructor( webhookEvents, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, mutableMapOf(), ) @@ -9487,6 +9492,19 @@ private constructor( 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") + /** * URL to receive webhook POST notifications * @@ -9526,6 +9544,16 @@ private constructor( @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]. * @@ -9563,6 +9591,7 @@ private 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() @@ -9573,6 +9602,7 @@ private constructor( webhookConfiguration.webhookEvents.map { it.toMutableList() } webhookHeaders = webhookConfiguration.webhookHeaders webhookOutputFormat = webhookConfiguration.webhookOutputFormat + webhookSigningSecret = webhookConfiguration.webhookSigningSecret webhookUrl = webhookConfiguration.webhookUrl additionalProperties = webhookConfiguration.additionalProperties.toMutableMap() @@ -9664,6 +9694,35 @@ private constructor( 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 + } + /** URL to receive webhook POST notifications */ fun webhookUrl(webhookUrl: String?) = webhookUrl(JsonField.ofNullable(webhookUrl)) @@ -9719,6 +9778,7 @@ private constructor( (webhookEvents ?: JsonMissing.of()).map { it.toImmutable() }, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties.toMutableMap(), ) @@ -9744,6 +9804,7 @@ private constructor( webhookEvents().ifPresent { it.forEach { it.validate() } } webhookHeaders().ifPresent { it.validate() } webhookOutputFormat() + webhookSigningSecret() webhookUrl() validated = true } @@ -9768,6 +9829,7 @@ private constructor( ?: 0) + (webhookHeaders.asKnown().getOrNull()?.validity() ?: 0) + (if (webhookOutputFormat.asKnown().isPresent) 1 else 0) + + (if (webhookSigningSecret.asKnown().isPresent) 1 else 0) + (if (webhookUrl.asKnown().isPresent) 1 else 0) class WebhookEvent @@ -10213,6 +10275,7 @@ private constructor( webhookEvents == other.webhookEvents && webhookHeaders == other.webhookHeaders && webhookOutputFormat == other.webhookOutputFormat && + webhookSigningSecret == other.webhookSigningSecret && webhookUrl == other.webhookUrl && additionalProperties == other.additionalProperties } @@ -10222,6 +10285,7 @@ private constructor( webhookEvents, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties, ) @@ -10230,7 +10294,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" + "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookSigningSecret=$webhookSigningSecret, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetCreateParams.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetCreateParams.kt index 1617940..474e46f 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetCreateParams.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetCreateParams.kt @@ -847,6 +847,7 @@ 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, ) { @@ -862,10 +863,20 @@ private constructor( @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, webhookUrl, mutableMapOf()) + ) : this( + webhookEvents, + webhookHeaders, + webhookOutputFormat, + webhookSigningSecret, + webhookUrl, + mutableMapOf(), + ) /** * Events to subscribe to (e.g. 'parse.success', 'extract.error'). If null, all events are @@ -895,6 +906,18 @@ private constructor( 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") + /** * URL to receive webhook POST notifications * @@ -933,6 +956,16 @@ private constructor( @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]. * @@ -966,6 +999,7 @@ private 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() @@ -974,6 +1008,7 @@ private constructor( webhookEvents = webhookConfiguration.webhookEvents.map { it.toMutableList() } webhookHeaders = webhookConfiguration.webhookHeaders webhookOutputFormat = webhookConfiguration.webhookOutputFormat + webhookSigningSecret = webhookConfiguration.webhookSigningSecret webhookUrl = webhookConfiguration.webhookUrl additionalProperties = webhookConfiguration.additionalProperties.toMutableMap() } @@ -1053,6 +1088,33 @@ private constructor( 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 + } + /** URL to receive webhook POST notifications */ fun webhookUrl(webhookUrl: String?) = webhookUrl(JsonField.ofNullable(webhookUrl)) @@ -1097,6 +1159,7 @@ private constructor( (webhookEvents ?: JsonMissing.of()).map { it.toImmutable() }, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties.toMutableMap(), ) @@ -1121,6 +1184,7 @@ private constructor( webhookEvents().ifPresent { it.forEach { it.validate() } } webhookHeaders().ifPresent { it.validate() } webhookOutputFormat() + webhookSigningSecret() webhookUrl() validated = true } @@ -1144,6 +1208,7 @@ private constructor( (webhookEvents.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (webhookHeaders.asKnown().getOrNull()?.validity() ?: 0) + (if (webhookOutputFormat.asKnown().isPresent) 1 else 0) + + (if (webhookSigningSecret.asKnown().isPresent) 1 else 0) + (if (webhookUrl.asKnown().isPresent) 1 else 0) class WebhookEvent @JsonCreator private constructor(private val value: JsonField) : @@ -1565,6 +1630,7 @@ private constructor( webhookEvents == other.webhookEvents && webhookHeaders == other.webhookHeaders && webhookOutputFormat == other.webhookOutputFormat && + webhookSigningSecret == other.webhookSigningSecret && webhookUrl == other.webhookUrl && additionalProperties == other.additionalProperties } @@ -1574,6 +1640,7 @@ private constructor( webhookEvents, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties, ) @@ -1582,7 +1649,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" + "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookSigningSecret=$webhookSigningSecret, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetsJob.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetsJob.kt index 5dc0afb..aa819ce 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetsJob.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetsJob.kt @@ -1315,6 +1315,7 @@ 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, ) { @@ -1330,10 +1331,20 @@ private constructor( @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, webhookUrl, mutableMapOf()) + ) : this( + webhookEvents, + webhookHeaders, + webhookOutputFormat, + webhookSigningSecret, + webhookUrl, + mutableMapOf(), + ) /** * Events to subscribe to (e.g. 'parse.success', 'extract.error'). If null, all events @@ -1363,6 +1374,18 @@ private constructor( 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") + /** * URL to receive webhook POST notifications * @@ -1401,6 +1424,16 @@ private constructor( @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]. * @@ -1437,6 +1470,7 @@ private 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() @@ -1445,6 +1479,7 @@ private constructor( webhookEvents = webhookConfiguration.webhookEvents.map { it.toMutableList() } webhookHeaders = webhookConfiguration.webhookHeaders webhookOutputFormat = webhookConfiguration.webhookOutputFormat + webhookSigningSecret = webhookConfiguration.webhookSigningSecret webhookUrl = webhookConfiguration.webhookUrl additionalProperties = webhookConfiguration.additionalProperties.toMutableMap() } @@ -1526,6 +1561,33 @@ private constructor( 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 + } + /** URL to receive webhook POST notifications */ fun webhookUrl(webhookUrl: String?) = webhookUrl(JsonField.ofNullable(webhookUrl)) @@ -1575,6 +1637,7 @@ private constructor( (webhookEvents ?: JsonMissing.of()).map { it.toImmutable() }, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties.toMutableMap(), ) @@ -1600,6 +1663,7 @@ private constructor( webhookEvents().ifPresent { it.forEach { it.validate() } } webhookHeaders().ifPresent { it.validate() } webhookOutputFormat() + webhookSigningSecret() webhookUrl() validated = true } @@ -1623,6 +1687,7 @@ private constructor( (webhookEvents.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (webhookHeaders.asKnown().getOrNull()?.validity() ?: 0) + (if (webhookOutputFormat.asKnown().isPresent) 1 else 0) + + (if (webhookSigningSecret.asKnown().isPresent) 1 else 0) + (if (webhookUrl.asKnown().isPresent) 1 else 0) class WebhookEvent @@ -2052,6 +2117,7 @@ private constructor( webhookEvents == other.webhookEvents && webhookHeaders == other.webhookHeaders && webhookOutputFormat == other.webhookOutputFormat && + webhookSigningSecret == other.webhookSigningSecret && webhookUrl == other.webhookUrl && additionalProperties == other.additionalProperties } @@ -2061,6 +2127,7 @@ private constructor( webhookEvents, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties, ) @@ -2069,7 +2136,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" + "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookSigningSecret=$webhookSigningSecret, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/classifier/jobs/JobCreateParams.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/classifier/jobs/JobCreateParams.kt index 3636135..86c8d79 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/classifier/jobs/JobCreateParams.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/classifier/jobs/JobCreateParams.kt @@ -965,6 +965,7 @@ 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, ) { @@ -980,10 +981,20 @@ private constructor( @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, webhookUrl, mutableMapOf()) + ) : this( + webhookEvents, + webhookHeaders, + webhookOutputFormat, + webhookSigningSecret, + webhookUrl, + mutableMapOf(), + ) /** * Events that trigger this webhook. Options: 'parse.success' (job completed), 'parse.error' @@ -1015,6 +1026,18 @@ private constructor( 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 * @@ -1053,6 +1076,16 @@ private constructor( @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]. * @@ -1086,6 +1119,7 @@ private 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() @@ -1094,6 +1128,7 @@ private constructor( webhookEvents = webhookConfiguration.webhookEvents.map { it.toMutableList() } webhookHeaders = webhookConfiguration.webhookHeaders webhookOutputFormat = webhookConfiguration.webhookOutputFormat + webhookSigningSecret = webhookConfiguration.webhookSigningSecret webhookUrl = webhookConfiguration.webhookUrl additionalProperties = webhookConfiguration.additionalProperties.toMutableMap() } @@ -1181,6 +1216,33 @@ private constructor( 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)) @@ -1225,6 +1287,7 @@ private constructor( (webhookEvents ?: JsonMissing.of()).map { it.toImmutable() }, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties.toMutableMap(), ) @@ -1249,6 +1312,7 @@ private constructor( webhookEvents() webhookHeaders().ifPresent { it.validate() } webhookOutputFormat().ifPresent { it.validate() } + webhookSigningSecret() webhookUrl() validated = true } @@ -1272,6 +1336,7 @@ private constructor( (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) /** @@ -1548,6 +1613,7 @@ private constructor( webhookEvents == other.webhookEvents && webhookHeaders == other.webhookHeaders && webhookOutputFormat == other.webhookOutputFormat && + webhookSigningSecret == other.webhookSigningSecret && webhookUrl == other.webhookUrl && additionalProperties == other.additionalProperties } @@ -1557,6 +1623,7 @@ private constructor( webhookEvents, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties, ) @@ -1565,7 +1632,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" + "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookSigningSecret=$webhookSigningSecret, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/classify/ClassifyCreateRequest.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/classify/ClassifyCreateRequest.kt index 2bb7e31..a1dae1b 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/classify/ClassifyCreateRequest.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/classify/ClassifyCreateRequest.kt @@ -465,6 +465,7 @@ 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, ) { @@ -480,10 +481,20 @@ private constructor( @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, webhookUrl, mutableMapOf()) + ) : this( + webhookEvents, + webhookHeaders, + webhookOutputFormat, + webhookSigningSecret, + webhookUrl, + mutableMapOf(), + ) /** * Events to subscribe to (e.g. 'parse.success', 'extract.error'). If null, all events are @@ -513,6 +524,18 @@ private constructor( 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") + /** * URL to receive webhook POST notifications * @@ -551,6 +574,16 @@ private constructor( @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]. * @@ -584,6 +617,7 @@ private 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() @@ -592,6 +626,7 @@ private constructor( webhookEvents = webhookConfiguration.webhookEvents.map { it.toMutableList() } webhookHeaders = webhookConfiguration.webhookHeaders webhookOutputFormat = webhookConfiguration.webhookOutputFormat + webhookSigningSecret = webhookConfiguration.webhookSigningSecret webhookUrl = webhookConfiguration.webhookUrl additionalProperties = webhookConfiguration.additionalProperties.toMutableMap() } @@ -671,6 +706,33 @@ private constructor( 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 + } + /** URL to receive webhook POST notifications */ fun webhookUrl(webhookUrl: String?) = webhookUrl(JsonField.ofNullable(webhookUrl)) @@ -715,6 +777,7 @@ private constructor( (webhookEvents ?: JsonMissing.of()).map { it.toImmutable() }, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties.toMutableMap(), ) @@ -739,6 +802,7 @@ private constructor( webhookEvents().ifPresent { it.forEach { it.validate() } } webhookHeaders().ifPresent { it.validate() } webhookOutputFormat() + webhookSigningSecret() webhookUrl() validated = true } @@ -762,6 +826,7 @@ private constructor( (webhookEvents.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (webhookHeaders.asKnown().getOrNull()?.validity() ?: 0) + (if (webhookOutputFormat.asKnown().isPresent) 1 else 0) + + (if (webhookSigningSecret.asKnown().isPresent) 1 else 0) + (if (webhookUrl.asKnown().isPresent) 1 else 0) class WebhookEvent @JsonCreator private constructor(private val value: JsonField) : @@ -1183,6 +1248,7 @@ private constructor( webhookEvents == other.webhookEvents && webhookHeaders == other.webhookHeaders && webhookOutputFormat == other.webhookOutputFormat && + webhookSigningSecret == other.webhookSigningSecret && webhookUrl == other.webhookUrl && additionalProperties == other.additionalProperties } @@ -1192,6 +1258,7 @@ private constructor( webhookEvents, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties, ) @@ -1200,7 +1267,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" + "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookSigningSecret=$webhookSigningSecret, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2Parameters.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2Parameters.kt index 17e0697..d50d3b7 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2Parameters.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2Parameters.kt @@ -17693,6 +17693,7 @@ 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, ) { @@ -17708,10 +17709,20 @@ private constructor( @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, webhookUrl, mutableMapOf()) + ) : this( + webhookEvents, + webhookHeaders, + webhookOutputFormat, + webhookSigningSecret, + webhookUrl, + mutableMapOf(), + ) /** * Events that trigger this webhook. Options: 'parse.success' (job completed), 'parse.error' @@ -17743,6 +17754,18 @@ private constructor( 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 * @@ -17781,6 +17804,16 @@ private constructor( @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]. * @@ -17814,6 +17847,7 @@ private 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() @@ -17822,6 +17856,7 @@ private constructor( webhookEvents = webhookConfiguration.webhookEvents.map { it.toMutableList() } webhookHeaders = webhookConfiguration.webhookHeaders webhookOutputFormat = webhookConfiguration.webhookOutputFormat + webhookSigningSecret = webhookConfiguration.webhookSigningSecret webhookUrl = webhookConfiguration.webhookUrl additionalProperties = webhookConfiguration.additionalProperties.toMutableMap() } @@ -17909,6 +17944,33 @@ private constructor( 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)) @@ -17953,6 +18015,7 @@ private constructor( (webhookEvents ?: JsonMissing.of()).map { it.toImmutable() }, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties.toMutableMap(), ) @@ -17977,6 +18040,7 @@ private constructor( webhookEvents() webhookHeaders().ifPresent { it.validate() } webhookOutputFormat().ifPresent { it.validate() } + webhookSigningSecret() webhookUrl() validated = true } @@ -18000,6 +18064,7 @@ private constructor( (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) /** @@ -18276,6 +18341,7 @@ private constructor( webhookEvents == other.webhookEvents && webhookHeaders == other.webhookHeaders && webhookOutputFormat == other.webhookOutputFormat && + webhookSigningSecret == other.webhookSigningSecret && webhookUrl == other.webhookUrl && additionalProperties == other.additionalProperties } @@ -18285,6 +18351,7 @@ private constructor( webhookEvents, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties, ) @@ -18293,7 +18360,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" + "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookSigningSecret=$webhookSigningSecret, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/extract/ExtractV2JobCreate.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/extract/ExtractV2JobCreate.kt index 2eec138..22ff640 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/extract/ExtractV2JobCreate.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/extract/ExtractV2JobCreate.kt @@ -332,6 +332,7 @@ 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, ) { @@ -347,10 +348,20 @@ private constructor( @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, webhookUrl, mutableMapOf()) + ) : this( + webhookEvents, + webhookHeaders, + webhookOutputFormat, + webhookSigningSecret, + webhookUrl, + mutableMapOf(), + ) /** * Events to subscribe to (e.g. 'parse.success', 'extract.error'). If null, all events are @@ -380,6 +391,18 @@ private constructor( 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") + /** * URL to receive webhook POST notifications * @@ -418,6 +441,16 @@ private constructor( @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]. * @@ -451,6 +484,7 @@ private 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() @@ -459,6 +493,7 @@ private constructor( webhookEvents = webhookConfiguration.webhookEvents.map { it.toMutableList() } webhookHeaders = webhookConfiguration.webhookHeaders webhookOutputFormat = webhookConfiguration.webhookOutputFormat + webhookSigningSecret = webhookConfiguration.webhookSigningSecret webhookUrl = webhookConfiguration.webhookUrl additionalProperties = webhookConfiguration.additionalProperties.toMutableMap() } @@ -538,6 +573,33 @@ private constructor( 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 + } + /** URL to receive webhook POST notifications */ fun webhookUrl(webhookUrl: String?) = webhookUrl(JsonField.ofNullable(webhookUrl)) @@ -582,6 +644,7 @@ private constructor( (webhookEvents ?: JsonMissing.of()).map { it.toImmutable() }, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties.toMutableMap(), ) @@ -606,6 +669,7 @@ private constructor( webhookEvents().ifPresent { it.forEach { it.validate() } } webhookHeaders().ifPresent { it.validate() } webhookOutputFormat() + webhookSigningSecret() webhookUrl() validated = true } @@ -629,6 +693,7 @@ private constructor( (webhookEvents.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (webhookHeaders.asKnown().getOrNull()?.validity() ?: 0) + (if (webhookOutputFormat.asKnown().isPresent) 1 else 0) + + (if (webhookSigningSecret.asKnown().isPresent) 1 else 0) + (if (webhookUrl.asKnown().isPresent) 1 else 0) class WebhookEvent @JsonCreator private constructor(private val value: JsonField) : @@ -1050,6 +1115,7 @@ private constructor( webhookEvents == other.webhookEvents && webhookHeaders == other.webhookHeaders && webhookOutputFormat == other.webhookOutputFormat && + webhookSigningSecret == other.webhookSigningSecret && webhookUrl == other.webhookUrl && additionalProperties == other.additionalProperties } @@ -1059,6 +1125,7 @@ private constructor( webhookEvents, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties, ) @@ -1067,7 +1134,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" + "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookSigningSecret=$webhookSigningSecret, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParams.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParams.kt index 698b39a..63fae27 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParams.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParams.kt @@ -18755,6 +18755,7 @@ 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, ) { @@ -18770,10 +18771,20 @@ private constructor( @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, webhookUrl, mutableMapOf()) + ) : this( + webhookEvents, + webhookHeaders, + webhookOutputFormat, + webhookSigningSecret, + webhookUrl, + mutableMapOf(), + ) /** * Events that trigger this webhook. Options: 'parse.success' (job completed), 'parse.error' @@ -18805,6 +18816,18 @@ private constructor( 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 * @@ -18843,6 +18866,16 @@ private constructor( @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]. * @@ -18876,6 +18909,7 @@ private 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() @@ -18884,6 +18918,7 @@ private constructor( webhookEvents = webhookConfiguration.webhookEvents.map { it.toMutableList() } webhookHeaders = webhookConfiguration.webhookHeaders webhookOutputFormat = webhookConfiguration.webhookOutputFormat + webhookSigningSecret = webhookConfiguration.webhookSigningSecret webhookUrl = webhookConfiguration.webhookUrl additionalProperties = webhookConfiguration.additionalProperties.toMutableMap() } @@ -18971,6 +19006,33 @@ private constructor( 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)) @@ -19015,6 +19077,7 @@ private constructor( (webhookEvents ?: JsonMissing.of()).map { it.toImmutable() }, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties.toMutableMap(), ) @@ -19039,6 +19102,7 @@ private constructor( webhookEvents() webhookHeaders().ifPresent { it.validate() } webhookOutputFormat().ifPresent { it.validate() } + webhookSigningSecret() webhookUrl() validated = true } @@ -19062,6 +19126,7 @@ private constructor( (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) /** @@ -19338,6 +19403,7 @@ private constructor( webhookEvents == other.webhookEvents && webhookHeaders == other.webhookHeaders && webhookOutputFormat == other.webhookOutputFormat && + webhookSigningSecret == other.webhookSigningSecret && webhookUrl == other.webhookUrl && additionalProperties == other.additionalProperties } @@ -19347,6 +19413,7 @@ private constructor( webhookEvents, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties, ) @@ -19355,7 +19422,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" + "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookSigningSecret=$webhookSigningSecret, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/pipelines/LlamaParseParameters.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/pipelines/LlamaParseParameters.kt index 016deaf..b36fcbb 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/pipelines/LlamaParseParameters.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/pipelines/LlamaParseParameters.kt @@ -6316,6 +6316,7 @@ 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, ) { @@ -6331,10 +6332,20 @@ private constructor( @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, webhookUrl, mutableMapOf()) + ) : this( + webhookEvents, + webhookHeaders, + webhookOutputFormat, + webhookSigningSecret, + webhookUrl, + mutableMapOf(), + ) /** * Events to subscribe to (e.g. 'parse.success', 'extract.error'). If null, all events are @@ -6364,6 +6375,18 @@ private constructor( 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") + /** * URL to receive webhook POST notifications * @@ -6402,6 +6425,16 @@ private constructor( @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]. * @@ -6435,6 +6468,7 @@ private 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() @@ -6443,6 +6477,7 @@ private constructor( webhookEvents = webhookConfiguration.webhookEvents.map { it.toMutableList() } webhookHeaders = webhookConfiguration.webhookHeaders webhookOutputFormat = webhookConfiguration.webhookOutputFormat + webhookSigningSecret = webhookConfiguration.webhookSigningSecret webhookUrl = webhookConfiguration.webhookUrl additionalProperties = webhookConfiguration.additionalProperties.toMutableMap() } @@ -6522,6 +6557,33 @@ private constructor( 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 + } + /** URL to receive webhook POST notifications */ fun webhookUrl(webhookUrl: String?) = webhookUrl(JsonField.ofNullable(webhookUrl)) @@ -6566,6 +6628,7 @@ private constructor( (webhookEvents ?: JsonMissing.of()).map { it.toImmutable() }, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties.toMutableMap(), ) @@ -6590,6 +6653,7 @@ private constructor( webhookEvents().ifPresent { it.forEach { it.validate() } } webhookHeaders().ifPresent { it.validate() } webhookOutputFormat() + webhookSigningSecret() webhookUrl() validated = true } @@ -6613,6 +6677,7 @@ private constructor( (webhookEvents.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (webhookHeaders.asKnown().getOrNull()?.validity() ?: 0) + (if (webhookOutputFormat.asKnown().isPresent) 1 else 0) + + (if (webhookSigningSecret.asKnown().isPresent) 1 else 0) + (if (webhookUrl.asKnown().isPresent) 1 else 0) class WebhookEvent @JsonCreator private constructor(private val value: JsonField) : @@ -7034,6 +7099,7 @@ private constructor( webhookEvents == other.webhookEvents && webhookHeaders == other.webhookHeaders && webhookOutputFormat == other.webhookOutputFormat && + webhookSigningSecret == other.webhookSigningSecret && webhookUrl == other.webhookUrl && additionalProperties == other.additionalProperties } @@ -7043,6 +7109,7 @@ private constructor( webhookEvents, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties, ) @@ -7051,7 +7118,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" + "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookSigningSecret=$webhookSigningSecret, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/sheets/SheetCreateParams.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/sheets/SheetCreateParams.kt index 2f051c4..b212873 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/sheets/SheetCreateParams.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/sheets/SheetCreateParams.kt @@ -847,6 +847,7 @@ 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, ) { @@ -862,10 +863,20 @@ private constructor( @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, webhookUrl, mutableMapOf()) + ) : this( + webhookEvents, + webhookHeaders, + webhookOutputFormat, + webhookSigningSecret, + webhookUrl, + mutableMapOf(), + ) /** * Events to subscribe to (e.g. 'parse.success', 'extract.error'). If null, all events are @@ -895,6 +906,18 @@ private constructor( 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") + /** * URL to receive webhook POST notifications * @@ -933,6 +956,16 @@ private constructor( @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]. * @@ -966,6 +999,7 @@ private 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() @@ -974,6 +1008,7 @@ private constructor( webhookEvents = webhookConfiguration.webhookEvents.map { it.toMutableList() } webhookHeaders = webhookConfiguration.webhookHeaders webhookOutputFormat = webhookConfiguration.webhookOutputFormat + webhookSigningSecret = webhookConfiguration.webhookSigningSecret webhookUrl = webhookConfiguration.webhookUrl additionalProperties = webhookConfiguration.additionalProperties.toMutableMap() } @@ -1053,6 +1088,33 @@ private constructor( 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 + } + /** URL to receive webhook POST notifications */ fun webhookUrl(webhookUrl: String?) = webhookUrl(JsonField.ofNullable(webhookUrl)) @@ -1097,6 +1159,7 @@ private constructor( (webhookEvents ?: JsonMissing.of()).map { it.toImmutable() }, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties.toMutableMap(), ) @@ -1121,6 +1184,7 @@ private constructor( webhookEvents().ifPresent { it.forEach { it.validate() } } webhookHeaders().ifPresent { it.validate() } webhookOutputFormat() + webhookSigningSecret() webhookUrl() validated = true } @@ -1144,6 +1208,7 @@ private constructor( (webhookEvents.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (webhookHeaders.asKnown().getOrNull()?.validity() ?: 0) + (if (webhookOutputFormat.asKnown().isPresent) 1 else 0) + + (if (webhookSigningSecret.asKnown().isPresent) 1 else 0) + (if (webhookUrl.asKnown().isPresent) 1 else 0) class WebhookEvent @JsonCreator private constructor(private val value: JsonField) : @@ -1565,6 +1630,7 @@ private constructor( webhookEvents == other.webhookEvents && webhookHeaders == other.webhookHeaders && webhookOutputFormat == other.webhookOutputFormat && + webhookSigningSecret == other.webhookSigningSecret && webhookUrl == other.webhookUrl && additionalProperties == other.additionalProperties } @@ -1574,6 +1640,7 @@ private constructor( webhookEvents, webhookHeaders, webhookOutputFormat, + webhookSigningSecret, webhookUrl, additionalProperties, ) @@ -1582,7 +1649,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" + "WebhookConfiguration{webhookEvents=$webhookEvents, webhookHeaders=$webhookHeaders, webhookOutputFormat=$webhookOutputFormat, webhookSigningSecret=$webhookSigningSecret, webhookUrl=$webhookUrl, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/batch/BatchCreateParamsTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/batch/BatchCreateParamsTest.kt index f13c743..22d36ee 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/batch/BatchCreateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/batch/BatchCreateParamsTest.kt @@ -215,6 +215,7 @@ internal class BatchCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -451,6 +452,7 @@ internal class BatchCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -705,6 +707,7 @@ internal class BatchCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -964,6 +967,7 @@ internal class BatchCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -1197,6 +1201,7 @@ internal class BatchCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/batch/jobitems/JobItemGetProcessingResultsResponseTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/batch/jobitems/JobItemGetProcessingResultsResponseTest.kt index 8447eb0..612ad46 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/batch/jobitems/JobItemGetProcessingResultsResponseTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/batch/jobitems/JobItemGetProcessingResultsResponseTest.kt @@ -261,6 +261,7 @@ internal class JobItemGetProcessingResultsResponseTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl( "https://example.com/webhooks/llamacloud" ) @@ -537,6 +538,7 @@ internal class JobItemGetProcessingResultsResponseTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -818,6 +820,7 @@ internal class JobItemGetProcessingResultsResponseTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl( "https://example.com/webhooks/llamacloud" ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetCreateParamsTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetCreateParamsTest.kt index 6fd3ab2..f0c1b84 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetCreateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetCreateParamsTest.kt @@ -55,6 +55,7 @@ internal class SheetCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -110,6 +111,7 @@ internal class SheetCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -185,6 +187,7 @@ internal class SheetCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -235,6 +238,7 @@ internal class SheetCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetListPageResponseTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetListPageResponseTest.kt index 50e9205..a984e11 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetListPageResponseTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetListPageResponseTest.kt @@ -114,6 +114,7 @@ internal class SheetListPageResponseTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -238,6 +239,7 @@ internal class SheetListPageResponseTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -370,6 +372,7 @@ internal class SheetListPageResponseTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetsJobTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetsJobTest.kt index aa78da1..e3c10dd 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetsJobTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/sheets/SheetsJobTest.kt @@ -103,6 +103,7 @@ internal class SheetsJobTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -216,6 +217,7 @@ internal class SheetsJobTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -334,6 +336,7 @@ internal class SheetsJobTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/classifier/jobs/JobCreateParamsTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/classifier/jobs/JobCreateParamsTest.kt index b30469f..b43c613 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/classifier/jobs/JobCreateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/classifier/jobs/JobCreateParamsTest.kt @@ -43,6 +43,7 @@ internal class JobCreateParamsTest { .webhookOutputFormat( JobCreateParams.WebhookConfiguration.WebhookOutputFormat.JSON ) + .webhookSigningSecret("webhook_signing_secret") .webhookUrl("https:") .build() ) @@ -82,6 +83,7 @@ internal class JobCreateParamsTest { .webhookOutputFormat( JobCreateParams.WebhookConfiguration.WebhookOutputFormat.JSON ) + .webhookSigningSecret("webhook_signing_secret") .webhookUrl("https:") .build() ) @@ -149,6 +151,7 @@ internal class JobCreateParamsTest { .webhookOutputFormat( JobCreateParams.WebhookConfiguration.WebhookOutputFormat.JSON ) + .webhookSigningSecret("webhook_signing_secret") .webhookUrl("https:") .build() ) @@ -186,6 +189,7 @@ internal class JobCreateParamsTest { .webhookOutputFormat( JobCreateParams.WebhookConfiguration.WebhookOutputFormat.JSON ) + .webhookSigningSecret("webhook_signing_secret") .webhookUrl("https:") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/classify/ClassifyCreateParamsTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/classify/ClassifyCreateParamsTest.kt index 82fba1a..d6c3bc6 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/classify/ClassifyCreateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/classify/ClassifyCreateParamsTest.kt @@ -59,6 +59,7 @@ internal class ClassifyCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -120,6 +121,7 @@ internal class ClassifyCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -203,6 +205,7 @@ internal class ClassifyCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -258,6 +261,7 @@ internal class ClassifyCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/classify/ClassifyCreateRequestTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/classify/ClassifyCreateRequestTest.kt index df3ff47..5d7af27 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/classify/ClassifyCreateRequestTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/classify/ClassifyCreateRequestTest.kt @@ -57,6 +57,7 @@ internal class ClassifyCreateRequestTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -105,6 +106,7 @@ internal class ClassifyCreateRequestTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -157,6 +159,7 @@ internal class ClassifyCreateRequestTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2ParametersTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2ParametersTest.kt index 85cd57d..080e303 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2ParametersTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2ParametersTest.kt @@ -286,6 +286,7 @@ internal class ParseV2ParametersTest { .webhookOutputFormat( ParseV2Parameters.WebhookConfiguration.WebhookOutputFormat.JSON ) + .webhookSigningSecret("webhook_signing_secret") .webhookUrl("https:") .build() ) @@ -562,6 +563,7 @@ internal class ParseV2ParametersTest { .webhookOutputFormat( ParseV2Parameters.WebhookConfiguration.WebhookOutputFormat.JSON ) + .webhookSigningSecret("webhook_signing_secret") .webhookUrl("https:") .build() ) @@ -842,6 +844,7 @@ internal class ParseV2ParametersTest { .webhookOutputFormat( ParseV2Parameters.WebhookConfiguration.WebhookOutputFormat.JSON ) + .webhookSigningSecret("webhook_signing_secret") .webhookUrl("https:") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/extract/ExtractCreateParamsTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/extract/ExtractCreateParamsTest.kt index 1b3ccbd..e104789 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/extract/ExtractCreateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/extract/ExtractCreateParamsTest.kt @@ -66,6 +66,7 @@ internal class ExtractCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -136,6 +137,7 @@ internal class ExtractCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -232,6 +234,7 @@ internal class ExtractCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -294,6 +297,7 @@ internal class ExtractCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/extract/ExtractV2JobCreateTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/extract/ExtractV2JobCreateTest.kt index 71266d5..c325dac 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/extract/ExtractV2JobCreateTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/extract/ExtractV2JobCreateTest.kt @@ -65,6 +65,7 @@ internal class ExtractV2JobCreateTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -121,6 +122,7 @@ internal class ExtractV2JobCreateTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -181,6 +183,7 @@ internal class ExtractV2JobCreateTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParamsTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParamsTest.kt index 4de6ab5..dd7a8d6 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParamsTest.kt @@ -282,6 +282,7 @@ internal class ParsingCreateParamsTest { .webhookOutputFormat( ParsingCreateParams.WebhookConfiguration.WebhookOutputFormat.JSON ) + .webhookSigningSecret("webhook_signing_secret") .webhookUrl("https:") .build() ) @@ -570,6 +571,7 @@ internal class ParsingCreateParamsTest { .webhookOutputFormat( ParsingCreateParams.WebhookConfiguration.WebhookOutputFormat.JSON ) + .webhookSigningSecret("webhook_signing_secret") .webhookUrl("https:") .build() ) @@ -881,6 +883,7 @@ internal class ParsingCreateParamsTest { .webhookOutputFormat( ParsingCreateParams.WebhookConfiguration.WebhookOutputFormat.JSON ) + .webhookSigningSecret("webhook_signing_secret") .webhookUrl("https:") .build() ) @@ -1163,6 +1166,7 @@ internal class ParsingCreateParamsTest { .webhookOutputFormat( ParsingCreateParams.WebhookConfiguration.WebhookOutputFormat.JSON ) + .webhookSigningSecret("webhook_signing_secret") .webhookUrl("https:") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/LlamaParseParametersTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/LlamaParseParametersTest.kt index aaf9eb5..d7bf29f 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/LlamaParseParametersTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/LlamaParseParametersTest.kt @@ -156,6 +156,7 @@ internal class LlamaParseParametersTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -310,6 +311,7 @@ internal class LlamaParseParametersTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -459,6 +461,7 @@ internal class LlamaParseParametersTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineCreateParamsTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineCreateParamsTest.kt index ccf5eb5..fdd70be 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineCreateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineCreateParamsTest.kt @@ -212,6 +212,7 @@ internal class PipelineCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -492,6 +493,7 @@ internal class PipelineCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -794,6 +796,7 @@ internal class PipelineCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -1063,6 +1066,7 @@ internal class PipelineCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineCreateTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineCreateTest.kt index 3de1e67..35866f1 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineCreateTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineCreateTest.kt @@ -208,6 +208,7 @@ internal class PipelineCreateTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -468,6 +469,7 @@ internal class PipelineCreateTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -736,6 +738,7 @@ internal class PipelineCreateTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineTest.kt index b450457..6794e75 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineTest.kt @@ -267,6 +267,7 @@ internal class PipelineTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -584,6 +585,7 @@ internal class PipelineTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -909,6 +911,7 @@ internal class PipelineTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineUpdateParamsTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineUpdateParamsTest.kt index e5f377e..aba2c68 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineUpdateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineUpdateParamsTest.kt @@ -202,6 +202,7 @@ internal class PipelineUpdateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -475,6 +476,7 @@ internal class PipelineUpdateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -735,6 +737,7 @@ internal class PipelineUpdateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineUpsertParamsTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineUpsertParamsTest.kt index e6111ec..b83d052 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineUpsertParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/pipelines/PipelineUpsertParamsTest.kt @@ -212,6 +212,7 @@ internal class PipelineUpsertParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -492,6 +493,7 @@ internal class PipelineUpsertParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -794,6 +796,7 @@ internal class PipelineUpsertParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -1063,6 +1066,7 @@ internal class PipelineUpsertParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/sheets/SheetCreateParamsTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/sheets/SheetCreateParamsTest.kt index 33a34fe..746aed4 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/sheets/SheetCreateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/sheets/SheetCreateParamsTest.kt @@ -56,6 +56,7 @@ internal class SheetCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -111,6 +112,7 @@ internal class SheetCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -186,6 +188,7 @@ internal class SheetCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -236,6 +239,7 @@ internal class SheetCreateParamsTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/sheets/SheetListPageResponseTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/sheets/SheetListPageResponseTest.kt index 1b3b01c..f1f3704 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/sheets/SheetListPageResponseTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/sheets/SheetListPageResponseTest.kt @@ -116,6 +116,7 @@ internal class SheetListPageResponseTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -240,6 +241,7 @@ internal class SheetListPageResponseTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -372,6 +374,7 @@ internal class SheetListPageResponseTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/ServiceParamsTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/ServiceParamsTest.kt index 28d7d7c..735bfbd 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/ServiceParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/ServiceParamsTest.kt @@ -346,6 +346,7 @@ internal class ServiceParamsTest { .webhookOutputFormat( ParsingCreateParams.WebhookConfiguration.WebhookOutputFormat.JSON ) + .webhookSigningSecret("webhook_signing_secret") .webhookUrl("https:") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ClassifyServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ClassifyServiceAsyncTest.kt index e055a94..089ad14 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ClassifyServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ClassifyServiceAsyncTest.kt @@ -71,6 +71,7 @@ internal class ClassifyServiceAsyncTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ExtractServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ExtractServiceAsyncTest.kt index 333232a..84dad0f 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ExtractServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ExtractServiceAsyncTest.kt @@ -88,6 +88,7 @@ internal class ExtractServiceAsyncTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ParsingServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ParsingServiceAsyncTest.kt index ef2349b..8d558a3 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ParsingServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ParsingServiceAsyncTest.kt @@ -303,6 +303,7 @@ internal class ParsingServiceAsyncTest { .webhookOutputFormat( ParsingCreateParams.WebhookConfiguration.WebhookOutputFormat.JSON ) + .webhookSigningSecret("webhook_signing_secret") .webhookUrl("https:") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/PipelineServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/PipelineServiceAsyncTest.kt index e58e233..4c73e8e 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/PipelineServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/PipelineServiceAsyncTest.kt @@ -251,6 +251,7 @@ internal class PipelineServiceAsyncTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -581,6 +582,7 @@ internal class PipelineServiceAsyncTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -938,6 +940,7 @@ internal class PipelineServiceAsyncTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/SheetServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/SheetServiceAsyncTest.kt index 66cd8d9..1114f2f 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/SheetServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/SheetServiceAsyncTest.kt @@ -68,6 +68,7 @@ internal class SheetServiceAsyncTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/beta/BatchServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/beta/BatchServiceAsyncTest.kt index 361f0ed..4732aa5 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/beta/BatchServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/beta/BatchServiceAsyncTest.kt @@ -238,6 +238,7 @@ internal class BatchServiceAsyncTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/beta/SheetServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/beta/SheetServiceAsyncTest.kt index 76a8161..8aa973c 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/beta/SheetServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/beta/SheetServiceAsyncTest.kt @@ -68,6 +68,7 @@ internal class SheetServiceAsyncTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/classifier/JobServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/classifier/JobServiceAsyncTest.kt index 73c4a0f..3e25832 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/classifier/JobServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/classifier/JobServiceAsyncTest.kt @@ -53,6 +53,7 @@ internal class JobServiceAsyncTest { .webhookOutputFormat( JobCreateParams.WebhookConfiguration.WebhookOutputFormat.JSON ) + .webhookSigningSecret("webhook_signing_secret") .webhookUrl("https:") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ClassifyServiceTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ClassifyServiceTest.kt index 89c26cd..0e67074 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ClassifyServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ClassifyServiceTest.kt @@ -71,6 +71,7 @@ internal class ClassifyServiceTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ExtractServiceTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ExtractServiceTest.kt index 4638b91..5807d41 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ExtractServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ExtractServiceTest.kt @@ -88,6 +88,7 @@ internal class ExtractServiceTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ParsingServiceTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ParsingServiceTest.kt index 01fd2ee..f757f33 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ParsingServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ParsingServiceTest.kt @@ -303,6 +303,7 @@ internal class ParsingServiceTest { .webhookOutputFormat( ParsingCreateParams.WebhookConfiguration.WebhookOutputFormat.JSON ) + .webhookSigningSecret("webhook_signing_secret") .webhookUrl("https:") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/PipelineServiceTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/PipelineServiceTest.kt index 1322c16..c4e5ece 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/PipelineServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/PipelineServiceTest.kt @@ -251,6 +251,7 @@ internal class PipelineServiceTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -579,6 +580,7 @@ internal class PipelineServiceTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) @@ -930,6 +932,7 @@ internal class PipelineServiceTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/SheetServiceTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/SheetServiceTest.kt index 51e1ac8..8398b66 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/SheetServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/SheetServiceTest.kt @@ -68,6 +68,7 @@ internal class SheetServiceTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/beta/BatchServiceTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/beta/BatchServiceTest.kt index 62f0ab8..5a1c120 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/beta/BatchServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/beta/BatchServiceTest.kt @@ -238,6 +238,7 @@ internal class BatchServiceTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/beta/SheetServiceTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/beta/SheetServiceTest.kt index db67075..c463463 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/beta/SheetServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/beta/SheetServiceTest.kt @@ -68,6 +68,7 @@ internal class SheetServiceTest { .build() ) .webhookOutputFormat("json") + .webhookSigningSecret("whsec_...") .webhookUrl("https://example.com/webhooks/llamacloud") .build() ) diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/classifier/JobServiceTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/classifier/JobServiceTest.kt index 45a3257..c6f6f9a 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/classifier/JobServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/classifier/JobServiceTest.kt @@ -53,6 +53,7 @@ internal class JobServiceTest { .webhookOutputFormat( JobCreateParams.WebhookConfiguration.WebhookOutputFormat.JSON ) + .webhookSigningSecret("webhook_signing_secret") .webhookUrl("https:") .build() ) From a0a2a8143a22f1d0a87f91046795a02a10fea13a Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Sat, 27 Jun 2026 03:49:26 +0000 Subject: [PATCH 04/10] Add immutable user_metadata tags to v2 parse jobs (#21177) Stainless-Generated-From: 5e982f7908e22cc6dd5ee4c2957bc2305a7fafd1 --- .../api/models/parsing/ParsingCreateParams.kt | 209 +++++++++++++++++- .../models/parsing/ParsingCreateResponse.kt | 174 ++++++++++++++- .../api/models/parsing/ParsingGetResponse.kt | 166 +++++++++++++- .../api/models/parsing/ParsingListResponse.kt | 174 ++++++++++++++- .../models/parsing/ParsingCreateParamsTest.kt | 25 +++ .../parsing/ParsingCreateResponseTest.kt | 20 ++ .../models/parsing/ParsingGetResponseTest.kt | 18 ++ .../parsing/ParsingListPageResponseTest.kt | 19 ++ .../models/parsing/ParsingListResponseTest.kt | 20 ++ .../api/services/ServiceParamsTest.kt | 6 + .../services/async/ParsingServiceAsyncTest.kt | 6 + .../services/blocking/ParsingServiceTest.kt | 6 + 12 files changed, 834 insertions(+), 9 deletions(-) diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParams.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParams.kt index 63fae27..41bc497 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParams.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParams.kt @@ -212,6 +212,16 @@ private constructor( */ fun sourceUrl(): Optional = body.sourceUrl() + /** + * Arbitrary key/value tags to attach to this job. Returned when retrieving the job. Not + * searchable. Limits apply to the number of entries and the length of keys and values; + * oversized metadata is rejected. + * + * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun userMetadata(): Optional = body.userMetadata() + /** * Webhook endpoints for job status notifications. Multiple webhooks can be configured for * different events or services @@ -328,6 +338,13 @@ private constructor( */ fun _sourceUrl(): JsonField = body._sourceUrl() + /** + * Returns the raw JSON value of [userMetadata]. + * + * Unlike [userMetadata], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _userMetadata(): JsonField = body._userMetadata() + /** * Returns the raw JSON value of [webhookConfigurations]. * @@ -693,6 +710,28 @@ private constructor( */ fun sourceUrl(sourceUrl: JsonField) = apply { body.sourceUrl(sourceUrl) } + /** + * Arbitrary key/value tags to attach to this job. Returned when retrieving the job. Not + * searchable. Limits apply to the number of entries and the length of keys and values; + * oversized metadata is rejected. + */ + fun userMetadata(userMetadata: UserMetadata?) = apply { body.userMetadata(userMetadata) } + + /** Alias for calling [Builder.userMetadata] with `userMetadata.orElse(null)`. */ + fun userMetadata(userMetadata: Optional) = + userMetadata(userMetadata.getOrNull()) + + /** + * Sets [Builder.userMetadata] to an arbitrary JSON value. + * + * You should usually call [Builder.userMetadata] with a well-typed [UserMetadata] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun userMetadata(userMetadata: JsonField) = apply { + body.userMetadata(userMetadata) + } + /** * Webhook endpoints for job status notifications. Multiple webhooks can be configured for * different events or services @@ -900,6 +939,7 @@ private constructor( private val processingControl: JsonField, private val processingOptions: JsonField, private val sourceUrl: JsonField, + private val userMetadata: JsonField, private val webhookConfigurations: JsonField>, private val additionalProperties: MutableMap, ) { @@ -946,6 +986,9 @@ private constructor( @JsonProperty("source_url") @ExcludeMissing sourceUrl: JsonField = JsonMissing.of(), + @JsonProperty("user_metadata") + @ExcludeMissing + userMetadata: JsonField = JsonMissing.of(), @JsonProperty("webhook_configurations") @ExcludeMissing webhookConfigurations: JsonField> = JsonMissing.of(), @@ -966,6 +1009,7 @@ private constructor( processingControl, processingOptions, sourceUrl, + userMetadata, webhookConfigurations, mutableMapOf(), ) @@ -1125,6 +1169,16 @@ private constructor( */ fun sourceUrl(): Optional = sourceUrl.getOptional("source_url") + /** + * Arbitrary key/value tags to attach to this job. Returned when retrieving the job. Not + * searchable. Limits apply to the number of entries and the length of keys and values; + * oversized metadata is rejected. + * + * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun userMetadata(): Optional = userMetadata.getOptional("user_metadata") + /** * Webhook endpoints for job status notifications. Multiple webhooks can be configured for * different events or services @@ -1265,6 +1319,16 @@ private constructor( */ @JsonProperty("source_url") @ExcludeMissing fun _sourceUrl(): JsonField = sourceUrl + /** + * Returns the raw JSON value of [userMetadata]. + * + * Unlike [userMetadata], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("user_metadata") + @ExcludeMissing + fun _userMetadata(): JsonField = userMetadata + /** * Returns the raw JSON value of [webhookConfigurations]. * @@ -1320,6 +1384,7 @@ private constructor( private var processingControl: JsonField = JsonMissing.of() private var processingOptions: JsonField = JsonMissing.of() private var sourceUrl: JsonField = JsonMissing.of() + private var userMetadata: JsonField = JsonMissing.of() private var webhookConfigurations: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -1341,6 +1406,7 @@ private constructor( processingControl = body.processingControl processingOptions = body.processingOptions sourceUrl = body.sourceUrl + userMetadata = body.userMetadata webhookConfigurations = body.webhookConfigurations.map { it.toMutableList() } additionalProperties = body.additionalProperties.toMutableMap() } @@ -1642,6 +1708,29 @@ private constructor( */ fun sourceUrl(sourceUrl: JsonField) = apply { this.sourceUrl = sourceUrl } + /** + * Arbitrary key/value tags to attach to this job. Returned when retrieving the job. Not + * searchable. Limits apply to the number of entries and the length of keys and values; + * oversized metadata is rejected. + */ + fun userMetadata(userMetadata: UserMetadata?) = + userMetadata(JsonField.ofNullable(userMetadata)) + + /** Alias for calling [Builder.userMetadata] with `userMetadata.orElse(null)`. */ + fun userMetadata(userMetadata: Optional) = + userMetadata(userMetadata.getOrNull()) + + /** + * Sets [Builder.userMetadata] to an arbitrary JSON value. + * + * You should usually call [Builder.userMetadata] with a well-typed [UserMetadata] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun userMetadata(userMetadata: JsonField) = apply { + this.userMetadata = userMetadata + } + /** * Webhook endpoints for job status notifications. Multiple webhooks can be configured * for different events or services @@ -1724,6 +1813,7 @@ private constructor( processingControl, processingOptions, sourceUrl, + userMetadata, (webhookConfigurations ?: JsonMissing.of()).map { it.toImmutable() }, additionalProperties.toMutableMap(), ) @@ -1760,6 +1850,7 @@ private constructor( processingControl().ifPresent { it.validate() } processingOptions().ifPresent { it.validate() } sourceUrl() + userMetadata().ifPresent { it.validate() } webhookConfigurations().ifPresent { it.forEach { it.validate() } } validated = true } @@ -1795,6 +1886,7 @@ private constructor( (processingControl.asKnown().getOrNull()?.validity() ?: 0) + (processingOptions.asKnown().getOrNull()?.validity() ?: 0) + (if (sourceUrl.asKnown().isPresent) 1 else 0) + + (userMetadata.asKnown().getOrNull()?.validity() ?: 0) + (webhookConfigurations.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) override fun equals(other: Any?): Boolean { @@ -1819,6 +1911,7 @@ private constructor( processingControl == other.processingControl && processingOptions == other.processingOptions && sourceUrl == other.sourceUrl && + userMetadata == other.userMetadata && webhookConfigurations == other.webhookConfigurations && additionalProperties == other.additionalProperties } @@ -1841,6 +1934,7 @@ private constructor( processingControl, processingOptions, sourceUrl, + userMetadata, webhookConfigurations, additionalProperties, ) @@ -1849,7 +1943,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Body{tier=$tier, version=$version, agenticOptions=$agenticOptions, clientName=$clientName, configurationId=$configurationId, cropBox=$cropBox, disableCache=$disableCache, fastOptions=$fastOptions, fileId=$fileId, httpProxy=$httpProxy, inputOptions=$inputOptions, outputOptions=$outputOptions, pageRanges=$pageRanges, processingControl=$processingControl, processingOptions=$processingOptions, sourceUrl=$sourceUrl, webhookConfigurations=$webhookConfigurations, additionalProperties=$additionalProperties}" + "Body{tier=$tier, version=$version, agenticOptions=$agenticOptions, clientName=$clientName, configurationId=$configurationId, cropBox=$cropBox, disableCache=$disableCache, fastOptions=$fastOptions, fileId=$fileId, httpProxy=$httpProxy, inputOptions=$inputOptions, outputOptions=$outputOptions, pageRanges=$pageRanges, processingControl=$processingControl, processingOptions=$processingOptions, sourceUrl=$sourceUrl, userMetadata=$userMetadata, webhookConfigurations=$webhookConfigurations, additionalProperties=$additionalProperties}" } /** @@ -18743,6 +18837,119 @@ private constructor( "ProcessingOptions{aggressiveTableExtraction=$aggressiveTableExtraction, autoModeConfiguration=$autoModeConfiguration, costOptimizer=$costOptimizer, disableHeuristics=$disableHeuristics, ignore=$ignore, ocrParameters=$ocrParameters, specializedChartParsing=$specializedChartParsing, additionalProperties=$additionalProperties}" } + /** + * Arbitrary key/value tags to attach to this job. Returned when retrieving the job. Not + * searchable. Limits apply to the number of entries and the length of keys and values; + * oversized metadata is rejected. + */ + class UserMetadata + @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 [UserMetadata]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [UserMetadata]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(userMetadata: UserMetadata) = apply { + additionalProperties = userMetadata.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 [UserMetadata]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): UserMetadata = UserMetadata(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(): UserMetadata = 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 UserMetadata && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "UserMetadata{additionalProperties=$additionalProperties}" + } + /** * Webhook configuration for receiving parsing job notifications. * diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateResponse.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateResponse.kt index 0ca3a22..2013724 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateResponse.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateResponse.kt @@ -12,6 +12,7 @@ import com.llamacloud_prod.api.core.JsonField import com.llamacloud_prod.api.core.JsonMissing import com.llamacloud_prod.api.core.JsonValue import com.llamacloud_prod.api.core.checkRequired +import com.llamacloud_prod.api.core.toImmutable import com.llamacloud_prod.api.errors.LlamaCloudInvalidDataException import java.time.OffsetDateTime import java.util.Collections @@ -31,6 +32,7 @@ private constructor( private val name: JsonField, private val tier: JsonField, private val updatedAt: JsonField, + private val userMetadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -50,7 +52,21 @@ private constructor( @JsonProperty("updated_at") @ExcludeMissing updatedAt: JsonField = JsonMissing.of(), - ) : this(id, projectId, status, createdAt, errorMessage, name, tier, updatedAt, mutableMapOf()) + @JsonProperty("user_metadata") + @ExcludeMissing + userMetadata: JsonField = JsonMissing.of(), + ) : this( + id, + projectId, + status, + createdAt, + errorMessage, + name, + tier, + updatedAt, + userMetadata, + mutableMapOf(), + ) /** * Unique parse job identifier @@ -116,6 +132,14 @@ private constructor( */ fun updatedAt(): Optional = updatedAt.getOptional("updated_at") + /** + * Key/value tags associated with this job. + * + * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun userMetadata(): Optional = userMetadata.getOptional("user_metadata") + /** * Returns the raw JSON value of [id]. * @@ -178,6 +202,15 @@ private constructor( @ExcludeMissing fun _updatedAt(): JsonField = updatedAt + /** + * Returns the raw JSON value of [userMetadata]. + * + * Unlike [userMetadata], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("user_metadata") + @ExcludeMissing + fun _userMetadata(): JsonField = userMetadata + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -216,6 +249,7 @@ private constructor( private var name: JsonField = JsonMissing.of() private var tier: JsonField = JsonMissing.of() private var updatedAt: JsonField = JsonMissing.of() + private var userMetadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -228,6 +262,7 @@ private constructor( name = parsingCreateResponse.name tier = parsingCreateResponse.tier updatedAt = parsingCreateResponse.updatedAt + userMetadata = parsingCreateResponse.userMetadata additionalProperties = parsingCreateResponse.additionalProperties.toMutableMap() } @@ -340,6 +375,25 @@ private constructor( */ fun updatedAt(updatedAt: JsonField) = apply { this.updatedAt = updatedAt } + /** Key/value tags associated with this job. */ + fun userMetadata(userMetadata: UserMetadata?) = + userMetadata(JsonField.ofNullable(userMetadata)) + + /** Alias for calling [Builder.userMetadata] with `userMetadata.orElse(null)`. */ + fun userMetadata(userMetadata: Optional) = + userMetadata(userMetadata.getOrNull()) + + /** + * Sets [Builder.userMetadata] to an arbitrary JSON value. + * + * You should usually call [Builder.userMetadata] with a well-typed [UserMetadata] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun userMetadata(userMetadata: JsonField) = apply { + this.userMetadata = userMetadata + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -383,6 +437,7 @@ private constructor( name, tier, updatedAt, + userMetadata, additionalProperties.toMutableMap(), ) } @@ -410,6 +465,7 @@ private constructor( name() tier() updatedAt() + userMetadata().ifPresent { it.validate() } validated = true } @@ -435,7 +491,8 @@ private constructor( (if (errorMessage.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + (if (tier.asKnown().isPresent) 1 else 0) + - (if (updatedAt.asKnown().isPresent) 1 else 0) + (if (updatedAt.asKnown().isPresent) 1 else 0) + + (userMetadata.asKnown().getOrNull()?.validity() ?: 0) /** Current job status: PENDING, RUNNING, COMPLETED, FAILED, or CANCELLED */ class Status @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -592,6 +649,115 @@ private constructor( override fun toString() = value.toString() } + /** Key/value tags associated with this job. */ + class UserMetadata + @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 [UserMetadata]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [UserMetadata]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(userMetadata: UserMetadata) = apply { + additionalProperties = userMetadata.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 [UserMetadata]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): UserMetadata = UserMetadata(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(): UserMetadata = 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 UserMetadata && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "UserMetadata{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -606,6 +772,7 @@ private constructor( name == other.name && tier == other.tier && updatedAt == other.updatedAt && + userMetadata == other.userMetadata && additionalProperties == other.additionalProperties } @@ -619,6 +786,7 @@ private constructor( name, tier, updatedAt, + userMetadata, additionalProperties, ) } @@ -626,5 +794,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ParsingCreateResponse{id=$id, projectId=$projectId, status=$status, createdAt=$createdAt, errorMessage=$errorMessage, name=$name, tier=$tier, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" + "ParsingCreateResponse{id=$id, projectId=$projectId, status=$status, createdAt=$createdAt, errorMessage=$errorMessage, name=$name, tier=$tier, updatedAt=$updatedAt, userMetadata=$userMetadata, additionalProperties=$additionalProperties}" } diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingGetResponse.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingGetResponse.kt index 5473677..638b9ac 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingGetResponse.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingGetResponse.kt @@ -621,6 +621,7 @@ private constructor( private val name: JsonField, private val tier: JsonField, private val updatedAt: JsonField, + private val userMetadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -642,6 +643,9 @@ private constructor( @JsonProperty("updated_at") @ExcludeMissing updatedAt: JsonField = JsonMissing.of(), + @JsonProperty("user_metadata") + @ExcludeMissing + userMetadata: JsonField = JsonMissing.of(), ) : this( id, projectId, @@ -651,6 +655,7 @@ private constructor( name, tier, updatedAt, + userMetadata, mutableMapOf(), ) @@ -718,6 +723,14 @@ private constructor( */ fun updatedAt(): Optional = updatedAt.getOptional("updated_at") + /** + * Key/value tags associated with this job. + * + * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun userMetadata(): Optional = userMetadata.getOptional("user_metadata") + /** * Returns the raw JSON value of [id]. * @@ -781,6 +794,16 @@ private constructor( @ExcludeMissing fun _updatedAt(): JsonField = updatedAt + /** + * Returns the raw JSON value of [userMetadata]. + * + * Unlike [userMetadata], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("user_metadata") + @ExcludeMissing + fun _userMetadata(): JsonField = userMetadata + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -819,6 +842,7 @@ private constructor( private var name: JsonField = JsonMissing.of() private var tier: JsonField = JsonMissing.of() private var updatedAt: JsonField = JsonMissing.of() + private var userMetadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -831,6 +855,7 @@ private constructor( name = job.name tier = job.tier updatedAt = job.updatedAt + userMetadata = job.userMetadata additionalProperties = job.additionalProperties.toMutableMap() } @@ -953,6 +978,25 @@ private constructor( this.updatedAt = updatedAt } + /** Key/value tags associated with this job. */ + fun userMetadata(userMetadata: UserMetadata?) = + userMetadata(JsonField.ofNullable(userMetadata)) + + /** Alias for calling [Builder.userMetadata] with `userMetadata.orElse(null)`. */ + fun userMetadata(userMetadata: Optional) = + userMetadata(userMetadata.getOrNull()) + + /** + * Sets [Builder.userMetadata] to an arbitrary JSON value. + * + * You should usually call [Builder.userMetadata] with a well-typed [UserMetadata] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun userMetadata(userMetadata: JsonField) = apply { + this.userMetadata = userMetadata + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -996,6 +1040,7 @@ private constructor( name, tier, updatedAt, + userMetadata, additionalProperties.toMutableMap(), ) } @@ -1024,6 +1069,7 @@ private constructor( name() tier() updatedAt() + userMetadata().ifPresent { it.validate() } validated = true } @@ -1050,7 +1096,8 @@ private constructor( (if (errorMessage.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + (if (tier.asKnown().isPresent) 1 else 0) + - (if (updatedAt.asKnown().isPresent) 1 else 0) + (if (updatedAt.asKnown().isPresent) 1 else 0) + + (userMetadata.asKnown().getOrNull()?.validity() ?: 0) /** Current job status: PENDING, RUNNING, COMPLETED, FAILED, or CANCELLED */ class Status @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -1210,6 +1257,119 @@ private constructor( override fun toString() = value.toString() } + /** Key/value tags associated with this job. */ + class UserMetadata + @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 [UserMetadata]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [UserMetadata]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(userMetadata: UserMetadata) = apply { + additionalProperties = userMetadata.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 [UserMetadata]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): UserMetadata = UserMetadata(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(): UserMetadata = 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 UserMetadata && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "UserMetadata{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -1224,6 +1384,7 @@ private constructor( name == other.name && tier == other.tier && updatedAt == other.updatedAt && + userMetadata == other.userMetadata && additionalProperties == other.additionalProperties } @@ -1237,6 +1398,7 @@ private constructor( name, tier, updatedAt, + userMetadata, additionalProperties, ) } @@ -1244,7 +1406,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Job{id=$id, projectId=$projectId, status=$status, createdAt=$createdAt, errorMessage=$errorMessage, name=$name, tier=$tier, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" + "Job{id=$id, projectId=$projectId, status=$status, createdAt=$createdAt, errorMessage=$errorMessage, name=$name, tier=$tier, updatedAt=$updatedAt, userMetadata=$userMetadata, additionalProperties=$additionalProperties}" } /** Metadata for all extracted images. */ diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingListResponse.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingListResponse.kt index 7820d7d..ac08d58 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingListResponse.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingListResponse.kt @@ -12,6 +12,7 @@ import com.llamacloud_prod.api.core.JsonField import com.llamacloud_prod.api.core.JsonMissing import com.llamacloud_prod.api.core.JsonValue import com.llamacloud_prod.api.core.checkRequired +import com.llamacloud_prod.api.core.toImmutable import com.llamacloud_prod.api.errors.LlamaCloudInvalidDataException import java.time.OffsetDateTime import java.util.Collections @@ -31,6 +32,7 @@ private constructor( private val name: JsonField, private val tier: JsonField, private val updatedAt: JsonField, + private val userMetadata: JsonField, private val additionalProperties: MutableMap, ) { @@ -50,7 +52,21 @@ private constructor( @JsonProperty("updated_at") @ExcludeMissing updatedAt: JsonField = JsonMissing.of(), - ) : this(id, projectId, status, createdAt, errorMessage, name, tier, updatedAt, mutableMapOf()) + @JsonProperty("user_metadata") + @ExcludeMissing + userMetadata: JsonField = JsonMissing.of(), + ) : this( + id, + projectId, + status, + createdAt, + errorMessage, + name, + tier, + updatedAt, + userMetadata, + mutableMapOf(), + ) /** * Unique parse job identifier @@ -116,6 +132,14 @@ private constructor( */ fun updatedAt(): Optional = updatedAt.getOptional("updated_at") + /** + * Key/value tags associated with this job. + * + * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun userMetadata(): Optional = userMetadata.getOptional("user_metadata") + /** * Returns the raw JSON value of [id]. * @@ -178,6 +202,15 @@ private constructor( @ExcludeMissing fun _updatedAt(): JsonField = updatedAt + /** + * Returns the raw JSON value of [userMetadata]. + * + * Unlike [userMetadata], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("user_metadata") + @ExcludeMissing + fun _userMetadata(): JsonField = userMetadata + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -216,6 +249,7 @@ private constructor( private var name: JsonField = JsonMissing.of() private var tier: JsonField = JsonMissing.of() private var updatedAt: JsonField = JsonMissing.of() + private var userMetadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -228,6 +262,7 @@ private constructor( name = parsingListResponse.name tier = parsingListResponse.tier updatedAt = parsingListResponse.updatedAt + userMetadata = parsingListResponse.userMetadata additionalProperties = parsingListResponse.additionalProperties.toMutableMap() } @@ -340,6 +375,25 @@ private constructor( */ fun updatedAt(updatedAt: JsonField) = apply { this.updatedAt = updatedAt } + /** Key/value tags associated with this job. */ + fun userMetadata(userMetadata: UserMetadata?) = + userMetadata(JsonField.ofNullable(userMetadata)) + + /** Alias for calling [Builder.userMetadata] with `userMetadata.orElse(null)`. */ + fun userMetadata(userMetadata: Optional) = + userMetadata(userMetadata.getOrNull()) + + /** + * Sets [Builder.userMetadata] to an arbitrary JSON value. + * + * You should usually call [Builder.userMetadata] with a well-typed [UserMetadata] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun userMetadata(userMetadata: JsonField) = apply { + this.userMetadata = userMetadata + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -383,6 +437,7 @@ private constructor( name, tier, updatedAt, + userMetadata, additionalProperties.toMutableMap(), ) } @@ -410,6 +465,7 @@ private constructor( name() tier() updatedAt() + userMetadata().ifPresent { it.validate() } validated = true } @@ -435,7 +491,8 @@ private constructor( (if (errorMessage.asKnown().isPresent) 1 else 0) + (if (name.asKnown().isPresent) 1 else 0) + (if (tier.asKnown().isPresent) 1 else 0) + - (if (updatedAt.asKnown().isPresent) 1 else 0) + (if (updatedAt.asKnown().isPresent) 1 else 0) + + (userMetadata.asKnown().getOrNull()?.validity() ?: 0) /** Current job status: PENDING, RUNNING, COMPLETED, FAILED, or CANCELLED */ class Status @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -592,6 +649,115 @@ private constructor( override fun toString() = value.toString() } + /** Key/value tags associated with this job. */ + class UserMetadata + @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 [UserMetadata]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [UserMetadata]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(userMetadata: UserMetadata) = apply { + additionalProperties = userMetadata.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 [UserMetadata]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): UserMetadata = UserMetadata(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(): UserMetadata = 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 UserMetadata && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "UserMetadata{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -606,6 +772,7 @@ private constructor( name == other.name && tier == other.tier && updatedAt == other.updatedAt && + userMetadata == other.userMetadata && additionalProperties == other.additionalProperties } @@ -619,6 +786,7 @@ private constructor( name, tier, updatedAt, + userMetadata, additionalProperties, ) } @@ -626,5 +794,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ParsingListResponse{id=$id, projectId=$projectId, status=$status, createdAt=$createdAt, errorMessage=$errorMessage, name=$name, tier=$tier, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" + "ParsingListResponse{id=$id, projectId=$projectId, status=$status, createdAt=$createdAt, errorMessage=$errorMessage, name=$name, tier=$tier, updatedAt=$updatedAt, userMetadata=$userMetadata, additionalProperties=$additionalProperties}" } diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParamsTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParamsTest.kt index dd7a8d6..1a38409 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParamsTest.kt @@ -270,6 +270,12 @@ internal class ParsingCreateParamsTest { .build() ) .sourceUrl("https:") + .userMetadata( + ParsingCreateParams.UserMetadata.builder() + .putAdditionalProperty("owner", JsonValue.from("jerry")) + .putAdditionalProperty("team", JsonValue.from("research")) + .build() + ) .addWebhookConfiguration( ParsingCreateParams.WebhookConfiguration.builder() .addWebhookEvent("parse.success") @@ -559,6 +565,12 @@ internal class ParsingCreateParamsTest { .build() ) .sourceUrl("https:") + .userMetadata( + ParsingCreateParams.UserMetadata.builder() + .putAdditionalProperty("owner", JsonValue.from("jerry")) + .putAdditionalProperty("team", JsonValue.from("research")) + .build() + ) .addWebhookConfiguration( ParsingCreateParams.WebhookConfiguration.builder() .addWebhookEvent("parse.success") @@ -871,6 +883,12 @@ internal class ParsingCreateParamsTest { .build() ) .sourceUrl("https:") + .userMetadata( + ParsingCreateParams.UserMetadata.builder() + .putAdditionalProperty("owner", JsonValue.from("jerry")) + .putAdditionalProperty("team", JsonValue.from("research")) + .build() + ) .addWebhookConfiguration( ParsingCreateParams.WebhookConfiguration.builder() .addWebhookEvent("parse.success") @@ -1153,6 +1171,13 @@ internal class ParsingCreateParamsTest { .build() ) assertThat(body.sourceUrl()).contains("https:") + assertThat(body.userMetadata()) + .contains( + ParsingCreateParams.UserMetadata.builder() + .putAdditionalProperty("owner", JsonValue.from("jerry")) + .putAdditionalProperty("team", JsonValue.from("research")) + .build() + ) assertThat(body.webhookConfigurations().getOrNull()) .containsExactly( ParsingCreateParams.WebhookConfiguration.builder() diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateResponseTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateResponseTest.kt index f92b692..599663b 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateResponseTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateResponseTest.kt @@ -3,6 +3,7 @@ package com.llamacloud_prod.api.models.parsing import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.llamacloud_prod.api.core.JsonValue import com.llamacloud_prod.api.core.jsonMapper import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -22,6 +23,12 @@ internal class ParsingCreateResponseTest { .name("Q4 Financial Report") .tier("fast") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userMetadata( + ParsingCreateResponse.UserMetadata.builder() + .putAdditionalProperty("owner", JsonValue.from("jerry")) + .putAdditionalProperty("team", JsonValue.from("research")) + .build() + ) .build() assertThat(parsingCreateResponse.id()).isEqualTo("pjb-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") @@ -35,6 +42,13 @@ internal class ParsingCreateResponseTest { assertThat(parsingCreateResponse.tier()).contains("fast") assertThat(parsingCreateResponse.updatedAt()) .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(parsingCreateResponse.userMetadata()) + .contains( + ParsingCreateResponse.UserMetadata.builder() + .putAdditionalProperty("owner", JsonValue.from("jerry")) + .putAdditionalProperty("team", JsonValue.from("research")) + .build() + ) } @Test @@ -50,6 +64,12 @@ internal class ParsingCreateResponseTest { .name("Q4 Financial Report") .tier("fast") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userMetadata( + ParsingCreateResponse.UserMetadata.builder() + .putAdditionalProperty("owner", JsonValue.from("jerry")) + .putAdditionalProperty("team", JsonValue.from("research")) + .build() + ) .build() val roundtrippedParsingCreateResponse = diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingGetResponseTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingGetResponseTest.kt index 0ede9e1..aa7489e 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingGetResponseTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingGetResponseTest.kt @@ -25,6 +25,12 @@ internal class ParsingGetResponseTest { .name("Q4 Financial Report") .tier("fast") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userMetadata( + ParsingGetResponse.Job.UserMetadata.builder() + .putAdditionalProperty("owner", JsonValue.from("jerry")) + .putAdditionalProperty("team", JsonValue.from("research")) + .build() + ) .build() ) .imagesContentMetadata( @@ -161,6 +167,12 @@ internal class ParsingGetResponseTest { .name("Q4 Financial Report") .tier("fast") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userMetadata( + ParsingGetResponse.Job.UserMetadata.builder() + .putAdditionalProperty("owner", JsonValue.from("jerry")) + .putAdditionalProperty("team", JsonValue.from("research")) + .build() + ) .build() ) assertThat(parsingGetResponse.imagesContentMetadata()) @@ -306,6 +318,12 @@ internal class ParsingGetResponseTest { .name("Q4 Financial Report") .tier("fast") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userMetadata( + ParsingGetResponse.Job.UserMetadata.builder() + .putAdditionalProperty("owner", JsonValue.from("jerry")) + .putAdditionalProperty("team", JsonValue.from("research")) + .build() + ) .build() ) .imagesContentMetadata( diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingListPageResponseTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingListPageResponseTest.kt index f58f78c..e4d8297 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingListPageResponseTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingListPageResponseTest.kt @@ -3,6 +3,7 @@ package com.llamacloud_prod.api.models.parsing import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.llamacloud_prod.api.core.JsonValue import com.llamacloud_prod.api.core.jsonMapper import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -24,6 +25,12 @@ internal class ParsingListPageResponseTest { .name("Q4 Financial Report") .tier("fast") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userMetadata( + ParsingListResponse.UserMetadata.builder() + .putAdditionalProperty("owner", JsonValue.from("jerry")) + .putAdditionalProperty("team", JsonValue.from("research")) + .build() + ) .build() ) .nextPageToken("next_page_token") @@ -41,6 +48,12 @@ internal class ParsingListPageResponseTest { .name("Q4 Financial Report") .tier("fast") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userMetadata( + ParsingListResponse.UserMetadata.builder() + .putAdditionalProperty("owner", JsonValue.from("jerry")) + .putAdditionalProperty("team", JsonValue.from("research")) + .build() + ) .build() ) assertThat(parsingListPageResponse.nextPageToken()).contains("next_page_token") @@ -62,6 +75,12 @@ internal class ParsingListPageResponseTest { .name("Q4 Financial Report") .tier("fast") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userMetadata( + ParsingListResponse.UserMetadata.builder() + .putAdditionalProperty("owner", JsonValue.from("jerry")) + .putAdditionalProperty("team", JsonValue.from("research")) + .build() + ) .build() ) .nextPageToken("next_page_token") diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingListResponseTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingListResponseTest.kt index 063b05b..4641a22 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingListResponseTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingListResponseTest.kt @@ -3,6 +3,7 @@ package com.llamacloud_prod.api.models.parsing import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.llamacloud_prod.api.core.JsonValue import com.llamacloud_prod.api.core.jsonMapper import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -22,6 +23,12 @@ internal class ParsingListResponseTest { .name("Q4 Financial Report") .tier("fast") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userMetadata( + ParsingListResponse.UserMetadata.builder() + .putAdditionalProperty("owner", JsonValue.from("jerry")) + .putAdditionalProperty("team", JsonValue.from("research")) + .build() + ) .build() assertThat(parsingListResponse.id()).isEqualTo("pjb-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") @@ -35,6 +42,13 @@ internal class ParsingListResponseTest { assertThat(parsingListResponse.tier()).contains("fast") assertThat(parsingListResponse.updatedAt()) .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + assertThat(parsingListResponse.userMetadata()) + .contains( + ParsingListResponse.UserMetadata.builder() + .putAdditionalProperty("owner", JsonValue.from("jerry")) + .putAdditionalProperty("team", JsonValue.from("research")) + .build() + ) } @Test @@ -50,6 +64,12 @@ internal class ParsingListResponseTest { .name("Q4 Financial Report") .tier("fast") .updatedAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .userMetadata( + ParsingListResponse.UserMetadata.builder() + .putAdditionalProperty("owner", JsonValue.from("jerry")) + .putAdditionalProperty("team", JsonValue.from("research")) + .build() + ) .build() val roundtrippedParsingListResponse = diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/ServiceParamsTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/ServiceParamsTest.kt index 735bfbd..2f60898 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/ServiceParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/ServiceParamsTest.kt @@ -334,6 +334,12 @@ internal class ServiceParamsTest { .build() ) .sourceUrl("https:") + .userMetadata( + ParsingCreateParams.UserMetadata.builder() + .putAdditionalProperty("owner", JsonValue.from("jerry")) + .putAdditionalProperty("team", JsonValue.from("research")) + .build() + ) .addWebhookConfiguration( ParsingCreateParams.WebhookConfiguration.builder() .addWebhookEvent("parse.success") diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ParsingServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ParsingServiceAsyncTest.kt index 8d558a3..c2b75e7 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ParsingServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ParsingServiceAsyncTest.kt @@ -291,6 +291,12 @@ internal class ParsingServiceAsyncTest { .build() ) .sourceUrl("https:") + .userMetadata( + ParsingCreateParams.UserMetadata.builder() + .putAdditionalProperty("owner", JsonValue.from("jerry")) + .putAdditionalProperty("team", JsonValue.from("research")) + .build() + ) .addWebhookConfiguration( ParsingCreateParams.WebhookConfiguration.builder() .addWebhookEvent("parse.success") diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ParsingServiceTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ParsingServiceTest.kt index f757f33..a295179 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ParsingServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ParsingServiceTest.kt @@ -291,6 +291,12 @@ internal class ParsingServiceTest { .build() ) .sourceUrl("https:") + .userMetadata( + ParsingCreateParams.UserMetadata.builder() + .putAdditionalProperty("owner", JsonValue.from("jerry")) + .putAdditionalProperty("team", JsonValue.from("research")) + .build() + ) .addWebhookConfiguration( ParsingCreateParams.WebhookConfiguration.builder() .addWebhookEvent("parse.success") From 54fc17a5abaa961bb301de2b9685daa07c7ca538 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Sat, 27 Jun 2026 07:50:09 +0000 Subject: [PATCH 05/10] Reference saved webhook configurations in parse v2 API (#21186) Stainless-Generated-From: ab436ff0f1ca47d2cb93d8356849cf56ca9b35b4 --- .../configurations/ParseV2Parameters.kt | 68 ++++++++++- .../api/models/parsing/ParsingCreateParams.kt | 115 +++++++++++++++++- .../configurations/ParseV2ParametersTest.kt | 6 + .../models/parsing/ParsingCreateParamsTest.kt | 7 ++ .../api/services/ServiceParamsTest.kt | 2 + .../services/async/ParsingServiceAsyncTest.kt | 2 + .../services/blocking/ParsingServiceTest.kt | 2 + 7 files changed, 200 insertions(+), 2 deletions(-) diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2Parameters.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2Parameters.kt index d50d3b7..66f84bb 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2Parameters.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2Parameters.kt @@ -54,6 +54,7 @@ private constructor( private val pageRanges: JsonField, private val processingControl: JsonField, private val processingOptions: JsonField, + private val webhookConfigurationIds: JsonField>, private val webhookConfigurations: JsonField>, private val additionalProperties: MutableMap, ) { @@ -89,6 +90,9 @@ private constructor( @JsonProperty("processing_options") @ExcludeMissing processingOptions: JsonField = JsonMissing.of(), + @JsonProperty("webhook_configuration_ids") + @ExcludeMissing + webhookConfigurationIds: JsonField> = JsonMissing.of(), @JsonProperty("webhook_configurations") @ExcludeMissing webhookConfigurations: JsonField> = JsonMissing.of(), @@ -106,6 +110,7 @@ private constructor( pageRanges, processingControl, processingOptions, + webhookConfigurationIds, webhookConfigurations, mutableMapOf(), ) @@ -242,6 +247,15 @@ private constructor( fun processingOptions(): Optional = processingOptions.getOptional("processing_options") + /** + * IDs of saved webhook configurations to notify for this job. + * + * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun webhookConfigurationIds(): Optional> = + webhookConfigurationIds.getOptional("webhook_configuration_ids") + /** * Webhook endpoints for job status notifications. Multiple webhooks can be configured for * different events or services @@ -345,6 +359,16 @@ private constructor( @ExcludeMissing fun _processingOptions(): JsonField = processingOptions + /** + * Returns the raw JSON value of [webhookConfigurationIds]. + * + * Unlike [webhookConfigurationIds], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("webhook_configuration_ids") + @ExcludeMissing + fun _webhookConfigurationIds(): JsonField> = webhookConfigurationIds + /** * Returns the raw JSON value of [webhookConfigurations]. * @@ -397,6 +421,7 @@ private constructor( private var pageRanges: JsonField = JsonMissing.of() private var processingControl: JsonField = JsonMissing.of() private var processingOptions: JsonField = JsonMissing.of() + private var webhookConfigurationIds: JsonField>? = null private var webhookConfigurations: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -415,6 +440,8 @@ private constructor( pageRanges = parseV2Parameters.pageRanges processingControl = parseV2Parameters.processingControl processingOptions = parseV2Parameters.processingOptions + webhookConfigurationIds = + parseV2Parameters.webhookConfigurationIds.map { it.toMutableList() } webhookConfigurations = parseV2Parameters.webhookConfigurations.map { it.toMutableList() } additionalProperties = parseV2Parameters.additionalProperties.toMutableMap() @@ -643,6 +670,40 @@ private constructor( this.processingOptions = processingOptions } + /** IDs of saved webhook configurations to notify for this job. */ + fun webhookConfigurationIds(webhookConfigurationIds: List?) = + webhookConfigurationIds(JsonField.ofNullable(webhookConfigurationIds)) + + /** + * Alias for calling [Builder.webhookConfigurationIds] with + * `webhookConfigurationIds.orElse(null)`. + */ + fun webhookConfigurationIds(webhookConfigurationIds: Optional>) = + webhookConfigurationIds(webhookConfigurationIds.getOrNull()) + + /** + * Sets [Builder.webhookConfigurationIds] to an arbitrary JSON value. + * + * You should usually call [Builder.webhookConfigurationIds] with a well-typed + * `List` value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun webhookConfigurationIds(webhookConfigurationIds: JsonField>) = apply { + this.webhookConfigurationIds = webhookConfigurationIds.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [webhookConfigurationIds]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addWebhookConfigurationId(webhookConfigurationId: String) = apply { + webhookConfigurationIds = + (webhookConfigurationIds ?: JsonField.of(mutableListOf())).also { + checkKnown("webhookConfigurationIds", it).add(webhookConfigurationId) + } + } + /** * Webhook endpoints for job status notifications. Multiple webhooks can be configured for * different events or services @@ -721,6 +782,7 @@ private constructor( pageRanges, processingControl, processingOptions, + (webhookConfigurationIds ?: JsonMissing.of()).map { it.toImmutable() }, (webhookConfigurations ?: JsonMissing.of()).map { it.toImmutable() }, additionalProperties.toMutableMap(), ) @@ -757,6 +819,7 @@ private constructor( pageRanges().ifPresent { it.validate() } processingControl().ifPresent { it.validate() } processingOptions().ifPresent { it.validate() } + webhookConfigurationIds() webhookConfigurations().ifPresent { it.forEach { it.validate() } } validated = true } @@ -788,6 +851,7 @@ private constructor( (pageRanges.asKnown().getOrNull()?.validity() ?: 0) + (processingControl.asKnown().getOrNull()?.validity() ?: 0) + (processingOptions.asKnown().getOrNull()?.validity() ?: 0) + + (webhookConfigurationIds.asKnown().getOrNull()?.size ?: 0) + (webhookConfigurations.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) /** @@ -18382,6 +18446,7 @@ private constructor( pageRanges == other.pageRanges && processingControl == other.processingControl && processingOptions == other.processingOptions && + webhookConfigurationIds == other.webhookConfigurationIds && webhookConfigurations == other.webhookConfigurations && additionalProperties == other.additionalProperties } @@ -18401,6 +18466,7 @@ private constructor( pageRanges, processingControl, processingOptions, + webhookConfigurationIds, webhookConfigurations, additionalProperties, ) @@ -18409,5 +18475,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ParseV2Parameters{productType=$productType, tier=$tier, version=$version, agenticOptions=$agenticOptions, clientName=$clientName, cropBox=$cropBox, disableCache=$disableCache, fastOptions=$fastOptions, inputOptions=$inputOptions, outputOptions=$outputOptions, pageRanges=$pageRanges, processingControl=$processingControl, processingOptions=$processingOptions, webhookConfigurations=$webhookConfigurations, additionalProperties=$additionalProperties}" + "ParseV2Parameters{productType=$productType, tier=$tier, version=$version, agenticOptions=$agenticOptions, clientName=$clientName, cropBox=$cropBox, disableCache=$disableCache, fastOptions=$fastOptions, inputOptions=$inputOptions, outputOptions=$outputOptions, pageRanges=$pageRanges, processingControl=$processingControl, processingOptions=$processingOptions, webhookConfigurationIds=$webhookConfigurationIds, webhookConfigurations=$webhookConfigurations, additionalProperties=$additionalProperties}" } diff --git a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParams.kt b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParams.kt index 41bc497..302c88c 100644 --- a/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParams.kt +++ b/llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParams.kt @@ -222,6 +222,14 @@ private constructor( */ fun userMetadata(): Optional = body.userMetadata() + /** + * IDs of saved webhook configurations to notify for this job. + * + * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun webhookConfigurationIds(): Optional> = body.webhookConfigurationIds() + /** * Webhook endpoints for job status notifications. Multiple webhooks can be configured for * different events or services @@ -345,6 +353,14 @@ private constructor( */ fun _userMetadata(): JsonField = body._userMetadata() + /** + * Returns the raw JSON value of [webhookConfigurationIds]. + * + * Unlike [webhookConfigurationIds], this method doesn't throw if the JSON field has an + * unexpected type. + */ + fun _webhookConfigurationIds(): JsonField> = body._webhookConfigurationIds() + /** * Returns the raw JSON value of [webhookConfigurations]. * @@ -732,6 +748,38 @@ private constructor( body.userMetadata(userMetadata) } + /** IDs of saved webhook configurations to notify for this job. */ + fun webhookConfigurationIds(webhookConfigurationIds: List?) = apply { + body.webhookConfigurationIds(webhookConfigurationIds) + } + + /** + * Alias for calling [Builder.webhookConfigurationIds] with + * `webhookConfigurationIds.orElse(null)`. + */ + fun webhookConfigurationIds(webhookConfigurationIds: Optional>) = + webhookConfigurationIds(webhookConfigurationIds.getOrNull()) + + /** + * Sets [Builder.webhookConfigurationIds] to an arbitrary JSON value. + * + * You should usually call [Builder.webhookConfigurationIds] with a well-typed + * `List` value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun webhookConfigurationIds(webhookConfigurationIds: JsonField>) = apply { + body.webhookConfigurationIds(webhookConfigurationIds) + } + + /** + * Adds a single [String] to [webhookConfigurationIds]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addWebhookConfigurationId(webhookConfigurationId: String) = apply { + body.addWebhookConfigurationId(webhookConfigurationId) + } + /** * Webhook endpoints for job status notifications. Multiple webhooks can be configured for * different events or services @@ -940,6 +988,7 @@ private constructor( private val processingOptions: JsonField, private val sourceUrl: JsonField, private val userMetadata: JsonField, + private val webhookConfigurationIds: JsonField>, private val webhookConfigurations: JsonField>, private val additionalProperties: MutableMap, ) { @@ -989,6 +1038,9 @@ private constructor( @JsonProperty("user_metadata") @ExcludeMissing userMetadata: JsonField = JsonMissing.of(), + @JsonProperty("webhook_configuration_ids") + @ExcludeMissing + webhookConfigurationIds: JsonField> = JsonMissing.of(), @JsonProperty("webhook_configurations") @ExcludeMissing webhookConfigurations: JsonField> = JsonMissing.of(), @@ -1010,6 +1062,7 @@ private constructor( processingOptions, sourceUrl, userMetadata, + webhookConfigurationIds, webhookConfigurations, mutableMapOf(), ) @@ -1179,6 +1232,15 @@ private constructor( */ fun userMetadata(): Optional = userMetadata.getOptional("user_metadata") + /** + * IDs of saved webhook configurations to notify for this job. + * + * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun webhookConfigurationIds(): Optional> = + webhookConfigurationIds.getOptional("webhook_configuration_ids") + /** * Webhook endpoints for job status notifications. Multiple webhooks can be configured for * different events or services @@ -1329,6 +1391,16 @@ private constructor( @ExcludeMissing fun _userMetadata(): JsonField = userMetadata + /** + * Returns the raw JSON value of [webhookConfigurationIds]. + * + * Unlike [webhookConfigurationIds], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("webhook_configuration_ids") + @ExcludeMissing + fun _webhookConfigurationIds(): JsonField> = webhookConfigurationIds + /** * Returns the raw JSON value of [webhookConfigurations]. * @@ -1385,6 +1457,7 @@ private constructor( private var processingOptions: JsonField = JsonMissing.of() private var sourceUrl: JsonField = JsonMissing.of() private var userMetadata: JsonField = JsonMissing.of() + private var webhookConfigurationIds: JsonField>? = null private var webhookConfigurations: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -1407,6 +1480,7 @@ private constructor( processingOptions = body.processingOptions sourceUrl = body.sourceUrl userMetadata = body.userMetadata + webhookConfigurationIds = body.webhookConfigurationIds.map { it.toMutableList() } webhookConfigurations = body.webhookConfigurations.map { it.toMutableList() } additionalProperties = body.additionalProperties.toMutableMap() } @@ -1731,6 +1805,40 @@ private constructor( this.userMetadata = userMetadata } + /** IDs of saved webhook configurations to notify for this job. */ + fun webhookConfigurationIds(webhookConfigurationIds: List?) = + webhookConfigurationIds(JsonField.ofNullable(webhookConfigurationIds)) + + /** + * Alias for calling [Builder.webhookConfigurationIds] with + * `webhookConfigurationIds.orElse(null)`. + */ + fun webhookConfigurationIds(webhookConfigurationIds: Optional>) = + webhookConfigurationIds(webhookConfigurationIds.getOrNull()) + + /** + * Sets [Builder.webhookConfigurationIds] to an arbitrary JSON value. + * + * You should usually call [Builder.webhookConfigurationIds] with a well-typed + * `List` value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun webhookConfigurationIds(webhookConfigurationIds: JsonField>) = apply { + this.webhookConfigurationIds = webhookConfigurationIds.map { it.toMutableList() } + } + + /** + * Adds a single [String] to [webhookConfigurationIds]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addWebhookConfigurationId(webhookConfigurationId: String) = apply { + webhookConfigurationIds = + (webhookConfigurationIds ?: JsonField.of(mutableListOf())).also { + checkKnown("webhookConfigurationIds", it).add(webhookConfigurationId) + } + } + /** * Webhook endpoints for job status notifications. Multiple webhooks can be configured * for different events or services @@ -1814,6 +1922,7 @@ private constructor( processingOptions, sourceUrl, userMetadata, + (webhookConfigurationIds ?: JsonMissing.of()).map { it.toImmutable() }, (webhookConfigurations ?: JsonMissing.of()).map { it.toImmutable() }, additionalProperties.toMutableMap(), ) @@ -1851,6 +1960,7 @@ private constructor( processingOptions().ifPresent { it.validate() } sourceUrl() userMetadata().ifPresent { it.validate() } + webhookConfigurationIds() webhookConfigurations().ifPresent { it.forEach { it.validate() } } validated = true } @@ -1887,6 +1997,7 @@ private constructor( (processingOptions.asKnown().getOrNull()?.validity() ?: 0) + (if (sourceUrl.asKnown().isPresent) 1 else 0) + (userMetadata.asKnown().getOrNull()?.validity() ?: 0) + + (webhookConfigurationIds.asKnown().getOrNull()?.size ?: 0) + (webhookConfigurations.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) override fun equals(other: Any?): Boolean { @@ -1912,6 +2023,7 @@ private constructor( processingOptions == other.processingOptions && sourceUrl == other.sourceUrl && userMetadata == other.userMetadata && + webhookConfigurationIds == other.webhookConfigurationIds && webhookConfigurations == other.webhookConfigurations && additionalProperties == other.additionalProperties } @@ -1935,6 +2047,7 @@ private constructor( processingOptions, sourceUrl, userMetadata, + webhookConfigurationIds, webhookConfigurations, additionalProperties, ) @@ -1943,7 +2056,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Body{tier=$tier, version=$version, agenticOptions=$agenticOptions, clientName=$clientName, configurationId=$configurationId, cropBox=$cropBox, disableCache=$disableCache, fastOptions=$fastOptions, fileId=$fileId, httpProxy=$httpProxy, inputOptions=$inputOptions, outputOptions=$outputOptions, pageRanges=$pageRanges, processingControl=$processingControl, processingOptions=$processingOptions, sourceUrl=$sourceUrl, userMetadata=$userMetadata, webhookConfigurations=$webhookConfigurations, additionalProperties=$additionalProperties}" + "Body{tier=$tier, version=$version, agenticOptions=$agenticOptions, clientName=$clientName, configurationId=$configurationId, cropBox=$cropBox, disableCache=$disableCache, fastOptions=$fastOptions, fileId=$fileId, httpProxy=$httpProxy, inputOptions=$inputOptions, outputOptions=$outputOptions, pageRanges=$pageRanges, processingControl=$processingControl, processingOptions=$processingOptions, sourceUrl=$sourceUrl, userMetadata=$userMetadata, webhookConfigurationIds=$webhookConfigurationIds, webhookConfigurations=$webhookConfigurations, additionalProperties=$additionalProperties}" } /** diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2ParametersTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2ParametersTest.kt index 080e303..44c570f 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2ParametersTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/configurations/ParseV2ParametersTest.kt @@ -274,6 +274,8 @@ internal class ParseV2ParametersTest { ) .build() ) + .addWebhookConfigurationId("whc-...") + .addWebhookConfigurationId("whc-...") .addWebhookConfiguration( ParseV2Parameters.WebhookConfiguration.builder() .addWebhookEvent("parse.success") @@ -550,6 +552,8 @@ internal class ParseV2ParametersTest { ) .build() ) + assertThat(parseV2Parameters.webhookConfigurationIds().getOrNull()) + .containsExactly("whc-...", "whc-...") assertThat(parseV2Parameters.webhookConfigurations().getOrNull()) .containsExactly( ParseV2Parameters.WebhookConfiguration.builder() @@ -832,6 +836,8 @@ internal class ParseV2ParametersTest { ) .build() ) + .addWebhookConfigurationId("whc-...") + .addWebhookConfigurationId("whc-...") .addWebhookConfiguration( ParseV2Parameters.WebhookConfiguration.builder() .addWebhookEvent("parse.success") diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParamsTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParamsTest.kt index 1a38409..289bd62 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/parsing/ParsingCreateParamsTest.kt @@ -276,6 +276,8 @@ internal class ParsingCreateParamsTest { .putAdditionalProperty("team", JsonValue.from("research")) .build() ) + .addWebhookConfigurationId("whc-...") + .addWebhookConfigurationId("whc-...") .addWebhookConfiguration( ParsingCreateParams.WebhookConfiguration.builder() .addWebhookEvent("parse.success") @@ -571,6 +573,8 @@ internal class ParsingCreateParamsTest { .putAdditionalProperty("team", JsonValue.from("research")) .build() ) + .addWebhookConfigurationId("whc-...") + .addWebhookConfigurationId("whc-...") .addWebhookConfiguration( ParsingCreateParams.WebhookConfiguration.builder() .addWebhookEvent("parse.success") @@ -889,6 +893,8 @@ internal class ParsingCreateParamsTest { .putAdditionalProperty("team", JsonValue.from("research")) .build() ) + .addWebhookConfigurationId("whc-...") + .addWebhookConfigurationId("whc-...") .addWebhookConfiguration( ParsingCreateParams.WebhookConfiguration.builder() .addWebhookEvent("parse.success") @@ -1178,6 +1184,7 @@ internal class ParsingCreateParamsTest { .putAdditionalProperty("team", JsonValue.from("research")) .build() ) + assertThat(body.webhookConfigurationIds().getOrNull()).containsExactly("whc-...", "whc-...") assertThat(body.webhookConfigurations().getOrNull()) .containsExactly( ParsingCreateParams.WebhookConfiguration.builder() diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/ServiceParamsTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/ServiceParamsTest.kt index 2f60898..a13e6bd 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/ServiceParamsTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/ServiceParamsTest.kt @@ -340,6 +340,8 @@ internal class ServiceParamsTest { .putAdditionalProperty("team", JsonValue.from("research")) .build() ) + .addWebhookConfigurationId("whc-...") + .addWebhookConfigurationId("whc-...") .addWebhookConfiguration( ParsingCreateParams.WebhookConfiguration.builder() .addWebhookEvent("parse.success") diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ParsingServiceAsyncTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ParsingServiceAsyncTest.kt index c2b75e7..332095e 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ParsingServiceAsyncTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/ParsingServiceAsyncTest.kt @@ -297,6 +297,8 @@ internal class ParsingServiceAsyncTest { .putAdditionalProperty("team", JsonValue.from("research")) .build() ) + .addWebhookConfigurationId("whc-...") + .addWebhookConfigurationId("whc-...") .addWebhookConfiguration( ParsingCreateParams.WebhookConfiguration.builder() .addWebhookEvent("parse.success") diff --git a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ParsingServiceTest.kt b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ParsingServiceTest.kt index a295179..fb573ae 100644 --- a/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ParsingServiceTest.kt +++ b/llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/ParsingServiceTest.kt @@ -297,6 +297,8 @@ internal class ParsingServiceTest { .putAdditionalProperty("team", JsonValue.from("research")) .build() ) + .addWebhookConfigurationId("whc-...") + .addWebhookConfigurationId("whc-...") .addWebhookConfiguration( ParsingCreateParams.WebhookConfiguration.builder() .addWebhookEvent("parse.success") From 7724870051f66a724271a211841d63ddadd8355e Mon Sep 17 00:00:00 2001 From: Yong Date: Tue, 30 Jun 2026 10:06:13 -0700 Subject: [PATCH 06/10] fix(ci): keep staging workflows on back-sync so GITHUB_TOKEN can push The sync-from-production push was rejected because it tried to create production-only workflow files (release.yml / publish-*.yml) on staging, which a GitHub App token (GITHUB_TOKEN) may not do. Squash production's content into one commit that keeps staging's own .github/workflows/, so the push is workflow-free and accepted, while still back-syncing the release-please content. --- .../workflows/stlc-sync-from-production.yml | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/stlc-sync-from-production.yml b/.github/workflows/stlc-sync-from-production.yml index 05b8f27..ec9240d 100644 --- a/.github/workflows/stlc-sync-from-production.yml +++ b/.github/workflows/stlc-sync-from-production.yml @@ -51,12 +51,36 @@ jobs: echo "behind=true" >> "$GITHUB_OUTPUT" fi - - name: Push production main to the back-sync branch on staging + - name: Build the back-sync branch (production content, staging workflows) + id: build if: steps.diff.outputs.behind == 'true' - run: git push origin production/main:refs/heads/stlc/from-prod --force + run: | + git config user.name stlc-bot + git config user.email stlc-bot@users.noreply.github.com + # Squash production's changes into one commit on top of staging main, + # keeping staging's own .github/workflows/. GITHUB_TOKEN is a GitHub + # App token and may not push commits that create or update + # .github/workflows/** — and production carries workflow files staging + # does not (release.yml, publish-*.yml). Dropping them keeps the push + # workflow-free while still delivering production's release-please + # content (CHANGELOG, version, manifest) for the next build to reseal. + git checkout --force -B stlc/from-prod origin/main + git reset --hard production/main + rm -rf .github/workflows + git checkout origin/main -- .github/workflows + git reset --soft origin/main + git add -A + if git diff --cached --quiet; then + echo "Production differs from staging only in workflow files - nothing to back-sync." + echo "synced=false" >> "$GITHUB_OUTPUT" + exit 0 + fi + git commit -m "Sync release changes from production" + git push origin stlc/from-prod --force + echo "synced=true" >> "$GITHUB_OUTPUT" - name: Open or update the back-sync PR on staging - if: steps.diff.outputs.behind == 'true' + if: steps.build.outputs.synced == 'true' run: | EXISTING_PR=$(gh pr list --head stlc/from-prod --base main --state open --json number --jq '.[0].number') if [ -z "${EXISTING_PR}" ]; then From 86c43a00d3739e6695ec6bef5c4343cefb086f36 Mon Sep 17 00:00:00 2001 From: Yong Date: Tue, 30 Jun 2026 10:10:37 -0700 Subject: [PATCH 07/10] fix(ci): squash-MERGE production into staging, don't reset to it The first cut used `git reset --hard production/main`, which replaces staging's tree with production's. Staging is ahead of production on generated code, so that reverted staging (e.g. dropped webhookSigningSecret). Use `git merge --squash` so staging keeps its newer code and only gains production's release-please commits, still as one workflow-free commit. --- .github/workflows/stlc-sync-from-production.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stlc-sync-from-production.yml b/.github/workflows/stlc-sync-from-production.yml index ec9240d..84da0b3 100644 --- a/.github/workflows/stlc-sync-from-production.yml +++ b/.github/workflows/stlc-sync-from-production.yml @@ -65,10 +65,15 @@ jobs: # workflow-free while still delivering production's release-please # content (CHANGELOG, version, manifest) for the next build to reseal. git checkout --force -B stlc/from-prod origin/main - git reset --hard production/main + # Squash-MERGE, not reset: staging is usually ahead of production on + # generated code, so merge production's release commits in rather than + # reset to production's tree (which would revert staging's newer code). + if ! git merge --squash production/main; then + echo "Back-sync conflicts with production - needs manual resolution." >&2 + git reset --hard origin/main; exit 1 + fi rm -rf .github/workflows git checkout origin/main -- .github/workflows - git reset --soft origin/main git add -A if git diff --cached --quiet; then echo "Production differs from staging only in workflow files - nothing to back-sync." From f95474c7dc3780d560acadbf7ea726581b09c186 Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Tue, 30 Jun 2026 17:11:05 +0000 Subject: [PATCH 08/10] Sync release changes from production --- .release-please-manifest.json | 2 +- CHANGELOG.md | 15 +++++++++++++++ README.md | 10 +++++----- build.gradle.kts | 2 +- 4 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1332969..fea3454 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.1" + ".": "1.0.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..5a538df --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,15 @@ +# Changelog + +## [1.0.0](https://github.com/run-llama/llama-parse-java/compare/v0.0.1...v1.0.0) (2026-06-25) + + +### Features + +* **java:** enable Maven Central publishing (ai.llamaindex:llama-cloud) ([6bc70c0](https://github.com/run-llama/llama-parse-java/commit/6bc70c07baea09fe7a3332eacd46606b9e97c722)) + + +### Chores + +* configure new SDK language ([f5bfbf1](https://github.com/run-llama/llama-parse-java/commit/f5bfbf17777ed432162656ae5e3eaeb7d40978cb)) +* release 1.0.0 ([845b61c](https://github.com/run-llama/llama-parse-java/commit/845b61ccc16299996e92b8e52b78e647ba460f35)) +* **spec:** sync OpenAPI spec from platform ([1245d24](https://github.com/run-llama/llama-parse-java/commit/1245d24ba984b175a8fb2c8886a7dd4012816f0d)) diff --git a/README.md b/README.md index ccdf68e..d0b8b1c 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.llamacloud_prod.api/llama-cloud)](https://central.sonatype.com/artifact/com.llamacloud_prod.api/llama-cloud/0.0.1) -[![javadoc](https://javadoc.io/badge2/com.llamacloud_prod.api/llama-cloud/0.0.1/javadoc.svg)](https://javadoc.io/doc/com.llamacloud_prod.api/llama-cloud/0.0.1) +[![Maven Central](https://img.shields.io/maven-central/v/com.llamacloud_prod.api/llama-cloud)](https://central.sonatype.com/artifact/com.llamacloud_prod.api/llama-cloud/1.0.0) +[![javadoc](https://javadoc.io/badge2/com.llamacloud_prod.api/llama-cloud/1.0.0/javadoc.svg)](https://javadoc.io/doc/com.llamacloud_prod.api/llama-cloud/0.0.1) @@ -22,7 +22,7 @@ Use the Llama Cloud MCP Server to enable AI assistants to interact with this API -The REST API documentation can be found on [developers.llamaindex.ai](https://developers.llamaindex.ai/). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.llamacloud_prod.api/llama-cloud/0.0.1). +The REST API documentation can be found on [developers.llamaindex.ai](https://developers.llamaindex.ai/). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.llamacloud_prod.api/llama-cloud/1.0.0). @@ -33,7 +33,7 @@ The REST API documentation can be found on [developers.llamaindex.ai](https://de ### Gradle ```kotlin -implementation("ai.llamaindex:llama-cloud:0.0.1") +implementation("ai.llamaindex:llama-cloud:1.0.0") ``` ### Maven @@ -42,7 +42,7 @@ implementation("ai.llamaindex:llama-cloud:0.0.1") ai.llamaindex llama-cloud - 0.0.1 + 1.0.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 538ea70..9945957 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "ai.llamaindex" - version = "0.0.1" // x-release-please-version + version = "1.0.0" // x-release-please-version } subprojects { From 23ba9bbb7f52dd0c800015cb58a41139fc43bc23 Mon Sep 17 00:00:00 2001 From: Yong Date: Tue, 30 Jun 2026 10:21:50 -0700 Subject: [PATCH 09/10] fix(ci): merge back-sync PR immediately instead of --auto main is unprotected and the bot PR's CI is gated behind manual approval, so --auto (which waits on checks) never completes. Immediate merge is hands-off and needs no approval. --- .github/workflows/stlc-sync-from-production.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stlc-sync-from-production.yml b/.github/workflows/stlc-sync-from-production.yml index 84da0b3..735e1e1 100644 --- a/.github/workflows/stlc-sync-from-production.yml +++ b/.github/workflows/stlc-sync-from-production.yml @@ -97,5 +97,9 @@ jobs: fi # Auto-merge so the loop is hands-off. If auto-merge isn't enabled on # the repo, the PR is left open for a one-click merge instead. - gh pr merge stlc/from-prod --merge --auto \ - || echo "Auto-merge unavailable — merge the back-sync PR manually." + # main is unprotected, so merge immediately. --auto would wait on a + # required check that doesn't exist here, and this bot PR's CI is gated + # behind manual approval (GITHUB_TOKEN-created PRs never auto-run CI), + # so waiting would block forever. An immediate merge needs neither. + gh pr merge stlc/from-prod --merge --delete-branch \ + || echo "Could not merge the back-sync PR automatically; merge it manually." From 0053e936ef261e24c348f2781947cfe55b63a11b Mon Sep 17 00:00:00 2001 From: stlc-bot Date: Tue, 30 Jun 2026 18:19:44 +0000 Subject: [PATCH 10/10] Build SDK Stainless-Generated-From: 5758524622e84d5eb5e1d022ee0a66694db31ff2 --- .../workflows/stlc-sync-from-production.yml | 43 +++---------------- CHANGELOG.md | 15 ------- README.md | 2 +- 3 files changed, 6 insertions(+), 54 deletions(-) delete mode 100644 CHANGELOG.md diff --git a/.github/workflows/stlc-sync-from-production.yml b/.github/workflows/stlc-sync-from-production.yml index 735e1e1..05b8f27 100644 --- a/.github/workflows/stlc-sync-from-production.yml +++ b/.github/workflows/stlc-sync-from-production.yml @@ -51,41 +51,12 @@ jobs: echo "behind=true" >> "$GITHUB_OUTPUT" fi - - name: Build the back-sync branch (production content, staging workflows) - id: build + - name: Push production main to the back-sync branch on staging if: steps.diff.outputs.behind == 'true' - run: | - git config user.name stlc-bot - git config user.email stlc-bot@users.noreply.github.com - # Squash production's changes into one commit on top of staging main, - # keeping staging's own .github/workflows/. GITHUB_TOKEN is a GitHub - # App token and may not push commits that create or update - # .github/workflows/** — and production carries workflow files staging - # does not (release.yml, publish-*.yml). Dropping them keeps the push - # workflow-free while still delivering production's release-please - # content (CHANGELOG, version, manifest) for the next build to reseal. - git checkout --force -B stlc/from-prod origin/main - # Squash-MERGE, not reset: staging is usually ahead of production on - # generated code, so merge production's release commits in rather than - # reset to production's tree (which would revert staging's newer code). - if ! git merge --squash production/main; then - echo "Back-sync conflicts with production - needs manual resolution." >&2 - git reset --hard origin/main; exit 1 - fi - rm -rf .github/workflows - git checkout origin/main -- .github/workflows - git add -A - if git diff --cached --quiet; then - echo "Production differs from staging only in workflow files - nothing to back-sync." - echo "synced=false" >> "$GITHUB_OUTPUT" - exit 0 - fi - git commit -m "Sync release changes from production" - git push origin stlc/from-prod --force - echo "synced=true" >> "$GITHUB_OUTPUT" + run: git push origin production/main:refs/heads/stlc/from-prod --force - name: Open or update the back-sync PR on staging - if: steps.build.outputs.synced == 'true' + if: steps.diff.outputs.behind == 'true' run: | EXISTING_PR=$(gh pr list --head stlc/from-prod --base main --state open --json number --jq '.[0].number') if [ -z "${EXISTING_PR}" ]; then @@ -97,9 +68,5 @@ jobs: fi # Auto-merge so the loop is hands-off. If auto-merge isn't enabled on # the repo, the PR is left open for a one-click merge instead. - # main is unprotected, so merge immediately. --auto would wait on a - # required check that doesn't exist here, and this bot PR's CI is gated - # behind manual approval (GITHUB_TOKEN-created PRs never auto-run CI), - # so waiting would block forever. An immediate merge needs neither. - gh pr merge stlc/from-prod --merge --delete-branch \ - || echo "Could not merge the back-sync PR automatically; merge it manually." + gh pr merge stlc/from-prod --merge --auto \ + || echo "Auto-merge unavailable — merge the back-sync PR manually." diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 5a538df..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,15 +0,0 @@ -# Changelog - -## [1.0.0](https://github.com/run-llama/llama-parse-java/compare/v0.0.1...v1.0.0) (2026-06-25) - - -### Features - -* **java:** enable Maven Central publishing (ai.llamaindex:llama-cloud) ([6bc70c0](https://github.com/run-llama/llama-parse-java/commit/6bc70c07baea09fe7a3332eacd46606b9e97c722)) - - -### Chores - -* configure new SDK language ([f5bfbf1](https://github.com/run-llama/llama-parse-java/commit/f5bfbf17777ed432162656ae5e3eaeb7d40978cb)) -* release 1.0.0 ([845b61c](https://github.com/run-llama/llama-parse-java/commit/845b61ccc16299996e92b8e52b78e647ba460f35)) -* **spec:** sync OpenAPI spec from platform ([1245d24](https://github.com/run-llama/llama-parse-java/commit/1245d24ba984b175a8fb2c8886a7dd4012816f0d)) diff --git a/README.md b/README.md index d0b8b1c..ca194c2 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Maven Central](https://img.shields.io/maven-central/v/com.llamacloud_prod.api/llama-cloud)](https://central.sonatype.com/artifact/com.llamacloud_prod.api/llama-cloud/1.0.0) -[![javadoc](https://javadoc.io/badge2/com.llamacloud_prod.api/llama-cloud/1.0.0/javadoc.svg)](https://javadoc.io/doc/com.llamacloud_prod.api/llama-cloud/0.0.1) +[![javadoc](https://javadoc.io/badge2/com.llamacloud_prod.api/llama-cloud/1.0.0/javadoc.svg)](https://javadoc.io/doc/com.llamacloud_prod.api/llama-cloud/1.0.0)