Skip to content

Commit fe07d47

Browse files
Update generated code (#1137)
* update generated code * Fix empty constructor * Apply suggestions from code review Co-authored-by: Jérémy Derussé <jeremy@derusse.com>
1 parent 6c84185 commit fe07d47

10 files changed

+143
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
- AWS api-change: used unique endpoint for `accesspoint-*` regions
88
- AWS api-change: Rework regions configuration.
9+
- AWS api-change: Introduce Amazon S3 Glacier Instant Retrieval storage class and a new setting in S3 Object Ownership to disable ACLs for bucket and the objects in it.
10+
- AWS api-change: Amazon S3 Event Notifications adds Amazon EventBridge as a destination and supports additional event types. The PutBucketNotificationConfiguration API can now skip validation of Amazon SQS, Amazon SNS and AWS Lambda destinations.
11+
- AWS api-change: Introduce two new Filters to S3 Lifecycle configurations - ObjectSizeGreaterThan and ObjectSizeLessThan. Introduce a new way to trigger actions on noncurrent versions by providing the number of newer noncurrent versions along with noncurrent days.
912

1013
## 1.9.2
1114

src/Enum/Event.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
*/
88
final class Event
99
{
10+
public const S3_INTELLIGENT_TIERING = 's3:IntelligentTiering';
11+
public const S3_LIFECYCLE_EXPIRATION_ALL = 's3:LifecycleExpiration:*';
12+
public const S3_LIFECYCLE_EXPIRATION_DELETE = 's3:LifecycleExpiration:Delete';
13+
public const S3_LIFECYCLE_EXPIRATION_DELETE_MARKER_CREATED = 's3:LifecycleExpiration:DeleteMarkerCreated';
14+
public const S3_LIFECYCLE_TRANSITION = 's3:LifecycleTransition';
15+
public const S3_OBJECT_ACL_PUT = 's3:ObjectAcl:Put';
1016
public const S3_OBJECT_CREATED_ALL = 's3:ObjectCreated:*';
1117
public const S3_OBJECT_CREATED_COMPLETE_MULTIPART_UPLOAD = 's3:ObjectCreated:CompleteMultipartUpload';
1218
public const S3_OBJECT_CREATED_COPY = 's3:ObjectCreated:Copy';
@@ -17,7 +23,11 @@ final class Event
1723
public const S3_OBJECT_REMOVED_DELETE_MARKER_CREATED = 's3:ObjectRemoved:DeleteMarkerCreated';
1824
public const S3_OBJECT_RESTORE_ALL = 's3:ObjectRestore:*';
1925
public const S3_OBJECT_RESTORE_COMPLETED = 's3:ObjectRestore:Completed';
26+
public const S3_OBJECT_RESTORE_DELETE = 's3:ObjectRestore:Delete';
2027
public const S3_OBJECT_RESTORE_POST = 's3:ObjectRestore:Post';
28+
public const S3_OBJECT_TAGGING_ALL = 's3:ObjectTagging:*';
29+
public const S3_OBJECT_TAGGING_DELETE = 's3:ObjectTagging:Delete';
30+
public const S3_OBJECT_TAGGING_PUT = 's3:ObjectTagging:Put';
2131
public const S3_REDUCED_REDUNDANCY_LOST_OBJECT = 's3:ReducedRedundancyLostObject';
2232
public const S3_REPLICATION_ALL = 's3:Replication:*';
2333
public const S3_REPLICATION_OPERATION_FAILED_REPLICATION = 's3:Replication:OperationFailedReplication';
@@ -28,6 +38,12 @@ final class Event
2838
public static function exists(string $value): bool
2939
{
3040
return isset([
41+
self::S3_INTELLIGENT_TIERING => true,
42+
self::S3_LIFECYCLE_EXPIRATION_ALL => true,
43+
self::S3_LIFECYCLE_EXPIRATION_DELETE => true,
44+
self::S3_LIFECYCLE_EXPIRATION_DELETE_MARKER_CREATED => true,
45+
self::S3_LIFECYCLE_TRANSITION => true,
46+
self::S3_OBJECT_ACL_PUT => true,
3147
self::S3_OBJECT_CREATED_ALL => true,
3248
self::S3_OBJECT_CREATED_COMPLETE_MULTIPART_UPLOAD => true,
3349
self::S3_OBJECT_CREATED_COPY => true,
@@ -38,7 +54,11 @@ public static function exists(string $value): bool
3854
self::S3_OBJECT_REMOVED_DELETE_MARKER_CREATED => true,
3955
self::S3_OBJECT_RESTORE_ALL => true,
4056
self::S3_OBJECT_RESTORE_COMPLETED => true,
57+
self::S3_OBJECT_RESTORE_DELETE => true,
4158
self::S3_OBJECT_RESTORE_POST => true,
59+
self::S3_OBJECT_TAGGING_ALL => true,
60+
self::S3_OBJECT_TAGGING_DELETE => true,
61+
self::S3_OBJECT_TAGGING_PUT => true,
4262
self::S3_REDUCED_REDUNDANCY_LOST_OBJECT => true,
4363
self::S3_REPLICATION_ALL => true,
4464
self::S3_REPLICATION_OPERATION_FAILED_REPLICATION => true,

src/Enum/ObjectOwnership.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace AsyncAws\S3\Enum;
4+
5+
final class ObjectOwnership
6+
{
7+
public const BUCKET_OWNER_ENFORCED = 'BucketOwnerEnforced';
8+
public const BUCKET_OWNER_PREFERRED = 'BucketOwnerPreferred';
9+
public const OBJECT_WRITER = 'ObjectWriter';
10+
11+
public static function exists(string $value): bool
12+
{
13+
return isset([
14+
self::BUCKET_OWNER_ENFORCED => true,
15+
self::BUCKET_OWNER_PREFERRED => true,
16+
self::OBJECT_WRITER => true,
17+
][$value]);
18+
}
19+
}

src/Enum/ObjectStorageClass.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ final class ObjectStorageClass
99
{
1010
public const DEEP_ARCHIVE = 'DEEP_ARCHIVE';
1111
public const GLACIER = 'GLACIER';
12+
public const GLACIER_IR = 'GLACIER_IR';
1213
public const INTELLIGENT_TIERING = 'INTELLIGENT_TIERING';
1314
public const ONEZONE_IA = 'ONEZONE_IA';
1415
public const OUTPOSTS = 'OUTPOSTS';
@@ -21,6 +22,7 @@ public static function exists(string $value): bool
2122
return isset([
2223
self::DEEP_ARCHIVE => true,
2324
self::GLACIER => true,
25+
self::GLACIER_IR => true,
2426
self::INTELLIGENT_TIERING => true,
2527
self::ONEZONE_IA => true,
2628
self::OUTPOSTS => true,

src/Enum/StorageClass.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ final class StorageClass
1414
{
1515
public const DEEP_ARCHIVE = 'DEEP_ARCHIVE';
1616
public const GLACIER = 'GLACIER';
17+
public const GLACIER_IR = 'GLACIER_IR';
1718
public const INTELLIGENT_TIERING = 'INTELLIGENT_TIERING';
1819
public const ONEZONE_IA = 'ONEZONE_IA';
1920
public const OUTPOSTS = 'OUTPOSTS';
@@ -26,6 +27,7 @@ public static function exists(string $value): bool
2627
return isset([
2728
self::DEEP_ARCHIVE => true,
2829
self::GLACIER => true,
30+
self::GLACIER_IR => true,
2931
self::INTELLIGENT_TIERING => true,
3032
self::ONEZONE_IA => true,
3133
self::OUTPOSTS => true,

src/Input/CreateBucketRequest.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use AsyncAws\Core\Request;
88
use AsyncAws\Core\Stream\StreamFactory;
99
use AsyncAws\S3\Enum\BucketCannedACL;
10+
use AsyncAws\S3\Enum\ObjectOwnership;
1011
use AsyncAws\S3\ValueObject\CreateBucketConfiguration;
1112

1213
final class CreateBucketRequest extends Input
@@ -76,6 +77,11 @@ final class CreateBucketRequest extends Input
7677
*/
7778
private $objectLockEnabledForBucket;
7879

80+
/**
81+
* @var ObjectOwnership::*|null
82+
*/
83+
private $objectOwnership;
84+
7985
/**
8086
* @param array{
8187
* ACL?: BucketCannedACL::*,
@@ -87,6 +93,7 @@ final class CreateBucketRequest extends Input
8793
* GrantWrite?: string,
8894
* GrantWriteACP?: string,
8995
* ObjectLockEnabledForBucket?: bool,
96+
* ObjectOwnership?: ObjectOwnership::*,
9097
* @region?: string,
9198
* } $input
9299
*/
@@ -101,6 +108,7 @@ public function __construct(array $input = [])
101108
$this->grantWrite = $input['GrantWrite'] ?? null;
102109
$this->grantWriteAcp = $input['GrantWriteACP'] ?? null;
103110
$this->objectLockEnabledForBucket = $input['ObjectLockEnabledForBucket'] ?? null;
111+
$this->objectOwnership = $input['ObjectOwnership'] ?? null;
104112
parent::__construct($input);
105113
}
106114

@@ -157,6 +165,14 @@ public function getObjectLockEnabledForBucket(): ?bool
157165
return $this->objectLockEnabledForBucket;
158166
}
159167

168+
/**
169+
* @return ObjectOwnership::*|null
170+
*/
171+
public function getObjectOwnership(): ?string
172+
{
173+
return $this->objectOwnership;
174+
}
175+
160176
/**
161177
* @internal
162178
*/
@@ -188,6 +204,12 @@ public function request(): Request
188204
if (null !== $this->objectLockEnabledForBucket) {
189205
$headers['x-amz-bucket-object-lock-enabled'] = $this->objectLockEnabledForBucket ? 'true' : 'false';
190206
}
207+
if (null !== $this->objectOwnership) {
208+
if (!ObjectOwnership::exists($this->objectOwnership)) {
209+
throw new InvalidArgument(sprintf('Invalid parameter "ObjectOwnership" for "%s". The value "%s" is not a valid "ObjectOwnership".', __CLASS__, $this->objectOwnership));
210+
}
211+
$headers['x-amz-object-ownership'] = $this->objectOwnership;
212+
}
191213

192214
// Prepare query
193215
$query = [];
@@ -277,6 +299,16 @@ public function setObjectLockEnabledForBucket(?bool $value): self
277299
return $this;
278300
}
279301

302+
/**
303+
* @param ObjectOwnership::*|null $value
304+
*/
305+
public function setObjectOwnership(?string $value): self
306+
{
307+
$this->objectOwnership = $value;
308+
309+
return $this;
310+
}
311+
280312
private function requestBody(\DOMNode $node, \DOMDocument $document): void
281313
{
282314
if (null !== $v = $this->createBucketConfiguration) {

src/Input/PutBucketNotificationConfigurationRequest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,19 @@ final class PutBucketNotificationConfigurationRequest extends Input
3434
*/
3535
private $expectedBucketOwner;
3636

37+
/**
38+
* Skips validation of Amazon SQS, Amazon SNS, and Lambda destinations. True or false value.
39+
*
40+
* @var bool|null
41+
*/
42+
private $skipDestinationValidation;
43+
3744
/**
3845
* @param array{
3946
* Bucket?: string,
4047
* NotificationConfiguration?: NotificationConfiguration|array,
4148
* ExpectedBucketOwner?: string,
49+
* SkipDestinationValidation?: bool,
4250
* @region?: string,
4351
* } $input
4452
*/
@@ -47,6 +55,7 @@ public function __construct(array $input = [])
4755
$this->bucket = $input['Bucket'] ?? null;
4856
$this->notificationConfiguration = isset($input['NotificationConfiguration']) ? NotificationConfiguration::create($input['NotificationConfiguration']) : null;
4957
$this->expectedBucketOwner = $input['ExpectedBucketOwner'] ?? null;
58+
$this->skipDestinationValidation = $input['SkipDestinationValidation'] ?? null;
5059
parent::__construct($input);
5160
}
5261

@@ -70,6 +79,11 @@ public function getNotificationConfiguration(): ?NotificationConfiguration
7079
return $this->notificationConfiguration;
7180
}
7281

82+
public function getSkipDestinationValidation(): ?bool
83+
{
84+
return $this->skipDestinationValidation;
85+
}
86+
7387
/**
7488
* @internal
7589
*/
@@ -80,6 +94,9 @@ public function request(): Request
8094
if (null !== $this->expectedBucketOwner) {
8195
$headers['x-amz-expected-bucket-owner'] = $this->expectedBucketOwner;
8296
}
97+
if (null !== $this->skipDestinationValidation) {
98+
$headers['x-amz-skip-destination-validation'] = $this->skipDestinationValidation ? 'true' : 'false';
99+
}
83100

84101
// Prepare query
85102
$query = [];
@@ -124,6 +141,13 @@ public function setNotificationConfiguration(?NotificationConfiguration $value):
124141
return $this;
125142
}
126143

144+
public function setSkipDestinationValidation(?bool $value): self
145+
{
146+
$this->skipDestinationValidation = $value;
147+
148+
return $this;
149+
}
150+
127151
private function requestBody(\DOMNode $node, \DOMDocument $document): void
128152
{
129153
if (null === $v = $this->notificationConfiguration) {

src/S3Client.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use AsyncAws\S3\Enum\ObjectCannedACL;
1515
use AsyncAws\S3\Enum\ObjectLockLegalHoldStatus;
1616
use AsyncAws\S3\Enum\ObjectLockMode;
17+
use AsyncAws\S3\Enum\ObjectOwnership;
1718
use AsyncAws\S3\Enum\RequestPayer;
1819
use AsyncAws\S3\Enum\ServerSideEncryption;
1920
use AsyncAws\S3\Enum\StorageClass;
@@ -256,6 +257,7 @@ public function copyObject($input): CopyObjectOutput
256257
* GrantWrite?: string,
257258
* GrantWriteACP?: string,
258259
* ObjectLockEnabledForBucket?: bool,
260+
* ObjectOwnership?: ObjectOwnership::*,
259261
* @region?: string,
260262
* }|CreateBucketRequest $input
261263
*
@@ -752,6 +754,7 @@ public function putBucketCors($input): Result
752754
* Bucket: string,
753755
* NotificationConfiguration: NotificationConfiguration|array,
754756
* ExpectedBucketOwner?: string,
757+
* SkipDestinationValidation?: bool,
755758
* @region?: string,
756759
* }|PutBucketNotificationConfigurationRequest $input
757760
*/
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace AsyncAws\S3\ValueObject;
4+
5+
/**
6+
* Enables delivery of events to Amazon EventBridge.
7+
*/
8+
final class EventBridgeConfiguration
9+
{
10+
public static function create($input): self
11+
{
12+
return $input instanceof self ? $input : new self();
13+
}
14+
15+
/**
16+
* @internal
17+
*/
18+
public function requestBody(\DOMElement $node, \DOMDocument $document): void
19+
{
20+
}
21+
}

src/ValueObject/NotificationConfiguration.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,37 @@ final class NotificationConfiguration
1919
*/
2020
private $lambdaFunctionConfigurations;
2121

22+
/**
23+
* Enables delivery of events to Amazon EventBridge.
24+
*/
25+
private $eventBridgeConfiguration;
26+
2227
/**
2328
* @param array{
2429
* TopicConfigurations?: null|TopicConfiguration[],
2530
* QueueConfigurations?: null|QueueConfiguration[],
2631
* LambdaFunctionConfigurations?: null|LambdaFunctionConfiguration[],
32+
* EventBridgeConfiguration?: null|EventBridgeConfiguration|array,
2733
* } $input
2834
*/
2935
public function __construct(array $input)
3036
{
3137
$this->topicConfigurations = isset($input['TopicConfigurations']) ? array_map([TopicConfiguration::class, 'create'], $input['TopicConfigurations']) : null;
3238
$this->queueConfigurations = isset($input['QueueConfigurations']) ? array_map([QueueConfiguration::class, 'create'], $input['QueueConfigurations']) : null;
3339
$this->lambdaFunctionConfigurations = isset($input['LambdaFunctionConfigurations']) ? array_map([LambdaFunctionConfiguration::class, 'create'], $input['LambdaFunctionConfigurations']) : null;
40+
$this->eventBridgeConfiguration = isset($input['EventBridgeConfiguration']) ? EventBridgeConfiguration::create($input['EventBridgeConfiguration']) : null;
3441
}
3542

3643
public static function create($input): self
3744
{
3845
return $input instanceof self ? $input : new self($input);
3946
}
4047

48+
public function getEventBridgeConfiguration(): ?EventBridgeConfiguration
49+
{
50+
return $this->eventBridgeConfiguration;
51+
}
52+
4153
/**
4254
* @return LambdaFunctionConfiguration[]
4355
*/
@@ -88,5 +100,10 @@ public function requestBody(\DOMElement $node, \DOMDocument $document): void
88100
$item->requestBody($child, $document);
89101
}
90102
}
103+
if (null !== $v = $this->eventBridgeConfiguration) {
104+
$node->appendChild($child = $document->createElement('EventBridgeConfiguration'));
105+
106+
$v->requestBody($child, $document);
107+
}
91108
}
92109
}

0 commit comments

Comments
 (0)