Skip to content

Commit

Permalink
update generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
async-aws-bot committed Oct 17, 2024
1 parent 056eee3 commit 2dbeab5
Show file tree
Hide file tree
Showing 11 changed files with 168 additions and 83 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"variables": {
"${LATEST}": "3.324.3"
"${LATEST}": "3.324.4"
},
"endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json",
"services": {
Expand Down
4 changes: 4 additions & 0 deletions src/Service/S3/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## NOT RELEASED

### Added

- 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.

## 2.4.0

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/Service/S3/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "2.4-dev"
"dev-master": "2.5-dev"
}
}
}
18 changes: 10 additions & 8 deletions src/Service/S3/src/Input/CopyObjectRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ final class CopyObjectRequest extends Input
* server-side encryption [^2] in the *Amazon S3 User Guide*. For more information about the encryption overriding
* behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads [^3].
* - To encrypt new object copies to a directory bucket with SSE-KMS, we recommend you specify SSE-KMS as the directory
* bucket's default encryption configuration with a KMS key (specifically, a customer managed key [^4]). Amazon Web
* Services managed key [^5] (`aws/s3`) isn't supported. Your SSE-KMS configuration can only support 1 customer
* bucket's default encryption configuration with a KMS key (specifically, a customer managed key [^4]). The Amazon
* Web Services managed key [^5] (`aws/s3`) isn't supported. Your SSE-KMS configuration can only support 1 customer
* managed key [^6] per directory bucket for the lifetime of the bucket. After you specify a customer managed key for
* SSE-KMS, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you perform
* a `CopyObject` operation and want to specify server-side encryption settings for new object copies with SSE-KMS in
Expand Down Expand Up @@ -505,12 +505,14 @@ final class CopyObjectRequest extends Input
* any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature
* Version in Request Authentication [^1] in the *Amazon S3 User Guide*.
*
* **Directory buckets** - If you specify `x-amz-server-side-encryption` with `aws:kms`, you must specify the `
* x-amz-server-side-encryption-aws-kms-key-id` header with the ID (Key ID or Key ARN) of the KMS symmetric encryption
* customer managed key to use. Otherwise, you get an HTTP `400 Bad Request` error. Only use the key ID or key ARN. The
* key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key
* [^2] per directory bucket for the lifetime of the bucket. Amazon Web Services managed key [^3] (`aws/s3`) isn't
* supported.
* **Directory buckets** - If you specify `x-amz-server-side-encryption` with `aws:kms`, the `
* x-amz-server-side-encryption-aws-kms-key-id` header is implicitly assigned the ID of the KMS symmetric encryption
* customer managed key that's configured for your directory bucket's default encryption setting. If you want to specify
* the ` x-amz-server-side-encryption-aws-kms-key-id` header explicitly, you can only specify it with the ID (Key ID or
* Key ARN) of the KMS customer managed key that's configured for your directory bucket's default encryption setting.
* Otherwise, you get an HTTP `400 Bad Request` error. Only use the key ID or key ARN. The key alias format of the KMS
* key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key [^2] per directory bucket for
* the lifetime of the bucket. The Amazon Web Services managed key [^3] (`aws/s3`) isn't supported.
*
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version
* [^2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
Expand Down
14 changes: 8 additions & 6 deletions src/Service/S3/src/Input/CreateMultipartUploadRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -416,12 +416,14 @@ final class CreateMultipartUploadRequest extends Input
* `x-amz-server-side-encryption-aws-kms-key-id`, Amazon S3 uses the Amazon Web Services managed key (`aws/s3`) to
* protect the data.
*
* **Directory buckets** - If you specify `x-amz-server-side-encryption` with `aws:kms`, you must specify the `
* x-amz-server-side-encryption-aws-kms-key-id` header with the ID (Key ID or Key ARN) of the KMS symmetric encryption
* customer managed key to use. Otherwise, you get an HTTP `400 Bad Request` error. Only use the key ID or key ARN. The
* key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key
* [^1] per directory bucket for the lifetime of the bucket. Amazon Web Services managed key [^2] (`aws/s3`) isn't
* supported.
* **Directory buckets** - If you specify `x-amz-server-side-encryption` with `aws:kms`, the `
* x-amz-server-side-encryption-aws-kms-key-id` header is implicitly assigned the ID of the KMS symmetric encryption
* customer managed key that's configured for your directory bucket's default encryption setting. If you want to specify
* the ` x-amz-server-side-encryption-aws-kms-key-id` header explicitly, you can only specify it with the ID (Key ID or
* Key ARN) of the KMS customer managed key that's configured for your directory bucket's default encryption setting.
* Otherwise, you get an HTTP `400 Bad Request` error. Only use the key ID or key ARN. The key alias format of the KMS
* key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key [^1] per directory bucket for
* the lifetime of the bucket. The Amazon Web Services managed key [^2] (`aws/s3`) isn't supported.
*
* [^1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
* [^2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
Expand Down
59 changes: 59 additions & 0 deletions src/Service/S3/src/Input/ListBucketsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,53 @@ final class ListBucketsRequest extends Input
*/
private $continuationToken;

/**
* Limits the response to bucket names that begin with the specified bucket name prefix.
*
* @var string|null
*/
private $prefix;

/**
* Limits the response to buckets that are located in the specified Amazon Web Services Region. The Amazon Web Services
* Region must be expressed according to the Amazon Web Services Region code, such as `us-west-2` for the US West
* (Oregon) Region. For a list of the valid values for all of the Amazon Web Services Regions, see Regions and Endpoints
* [^1].
*
* > Requests made to a Regional endpoint that is different from the `bucket-region` parameter are not supported. For
* > example, if you want to limit the response to your buckets in Region `us-west-2`, the request must be made to an
* > endpoint in Region `us-west-2`.
*
* [^1]: https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
*
* @var string|null
*/
private $bucketRegion;

/**
* @param array{
* MaxBuckets?: null|int,
* ContinuationToken?: null|string,
* Prefix?: null|string,
* BucketRegion?: null|string,
* '@region'?: string|null,
* } $input
*/
public function __construct(array $input = [])
{
$this->maxBuckets = $input['MaxBuckets'] ?? null;
$this->continuationToken = $input['ContinuationToken'] ?? null;
$this->prefix = $input['Prefix'] ?? null;
$this->bucketRegion = $input['BucketRegion'] ?? null;
parent::__construct($input);
}

/**
* @param array{
* MaxBuckets?: null|int,
* ContinuationToken?: null|string,
* Prefix?: null|string,
* BucketRegion?: null|string,
* '@region'?: string|null,
* }|ListBucketsRequest $input
*/
Expand All @@ -55,6 +84,11 @@ public static function create($input): self
return $input instanceof self ? $input : new self($input);
}

public function getBucketRegion(): ?string
{
return $this->bucketRegion;
}

public function getContinuationToken(): ?string
{
return $this->continuationToken;
Expand All @@ -65,6 +99,11 @@ public function getMaxBuckets(): ?int
return $this->maxBuckets;
}

public function getPrefix(): ?string
{
return $this->prefix;
}

/**
* @internal
*/
Expand All @@ -81,6 +120,12 @@ public function request(): Request
if (null !== $this->continuationToken) {
$query['continuation-token'] = $this->continuationToken;
}
if (null !== $this->prefix) {
$query['prefix'] = $this->prefix;
}
if (null !== $this->bucketRegion) {
$query['bucket-region'] = $this->bucketRegion;
}

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

public function setBucketRegion(?string $value): self
{
$this->bucketRegion = $value;

return $this;
}

public function setContinuationToken(?string $value): self
{
$this->continuationToken = $value;
Expand All @@ -105,4 +157,11 @@ public function setMaxBuckets(?int $value): self

return $this;
}

public function setPrefix(?string $value): self
{
$this->prefix = $value;

return $this;
}
}
31 changes: 19 additions & 12 deletions src/Service/S3/src/Input/PutObjectRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,14 @@ final class PutObjectRequest extends Input
* optional, we recommend using the Content-MD5 mechanism as an end-to-end integrity check. For more information about
* REST request authentication, see REST Authentication [^1].
*
* > The `Content-MD5` header is required for any request to upload an object with a retention period configured using
* > Amazon S3 Object Lock. For more information about Amazon S3 Object Lock, see Amazon S3 Object Lock Overview [^2] in
* > the *Amazon S3 User Guide*.
* > The `Content-MD5` or `x-amz-sdk-checksum-algorithm` header is required for any request to upload an object with a
* > retention period configured using Amazon S3 Object Lock. For more information, see Uploading objects to an Object
* > Lock enabled bucket [^2] in the *Amazon S3 User Guide*.
*
* > This functionality is not supported for directory buckets.
*
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html
* [^2]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html
* [^2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-managing.html#object-lock-put-object
*
* @var string|null
*/
Expand Down Expand Up @@ -183,10 +183,15 @@ final class PutObjectRequest extends Input
* algorithm you set through `x-amz-sdk-checksum-algorithm`, Amazon S3 ignores any provided `ChecksumAlgorithm`
* parameter and uses the checksum algorithm that matches the provided value in `x-amz-checksum-*algorithm*`.
*
* > For directory buckets, when you use Amazon Web Services SDKs, `CRC32` is the default checksum algorithm that's used
* > for performance.
* > The `Content-MD5` or `x-amz-sdk-checksum-algorithm` header is required for any request to upload an object with a
* > retention period configured using Amazon S3 Object Lock. For more information, see Uploading objects to an Object
* > Lock enabled bucket [^2] in the *Amazon S3 User Guide*.
*
* For directory buckets, when you use Amazon Web Services SDKs, `CRC32` is the default checksum algorithm that's used
* for performance.
*
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
* [^2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock-managing.html#object-lock-put-object
*
* @var ChecksumAlgorithm::*|null
*/
Expand Down Expand Up @@ -452,12 +457,14 @@ final class PutObjectRequest extends Input
* `x-amz-server-side-encryption-aws-kms-key-id`, Amazon S3 uses the Amazon Web Services managed key (`aws/s3`) to
* protect the data.
*
* **Directory buckets** - If you specify `x-amz-server-side-encryption` with `aws:kms`, you must specify the `
* x-amz-server-side-encryption-aws-kms-key-id` header with the ID (Key ID or Key ARN) of the KMS symmetric encryption
* customer managed key to use. Otherwise, you get an HTTP `400 Bad Request` error. Only use the key ID or key ARN. The
* key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key
* [^1] per directory bucket for the lifetime of the bucket. Amazon Web Services managed key [^2] (`aws/s3`) isn't
* supported.
* **Directory buckets** - If you specify `x-amz-server-side-encryption` with `aws:kms`, the `
* x-amz-server-side-encryption-aws-kms-key-id` header is implicitly assigned the ID of the KMS symmetric encryption
* customer managed key that's configured for your directory bucket's default encryption setting. If you want to specify
* the ` x-amz-server-side-encryption-aws-kms-key-id` header explicitly, you can only specify it with the ID (Key ID or
* Key ARN) of the KMS customer managed key that's configured for your directory bucket's default encryption setting.
* Otherwise, you get an HTTP `400 Bad Request` error. Only use the key ID or key ARN. The key alias format of the KMS
* key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key [^1] per directory bucket for
* the lifetime of the bucket. The Amazon Web Services managed key [^2] (`aws/s3`) isn't supported.
*
* [^1]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
* [^2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
Expand Down
18 changes: 18 additions & 0 deletions src/Service/S3/src/Result/ListBucketsOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ class ListBucketsOutput extends Result implements \IteratorAggregate
*/
private $continuationToken;

/**
* If `Prefix` was sent with the request, it is included in the response.
*
* All bucket names in the response begin with the specified bucket name prefix.
*
* @var string|null
*/
private $prefix;

/**
* @param bool $currentPageOnly When true, iterates over items of the current page. Otherwise also fetch items in the next pages.
*
Expand Down Expand Up @@ -106,6 +115,13 @@ public function getOwner(): ?Owner
return $this->owner;
}

public function getPrefix(): ?string
{
$this->initialize();

return $this->prefix;
}

protected function populateResult(Response $response): void
{
$data = new \SimpleXMLElement($response->getContent());
Expand All @@ -115,6 +131,7 @@ protected function populateResult(Response $response): void
'ID' => ($v = $data->Owner->ID) ? (string) $v : null,
]);
$this->continuationToken = ($v = $data->ContinuationToken) ? (string) $v : null;
$this->prefix = ($v = $data->Prefix) ? (string) $v : null;
}

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

Expand Down
Loading

0 comments on commit 2dbeab5

Please sign in to comment.