Skip to content

Commit

Permalink
Merge pull request #1515 from php-api-clients/GitHubEnterprise-3.14/f…
Browse files Browse the repository at this point in the history
…rom-1.1.4-f5ae341048327f8fa2b6a1ba017066cc-from-1.1.4-f5ae341048327f8fa2b6a1ba017066cc
  • Loading branch information
WyriHaximus authored Feb 12, 2025
2 parents cbc67fb + a450545 commit 881401d
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"specHash": "dc977c8003154234e7a787ec7b8ad5db",
"specHash": "f5ae341048327f8fa2b6a1ba017066cc",
"generatedFiles": {
"files": [
{
Expand Down Expand Up @@ -13516,7 +13516,7 @@
},
{
"name": ".\/clients\/GitHubEnterprise-3.14\/etc\/..\/\/src\/\/Schema\/Announcement.php",
"hash": "43d88c2fe6d9b323473405dbb6d7cbe7"
"hash": "fc94b9b02ef56f864c859e9d58d3ce45"
},
{
"name": ".\/clients\/GitHubEnterprise-3.14\/etc\/..\/\/src\/\/Schema\/LicenseInfo.php",
Expand Down Expand Up @@ -27464,7 +27464,7 @@
},
{
"name": ".\/clients\/GitHubEnterprise-3.14\/etc\/..\/\/src\/\/Operation\/EnterpriseAdmin.php",
"hash": "8e5ed19636edd3f61c268f23d3dba92d"
"hash": "3969d0c96e854589ccfd64812d38dcba"
},
{
"name": ".\/clients\/GitHubEnterprise-3.14\/etc\/..\/\/src\/\/Operation\/SecurityAdvisories.php",
Expand Down Expand Up @@ -28048,7 +28048,7 @@
},
{
"name": ".\/clients\/GitHubEnterprise-3.14\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Enterprise\/Announcement.php",
"hash": "2031eff3f5c8d7209048e852b5c84031"
"hash": "5e98612b79dbbc66f8c8e936476d0875"
},
{
"name": ".\/clients\/GitHubEnterprise-3.14\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Enterprise\/Settings\/License.php",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ private function hydrateApiClients⚡️Client⚡️GitHubEnterprise⚡️Schema
$properties['expiresAt'] = $value;

after_expiresAt:

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

if ($value === null) {
$properties['userDismissible'] = null;
goto after_userDismissible;
}

$properties['userDismissible'] = $value;

after_userDismissible:
} catch (Throwable $exception) {
throw UnableToHydrateObject::dueToError('ApiClients\Client\GitHubEnterprise\Schema\Announcement', $exception, stack: $this->hydrationStack);
}
Expand Down Expand Up @@ -198,6 +209,14 @@ private function serializeObjectApiClients⚡️Client⚡️GitHubEnterprise⚡

after_expiresAt: $result['expires_at'] = $expiresAt;

$userDismissible = $object->userDismissible;

if ($userDismissible === null) {
goto after_userDismissible;
}

after_userDismissible: $result['user_dismissible'] = $userDismissible;

return $result;
}

Expand Down
18 changes: 16 additions & 2 deletions clients/GitHubEnterprise-3.14/src/Schema/Announcement.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@
"examples": [
"\\"2021-01-01T00:00:00.000-07:00\\""
]
},
"user_dismissible": {
"type": [
"boolean",
"null"
],
"description": "Whether an announcement can be dismissed by the user.",
"default": false,
"examples": [
false
]
}
},
"description": "Enterprise global announcement"
Expand All @@ -43,15 +54,18 @@
public const SCHEMA_DESCRIPTION = 'Enterprise global announcement';
public const SCHEMA_EXAMPLE_DATA = '{
"announcement": "Very **important** announcement about _something_.",
"expires_at": "\\"2021-01-01T00:00:00.000-07:00\\""
"expires_at": "\\"2021-01-01T00:00:00.000-07:00\\"",
"user_dismissible": false
}';

/**
* announcement: The announcement text in GitHub Flavored Markdown. For more information about GitHub Flavored Markdown, see "[Basic writing and formatting syntax](https://docs.github.com/enterprise-server@3.14/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax)."
* expiresAt: The time at which the announcement expires. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. To set an announcement that never expires, omit this parameter, set it to `null`, or set it to an empty string.
* userDismissible: Whether an announcement can be dismissed by the user.
*/
public function __construct(public string|null $announcement, #[MapFrom('expires_at')]
public string|null $expiresAt,)
public string|null $expiresAt, #[MapFrom('user_dismissible')]
public bool|null $userDismissible,)
{
}
}
20 changes: 11 additions & 9 deletions etc/specs/GitHubEnterprise-3.14/current.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33688,7 +33688,7 @@ paths:
"$ref": "#/components/responses/validation_failed"
x-github:
githubCloudOnly: false
enabledForGitHubApps: false
enabledForGitHubApps: true
category: reactions
subcategory: reactions
"/repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}":
Expand Down Expand Up @@ -69130,6 +69130,14 @@ components:
`null`, or set it to an empty string.'
examples:
- '"2021-01-01T00:00:00.000-07:00"'
announcement-user-dismissible:
type:
- boolean
- 'null'
description: Whether an announcement can be dismissed by the user.
default: false
examples:
- false
announcement:
title: Enterprise Announcement
description: Enterprise global announcement
Expand All @@ -69139,6 +69147,8 @@ components:
"$ref": "#/components/schemas/announcement-message"
expires_at:
"$ref": "#/components/schemas/announcement-expiration"
user_dismissible:
"$ref": "#/components/schemas/announcement-user-dismissible"
required:
- announcement
license-info:
Expand Down Expand Up @@ -74239,14 +74249,6 @@ components:
- created_at
- updated_at
- visibility
announcement-user-dismissible:
type:
- boolean
- 'null'
description: Whether an announcement can be dismissed by the user.
default: false
examples:
- false
announcement-banner:
title: Announcement Banner
description: Announcement at either the repository, organization, or enterprise
Expand Down

0 comments on commit 881401d

Please sign in to comment.