@@ -1372,6 +1372,7 @@ private constructor(
13721372 private constructor (
13731373 private val acceptDownloads: JsonField <Boolean >,
13741374 private val args: JsonField <List <String >>,
1375+ private val cdpHeaders: JsonField <CdpHeaders >,
13751376 private val cdpUrl: JsonField <String >,
13761377 private val chromiumSandbox: JsonField <Boolean >,
13771378 private val connectTimeoutMs: JsonField <Double >,
@@ -1400,6 +1401,9 @@ private constructor(
14001401 @JsonProperty(" args" )
14011402 @ExcludeMissing
14021403 args: JsonField <List <String >> = JsonMissing .of(),
1404+ @JsonProperty(" cdpHeaders" )
1405+ @ExcludeMissing
1406+ cdpHeaders: JsonField <CdpHeaders > = JsonMissing .of(),
14031407 @JsonProperty(" cdpUrl" )
14041408 @ExcludeMissing
14051409 cdpUrl: JsonField <String > = JsonMissing .of(),
@@ -1450,6 +1454,7 @@ private constructor(
14501454 ) : this (
14511455 acceptDownloads,
14521456 args,
1457+ cdpHeaders,
14531458 cdpUrl,
14541459 chromiumSandbox,
14551460 connectTimeoutMs,
@@ -1483,6 +1488,12 @@ private constructor(
14831488 */
14841489 fun args (): Optional <List <String >> = args.getOptional(" args" )
14851490
1491+ /* *
1492+ * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g.
1493+ * if the server responded with an unexpected value).
1494+ */
1495+ fun cdpHeaders (): Optional <CdpHeaders > = cdpHeaders.getOptional(" cdpHeaders" )
1496+
14861497 /* *
14871498 * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g.
14881499 * if the server responded with an unexpected value).
@@ -1608,6 +1619,16 @@ private constructor(
16081619 */
16091620 @JsonProperty(" args" ) @ExcludeMissing fun _args (): JsonField <List <String >> = args
16101621
1622+ /* *
1623+ * Returns the raw JSON value of [cdpHeaders].
1624+ *
1625+ * Unlike [cdpHeaders], this method doesn't throw if the JSON field has an unexpected
1626+ * type.
1627+ */
1628+ @JsonProperty(" cdpHeaders" )
1629+ @ExcludeMissing
1630+ fun _cdpHeaders (): JsonField <CdpHeaders > = cdpHeaders
1631+
16111632 /* *
16121633 * Returns the raw JSON value of [cdpUrl].
16131634 *
@@ -1783,6 +1804,7 @@ private constructor(
17831804
17841805 private var acceptDownloads: JsonField <Boolean > = JsonMissing .of()
17851806 private var args: JsonField <MutableList <String >>? = null
1807+ private var cdpHeaders: JsonField <CdpHeaders > = JsonMissing .of()
17861808 private var cdpUrl: JsonField <String > = JsonMissing .of()
17871809 private var chromiumSandbox: JsonField <Boolean > = JsonMissing .of()
17881810 private var connectTimeoutMs: JsonField <Double > = JsonMissing .of()
@@ -1806,6 +1828,7 @@ private constructor(
18061828 internal fun from (launchOptions : LaunchOptions ) = apply {
18071829 acceptDownloads = launchOptions.acceptDownloads
18081830 args = launchOptions.args.map { it.toMutableList() }
1831+ cdpHeaders = launchOptions.cdpHeaders
18091832 cdpUrl = launchOptions.cdpUrl
18101833 chromiumSandbox = launchOptions.chromiumSandbox
18111834 connectTimeoutMs = launchOptions.connectTimeoutMs
@@ -1865,6 +1888,19 @@ private constructor(
18651888 }
18661889 }
18671890
1891+ fun cdpHeaders (cdpHeaders : CdpHeaders ) = cdpHeaders(JsonField .of(cdpHeaders))
1892+
1893+ /* *
1894+ * Sets [Builder.cdpHeaders] to an arbitrary JSON value.
1895+ *
1896+ * You should usually call [Builder.cdpHeaders] with a well-typed [CdpHeaders] value
1897+ * instead. This method is primarily for setting the field to an undocumented or not
1898+ * yet supported value.
1899+ */
1900+ fun cdpHeaders (cdpHeaders : JsonField <CdpHeaders >) = apply {
1901+ this .cdpHeaders = cdpHeaders
1902+ }
1903+
18681904 fun cdpUrl (cdpUrl : String ) = cdpUrl(JsonField .of(cdpUrl))
18691905
18701906 /* *
@@ -2120,6 +2156,7 @@ private constructor(
21202156 LaunchOptions (
21212157 acceptDownloads,
21222158 (args ? : JsonMissing .of()).map { it.toImmutable() },
2159+ cdpHeaders,
21232160 cdpUrl,
21242161 chromiumSandbox,
21252162 connectTimeoutMs,
@@ -2150,6 +2187,7 @@ private constructor(
21502187
21512188 acceptDownloads()
21522189 args()
2190+ cdpHeaders().ifPresent { it.validate() }
21532191 cdpUrl()
21542192 chromiumSandbox()
21552193 connectTimeoutMs()
@@ -2188,6 +2226,7 @@ private constructor(
21882226 internal fun validity (): Int =
21892227 (if (acceptDownloads.asKnown().isPresent) 1 else 0 ) +
21902228 (args.asKnown().getOrNull()?.size ? : 0 ) +
2229+ (cdpHeaders.asKnown().getOrNull()?.validity() ? : 0 ) +
21912230 (if (cdpUrl.asKnown().isPresent) 1 else 0 ) +
21922231 (if (chromiumSandbox.asKnown().isPresent) 1 else 0 ) +
21932232 (if (connectTimeoutMs.asKnown().isPresent) 1 else 0 ) +
@@ -2206,6 +2245,110 @@ private constructor(
22062245 (if (userDataDir.asKnown().isPresent) 1 else 0 ) +
22072246 (viewport.asKnown().getOrNull()?.validity() ? : 0 )
22082247
2248+ class CdpHeaders
2249+ @JsonCreator
2250+ private constructor (
2251+ @com.fasterxml.jackson.annotation.JsonValue
2252+ private val additionalProperties: Map <String , JsonValue >
2253+ ) {
2254+
2255+ @JsonAnyGetter
2256+ @ExcludeMissing
2257+ fun _additionalProperties (): Map <String , JsonValue > = additionalProperties
2258+
2259+ fun toBuilder () = Builder ().from(this )
2260+
2261+ companion object {
2262+
2263+ /* * Returns a mutable builder for constructing an instance of [CdpHeaders]. */
2264+ @JvmStatic fun builder () = Builder ()
2265+ }
2266+
2267+ /* * A builder for [CdpHeaders]. */
2268+ class Builder internal constructor() {
2269+
2270+ private var additionalProperties: MutableMap <String , JsonValue > = mutableMapOf ()
2271+
2272+ @JvmSynthetic
2273+ internal fun from (cdpHeaders : CdpHeaders ) = apply {
2274+ additionalProperties = cdpHeaders.additionalProperties.toMutableMap()
2275+ }
2276+
2277+ fun additionalProperties (additionalProperties : Map <String , JsonValue >) = apply {
2278+ this .additionalProperties.clear()
2279+ putAllAdditionalProperties(additionalProperties)
2280+ }
2281+
2282+ fun putAdditionalProperty (key : String , value : JsonValue ) = apply {
2283+ additionalProperties.put(key, value)
2284+ }
2285+
2286+ fun putAllAdditionalProperties (additionalProperties : Map <String , JsonValue >) =
2287+ apply {
2288+ this .additionalProperties.putAll(additionalProperties)
2289+ }
2290+
2291+ fun removeAdditionalProperty (key : String ) = apply {
2292+ additionalProperties.remove(key)
2293+ }
2294+
2295+ fun removeAllAdditionalProperties (keys : Set <String >) = apply {
2296+ keys.forEach(::removeAdditionalProperty)
2297+ }
2298+
2299+ /* *
2300+ * Returns an immutable instance of [CdpHeaders].
2301+ *
2302+ * Further updates to this [Builder] will not mutate the returned instance.
2303+ */
2304+ fun build (): CdpHeaders = CdpHeaders (additionalProperties.toImmutable())
2305+ }
2306+
2307+ private var validated: Boolean = false
2308+
2309+ fun validate (): CdpHeaders = apply {
2310+ if (validated) {
2311+ return @apply
2312+ }
2313+
2314+ validated = true
2315+ }
2316+
2317+ fun isValid (): Boolean =
2318+ try {
2319+ validate()
2320+ true
2321+ } catch (e: StagehandInvalidDataException ) {
2322+ false
2323+ }
2324+
2325+ /* *
2326+ * Returns a score indicating how many valid values are contained in this object
2327+ * recursively.
2328+ *
2329+ * Used for best match union deserialization.
2330+ */
2331+ @JvmSynthetic
2332+ internal fun validity (): Int =
2333+ additionalProperties.count { (_, value) ->
2334+ ! value.isNull() && ! value.isMissing()
2335+ }
2336+
2337+ override fun equals (other : Any? ): Boolean {
2338+ if (this == = other) {
2339+ return true
2340+ }
2341+
2342+ return other is CdpHeaders && additionalProperties == other.additionalProperties
2343+ }
2344+
2345+ private val hashCode: Int by lazy { Objects .hash(additionalProperties) }
2346+
2347+ override fun hashCode (): Int = hashCode
2348+
2349+ override fun toString () = " CdpHeaders{additionalProperties=$additionalProperties }"
2350+ }
2351+
22092352 @JsonDeserialize(using = IgnoreDefaultArgs .Deserializer ::class )
22102353 @JsonSerialize(using = IgnoreDefaultArgs .Serializer ::class )
22112354 class IgnoreDefaultArgs
@@ -2872,6 +3015,7 @@ private constructor(
28723015 return other is LaunchOptions &&
28733016 acceptDownloads == other.acceptDownloads &&
28743017 args == other.args &&
3018+ cdpHeaders == other.cdpHeaders &&
28753019 cdpUrl == other.cdpUrl &&
28763020 chromiumSandbox == other.chromiumSandbox &&
28773021 connectTimeoutMs == other.connectTimeoutMs &&
@@ -2896,6 +3040,7 @@ private constructor(
28963040 Objects .hash(
28973041 acceptDownloads,
28983042 args,
3043+ cdpHeaders,
28993044 cdpUrl,
29003045 chromiumSandbox,
29013046 connectTimeoutMs,
@@ -2920,7 +3065,7 @@ private constructor(
29203065 override fun hashCode (): Int = hashCode
29213066
29223067 override fun toString () =
2923- " LaunchOptions{acceptDownloads=$acceptDownloads , args=$args , cdpUrl=$cdpUrl , chromiumSandbox=$chromiumSandbox , connectTimeoutMs=$connectTimeoutMs , deviceScaleFactor=$deviceScaleFactor , devtools=$devtools , downloadsPath=$downloadsPath , executablePath=$executablePath , hasTouch=$hasTouch , headless=$headless , ignoreDefaultArgs=$ignoreDefaultArgs , ignoreHttpsErrors=$ignoreHttpsErrors , locale=$locale , port=$port , preserveUserDataDir=$preserveUserDataDir , proxy=$proxy , userDataDir=$userDataDir , viewport=$viewport , additionalProperties=$additionalProperties }"
3068+ " LaunchOptions{acceptDownloads=$acceptDownloads , args=$args , cdpHeaders= $cdpHeaders , cdpUrl=$cdpUrl , chromiumSandbox=$chromiumSandbox , connectTimeoutMs=$connectTimeoutMs , deviceScaleFactor=$deviceScaleFactor , devtools=$devtools , downloadsPath=$downloadsPath , executablePath=$executablePath , hasTouch=$hasTouch , headless=$headless , ignoreDefaultArgs=$ignoreDefaultArgs , ignoreHttpsErrors=$ignoreHttpsErrors , locale=$locale , port=$port , preserveUserDataDir=$preserveUserDataDir , proxy=$proxy , userDataDir=$userDataDir , viewport=$viewport , additionalProperties=$additionalProperties }"
29243069 }
29253070
29263071 /* * Browser type to use */
0 commit comments