Skip to content

Commit 5b89308

Browse files
author
Jakub Kulhan
committed
autoupdated protocol.json & generated files
1 parent 879e804 commit 5b89308

12 files changed

+425
-1
lines changed

gen-src/ChromeDevtoolsProtocol/Domain/WebAuthnDomain.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
use ChromeDevtoolsProtocol\ContextInterface;
66
use ChromeDevtoolsProtocol\InternalClientInterface;
7+
use ChromeDevtoolsProtocol\Model\WebAuthn\AddVirtualAuthenticatorRequest;
8+
use ChromeDevtoolsProtocol\Model\WebAuthn\AddVirtualAuthenticatorResponse;
9+
use ChromeDevtoolsProtocol\Model\WebAuthn\RemoveVirtualAuthenticatorRequest;
710

811
class WebAuthnDomain implements WebAuthnDomainInterface
912
{
@@ -17,6 +20,13 @@ public function __construct(InternalClientInterface $internalClient)
1720
}
1821

1922

23+
public function addVirtualAuthenticator(ContextInterface $ctx, AddVirtualAuthenticatorRequest $request): AddVirtualAuthenticatorResponse
24+
{
25+
$response = $this->internalClient->executeCommand($ctx, 'WebAuthn.addVirtualAuthenticator', $request);
26+
return AddVirtualAuthenticatorResponse::fromJson($response);
27+
}
28+
29+
2030
public function disable(ContextInterface $ctx): void
2131
{
2232
$request = new \stdClass();
@@ -29,4 +39,10 @@ public function enable(ContextInterface $ctx): void
2939
$request = new \stdClass();
3040
$this->internalClient->executeCommand($ctx, 'WebAuthn.enable', $request);
3141
}
42+
43+
44+
public function removeVirtualAuthenticator(ContextInterface $ctx, RemoveVirtualAuthenticatorRequest $request): void
45+
{
46+
$this->internalClient->executeCommand($ctx, 'WebAuthn.removeVirtualAuthenticator', $request);
47+
}
3248
}

gen-src/ChromeDevtoolsProtocol/Domain/WebAuthnDomainInterface.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
namespace ChromeDevtoolsProtocol\Domain;
44

55
use ChromeDevtoolsProtocol\ContextInterface;
6+
use ChromeDevtoolsProtocol\Model\WebAuthn\AddVirtualAuthenticatorRequest;
7+
use ChromeDevtoolsProtocol\Model\WebAuthn\AddVirtualAuthenticatorResponse;
8+
use ChromeDevtoolsProtocol\Model\WebAuthn\RemoveVirtualAuthenticatorRequest;
69

710
/**
811
* This domain allows configuring virtual authenticators to test the WebAuthn API.
@@ -15,6 +18,17 @@
1518
*/
1619
interface WebAuthnDomainInterface
1720
{
21+
/**
22+
* Creates and adds a virtual authenticator.
23+
*
24+
* @param ContextInterface $ctx
25+
* @param AddVirtualAuthenticatorRequest $request
26+
*
27+
* @return AddVirtualAuthenticatorResponse
28+
*/
29+
public function addVirtualAuthenticator(ContextInterface $ctx, AddVirtualAuthenticatorRequest $request): AddVirtualAuthenticatorResponse;
30+
31+
1832
/**
1933
* Disable the WebAuthn domain.
2034
*
@@ -33,4 +47,15 @@ public function disable(ContextInterface $ctx): void;
3347
* @return void
3448
*/
3549
public function enable(ContextInterface $ctx): void;
50+
51+
52+
/**
53+
* Removes the given authenticator.
54+
*
55+
* @param ContextInterface $ctx
56+
* @param RemoveVirtualAuthenticatorRequest $request
57+
*
58+
* @return void
59+
*/
60+
public function removeVirtualAuthenticator(ContextInterface $ctx, RemoveVirtualAuthenticatorRequest $request): void;
3661
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
namespace ChromeDevtoolsProtocol\Model\WebAuthn;
4+
5+
/**
6+
* Request for WebAuthn.addVirtualAuthenticator command.
7+
*
8+
* @generated This file has been auto-generated, do not edit.
9+
*
10+
* @author Jakub Kulhan <[email protected]>
11+
*/
12+
final class AddVirtualAuthenticatorRequest implements \JsonSerializable
13+
{
14+
/** @var VirtualAuthenticatorOptions */
15+
public $options;
16+
17+
18+
public static function fromJson($data)
19+
{
20+
$instance = new static();
21+
if (isset($data->options)) {
22+
$instance->options = VirtualAuthenticatorOptions::fromJson($data->options);
23+
}
24+
return $instance;
25+
}
26+
27+
28+
public function jsonSerialize()
29+
{
30+
$data = new \stdClass();
31+
if ($this->options !== null) {
32+
$data->options = $this->options->jsonSerialize();
33+
}
34+
return $data;
35+
}
36+
37+
38+
/**
39+
* Create new instance using builder.
40+
*
41+
* @return AddVirtualAuthenticatorRequestBuilder
42+
*/
43+
public static function builder(): AddVirtualAuthenticatorRequestBuilder
44+
{
45+
return new AddVirtualAuthenticatorRequestBuilder();
46+
}
47+
}
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\WebAuthn;
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 AddVirtualAuthenticatorRequestBuilder
13+
{
14+
private $options;
15+
16+
17+
/**
18+
* Validate non-optional parameters and return new instance.
19+
*/
20+
public function build(): AddVirtualAuthenticatorRequest
21+
{
22+
$instance = new AddVirtualAuthenticatorRequest();
23+
if ($this->options === null) {
24+
throw new BuilderException('Property [options] is required.');
25+
}
26+
$instance->options = $this->options;
27+
return $instance;
28+
}
29+
30+
31+
/**
32+
* @param VirtualAuthenticatorOptions $options
33+
*
34+
* @return self
35+
*/
36+
public function setOptions($options): self
37+
{
38+
$this->options = $options;
39+
return $this;
40+
}
41+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
namespace ChromeDevtoolsProtocol\Model\WebAuthn;
4+
5+
/**
6+
* Response to WebAuthn.addVirtualAuthenticator command.
7+
*
8+
* @generated This file has been auto-generated, do not edit.
9+
*
10+
* @author Jakub Kulhan <[email protected]>
11+
*/
12+
final class AddVirtualAuthenticatorResponse implements \JsonSerializable
13+
{
14+
/** @var string */
15+
public $authenticatorId;
16+
17+
18+
public static function fromJson($data)
19+
{
20+
$instance = new static();
21+
if (isset($data->authenticatorId)) {
22+
$instance->authenticatorId = (string)$data->authenticatorId;
23+
}
24+
return $instance;
25+
}
26+
27+
28+
public function jsonSerialize()
29+
{
30+
$data = new \stdClass();
31+
if ($this->authenticatorId !== null) {
32+
$data->authenticatorId = $this->authenticatorId;
33+
}
34+
return $data;
35+
}
36+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace ChromeDevtoolsProtocol\Model\WebAuthn;
4+
5+
/**
6+
* Values of named type WebAuthn.AuthenticatorProtocol.
7+
*
8+
* @generated This file has been auto-generated, do not edit.
9+
*
10+
* @author Jakub Kulhan <[email protected]>
11+
*/
12+
final class AuthenticatorProtocolEnum
13+
{
14+
const U2F = 'u2f';
15+
const CTAP2 = 'ctap2';
16+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace ChromeDevtoolsProtocol\Model\WebAuthn;
4+
5+
/**
6+
* Values of named type WebAuthn.AuthenticatorTransport.
7+
*
8+
* @generated This file has been auto-generated, do not edit.
9+
*
10+
* @author Jakub Kulhan <[email protected]>
11+
*/
12+
final class AuthenticatorTransportEnum
13+
{
14+
const USB = 'usb';
15+
const NFC = 'nfc';
16+
const BLE = 'ble';
17+
const CABLE = 'cable';
18+
const INTERNAL = 'internal';
19+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
namespace ChromeDevtoolsProtocol\Model\WebAuthn;
4+
5+
/**
6+
* Request for WebAuthn.removeVirtualAuthenticator command.
7+
*
8+
* @generated This file has been auto-generated, do not edit.
9+
*
10+
* @author Jakub Kulhan <[email protected]>
11+
*/
12+
final class RemoveVirtualAuthenticatorRequest implements \JsonSerializable
13+
{
14+
/** @var string */
15+
public $authenticatorId;
16+
17+
18+
public static function fromJson($data)
19+
{
20+
$instance = new static();
21+
if (isset($data->authenticatorId)) {
22+
$instance->authenticatorId = (string)$data->authenticatorId;
23+
}
24+
return $instance;
25+
}
26+
27+
28+
public function jsonSerialize()
29+
{
30+
$data = new \stdClass();
31+
if ($this->authenticatorId !== null) {
32+
$data->authenticatorId = $this->authenticatorId;
33+
}
34+
return $data;
35+
}
36+
37+
38+
/**
39+
* Create new instance using builder.
40+
*
41+
* @return RemoveVirtualAuthenticatorRequestBuilder
42+
*/
43+
public static function builder(): RemoveVirtualAuthenticatorRequestBuilder
44+
{
45+
return new RemoveVirtualAuthenticatorRequestBuilder();
46+
}
47+
}
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\WebAuthn;
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 RemoveVirtualAuthenticatorRequestBuilder
13+
{
14+
private $authenticatorId;
15+
16+
17+
/**
18+
* Validate non-optional parameters and return new instance.
19+
*/
20+
public function build(): RemoveVirtualAuthenticatorRequest
21+
{
22+
$instance = new RemoveVirtualAuthenticatorRequest();
23+
if ($this->authenticatorId === null) {
24+
throw new BuilderException('Property [authenticatorId] is required.');
25+
}
26+
$instance->authenticatorId = $this->authenticatorId;
27+
return $instance;
28+
}
29+
30+
31+
/**
32+
* @param string $authenticatorId
33+
*
34+
* @return self
35+
*/
36+
public function setAuthenticatorId($authenticatorId): self
37+
{
38+
$this->authenticatorId = $authenticatorId;
39+
return $this;
40+
}
41+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?php
2+
3+
namespace ChromeDevtoolsProtocol\Model\WebAuthn;
4+
5+
/**
6+
* Named type WebAuthn.VirtualAuthenticatorOptions.
7+
*
8+
* @generated This file has been auto-generated, do not edit.
9+
*
10+
* @author Jakub Kulhan <[email protected]>
11+
*/
12+
final class VirtualAuthenticatorOptions implements \JsonSerializable
13+
{
14+
/** @var string */
15+
public $protocol;
16+
17+
/** @var string */
18+
public $transport;
19+
20+
/** @var bool */
21+
public $hasResidentKey;
22+
23+
/** @var bool */
24+
public $hasUserVerification;
25+
26+
27+
public static function fromJson($data)
28+
{
29+
$instance = new static();
30+
if (isset($data->protocol)) {
31+
$instance->protocol = (string)$data->protocol;
32+
}
33+
if (isset($data->transport)) {
34+
$instance->transport = (string)$data->transport;
35+
}
36+
if (isset($data->hasResidentKey)) {
37+
$instance->hasResidentKey = (bool)$data->hasResidentKey;
38+
}
39+
if (isset($data->hasUserVerification)) {
40+
$instance->hasUserVerification = (bool)$data->hasUserVerification;
41+
}
42+
return $instance;
43+
}
44+
45+
46+
public function jsonSerialize()
47+
{
48+
$data = new \stdClass();
49+
if ($this->protocol !== null) {
50+
$data->protocol = $this->protocol;
51+
}
52+
if ($this->transport !== null) {
53+
$data->transport = $this->transport;
54+
}
55+
if ($this->hasResidentKey !== null) {
56+
$data->hasResidentKey = $this->hasResidentKey;
57+
}
58+
if ($this->hasUserVerification !== null) {
59+
$data->hasUserVerification = $this->hasUserVerification;
60+
}
61+
return $data;
62+
}
63+
}

0 commit comments

Comments
 (0)