6
6
7
7
use ApiClients \Client \GitHub \Schema \ApiOverview ;
8
8
use ApiClients \Client \GitHub \Schema \ApiOverview \Domains ;
9
+ use ApiClients \Client \GitHub \Schema \ApiOverview \Domains \ArtifactAttestations ;
9
10
use ApiClients \Client \GitHub \Schema \ApiOverview \SshKeyFingerprints ;
10
11
use EventSauce \ObjectHydrator \IterableList ;
11
12
use EventSauce \ObjectHydrator \ObjectMapper ;
@@ -45,6 +46,7 @@ public function hydrateObject(string $className, array $payload): object
45
46
'ApiClients\Client\GitHub\Schema\ApiOverview ' => $ this ->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview ($ payload ),
46
47
'ApiClients\Client\GitHub\Schema\ApiOverview\SshKeyFingerprints ' => $ this ->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️SshKeyFingerprints ($ payload ),
47
48
'ApiClients\Client\GitHub\Schema\ApiOverview\Domains ' => $ this ->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️Domains ($ payload ),
49
+ 'ApiClients\Client\GitHub\Schema\ApiOverview\Domains\ArtifactAttestations ' => $ this ->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️Domains⚡️ArtifactAttestations ($ payload ),
48
50
default => throw UnableToHydrateObject::noHydrationDefined ($ className , $ this ->hydrationStack ),
49
51
};
50
52
}
@@ -384,6 +386,26 @@ private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiO
384
386
$ properties ['actions ' ] = $ value ;
385
387
386
388
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⚡️GitHub⚡️Schema⚡️ApiOverview⚡️Domains⚡️ArtifactAttestations ($ value );
401
+ } finally {
402
+ array_pop ($ this ->hydrationStack );
403
+ }
404
+ }
405
+
406
+ $ properties ['artifactAttestations ' ] = $ value ;
407
+
408
+ after_artifactAttestations:
387
409
} catch (Throwable $ exception ) {
388
410
throw UnableToHydrateObject::dueToError ('ApiClients\Client\GitHub\Schema\ApiOverview\Domains ' , $ exception , stack: $ this ->hydrationStack );
389
411
}
@@ -399,6 +421,47 @@ private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiO
399
421
}
400
422
}
401
423
424
+ private function hydrateApiClients⚡️Client⚡️GitHub⚡️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\GitHub\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\GitHub\Schema\ApiOverview\Domains\ArtifactAttestations ' , $ exception , stack: $ this ->hydrationStack );
462
+ }
463
+ }
464
+
402
465
private function serializeViaTypeMap (string $ accessor , object $ object , array $ payloadToTypeMap ): array
403
466
{
404
467
foreach ($ payloadToTypeMap as $ payloadType => [$ valueType , $ method ]) {
@@ -433,6 +496,7 @@ public function serializeObjectOfType(object $object, string $className): mixed
433
496
'ApiClients\Client\GitHub\Schema\ApiOverview ' => $ this ->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview ($ object ),
434
497
'ApiClients\Client\GitHub\Schema\ApiOverview\SshKeyFingerprints ' => $ this ->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️SshKeyFingerprints ($ object ),
435
498
'ApiClients\Client\GitHub\Schema\ApiOverview\Domains ' => $ this ->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️Domains ($ object ),
499
+ 'ApiClients\Client\GitHub\Schema\ApiOverview\Domains\ArtifactAttestations ' => $ this ->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️Domains⚡️ArtifactAttestations ($ object ),
436
500
default => throw new LogicException ("No serialization defined for $ className " ),
437
501
};
438
502
} catch (Throwable $ exception ) {
@@ -839,6 +903,46 @@ private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema
839
903
$ actions = $ actionsSerializer0 ->serialize ($ actions , $ this );
840
904
after_actions: $ result ['actions ' ] = $ actions ;
841
905
906
+ $ artifactAttestations = $ object ->artifactAttestations ;
907
+
908
+ if ($ artifactAttestations === null ) {
909
+ goto after_artifactAttestations;
910
+ }
911
+
912
+ $ artifactAttestations = $ this ->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️ApiOverview⚡️Domains⚡️ArtifactAttestations ($ artifactAttestations );
913
+ after_artifactAttestations: $ result ['artifact_attestations ' ] = $ artifactAttestations ;
914
+
915
+ return $ result ;
916
+ }
917
+
918
+ private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️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
+
842
946
return $ result ;
843
947
}
844
948
0 commit comments