Skip to content

Commit

Permalink
Merge pull request #1522 from php-api-clients/GitHub/from-1.1.4-db98a…
Browse files Browse the repository at this point in the history
…dd04ce623b04585203c6ced5d4b-from-1.1.4-db98add04ce623b04585203c6ced5d4b
  • Loading branch information
WyriHaximus authored Feb 13, 2025
2 parents d39e410 + 37f8a9c commit e082f5c
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 59 deletions.
20 changes: 10 additions & 10 deletions clients/GitHub/etc/openapi-client-generator.state
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"specHash": "975ed3e1d762d10ff749fca3c2105b5a",
"specHash": "db98add04ce623b04585203c6ced5d4b",
"generatedFiles": {
"files": [
{
Expand Down Expand Up @@ -5560,7 +5560,7 @@
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Orgs.php",
"hash": "69c5de1d9c2ea9c9f4a47c99a158f37c"
"hash": "2af451090a9b56d1994a6dcd8e65f4e2"
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Actions.php",
Expand Down Expand Up @@ -5596,7 +5596,7 @@
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Repos.php",
"hash": "db17b23c5ac1efafd63ff36b1638e622"
"hash": "946c8e10b9dede0d909c097dff038341"
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Operation\/Billing.php",
Expand Down Expand Up @@ -11574,13 +11574,9 @@
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/RepositoryRuleDetailed.php",
"hash": "2ddf01f931848dc8dae3093027c68aa4"
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CopilotSeatBreakdown.php",
"hash": "329771699046cdadace0eee81bf5c272"
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CopilotOrganizationDetails.php",
"hash": "2050773bcb76af8cf988458a3bfd22a1"
"hash": "2a7341605329a119bd65d5b5e83785a1"
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CopilotSeatDetails.php",
Expand Down Expand Up @@ -25380,7 +25376,7 @@
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Orgs\/Org\/Copilot\/Billing.php",
"hash": "ba0ebdf9ed5de7f8bbfe345861748d2c"
"hash": "3f27e0be70b44a105dbe2f55c5b16945"
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Orgs\/Org\/Copilot\/Billing\/Seats.php",
Expand Down Expand Up @@ -27048,7 +27044,7 @@
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Internal\/Hydrators.php",
"hash": "627acdf6598fb53e73251e26d698c749"
"hash": "f364c8dc89d92f50fd9dbcbd2c7c9bde"
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/OrganizationSimpleWebhooks.php",
Expand Down Expand Up @@ -31945,6 +31941,10 @@
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/WebhookCodeScanningAlertClosedByUser\/Alert\/DismissalApprovedBy.php",
"hash": "2d3e43a91657c1977300fdbc36d37723"
},
{
"name": ".\/clients\/GitHub\/etc\/..\/\/src\/\/Schema\/CopilotOrganizationSeatBreakdown.php",
"hash": "4260c5a9ab97fe4ce33b3eb89a8b73d0"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use ApiClients\Client\GitHub\Schema\BasicError;
use ApiClients\Client\GitHub\Schema\CopilotOrganizationDetails;
use ApiClients\Client\GitHub\Schema\CopilotSeatBreakdown;
use ApiClients\Client\GitHub\Schema\CopilotOrganizationSeatBreakdown;
use EventSauce\ObjectHydrator\IterableList;
use EventSauce\ObjectHydrator\ObjectMapper;
use EventSauce\ObjectHydrator\PropertySerializers\SerializeArrayItems;
Expand Down Expand Up @@ -43,7 +43,7 @@ public function hydrateObject(string $className, array $payload): object
{
return match ($className) {
'ApiClients\Client\GitHub\Schema\CopilotOrganizationDetails' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CopilotOrganizationDetails($payload),
'ApiClients\Client\GitHub\Schema\CopilotSeatBreakdown' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CopilotSeatBreakdown($payload),
'ApiClients\Client\GitHub\Schema\CopilotOrganizationSeatBreakdown' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CopilotOrganizationSeatBreakdown($payload),
'ApiClients\Client\GitHub\Schema\BasicError' => $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($payload),
default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack),
};
Expand All @@ -64,7 +64,7 @@ private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Copi
if (is_array($value)) {
try {
$this->hydrationStack[] = 'seatBreakdown';
$value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CopilotSeatBreakdown($value);
$value = $this->hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CopilotOrganizationSeatBreakdown($value);
} finally {
array_pop($this->hydrationStack);
}
Expand Down Expand Up @@ -154,7 +154,7 @@ private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Copi
}
}

private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CopilotSeatBreakdown(array $payload): CopilotSeatBreakdown
private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CopilotOrganizationSeatBreakdown(array $payload): CopilotOrganizationSeatBreakdown
{
$properties = [];
$missingFields = [];
Expand Down Expand Up @@ -225,17 +225,17 @@ private function hydrateApiClients⚡️Client⚡️GitHub⚡️Schema⚡️Copi

after_inactiveThisCycle:
} catch (Throwable $exception) {
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CopilotSeatBreakdown', $exception, stack: $this->hydrationStack);
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHub\Schema\CopilotOrganizationSeatBreakdown', $exception, stack: $this->hydrationStack);
}

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

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

Expand Down Expand Up @@ -334,7 +334,7 @@ public function serializeObjectOfType(object $object, string $className): mixed
'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object),
'DateTimeInterface' => $this->serializeValueDateTimeInterface($object),
'ApiClients\Client\GitHub\Schema\CopilotOrganizationDetails' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CopilotOrganizationDetails($object),
'ApiClients\Client\GitHub\Schema\CopilotSeatBreakdown' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CopilotSeatBreakdown($object),
'ApiClients\Client\GitHub\Schema\CopilotOrganizationSeatBreakdown' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CopilotOrganizationSeatBreakdown($object),
'ApiClients\Client\GitHub\Schema\BasicError' => $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️BasicError($object),
default => throw new LogicException("No serialization defined for $className"),
};
Expand Down Expand Up @@ -404,7 +404,7 @@ private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema
$result = [];

$seatBreakdown = $object->seatBreakdown;
$seatBreakdown = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CopilotSeatBreakdown($seatBreakdown);
$seatBreakdown = $this->serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema⚡️CopilotOrganizationSeatBreakdown($seatBreakdown);
after_seatBreakdown: $result['seat_breakdown'] = $seatBreakdown;

$publicCodeSuggestions = $object->publicCodeSuggestions;
Expand Down Expand Up @@ -448,9 +448,9 @@ private function serializeObjectApiClients⚡️Client⚡️GitHub⚡️Schema
return $result;
}

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

$total = $object->total;
Expand Down
4 changes: 2 additions & 2 deletions clients/GitHub/src/Internal/Hydrators.php
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ public function hydrateObject(string $className, array $payload): object
'\\ApiClients\\Client\\GitHub\\Schema\\CodespacesPublicKey' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Codespaces🌀Secrets🌀PublicKey()->hydrateObject($className, $payload),
'\\ApiClients\\Client\\GitHub\\Schema\\CodespacesOrgSecret' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Codespaces🌀Secrets🌀SecretName()->hydrateObject($className, $payload),
'\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Codespaces\\ListSelectedReposForOrgSecret\\Response\\ApplicationJson\\Ok\\Application\\Json' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Codespaces🌀Secrets🌀SecretName🌀Repositories()->hydrateObject($className, $payload),
'\\ApiClients\\Client\\GitHub\\Schema\\CopilotOrganizationDetails', '\\ApiClients\\Client\\GitHub\\Schema\\CopilotSeatBreakdown' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Copilot🌀Billing()->hydrateObject($className, $payload),
'\\ApiClients\\Client\\GitHub\\Schema\\CopilotOrganizationDetails', '\\ApiClients\\Client\\GitHub\\Schema\\CopilotOrganizationSeatBreakdown' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Copilot🌀Billing()->hydrateObject($className, $payload),
'\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Copilot\\ListCopilotSeats\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Copilot🌀Billing🌀Seats()->hydrateObject($className, $payload),
'\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Copilot\\AddCopilotSeatsForTeams\\Response\\ApplicationJson\\Created', '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Copilot\\CancelCopilotSeatAssignmentForTeams\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Copilot🌀Billing🌀SelectedTeams()->hydrateObject($className, $payload),
'\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Copilot\\AddCopilotSeatsForUsers\\Response\\ApplicationJson\\Created', '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Copilot\\CancelCopilotSeatAssignmentForUsers\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Copilot🌀Billing🌀SelectedUsers()->hydrateObject($className, $payload),
Expand Down Expand Up @@ -1214,7 +1214,7 @@ public function serializeObjectOfType(object $object, string $className): mixed
'\\ApiClients\\Client\\GitHub\\Schema\\CodespacesPublicKey' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Codespaces🌀Secrets🌀PublicKey()->serializeObject($object),
'\\ApiClients\\Client\\GitHub\\Schema\\CodespacesOrgSecret' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Codespaces🌀Secrets🌀SecretName()->serializeObject($object),
'\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Codespaces\\ListSelectedReposForOrgSecret\\Response\\ApplicationJson\\Ok\\Application\\Json' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Codespaces🌀Secrets🌀SecretName🌀Repositories()->serializeObject($object),
'\\ApiClients\\Client\\GitHub\\Schema\\CopilotOrganizationDetails', '\\ApiClients\\Client\\GitHub\\Schema\\CopilotSeatBreakdown' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Copilot🌀Billing()->serializeObject($object),
'\\ApiClients\\Client\\GitHub\\Schema\\CopilotOrganizationDetails', '\\ApiClients\\Client\\GitHub\\Schema\\CopilotOrganizationSeatBreakdown' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Copilot🌀Billing()->serializeObject($object),
'\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Copilot\\ListCopilotSeats\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Copilot🌀Billing🌀Seats()->serializeObject($object),
'\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Copilot\\AddCopilotSeatsForTeams\\Response\\ApplicationJson\\Created', '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Copilot\\CancelCopilotSeatAssignmentForTeams\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Copilot🌀Billing🌀SelectedTeams()->serializeObject($object),
'\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Copilot\\AddCopilotSeatsForUsers\\Response\\ApplicationJson\\Created', '\\ApiClients\\Client\\GitHub\\Schema\\Operations\\Copilot\\CancelCopilotSeatAssignmentForUsers\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Orgs🌀Org🌀Copilot🌀Billing🌀SelectedUsers()->serializeObject($object),
Expand Down
28 changes: 13 additions & 15 deletions clients/GitHub/src/Schema/CopilotOrganizationDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"type": "object",
"properties": {
"seat_breakdown": {
"title": "Copilot Business Seat Breakdown",
"title": "Copilot Seat Breakdown",
"type": "object",
"properties": {
"total": {
Expand All @@ -36,7 +36,7 @@
},
"pending_invitation": {
"type": "integer",
"description": "The number of seats that have been assigned to users that have not yet accepted an invitation to this organization."
"description": "The number of users who have been invited to receive a Copilot seat through this organization."
},
"active_this_cycle": {
"type": "integer",
Expand All @@ -53,11 +53,10 @@
"enum": [
"allow",
"block",
"unconfigured",
"unknown"
"unconfigured"
],
"type": "string",
"description": "The organization policy for allowing or disallowing Copilot to make suggestions that match public code."
"description": "The organization policy for allowing or blocking suggestions matching public code (duplication detection filter)."
},
"ide_chat": {
"enum": [
Expand All @@ -66,7 +65,7 @@
"unconfigured"
],
"type": "string",
"description": "The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor."
"description": "The organization policy for allowing or disallowing Copilot Chat in the IDE."
},
"platform_chat": {
"enum": [
Expand All @@ -75,7 +74,7 @@
"unconfigured"
],
"type": "string",
"description": "The organization policy for allowing or disallowing organization members to use Copilot features within github.com."
"description": "The organization policy for allowing or disallowing Copilot features on GitHub.com."
},
"cli": {
"enum": [
Expand All @@ -84,7 +83,7 @@
"unconfigured"
],
"type": "string",
"description": "The organization policy for allowing or disallowing organization members to use Copilot within their CLI."
"description": "The organization policy for allowing or disallowing Copilot in the CLI."
},
"seat_management_setting": {
"enum": [
Expand All @@ -99,8 +98,7 @@
"plan_type": {
"enum": [
"business",
"enterprise",
"unknown"
"enterprise"
],
"type": "string",
"description": "The Copilot plan of the organization, or the parent enterprise, when applicable."
Expand Down Expand Up @@ -130,15 +128,15 @@

/**
* seatBreakdown: The breakdown of Copilot Business seats for the organization.
* publicCodeSuggestions: The organization policy for allowing or disallowing Copilot to make suggestions that match public code.
* ideChat: The organization policy for allowing or disallowing organization members to use Copilot Chat within their editor.
* platformChat: The organization policy for allowing or disallowing organization members to use Copilot features within github.com.
* cli: The organization policy for allowing or disallowing organization members to use Copilot within their CLI.
* publicCodeSuggestions: The organization policy for allowing or blocking suggestions matching public code (duplication detection filter).
* ideChat: The organization policy for allowing or disallowing Copilot Chat in the IDE.
* platformChat: The organization policy for allowing or disallowing Copilot features on GitHub.com.
* cli: The organization policy for allowing or disallowing Copilot in the CLI.
* seatManagementSetting: The mode of assigning new seats.
* planType: The Copilot plan of the organization, or the parent enterprise, when applicable.
*/
public function __construct(#[MapFrom('seat_breakdown')]
public Schema\CopilotSeatBreakdown $seatBreakdown, #[MapFrom('public_code_suggestions')]
public Schema\CopilotOrganizationSeatBreakdown $seatBreakdown, #[MapFrom('public_code_suggestions')]
public string $publicCodeSuggestions, #[MapFrom('ide_chat')]
public string|null $ideChat, #[MapFrom('platform_chat')]
public string|null $platformChat, public string|null $cli, #[MapFrom('seat_management_setting')]
Expand Down
Loading

0 comments on commit e082f5c

Please sign in to comment.