Skip to content

Commit 3b8e314

Browse files
Update generated code (#1782)
update generated code
1 parent 056eee3 commit 3b8e314

File tree

11 files changed

+168
-83
lines changed

11 files changed

+168
-83
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"variables": {
3-
"${LATEST}": "3.324.3"
3+
"${LATEST}": "3.324.5"
44
},
55
"endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json",
66
"services": {

src/Service/S3/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: Add support for the new optional bucket-region and prefix query parameters in the ListBuckets API. For ListBuckets requests that express pagination, Amazon S3 will now return both the bucket names and associated AWS regions in the response.
8+
59
## 2.4.0
610

711
### Added

src/Service/S3/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"extra": {
3232
"branch-alias": {
33-
"dev-master": "2.4-dev"
33+
"dev-master": "2.5-dev"
3434
}
3535
}
3636
}

src/Service/S3/src/Input/CopyObjectRequest.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,8 @@ final class CopyObjectRequest extends Input
401401
* server-side encryption [^2] in the *Amazon S3 User Guide*. For more information about the encryption overriding
402402
* behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads [^3].
403403
* - To encrypt new object copies to a directory bucket with SSE-KMS, we recommend you specify SSE-KMS as the directory
404-
* bucket's default encryption configuration with a KMS key (specifically, a customer managed key [^4]). Amazon Web
405-
* Services managed key [^5] (`aws/s3`) isn't supported. Your SSE-KMS configuration can only support 1 customer
404+
* bucket's default encryption configuration with a KMS key (specifically, a customer managed key [^4]). The Amazon
405+
* Web Services managed key [^5] (`aws/s3`) isn't supported. Your SSE-KMS configuration can only support 1 customer
406406
* managed key [^6] per directory bucket for the lifetime of the bucket. After you specify a customer managed key for
407407
* SSE-KMS, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you perform
408408
* a `CopyObject` operation and want to specify server-side encryption settings for new object copies with SSE-KMS in
@@ -505,12 +505,14 @@ final class CopyObjectRequest extends Input
505505
* any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature
506506
* Version in Request Authentication [^1] in the *Amazon S3 User Guide*.
507507
*
508-
* **Directory buckets** - If you specify `x-amz-server-side-encryption` with `aws:kms`, you must specify the `
509-
* x-amz-server-side-encryption-aws-kms-key-id` header with the ID (Key ID or Key ARN) of the KMS symmetric encryption
510-
* customer managed key to use. Otherwise, you get an HTTP `400 Bad Request` error. Only use the key ID or key ARN. The
511-
* key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key
512-
* [^2] per directory bucket for the lifetime of the bucket. Amazon Web Services managed key [^3] (`aws/s3`) isn't
513-
* supported.
508+
* **Directory buckets** - If you specify `x-amz-server-side-encryption` with `aws:kms`, the `
509+
* x-amz-server-side-encryption-aws-kms-key-id` header is implicitly assigned the ID of the KMS symmetric encryption
510+
* customer managed key that's configured for your directory bucket's default encryption setting. If you want to specify
511+
* the ` x-amz-server-side-encryption-aws-kms-key-id` header explicitly, you can only specify it with the ID (Key ID or
512+
* Key ARN) of the KMS customer managed key that's configured for your directory bucket's default encryption setting.
513+
* Otherwise, you get an HTTP `400 Bad Request` error. Only use the key ID or key ARN. The key alias format of the KMS
514+
* key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key [^2] per directory bucket for
515+
* the lifetime of the bucket. The Amazon Web Services managed key [^3] (`aws/s3`) isn't supported.
514516
*
515517
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version
516518
* [^2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk

src/Service/S3/src/Input/CreateMultipartUploadRequest.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -416,12 +416,14 @@ final class CreateMultipartUploadRequest extends Input
416416
* `x-amz-server-side-encryption-aws-kms-key-id`, Amazon S3 uses the Amazon Web Services managed key (`aws/s3`) to
417417
* protect the data.
418418
*
419-
* **Directory buckets** - If you specify `x-amz-server-side-encryption` with `aws:kms`, you must specify the `
420-
* x-amz-server-side-encryption-aws-kms-key-id` header with the ID (Key ID or Key ARN) of the KMS symmetric encryption
421-
* customer managed key to use. Otherwise, you get an HTTP `400 Bad Request` error. Only use the key ID or key ARN. The
422-
* key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key
423-
* [^1] per directory bucket for the lifetime of the bucket. Amazon Web Services managed key [^2] (`aws/s3`) isn't
424-
* supported.
419+
* **Directory buckets** - If you specify `x-amz-server-side-encryption` with `aws:kms`, the `
420+
* x-amz-server-side-encryption-aws-kms-key-id` header is implicitly assigned the ID of the KMS symmetric encryption
421+
* customer managed key that's configured for your directory bucket's default encryption setting. If you want to specify
422+
* the ` x-amz-server-side-encryption-aws-kms-key-id` header explicitly, you can only specify it with the ID (Key ID or
423+
* Key ARN) of the KMS customer managed key that's configured for your directory bucket's default encryption setting.
424+
* Otherwise, you get an HTTP `400 Bad Request` error. Only use the key ID or key ARN. The key alias format of the KMS
425+
* key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key [^1] per directory bucket for
426+
* the lifetime of the bucket. The Amazon Web Services managed key [^2] (`aws/s3`) isn't supported.
425427
*
426428
* [^1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
427429
* [^2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk

src/Service/S3/src/Input/ListBucketsRequest.php

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,53 @@ final class ListBucketsRequest extends Input
2929
*/
3030
private $continuationToken;
3131

32+
/**
33+
* Limits the response to bucket names that begin with the specified bucket name prefix.
34+
*
35+
* @var string|null
36+
*/
37+
private $prefix;
38+
39+
/**
40+
* Limits the response to buckets that are located in the specified Amazon Web Services Region. The Amazon Web Services
41+
* Region must be expressed according to the Amazon Web Services Region code, such as `us-west-2` for the US West
42+
* (Oregon) Region. For a list of the valid values for all of the Amazon Web Services Regions, see Regions and Endpoints
43+
* [^1].
44+
*
45+
* > Requests made to a Regional endpoint that is different from the `bucket-region` parameter are not supported. For
46+
* > example, if you want to limit the response to your buckets in Region `us-west-2`, the request must be made to an
47+
* > endpoint in Region `us-west-2`.
48+
*
49+
* [^1]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
50+
*
51+
* @var string|null
52+
*/
53+
private $bucketRegion;
54+
3255
/**
3356
* @param array{
3457
* MaxBuckets?: null|int,
3558
* ContinuationToken?: null|string,
59+
* Prefix?: null|string,
60+
* BucketRegion?: null|string,
3661
* '@region'?: string|null,
3762
* } $input
3863
*/
3964
public function __construct(array $input = [])
4065
{
4166
$this->maxBuckets = $input['MaxBuckets'] ?? null;
4267
$this->continuationToken = $input['ContinuationToken'] ?? null;
68+
$this->prefix = $input['Prefix'] ?? null;
69+
$this->bucketRegion = $input['BucketRegion'] ?? null;
4370
parent::__construct($input);
4471
}
4572

4673
/**
4774
* @param array{
4875
* MaxBuckets?: null|int,
4976
* ContinuationToken?: null|string,
77+
* Prefix?: null|string,
78+
* BucketRegion?: null|string,
5079
* '@region'?: string|null,
5180
* }|ListBucketsRequest $input
5281
*/
@@ -55,6 +84,11 @@ public static function create($input): self
5584
return $input instanceof self ? $input : new self($input);
5685
}
5786

87+
public function getBucketRegion(): ?string
88+
{
89+
return $this->bucketRegion;
90+
}
91+
5892
public function getContinuationToken(): ?string
5993
{
6094
return $this->continuationToken;
@@ -65,6 +99,11 @@ public function getMaxBuckets(): ?int
6599
return $this->maxBuckets;
66100
}
67101

102+
public function getPrefix(): ?string
103+
{
104+
return $this->prefix;
105+
}
106+
68107
/**
69108
* @internal
70109
*/
@@ -81,6 +120,12 @@ public function request(): Request
81120
if (null !== $this->continuationToken) {
82121
$query['continuation-token'] = $this->continuationToken;
83122
}
123+
if (null !== $this->prefix) {
124+
$query['prefix'] = $this->prefix;
125+
}
126+
if (null !== $this->bucketRegion) {
127+
$query['bucket-region'] = $this->bucketRegion;
128+
}
84129

85130
// Prepare URI
86131
$uriString = '/';
@@ -92,6 +137,13 @@ public function request(): Request
92137
return new Request('GET', $uriString, $query, $headers, StreamFactory::create($body));
93138
}
94139

140+
public function setBucketRegion(?string $value): self
141+
{
142+
$this->bucketRegion = $value;
143+
144+
return $this;
145+
}
146+
95147
public function setContinuationToken(?string $value): self
96148
{
97149
$this->continuationToken = $value;
@@ -105,4 +157,11 @@ public function setMaxBuckets(?int $value): self
105157

106158
return $this;
107159
}
160+
161+
public function setPrefix(?string $value): self
162+
{
163+
$this->prefix = $value;
164+
165+
return $this;
166+
}
108167
}

src/Service/S3/src/Input/PutObjectRequest.php

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ final class PutObjectRequest extends Input
140140
* optional, we recommend using the Content-MD5 mechanism as an end-to-end integrity check. For more information about
141141
* REST request authentication, see REST Authentication [^1].
142142
*
143-
* > The `Content-MD5` header is required for any request to upload an object with a retention period configured using
144-
* > Amazon S3 Object Lock. For more information about Amazon S3 Object Lock, see Amazon S3 Object Lock Overview [^2] in
145-
* > the *Amazon S3 User Guide*.
143+
* > The `Content-MD5` or `x-amz-sdk-checksum-algorithm` header is required for any request to upload an object with a
144+
* > retention period configured using Amazon S3 Object Lock. For more information, see Uploading objects to an Object
145+
* > Lock enabled bucket [^2] in the *Amazon S3 User Guide*.
146146
*
147147
* > This functionality is not supported for directory buckets.
148148
*
149149
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html
150-
* [^2]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html
150+
* [^2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-managing.html#object-lock-put-object
151151
*
152152
* @var string|null
153153
*/
@@ -183,10 +183,15 @@ final class PutObjectRequest extends Input
183183
* algorithm you set through `x-amz-sdk-checksum-algorithm`, Amazon S3 ignores any provided `ChecksumAlgorithm`
184184
* parameter and uses the checksum algorithm that matches the provided value in `x-amz-checksum-*algorithm*`.
185185
*
186-
* > For directory buckets, when you use Amazon Web Services SDKs, `CRC32` is the default checksum algorithm that's used
187-
* > for performance.
186+
* > The `Content-MD5` or `x-amz-sdk-checksum-algorithm` header is required for any request to upload an object with a
187+
* > retention period configured using Amazon S3 Object Lock. For more information, see Uploading objects to an Object
188+
* > Lock enabled bucket [^2] in the *Amazon S3 User Guide*.
189+
*
190+
* For directory buckets, when you use Amazon Web Services SDKs, `CRC32` is the default checksum algorithm that's used
191+
* for performance.
188192
*
189193
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
194+
* [^2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-managing.html#object-lock-put-object
190195
*
191196
* @var ChecksumAlgorithm::*|null
192197
*/
@@ -452,12 +457,14 @@ final class PutObjectRequest extends Input
452457
* `x-amz-server-side-encryption-aws-kms-key-id`, Amazon S3 uses the Amazon Web Services managed key (`aws/s3`) to
453458
* protect the data.
454459
*
455-
* **Directory buckets** - If you specify `x-amz-server-side-encryption` with `aws:kms`, you must specify the `
456-
* x-amz-server-side-encryption-aws-kms-key-id` header with the ID (Key ID or Key ARN) of the KMS symmetric encryption
457-
* customer managed key to use. Otherwise, you get an HTTP `400 Bad Request` error. Only use the key ID or key ARN. The
458-
* key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key
459-
* [^1] per directory bucket for the lifetime of the bucket. Amazon Web Services managed key [^2] (`aws/s3`) isn't
460-
* supported.
460+
* **Directory buckets** - If you specify `x-amz-server-side-encryption` with `aws:kms`, the `
461+
* x-amz-server-side-encryption-aws-kms-key-id` header is implicitly assigned the ID of the KMS symmetric encryption
462+
* customer managed key that's configured for your directory bucket's default encryption setting. If you want to specify
463+
* the ` x-amz-server-side-encryption-aws-kms-key-id` header explicitly, you can only specify it with the ID (Key ID or
464+
* Key ARN) of the KMS customer managed key that's configured for your directory bucket's default encryption setting.
465+
* Otherwise, you get an HTTP `400 Bad Request` error. Only use the key ID or key ARN. The key alias format of the KMS
466+
* key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key [^1] per directory bucket for
467+
* the lifetime of the bucket. The Amazon Web Services managed key [^2] (`aws/s3`) isn't supported.
461468
*
462469
* [^1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
463470
* [^2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk

src/Service/S3/src/Result/ListBucketsOutput.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ class ListBucketsOutput extends Result implements \IteratorAggregate
3838
*/
3939
private $continuationToken;
4040

41+
/**
42+
* If `Prefix` was sent with the request, it is included in the response.
43+
*
44+
* All bucket names in the response begin with the specified bucket name prefix.
45+
*
46+
* @var string|null
47+
*/
48+
private $prefix;
49+
4150
/**
4251
* @param bool $currentPageOnly When true, iterates over items of the current page. Otherwise also fetch items in the next pages.
4352
*
@@ -106,6 +115,13 @@ public function getOwner(): ?Owner
106115
return $this->owner;
107116
}
108117

118+
public function getPrefix(): ?string
119+
{
120+
$this->initialize();
121+
122+
return $this->prefix;
123+
}
124+
109125
protected function populateResult(Response $response): void
110126
{
111127
$data = new \SimpleXMLElement($response->getContent());
@@ -115,6 +131,7 @@ protected function populateResult(Response $response): void
115131
'ID' => ($v = $data->Owner->ID) ? (string) $v : null,
116132
]);
117133
$this->continuationToken = ($v = $data->ContinuationToken) ? (string) $v : null;
134+
$this->prefix = ($v = $data->Prefix) ? (string) $v : null;
118135
}
119136

120137
/**
@@ -127,6 +144,7 @@ private function populateResultBuckets(\SimpleXMLElement $xml): array
127144
$items[] = new Bucket([
128145
'Name' => ($v = $item->Name) ? (string) $v : null,
129146
'CreationDate' => ($v = $item->CreationDate) ? new \DateTimeImmutable((string) $v) : null,
147+
'BucketRegion' => ($v = $item->BucketRegion) ? (string) $v : null,
130148
]);
131149
}
132150

0 commit comments

Comments
 (0)