Skip to content

Commit e561ae7

Browse files
authored
Merge pull request #760 from php-api-clients/GitHubAE/from-1.1.4-4c4e1701d928399d4897fc32d297d17b-from-1.1.4-4c4e1701d928399d4897fc32d297d17b
2 parents e74274b + 11931bf commit e561ae7

File tree

5 files changed

+82
-23
lines changed

5 files changed

+82
-23
lines changed

clients/GitHubAE/etc/openapi-client-generator.state

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"specHash": "a2da0f53e6e409f85678904ce5808926",
2+
"specHash": "4c4e1701d928399d4897fc32d297d17b",
33
"generatedFiles": {
44
"files": [
55
{
@@ -4848,7 +4848,7 @@
48484848
},
48494849
{
48504850
"name": ".\/clients\/GitHubAE\/etc\/..\/\/src\/\/Operation\/EnterpriseAdmin.php",
4851-
"hash": "969ab4e55d891ff1ee9a9a69939a14b8"
4851+
"hash": "3763297449aa164a5bc3781df0bc393c"
48524852
},
48534853
{
48544854
"name": ".\/clients\/GitHubAE\/etc\/..\/\/src\/\/Operation\/Apps.php",
@@ -4892,11 +4892,11 @@
48924892
},
48934893
{
48944894
"name": ".\/clients\/GitHubAE\/etc\/..\/\/src\/\/Operation\/Orgs.php",
4895-
"hash": "9c8bfc530e90d40ea31d8d330a8b0cc6"
4895+
"hash": "060f8e5408cf25e4f8ed5553efe32ae7"
48964896
},
48974897
{
48984898
"name": ".\/clients\/GitHubAE\/etc\/..\/\/src\/\/Operation\/Actions.php",
4899-
"hash": "80d30cf4f4e29714fc71a81c030c14be"
4899+
"hash": "30727655dc7e384b9c978060c8dec978"
49004900
},
49014901
{
49024902
"name": ".\/clients\/GitHubAE\/etc\/..\/\/src\/\/Operation\/CodeScanning.php",
@@ -4916,7 +4916,7 @@
49164916
},
49174917
{
49184918
"name": ".\/clients\/GitHubAE\/etc\/..\/\/src\/\/Operation\/Repos.php",
4919-
"hash": "2d4beedd21db7d61f1c5f34103c98bee"
4919+
"hash": "0fe31eb63fd9a5c5e3398cd2f14483e2"
49204920
},
49214921
{
49224922
"name": ".\/clients\/GitHubAE\/etc\/..\/\/src\/\/Operation\/Reactions.php",
@@ -17264,15 +17264,15 @@
1726417264
},
1726517265
{
1726617266
"name": ".\/clients\/GitHubAE\/etc\/..\/\/src\/\/Internal\/Operation\/Repos\/CreateDeploymentBranchPolicy.php",
17267-
"hash": "adce63e41c5e7b33375bf14fa18aed9b"
17267+
"hash": "5cb40f8defd983846180d294db459b81"
1726817268
},
1726917269
{
1727017270
"name": ".\/clients\/GitHubAE\/etc\/..\/\/src\/\/Internal\/Operator\/Repos\/CreateDeploymentBranchPolicy.php",
1727117271
"hash": "42733615fa1190260f356e515519d4f3"
1727217272
},
1727317273
{
1727417274
"name": ".\/clients\/GitHubAE\/etc\/..\/\/tests\/\/Internal\/Operation\/Repos\/CreateDeploymentBranchPolicyTest.php",
17275-
"hash": "e5351388ec5cb32b623ea4e16fd6da6f"
17275+
"hash": "4957e6de4cc85f30b081e49ae5fe4a05"
1727617276
},
1727717277
{
1727817278
"name": ".\/clients\/GitHubAE\/etc\/..\/\/src\/\/Internal\/Operation\/Repos\/GetDeploymentBranchPolicy.php",
@@ -23401,6 +23401,10 @@
2340123401
{
2340223402
"name": ".\/clients\/GitHubAE\/etc\/..\/\/src\/\/Internal\/Hydrator\/Operation\/Repos\/Owner\/Repo\/Actions\/Runs\/RunId\/ForceCancel.php",
2340323403
"hash": "214bd6b16c7504cf76529ed48693ccd3"
23404+
},
23405+
{
23406+
"name": ".\/clients\/GitHubAE\/etc\/..\/\/src\/\/Schema\/DeploymentBranchPolicyNamePatternWithType.php",
23407+
"hash": "0b3d0945d7c97e2f516829d303f42e99"
2340423408
}
2340523409
]
2340623410
},

clients/GitHubAE/src/Internal/Operation/Repos/CreateDeploymentBranchPolicy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct(private readonly SchemaValidator $requestSchemaValid
4040

4141
public function createRequest(array $data): RequestInterface
4242
{
43-
$this->requestSchemaValidator->validate($data, Reader::readFromJson(Schema\DeploymentBranchPolicyNamePattern::SCHEMA_JSON, \cebe\openapi\spec\Schema::class));
43+
$this->requestSchemaValidator->validate($data, Reader::readFromJson(Schema\DeploymentBranchPolicyNamePatternWithType::SCHEMA_JSON, \cebe\openapi\spec\Schema::class));
4444

4545
return new Request(self::METHOD, str_replace(['{owner}', '{repo}', '{environment_name}'], [$this->owner, $this->repo, $this->environmentName], self::PATH), ['Content-Type' => 'application/json'], json_encode($data));
4646
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace ApiClients\Client\GitHubAE\Schema;
6+
7+
final readonly class DeploymentBranchPolicyNamePatternWithType
8+
{
9+
public const SCHEMA_JSON = '{
10+
"title": "Deployment branch policy name pattern",
11+
"required": [
12+
"name"
13+
],
14+
"type": "object",
15+
"properties": {
16+
"name": {
17+
"type": "string",
18+
"description": "The name pattern that branches must match in order to deploy to the environment.\\n\\nWildcard characters will not match `\\/`. For example, to match branches that begin with `release\\/` and contain an additional single slash, use `release\\/*\\/*`.\\nFor more information about pattern matching syntax, see the [Ruby File.fnmatch documentation](https:\\/\\/ruby-doc.org\\/core-2.5.1\\/File.html#method-c-fnmatch).",
19+
"examples": [
20+
"release\\/*"
21+
]
22+
}
23+
}
24+
}';
25+
public const SCHEMA_TITLE = 'Deployment branch policy name pattern';
26+
public const SCHEMA_DESCRIPTION = '';
27+
public const SCHEMA_EXAMPLE_DATA = '{
28+
"name": "release\\/*"
29+
}';
30+
31+
/**
32+
* name: The name pattern that branches must match in order to deploy to the environment.
33+
34+
Wildcard characters will not match `/`. For example, to match branches that begin with `release/` and contain an additional single slash, use `release/*`.
35+
For more information about pattern matching syntax, see the [Ruby File.fnmatch documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch).
36+
*/
37+
public function __construct(public string $name)
38+
{
39+
}
40+
}

clients/GitHubAE/tests/Internal/Operation/Repos/CreateDeploymentBranchPolicyTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ public function call_httpCode_200_requestContentType_application_json_responseCo
2929
$browser = $this->prophesize(Browser::class);
3030
$browser->withBase(Argument::any())->willReturn($browser->reveal());
3131
$browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal());
32-
$browser->request('POST', '/repos/generated/generated/environments/generated/deployment-branch-policies', Argument::type('array'), json_encode(json_decode(Schema\DeploymentBranchPolicyNamePattern::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled();
32+
$browser->request('POST', '/repos/generated/generated/environments/generated/deployment-branch-policies', Argument::type('array'), json_encode(json_decode(Schema\DeploymentBranchPolicyNamePatternWithType::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled();
3333
$client = new Client($auth->reveal(), $browser->reveal());
3434
$result = $client->call(Internal\Operation\Repos\CreateDeploymentBranchPolicy::OPERATION_MATCH, (static function (array $data): array {
3535
$data['owner'] = 'generated';
3636
$data['repo'] = 'generated';
3737
$data['environment_name'] = 'generated';
3838

3939
return $data;
40-
})(json_decode(Schema\DeploymentBranchPolicyNamePattern::SCHEMA_EXAMPLE_DATA, true)));
40+
})(json_decode(Schema\DeploymentBranchPolicyNamePatternWithType::SCHEMA_EXAMPLE_DATA, true)));
4141
}
4242

4343
/** @test */
@@ -49,9 +49,9 @@ public function operations_httpCode_200_requestContentType_application_json_resp
4949
$browser = $this->prophesize(Browser::class);
5050
$browser->withBase(Argument::any())->willReturn($browser->reveal());
5151
$browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal());
52-
$browser->request('POST', '/repos/generated/generated/environments/generated/deployment-branch-policies', Argument::type('array'), json_encode(json_decode(Schema\DeploymentBranchPolicyNamePattern::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled();
52+
$browser->request('POST', '/repos/generated/generated/environments/generated/deployment-branch-policies', Argument::type('array'), json_encode(json_decode(Schema\DeploymentBranchPolicyNamePatternWithType::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled();
5353
$client = new Client($auth->reveal(), $browser->reveal());
54-
$result = $client->operations()->repos()->createDeploymentBranchPolicy('generated', 'generated', 'generated', json_decode(Schema\DeploymentBranchPolicyNamePattern::SCHEMA_EXAMPLE_DATA, true));
54+
$result = $client->operations()->repos()->createDeploymentBranchPolicy('generated', 'generated', 'generated', json_decode(Schema\DeploymentBranchPolicyNamePatternWithType::SCHEMA_EXAMPLE_DATA, true));
5555
}
5656

5757
/** @test */
@@ -63,15 +63,15 @@ public function call_httpCode_404_requestContentType_application_json_empty(): v
6363
$browser = $this->prophesize(Browser::class);
6464
$browser->withBase(Argument::any())->willReturn($browser->reveal());
6565
$browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal());
66-
$browser->request('POST', '/repos/generated/generated/environments/generated/deployment-branch-policies', Argument::type('array'), json_encode(json_decode(Schema\DeploymentBranchPolicyNamePattern::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled();
66+
$browser->request('POST', '/repos/generated/generated/environments/generated/deployment-branch-policies', Argument::type('array'), json_encode(json_decode(Schema\DeploymentBranchPolicyNamePatternWithType::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled();
6767
$client = new Client($auth->reveal(), $browser->reveal());
6868
$result = $client->call(Internal\Operation\Repos\CreateDeploymentBranchPolicy::OPERATION_MATCH, (static function (array $data): array {
6969
$data['owner'] = 'generated';
7070
$data['repo'] = 'generated';
7171
$data['environment_name'] = 'generated';
7272

7373
return $data;
74-
})(json_decode(Schema\DeploymentBranchPolicyNamePattern::SCHEMA_EXAMPLE_DATA, true)));
74+
})(json_decode(Schema\DeploymentBranchPolicyNamePatternWithType::SCHEMA_EXAMPLE_DATA, true)));
7575
}
7676

7777
/** @test */
@@ -83,9 +83,9 @@ public function operations_httpCode_404_requestContentType_application_json_empt
8383
$browser = $this->prophesize(Browser::class);
8484
$browser->withBase(Argument::any())->willReturn($browser->reveal());
8585
$browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal());
86-
$browser->request('POST', '/repos/generated/generated/environments/generated/deployment-branch-policies', Argument::type('array'), json_encode(json_decode(Schema\DeploymentBranchPolicyNamePattern::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled();
86+
$browser->request('POST', '/repos/generated/generated/environments/generated/deployment-branch-policies', Argument::type('array'), json_encode(json_decode(Schema\DeploymentBranchPolicyNamePatternWithType::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled();
8787
$client = new Client($auth->reveal(), $browser->reveal());
88-
$result = $client->operations()->repos()->createDeploymentBranchPolicy('generated', 'generated', 'generated', json_decode(Schema\DeploymentBranchPolicyNamePattern::SCHEMA_EXAMPLE_DATA, true));
88+
$result = $client->operations()->repos()->createDeploymentBranchPolicy('generated', 'generated', 'generated', json_decode(Schema\DeploymentBranchPolicyNamePatternWithType::SCHEMA_EXAMPLE_DATA, true));
8989
self::assertArrayHasKey('code', $result);
9090
self::assertSame(404, $result['code']);
9191
}
@@ -99,15 +99,15 @@ public function call_httpCode_303_requestContentType_application_json_empty(): v
9999
$browser = $this->prophesize(Browser::class);
100100
$browser->withBase(Argument::any())->willReturn($browser->reveal());
101101
$browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal());
102-
$browser->request('POST', '/repos/generated/generated/environments/generated/deployment-branch-policies', Argument::type('array'), json_encode(json_decode(Schema\DeploymentBranchPolicyNamePattern::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled();
102+
$browser->request('POST', '/repos/generated/generated/environments/generated/deployment-branch-policies', Argument::type('array'), json_encode(json_decode(Schema\DeploymentBranchPolicyNamePatternWithType::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled();
103103
$client = new Client($auth->reveal(), $browser->reveal());
104104
$result = $client->call(Internal\Operation\Repos\CreateDeploymentBranchPolicy::OPERATION_MATCH, (static function (array $data): array {
105105
$data['owner'] = 'generated';
106106
$data['repo'] = 'generated';
107107
$data['environment_name'] = 'generated';
108108

109109
return $data;
110-
})(json_decode(Schema\DeploymentBranchPolicyNamePattern::SCHEMA_EXAMPLE_DATA, true)));
110+
})(json_decode(Schema\DeploymentBranchPolicyNamePatternWithType::SCHEMA_EXAMPLE_DATA, true)));
111111
}
112112

113113
/** @test */
@@ -119,9 +119,9 @@ public function operations_httpCode_303_requestContentType_application_json_empt
119119
$browser = $this->prophesize(Browser::class);
120120
$browser->withBase(Argument::any())->willReturn($browser->reveal());
121121
$browser->withFollowRedirects(Argument::any())->willReturn($browser->reveal());
122-
$browser->request('POST', '/repos/generated/generated/environments/generated/deployment-branch-policies', Argument::type('array'), json_encode(json_decode(Schema\DeploymentBranchPolicyNamePattern::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled();
122+
$browser->request('POST', '/repos/generated/generated/environments/generated/deployment-branch-policies', Argument::type('array'), json_encode(json_decode(Schema\DeploymentBranchPolicyNamePatternWithType::SCHEMA_EXAMPLE_DATA, true)))->willReturn(resolve($response))->shouldBeCalled();
123123
$client = new Client($auth->reveal(), $browser->reveal());
124-
$result = $client->operations()->repos()->createDeploymentBranchPolicy('generated', 'generated', 'generated', json_decode(Schema\DeploymentBranchPolicyNamePattern::SCHEMA_EXAMPLE_DATA, true));
124+
$result = $client->operations()->repos()->createDeploymentBranchPolicy('generated', 'generated', 'generated', json_decode(Schema\DeploymentBranchPolicyNamePatternWithType::SCHEMA_EXAMPLE_DATA, true));
125125
self::assertArrayHasKey('code', $result);
126126
self::assertSame(303, $result['code']);
127127
}

etc/specs/GitHubAE/current.spec.yaml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19226,7 +19226,7 @@ paths:
1922619226
content:
1922719227
application/json:
1922819228
schema:
19229-
"$ref": "#/components/schemas/deployment-branch-policy-name-pattern"
19229+
"$ref": "#/components/schemas/deployment-branch-policy-name-pattern-with-type"
1923019230
examples:
1923119231
example-wildcard:
1923219232
summary: Example of a wildcard name pattern
@@ -45391,7 +45391,7 @@ webhooks:
4539145391
description: Return a 200 status to indicate that the data was received
4539245392
successfully
4539345393
x-github:
45394-
githubCloudOnly: false
45394+
githubCloudOnly: true
4539545395
category: webhooks
4539645396
subcategory: user
4539745397
supported-webhook-types:
@@ -45451,7 +45451,7 @@ webhooks:
4545145451
description: Return a 200 status to indicate that the data was received
4545245452
successfully
4545345453
x-github:
45454-
githubCloudOnly: false
45454+
githubCloudOnly: true
4545545455
category: webhooks
4545645456
subcategory: user
4545745457
supported-webhook-types:
@@ -58791,6 +58791,21 @@ components:
5879158791
type: string
5879258792
examples:
5879358793
- release/*
58794+
deployment-branch-policy-name-pattern-with-type:
58795+
title: Deployment branch policy name pattern
58796+
type: object
58797+
properties:
58798+
name:
58799+
description: |-
58800+
The name pattern that branches must match in order to deploy to the environment.
58801+
58802+
Wildcard characters will not match `/`. For example, to match branches that begin with `release/` and contain an additional single slash, use `release/*/*`.
58803+
For more information about pattern matching syntax, see the [Ruby File.fnmatch documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch).
58804+
type: string
58805+
examples:
58806+
- release/*
58807+
required:
58808+
- name
5879458809
deployment-branch-policy-name-pattern:
5879558810
title: Deployment branch policy name pattern
5879658811
type: object

0 commit comments

Comments
 (0)