Skip to content

Commit 5d55cd0

Browse files
feat(api): manual updates
1 parent 2262f19 commit 5d55cd0

File tree

3 files changed

+37
-39
lines changed

3 files changed

+37
-39
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 7
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-6a22863a7da4fa45f904657a4cb8fc1a28e236925f03dc94fca25fd8271ca6db.yml
3-
openapi_spec_hash: d5c6108942ad79f39ea4ff1bee9b7996
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-3607b588cab78536eb7de9f6acffe8ddda1d34aebe5910c2147421aa6c16bf22.yml
3+
openapi_spec_hash: fb507e8d38b4978a5717fbb144197868
44
config_hash: 2f1ec44e7e07906e07bdc6e075763da9

stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractResponse.kt

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,32 +33,32 @@ import java.util.Optional
3333
class SessionExtractResponse
3434
private constructor(
3535
private val extraction: Extraction? = null,
36-
private val unionMember1: UnionMember1? = null,
36+
private val custom: Custom? = null,
3737
private val _json: JsonValue? = null,
3838
) {
3939

4040
/** Default extraction result */
4141
fun extraction(): Optional<Extraction> = Optional.ofNullable(extraction)
4242

4343
/** Structured data matching provided schema */
44-
fun unionMember1(): Optional<UnionMember1> = Optional.ofNullable(unionMember1)
44+
fun custom(): Optional<Custom> = Optional.ofNullable(custom)
4545

4646
fun isExtraction(): Boolean = extraction != null
4747

48-
fun isUnionMember1(): Boolean = unionMember1 != null
48+
fun isCustom(): Boolean = custom != null
4949

5050
/** Default extraction result */
5151
fun asExtraction(): Extraction = extraction.getOrThrow("extraction")
5252

5353
/** Structured data matching provided schema */
54-
fun asUnionMember1(): UnionMember1 = unionMember1.getOrThrow("unionMember1")
54+
fun asCustom(): Custom = custom.getOrThrow("custom")
5555

5656
fun _json(): Optional<JsonValue> = Optional.ofNullable(_json)
5757

5858
fun <T> accept(visitor: Visitor<T>): T =
5959
when {
6060
extraction != null -> visitor.visitExtraction(extraction)
61-
unionMember1 != null -> visitor.visitUnionMember1(unionMember1)
61+
custom != null -> visitor.visitCustom(custom)
6262
else -> visitor.unknown(_json)
6363
}
6464

@@ -75,8 +75,8 @@ private constructor(
7575
extraction.validate()
7676
}
7777

78-
override fun visitUnionMember1(unionMember1: UnionMember1) {
79-
unionMember1.validate()
78+
override fun visitCustom(custom: Custom) {
79+
custom.validate()
8080
}
8181
}
8282
)
@@ -102,7 +102,7 @@ private constructor(
102102
object : Visitor<Int> {
103103
override fun visitExtraction(extraction: Extraction) = extraction.validity()
104104

105-
override fun visitUnionMember1(unionMember1: UnionMember1) = unionMember1.validity()
105+
override fun visitCustom(custom: Custom) = custom.validity()
106106

107107
override fun unknown(json: JsonValue?) = 0
108108
}
@@ -115,15 +115,15 @@ private constructor(
115115

116116
return other is SessionExtractResponse &&
117117
extraction == other.extraction &&
118-
unionMember1 == other.unionMember1
118+
custom == other.custom
119119
}
120120

121-
override fun hashCode(): Int = Objects.hash(extraction, unionMember1)
121+
override fun hashCode(): Int = Objects.hash(extraction, custom)
122122

123123
override fun toString(): String =
124124
when {
125125
extraction != null -> "SessionExtractResponse{extraction=$extraction}"
126-
unionMember1 != null -> "SessionExtractResponse{unionMember1=$unionMember1}"
126+
custom != null -> "SessionExtractResponse{custom=$custom}"
127127
_json != null -> "SessionExtractResponse{_unknown=$_json}"
128128
else -> throw IllegalStateException("Invalid SessionExtractResponse")
129129
}
@@ -135,9 +135,7 @@ private constructor(
135135
fun ofExtraction(extraction: Extraction) = SessionExtractResponse(extraction = extraction)
136136

137137
/** Structured data matching provided schema */
138-
@JvmStatic
139-
fun ofUnionMember1(unionMember1: UnionMember1) =
140-
SessionExtractResponse(unionMember1 = unionMember1)
138+
@JvmStatic fun ofCustom(custom: Custom) = SessionExtractResponse(custom = custom)
141139
}
142140

143141
/**
@@ -150,7 +148,7 @@ private constructor(
150148
fun visitExtraction(extraction: Extraction): T
151149

152150
/** Structured data matching provided schema */
153-
fun visitUnionMember1(unionMember1: UnionMember1): T
151+
fun visitCustom(custom: Custom): T
154152

155153
/**
156154
* Maps an unknown variant of [SessionExtractResponse] to a value of type [T].
@@ -178,8 +176,8 @@ private constructor(
178176
tryDeserialize(node, jacksonTypeRef<Extraction>())?.let {
179177
SessionExtractResponse(extraction = it, _json = json)
180178
},
181-
tryDeserialize(node, jacksonTypeRef<UnionMember1>())?.let {
182-
SessionExtractResponse(unionMember1 = it, _json = json)
179+
tryDeserialize(node, jacksonTypeRef<Custom>())?.let {
180+
SessionExtractResponse(custom = it, _json = json)
183181
},
184182
)
185183
.filterNotNull()
@@ -207,7 +205,7 @@ private constructor(
207205
) {
208206
when {
209207
value.extraction != null -> generator.writeObject(value.extraction)
210-
value.unionMember1 != null -> generator.writeObject(value.unionMember1)
208+
value.custom != null -> generator.writeObject(value.custom)
211209
value._json != null -> generator.writeObject(value._json)
212210
else -> throw IllegalStateException("Invalid SessionExtractResponse")
213211
}
@@ -358,7 +356,7 @@ private constructor(
358356
}
359357

360358
/** Structured data matching provided schema */
361-
class UnionMember1
359+
class Custom
362360
@JsonCreator
363361
private constructor(
364362
@com.fasterxml.jackson.annotation.JsonValue
@@ -373,18 +371,18 @@ private constructor(
373371

374372
companion object {
375373

376-
/** Returns a mutable builder for constructing an instance of [UnionMember1]. */
374+
/** Returns a mutable builder for constructing an instance of [Custom]. */
377375
@JvmStatic fun builder() = Builder()
378376
}
379377

380-
/** A builder for [UnionMember1]. */
378+
/** A builder for [Custom]. */
381379
class Builder internal constructor() {
382380

383381
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
384382

385383
@JvmSynthetic
386-
internal fun from(unionMember1: UnionMember1) = apply {
387-
additionalProperties = unionMember1.additionalProperties.toMutableMap()
384+
internal fun from(custom: Custom) = apply {
385+
additionalProperties = custom.additionalProperties.toMutableMap()
388386
}
389387

390388
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
@@ -407,16 +405,16 @@ private constructor(
407405
}
408406

409407
/**
410-
* Returns an immutable instance of [UnionMember1].
408+
* Returns an immutable instance of [Custom].
411409
*
412410
* Further updates to this [Builder] will not mutate the returned instance.
413411
*/
414-
fun build(): UnionMember1 = UnionMember1(additionalProperties.toImmutable())
412+
fun build(): Custom = Custom(additionalProperties.toImmutable())
415413
}
416414

417415
private var validated: Boolean = false
418416

419-
fun validate(): UnionMember1 = apply {
417+
fun validate(): Custom = apply {
420418
if (validated) {
421419
return@apply
422420
}
@@ -447,13 +445,13 @@ private constructor(
447445
return true
448446
}
449447

450-
return other is UnionMember1 && additionalProperties == other.additionalProperties
448+
return other is Custom && additionalProperties == other.additionalProperties
451449
}
452450

453451
private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
454452

455453
override fun hashCode(): Int = hashCode
456454

457-
override fun toString() = "UnionMember1{additionalProperties=$additionalProperties}"
455+
override fun toString() = "Custom{additionalProperties=$additionalProperties}"
458456
}
459457
}

stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractResponseTest.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ internal class SessionExtractResponseTest {
2222
val sessionExtractResponse = SessionExtractResponse.ofExtraction(extraction)
2323

2424
assertThat(sessionExtractResponse.extraction()).contains(extraction)
25-
assertThat(sessionExtractResponse.unionMember1()).isEmpty
25+
assertThat(sessionExtractResponse.custom()).isEmpty
2626
}
2727

2828
@Test
@@ -43,24 +43,24 @@ internal class SessionExtractResponseTest {
4343
}
4444

4545
@Test
46-
fun ofUnionMember1() {
47-
val unionMember1 =
48-
SessionExtractResponse.UnionMember1.builder()
46+
fun ofCustom() {
47+
val custom =
48+
SessionExtractResponse.Custom.builder()
4949
.putAdditionalProperty("foo", JsonValue.from("bar"))
5050
.build()
5151

52-
val sessionExtractResponse = SessionExtractResponse.ofUnionMember1(unionMember1)
52+
val sessionExtractResponse = SessionExtractResponse.ofCustom(custom)
5353

5454
assertThat(sessionExtractResponse.extraction()).isEmpty
55-
assertThat(sessionExtractResponse.unionMember1()).contains(unionMember1)
55+
assertThat(sessionExtractResponse.custom()).contains(custom)
5656
}
5757

5858
@Test
59-
fun ofUnionMember1Roundtrip() {
59+
fun ofCustomRoundtrip() {
6060
val jsonMapper = jsonMapper()
6161
val sessionExtractResponse =
62-
SessionExtractResponse.ofUnionMember1(
63-
SessionExtractResponse.UnionMember1.builder()
62+
SessionExtractResponse.ofCustom(
63+
SessionExtractResponse.Custom.builder()
6464
.putAdditionalProperty("foo", JsonValue.from("bar"))
6565
.build()
6666
)

0 commit comments

Comments
 (0)