Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.348.2"
"${LATEST}": "3.349.1"
},
"endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json",
"services": {
Expand Down
1 change: 1 addition & 0 deletions src/Service/S3/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions src/Service/S3/src/Input/ListMultipartUploadsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/Service/S3/src/Input/ListObjectVersionsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/Service/S3/src/Input/ListObjectsV2Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions src/Service/S3/src/Result/CreateBucketOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
}
}
1 change: 1 addition & 0 deletions src/Service/S3/src/Result/ListBucketsOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]);
}

Expand Down
21 changes: 21 additions & 0 deletions src/Service/S3/src/ValueObject/Bucket.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,53 @@ 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)
{
$this->name = $input['Name'] ?? null;
$this->creationDate = $input['CreationDate'] ?? null;
$this->bucketRegion = $input['BucketRegion'] ?? null;
$this->bucketArn = $input['BucketArn'] ?? null;
}

/**
* @param array{
* Name?: null|string,
* CreationDate?: null|\DateTimeImmutable,
* BucketRegion?: null|string,
* BucketArn?: null|string,
* }|Bucket $input
*/
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;
Expand Down
32 changes: 32 additions & 0 deletions src/Service/S3/src/ValueObject/CreateBucketConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,41 @@ 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<Tag|array>,
* } $input
*/
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;
}

/**
* @param array{
* LocationConstraint?: null|BucketLocationConstraint::*,
* Location?: null|LocationInfo|array,
* Bucket?: null|BucketInfo|array,
* Tags?: null|array<Tag|array>,
* }|CreateBucketConfiguration $input
*/
public static function create($input): self
Expand All @@ -96,6 +112,14 @@ public function getLocationConstraint(): ?string
return $this->locationConstraint;
}

/**
* @return Tag[]
*/
public function getTags(): array
{
return $this->tags ?? [];
}

/**
* @internal
*/
Expand All @@ -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);
}
}
}
}