Skip to content

Commit a2286af

Browse files
Update generated code (#1786)
update generated code
1 parent c0869e3 commit a2286af

9 files changed

+172
-1
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## NOT RELEASED
44

5+
### Added
6+
7+
- AWS api-change: AWS CodeBuild now supports automatically retrying failed builds
8+
59
## 2.5.0
610

711
### Added

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"extra": {
3030
"branch-alias": {
31-
"dev-master": "2.5-dev"
31+
"dev-master": "2.6-dev"
3232
}
3333
}
3434
}

src/CodeBuildClient.php

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public function batchGetBuilds($input): BatchGetBuildsOutput
101101
* imagePullCredentialsTypeOverride?: null|ImagePullCredentialsType::*,
102102
* debugSessionEnabled?: null|bool,
103103
* fleetOverride?: null|ProjectFleet|array,
104+
* autoRetryLimitOverride?: null|int,
104105
* '@region'?: string|null,
105106
* }|StartBuildInput $input
106107
*

src/Input/StartBuildInput.php

+26
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,14 @@ final class StartBuildInput extends Input
335335
*/
336336
private $fleetOverride;
337337

338+
/**
339+
* The maximum number of additional automatic retries after a failed build. For example, if the auto-retry limit is set
340+
* to 2, CodeBuild will call the `RetryBuild` API to automatically retry your build for up to 2 additional times.
341+
*
342+
* @var int|null
343+
*/
344+
private $autoRetryLimitOverride;
345+
338346
/**
339347
* @param array{
340348
* projectName?: string,
@@ -369,6 +377,7 @@ final class StartBuildInput extends Input
369377
* imagePullCredentialsTypeOverride?: null|ImagePullCredentialsType::*,
370378
* debugSessionEnabled?: null|bool,
371379
* fleetOverride?: null|ProjectFleet|array,
380+
* autoRetryLimitOverride?: null|int,
372381
* '@region'?: string|null,
373382
* } $input
374383
*/
@@ -406,6 +415,7 @@ public function __construct(array $input = [])
406415
$this->imagePullCredentialsTypeOverride = $input['imagePullCredentialsTypeOverride'] ?? null;
407416
$this->debugSessionEnabled = $input['debugSessionEnabled'] ?? null;
408417
$this->fleetOverride = isset($input['fleetOverride']) ? ProjectFleet::create($input['fleetOverride']) : null;
418+
$this->autoRetryLimitOverride = $input['autoRetryLimitOverride'] ?? null;
409419
parent::__construct($input);
410420
}
411421

@@ -443,6 +453,7 @@ public function __construct(array $input = [])
443453
* imagePullCredentialsTypeOverride?: null|ImagePullCredentialsType::*,
444454
* debugSessionEnabled?: null|bool,
445455
* fleetOverride?: null|ProjectFleet|array,
456+
* autoRetryLimitOverride?: null|int,
446457
* '@region'?: string|null,
447458
* }|StartBuildInput $input
448459
*/
@@ -456,6 +467,11 @@ public function getArtifactsOverride(): ?ProjectArtifacts
456467
return $this->artifactsOverride;
457468
}
458469

470+
public function getAutoRetryLimitOverride(): ?int
471+
{
472+
return $this->autoRetryLimitOverride;
473+
}
474+
459475
public function getBuildStatusConfigOverride(): ?BuildStatusConfig
460476
{
461477
return $this->buildStatusConfigOverride;
@@ -668,6 +684,13 @@ public function setArtifactsOverride(?ProjectArtifacts $value): self
668684
return $this;
669685
}
670686

687+
public function setAutoRetryLimitOverride(?int $value): self
688+
{
689+
$this->autoRetryLimitOverride = $value;
690+
691+
return $this;
692+
}
693+
671694
public function setBuildStatusConfigOverride(?BuildStatusConfig $value): self
672695
{
673696
$this->buildStatusConfigOverride = $value;
@@ -1041,6 +1064,9 @@ private function requestBody(): array
10411064
if (null !== $v = $this->fleetOverride) {
10421065
$payload['fleetOverride'] = $v->requestBody();
10431066
}
1067+
if (null !== $v = $this->autoRetryLimitOverride) {
1068+
$payload['autoRetryLimitOverride'] = $v;
1069+
}
10441070

10451071
return $payload;
10461072
}

src/Result/BatchGetBuildsOutput.php

+12
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace AsyncAws\CodeBuild\Result;
44

55
use AsyncAws\CodeBuild\Enum\CacheMode;
6+
use AsyncAws\CodeBuild\ValueObject\AutoRetryConfig;
67
use AsyncAws\CodeBuild\ValueObject\Build;
78
use AsyncAws\CodeBuild\ValueObject\BuildArtifacts;
89
use AsyncAws\CodeBuild\ValueObject\BuildPhase;
@@ -72,6 +73,16 @@ protected function populateResult(Response $response): void
7273
$this->buildsNotFound = empty($data['buildsNotFound']) ? [] : $this->populateResultBuildIds($data['buildsNotFound']);
7374
}
7475

76+
private function populateResultAutoRetryConfig(array $json): AutoRetryConfig
77+
{
78+
return new AutoRetryConfig([
79+
'autoRetryLimit' => isset($json['autoRetryLimit']) ? (int) $json['autoRetryLimit'] : null,
80+
'autoRetryNumber' => isset($json['autoRetryNumber']) ? (int) $json['autoRetryNumber'] : null,
81+
'nextAutoRetry' => isset($json['nextAutoRetry']) ? (string) $json['nextAutoRetry'] : null,
82+
'previousAutoRetry' => isset($json['previousAutoRetry']) ? (string) $json['previousAutoRetry'] : null,
83+
]);
84+
}
85+
7586
private function populateResultBuild(array $json): Build
7687
{
7788
return new Build([
@@ -107,6 +118,7 @@ private function populateResultBuild(array $json): Build
107118
'fileSystemLocations' => !isset($json['fileSystemLocations']) ? null : $this->populateResultProjectFileSystemLocations($json['fileSystemLocations']),
108119
'debugSession' => empty($json['debugSession']) ? null : $this->populateResultDebugSession($json['debugSession']),
109120
'buildBatchArn' => isset($json['buildBatchArn']) ? (string) $json['buildBatchArn'] : null,
121+
'autoRetryConfig' => empty($json['autoRetryConfig']) ? null : $this->populateResultAutoRetryConfig($json['autoRetryConfig']),
110122
]);
111123
}
112124

src/Result/StartBuildOutput.php

+12
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace AsyncAws\CodeBuild\Result;
44

55
use AsyncAws\CodeBuild\Enum\CacheMode;
6+
use AsyncAws\CodeBuild\ValueObject\AutoRetryConfig;
67
use AsyncAws\CodeBuild\ValueObject\Build;
78
use AsyncAws\CodeBuild\ValueObject\BuildArtifacts;
89
use AsyncAws\CodeBuild\ValueObject\BuildPhase;
@@ -51,6 +52,16 @@ protected function populateResult(Response $response): void
5152
$this->build = empty($data['build']) ? null : $this->populateResultBuild($data['build']);
5253
}
5354

55+
private function populateResultAutoRetryConfig(array $json): AutoRetryConfig
56+
{
57+
return new AutoRetryConfig([
58+
'autoRetryLimit' => isset($json['autoRetryLimit']) ? (int) $json['autoRetryLimit'] : null,
59+
'autoRetryNumber' => isset($json['autoRetryNumber']) ? (int) $json['autoRetryNumber'] : null,
60+
'nextAutoRetry' => isset($json['nextAutoRetry']) ? (string) $json['nextAutoRetry'] : null,
61+
'previousAutoRetry' => isset($json['previousAutoRetry']) ? (string) $json['previousAutoRetry'] : null,
62+
]);
63+
}
64+
5465
private function populateResultBuild(array $json): Build
5566
{
5667
return new Build([
@@ -86,6 +97,7 @@ private function populateResultBuild(array $json): Build
8697
'fileSystemLocations' => !isset($json['fileSystemLocations']) ? null : $this->populateResultProjectFileSystemLocations($json['fileSystemLocations']),
8798
'debugSession' => empty($json['debugSession']) ? null : $this->populateResultDebugSession($json['debugSession']),
8899
'buildBatchArn' => isset($json['buildBatchArn']) ? (string) $json['buildBatchArn'] : null,
100+
'autoRetryConfig' => empty($json['autoRetryConfig']) ? null : $this->populateResultAutoRetryConfig($json['autoRetryConfig']),
89101
]);
90102
}
91103

src/Result/StopBuildOutput.php

+12
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace AsyncAws\CodeBuild\Result;
44

55
use AsyncAws\CodeBuild\Enum\CacheMode;
6+
use AsyncAws\CodeBuild\ValueObject\AutoRetryConfig;
67
use AsyncAws\CodeBuild\ValueObject\Build;
78
use AsyncAws\CodeBuild\ValueObject\BuildArtifacts;
89
use AsyncAws\CodeBuild\ValueObject\BuildPhase;
@@ -51,6 +52,16 @@ protected function populateResult(Response $response): void
5152
$this->build = empty($data['build']) ? null : $this->populateResultBuild($data['build']);
5253
}
5354

55+
private function populateResultAutoRetryConfig(array $json): AutoRetryConfig
56+
{
57+
return new AutoRetryConfig([
58+
'autoRetryLimit' => isset($json['autoRetryLimit']) ? (int) $json['autoRetryLimit'] : null,
59+
'autoRetryNumber' => isset($json['autoRetryNumber']) ? (int) $json['autoRetryNumber'] : null,
60+
'nextAutoRetry' => isset($json['nextAutoRetry']) ? (string) $json['nextAutoRetry'] : null,
61+
'previousAutoRetry' => isset($json['previousAutoRetry']) ? (string) $json['previousAutoRetry'] : null,
62+
]);
63+
}
64+
5465
private function populateResultBuild(array $json): Build
5566
{
5667
return new Build([
@@ -86,6 +97,7 @@ private function populateResultBuild(array $json): Build
8697
'fileSystemLocations' => !isset($json['fileSystemLocations']) ? null : $this->populateResultProjectFileSystemLocations($json['fileSystemLocations']),
8798
'debugSession' => empty($json['debugSession']) ? null : $this->populateResultDebugSession($json['debugSession']),
8899
'buildBatchArn' => isset($json['buildBatchArn']) ? (string) $json['buildBatchArn'] : null,
100+
'autoRetryConfig' => empty($json['autoRetryConfig']) ? null : $this->populateResultAutoRetryConfig($json['autoRetryConfig']),
89101
]);
90102
}
91103

src/ValueObject/AutoRetryConfig.php

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?php
2+
3+
namespace AsyncAws\CodeBuild\ValueObject;
4+
5+
/**
6+
* Information about the auto-retry configuration for the build.
7+
*/
8+
final class AutoRetryConfig
9+
{
10+
/**
11+
* The maximum number of additional automatic retries after a failed build. For example, if the auto-retry limit is set
12+
* to 2, CodeBuild will call the `RetryBuild` API to automatically retry your build for up to 2 additional times.
13+
*
14+
* @var int|null
15+
*/
16+
private $autoRetryLimit;
17+
18+
/**
19+
* The number of times that the build has been retried. The initial build will have an auto-retry number of 0.
20+
*
21+
* @var int|null
22+
*/
23+
private $autoRetryNumber;
24+
25+
/**
26+
* The build ARN of the auto-retried build triggered by the current build. The next auto-retry will be `null` for builds
27+
* that don't trigger an auto-retry.
28+
*
29+
* @var string|null
30+
*/
31+
private $nextAutoRetry;
32+
33+
/**
34+
* The build ARN of the build that triggered the current auto-retry build. The previous auto-retry will be `null` for
35+
* the initial build.
36+
*
37+
* @var string|null
38+
*/
39+
private $previousAutoRetry;
40+
41+
/**
42+
* @param array{
43+
* autoRetryLimit?: null|int,
44+
* autoRetryNumber?: null|int,
45+
* nextAutoRetry?: null|string,
46+
* previousAutoRetry?: null|string,
47+
* } $input
48+
*/
49+
public function __construct(array $input)
50+
{
51+
$this->autoRetryLimit = $input['autoRetryLimit'] ?? null;
52+
$this->autoRetryNumber = $input['autoRetryNumber'] ?? null;
53+
$this->nextAutoRetry = $input['nextAutoRetry'] ?? null;
54+
$this->previousAutoRetry = $input['previousAutoRetry'] ?? null;
55+
}
56+
57+
/**
58+
* @param array{
59+
* autoRetryLimit?: null|int,
60+
* autoRetryNumber?: null|int,
61+
* nextAutoRetry?: null|string,
62+
* previousAutoRetry?: null|string,
63+
* }|AutoRetryConfig $input
64+
*/
65+
public static function create($input): self
66+
{
67+
return $input instanceof self ? $input : new self($input);
68+
}
69+
70+
public function getAutoRetryLimit(): ?int
71+
{
72+
return $this->autoRetryLimit;
73+
}
74+
75+
public function getAutoRetryNumber(): ?int
76+
{
77+
return $this->autoRetryNumber;
78+
}
79+
80+
public function getNextAutoRetry(): ?string
81+
{
82+
return $this->nextAutoRetry;
83+
}
84+
85+
public function getPreviousAutoRetry(): ?string
86+
{
87+
return $this->previousAutoRetry;
88+
}
89+
}

src/ValueObject/Build.php

+15
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,13 @@ final class Build
282282
*/
283283
private $buildBatchArn;
284284

285+
/**
286+
* Information about the auto-retry configuration for the build.
287+
*
288+
* @var AutoRetryConfig|null
289+
*/
290+
private $autoRetryConfig;
291+
285292
/**
286293
* @param array{
287294
* id?: null|string,
@@ -316,6 +323,7 @@ final class Build
316323
* fileSystemLocations?: null|array<ProjectFileSystemLocation|array>,
317324
* debugSession?: null|DebugSession|array,
318325
* buildBatchArn?: null|string,
326+
* autoRetryConfig?: null|AutoRetryConfig|array,
319327
* } $input
320328
*/
321329
public function __construct(array $input)
@@ -352,6 +360,7 @@ public function __construct(array $input)
352360
$this->fileSystemLocations = isset($input['fileSystemLocations']) ? array_map([ProjectFileSystemLocation::class, 'create'], $input['fileSystemLocations']) : null;
353361
$this->debugSession = isset($input['debugSession']) ? DebugSession::create($input['debugSession']) : null;
354362
$this->buildBatchArn = $input['buildBatchArn'] ?? null;
363+
$this->autoRetryConfig = isset($input['autoRetryConfig']) ? AutoRetryConfig::create($input['autoRetryConfig']) : null;
355364
}
356365

357366
/**
@@ -388,6 +397,7 @@ public function __construct(array $input)
388397
* fileSystemLocations?: null|array<ProjectFileSystemLocation|array>,
389398
* debugSession?: null|DebugSession|array,
390399
* buildBatchArn?: null|string,
400+
* autoRetryConfig?: null|AutoRetryConfig|array,
391401
* }|Build $input
392402
*/
393403
public static function create($input): self
@@ -405,6 +415,11 @@ public function getArtifacts(): ?BuildArtifacts
405415
return $this->artifacts;
406416
}
407417

418+
public function getAutoRetryConfig(): ?AutoRetryConfig
419+
{
420+
return $this->autoRetryConfig;
421+
}
422+
408423
public function getBuildBatchArn(): ?string
409424
{
410425
return $this->buildBatchArn;

0 commit comments

Comments
 (0)