Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 81 additions & 77 deletions clients/GitHubEnterpriseCloud/etc/openapi-client-generator.state

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function cast(mixed $value, ObjectMapper $hydrator): mixed

if ($signature === 'data|type' && $value['type'] === 'secret_scanning_closure') {
try {
return $hydrator->hydrateObject(Schema\ExemptionRequestSecretScanningClosure::class, $value);
return $hydrator->hydrateObject(Schema\DismissalRequestSecretScanning::class, $value);
} catch (Throwable) {
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function cast(mixed $value, ObjectMapper $hydrator): mixed

if ($signature === 'alert_title|reason' && ($value['reason'] === 'fixed_later' || $value['reason'] === 'false_positive' || $value['reason'] === 'tests' || $value['reason'] === 'revoked')) {
try {
return $hydrator->hydrateObject(Schema\ExemptionRequestSecretScanningClosureMetadata::class, $value);
return $hydrator->hydrateObject(Schema\DismissalRequestSecretScanningMetadata::class, $value);
} catch (Throwable) {
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,6 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
$properties['source'] = $value;

after_source:

$value = $payload['version'] ?? null;

if ($value === null) {
$missingFields[] = 'version';
goto after_version;
}

$properties['version'] = $value;

after_version:
} catch (Throwable $exception) {
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubEnterpriseCloud\Schema\ActionsHostedRunnerPoolImage', $exception, stack: $this->hydrationStack);
}
Expand Down Expand Up @@ -597,9 +586,6 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseClou
$source = $object->source;
after_source: $result['source'] = $source;

$version = $object->version;
after_version: $result['version'] = $version;

return $result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,6 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
$properties['source'] = $value;

after_source:

$value = $payload['version'] ?? null;

if ($value === null) {
$missingFields[] = 'version';
goto after_version;
}

$properties['version'] = $value;

after_version:
} catch (Throwable $exception) {
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubEnterpriseCloud\Schema\ActionsHostedRunnerPoolImage', $exception, stack: $this->hydrationStack);
}
Expand Down Expand Up @@ -532,9 +521,6 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseClou
$source = $object->source;
after_source: $result['source'] = $source;

$version = $object->version;
after_version: $result['version'] = $version;

return $result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,6 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
$properties['source'] = $value;

after_source:

$value = $payload['version'] ?? null;

if ($value === null) {
$missingFields[] = 'version';
goto after_version;
}

$properties['version'] = $value;

after_version:
} catch (Throwable $exception) {
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubEnterpriseCloud\Schema\ActionsHostedRunnerPoolImage', $exception, stack: $this->hydrationStack);
}
Expand Down Expand Up @@ -597,9 +586,6 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseClou
$source = $object->source;
after_source: $result['source'] = $source;

$version = $object->version;
after_version: $result['version'] = $version;

return $result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,6 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
$properties['source'] = $value;

after_source:

$value = $payload['version'] ?? null;

if ($value === null) {
$missingFields[] = 'version';
goto after_version;
}

$properties['version'] = $value;

after_version:
} catch (Throwable $exception) {
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubEnterpriseCloud\Schema\ActionsHostedRunnerPoolImage', $exception, stack: $this->hydrationStack);
}
Expand Down Expand Up @@ -532,9 +521,6 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseClou
$source = $object->source;
after_source: $result['source'] = $source;

$version = $object->version;
after_version: $result['version'] = $version;

return $result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use ApiClients\Client\GitHubEnterpriseCloud\Schema\CodeScanningAlertRule;
use ApiClients\Client\GitHubEnterpriseCloud\Schema\CodeScanningAnalysisTool;
use ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable;
use ApiClients\Client\GitHubEnterpriseCloud\Schema\ScimError;
use ApiClients\Client\GitHubEnterpriseCloud\Schema\SimpleUser;
use EventSauce\ObjectHydrator\IterableList;
use EventSauce\ObjectHydrator\ObjectMapper;
Expand Down Expand Up @@ -57,6 +58,7 @@ public function hydrateObject(string $className, array $payload): object
'ApiClients\Client\GitHubEnterpriseCloud\Schema\CodeScanningAlertLocation' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️CodeScanningAlertLocation($payload),
'ApiClients\Client\GitHubEnterpriseCloud\Schema\BasicError' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️BasicError($payload),
'ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️Operations⚡️CodeScanning⚡️ListAlertsForEnterprise⚡️Response⚡️ApplicationJson⚡️ServiceUnavailable($payload),
'ApiClients\Client\GitHubEnterpriseCloud\Schema\ScimError' => $this->hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️ScimError($payload),
default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack),
};
}
Expand Down Expand Up @@ -1098,6 +1100,91 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️S
}
}

private function hydrateApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️ScimError(array $payload): ScimError
{
$properties = [];
$missingFields = [];
try {
$value = $payload['message'] ?? null;

if ($value === null) {
$properties['message'] = null;
goto after_message;
}

$properties['message'] = $value;

after_message:

$value = $payload['documentation_url'] ?? null;

if ($value === null) {
$properties['documentationUrl'] = null;
goto after_documentationUrl;
}

$properties['documentationUrl'] = $value;

after_documentationUrl:

$value = $payload['detail'] ?? null;

if ($value === null) {
$properties['detail'] = null;
goto after_detail;
}

$properties['detail'] = $value;

after_detail:

$value = $payload['status'] ?? null;

if ($value === null) {
$properties['status'] = null;
goto after_status;
}

$properties['status'] = $value;

after_status:

$value = $payload['scim_type'] ?? null;

if ($value === null) {
$properties['scimType'] = null;
goto after_scimType;
}

$properties['scimType'] = $value;

after_scimType:

$value = $payload['schemas'] ?? null;

if ($value === null) {
$properties['schemas'] = null;
goto after_schemas;
}

$properties['schemas'] = $value;

after_schemas:
} catch (Throwable $exception) {
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubEnterpriseCloud\Schema\ScimError', $exception, stack: $this->hydrationStack);
}

if (count($missingFields) > 0) {
throw UnableToHydrateObject::dueToMissingFields(ScimError::class, $missingFields, stack: $this->hydrationStack);
}

try {
return new ScimError(...$properties);
} catch (Throwable $exception) {
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubEnterpriseCloud\Schema\ScimError', $exception, stack: $this->hydrationStack);
}
}

private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array
{
foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) {
Expand Down Expand Up @@ -1138,6 +1225,7 @@ public function serializeObjectOfType(object $object, string $className): mixed
'ApiClients\Client\GitHubEnterpriseCloud\Schema\CodeScanningAlertLocation' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️CodeScanningAlertLocation($object),
'ApiClients\Client\GitHubEnterpriseCloud\Schema\BasicError' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️BasicError($object),
'ApiClients\Client\GitHubEnterpriseCloud\Schema\Operations\CodeScanning\ListAlertsForEnterprise\Response\ApplicationJson\ServiceUnavailable' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️Operations⚡️CodeScanning⚡️ListAlertsForEnterprise⚡️Response⚡️ApplicationJson⚡️ServiceUnavailable($object),
'ApiClients\Client\GitHubEnterpriseCloud\Schema\ScimError' => $this->serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️ScimError($object),
default => throw new LogicException("No serialization defined for $className"),
};
} catch (Throwable $exception) {
Expand Down Expand Up @@ -1752,6 +1840,69 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseClou
return $result;
}

private function serializeObjectApiClients⚡️Client⚡️GitHubEnterpriseCloud⚡️Schema⚡️ScimError(mixed $object): mixed
{
assert($object instanceof ScimError);
$result = [];

$message = $object->message;

if ($message === null) {
goto after_message;
}

after_message: $result['message'] = $message;

$documentationUrl = $object->documentationUrl;

if ($documentationUrl === null) {
goto after_documentationUrl;
}

after_documentationUrl: $result['documentation_url'] = $documentationUrl;

$detail = $object->detail;

if ($detail === null) {
goto after_detail;
}

after_detail: $result['detail'] = $detail;

$status = $object->status;

if ($status === null) {
goto after_status;
}

after_status: $result['status'] = $status;

$scimType = $object->scimType;

if ($scimType === null) {
goto after_scimType;
}

after_scimType: $result['scim_type'] = $scimType;

$schemas = $object->schemas;

if ($schemas === null) {
goto after_schemas;
}

static $schemasSerializer0;

if ($schemasSerializer0 === null) {
$schemasSerializer0 = new SerializeArrayItems(...[]);
}

$schemas = $schemasSerializer0->serialize($schemas, $this);
after_schemas: $result['schemas'] = $schemas;

return $result;
}

/**
* @param class-string<T> $className
* @param iterable<array> $payloads;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
use function is_array;
use function is_object;

class ExemptionRequestSecretScanningClosure implements ObjectMapper
class DismissalRequestSecretScanning implements ObjectMapper
{
private array $hydrationStack = [];

Expand Down
20 changes: 10 additions & 10 deletions clients/GitHubEnterpriseCloud/src/Internal/Hydrators.php
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,6 @@ final class Hydrators implements ObjectMapper
private Internal\Hydrator\WebHook\ExemptionRequestSecretScanning|null $webHook🪝ExemptionRequestSecretScanning = null;
private Internal\Hydrator\WebHook\CheckRun|null $webHook🪝CheckRun = null;
private Internal\Hydrator\WebHook\CheckSuite|null $webHook🪝CheckSuite = null;
private Internal\Hydrator\WebHook\ExemptionRequestSecretScanningClosure|null $webHook🪝ExemptionRequestSecretScanningClosure = null;
private Internal\Hydrator\WebHook\CodeScanningAlert|null $webHook🪝CodeScanningAlert = null;
private Internal\Hydrator\WebHook\CommitComment|null $webHook🪝CommitComment = null;
private Internal\Hydrator\WebHook\Create|null $webHook🪝Create = null;
Expand All @@ -804,6 +803,7 @@ final class Hydrators implements ObjectMapper
private Internal\Hydrator\WebHook\DeploymentStatus|null $webHook🪝DeploymentStatus = null;
private Internal\Hydrator\WebHook\Discussion|null $webHook🪝Discussion = null;
private Internal\Hydrator\WebHook\DiscussionComment|null $webHook🪝DiscussionComment = null;
private Internal\Hydrator\WebHook\DismissalRequestSecretScanning|null $webHook🪝DismissalRequestSecretScanning = null;
private Internal\Hydrator\WebHook\Fork|null $webHook🪝Fork = null;
private Internal\Hydrator\WebHook\GithubAppAuthorization|null $webHook🪝GithubAppAuthorization = null;
private Internal\Hydrator\WebHook\Gollum|null $webHook🪝Gollum = null;
Expand Down Expand Up @@ -8680,15 +8680,6 @@ public function getObjectMapperWebHook🪝CheckSuite(): Internal\Hydrator\WebHoo
return $this->webHook🪝CheckSuite;
}

public function getObjectMapperWebHook🪝ExemptionRequestSecretScanningClosure(): Internal\Hydrator\WebHook\ExemptionRequestSecretScanningClosure
{
if ($this->webHook🪝ExemptionRequestSecretScanningClosure instanceof Internal\Hydrator\WebHook\ExemptionRequestSecretScanningClosure === false) {
$this->webHook🪝ExemptionRequestSecretScanningClosure = new Internal\Hydrator\WebHook\ExemptionRequestSecretScanningClosure();
}

return $this->webHook🪝ExemptionRequestSecretScanningClosure;
}

public function getObjectMapperWebHook🪝CodeScanningAlert(): Internal\Hydrator\WebHook\CodeScanningAlert
{
if ($this->webHook🪝CodeScanningAlert instanceof Internal\Hydrator\WebHook\CodeScanningAlert === false) {
Expand Down Expand Up @@ -8815,6 +8806,15 @@ public function getObjectMapperWebHook🪝DiscussionComment(): Internal\Hydrator
return $this->webHook🪝DiscussionComment;
}

public function getObjectMapperWebHook🪝DismissalRequestSecretScanning(): Internal\Hydrator\WebHook\DismissalRequestSecretScanning
{
if ($this->webHook🪝DismissalRequestSecretScanning instanceof Internal\Hydrator\WebHook\DismissalRequestSecretScanning === false) {
$this->webHook🪝DismissalRequestSecretScanning = new Internal\Hydrator\WebHook\DismissalRequestSecretScanning();
}

return $this->webHook🪝DismissalRequestSecretScanning;
}

public function getObjectMapperWebHook🪝Fork(): Internal\Hydrator\WebHook\Fork
{
if ($this->webHook🪝Fork instanceof Internal\Hydrator\WebHook\Fork === false) {
Expand Down
Loading
Loading