Skip to content

Commit 59ad01d

Browse files
author
stlc-bot
committed
Hide public directory expires_at input (#21111)
Stainless-Generated-From: 4162c6f7b4065e64739a7c195ae1f8587fb78780
1 parent ab163b0 commit 59ad01d

4 files changed

Lines changed: 3 additions & 89 deletions

File tree

‎llama-cloud-core/src/main/kotlin/com/llamacloud_prod/api/models/beta/directories/DirectoryCreateParams.kt‎

Lines changed: 3 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import com.llamacloud_prod.api.core.http.Headers
1717
import com.llamacloud_prod.api.core.http.QueryParams
1818
import com.llamacloud_prod.api.core.toImmutable
1919
import com.llamacloud_prod.api.errors.LlamaCloudInvalidDataException
20-
import java.time.OffsetDateTime
2120
import java.util.Collections
2221
import java.util.Objects
2322
import java.util.Optional
@@ -53,14 +52,6 @@ private constructor(
5352
*/
5453
fun description(): Optional<String> = body.description()
5554

56-
/**
57-
* When this directory expires. Required for ephemeral directories.
58-
*
59-
* @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the
60-
* server responded with an unexpected value).
61-
*/
62-
fun expiresAt(): Optional<OffsetDateTime> = body.expiresAt()
63-
6455
/**
6556
* Reserved system-managed metadata.
6657
*
@@ -91,13 +82,6 @@ private constructor(
9182
*/
9283
fun _description(): JsonField<String> = body._description()
9384

94-
/**
95-
* Returns the raw JSON value of [expiresAt].
96-
*
97-
* Unlike [expiresAt], this method doesn't throw if the JSON field has an unexpected type.
98-
*/
99-
fun _expiresAt(): JsonField<OffsetDateTime> = body._expiresAt()
100-
10185
/**
10286
* Returns the raw JSON value of [systemMetadata].
10387
*
@@ -171,10 +155,8 @@ private constructor(
171155
* Otherwise, it's more convenient to use the top-level setters instead:
172156
* - [name]
173157
* - [description]
174-
* - [expiresAt]
175158
* - [systemMetadata]
176159
* - [type]
177-
* - etc.
178160
*/
179161
fun body(body: Body) = apply { this.body = body.toBuilder() }
180162

@@ -204,21 +186,6 @@ private constructor(
204186
*/
205187
fun description(description: JsonField<String>) = apply { body.description(description) }
206188

207-
/** When this directory expires. Required for ephemeral directories. */
208-
fun expiresAt(expiresAt: OffsetDateTime?) = apply { body.expiresAt(expiresAt) }
209-
210-
/** Alias for calling [Builder.expiresAt] with `expiresAt.orElse(null)`. */
211-
fun expiresAt(expiresAt: Optional<OffsetDateTime>) = expiresAt(expiresAt.getOrNull())
212-
213-
/**
214-
* Sets [Builder.expiresAt] to an arbitrary JSON value.
215-
*
216-
* You should usually call [Builder.expiresAt] with a well-typed [OffsetDateTime] value
217-
* instead. This method is primarily for setting the field to an undocumented or not yet
218-
* supported value.
219-
*/
220-
fun expiresAt(expiresAt: JsonField<OffsetDateTime>) = apply { body.expiresAt(expiresAt) }
221-
222189
/** Reserved system-managed metadata. */
223190
fun systemMetadata(systemMetadata: SystemMetadata?) = apply {
224191
body.systemMetadata(systemMetadata)
@@ -408,7 +375,6 @@ private constructor(
408375
private constructor(
409376
private val name: JsonField<String>,
410377
private val description: JsonField<String>,
411-
private val expiresAt: JsonField<OffsetDateTime>,
412378
private val systemMetadata: JsonField<SystemMetadata>,
413379
private val type: JsonField<Type>,
414380
private val additionalProperties: MutableMap<String, JsonValue>,
@@ -420,14 +386,11 @@ private constructor(
420386
@JsonProperty("description")
421387
@ExcludeMissing
422388
description: JsonField<String> = JsonMissing.of(),
423-
@JsonProperty("expires_at")
424-
@ExcludeMissing
425-
expiresAt: JsonField<OffsetDateTime> = JsonMissing.of(),
426389
@JsonProperty("system_metadata")
427390
@ExcludeMissing
428391
systemMetadata: JsonField<SystemMetadata> = JsonMissing.of(),
429392
@JsonProperty("type") @ExcludeMissing type: JsonField<Type> = JsonMissing.of(),
430-
) : this(name, description, expiresAt, systemMetadata, type, mutableMapOf())
393+
) : this(name, description, systemMetadata, type, mutableMapOf())
431394

432395
/**
433396
* Human-readable name for the directory.
@@ -445,14 +408,6 @@ private constructor(
445408
*/
446409
fun description(): Optional<String> = description.getOptional("description")
447410

448-
/**
449-
* When this directory expires. Required for ephemeral directories.
450-
*
451-
* @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if
452-
* the server responded with an unexpected value).
453-
*/
454-
fun expiresAt(): Optional<OffsetDateTime> = expiresAt.getOptional("expires_at")
455-
456411
/**
457412
* Reserved system-managed metadata.
458413
*
@@ -486,15 +441,6 @@ private constructor(
486441
@ExcludeMissing
487442
fun _description(): JsonField<String> = description
488443

489-
/**
490-
* Returns the raw JSON value of [expiresAt].
491-
*
492-
* Unlike [expiresAt], this method doesn't throw if the JSON field has an unexpected type.
493-
*/
494-
@JsonProperty("expires_at")
495-
@ExcludeMissing
496-
fun _expiresAt(): JsonField<OffsetDateTime> = expiresAt
497-
498444
/**
499445
* Returns the raw JSON value of [systemMetadata].
500446
*
@@ -542,7 +488,6 @@ private constructor(
542488

543489
private var name: JsonField<String>? = null
544490
private var description: JsonField<String> = JsonMissing.of()
545-
private var expiresAt: JsonField<OffsetDateTime> = JsonMissing.of()
546491
private var systemMetadata: JsonField<SystemMetadata> = JsonMissing.of()
547492
private var type: JsonField<Type> = JsonMissing.of()
548493
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
@@ -551,7 +496,6 @@ private constructor(
551496
internal fun from(body: Body) = apply {
552497
name = body.name
553498
description = body.description
554-
expiresAt = body.expiresAt
555499
systemMetadata = body.systemMetadata
556500
type = body.type
557501
additionalProperties = body.additionalProperties.toMutableMap()
@@ -586,23 +530,6 @@ private constructor(
586530
this.description = description
587531
}
588532

589-
/** When this directory expires. Required for ephemeral directories. */
590-
fun expiresAt(expiresAt: OffsetDateTime?) = expiresAt(JsonField.ofNullable(expiresAt))
591-
592-
/** Alias for calling [Builder.expiresAt] with `expiresAt.orElse(null)`. */
593-
fun expiresAt(expiresAt: Optional<OffsetDateTime>) = expiresAt(expiresAt.getOrNull())
594-
595-
/**
596-
* Sets [Builder.expiresAt] to an arbitrary JSON value.
597-
*
598-
* You should usually call [Builder.expiresAt] with a well-typed [OffsetDateTime] value
599-
* instead. This method is primarily for setting the field to an undocumented or not yet
600-
* supported value.
601-
*/
602-
fun expiresAt(expiresAt: JsonField<OffsetDateTime>) = apply {
603-
this.expiresAt = expiresAt
604-
}
605-
606533
/** Reserved system-managed metadata. */
607534
fun systemMetadata(systemMetadata: SystemMetadata?) =
608535
systemMetadata(JsonField.ofNullable(systemMetadata))
@@ -669,7 +596,6 @@ private constructor(
669596
Body(
670597
checkRequired("name", name),
671598
description,
672-
expiresAt,
673599
systemMetadata,
674600
type,
675601
additionalProperties.toMutableMap(),
@@ -694,7 +620,6 @@ private constructor(
694620

695621
name()
696622
description()
697-
expiresAt()
698623
systemMetadata().ifPresent { it.validate() }
699624
type().ifPresent { it.validate() }
700625
validated = true
@@ -718,7 +643,6 @@ private constructor(
718643
internal fun validity(): Int =
719644
(if (name.asKnown().isPresent) 1 else 0) +
720645
(if (description.asKnown().isPresent) 1 else 0) +
721-
(if (expiresAt.asKnown().isPresent) 1 else 0) +
722646
(systemMetadata.asKnown().getOrNull()?.validity() ?: 0) +
723647
(type.asKnown().getOrNull()?.validity() ?: 0)
724648

@@ -730,20 +654,19 @@ private constructor(
730654
return other is Body &&
731655
name == other.name &&
732656
description == other.description &&
733-
expiresAt == other.expiresAt &&
734657
systemMetadata == other.systemMetadata &&
735658
type == other.type &&
736659
additionalProperties == other.additionalProperties
737660
}
738661

739662
private val hashCode: Int by lazy {
740-
Objects.hash(name, description, expiresAt, systemMetadata, type, additionalProperties)
663+
Objects.hash(name, description, systemMetadata, type, additionalProperties)
741664
}
742665

743666
override fun hashCode(): Int = hashCode
744667

745668
override fun toString() =
746-
"Body{name=$name, description=$description, expiresAt=$expiresAt, systemMetadata=$systemMetadata, type=$type, additionalProperties=$additionalProperties}"
669+
"Body{name=$name, description=$description, systemMetadata=$systemMetadata, type=$type, additionalProperties=$additionalProperties}"
747670
}
748671

749672
/** Reserved system-managed metadata. */

‎llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/models/beta/directories/DirectoryCreateParamsTest.kt‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package com.llamacloud_prod.api.models.beta.directories
44

55
import com.llamacloud_prod.api.core.JsonValue
66
import com.llamacloud_prod.api.core.http.QueryParams
7-
import java.time.OffsetDateTime
87
import org.assertj.core.api.Assertions.assertThat
98
import org.junit.jupiter.api.Test
109

@@ -17,7 +16,6 @@ internal class DirectoryCreateParamsTest {
1716
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
1817
.name("x")
1918
.description("description")
20-
.expiresAt(OffsetDateTime.parse("2026-05-10T00:00:00Z"))
2119
.systemMetadata(
2220
DirectoryCreateParams.SystemMetadata.builder()
2321
.putAdditionalProperty("foo", JsonValue.from("bar"))
@@ -35,7 +33,6 @@ internal class DirectoryCreateParamsTest {
3533
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
3634
.name("x")
3735
.description("description")
38-
.expiresAt(OffsetDateTime.parse("2026-05-10T00:00:00Z"))
3936
.systemMetadata(
4037
DirectoryCreateParams.SystemMetadata.builder()
4138
.putAdditionalProperty("foo", JsonValue.from("bar"))
@@ -72,7 +69,6 @@ internal class DirectoryCreateParamsTest {
7269
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
7370
.name("x")
7471
.description("description")
75-
.expiresAt(OffsetDateTime.parse("2026-05-10T00:00:00Z"))
7672
.systemMetadata(
7773
DirectoryCreateParams.SystemMetadata.builder()
7874
.putAdditionalProperty("foo", JsonValue.from("bar"))
@@ -85,7 +81,6 @@ internal class DirectoryCreateParamsTest {
8581

8682
assertThat(body.name()).isEqualTo("x")
8783
assertThat(body.description()).contains("description")
88-
assertThat(body.expiresAt()).contains(OffsetDateTime.parse("2026-05-10T00:00:00Z"))
8984
assertThat(body.systemMetadata())
9085
.contains(
9186
DirectoryCreateParams.SystemMetadata.builder()

‎llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/async/beta/DirectoryServiceAsyncTest.kt‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import com.llamacloud_prod.api.models.beta.directories.DirectoryCreateParams
88
import com.llamacloud_prod.api.models.beta.directories.DirectoryDeleteParams
99
import com.llamacloud_prod.api.models.beta.directories.DirectoryGetParams
1010
import com.llamacloud_prod.api.models.beta.directories.DirectoryUpdateParams
11-
import java.time.OffsetDateTime
1211
import org.junit.jupiter.api.Disabled
1312
import org.junit.jupiter.api.Test
1413

@@ -27,7 +26,6 @@ internal class DirectoryServiceAsyncTest {
2726
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
2827
.name("x")
2928
.description("description")
30-
.expiresAt(OffsetDateTime.parse("2026-05-10T00:00:00Z"))
3129
.systemMetadata(
3230
DirectoryCreateParams.SystemMetadata.builder()
3331
.putAdditionalProperty("foo", JsonValue.from("bar"))

‎llama-cloud-core/src/test/kotlin/com/llamacloud_prod/api/services/blocking/beta/DirectoryServiceTest.kt‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import com.llamacloud_prod.api.models.beta.directories.DirectoryCreateParams
88
import com.llamacloud_prod.api.models.beta.directories.DirectoryDeleteParams
99
import com.llamacloud_prod.api.models.beta.directories.DirectoryGetParams
1010
import com.llamacloud_prod.api.models.beta.directories.DirectoryUpdateParams
11-
import java.time.OffsetDateTime
1211
import org.junit.jupiter.api.Disabled
1312
import org.junit.jupiter.api.Test
1413

@@ -27,7 +26,6 @@ internal class DirectoryServiceTest {
2726
.projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")
2827
.name("x")
2928
.description("description")
30-
.expiresAt(OffsetDateTime.parse("2026-05-10T00:00:00Z"))
3129
.systemMetadata(
3230
DirectoryCreateParams.SystemMetadata.builder()
3331
.putAdditionalProperty("foo", JsonValue.from("bar"))

0 commit comments

Comments
 (0)