Skip to content

Commit 6c1f9f1

Browse files
authored
Merge pull request #1536 from php-api-clients/GitHub/from-1.1.4-dbba2c62a8f04380c590a1aa0d1194e8-from-1.1.4-dbba2c62a8f04380c590a1aa0d1194e8
2 parents 51593d3 + 3bf26ef commit 6c1f9f1

File tree

58 files changed

+297
-1406
lines changed

Some content is hidden

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

58 files changed

+297
-1406
lines changed

clients/GitHub/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -4153,6 +4153,7 @@ $client->call('GET /orgs/{org}/attestations/{subject_digest}', [
41534153
'after' => 'generated',
41544154
'org' => 'generated',
41554155
'subject_digest' => 'generated',
4156+
'predicate_type' => 'generated',
41564157
'per_page' => 8,
41574158
]);
41584159
```
@@ -4163,6 +4164,7 @@ $client->operations()->orgs()->listAttestations( before: 'generated',
41634164
after: 'generated',
41644165
org: 'generated',
41654166
subject_digest: 'generated',
4167+
predicate_type: 'generated',
41664168
per_page: 8,
41674169
);
41684170
```
@@ -13117,6 +13119,7 @@ $client->call('GET /repos/{owner}/{repo}/attestations/{subject_digest}', [
1311713119
'before' => 'generated',
1311813120
'after' => 'generated',
1311913121
'subject_digest' => 'generated',
13122+
'predicate_type' => 'generated',
1312013123
'per_page' => 8,
1312113124
]);
1312213125
```
@@ -13128,6 +13131,7 @@ $client->operations()->repos()->listAttestations( owner: 'generated',
1312813131
before: 'generated',
1312913132
after: 'generated',
1313013133
subject_digest: 'generated',
13134+
predicate_type: 'generated',
1313113135
per_page: 8,
1313213136
);
1313313137
```
@@ -28087,6 +28091,7 @@ $client->call('GET /users/{username}/attestations/{subject_digest}', [
2808728091
'after' => 'generated',
2808828092
'username' => 'generated',
2808928093
'subject_digest' => 'generated',
28094+
'predicate_type' => 'generated',
2809028095
'per_page' => 8,
2809128096
]);
2809228097
```
@@ -28097,6 +28102,7 @@ $client->operations()->users()->listAttestations( before: 'generated',
2809728102
after: 'generated',
2809828103
username: 'generated',
2809928104
subject_digest: 'generated',
28105+
predicate_type: 'generated',
2810028106
per_page: 8,
2810128107
);
2810228108
```

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

+60-84
Large diffs are not rendered by default.

clients/GitHub/src/Client.php

+1-1
Large diffs are not rendered by default.

clients/GitHub/src/ClientInterface.php

+1-1
Large diffs are not rendered by default.

clients/GitHub/src/Internal/Hydrator/Operation/Users/Username/Attestations/SubjectDigest.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace ApiClients\Client\GitHub\Internal\Hydrator\Operation\Users\Username\Attestations;
66

77
use ApiClients\Client\GitHub\Schema\BasicError;
8-
use ApiClients\Client\GitHub\Schema\Operations\Users\ListAttestations\Response\ApplicationJson\Ok;
8+
use ApiClients\Client\GitHub\Schema\Operations\Users\ListAttestations\Response\ApplicationJson\Ok\Application\Json;
99
use EventSauce\ObjectHydrator\IterableList;
1010
use EventSauce\ObjectHydrator\ObjectMapper;
1111
use EventSauce\ObjectHydrator\PropertySerializers\SerializeArrayItems;
@@ -39,13 +39,13 @@ public function __construct()
3939
public function hydrateObject(string $className, array $payload): object
4040
{
4141
return match ($className) {
42-
'ApiClients\Client\GitHub\Schema\Operations\Users\ListAttestations\Response\ApplicationJson\Ok' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️Users⚡️ListAttestations⚡️Response⚡️ApplicationJson⚡️Ok($payload),
42+
'ApiClients\Client\GitHub\Schema\Operations\Users\ListAttestations\Response\ApplicationJson\Ok\Application\Json' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️Users⚡️ListAttestations⚡️Response⚡️ApplicationJson⚡️Ok⚡️Application⚡️Json($payload),
4343
'ApiClients\Client\GitHub\Schema\BasicError' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($payload),
4444
default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack),
4545
};
4646
}
4747

48-
private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️Users⚡️ListAttestations⚡️Response⚡️ApplicationJson⚡️Ok(array $payload): Ok
48+
private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️Users⚡️ListAttestations⚡️Response⚡️ApplicationJson⚡️Ok⚡️Application⚡️Json(array $payload): Json
4949
{
5050
$properties = [];
5151
$missingFields = [];
@@ -61,17 +61,17 @@ private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Oper
6161

6262
after_attestations:
6363
} catch (Throwable $exception) {
64-
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\Operations\Users\ListAttestations\Response\ApplicationJson\Ok', $exception, stack: $this->hydrationStack);
64+
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\Operations\Users\ListAttestations\Response\ApplicationJson\Ok\Application\Json', $exception, stack: $this->hydrationStack);
6565
}
6666

6767
if (count($missingFields) > 0) {
68-
throw UnableToHydrateObject::dueToMissingFields(Ok::class, $missingFields, stack: $this->hydrationStack);
68+
throw UnableToHydrateObject::dueToMissingFields(Json::class, $missingFields, stack: $this->hydrationStack);
6969
}
7070

7171
try {
72-
return new Ok(...$properties);
72+
return new Json(...$properties);
7373
} catch (Throwable $exception) {
74-
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\Operations\Users\ListAttestations\Response\ApplicationJson\Ok', $exception, stack: $this->hydrationStack);
74+
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\Operations\Users\ListAttestations\Response\ApplicationJson\Ok\Application\Json', $exception, stack: $this->hydrationStack);
7575
}
7676
}
7777

@@ -169,7 +169,7 @@ public function serializeObjectOfType(object $object, string $className): mixed
169169
'DateTime' => $this->serializeValueDateTime($object),
170170
'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object),
171171
'DateTimeInterface' => $this->serializeValueDateTimeInterface($object),
172-
'ApiClients\Client\GitHub\Schema\Operations\Users\ListAttestations\Response\ApplicationJson\Ok' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️Users⚡️ListAttestations⚡️Response⚡️ApplicationJson⚡️Ok($object),
172+
'ApiClients\Client\GitHub\Schema\Operations\Users\ListAttestations\Response\ApplicationJson\Ok\Application\Json' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️Users⚡️ListAttestations⚡️Response⚡️ApplicationJson⚡️Ok⚡️Application⚡️Json($object),
173173
'ApiClients\Client\GitHub\Schema\BasicError' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($object),
174174
default => throw new LogicException("No serialization defined for $className"),
175175
};
@@ -233,9 +233,9 @@ private function serializeValueDateTimeInterface(mixed $value): mixed
233233
return $serializer->serialize($value, $this);
234234
}
235235

236-
private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️Users⚡️ListAttestations⚡️Response⚡️ApplicationJson⚡️Ok(mixed $object): mixed
236+
private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Operations⚡️Users⚡️ListAttestations⚡️Response⚡️ApplicationJson⚡️Ok⚡️Application⚡️Json(mixed $object): mixed
237237
{
238-
assert($object instanceof Ok);
238+
assert($object instanceof Json);
239239
$result = [];
240240

241241
$attestations = $object->attestations;

clients/GitHub/src/Internal/Hydrators.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ public function hydrateObject(string $className, array $payload): object
10451045
'\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Apps\\ListInstallationReposForAuthenticatedUser\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀User🌀Installations🌀InstallationId🌀Repositories()->hydrateObject($className, $payload),
10461046
'\\ApiClients\\Client\\GitHub\\Schema\\Key' => $this->getObjectMapperOperation🌀User🌀Keys()->hydrateObject($className, $payload),
10471047
'\\ApiClients\\Client\\GitHub\\Schema\\SshSigningKey' => $this->getObjectMapperOperation🌀User🌀SshSigningKeys()->hydrateObject($className, $payload),
1048-
'\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Users\\ListAttestations\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Users🌀Username🌀Attestations🌀SubjectDigest()->hydrateObject($className, $payload),
1048+
'\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Users\\ListAttestations\\Response\\ApplicationJson\\Ok\\Application\\Json' => $this->getObjectMapperOperation🌀Users🌀Username🌀Attestations🌀SubjectDigest()->hydrateObject($className, $payload),
10491049
'\\ApiClients\\Client\\GitHub\\Schema\\Hovercard' => $this->getObjectMapperOperation🌀Users🌀Username🌀Hovercard()->hydrateObject($className, $payload),
10501050
'\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionConfigurationDisabled', '\\ApiClients\\Client\\GitHub\\Schema\\EnterpriseWebhooks', '\\ApiClients\\Client\\GitHub\\Schema\\SimpleInstallation', '\\ApiClients\\Client\\GitHub\\Schema\\OrganizationSimpleWebhooks', '\\ApiClients\\Client\\GitHub\\Schema\\RepositoryWebhooks', '\\ApiClients\\Client\\GitHub\\Schema\\RepositoryWebhooks\\Permissions', '\\ApiClients\\Client\\GitHub\\Schema\\RepositoryWebhooks\\CustomProperties', '\\ApiClients\\Client\\GitHub\\Schema\\RepositoryWebhooks\\TemplateRepository', '\\ApiClients\\Client\\GitHub\\Schema\\RepositoryWebhooks\\TemplateRepository\\Owner', '\\ApiClients\\Client\\GitHub\\Schema\\RepositoryWebhooks\\TemplateRepository\\Permissions', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionConfigurationEnabled' => $this->getObjectMapperWebHook🪝BranchProtectionConfiguration()->hydrateObject($className, $payload),
10511051
'\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleCreated', '\\ApiClients\\Client\\GitHub\\Schema\\WebhooksRule', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleDeleted', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\AdminEnforced', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\AuthorizedActorNames', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\AuthorizedActorsOnly', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\AuthorizedDismissalActorsOnly', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\LinearHistoryRequirementEnforcementLevel', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\LockBranchEnforcementLevel', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\LockAllowsForkSync', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\PullRequestReviewsEnforcementLevel', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\RequireLastPushApproval', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\RequiredStatusChecks', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\RequiredStatusChecksEnforcementLevel' => $this->getObjectMapperWebHook🪝BranchProtectionRule()->hydrateObject($className, $payload),
@@ -1423,7 +1423,7 @@ public function serializeObjectOfType(object $object, string $className): mixed
14231423
'\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Apps\\ListInstallationReposForAuthenticatedUser\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀User🌀Installations🌀InstallationId🌀Repositories()->serializeObject($object),
14241424
'\\ApiClients\\Client\\GitHub\\Schema\\Key' => $this->getObjectMapperOperation🌀User🌀Keys()->serializeObject($object),
14251425
'\\ApiClients\\Client\\GitHub\\Schema\\SshSigningKey' => $this->getObjectMapperOperation🌀User🌀SshSigningKeys()->serializeObject($object),
1426-
'\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Users\\ListAttestations\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Users🌀Username🌀Attestations🌀SubjectDigest()->serializeObject($object),
1426+
'\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Users\\ListAttestations\\Response\\ApplicationJson\\Ok\\Application\\Json' => $this->getObjectMapperOperation🌀Users🌀Username🌀Attestations🌀SubjectDigest()->serializeObject($object),
14271427
'\\ApiClients\\Client\\GitHub\\Schema\\Hovercard' => $this->getObjectMapperOperation🌀Users🌀Username🌀Hovercard()->serializeObject($object),
14281428
'\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionConfigurationDisabled', '\\ApiClients\\Client\\GitHub\\Schema\\EnterpriseWebhooks', '\\ApiClients\\Client\\GitHub\\Schema\\SimpleInstallation', '\\ApiClients\\Client\\GitHub\\Schema\\OrganizationSimpleWebhooks', '\\ApiClients\\Client\\GitHub\\Schema\\RepositoryWebhooks', '\\ApiClients\\Client\\GitHub\\Schema\\RepositoryWebhooks\\Permissions', '\\ApiClients\\Client\\GitHub\\Schema\\RepositoryWebhooks\\CustomProperties', '\\ApiClients\\Client\\GitHub\\Schema\\RepositoryWebhooks\\TemplateRepository', '\\ApiClients\\Client\\GitHub\\Schema\\RepositoryWebhooks\\TemplateRepository\\Owner', '\\ApiClients\\Client\\GitHub\\Schema\\RepositoryWebhooks\\TemplateRepository\\Permissions', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionConfigurationEnabled' => $this->getObjectMapperWebHook🪝BranchProtectionConfiguration()->serializeObject($object),
14291429
'\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleCreated', '\\ApiClients\\Client\\GitHub\\Schema\\WebhooksRule', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleDeleted', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\AdminEnforced', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\AuthorizedActorNames', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\AuthorizedActorsOnly', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\AuthorizedDismissalActorsOnly', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\LinearHistoryRequirementEnforcementLevel', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\LockBranchEnforcementLevel', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\LockAllowsForkSync', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\PullRequestReviewsEnforcementLevel', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\RequireLastPushApproval', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\RequiredStatusChecks', '\\ApiClients\\Client\\GitHub\\Schema\\WebhookBranchProtectionRuleEdited\\Changes\\RequiredStatusChecksEnforcementLevel' => $this->getObjectMapperWebHook🪝BranchProtectionRule()->serializeObject($object),

clients/GitHub/src/Internal/Operation/Orgs/ListAttestations.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,25 @@ final class ListAttestations
2929
private string $org;
3030
/**The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. **/
3131
private string $subjectDigest;
32+
/**Optional filter for fetching attestations with a given predicate type.
33+
This option accepts `provenance`, `sbom`, or freeform text for custom predicate types. **/
34+
private string $predicateType;
3235
/**The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." **/
3336
private int $perPage;
3437

35-
public function __construct(private readonly SchemaValidator $responseSchemaValidator, private readonly Internal\Hydrator\Operation\Orgs\Org\Attestations\SubjectDigest $hydrator, string $before, string $after, string $org, string $subjectDigest, int $perPage = 30)
38+
public function __construct(private readonly SchemaValidator $responseSchemaValidator, private readonly Internal\Hydrator\Operation\Orgs\Org\Attestations\SubjectDigest $hydrator, string $before, string $after, string $org, string $subjectDigest, string $predicateType, int $perPage = 30)
3639
{
3740
$this->before = $before;
3841
$this->after = $after;
3942
$this->org = $org;
4043
$this->subjectDigest = $subjectDigest;
44+
$this->predicateType = $predicateType;
4145
$this->perPage = $perPage;
4246
}
4347

4448
public function createRequest(): RequestInterface
4549
{
46-
return new Request('GET', str_replace(['{before}', '{after}', '{org}', '{subject_digest}', '{per_page}'], [$this->before, $this->after, $this->org, $this->subjectDigest, $this->perPage], '/orgs/{org}/attestations/{subject_digest}' . '?before={before}&after={after}&per_page={per_page}'));
50+
return new Request('GET', str_replace(['{before}', '{after}', '{org}', '{subject_digest}', '{predicate_type}', '{per_page}'], [$this->before, $this->after, $this->org, $this->subjectDigest, $this->predicateType, $this->perPage], '/orgs/{org}/attestations/{subject_digest}' . '?before={before}&after={after}&predicate_type={predicate_type}&per_page={per_page}'));
4751
}
4852

4953
public function createResponse(ResponseInterface $response): Schema\Operations\Orgs\ListAttestations\Response\ApplicationJson\Ok

clients/GitHub/src/Internal/Operation/Repos/ListAttestations.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,26 @@ final class ListAttestations
3131
private string $after;
3232
/**The parameter should be set to the attestation's subject's SHA256 digest, in the form `sha256:HEX_DIGEST`. **/
3333
private string $subjectDigest;
34+
/**Optional filter for fetching attestations with a given predicate type.
35+
This option accepts `provenance`, `sbom`, or freeform text for custom predicate types. **/
36+
private string $predicateType;
3437
/**The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." **/
3538
private int $perPage;
3639

37-
public function __construct(private readonly SchemaValidator $responseSchemaValidator, private readonly Internal\Hydrator\Operation\Repos\Owner\Repo\Attestations\SubjectDigest $hydrator, string $owner, string $repo, string $before, string $after, string $subjectDigest, int $perPage = 30)
40+
public function __construct(private readonly SchemaValidator $responseSchemaValidator, private readonly Internal\Hydrator\Operation\Repos\Owner\Repo\Attestations\SubjectDigest $hydrator, string $owner, string $repo, string $before, string $after, string $subjectDigest, string $predicateType, int $perPage = 30)
3841
{
3942
$this->owner = $owner;
4043
$this->repo = $repo;
4144
$this->before = $before;
4245
$this->after = $after;
4346
$this->subjectDigest = $subjectDigest;
47+
$this->predicateType = $predicateType;
4448
$this->perPage = $perPage;
4549
}
4650

4751
public function createRequest(): RequestInterface
4852
{
49-
return new Request('GET', str_replace(['{owner}', '{repo}', '{before}', '{after}', '{subject_digest}', '{per_page}'], [$this->owner, $this->repo, $this->before, $this->after, $this->subjectDigest, $this->perPage], '/repos/{owner}/{repo}/attestations/{subject_digest}' . '?before={before}&after={after}&per_page={per_page}'));
53+
return new Request('GET', str_replace(['{owner}', '{repo}', '{before}', '{after}', '{subject_digest}', '{predicate_type}', '{per_page}'], [$this->owner, $this->repo, $this->before, $this->after, $this->subjectDigest, $this->predicateType, $this->perPage], '/repos/{owner}/{repo}/attestations/{subject_digest}' . '?before={before}&after={after}&predicate_type={predicate_type}&per_page={per_page}'));
5054
}
5155

5256
public function createResponse(ResponseInterface $response): Schema\Operations\Repos\ListAttestations\Response\ApplicationJson\Ok\Application\Json

0 commit comments

Comments
 (0)