Skip to content

Commit 4b65218

Browse files
author
Jakub Kulhan
committed
autoupdated protocol.json & generated files
1 parent da5b79b commit 4b65218

16 files changed

+728
-1
lines changed

gen-src/ChromeDevtoolsProtocol/DevtoolsClientInterface.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use ChromeDevtoolsProtocol\Domain\DOMStorageDomainInterface;
1818
use ChromeDevtoolsProtocol\Domain\DatabaseDomainInterface;
1919
use ChromeDevtoolsProtocol\Domain\DebuggerDomainInterface;
20+
use ChromeDevtoolsProtocol\Domain\DeviceAccessDomainInterface;
2021
use ChromeDevtoolsProtocol\Domain\DeviceOrientationDomainInterface;
2122
use ChromeDevtoolsProtocol\Domain\EmulationDomainInterface;
2223
use ChromeDevtoolsProtocol\Domain\EventBreakpointsDomainInterface;
@@ -140,6 +141,14 @@ public function database(): DatabaseDomainInterface;
140141
public function debugger(): DebuggerDomainInterface;
141142

142143

144+
/**
145+
* DeviceAccess domain.
146+
*
147+
* @experimental
148+
*/
149+
public function deviceAccess(): DeviceAccessDomainInterface;
150+
151+
143152
/**
144153
* DeviceOrientation domain.
145154
*

gen-src/ChromeDevtoolsProtocol/DevtoolsClientTrait.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
use ChromeDevtoolsProtocol\Domain\DatabaseDomainInterface;
3333
use ChromeDevtoolsProtocol\Domain\DebuggerDomain;
3434
use ChromeDevtoolsProtocol\Domain\DebuggerDomainInterface;
35+
use ChromeDevtoolsProtocol\Domain\DeviceAccessDomain;
36+
use ChromeDevtoolsProtocol\Domain\DeviceAccessDomainInterface;
3537
use ChromeDevtoolsProtocol\Domain\DeviceOrientationDomain;
3638
use ChromeDevtoolsProtocol\Domain\DeviceOrientationDomainInterface;
3739
use ChromeDevtoolsProtocol\Domain\EmulationDomain;
@@ -233,6 +235,18 @@ public function debugger(): DebuggerDomainInterface
233235
}
234236

235237

238+
public function deviceAccess(): DeviceAccessDomainInterface
239+
{
240+
if (!isset($this->domains['DeviceAccess'])) {
241+
/** @var InternalClientInterface $this */
242+
$this->domains['DeviceAccess'] = new DeviceAccessDomain($this);
243+
}
244+
/** @var DeviceAccessDomainInterface $domain */
245+
$domain = $this->domains['DeviceAccess'];
246+
return $domain;
247+
}
248+
249+
236250
public function deviceOrientation(): DeviceOrientationDomainInterface
237251
{
238252
if (!isset($this->domains['DeviceOrientation'])) {
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
3+
namespace ChromeDevtoolsProtocol\Domain;
4+
5+
use ChromeDevtoolsProtocol\ContextInterface;
6+
use ChromeDevtoolsProtocol\InternalClientInterface;
7+
use ChromeDevtoolsProtocol\Model\DeviceAccess\CancelPromptRequest;
8+
use ChromeDevtoolsProtocol\Model\DeviceAccess\DeviceRequestPromptedEvent;
9+
use ChromeDevtoolsProtocol\Model\DeviceAccess\SelectPromptRequest;
10+
use ChromeDevtoolsProtocol\SubscriptionInterface;
11+
12+
class DeviceAccessDomain implements DeviceAccessDomainInterface
13+
{
14+
/** @var InternalClientInterface */
15+
public $internalClient;
16+
17+
18+
public function __construct(InternalClientInterface $internalClient)
19+
{
20+
$this->internalClient = $internalClient;
21+
}
22+
23+
24+
public function cancelPrompt(ContextInterface $ctx, CancelPromptRequest $request): void
25+
{
26+
$this->internalClient->executeCommand($ctx, 'DeviceAccess.cancelPrompt', $request);
27+
}
28+
29+
30+
public function disable(ContextInterface $ctx): void
31+
{
32+
$request = new \stdClass();
33+
$this->internalClient->executeCommand($ctx, 'DeviceAccess.disable', $request);
34+
}
35+
36+
37+
public function enable(ContextInterface $ctx): void
38+
{
39+
$request = new \stdClass();
40+
$this->internalClient->executeCommand($ctx, 'DeviceAccess.enable', $request);
41+
}
42+
43+
44+
public function selectPrompt(ContextInterface $ctx, SelectPromptRequest $request): void
45+
{
46+
$this->internalClient->executeCommand($ctx, 'DeviceAccess.selectPrompt', $request);
47+
}
48+
49+
50+
public function addDeviceRequestPromptedListener(callable $listener): SubscriptionInterface
51+
{
52+
return $this->internalClient->addListener('DeviceAccess.deviceRequestPrompted', function ($event) use ($listener) {
53+
return $listener(DeviceRequestPromptedEvent::fromJson($event));
54+
});
55+
}
56+
57+
58+
public function awaitDeviceRequestPrompted(ContextInterface $ctx): DeviceRequestPromptedEvent
59+
{
60+
return DeviceRequestPromptedEvent::fromJson($this->internalClient->awaitEvent($ctx, 'DeviceAccess.deviceRequestPrompted'));
61+
}
62+
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?php
2+
3+
namespace ChromeDevtoolsProtocol\Domain;
4+
5+
use ChromeDevtoolsProtocol\ContextInterface;
6+
use ChromeDevtoolsProtocol\Model\DeviceAccess\CancelPromptRequest;
7+
use ChromeDevtoolsProtocol\Model\DeviceAccess\DeviceRequestPromptedEvent;
8+
use ChromeDevtoolsProtocol\Model\DeviceAccess\SelectPromptRequest;
9+
use ChromeDevtoolsProtocol\SubscriptionInterface;
10+
11+
/**
12+
* DeviceAccess domain.
13+
*
14+
* @experimental
15+
*
16+
* @generated This file has been auto-generated, do not edit.
17+
*
18+
* @author Jakub Kulhan <[email protected]>
19+
*/
20+
interface DeviceAccessDomainInterface
21+
{
22+
/**
23+
* Cancel a prompt in response to a DeviceAccess.deviceRequestPrompted event.
24+
*
25+
* @param ContextInterface $ctx
26+
* @param CancelPromptRequest $request
27+
*
28+
* @return void
29+
*/
30+
public function cancelPrompt(ContextInterface $ctx, CancelPromptRequest $request): void;
31+
32+
33+
/**
34+
* Disable events in this domain.
35+
*
36+
* @param ContextInterface $ctx
37+
*
38+
* @return void
39+
*/
40+
public function disable(ContextInterface $ctx): void;
41+
42+
43+
/**
44+
* Enable events in this domain.
45+
*
46+
* @param ContextInterface $ctx
47+
*
48+
* @return void
49+
*/
50+
public function enable(ContextInterface $ctx): void;
51+
52+
53+
/**
54+
* Select a device in response to a DeviceAccess.deviceRequestPrompted event.
55+
*
56+
* @param ContextInterface $ctx
57+
* @param SelectPromptRequest $request
58+
*
59+
* @return void
60+
*/
61+
public function selectPrompt(ContextInterface $ctx, SelectPromptRequest $request): void;
62+
63+
64+
/**
65+
* A device request opened a user prompt to select a device. Respond with the selectPrompt or cancelPrompt command.
66+
*
67+
* Listener will be called whenever event DeviceAccess.deviceRequestPrompted is fired.
68+
*
69+
* @param callable $listener
70+
*
71+
* @return SubscriptionInterface
72+
*/
73+
public function addDeviceRequestPromptedListener(callable $listener): SubscriptionInterface;
74+
75+
76+
/**
77+
* A device request opened a user prompt to select a device. Respond with the selectPrompt or cancelPrompt command.
78+
*
79+
* Method will block until first DeviceAccess.deviceRequestPrompted event is fired.
80+
*
81+
* @param ContextInterface $ctx
82+
*
83+
* @return DeviceRequestPromptedEvent
84+
*/
85+
public function awaitDeviceRequestPrompted(ContextInterface $ctx): DeviceRequestPromptedEvent;
86+
}

gen-src/ChromeDevtoolsProtocol/Domain/PageDomain.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
use ChromeDevtoolsProtocol\Model\Page\NavigateResponse;
6262
use ChromeDevtoolsProtocol\Model\Page\NavigateToHistoryEntryRequest;
6363
use ChromeDevtoolsProtocol\Model\Page\NavigatedWithinDocumentEvent;
64+
use ChromeDevtoolsProtocol\Model\Page\PrefetchStatusUpdatedEvent;
6465
use ChromeDevtoolsProtocol\Model\Page\PrerenderAttemptCompletedEvent;
6566
use ChromeDevtoolsProtocol\Model\Page\PrintToPDFRequest;
6667
use ChromeDevtoolsProtocol\Model\Page\PrintToPDFResponse;
@@ -843,6 +844,20 @@ public function awaitNavigatedWithinDocument(ContextInterface $ctx): NavigatedWi
843844
}
844845

845846

847+
public function addPrefetchStatusUpdatedListener(callable $listener): SubscriptionInterface
848+
{
849+
return $this->internalClient->addListener('Page.prefetchStatusUpdated', function ($event) use ($listener) {
850+
return $listener(PrefetchStatusUpdatedEvent::fromJson($event));
851+
});
852+
}
853+
854+
855+
public function awaitPrefetchStatusUpdated(ContextInterface $ctx): PrefetchStatusUpdatedEvent
856+
{
857+
return PrefetchStatusUpdatedEvent::fromJson($this->internalClient->awaitEvent($ctx, 'Page.prefetchStatusUpdated'));
858+
}
859+
860+
846861
public function addPrerenderAttemptCompletedListener(callable $listener): SubscriptionInterface
847862
{
848863
return $this->internalClient->addListener('Page.prerenderAttemptCompleted', function ($event) use ($listener) {

gen-src/ChromeDevtoolsProtocol/Domain/PageDomainInterface.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
use ChromeDevtoolsProtocol\Model\Page\NavigateResponse;
6161
use ChromeDevtoolsProtocol\Model\Page\NavigateToHistoryEntryRequest;
6262
use ChromeDevtoolsProtocol\Model\Page\NavigatedWithinDocumentEvent;
63+
use ChromeDevtoolsProtocol\Model\Page\PrefetchStatusUpdatedEvent;
6364
use ChromeDevtoolsProtocol\Model\Page\PrerenderAttemptCompletedEvent;
6465
use ChromeDevtoolsProtocol\Model\Page\PrintToPDFRequest;
6566
use ChromeDevtoolsProtocol\Model\Page\PrintToPDFResponse;
@@ -1311,6 +1312,30 @@ public function addNavigatedWithinDocumentListener(callable $listener): Subscrip
13111312
public function awaitNavigatedWithinDocument(ContextInterface $ctx): NavigatedWithinDocumentEvent;
13121313

13131314

1315+
/**
1316+
* TODO(crbug/1384419): Create a dedicated domain for preloading. Fired when a prefetch attempt is updated.
1317+
*
1318+
* Listener will be called whenever event Page.prefetchStatusUpdated is fired.
1319+
*
1320+
* @param callable $listener
1321+
*
1322+
* @return SubscriptionInterface
1323+
*/
1324+
public function addPrefetchStatusUpdatedListener(callable $listener): SubscriptionInterface;
1325+
1326+
1327+
/**
1328+
* TODO(crbug/1384419): Create a dedicated domain for preloading. Fired when a prefetch attempt is updated.
1329+
*
1330+
* Method will block until first Page.prefetchStatusUpdated event is fired.
1331+
*
1332+
* @param ContextInterface $ctx
1333+
*
1334+
* @return PrefetchStatusUpdatedEvent
1335+
*/
1336+
public function awaitPrefetchStatusUpdated(ContextInterface $ctx): PrefetchStatusUpdatedEvent;
1337+
1338+
13141339
/**
13151340
* Fired when a prerender attempt is completed.
13161341
*
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
3+
namespace ChromeDevtoolsProtocol\Model\DeviceAccess;
4+
5+
/**
6+
* Request for DeviceAccess.cancelPrompt command.
7+
*
8+
* @generated This file has been auto-generated, do not edit.
9+
*
10+
* @author Jakub Kulhan <[email protected]>
11+
*/
12+
final class CancelPromptRequest implements \JsonSerializable
13+
{
14+
/** @var string */
15+
public $id;
16+
17+
18+
/**
19+
* @param object $data
20+
* @return static
21+
*/
22+
public static function fromJson($data)
23+
{
24+
$instance = new static();
25+
if (isset($data->id)) {
26+
$instance->id = (string)$data->id;
27+
}
28+
return $instance;
29+
}
30+
31+
32+
public function jsonSerialize()
33+
{
34+
$data = new \stdClass();
35+
if ($this->id !== null) {
36+
$data->id = $this->id;
37+
}
38+
return $data;
39+
}
40+
41+
42+
/**
43+
* Create new instance using builder.
44+
*
45+
* @return CancelPromptRequestBuilder
46+
*/
47+
public static function builder(): CancelPromptRequestBuilder
48+
{
49+
return new CancelPromptRequestBuilder();
50+
}
51+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
namespace ChromeDevtoolsProtocol\Model\DeviceAccess;
4+
5+
use ChromeDevtoolsProtocol\Exception\BuilderException;
6+
7+
/**
8+
* @generated This file has been auto-generated, do not edit.
9+
*
10+
* @author Jakub Kulhan <[email protected]>
11+
*/
12+
final class CancelPromptRequestBuilder
13+
{
14+
private $id;
15+
16+
17+
/**
18+
* Validate non-optional parameters and return new instance.
19+
*/
20+
public function build(): CancelPromptRequest
21+
{
22+
$instance = new CancelPromptRequest();
23+
if ($this->id === null) {
24+
throw new BuilderException('Property [id] is required.');
25+
}
26+
$instance->id = $this->id;
27+
return $instance;
28+
}
29+
30+
31+
/**
32+
* @param string $id
33+
*
34+
* @return self
35+
*/
36+
public function setId($id): self
37+
{
38+
$this->id = $id;
39+
return $this;
40+
}
41+
}

0 commit comments

Comments
 (0)