Skip to content

Commit 5054cb6

Browse files
authored
Merge pull request #1113 from php-api-clients/GitHubEnterpriseCloud/from-1.1.4-b0eff1601830e8d5ba61c38811faf765-from-1.1.4-b0eff1601830e8d5ba61c38811faf765
2 parents 3204d4b + 7fd06d0 commit 5054cb6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+307
-119
lines changed

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

Lines changed: 50 additions & 46 deletions
Large diffs are not rendered by default.

clients/GitHubEnterpriseCloud/src/Internal/Hydrator/WebHook/Member.php

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberAdded;
1919
use ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberAdded\Changes;
2020
use ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberAdded\Changes\Permission;
21+
use ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberAdded\Changes\RoleName;
2122
use ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberEdited;
2223
use ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberEdited\Changes\OldPermission;
2324
use ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberRemoved;
@@ -59,6 +60,7 @@ public function hydrateObject(string $className, array $payload): object
5960
'ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberAdded' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️WebhookMemberAdded($payload),
6061
'ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberAdded\Changes' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️WebhookMemberAdded⚡️Changes($payload),
6162
'ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberAdded\Changes\Permission' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️WebhookMemberAdded⚡️Changes⚡️Permission($payload),
63+
'ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberAdded\Changes\RoleName' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️WebhookMemberAdded⚡️Changes⚡️RoleName($payload),
6264
'ApiClients\Client\GitHubEnterpriseCloud\Schema\EnterpriseWebhooks' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️EnterpriseWebhooks($payload),
6365
'ApiClients\Client\GitHubEnterpriseCloud\Schema\SimpleInstallation' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️SimpleInstallation($payload),
6466
'ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberAdded\Member' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️WebhookMemberAdded⚡️Member($payload),
@@ -277,6 +279,26 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
277279
$properties['permission'] = $value;
278280

279281
after_permission:
282+
283+
$value = $payload['role_name'] ?? null;
284+
285+
if ($value === null) {
286+
$properties['roleName'] = null;
287+
goto after_roleName;
288+
}
289+
290+
if (is_array($value)) {
291+
try {
292+
$this->hydrationStack[] = 'roleName';
293+
$value = $this->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️WebhookMemberAdded⚡️Changes⚡️RoleName($value);
294+
} finally {
295+
array_pop($this->hydrationStack);
296+
}
297+
}
298+
299+
$properties['roleName'] = $value;
300+
301+
after_roleName:
280302
} catch (Throwable $exception) {
281303
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberAdded\Changes', $exception, stack: $this->hydrationStack);
282304
}
@@ -322,6 +344,36 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
322344
}
323345
}
324346

347+
private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️WebhookMemberAdded⚡️Changes⚡️RoleName(array $payload): RoleName
348+
{
349+
$properties = [];
350+
$missingFields = [];
351+
try {
352+
$value = $payload['to'] ?? null;
353+
354+
if ($value === null) {
355+
$missingFields[] = 'to';
356+
goto after_to;
357+
}
358+
359+
$properties['to'] = $value;
360+
361+
after_to:
362+
} catch (Throwable $exception) {
363+
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberAdded\Changes\RoleName', $exception, stack: $this->hydrationStack);
364+
}
365+
366+
if (count($missingFields) > 0) {
367+
throw UnableToHydrateObject::dueToMissingFields(RoleName::class, $missingFields, stack: $this->hydrationStack);
368+
}
369+
370+
try {
371+
return new RoleName(...$properties);
372+
} catch (Throwable $exception) {
373+
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberAdded\Changes\RoleName', $exception, stack: $this->hydrationStack);
374+
}
375+
}
376+
325377
private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️EnterpriseWebhooks(array $payload): EnterpriseWebhooks
326378
{
327379
$properties = [];
@@ -5014,6 +5066,7 @@ public function serializeObjectOfType(object $object, string $className): mixed
50145066
'ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberAdded' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️WebhookMemberAdded($object),
50155067
'ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberAdded\Changes' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️WebhookMemberAdded⚡️Changes($object),
50165068
'ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberAdded\Changes\Permission' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️WebhookMemberAdded⚡️Changes⚡️Permission($object),
5069+
'ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberAdded\Changes\RoleName' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️WebhookMemberAdded⚡️Changes⚡️RoleName($object),
50175070
'ApiClients\Client\GitHubEnterpriseCloud\Schema\EnterpriseWebhooks' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️EnterpriseWebhooks($object),
50185071
'ApiClients\Client\GitHubEnterpriseCloud\Schema\SimpleInstallation' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️SimpleInstallation($object),
50195072
'ApiClients\Client\GitHubEnterpriseCloud\Schema\WebhookMemberAdded\Member' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️WebhookMemberAdded⚡️Member($object),
@@ -5173,6 +5226,15 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseClou
51735226
$permission = $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️WebhookMemberAdded⚡️Changes⚡️Permission($permission);
51745227
after_permission: $result['permission'] = $permission;
51755228

5229+
$roleName = $object->roleName;
5230+
5231+
if ($roleName === null) {
5232+
goto after_roleName;
5233+
}
5234+
5235+
$roleName = $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️WebhookMemberAdded⚡️Changes⚡️RoleName($roleName);
5236+
after_roleName: $result['role_name'] = $roleName;
5237+
51765238
return $result;
51775239
}
51785240

@@ -5187,6 +5249,17 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseClou
51875249
return $result;
51885250
}
51895251

5252+
private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️WebhookMemberAdded⚡️Changes⚡️RoleName(mixed $object): mixed
5253+
{
5254+
assert($object instanceof RoleName);
5255+
$result = [];
5256+
5257+
$to = $object->to;
5258+
after_to: $result['to'] = $to;
5259+
5260+
return $result;
5261+
}
5262+
51905263
private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️EnterpriseWebhooks(mixed $object): mixed
51915264
{
51925265
assert($object instanceof EnterpriseWebhooks);

clients/GitHubEnterpriseCloud/src/Internal/Hydrators.php

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

clients/GitHubEnterpriseCloud/src/Internal/Operation/Git/DeleteRef.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ final class DeleteRef
2727
private string $owner;
2828
/**The name of the repository without the `.git` extension. The name is not case sensitive. **/
2929
private string $repo;
30-
/**The commit reference. Can be a commit SHA, branch name (`heads/BRANCH_NAME`), or tag name (`tags/TAG_NAME`). For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. **/
30+
/**The Git reference. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. **/
3131
private string $ref;
3232

3333
public function __construct(private readonly SchemaValidator $responseSchemaValidator, private readonly Internal\Hydrator\Operation\Repos\Owner\Repo\Git\Refs\Ref $hydrator, string $owner, string $repo, string $ref)

clients/GitHubEnterpriseCloud/src/Internal/Operation/Git/GetRef.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class GetRef
2626
private string $owner;
2727
/**The name of the repository without the `.git` extension. The name is not case sensitive. **/
2828
private string $repo;
29-
/**The commit reference. Can be a commit SHA, branch name (`heads/BRANCH_NAME`), or tag name (`tags/TAG_NAME`). For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. **/
29+
/**The Git reference. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. **/
3030
private string $ref;
3131

3232
public function __construct(private readonly SchemaValidator $responseSchemaValidator, private readonly Internal\Hydrator\Operation\Repos\Owner\Repo\Git\Ref\Ref $hydrator, string $owner, string $repo, string $ref)

clients/GitHubEnterpriseCloud/src/Internal/Operation/Git/ListMatchingRefs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class ListMatchingRefs
2828
private string $owner;
2929
/**The name of the repository without the `.git` extension. The name is not case sensitive. **/
3030
private string $repo;
31-
/**The commit reference. Can be a commit SHA, branch name (`heads/BRANCH_NAME`), or tag name (`tags/TAG_NAME`). For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. **/
31+
/**The Git reference. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. **/
3232
private string $ref;
3333

3434
public function __construct(private readonly SchemaValidator $responseSchemaValidator, private readonly Internal\Hydrator\Operation\Repos\Owner\Repo\Git\MatchingRefs\Ref $hydrator, string $owner, string $repo, string $ref)

clients/GitHubEnterpriseCloud/src/Internal/Operation/Git/UpdateRef.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ final class UpdateRef
2727
private string $owner;
2828
/**The name of the repository without the `.git` extension. The name is not case sensitive. **/
2929
private string $repo;
30-
/**The name of the reference to update (for example, `heads/featureA`). Can be a branch name (`heads/BRANCH_NAME`) or tag name (`tags/TAG_NAME`). For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. **/
30+
/**The Git reference. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. **/
3131
private string $ref;
3232

3333
public function __construct(private readonly SchemaValidator $requestSchemaValidator, private readonly SchemaValidator $responseSchemaValidator, private readonly Internal\Hydrator\Operation\Repos\Owner\Repo\Git\Refs\Ref $hydrator, string $owner, string $repo, string $ref)

clients/GitHubEnterpriseCloud/src/Internal/Operator/Actions/CreateEnvironmentVariable.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function __construct(private Browser $browser, private AuthenticationInte
2424
{
2525
}
2626

27+
/** @return */
2728
public function call(string $owner, string $repo, string $environmentName, array $params): EmptyObject
2829
{
2930
$operation = new \ApiClients\Client\GitHubEnterpriseCloud\Internal\Operation\Actions\CreateEnvironmentVariable($this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrator, $owner, $repo, $environmentName);

clients/GitHubEnterpriseCloud/src/Internal/Operator/Actions/CreateOrUpdateEnvironmentSecret.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function __construct(private Browser $browser, private AuthenticationInte
2525
{
2626
}
2727

28+
/** @return */
2829
public function call(string $owner, string $repo, string $environmentName, string $secretName, array $params): EmptyObject|WithoutBody
2930
{
3031
$operation = new \ApiClients\Client\GitHubEnterpriseCloud\Internal\Operation\Actions\CreateOrUpdateEnvironmentSecret($this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrator, $owner, $repo, $environmentName, $secretName);

clients/GitHubEnterpriseCloud/src/Internal/Operator/Actions/DeleteEnvironmentSecret.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public function __construct(private Browser $browser, private AuthenticationInte
2222
{
2323
}
2424

25+
/** @return */
2526
public function call(string $owner, string $repo, string $environmentName, string $secretName): WithoutBody
2627
{
2728
$operation = new \ApiClients\Client\GitHubEnterpriseCloud\Internal\Operation\Actions\DeleteEnvironmentSecret($owner, $repo, $environmentName, $secretName);

0 commit comments

Comments
 (0)