From 3b8e314086abf139ca8a0d5cef005d7452dd02fe Mon Sep 17 00:00:00 2001 From: AsyncAws <61784373+async-aws-bot@users.noreply.github.com> Date: Fri, 18 Oct 2024 01:09:29 -0700 Subject: [PATCH] Update generated code (#1782) update generated code --- manifest.json | 2 +- src/Service/S3/CHANGELOG.md | 4 + src/Service/S3/composer.json | 2 +- .../S3/src/Input/CopyObjectRequest.php | 18 ++-- .../Input/CreateMultipartUploadRequest.php | 14 +-- .../S3/src/Input/ListBucketsRequest.php | 59 +++++++++++++ src/Service/S3/src/Input/PutObjectRequest.php | 31 ++++--- .../S3/src/Result/ListBucketsOutput.php | 18 ++++ src/Service/S3/src/S3Client.php | 85 +++++++------------ src/Service/S3/src/ValueObject/Bucket.php | 16 ++++ .../ServerSideEncryptionByDefault.php | 2 +- 11 files changed, 168 insertions(+), 83 deletions(-) diff --git a/manifest.json b/manifest.json index 6e3d212be..de4371809 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "variables": { - "${LATEST}": "3.324.3" + "${LATEST}": "3.324.5" }, "endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json", "services": { diff --git a/src/Service/S3/CHANGELOG.md b/src/Service/S3/CHANGELOG.md index f2bb7217d..6d3731958 100644 --- a/src/Service/S3/CHANGELOG.md +++ b/src/Service/S3/CHANGELOG.md @@ -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 diff --git a/src/Service/S3/composer.json b/src/Service/S3/composer.json index fc4f92c16..f08e84c7a 100644 --- a/src/Service/S3/composer.json +++ b/src/Service/S3/composer.json @@ -30,7 +30,7 @@ }, "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.5-dev" } } } diff --git a/src/Service/S3/src/Input/CopyObjectRequest.php b/src/Service/S3/src/Input/CopyObjectRequest.php index 1ee862f23..c0017df51 100644 --- a/src/Service/S3/src/Input/CopyObjectRequest.php +++ b/src/Service/S3/src/Input/CopyObjectRequest.php @@ -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 @@ -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 diff --git a/src/Service/S3/src/Input/CreateMultipartUploadRequest.php b/src/Service/S3/src/Input/CreateMultipartUploadRequest.php index d5e82076d..443f97161 100644 --- a/src/Service/S3/src/Input/CreateMultipartUploadRequest.php +++ b/src/Service/S3/src/Input/CreateMultipartUploadRequest.php @@ -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 diff --git a/src/Service/S3/src/Input/ListBucketsRequest.php b/src/Service/S3/src/Input/ListBucketsRequest.php index 5b66449f6..09e6418de 100644 --- a/src/Service/S3/src/Input/ListBucketsRequest.php +++ b/src/Service/S3/src/Input/ListBucketsRequest.php @@ -29,10 +29,35 @@ 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 */ @@ -40,6 +65,8 @@ 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); } @@ -47,6 +74,8 @@ public function __construct(array $input = []) * @param array{ * MaxBuckets?: null|int, * ContinuationToken?: null|string, + * Prefix?: null|string, + * BucketRegion?: null|string, * '@region'?: string|null, * }|ListBucketsRequest $input */ @@ -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; @@ -65,6 +99,11 @@ public function getMaxBuckets(): ?int return $this->maxBuckets; } + public function getPrefix(): ?string + { + return $this->prefix; + } + /** * @internal */ @@ -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 = '/'; @@ -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; @@ -105,4 +157,11 @@ public function setMaxBuckets(?int $value): self return $this; } + + public function setPrefix(?string $value): self + { + $this->prefix = $value; + + return $this; + } } diff --git a/src/Service/S3/src/Input/PutObjectRequest.php b/src/Service/S3/src/Input/PutObjectRequest.php index d0f6acf6f..99e4489c2 100644 --- a/src/Service/S3/src/Input/PutObjectRequest.php +++ b/src/Service/S3/src/Input/PutObjectRequest.php @@ -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 */ @@ -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 */ @@ -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 diff --git a/src/Service/S3/src/Result/ListBucketsOutput.php b/src/Service/S3/src/Result/ListBucketsOutput.php index 01542e8e9..4bf0465b3 100644 --- a/src/Service/S3/src/Result/ListBucketsOutput.php +++ b/src/Service/S3/src/Result/ListBucketsOutput.php @@ -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. * @@ -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()); @@ -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; } /** @@ -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, ]); } diff --git a/src/Service/S3/src/S3Client.php b/src/Service/S3/src/S3Client.php index 2b48d432f..b33e6d061 100644 --- a/src/Service/S3/src/S3Client.php +++ b/src/Service/S3/src/S3Client.php @@ -975,45 +975,25 @@ public function deleteBucketCors($input): Result } /** - * Removes an object from a bucket. The behavior depends on the bucket's versioning state: - * - * - If bucket versioning is not enabled, the operation permanently deletes the object. - * - If bucket versioning is enabled, the operation inserts a delete marker, which becomes the current version of the - * object. To permanently delete an object in a versioned bucket, you must include the object’s `versionId` in the - * request. For more information about versioning-enabled buckets, see Deleting object versions from a - * versioning-enabled bucket [^1]. - * - If bucket versioning is suspended, the operation removes the object that has a null `versionId`, if there is one, - * and inserts a delete marker that becomes the current version of the object. If there isn't an object with a null - * `versionId`, and all versions of the object have a `versionId`, Amazon S3 does not remove the object and only - * inserts a delete marker. To permanently delete an object that has a `versionId`, you must include the object’s - * `versionId` in the request. For more information about versioning-suspended buckets, see Deleting objects from - * versioning-suspended buckets [^2]. - * - * > - **Directory buckets** - S3 Versioning isn't enabled and supported for directory buckets. For this API operation, - * > only the `null` value of the version ID is supported by directory buckets. You can only specify `null` to the - * > `versionId` query parameter in the request. - * > - **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal - * > endpoint. These endpoints support virtual-hosted-style requests in the format - * > `https://*bucket_name*.s3express-*az_id*.*region*.amazonaws.com/*key-name*`. Path-style requests are not - * > supported. For more information, see Regional and Zonal endpoints [^3] in the *Amazon S3 User Guide*. - * > + * Removes an object from a bucket. The behavior depends on the bucket's versioning state. For more information, see + * Best practices to consider before deleting an object [^1]. * * To remove a specific version, you must use the `versionId` query parameter. Using this query parameter permanently * deletes the version. If the object deleted is a delete marker, Amazon S3 sets the response header - * `x-amz-delete-marker` to true. - * - * If the object you want to delete is in a bucket where the bucket versioning configuration is MFA Delete enabled, you - * must include the `x-amz-mfa` request header in the DELETE `versionId` request. Requests that include `x-amz-mfa` must - * use HTTPS. For more information about MFA Delete, see Using MFA Delete [^4] in the *Amazon S3 User Guide*. To see - * sample requests that use versioning, see Sample Request [^5]. - * - * > **Directory buckets** - MFA delete is not supported by directory buckets. - * - * You can delete objects by explicitly calling DELETE Object or calling (PutBucketLifecycle [^6]) to enable Amazon S3 - * to remove them for you. If you want to block users or accounts from removing or deleting objects from your bucket, - * you must deny them the `s3:DeleteObject`, `s3:DeleteObjectVersion`, and `s3:PutLifeCycleConfiguration` actions. - * - * > **Directory buckets** - S3 Lifecycle is not supported by directory buckets. + * `x-amz-delete-marker` to true. If the object you want to delete is in a bucket where the bucket versioning + * configuration is MFA delete enabled, you must include the `x-amz-mfa` request header in the DELETE `versionId` + * request. Requests that include `x-amz-mfa` must use HTTPS. For more information about MFA delete and to see example + * requests, see Using MFA delete [^2] and Sample request [^3] in the *Amazon S3 User Guide*. + * + * > - S3 Versioning isn't enabled and supported for directory buckets. For this API operation, only the `null` value of + * > the version ID is supported by directory buckets. You can only specify `null` to the `versionId` query parameter + * > in the request. + * > - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints + * > support virtual-hosted-style requests in the format + * > `https://*bucket_name*.s3express-*az_id*.*region*.amazonaws.com/*key-name*`. Path-style requests are not + * > supported. For more information, see Regional and Zonal endpoints [^4] in the *Amazon S3 User Guide*. + * > - MFA delete is not supported by directory buckets. + * > * * - `Permissions`: * @@ -1022,17 +1002,16 @@ public function deleteBucketCors($input): Result * * - **`s3:DeleteObject`** - To delete an object from a bucket, you must always have the `s3:DeleteObject` * permission. + * + * > You can also use PutBucketLifecycle to delete objects in Amazon S3. + * * - **`s3:DeleteObjectVersion`** - To delete a specific version of an object from a versioning-enabled bucket, you * must have the `s3:DeleteObjectVersion` permission. + * - If you want to block users or accounts from removing or deleting objects from your bucket, you must deny them + * the `s3:DeleteObject`, `s3:DeleteObjectVersion`, and `s3:PutLifeCycleConfiguration` permissions. * - * - **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that - * you use the `CreateSession` [^7] API operation for session-based authorization. Specifically, you grant the - * `s3express:CreateSession` permission to the directory bucket in a bucket policy or an IAM identity-based policy. - * Then, you make the `CreateSession` API call on the bucket to obtain a session token. With the session token in - * your request header, you can make API requests to this operation. After the session token expires, you make - * another `CreateSession` API call to generate a new session token for use. Amazon Web Services CLI or SDKs create - * session and refresh the session token automatically to avoid service interruptions when a session expires. For - * more information about authorization, see `CreateSession` [^8]. + * - **Directory buckets permissions** - To grant access to this API operation on a directory bucket, we recommend + * that you use the CreateSession API operation for session-based authorization. * * - `HTTP Host header syntax`: * @@ -1040,17 +1019,13 @@ public function deleteBucketCors($input): Result * * The following action is related to `DeleteObject`: * - * - PutObject [^9] + * - PutObject [^5] * - * [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeletingObjectVersions.html - * [^2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeletingObjectsfromVersioningSuspendedBuckets.html - * [^3]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html - * [^4]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMFADelete.html - * [^5]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html#ExampleVersionObjectDelete - * [^6]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html - * [^7]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html - * [^8]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html - * [^9]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html + * [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeletingObjects.html#DeletingObjects-best-practices + * [^2]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMFADelete.html + * [^3]: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html#ExampleVersionObjectDelete + * [^4]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html + * [^5]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html * * @see http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectDELETE.html * @see https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html @@ -1750,6 +1725,8 @@ public function headObject($input): HeadObjectOutput * @param array{ * MaxBuckets?: null|int, * ContinuationToken?: null|string, + * Prefix?: null|string, + * BucketRegion?: null|string, * '@region'?: string|null, * }|ListBucketsRequest $input */ diff --git a/src/Service/S3/src/ValueObject/Bucket.php b/src/Service/S3/src/ValueObject/Bucket.php index 905dd14cf..a91e27f90 100644 --- a/src/Service/S3/src/ValueObject/Bucket.php +++ b/src/Service/S3/src/ValueObject/Bucket.php @@ -22,22 +22,33 @@ final class Bucket */ private $creationDate; + /** + * `BucketRegion` indicates the Amazon Web Services region where the bucket is located. If the request contains at least + * one valid parameter, it is included in the response. + * + * @var string|null + */ + private $bucketRegion; + /** * @param array{ * Name?: null|string, * CreationDate?: null|\DateTimeImmutable, + * BucketRegion?: null|string, * } $input */ public function __construct(array $input) { $this->name = $input['Name'] ?? null; $this->creationDate = $input['CreationDate'] ?? null; + $this->bucketRegion = $input['BucketRegion'] ?? null; } /** * @param array{ * Name?: null|string, * CreationDate?: null|\DateTimeImmutable, + * BucketRegion?: null|string, * }|Bucket $input */ public static function create($input): self @@ -45,6 +56,11 @@ public static function create($input): self return $input instanceof self ? $input : new self($input); } + public function getBucketRegion(): ?string + { + return $this->bucketRegion; + } + public function getCreationDate(): ?\DateTimeImmutable { return $this->creationDate; diff --git a/src/Service/S3/src/ValueObject/ServerSideEncryptionByDefault.php b/src/Service/S3/src/ValueObject/ServerSideEncryptionByDefault.php index c1cf9db67..8a7a3c7e2 100644 --- a/src/Service/S3/src/ValueObject/ServerSideEncryptionByDefault.php +++ b/src/Service/S3/src/ValueObject/ServerSideEncryptionByDefault.php @@ -15,7 +15,7 @@ * > time that you add an object encrypted with SSE-KMS to a bucket. By default, Amazon S3 uses this KMS key for * > SSE-KMS. * > - **Directory buckets** - 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. + * > bucket for the lifetime of the bucket. The Amazon Web Services managed key [^3] (`aws/s3`) isn't supported. * > - **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: * > SSE-S3 and SSE-KMS. * >