Skip to content

Commit 15f3703

Browse files
Update generated code (#1789)
update generated code
1 parent a2286af commit 15f3703

8 files changed

+191
-21
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Added
66

77
- AWS api-change: AWS CodeBuild now supports automatically retrying failed builds
8+
- AWS api-change: AWS CodeBuild now adds additional compute types for reserved capacity fleet.
89

910
## 2.5.0
1011

src/Enum/ComputeType.php

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
final class ComputeType
66
{
7+
public const ATTRIBUTE_BASED_COMPUTE = 'ATTRIBUTE_BASED_COMPUTE';
78
public const BUILD_GENERAL1_2XLARGE = 'BUILD_GENERAL1_2XLARGE';
89
public const BUILD_GENERAL1_LARGE = 'BUILD_GENERAL1_LARGE';
910
public const BUILD_GENERAL1_MEDIUM = 'BUILD_GENERAL1_MEDIUM';
@@ -18,6 +19,7 @@ final class ComputeType
1819
public static function exists(string $value): bool
1920
{
2021
return isset([
22+
self::ATTRIBUTE_BASED_COMPUTE => true,
2123
self::BUILD_GENERAL1_2XLARGE => true,
2224
self::BUILD_GENERAL1_LARGE => true,
2325
self::BUILD_GENERAL1_MEDIUM => true,

src/Enum/MachineType.php

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace AsyncAws\CodeBuild\Enum;
4+
5+
final class MachineType
6+
{
7+
public const GENERAL = 'GENERAL';
8+
public const NVME = 'NVME';
9+
10+
public static function exists(string $value): bool
11+
{
12+
return isset([
13+
self::GENERAL => true,
14+
self::NVME => true,
15+
][$value]);
16+
}
17+
}

src/Result/BatchGetBuildsOutput.php

+12
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use AsyncAws\CodeBuild\ValueObject\BuildPhase;
1010
use AsyncAws\CodeBuild\ValueObject\BuildStatusConfig;
1111
use AsyncAws\CodeBuild\ValueObject\CloudWatchLogsConfig;
12+
use AsyncAws\CodeBuild\ValueObject\ComputeConfiguration;
1213
use AsyncAws\CodeBuild\ValueObject\DebugSession;
1314
use AsyncAws\CodeBuild\ValueObject\EnvironmentVariable;
1415
use AsyncAws\CodeBuild\ValueObject\ExportedEnvironmentVariable;
@@ -235,6 +236,16 @@ private function populateResultCloudWatchLogsConfig(array $json): CloudWatchLogs
235236
]);
236237
}
237238

239+
private function populateResultComputeConfiguration(array $json): ComputeConfiguration
240+
{
241+
return new ComputeConfiguration([
242+
'vCpu' => isset($json['vCpu']) ? (int) $json['vCpu'] : null,
243+
'memory' => isset($json['memory']) ? (int) $json['memory'] : null,
244+
'disk' => isset($json['disk']) ? (int) $json['disk'] : null,
245+
'machineType' => isset($json['machineType']) ? (string) $json['machineType'] : null,
246+
]);
247+
}
248+
238249
private function populateResultDebugSession(array $json): DebugSession
239250
{
240251
return new DebugSession([
@@ -367,6 +378,7 @@ private function populateResultProjectEnvironment(array $json): ProjectEnvironme
367378
'type' => (string) $json['type'],
368379
'image' => (string) $json['image'],
369380
'computeType' => (string) $json['computeType'],
381+
'computeConfiguration' => empty($json['computeConfiguration']) ? null : $this->populateResultComputeConfiguration($json['computeConfiguration']),
370382
'fleet' => empty($json['fleet']) ? null : $this->populateResultProjectFleet($json['fleet']),
371383
'environmentVariables' => !isset($json['environmentVariables']) ? null : $this->populateResultEnvironmentVariables($json['environmentVariables']),
372384
'privilegedMode' => isset($json['privilegedMode']) ? filter_var($json['privilegedMode'], \FILTER_VALIDATE_BOOLEAN) : null,

src/Result/StartBuildOutput.php

+12
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use AsyncAws\CodeBuild\ValueObject\BuildPhase;
1010
use AsyncAws\CodeBuild\ValueObject\BuildStatusConfig;
1111
use AsyncAws\CodeBuild\ValueObject\CloudWatchLogsConfig;
12+
use AsyncAws\CodeBuild\ValueObject\ComputeConfiguration;
1213
use AsyncAws\CodeBuild\ValueObject\DebugSession;
1314
use AsyncAws\CodeBuild\ValueObject\EnvironmentVariable;
1415
use AsyncAws\CodeBuild\ValueObject\ExportedEnvironmentVariable;
@@ -185,6 +186,16 @@ private function populateResultCloudWatchLogsConfig(array $json): CloudWatchLogs
185186
]);
186187
}
187188

189+
private function populateResultComputeConfiguration(array $json): ComputeConfiguration
190+
{
191+
return new ComputeConfiguration([
192+
'vCpu' => isset($json['vCpu']) ? (int) $json['vCpu'] : null,
193+
'memory' => isset($json['memory']) ? (int) $json['memory'] : null,
194+
'disk' => isset($json['disk']) ? (int) $json['disk'] : null,
195+
'machineType' => isset($json['machineType']) ? (string) $json['machineType'] : null,
196+
]);
197+
}
198+
188199
private function populateResultDebugSession(array $json): DebugSession
189200
{
190201
return new DebugSession([
@@ -317,6 +328,7 @@ private function populateResultProjectEnvironment(array $json): ProjectEnvironme
317328
'type' => (string) $json['type'],
318329
'image' => (string) $json['image'],
319330
'computeType' => (string) $json['computeType'],
331+
'computeConfiguration' => empty($json['computeConfiguration']) ? null : $this->populateResultComputeConfiguration($json['computeConfiguration']),
320332
'fleet' => empty($json['fleet']) ? null : $this->populateResultProjectFleet($json['fleet']),
321333
'environmentVariables' => !isset($json['environmentVariables']) ? null : $this->populateResultEnvironmentVariables($json['environmentVariables']),
322334
'privilegedMode' => isset($json['privilegedMode']) ? filter_var($json['privilegedMode'], \FILTER_VALIDATE_BOOLEAN) : null,

src/Result/StopBuildOutput.php

+12
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use AsyncAws\CodeBuild\ValueObject\BuildPhase;
1010
use AsyncAws\CodeBuild\ValueObject\BuildStatusConfig;
1111
use AsyncAws\CodeBuild\ValueObject\CloudWatchLogsConfig;
12+
use AsyncAws\CodeBuild\ValueObject\ComputeConfiguration;
1213
use AsyncAws\CodeBuild\ValueObject\DebugSession;
1314
use AsyncAws\CodeBuild\ValueObject\EnvironmentVariable;
1415
use AsyncAws\CodeBuild\ValueObject\ExportedEnvironmentVariable;
@@ -185,6 +186,16 @@ private function populateResultCloudWatchLogsConfig(array $json): CloudWatchLogs
185186
]);
186187
}
187188

189+
private function populateResultComputeConfiguration(array $json): ComputeConfiguration
190+
{
191+
return new ComputeConfiguration([
192+
'vCpu' => isset($json['vCpu']) ? (int) $json['vCpu'] : null,
193+
'memory' => isset($json['memory']) ? (int) $json['memory'] : null,
194+
'disk' => isset($json['disk']) ? (int) $json['disk'] : null,
195+
'machineType' => isset($json['machineType']) ? (string) $json['machineType'] : null,
196+
]);
197+
}
198+
188199
private function populateResultDebugSession(array $json): DebugSession
189200
{
190201
return new DebugSession([
@@ -317,6 +328,7 @@ private function populateResultProjectEnvironment(array $json): ProjectEnvironme
317328
'type' => (string) $json['type'],
318329
'image' => (string) $json['image'],
319330
'computeType' => (string) $json['computeType'],
331+
'computeConfiguration' => empty($json['computeConfiguration']) ? null : $this->populateResultComputeConfiguration($json['computeConfiguration']),
320332
'fleet' => empty($json['fleet']) ? null : $this->populateResultProjectFleet($json['fleet']),
321333
'environmentVariables' => !isset($json['environmentVariables']) ? null : $this->populateResultEnvironmentVariables($json['environmentVariables']),
322334
'privilegedMode' => isset($json['privilegedMode']) ? filter_var($json['privilegedMode'], \FILTER_VALIDATE_BOOLEAN) : null,
+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?php
2+
3+
namespace AsyncAws\CodeBuild\ValueObject;
4+
5+
use AsyncAws\CodeBuild\Enum\MachineType;
6+
7+
/**
8+
* Contains compute attributes. These attributes only need be specified when your project's or fleet's `computeType` is
9+
* set to `ATTRIBUTE_BASED_COMPUTE`.
10+
*/
11+
final class ComputeConfiguration
12+
{
13+
/**
14+
* The number of vCPUs of the instance type included in your fleet.
15+
*
16+
* @var int|null
17+
*/
18+
private $vCpu;
19+
20+
/**
21+
* The amount of memory of the instance type included in your fleet.
22+
*
23+
* @var int|null
24+
*/
25+
private $memory;
26+
27+
/**
28+
* The amount of disk space of the instance type included in your fleet.
29+
*
30+
* @var int|null
31+
*/
32+
private $disk;
33+
34+
/**
35+
* The machine type of the instance type included in your fleet.
36+
*
37+
* @var MachineType::*|null
38+
*/
39+
private $machineType;
40+
41+
/**
42+
* @param array{
43+
* vCpu?: null|int,
44+
* memory?: null|int,
45+
* disk?: null|int,
46+
* machineType?: null|MachineType::*,
47+
* } $input
48+
*/
49+
public function __construct(array $input)
50+
{
51+
$this->vCpu = $input['vCpu'] ?? null;
52+
$this->memory = $input['memory'] ?? null;
53+
$this->disk = $input['disk'] ?? null;
54+
$this->machineType = $input['machineType'] ?? null;
55+
}
56+
57+
/**
58+
* @param array{
59+
* vCpu?: null|int,
60+
* memory?: null|int,
61+
* disk?: null|int,
62+
* machineType?: null|MachineType::*,
63+
* }|ComputeConfiguration $input
64+
*/
65+
public static function create($input): self
66+
{
67+
return $input instanceof self ? $input : new self($input);
68+
}
69+
70+
public function getDisk(): ?int
71+
{
72+
return $this->disk;
73+
}
74+
75+
/**
76+
* @return MachineType::*|null
77+
*/
78+
public function getMachineType(): ?string
79+
{
80+
return $this->machineType;
81+
}
82+
83+
public function getMemory(): ?int
84+
{
85+
return $this->memory;
86+
}
87+
88+
public function getVCpu(): ?int
89+
{
90+
return $this->vCpu;
91+
}
92+
}

src/ValueObject/ProjectEnvironment.php

+43-21
Original file line numberDiff line numberDiff line change
@@ -62,48 +62,62 @@ final class ProjectEnvironment
6262
/**
6363
* Information about the compute resources the build project uses. Available values include:
6464
*
65-
* - `BUILD_GENERAL1_SMALL`: Use up to 3 GB memory and 2 vCPUs for builds.
66-
* - `BUILD_GENERAL1_MEDIUM`: Use up to 7 GB memory and 4 vCPUs for builds.
67-
* - `BUILD_GENERAL1_LARGE`: Use up to 16 GB memory and 8 vCPUs for builds, depending on your environment type.
68-
* - `BUILD_GENERAL1_XLARGE`: Use up to 70 GB memory and 36 vCPUs for builds, depending on your environment type.
69-
* - `BUILD_GENERAL1_2XLARGE`: Use up to 145 GB memory, 72 vCPUs, and 824 GB of SSD storage for builds. This compute
65+
* - `ATTRIBUTE_BASED_COMPUTE`: Specify the amount of vCPUs, memory, disk space, and the type of machine.
66+
*
67+
* > If you use `ATTRIBUTE_BASED_COMPUTE`, you must define your attributes by using `computeConfiguration`. CodeBuild
68+
* > will select the cheapest instance that satisfies your specified attributes. For more information, see Reserved
69+
* > capacity environment types [^1] in the *CodeBuild User Guide*.
70+
*
71+
* - `BUILD_GENERAL1_SMALL`: Use up to 4 GiB memory and 2 vCPUs for builds.
72+
* - `BUILD_GENERAL1_MEDIUM`: Use up to 8 GiB memory and 4 vCPUs for builds.
73+
* - `BUILD_GENERAL1_LARGE`: Use up to 16 GiB memory and 8 vCPUs for builds, depending on your environment type.
74+
* - `BUILD_GENERAL1_XLARGE`: Use up to 72 GiB memory and 36 vCPUs for builds, depending on your environment type.
75+
* - `BUILD_GENERAL1_2XLARGE`: Use up to 144 GiB memory, 72 vCPUs, and 824 GB of SSD storage for builds. This compute
7076
* type supports Docker images up to 100 GB uncompressed.
71-
* - `BUILD_LAMBDA_1GB`: Use up to 1 GB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER`
77+
* - `BUILD_LAMBDA_1GB`: Use up to 1 GiB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER`
7278
* and `ARM_LAMBDA_CONTAINER`.
73-
* - `BUILD_LAMBDA_2GB`: Use up to 2 GB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER`
79+
* - `BUILD_LAMBDA_2GB`: Use up to 2 GiB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER`
7480
* and `ARM_LAMBDA_CONTAINER`.
75-
* - `BUILD_LAMBDA_4GB`: Use up to 4 GB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER`
81+
* - `BUILD_LAMBDA_4GB`: Use up to 4 GiB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER`
7682
* and `ARM_LAMBDA_CONTAINER`.
77-
* - `BUILD_LAMBDA_8GB`: Use up to 8 GB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER`
83+
* - `BUILD_LAMBDA_8GB`: Use up to 8 GiB memory for builds. Only available for environment type `LINUX_LAMBDA_CONTAINER`
7884
* and `ARM_LAMBDA_CONTAINER`.
79-
* - `BUILD_LAMBDA_10GB`: Use up to 10 GB memory for builds. Only available for environment type
85+
* - `BUILD_LAMBDA_10GB`: Use up to 10 GiB memory for builds. Only available for environment type
8086
* `LINUX_LAMBDA_CONTAINER` and `ARM_LAMBDA_CONTAINER`.
8187
*
8288
* If you use `BUILD_GENERAL1_SMALL`:
8389
*
84-
* - For environment type `LINUX_CONTAINER`, you can use up to 3 GB memory and 2 vCPUs for builds.
85-
* - For environment type `LINUX_GPU_CONTAINER`, you can use up to 16 GB memory, 4 vCPUs, and 1 NVIDIA A10G Tensor Core
90+
* - For environment type `LINUX_CONTAINER`, you can use up to 4 GiB memory and 2 vCPUs for builds.
91+
* - For environment type `LINUX_GPU_CONTAINER`, you can use up to 16 GiB memory, 4 vCPUs, and 1 NVIDIA A10G Tensor Core
8692
* GPU for builds.
87-
* - For environment type `ARM_CONTAINER`, you can use up to 4 GB memory and 2 vCPUs on ARM-based processors for builds.
93+
* - For environment type `ARM_CONTAINER`, you can use up to 4 GiB memory and 2 vCPUs on ARM-based processors for
94+
* builds.
8895
*
8996
* If you use `BUILD_GENERAL1_LARGE`:
9097
*
91-
* - For environment type `LINUX_CONTAINER`, you can use up to 15 GB memory and 8 vCPUs for builds.
92-
* - For environment type `LINUX_GPU_CONTAINER`, you can use up to 255 GB memory, 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs
93-
* for builds.
94-
* - For environment type `ARM_CONTAINER`, you can use up to 16 GB memory and 8 vCPUs on ARM-based processors for
98+
* - For environment type `LINUX_CONTAINER`, you can use up to 16 GiB memory and 8 vCPUs for builds.
99+
* - For environment type `LINUX_GPU_CONTAINER`, you can use up to 255 GiB memory, 32 vCPUs, and 4 NVIDIA Tesla V100
100+
* GPUs for builds.
101+
* - For environment type `ARM_CONTAINER`, you can use up to 16 GiB memory and 8 vCPUs on ARM-based processors for
95102
* builds.
96103
*
97-
* > If you're using compute fleets during project creation, `computeType` will be ignored.
104+
* For more information, see On-demand environment types [^2] in the *CodeBuild User Guide.*
98105
*
99-
* For more information, see Build Environment Compute Types [^1] in the *CodeBuild User Guide.*
100-
*
101-
* [^1]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html
106+
* [^1]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment-reserved-capacity.types
107+
* [^2]: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types
102108
*
103109
* @var ComputeType::*
104110
*/
105111
private $computeType;
106112

113+
/**
114+
* The compute configuration of the build project. This is only required if `computeType` is set to
115+
* `ATTRIBUTE_BASED_COMPUTE`.
116+
*
117+
* @var ComputeConfiguration|null
118+
*/
119+
private $computeConfiguration;
120+
107121
/**
108122
* A ProjectFleet object to use for this build project.
109123
*
@@ -181,6 +195,7 @@ final class ProjectEnvironment
181195
* type: EnvironmentType::*,
182196
* image: string,
183197
* computeType: ComputeType::*,
198+
* computeConfiguration?: null|ComputeConfiguration|array,
184199
* fleet?: null|ProjectFleet|array,
185200
* environmentVariables?: null|array<EnvironmentVariable|array>,
186201
* privilegedMode?: null|bool,
@@ -194,6 +209,7 @@ public function __construct(array $input)
194209
$this->type = $input['type'] ?? $this->throwException(new InvalidArgument('Missing required field "type".'));
195210
$this->image = $input['image'] ?? $this->throwException(new InvalidArgument('Missing required field "image".'));
196211
$this->computeType = $input['computeType'] ?? $this->throwException(new InvalidArgument('Missing required field "computeType".'));
212+
$this->computeConfiguration = isset($input['computeConfiguration']) ? ComputeConfiguration::create($input['computeConfiguration']) : null;
197213
$this->fleet = isset($input['fleet']) ? ProjectFleet::create($input['fleet']) : null;
198214
$this->environmentVariables = isset($input['environmentVariables']) ? array_map([EnvironmentVariable::class, 'create'], $input['environmentVariables']) : null;
199215
$this->privilegedMode = $input['privilegedMode'] ?? null;
@@ -207,6 +223,7 @@ public function __construct(array $input)
207223
* type: EnvironmentType::*,
208224
* image: string,
209225
* computeType: ComputeType::*,
226+
* computeConfiguration?: null|ComputeConfiguration|array,
210227
* fleet?: null|ProjectFleet|array,
211228
* environmentVariables?: null|array<EnvironmentVariable|array>,
212229
* privilegedMode?: null|bool,
@@ -225,6 +242,11 @@ public function getCertificate(): ?string
225242
return $this->certificate;
226243
}
227244

245+
public function getComputeConfiguration(): ?ComputeConfiguration
246+
{
247+
return $this->computeConfiguration;
248+
}
249+
228250
/**
229251
* @return ComputeType::*
230252
*/

0 commit comments

Comments
 (0)