Skip to content

Commit b83df4f

Browse files
Update generated code (#1867)
update generated code
1 parent e7c26b1 commit b83df4f

File tree

6 files changed

+29
-1
lines changed

6 files changed

+29
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## NOT RELEASED
44

5+
### Added
6+
7+
- AWS api-change: This release adds support for cacheNamespace in ProjectCache
8+
59
### Changed
610

711
- AWS enhancement: Documentation updates.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"extra": {
3030
"branch-alias": {
31-
"dev-master": "2.8-dev"
31+
"dev-master": "2.9-dev"
3232
}
3333
}
3434
}

src/Result/BatchGetBuildsOutput.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ private function populateResultProjectCache(array $json): ProjectCache
353353
'type' => (string) $json['type'],
354354
'location' => isset($json['location']) ? (string) $json['location'] : null,
355355
'modes' => !isset($json['modes']) ? null : $this->populateResultProjectCacheModes($json['modes']),
356+
'cacheNamespace' => isset($json['cacheNamespace']) ? (string) $json['cacheNamespace'] : null,
356357
]);
357358
}
358359

src/Result/StartBuildOutput.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ private function populateResultProjectCache(array $json): ProjectCache
303303
'type' => (string) $json['type'],
304304
'location' => isset($json['location']) ? (string) $json['location'] : null,
305305
'modes' => !isset($json['modes']) ? null : $this->populateResultProjectCacheModes($json['modes']),
306+
'cacheNamespace' => isset($json['cacheNamespace']) ? (string) $json['cacheNamespace'] : null,
306307
]);
307308
}
308309

src/Result/StopBuildOutput.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ private function populateResultProjectCache(array $json): ProjectCache
303303
'type' => (string) $json['type'],
304304
'location' => isset($json['location']) ? (string) $json['location'] : null,
305305
'modes' => !isset($json['modes']) ? null : $this->populateResultProjectCacheModes($json['modes']),
306+
'cacheNamespace' => isset($json['cacheNamespace']) ? (string) $json['cacheNamespace'] : null,
306307
]);
307308
}
308309

src/ValueObject/ProjectCache.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,32 +68,50 @@ final class ProjectCache
6868
*/
6969
private $modes;
7070

71+
/**
72+
* Defines the scope of the cache. You can use this namespace to share a cache across multiple projects. For more
73+
* information, see Cache sharing between projects [^1] in the *CodeBuild User Guide*.
74+
*
75+
* [^1]: https://docs.aws.amazon.com/codebuild/latest/userguide/caching-s3.html#caching-s3-sharing
76+
*
77+
* @var string|null
78+
*/
79+
private $cacheNamespace;
80+
7181
/**
7282
* @param array{
7383
* type: CacheType::*,
7484
* location?: null|string,
7585
* modes?: null|array<CacheMode::*>,
86+
* cacheNamespace?: null|string,
7687
* } $input
7788
*/
7889
public function __construct(array $input)
7990
{
8091
$this->type = $input['type'] ?? $this->throwException(new InvalidArgument('Missing required field "type".'));
8192
$this->location = $input['location'] ?? null;
8293
$this->modes = $input['modes'] ?? null;
94+
$this->cacheNamespace = $input['cacheNamespace'] ?? null;
8395
}
8496

8597
/**
8698
* @param array{
8799
* type: CacheType::*,
88100
* location?: null|string,
89101
* modes?: null|array<CacheMode::*>,
102+
* cacheNamespace?: null|string,
90103
* }|ProjectCache $input
91104
*/
92105
public static function create($input): self
93106
{
94107
return $input instanceof self ? $input : new self($input);
95108
}
96109

110+
public function getCacheNamespace(): ?string
111+
{
112+
return $this->cacheNamespace;
113+
}
114+
97115
public function getLocation(): ?string
98116
{
99117
return $this->location;
@@ -140,6 +158,9 @@ public function requestBody(): array
140158
$payload['modes'][$index] = $listValue;
141159
}
142160
}
161+
if (null !== $v = $this->cacheNamespace) {
162+
$payload['cacheNamespace'] = $v;
163+
}
143164

144165
return $payload;
145166
}

0 commit comments

Comments
 (0)