|
11 | 11 | use ApiClients\Client\GitHub\Schema\WebhookCustomPropertyCreated;
|
12 | 12 | use ApiClients\Client\GitHub\Schema\WebhookCustomPropertyDeleted;
|
13 | 13 | use ApiClients\Client\GitHub\Schema\WebhookCustomPropertyDeleted\Definition;
|
| 14 | +use ApiClients\Client\GitHub\Schema\WebhookCustomPropertyPromotedToEnterprise; |
14 | 15 | use ApiClients\Client\GitHub\Schema\WebhookCustomPropertyUpdated;
|
15 | 16 | use EventSauce\ObjectHydrator\IterableList;
|
16 | 17 | use EventSauce\ObjectHydrator\ObjectMapper;
|
@@ -55,6 +56,7 @@ public function hydrateObject(string $className, array $payload): object
|
55 | 56 | 'ApiClients\Client\GitHub\Schema\SimpleUser' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SimpleUser($payload),
|
56 | 57 | 'ApiClients\Client\GitHub\Schema\WebhookCustomPropertyDeleted' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookCustomPropertyDeleted($payload),
|
57 | 58 | 'ApiClients\Client\GitHub\Schema\WebhookCustomPropertyDeleted\Definition' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookCustomPropertyDeleted⚡️Definition($payload),
|
| 59 | + 'ApiClients\Client\GitHub\Schema\WebhookCustomPropertyPromotedToEnterprise' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookCustomPropertyPromotedToEnterprise($payload), |
58 | 60 | 'ApiClients\Client\GitHub\Schema\WebhookCustomPropertyUpdated' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookCustomPropertyUpdated($payload),
|
59 | 61 | default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack),
|
60 | 62 | };
|
@@ -1050,6 +1052,136 @@ private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Webh
|
1050 | 1052 | }
|
1051 | 1053 | }
|
1052 | 1054 |
|
| 1055 | + private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookCustomPropertyPromotedToEnterprise(array $payload): WebhookCustomPropertyPromotedToEnterprise |
| 1056 | + { |
| 1057 | + $properties = []; |
| 1058 | + $missingFields = []; |
| 1059 | + try { |
| 1060 | + $value = $payload['action'] ?? null; |
| 1061 | + |
| 1062 | + if ($value === null) { |
| 1063 | + $missingFields[] = 'action'; |
| 1064 | + goto after_action; |
| 1065 | + } |
| 1066 | + |
| 1067 | + $properties['action'] = $value; |
| 1068 | + |
| 1069 | + after_action: |
| 1070 | + |
| 1071 | + $value = $payload['definition'] ?? null; |
| 1072 | + |
| 1073 | + if ($value === null) { |
| 1074 | + $missingFields[] = 'definition'; |
| 1075 | + goto after_definition; |
| 1076 | + } |
| 1077 | + |
| 1078 | + if (is_array($value)) { |
| 1079 | + try { |
| 1080 | + $this->hydrationStack[] = 'definition'; |
| 1081 | + $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CustomProperty($value); |
| 1082 | + } finally { |
| 1083 | + array_pop($this->hydrationStack); |
| 1084 | + } |
| 1085 | + } |
| 1086 | + |
| 1087 | + $properties['definition'] = $value; |
| 1088 | + |
| 1089 | + after_definition: |
| 1090 | + |
| 1091 | + $value = $payload['enterprise'] ?? null; |
| 1092 | + |
| 1093 | + if ($value === null) { |
| 1094 | + $properties['enterprise'] = null; |
| 1095 | + goto after_enterprise; |
| 1096 | + } |
| 1097 | + |
| 1098 | + if (is_array($value)) { |
| 1099 | + try { |
| 1100 | + $this->hydrationStack[] = 'enterprise'; |
| 1101 | + $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️EnterpriseWebhooks($value); |
| 1102 | + } finally { |
| 1103 | + array_pop($this->hydrationStack); |
| 1104 | + } |
| 1105 | + } |
| 1106 | + |
| 1107 | + $properties['enterprise'] = $value; |
| 1108 | + |
| 1109 | + after_enterprise: |
| 1110 | + |
| 1111 | + $value = $payload['installation'] ?? null; |
| 1112 | + |
| 1113 | + if ($value === null) { |
| 1114 | + $properties['installation'] = null; |
| 1115 | + goto after_installation; |
| 1116 | + } |
| 1117 | + |
| 1118 | + if (is_array($value)) { |
| 1119 | + try { |
| 1120 | + $this->hydrationStack[] = 'installation'; |
| 1121 | + $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SimpleInstallation($value); |
| 1122 | + } finally { |
| 1123 | + array_pop($this->hydrationStack); |
| 1124 | + } |
| 1125 | + } |
| 1126 | + |
| 1127 | + $properties['installation'] = $value; |
| 1128 | + |
| 1129 | + after_installation: |
| 1130 | + |
| 1131 | + $value = $payload['organization'] ?? null; |
| 1132 | + |
| 1133 | + if ($value === null) { |
| 1134 | + $properties['organization'] = null; |
| 1135 | + goto after_organization; |
| 1136 | + } |
| 1137 | + |
| 1138 | + if (is_array($value)) { |
| 1139 | + try { |
| 1140 | + $this->hydrationStack[] = 'organization'; |
| 1141 | + $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️OrganizationSimpleWebhooks($value); |
| 1142 | + } finally { |
| 1143 | + array_pop($this->hydrationStack); |
| 1144 | + } |
| 1145 | + } |
| 1146 | + |
| 1147 | + $properties['organization'] = $value; |
| 1148 | + |
| 1149 | + after_organization: |
| 1150 | + |
| 1151 | + $value = $payload['sender'] ?? null; |
| 1152 | + |
| 1153 | + if ($value === null) { |
| 1154 | + $properties['sender'] = null; |
| 1155 | + goto after_sender; |
| 1156 | + } |
| 1157 | + |
| 1158 | + if (is_array($value)) { |
| 1159 | + try { |
| 1160 | + $this->hydrationStack[] = 'sender'; |
| 1161 | + $value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SimpleUser($value); |
| 1162 | + } finally { |
| 1163 | + array_pop($this->hydrationStack); |
| 1164 | + } |
| 1165 | + } |
| 1166 | + |
| 1167 | + $properties['sender'] = $value; |
| 1168 | + |
| 1169 | + after_sender: |
| 1170 | + } catch (Throwable $exception) { |
| 1171 | + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\WebhookCustomPropertyPromotedToEnterprise', $exception, stack: $this->hydrationStack); |
| 1172 | + } |
| 1173 | + |
| 1174 | + if (count($missingFields) > 0) { |
| 1175 | + throw UnableToHydrateObject::dueToMissingFields(WebhookCustomPropertyPromotedToEnterprise::class, $missingFields, stack: $this->hydrationStack); |
| 1176 | + } |
| 1177 | + |
| 1178 | + try { |
| 1179 | + return new WebhookCustomPropertyPromotedToEnterprise(...$properties); |
| 1180 | + } catch (Throwable $exception) { |
| 1181 | + throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\WebhookCustomPropertyPromotedToEnterprise', $exception, stack: $this->hydrationStack); |
| 1182 | + } |
| 1183 | + } |
| 1184 | + |
1053 | 1185 | private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookCustomPropertyUpdated(array $payload): WebhookCustomPropertyUpdated
|
1054 | 1186 | {
|
1055 | 1187 | $properties = [];
|
@@ -1219,6 +1351,7 @@ public function serializeObjectOfType(object $object, string $className): mixed
|
1219 | 1351 | 'ApiClients\Client\GitHub\Schema\SimpleUser' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SimpleUser($object),
|
1220 | 1352 | 'ApiClients\Client\GitHub\Schema\WebhookCustomPropertyDeleted' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookCustomPropertyDeleted($object),
|
1221 | 1353 | 'ApiClients\Client\GitHub\Schema\WebhookCustomPropertyDeleted\Definition' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookCustomPropertyDeleted⚡️Definition($object),
|
| 1354 | + 'ApiClients\Client\GitHub\Schema\WebhookCustomPropertyPromotedToEnterprise' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookCustomPropertyPromotedToEnterprise($object), |
1222 | 1355 | 'ApiClients\Client\GitHub\Schema\WebhookCustomPropertyUpdated' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookCustomPropertyUpdated($object),
|
1223 | 1356 | default => throw new LogicException("No serialization defined for $className"),
|
1224 | 1357 | };
|
@@ -1699,6 +1832,57 @@ private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema
|
1699 | 1832 | return $result;
|
1700 | 1833 | }
|
1701 | 1834 |
|
| 1835 | + private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookCustomPropertyPromotedToEnterprise(mixed $object): mixed |
| 1836 | + { |
| 1837 | + assert($object instanceof WebhookCustomPropertyPromotedToEnterprise); |
| 1838 | + $result = []; |
| 1839 | + |
| 1840 | + $action = $object->action; |
| 1841 | + after_action: $result['action'] = $action; |
| 1842 | + |
| 1843 | + $definition = $object->definition; |
| 1844 | + $definition = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CustomProperty($definition); |
| 1845 | + after_definition: $result['definition'] = $definition; |
| 1846 | + |
| 1847 | + $enterprise = $object->enterprise; |
| 1848 | + |
| 1849 | + if ($enterprise === null) { |
| 1850 | + goto after_enterprise; |
| 1851 | + } |
| 1852 | + |
| 1853 | + $enterprise = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️EnterpriseWebhooks($enterprise); |
| 1854 | + after_enterprise: $result['enterprise'] = $enterprise; |
| 1855 | + |
| 1856 | + $installation = $object->installation; |
| 1857 | + |
| 1858 | + if ($installation === null) { |
| 1859 | + goto after_installation; |
| 1860 | + } |
| 1861 | + |
| 1862 | + $installation = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SimpleInstallation($installation); |
| 1863 | + after_installation: $result['installation'] = $installation; |
| 1864 | + |
| 1865 | + $organization = $object->organization; |
| 1866 | + |
| 1867 | + if ($organization === null) { |
| 1868 | + goto after_organization; |
| 1869 | + } |
| 1870 | + |
| 1871 | + $organization = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️OrganizationSimpleWebhooks($organization); |
| 1872 | + after_organization: $result['organization'] = $organization; |
| 1873 | + |
| 1874 | + $sender = $object->sender; |
| 1875 | + |
| 1876 | + if ($sender === null) { |
| 1877 | + goto after_sender; |
| 1878 | + } |
| 1879 | + |
| 1880 | + $sender = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️SimpleUser($sender); |
| 1881 | + after_sender: $result['sender'] = $sender; |
| 1882 | + |
| 1883 | + return $result; |
| 1884 | + } |
| 1885 | + |
1702 | 1886 | private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️WebhookCustomPropertyUpdated(mixed $object): mixed
|
1703 | 1887 | {
|
1704 | 1888 | assert($object instanceof WebhookCustomPropertyUpdated);
|
|
0 commit comments