Skip to content

Commit efa492a

Browse files
authored
Merge pull request #1114 from php-api-clients/GitHub/from-1.1.4-fbba6d70329032006e174265d6dabdb4-from-1.1.4-fbba6d70329032006e174265d6dabdb4
2 parents 5054cb6 + 6b891d3 commit efa492a

File tree

28 files changed

+499
-42
lines changed

28 files changed

+499
-42
lines changed

clients/GitHub/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18599,6 +18599,28 @@ $client->operations()->repos()->getPagesHealthCheck( owner: 'generated',
1859918599
You can find more about this operation over at the [API method documentation](https://docs.github.com/rest/pages/pages#get-a-dns-health-check-for-github-pages).
1860018600

1860118601

18602+
### repos/check-private-vulnerability-reporting
18603+
18604+
Check if private vulnerability reporting is enabled for a repository
18605+
18606+
Using the `call` method:
18607+
```php
18608+
$client->call('GET /repos/{owner}/{repo}/private-vulnerability-reporting', [
18609+
'owner' => 'generated',
18610+
'repo' => 'generated',
18611+
]);
18612+
```
18613+
18614+
Operations method:
18615+
```php
18616+
$client->operations()->repos()->checkPrivateVulnerabilityReporting( owner: 'generated',
18617+
repo: 'generated',
18618+
);
18619+
```
18620+
18621+
You can find more about this operation over at the [API method documentation](https://docs.github.com/rest/repos/repos#check-if-private-vulnerability-reporting-is-enabled-for-a-repository).
18622+
18623+
1860218624
### repos/enable-private-vulnerability-reporting
1860318625

1860418626
Enable private vulnerability reporting for a repository

clients/GitHub/etc/openapi-client-generator.state

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"specHash": "e684b01f55e23e58e41fa2e7c0b64a92",
2+
"specHash": "fbba6d70329032006e174265d6dabdb4",
33
"generatedFiles": {
44
"files": [
55
{
@@ -5704,11 +5704,11 @@
57045704
},
57055705
{
57065706
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/ClientInterface.php",
5707-
"hash": "c4dbae45a088e8ec687c225dc61f719d"
5707+
"hash": "09cadcb46ee15fd761d19ac3c9131e50"
57085708
},
57095709
{
57105710
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Client.php",
5711-
"hash": "d66d26643edb0962642617d195612cc7"
5711+
"hash": "0146fd390caf42bb44d9cf23f1ad51ef"
57125712
},
57135713
{
57145714
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/OperationsInterface.php",
@@ -5768,7 +5768,7 @@
57685768
},
57695769
{
57705770
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Actions.php",
5771-
"hash": "6958a502baab32c754e72a79106afaf5"
5771+
"hash": "277e40b19d896803fe34e8e94f5afbaf"
57725772
},
57735773
{
57745774
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Oidc.php",
@@ -5800,7 +5800,7 @@
58005800
},
58015801
{
58025802
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Repos.php",
5803-
"hash": "431da1a2adf36d781376be3c9313eeed"
5803+
"hash": "1652f3aa1c4dee669d2f56f75642b1b0"
58045804
},
58055805
{
58065806
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Billing.php",
@@ -5828,7 +5828,7 @@
58285828
},
58295829
{
58305830
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Git.php",
5831-
"hash": "9c38a4a18823d6f90c6e9ca6b916def3"
5831+
"hash": "b948e2966114b2c12ded4f9bdbd73b53"
58325832
},
58335833
{
58345834
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Pulls.php",
@@ -20792,7 +20792,7 @@
2079220792
},
2079320793
{
2079420794
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Git\/ListMatchingRefs.php",
20795-
"hash": "21d7062a4c75b151ea1a5d2dc265b11d"
20795+
"hash": "57dff4c78832390e6e38e77882be5ca0"
2079620796
},
2079720797
{
2079820798
"name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Git\/ListMatchingRefsTest.php",
@@ -20804,7 +20804,7 @@
2080420804
},
2080520805
{
2080620806
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Git\/GetRef.php",
20807-
"hash": "946a4735d7116bed09c18890b1a2809f"
20807+
"hash": "fd4eceee4cde3d4996f8aa5fa841da2d"
2080820808
},
2080920809
{
2081020810
"name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Git\/GetRefTest.php",
@@ -20828,7 +20828,7 @@
2082820828
},
2082920829
{
2083020830
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Git\/DeleteRef.php",
20831-
"hash": "fae3ae258f084b924ec7088f683c51d8"
20831+
"hash": "8f771722c05fc2681400021a65928c4b"
2083220832
},
2083320833
{
2083420834
"name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Git\/DeleteRefTest.php",
@@ -20840,7 +20840,7 @@
2084020840
},
2084120841
{
2084220842
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Git\/UpdateRef.php",
20843-
"hash": "965e8ccd478048451b32fe8ecf66a8f7"
20843+
"hash": "84246cae2314b6be275c95204e2c1144"
2084420844
},
2084520845
{
2084620846
"name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Git\/UpdateRefTest.php",
@@ -26360,7 +26360,7 @@
2636026360
},
2636126361
{
2636226362
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Repos.php",
26363-
"hash": "f9791132970373461e6a1e891b09faf4"
26363+
"hash": "78ec9f1dd11aa7047d235f941dd087cf"
2636426364
},
2636526365
{
2636626366
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Users.php",
@@ -26444,7 +26444,7 @@
2644426444
},
2644526445
{
2644626446
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Git.php",
26447-
"hash": "c57d4a5cedc282c7abb40124ad4fcd2f"
26447+
"hash": "d63897f9d8f2f75c641b8eeeae3cd666"
2644826448
},
2644926449
{
2645026450
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Post\/Apps.php",
@@ -26600,7 +26600,7 @@
2660026600
},
2660126601
{
2660226602
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/Git.php",
26603-
"hash": "e7b644c0d23c4ee08bdbf9c965ed769e"
26603+
"hash": "589f7fed5c27b166afa8be30ef8ca864"
2660426604
},
2660526605
{
2660626606
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/SecretScanning.php",
@@ -26740,7 +26740,7 @@
2674026740
},
2674126741
{
2674226742
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Git.php",
26743-
"hash": "fb6d8564b8dd353e8f27f33539b27e02"
26743+
"hash": "424bfc4103110a6ea98bbc894264abe0"
2674426744
},
2674526745
{
2674626746
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Issues.php",
@@ -26852,15 +26852,15 @@
2685226852
},
2685326853
{
2685426854
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Five.php",
26855-
"hash": "a74e39ca54dba0682475b255dcea9c6d"
26855+
"hash": "c9117cbea4f5f1d12fe1908351534f1d"
2685626856
},
2685726857
{
2685826858
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Six.php",
2685926859
"hash": "147555754780b5408e6bdfb6561e2110"
2686026860
},
2686126861
{
2686226862
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Seven.php",
26863-
"hash": "7d2360cc75bc508288a3726bfe688edd"
26863+
"hash": "ef991455eed10a93b989f73a343925da"
2686426864
},
2686526865
{
2686626866
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Get\/Eight.php",
@@ -26928,7 +26928,7 @@
2692826928
},
2692926929
{
2693026930
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/Seven.php",
26931-
"hash": "d0a3e9f73e2d004947ea8119671e26d9"
26931+
"hash": "65d699bf86ed52845ce7befdef35c421"
2693226932
},
2693326933
{
2693426934
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Patch\/Nine.php",
@@ -26992,7 +26992,7 @@
2699226992
},
2699326993
{
2699426994
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Seven.php",
26995-
"hash": "98773eb5ec018004fca3bde15589905f"
26995+
"hash": "eb1b6fc01745b0ea129737b92c6b1730"
2699626996
},
2699726997
{
2699826998
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Router\/Delete\/Six.php",
@@ -27060,7 +27060,7 @@
2706027060
},
2706127061
{
2706227062
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operators.php",
27063-
"hash": "2d2165e4b22cf2f46a5947f6a5e30790"
27063+
"hash": "a311396c927411c6481a78befcbc531c"
2706427064
},
2706527065
{
2706627066
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Root.php",
@@ -28452,7 +28452,7 @@
2845228452
},
2845328453
{
2845428454
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Repos\/Owner\/Repo\/PrivateVulnerabilityReporting.php",
28455-
"hash": "342bda4a4437ac75803724a8d59a482d"
28455+
"hash": "8d76c94b69bbb9a6cd4a3a31b1f99023"
2845628456
},
2845728457
{
2845828458
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Repos\/Owner\/Repo\/Projects.php",
@@ -29052,7 +29052,7 @@
2905229052
},
2905329053
{
2905429054
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrators.php",
29055-
"hash": "c8dc00fc1fafd16d8ef33fe7af2d1015"
29055+
"hash": "b1a270b3ab45f4e2b548c15f67a999e8"
2905629056
},
2905729057
{
2905829058
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/OrganizationSimpleWebhooks.php",
@@ -29688,11 +29688,11 @@
2968829688
},
2968929689
{
2969029690
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/PHPStan\/ClientCallReturnTypes.php",
29691-
"hash": "6d0ac9512eb1aec47121021bb7c31cec"
29691+
"hash": "95b4c3fa114ef069302254c2d7215fe1"
2969229692
},
2969329693
{
2969429694
"name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Types\/ClientCallReturnTypes.php",
29695-
"hash": "d1cb19fb08511ccbf5d2e56440135be1"
29695+
"hash": "0aa48ffd13970d33ebb5a0d63e54f0d4"
2969629696
},
2969729697
{
2969829698
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/..\/etc\/phpstan-extension.neon",
@@ -30693,6 +30693,22 @@
3069330693
{
3069430694
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookMemberAdded\/Changes\/RoleName.php",
3069530695
"hash": "55d4f31f4a6f67b0ffd9bceef734ae61"
30696+
},
30697+
{
30698+
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operation\/Repos\/CheckPrivateVulnerabilityReporting.php",
30699+
"hash": "413cee7ee3b8eea367078a6e766e3c53"
30700+
},
30701+
{
30702+
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Operator\/Repos\/CheckPrivateVulnerabilityReporting.php",
30703+
"hash": "f7cb209031663ea158f90e90d2f3d447"
30704+
},
30705+
{
30706+
"name": ".\/clients\/GitHub\/etc\/..\/\/tests\/\/Internal\/Operation\/Repos\/CheckPrivateVulnerabilityReportingTest.php",
30707+
"hash": "0645ca5fc5434bab13096832bbb04cfb"
30708+
},
30709+
{
30710+
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/Operations\/Repos\/CheckPrivateVulnerabilityReporting\/Response\/ApplicationJson\/Ok.php",
30711+
"hash": "e78db169660a96b37a058a82cedfa94e"
3069630712
}
3069730713
]
3069830714
},

clients/GitHub/src/Client.php

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

clients/GitHub/src/ClientInterface.php

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

clients/GitHub/src/Internal/Hydrator/Operation/Repos/Owner/Repo/PrivateVulnerabilityReporting.php

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace ApiClients\Client\GitHub\Internal\Hydrator\Operation\Repos\Owner\Repo;
66

77
use ApiClients\Client\GitHub\Schema\BasicError;
8+
use ApiClients\Client\GitHub\Schema\Operations\Repos\CheckPrivateVulnerabilityReporting\Response\ApplicationJson\Ok;
89
use ApiClients\Client\GitHub\Schema\ScimError;
910
use EventSauce\ObjectHydrator\IterableList;
1011
use EventSauce\ObjectHydrator\ObjectMapper;
@@ -39,12 +40,43 @@ public function __construct()
3940
public function hydrateObject(string $className, array $payload): object
4041
{
4142
return match ($className) {
42-
'ApiClients\Client\GitHub\Schema\BasicError' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($payload),
43+
'ApiClients\Client\GitHub\Schema\Operations\Repos\CheckPrivateVulnerabilityReporting\Response\ApplicationJson\Ok' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️Repos⚡️CheckPrivateVulnerabilityReporting⚡️Response⚡️ApplicationJson⚡️Ok($payload),
44+
'ApiClients\Client\GitHub\Schema\BasicError' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($payload),
4345
'ApiClients\Client\GitHub\Schema\ScimError' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ScimError($payload),
4446
default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack),
4547
};
4648
}
4749

50+
private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️Repos⚡️CheckPrivateVulnerabilityReporting⚡️Response⚡️ApplicationJson⚡️Ok(array $payload): Ok
51+
{
52+
$properties = [];
53+
$missingFields = [];
54+
try {
55+
$value = $payload['enabled'] ?? null;
56+
57+
if ($value === null) {
58+
$missingFields[] = 'enabled';
59+
goto after_enabled;
60+
}
61+
62+
$properties['enabled'] = $value;
63+
64+
after_enabled:
65+
} catch (Throwable $exception) {
66+
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\Operations\Repos\CheckPrivateVulnerabilityReporting\Response\ApplicationJson\Ok', $exception, stack: $this->hydrationStack);
67+
}
68+
69+
if (count($missingFields) > 0) {
70+
throw UnableToHydrateObject::dueToMissingFields(Ok::class, $missingFields, stack: $this->hydrationStack);
71+
}
72+
73+
try {
74+
return new Ok(...$properties);
75+
} catch (Throwable $exception) {
76+
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\Operations\Repos\CheckPrivateVulnerabilityReporting\Response\ApplicationJson\Ok', $exception, stack: $this->hydrationStack);
77+
}
78+
}
79+
4880
private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError(array $payload): BasicError
4981
{
5082
$properties = [];
@@ -224,6 +256,7 @@ public function serializeObjectOfType(object $object, string $className): mixed
224256
'DateTime' => $this->serializeValueDateTime($object),
225257
'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object),
226258
'DateTimeInterface' => $this->serializeValueDateTimeInterface($object),
259+
'ApiClients\Client\GitHub\Schema\Operations\Repos\CheckPrivateVulnerabilityReporting\Response\ApplicationJson\Ok' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️Repos⚡️CheckPrivateVulnerabilityReporting⚡️Response⚡️ApplicationJson⚡️Ok($object),
227260
'ApiClients\Client\GitHub\Schema\BasicError' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($object),
228261
'ApiClients\Client\GitHub\Schema\ScimError' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ScimError($object),
229262
default => throw new LogicException('No serialization defined for $className'),
@@ -288,6 +321,17 @@ private function serializeValueDateTimeInterface(mixed $value): mixed
288321
return $serializer->serialize($value, $this);
289322
}
290323

324+
private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️Repos⚡️CheckPrivateVulnerabilityReporting⚡️Response⚡️ApplicationJson⚡️Ok(mixed $object): mixed
325+
{
326+
assert($object instanceof Ok);
327+
$result = [];
328+
329+
$enabled = $object->enabled;
330+
after_enabled: $result['enabled'] = $enabled;
331+
332+
return $result;
333+
}
334+
291335
private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError(mixed $object): mixed
292336
{
293337
assert($object instanceof BasicError);

0 commit comments

Comments
 (0)