diff --git a/manifest.json b/manifest.json index 0970c7e82..010ac207f 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "variables": { - "${LATEST}": "3.348.2" + "${LATEST}": "3.349.1" }, "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 6f16b360f..ce1974ee9 100644 --- a/src/Service/S3/CHANGELOG.md +++ b/src/Service/S3/CHANGELOG.md @@ -7,6 +7,7 @@ - AWS api-change: Rework regions configuration - AWS api-change: Added `tagCount` property to the HeadObject response - AWS api-change: Adds support for additional server-side encryption mode and storage class values for accessing Amazon FSx data from Amazon S3 using S3 Access Points +- AWS api-change: Added support for directory bucket creation with tags and bucket ARN retrieval in CreateBucket, ListDirectoryBuckets, and HeadBucket operations ## 2.9.1 diff --git a/src/Service/S3/src/Input/ListMultipartUploadsRequest.php b/src/Service/S3/src/Input/ListMultipartUploadsRequest.php index 456bdd66e..76900e65e 100644 --- a/src/Service/S3/src/Input/ListMultipartUploadsRequest.php +++ b/src/Service/S3/src/Input/ListMultipartUploadsRequest.php @@ -55,6 +55,8 @@ final class ListMultipartUploadsRequest extends Input * parameter, then the substring starts at the beginning of the key. The keys that are grouped under `CommonPrefixes` * result element are not returned elsewhere in the response. * + * `CommonPrefixes` is filtered out from results if it is not lexicographically greater than the key-marker. + * * > **Directory buckets** - For directory buckets, `/` is the only supported delimiter. * * @var string|null diff --git a/src/Service/S3/src/Input/ListObjectVersionsRequest.php b/src/Service/S3/src/Input/ListObjectVersionsRequest.php index 0f035216a..e4440c474 100644 --- a/src/Service/S3/src/Input/ListObjectVersionsRequest.php +++ b/src/Service/S3/src/Input/ListObjectVersionsRequest.php @@ -26,6 +26,8 @@ final class ListObjectVersionsRequest extends Input * and the first occurrence of the delimiter are grouped under a single result element in `CommonPrefixes`. These groups * are counted as one result against the `max-keys` limitation. These keys are not returned elsewhere in the response. * + * `CommonPrefixes` is filtered out from results if it is not lexicographically greater than the key-marker. + * * @var string|null */ private $delimiter; diff --git a/src/Service/S3/src/Input/ListObjectsV2Request.php b/src/Service/S3/src/Input/ListObjectsV2Request.php index e08c959f6..70bd89092 100644 --- a/src/Service/S3/src/Input/ListObjectsV2Request.php +++ b/src/Service/S3/src/Input/ListObjectsV2Request.php @@ -49,6 +49,8 @@ final class ListObjectsV2Request extends Input /** * A delimiter is a character that you use to group keys. * + * `CommonPrefixes` is filtered out from results if it is not lexicographically greater than the `StartAfter` value. + * * > - **Directory buckets** - For directory buckets, `/` is the only supported delimiter. * > - **Directory buckets ** - When you query `ListObjectsV2` with a delimiter during in-progress multipart uploads, * > the `CommonPrefixes` response parameter contains the prefixes that are associated with the in-progress multipart diff --git a/src/Service/S3/src/Result/CreateBucketOutput.php b/src/Service/S3/src/Result/CreateBucketOutput.php index 441d7a2bf..3f8a77e07 100644 --- a/src/Service/S3/src/Result/CreateBucketOutput.php +++ b/src/Service/S3/src/Result/CreateBucketOutput.php @@ -14,6 +14,26 @@ class CreateBucketOutput extends Result */ private $location; + /** + * The Amazon Resource Name (ARN) of the S3 bucket. ARNs uniquely identify Amazon Web Services resources across all of + * Amazon Web Services. + * + * > This parameter is only supported for S3 directory buckets. For more information, see Using tags with directory + * > buckets [^1]. + * + * [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-tagging.html + * + * @var string|null + */ + private $bucketArn; + + public function getBucketArn(): ?string + { + $this->initialize(); + + return $this->bucketArn; + } + public function getLocation(): ?string { $this->initialize(); @@ -26,5 +46,6 @@ protected function populateResult(Response $response): void $headers = $response->getHeaders(); $this->location = $headers['location'][0] ?? null; + $this->bucketArn = $headers['x-amz-bucket-arn'][0] ?? null; } } diff --git a/src/Service/S3/src/Result/ListBucketsOutput.php b/src/Service/S3/src/Result/ListBucketsOutput.php index 0598ef08b..bad0736ce 100644 --- a/src/Service/S3/src/Result/ListBucketsOutput.php +++ b/src/Service/S3/src/Result/ListBucketsOutput.php @@ -137,6 +137,7 @@ private function populateResultBucket(\SimpleXMLElement $xml): Bucket 'Name' => (null !== $v = $xml->Name[0]) ? (string) $v : null, 'CreationDate' => (null !== $v = $xml->CreationDate[0]) ? new \DateTimeImmutable((string) $v) : null, 'BucketRegion' => (null !== $v = $xml->BucketRegion[0]) ? (string) $v : null, + 'BucketArn' => (null !== $v = $xml->BucketArn[0]) ? (string) $v : null, ]); } diff --git a/src/Service/S3/src/ValueObject/Bucket.php b/src/Service/S3/src/ValueObject/Bucket.php index a91e27f90..aea5a355b 100644 --- a/src/Service/S3/src/ValueObject/Bucket.php +++ b/src/Service/S3/src/ValueObject/Bucket.php @@ -30,11 +30,25 @@ final class Bucket */ private $bucketRegion; + /** + * The Amazon Resource Name (ARN) of the S3 bucket. ARNs uniquely identify Amazon Web Services resources across all of + * Amazon Web Services. + * + * > This parameter is only supported for S3 directory buckets. For more information, see Using tags with directory + * > buckets [^1]. + * + * [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-tagging.html + * + * @var string|null + */ + private $bucketArn; + /** * @param array{ * Name?: null|string, * CreationDate?: null|\DateTimeImmutable, * BucketRegion?: null|string, + * BucketArn?: null|string, * } $input */ public function __construct(array $input) @@ -42,6 +56,7 @@ public function __construct(array $input) $this->name = $input['Name'] ?? null; $this->creationDate = $input['CreationDate'] ?? null; $this->bucketRegion = $input['BucketRegion'] ?? null; + $this->bucketArn = $input['BucketArn'] ?? null; } /** @@ -49,6 +64,7 @@ public function __construct(array $input) * Name?: null|string, * CreationDate?: null|\DateTimeImmutable, * BucketRegion?: null|string, + * BucketArn?: null|string, * }|Bucket $input */ public static function create($input): self @@ -56,6 +72,11 @@ public static function create($input): self return $input instanceof self ? $input : new self($input); } + public function getBucketArn(): ?string + { + return $this->bucketArn; + } + public function getBucketRegion(): ?string { return $this->bucketRegion; diff --git a/src/Service/S3/src/ValueObject/CreateBucketConfiguration.php b/src/Service/S3/src/ValueObject/CreateBucketConfiguration.php index e58096517..0722ea3ce 100644 --- a/src/Service/S3/src/ValueObject/CreateBucketConfiguration.php +++ b/src/Service/S3/src/ValueObject/CreateBucketConfiguration.php @@ -52,11 +52,25 @@ final class CreateBucketConfiguration */ private $bucket; + /** + * An array of tags that you can apply to the bucket that you're creating. Tags are key-value pairs of metadata used to + * categorize and organize your buckets, track costs, and control access. + * + * > This parameter is only supported for S3 directory buckets. For more information, see Using tags with directory + * > buckets [^1]. + * + * [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-tagging.html + * + * @var Tag[]|null + */ + private $tags; + /** * @param array{ * LocationConstraint?: null|BucketLocationConstraint::*, * Location?: null|LocationInfo|array, * Bucket?: null|BucketInfo|array, + * Tags?: null|array, * } $input */ public function __construct(array $input) @@ -64,6 +78,7 @@ public function __construct(array $input) $this->locationConstraint = $input['LocationConstraint'] ?? null; $this->location = isset($input['Location']) ? LocationInfo::create($input['Location']) : null; $this->bucket = isset($input['Bucket']) ? BucketInfo::create($input['Bucket']) : null; + $this->tags = isset($input['Tags']) ? array_map([Tag::class, 'create'], $input['Tags']) : null; } /** @@ -71,6 +86,7 @@ public function __construct(array $input) * LocationConstraint?: null|BucketLocationConstraint::*, * Location?: null|LocationInfo|array, * Bucket?: null|BucketInfo|array, + * Tags?: null|array, * }|CreateBucketConfiguration $input */ public static function create($input): self @@ -96,6 +112,14 @@ public function getLocationConstraint(): ?string return $this->locationConstraint; } + /** + * @return Tag[] + */ + public function getTags(): array + { + return $this->tags ?? []; + } + /** * @internal */ @@ -117,5 +141,13 @@ public function requestBody(\DOMElement $node, \DOMDocument $document): void $v->requestBody($child, $document); } + if (null !== $v = $this->tags) { + $node->appendChild($nodeList = $document->createElement('Tags')); + foreach ($v as $item) { + $nodeList->appendChild($child = $document->createElement('Tag')); + + $item->requestBody($child, $document); + } + } } }