@@ -6,8 +6,6 @@ import com.browserbase.api.core.ExcludeMissing
66import com.browserbase.api.core.JsonField
77import com.browserbase.api.core.JsonMissing
88import com.browserbase.api.core.JsonValue
9- import com.browserbase.api.core.checkKnown
10- import com.browserbase.api.core.toImmutable
119import com.browserbase.api.errors.StagehandInvalidDataException
1210import com.fasterxml.jackson.annotation.JsonAnyGetter
1311import com.fasterxml.jackson.annotation.JsonAnySetter
@@ -16,21 +14,18 @@ import com.fasterxml.jackson.annotation.JsonProperty
1614import java.util.Collections
1715import java.util.Objects
1816import java.util.Optional
19- import kotlin.jvm.optionals.getOrNull
2017
2118class SessionExecuteAgentResponse
2219@JsonCreator(mode = JsonCreator .Mode .DISABLED )
2320private constructor (
2421 private val message: JsonField <String >,
25- private val steps: JsonField <List <JsonValue >>,
2622 private val additionalProperties: MutableMap <String , JsonValue >,
2723) {
2824
2925 @JsonCreator
3026 private constructor (
31- @JsonProperty(" message" ) @ExcludeMissing message: JsonField <String > = JsonMissing .of(),
32- @JsonProperty(" steps" ) @ExcludeMissing steps: JsonField <List <JsonValue >> = JsonMissing .of(),
33- ) : this (message, steps, mutableMapOf ())
27+ @JsonProperty(" message" ) @ExcludeMissing message: JsonField <String > = JsonMissing .of()
28+ ) : this (message, mutableMapOf ())
3429
3530 /* *
3631 * Final message from the agent
@@ -40,28 +35,13 @@ private constructor(
4035 */
4136 fun message (): Optional <String > = message.getOptional(" message" )
4237
43- /* *
44- * Steps taken by the agent
45- *
46- * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the
47- * server responded with an unexpected value).
48- */
49- fun steps (): Optional <List <JsonValue >> = steps.getOptional(" steps" )
50-
5138 /* *
5239 * Returns the raw JSON value of [message].
5340 *
5441 * Unlike [message], this method doesn't throw if the JSON field has an unexpected type.
5542 */
5643 @JsonProperty(" message" ) @ExcludeMissing fun _message (): JsonField <String > = message
5744
58- /* *
59- * Returns the raw JSON value of [steps].
60- *
61- * Unlike [steps], this method doesn't throw if the JSON field has an unexpected type.
62- */
63- @JsonProperty(" steps" ) @ExcludeMissing fun _steps (): JsonField <List <JsonValue >> = steps
64-
6545 @JsonAnySetter
6646 private fun putAdditionalProperty (key : String , value : JsonValue ) {
6747 additionalProperties.put(key, value)
@@ -86,13 +66,11 @@ private constructor(
8666 class Builder internal constructor() {
8767
8868 private var message: JsonField <String > = JsonMissing .of()
89- private var steps: JsonField <MutableList <JsonValue >>? = null
9069 private var additionalProperties: MutableMap <String , JsonValue > = mutableMapOf ()
9170
9271 @JvmSynthetic
9372 internal fun from (sessionExecuteAgentResponse : SessionExecuteAgentResponse ) = apply {
9473 message = sessionExecuteAgentResponse.message
95- steps = sessionExecuteAgentResponse.steps.map { it.toMutableList() }
9674 additionalProperties = sessionExecuteAgentResponse.additionalProperties.toMutableMap()
9775 }
9876
@@ -107,30 +85,6 @@ private constructor(
10785 */
10886 fun message (message : JsonField <String >) = apply { this .message = message }
10987
110- /* * Steps taken by the agent */
111- fun steps (steps : List <JsonValue >) = steps(JsonField .of(steps))
112-
113- /* *
114- * Sets [Builder.steps] to an arbitrary JSON value.
115- *
116- * You should usually call [Builder.steps] with a well-typed `List<JsonValue>` value
117- * instead. This method is primarily for setting the field to an undocumented or not yet
118- * supported value.
119- */
120- fun steps (steps : JsonField <List <JsonValue >>) = apply {
121- this .steps = steps.map { it.toMutableList() }
122- }
123-
124- /* *
125- * Adds a single [JsonValue] to [steps].
126- *
127- * @throws IllegalStateException if the field was previously set to a non-list.
128- */
129- fun addStep (step : JsonValue ) = apply {
130- steps =
131- (steps ? : JsonField .of(mutableListOf ())).also { checkKnown(" steps" , it).add(step) }
132- }
133-
13488 fun additionalProperties (additionalProperties : Map <String , JsonValue >) = apply {
13589 this .additionalProperties.clear()
13690 putAllAdditionalProperties(additionalProperties)
@@ -156,11 +110,7 @@ private constructor(
156110 * Further updates to this [Builder] will not mutate the returned instance.
157111 */
158112 fun build (): SessionExecuteAgentResponse =
159- SessionExecuteAgentResponse (
160- message,
161- (steps ? : JsonMissing .of()).map { it.toImmutable() },
162- additionalProperties.toMutableMap(),
163- )
113+ SessionExecuteAgentResponse (message, additionalProperties.toMutableMap())
164114 }
165115
166116 private var validated: Boolean = false
@@ -171,7 +121,6 @@ private constructor(
171121 }
172122
173123 message()
174- steps()
175124 validated = true
176125 }
177126
@@ -188,9 +137,7 @@ private constructor(
188137 *
189138 * Used for best match union deserialization.
190139 */
191- @JvmSynthetic
192- internal fun validity (): Int =
193- (if (message.asKnown().isPresent) 1 else 0 ) + (steps.asKnown().getOrNull()?.size ? : 0 )
140+ @JvmSynthetic internal fun validity (): Int = (if (message.asKnown().isPresent) 1 else 0 )
194141
195142 override fun equals (other : Any? ): Boolean {
196143 if (this == = other) {
@@ -199,14 +146,13 @@ private constructor(
199146
200147 return other is SessionExecuteAgentResponse &&
201148 message == other.message &&
202- steps == other.steps &&
203149 additionalProperties == other.additionalProperties
204150 }
205151
206- private val hashCode: Int by lazy { Objects .hash(message, steps, additionalProperties) }
152+ private val hashCode: Int by lazy { Objects .hash(message, additionalProperties) }
207153
208154 override fun hashCode (): Int = hashCode
209155
210156 override fun toString () =
211- " SessionExecuteAgentResponse{message=$message , steps= $steps , additionalProperties=$additionalProperties }"
157+ " SessionExecuteAgentResponse{message=$message , additionalProperties=$additionalProperties }"
212158}
0 commit comments