66
77use ApiClients \Client \GitHubEnterpriseCloud \Schema \ApiOverview ;
88use ApiClients \Client \GitHubEnterpriseCloud \Schema \ApiOverview \Domains ;
9+ use ApiClients \Client \GitHubEnterpriseCloud \Schema \ApiOverview \Domains \ArtifactAttestations ;
910use ApiClients \Client \GitHubEnterpriseCloud \Schema \ApiOverview \SshKeyFingerprints ;
1011use EventSauce \ObjectHydrator \IterableList ;
1112use EventSauce \ObjectHydrator \ObjectMapper ;
@@ -45,6 +46,7 @@ public function hydrateObject(string $className, array $payload): object
4546 'ApiClients\Client\GitHubEnterpriseCloud\Schema\ApiOverview ' => $ this ->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️ApiOverview ($ payload ),
4647 'ApiClients\Client\GitHubEnterpriseCloud\Schema\ApiOverview\SshKeyFingerprints ' => $ this ->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️ApiOverview⚡️SshKeyFingerprints ($ payload ),
4748 'ApiClients\Client\GitHubEnterpriseCloud\Schema\ApiOverview\Domains ' => $ this ->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️ApiOverview⚡️Domains ($ payload ),
49+ 'ApiClients\Client\GitHubEnterpriseCloud\Schema\ApiOverview\Domains\ArtifactAttestations ' => $ this ->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️ApiOverview⚡️Domains⚡️ArtifactAttestations ($ payload ),
4850 default => throw UnableToHydrateObject::noHydrationDefined ($ className , $ this ->hydrationStack ),
4951 };
5052 }
@@ -384,6 +386,26 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
384386 $ properties ['actions ' ] = $ value ;
385387
386388 after_actions:
389+
390+ $ value = $ payload ['artifact_attestations ' ] ?? null ;
391+
392+ if ($ value === null ) {
393+ $ properties ['artifactAttestations ' ] = null ;
394+ goto after_artifactAttestations;
395+ }
396+
397+ if (is_array ($ value )) {
398+ try {
399+ $ this ->hydrationStack [] = 'artifactAttestations ' ;
400+ $ value = $ this ->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️ApiOverview⚡️Domains⚡️ArtifactAttestations ($ value );
401+ } finally {
402+ array_pop ($ this ->hydrationStack );
403+ }
404+ }
405+
406+ $ properties ['artifactAttestations ' ] = $ value ;
407+
408+ after_artifactAttestations:
387409 } catch (Throwable $ exception ) {
388410 throw UnableToHydrateObject::dueToError ('ApiClients\Client\GitHubEnterpriseCloud\Schema\ApiOverview\Domains ' , $ exception , stack: $ this ->hydrationStack );
389411 }
@@ -399,6 +421,47 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
399421 }
400422 }
401423
424+ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️ApiOverview⚡️Domains⚡️ArtifactAttestations (array $ payload ): ArtifactAttestations
425+ {
426+ $ properties = [];
427+ $ missingFields = [];
428+ try {
429+ $ value = $ payload ['trust_domain ' ] ?? null ;
430+
431+ if ($ value === null ) {
432+ $ properties ['trustDomain ' ] = null ;
433+ goto after_trustDomain;
434+ }
435+
436+ $ properties ['trustDomain ' ] = $ value ;
437+
438+ after_trustDomain:
439+
440+ $ value = $ payload ['services ' ] ?? null ;
441+
442+ if ($ value === null ) {
443+ $ properties ['services ' ] = null ;
444+ goto after_services;
445+ }
446+
447+ $ properties ['services ' ] = $ value ;
448+
449+ after_services:
450+ } catch (Throwable $ exception ) {
451+ throw UnableToHydrateObject::dueToError ('ApiClients\Client\GitHubEnterpriseCloud\Schema\ApiOverview\Domains\ArtifactAttestations ' , $ exception , stack: $ this ->hydrationStack );
452+ }
453+
454+ if (count ($ missingFields ) > 0 ) {
455+ throw UnableToHydrateObject::dueToMissingFields (ArtifactAttestations::class, $ missingFields , stack: $ this ->hydrationStack );
456+ }
457+
458+ try {
459+ return new ArtifactAttestations (...$ properties );
460+ } catch (Throwable $ exception ) {
461+ throw UnableToHydrateObject::dueToError ('ApiClients\Client\GitHubEnterpriseCloud\Schema\ApiOverview\Domains\ArtifactAttestations ' , $ exception , stack: $ this ->hydrationStack );
462+ }
463+ }
464+
402465 private function serializeViaTypeMap (string $ accessor , object $ object , array $ payloadToTypeMap ): array
403466 {
404467 foreach ($ payloadToTypeMap as $ payloadType => [$ valueType , $ method ]) {
@@ -433,6 +496,7 @@ public function serializeObjectOfType(object $object, string $className): mixed
433496 'ApiClients\Client\GitHubEnterpriseCloud\Schema\ApiOverview ' => $ this ->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️ApiOverview ($ object ),
434497 'ApiClients\Client\GitHubEnterpriseCloud\Schema\ApiOverview\SshKeyFingerprints ' => $ this ->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️ApiOverview⚡️SshKeyFingerprints ($ object ),
435498 'ApiClients\Client\GitHubEnterpriseCloud\Schema\ApiOverview\Domains ' => $ this ->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️ApiOverview⚡️Domains ($ object ),
499+ 'ApiClients\Client\GitHubEnterpriseCloud\Schema\ApiOverview\Domains\ArtifactAttestations ' => $ this ->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️ApiOverview⚡️Domains⚡️ArtifactAttestations ($ object ),
436500 default => throw new LogicException ("No serialization defined for $ className " ),
437501 };
438502 } catch (Throwable $ exception ) {
@@ -839,6 +903,46 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseClou
839903 $ actions = $ actionsSerializer0 ->serialize ($ actions , $ this );
840904 after_actions: $ result ['actions ' ] = $ actions ;
841905
906+ $ artifactAttestations = $ object ->artifactAttestations ;
907+
908+ if ($ artifactAttestations === null ) {
909+ goto after_artifactAttestations;
910+ }
911+
912+ $ artifactAttestations = $ this ->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️ApiOverview⚡️Domains⚡️ArtifactAttestations ($ artifactAttestations );
913+ after_artifactAttestations: $ result ['artifact_attestations ' ] = $ artifactAttestations ;
914+
915+ return $ result ;
916+ }
917+
918+ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️ApiOverview⚡️Domains⚡️ArtifactAttestations (mixed $ object ): mixed
919+ {
920+ assert ($ object instanceof ArtifactAttestations);
921+ $ result = [];
922+
923+ $ trustDomain = $ object ->trustDomain ;
924+
925+ if ($ trustDomain === null ) {
926+ goto after_trustDomain;
927+ }
928+
929+ after_trustDomain: $ result ['trust_domain ' ] = $ trustDomain ;
930+
931+ $ services = $ object ->services ;
932+
933+ if ($ services === null ) {
934+ goto after_services;
935+ }
936+
937+ static $ servicesSerializer0 ;
938+
939+ if ($ servicesSerializer0 === null ) {
940+ $ servicesSerializer0 = new SerializeArrayItems (...[]);
941+ }
942+
943+ $ services = $ servicesSerializer0 ->serialize ($ services , $ this );
944+ after_services: $ result ['services ' ] = $ services ;
945+
842946 return $ result ;
843947 }
844948
0 commit comments