Skip to content

Commit 44a3443

Browse files
Update generated code (#2102)
* update generated code * Apply suggestion from @jderusse --------- Co-authored-by: Jérémy Derussé <jeremy@derusse.com>
1 parent 1a507f2 commit 44a3443

6 files changed

Lines changed: 145 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Added
66

77
- AWS api-change: Converging and fixing existing documentation gaps in Lambda SDK
8+
- AWS api-change: Lambda now supports self-managed S3 buckets for Lambda code storage giving you the option for Lambda to reference a copy of your source code from your own S3 buckets. This allows you to maintain a single copy of your source code and manage your own code storage limits.
89

910
## 2.15.0
1011

src/Enum/S3ObjectStorageMode.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace AsyncAws\Lambda\Enum;
4+
5+
/**
6+
* The storage mode for a function's deployment package.
7+
*/
8+
final class S3ObjectStorageMode
9+
{
10+
public const COPY = 'COPY';
11+
public const REFERENCE = 'REFERENCE';
12+
13+
/**
14+
* @psalm-assert-if-true self::* $value
15+
*/
16+
public static function exists(string $value): bool
17+
{
18+
return isset([
19+
self::COPY => true,
20+
self::REFERENCE => true,
21+
][$value]);
22+
}
23+
}

src/Result/PublishLayerVersionResponse.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use AsyncAws\Lambda\Enum\Architecture;
88
use AsyncAws\Lambda\Enum\Runtime;
99
use AsyncAws\Lambda\ValueObject\LayerVersionContentOutput;
10+
use AsyncAws\Lambda\ValueObject\ResolvedS3Object;
1011

1112
class PublishLayerVersionResponse extends Result
1213
{
@@ -214,6 +215,16 @@ private function populateResultLayerVersionContentOutput(array $json): LayerVers
214215
'CodeSize' => isset($json['CodeSize']) ? (int) $json['CodeSize'] : null,
215216
'SigningProfileVersionArn' => isset($json['SigningProfileVersionArn']) ? (string) $json['SigningProfileVersionArn'] : null,
216217
'SigningJobArn' => isset($json['SigningJobArn']) ? (string) $json['SigningJobArn'] : null,
218+
'ResolvedS3Object' => empty($json['ResolvedS3Object']) ? null : $this->populateResultResolvedS3Object($json['ResolvedS3Object']),
219+
]);
220+
}
221+
222+
private function populateResultResolvedS3Object(array $json): ResolvedS3Object
223+
{
224+
return new ResolvedS3Object([
225+
'S3Bucket' => isset($json['S3Bucket']) ? (string) $json['S3Bucket'] : null,
226+
'S3Key' => isset($json['S3Key']) ? (string) $json['S3Key'] : null,
227+
'S3ObjectVersion' => isset($json['S3ObjectVersion']) ? (string) $json['S3ObjectVersion'] : null,
217228
]);
218229
}
219230
}

src/ValueObject/LayerVersionContentInput.php

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

33
namespace AsyncAws\Lambda\ValueObject;
44

5+
use AsyncAws\Core\Exception\InvalidArgument;
6+
use AsyncAws\Lambda\Enum\S3ObjectStorageMode;
7+
58
/**
69
* A ZIP archive that contains the contents of an Lambda layer [^1]. You can specify either an Amazon S3 location, or
710
* upload a layer archive directly.
@@ -31,6 +34,11 @@ final class LayerVersionContentInput
3134
*/
3235
private $s3ObjectVersion;
3336

37+
/**
38+
* @var S3ObjectStorageMode::*|null
39+
*/
40+
private $s3ObjectStorageMode;
41+
3442
/**
3543
* The base64-encoded contents of the layer archive. Amazon Web Services SDK and Amazon Web Services CLI clients handle
3644
* the encoding for you.
@@ -44,6 +52,7 @@ final class LayerVersionContentInput
4452
* S3Bucket?: string|null,
4553
* S3Key?: string|null,
4654
* S3ObjectVersion?: string|null,
55+
* S3ObjectStorageMode?: S3ObjectStorageMode::*|null,
4756
* ZipFile?: string|null,
4857
* } $input
4958
*/
@@ -52,6 +61,7 @@ public function __construct(array $input)
5261
$this->s3Bucket = $input['S3Bucket'] ?? null;
5362
$this->s3Key = $input['S3Key'] ?? null;
5463
$this->s3ObjectVersion = $input['S3ObjectVersion'] ?? null;
64+
$this->s3ObjectStorageMode = $input['S3ObjectStorageMode'] ?? null;
5565
$this->zipFile = $input['ZipFile'] ?? null;
5666
}
5767

@@ -60,6 +70,7 @@ public function __construct(array $input)
6070
* S3Bucket?: string|null,
6171
* S3Key?: string|null,
6272
* S3ObjectVersion?: string|null,
73+
* S3ObjectStorageMode?: S3ObjectStorageMode::*|null,
6374
* ZipFile?: string|null,
6475
* }|LayerVersionContentInput $input
6576
*/
@@ -78,6 +89,14 @@ public function getS3Key(): ?string
7889
return $this->s3Key;
7990
}
8091

92+
/**
93+
* @return S3ObjectStorageMode::*|null
94+
*/
95+
public function getS3ObjectStorageMode(): ?string
96+
{
97+
return $this->s3ObjectStorageMode;
98+
}
99+
81100
public function getS3ObjectVersion(): ?string
82101
{
83102
return $this->s3ObjectVersion;
@@ -103,6 +122,13 @@ public function requestBody(): array
103122
if (null !== $v = $this->s3ObjectVersion) {
104123
$payload['S3ObjectVersion'] = $v;
105124
}
125+
if (null !== $v = $this->s3ObjectStorageMode) {
126+
if (!S3ObjectStorageMode::exists($v)) {
127+
/** @psalm-suppress NoValue */
128+
throw new InvalidArgument(\sprintf('Invalid parameter "S3ObjectStorageMode" for "%s". The value "%s" is not a valid "S3ObjectStorageMode".', __CLASS__, $v));
129+
}
130+
$payload['S3ObjectStorageMode'] = $v;
131+
}
106132
if (null !== $v = $this->zipFile) {
107133
$payload['ZipFile'] = base64_encode($v);
108134
}

src/ValueObject/LayerVersionContentOutput.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,19 @@ final class LayerVersionContentOutput
4444
*/
4545
private $signingJobArn;
4646

47+
/**
48+
* @var ResolvedS3Object|null
49+
*/
50+
private $resolvedS3Object;
51+
4752
/**
4853
* @param array{
4954
* Location?: string|null,
5055
* CodeSha256?: string|null,
5156
* CodeSize?: int|null,
5257
* SigningProfileVersionArn?: string|null,
5358
* SigningJobArn?: string|null,
59+
* ResolvedS3Object?: ResolvedS3Object|array|null,
5460
* } $input
5561
*/
5662
public function __construct(array $input)
@@ -60,6 +66,7 @@ public function __construct(array $input)
6066
$this->codeSize = $input['CodeSize'] ?? null;
6167
$this->signingProfileVersionArn = $input['SigningProfileVersionArn'] ?? null;
6268
$this->signingJobArn = $input['SigningJobArn'] ?? null;
69+
$this->resolvedS3Object = isset($input['ResolvedS3Object']) ? ResolvedS3Object::create($input['ResolvedS3Object']) : null;
6370
}
6471

6572
/**
@@ -69,6 +76,7 @@ public function __construct(array $input)
6976
* CodeSize?: int|null,
7077
* SigningProfileVersionArn?: string|null,
7178
* SigningJobArn?: string|null,
79+
* ResolvedS3Object?: ResolvedS3Object|array|null,
7280
* }|LayerVersionContentOutput $input
7381
*/
7482
public static function create($input): self
@@ -91,6 +99,11 @@ public function getLocation(): ?string
9199
return $this->location;
92100
}
93101

102+
public function getResolvedS3Object(): ?ResolvedS3Object
103+
{
104+
return $this->resolvedS3Object;
105+
}
106+
94107
public function getSigningJobArn(): ?string
95108
{
96109
return $this->signingJobArn;
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?php
2+
3+
namespace AsyncAws\Lambda\ValueObject;
4+
5+
/**
6+
* Details about the resolved Amazon S3 object that contains a function's deployment package.
7+
*/
8+
final class ResolvedS3Object
9+
{
10+
/**
11+
* The Amazon S3 bucket that contains the deployment package.
12+
*
13+
* @var string|null
14+
*/
15+
private $s3Bucket;
16+
17+
/**
18+
* The Amazon S3 key of the deployment package.
19+
*
20+
* @var string|null
21+
*/
22+
private $s3Key;
23+
24+
/**
25+
* The version of the deployment package object.
26+
*
27+
* @var string|null
28+
*/
29+
private $s3ObjectVersion;
30+
31+
/**
32+
* @param array{
33+
* S3Bucket?: string|null,
34+
* S3Key?: string|null,
35+
* S3ObjectVersion?: string|null,
36+
* } $input
37+
*/
38+
public function __construct(array $input)
39+
{
40+
$this->s3Bucket = $input['S3Bucket'] ?? null;
41+
$this->s3Key = $input['S3Key'] ?? null;
42+
$this->s3ObjectVersion = $input['S3ObjectVersion'] ?? null;
43+
}
44+
45+
/**
46+
* @param array{
47+
* S3Bucket?: string|null,
48+
* S3Key?: string|null,
49+
* S3ObjectVersion?: string|null,
50+
* }|ResolvedS3Object $input
51+
*/
52+
public static function create($input): self
53+
{
54+
return $input instanceof self ? $input : new self($input);
55+
}
56+
57+
public function getS3Bucket(): ?string
58+
{
59+
return $this->s3Bucket;
60+
}
61+
62+
public function getS3Key(): ?string
63+
{
64+
return $this->s3Key;
65+
}
66+
67+
public function getS3ObjectVersion(): ?string
68+
{
69+
return $this->s3ObjectVersion;
70+
}
71+
}

0 commit comments

Comments
 (0)