Skip to content

Commit 07f2358

Browse files
feat: Add missing cdpHeaders field to v3 server openapi spec
1 parent 20b3106 commit 07f2358

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 8
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-a4e672f457dd99336f4b2a113fd7c7c6c9db0941b38d57cff6e3641549a6c4ed.yml
3-
openapi_spec_hash: eae9c8561e420db8e4d238c1e59617fb
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-573d364768ac1902ee5ed8b2485d3b293bda0ea8ff7898aef1a3fd6be79b594a.yml
3+
openapi_spec_hash: 107ec840f4330885dd2232a05a66fed7
44
config_hash: 2a565ad6662259a2e90fa5f1f5095525

src/Sessions/SessionStartParams/Browser/LaunchOptions.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* @phpstan-type LaunchOptionsShape = array{
2121
* acceptDownloads?: bool|null,
2222
* args?: list<string>|null,
23+
* cdpHeaders?: array<string,string>|null,
2324
* cdpURL?: string|null,
2425
* chromiumSandbox?: bool|null,
2526
* connectTimeoutMs?: float|null,
@@ -51,6 +52,10 @@ final class LaunchOptions implements BaseModel
5152
#[Optional(list: 'string')]
5253
public ?array $args;
5354

55+
/** @var array<string,string>|null $cdpHeaders */
56+
#[Optional(map: 'string')]
57+
public ?array $cdpHeaders;
58+
5459
#[Optional('cdpUrl')]
5560
public ?string $cdpURL;
5661

@@ -114,13 +119,15 @@ public function __construct()
114119
* You must use named parameters to construct any parameters with a default value.
115120
*
116121
* @param list<string>|null $args
122+
* @param array<string,string>|null $cdpHeaders
117123
* @param IgnoreDefaultArgsShape|null $ignoreDefaultArgs
118124
* @param Proxy|ProxyShape|null $proxy
119125
* @param Viewport|ViewportShape|null $viewport
120126
*/
121127
public static function with(
122128
?bool $acceptDownloads = null,
123129
?array $args = null,
130+
?array $cdpHeaders = null,
124131
?string $cdpURL = null,
125132
?bool $chromiumSandbox = null,
126133
?float $connectTimeoutMs = null,
@@ -143,6 +150,7 @@ public static function with(
143150

144151
null !== $acceptDownloads && $self['acceptDownloads'] = $acceptDownloads;
145152
null !== $args && $self['args'] = $args;
153+
null !== $cdpHeaders && $self['cdpHeaders'] = $cdpHeaders;
146154
null !== $cdpURL && $self['cdpURL'] = $cdpURL;
147155
null !== $chromiumSandbox && $self['chromiumSandbox'] = $chromiumSandbox;
148156
null !== $connectTimeoutMs && $self['connectTimeoutMs'] = $connectTimeoutMs;
@@ -183,6 +191,17 @@ public function withArgs(array $args): self
183191
return $self;
184192
}
185193

194+
/**
195+
* @param array<string,string> $cdpHeaders
196+
*/
197+
public function withCdpHeaders(array $cdpHeaders): self
198+
{
199+
$self = clone $this;
200+
$self['cdpHeaders'] = $cdpHeaders;
201+
202+
return $self;
203+
}
204+
186205
public function withCdpURL(string $cdpURL): self
187206
{
188207
$self = clone $this;

tests/Services/SessionsTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ public function testStartWithOptionalParams(): void
270270
'launchOptions' => [
271271
'acceptDownloads' => true,
272272
'args' => ['string'],
273+
'cdpHeaders' => ['foo' => 'string'],
273274
'cdpURL' => 'cdpUrl',
274275
'chromiumSandbox' => true,
275276
'connectTimeoutMs' => 0,

0 commit comments

Comments
 (0)