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.394.8"
"${LATEST}": "3.394.10"
},
"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 @@ -5,6 +5,7 @@
### Added

- AWS api-change: AWS Backup now lets you create read-only access points for Amazon S3 recovery points, enabling you to access backup data using S3 APIs without initiating a restore.
- AWS api-change: Adds support for Amazon S3 Object Lock variable retention. Existing S3 APIs that support S3 Object Lock parameters now support two new parameters EventHold and EventHoldDuration at the object level, and DefaultEventHoldDuration at the bucket level.

## 3.4.1

Expand Down
2 changes: 2 additions & 0 deletions src/Service/S3/src/Enum/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ final class Event
public const S3_OBJECT_RESTORE_COMPLETED = 's3:ObjectRestore:Completed';
public const S3_OBJECT_RESTORE_DELETE = 's3:ObjectRestore:Delete';
public const S3_OBJECT_RESTORE_POST = 's3:ObjectRestore:Post';
public const S3_OBJECT_RETENTION_PUT = 's3:ObjectRetention:Put';
public const S3_OBJECT_TAGGING_ALL = 's3:ObjectTagging:*';
public const S3_OBJECT_TAGGING_DELETE = 's3:ObjectTagging:Delete';
public const S3_OBJECT_TAGGING_PUT = 's3:ObjectTagging:Put';
Expand Down Expand Up @@ -65,6 +66,7 @@ public static function exists(string $value): bool
self::S3_OBJECT_RESTORE_COMPLETED => true,
self::S3_OBJECT_RESTORE_DELETE => true,
self::S3_OBJECT_RESTORE_POST => true,
self::S3_OBJECT_RETENTION_PUT => true,
self::S3_OBJECT_TAGGING_ALL => true,
self::S3_OBJECT_TAGGING_DELETE => true,
self::S3_OBJECT_TAGGING_PUT => true,
Expand Down
21 changes: 21 additions & 0 deletions src/Service/S3/src/Enum/ObjectLockEventHold.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace AsyncAws\S3\Enum;

final class ObjectLockEventHold
{
public const OFF = 'OFF';
public const ON = 'ON';
public const UNKNOWN_TO_SDK = 'UNKNOWN_TO_SDK';

/**
* @psalm-assert-if-true self::* $value
*/
public static function exists(string $value): bool
{
return isset([
self::OFF => true,
self::ON => true,
][$value]);
}
}
106 changes: 99 additions & 7 deletions src/Service/S3/src/Input/CopyObjectRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use AsyncAws\S3\Enum\ChecksumAlgorithm;
use AsyncAws\S3\Enum\MetadataDirective;
use AsyncAws\S3\Enum\ObjectCannedACL;
use AsyncAws\S3\Enum\ObjectLockEventHold;
use AsyncAws\S3\Enum\ObjectLockLegalHoldStatus;
use AsyncAws\S3\Enum\ObjectLockMode;
use AsyncAws\S3\Enum\RequestPayer;
Expand Down Expand Up @@ -257,7 +258,7 @@ final class CopyObjectRequest extends Input
/**
* The date and time at which the object is no longer cacheable.
*
* @var \DateTimeImmutable|null
* @var string|null
*/
private $expires;

Expand Down Expand Up @@ -741,6 +742,33 @@ final class CopyObjectRequest extends Input
*/
private $objectLockLegalHoldStatus;

/**
* The event hold status to apply to the object copy. Set to `ON` to enable or `OFF` to disable.
*
* > This functionality is not supported for directory buckets.
*
* @var ObjectLockEventHold::*|null
*/
private $objectLockEventHold;

/**
* The event hold duration in days to apply to the object copy.
*
* > This functionality is not supported for directory buckets.
*
* @var int|null
*/
private $objectLockEventHoldDurationDays;

/**
* The event hold duration in years to apply to the object copy.
*
* > This functionality is not supported for directory buckets.
*
* @var int|null
*/
private $objectLockEventHoldDurationYears;

/**
* The account ID of the expected destination bucket owner. If the account ID that you provide does not match the actual
* owner of the destination bucket, the request fails with the HTTP status code `403 Forbidden` (access denied).
Expand Down Expand Up @@ -772,7 +800,7 @@ final class CopyObjectRequest extends Input
* CopySourceIfModifiedSince?: \DateTimeImmutable|string|null,
* CopySourceIfNoneMatch?: string|null,
* CopySourceIfUnmodifiedSince?: \DateTimeImmutable|string|null,
* Expires?: \DateTimeImmutable|string|null,
* Expires?: string|null,
* GrantFullControl?: string|null,
* GrantRead?: string|null,
* GrantReadACP?: string|null,
Expand Down Expand Up @@ -801,6 +829,9 @@ final class CopyObjectRequest extends Input
* ObjectLockMode?: ObjectLockMode::*|null,
* ObjectLockRetainUntilDate?: \DateTimeImmutable|string|null,
* ObjectLockLegalHoldStatus?: ObjectLockLegalHoldStatus::*|null,
* ObjectLockEventHold?: ObjectLockEventHold::*|null,
* ObjectLockEventHoldDurationDays?: int|null,
* ObjectLockEventHoldDurationYears?: int|null,
* ExpectedBucketOwner?: string|null,
* ExpectedSourceBucketOwner?: string|null,
* '@region'?: string|null,
Expand All @@ -821,7 +852,7 @@ public function __construct(array $input = [])
$this->copySourceIfModifiedSince = !isset($input['CopySourceIfModifiedSince']) ? null : ($input['CopySourceIfModifiedSince'] instanceof \DateTimeImmutable ? $input['CopySourceIfModifiedSince'] : new \DateTimeImmutable($input['CopySourceIfModifiedSince']));
$this->copySourceIfNoneMatch = $input['CopySourceIfNoneMatch'] ?? null;
$this->copySourceIfUnmodifiedSince = !isset($input['CopySourceIfUnmodifiedSince']) ? null : ($input['CopySourceIfUnmodifiedSince'] instanceof \DateTimeImmutable ? $input['CopySourceIfUnmodifiedSince'] : new \DateTimeImmutable($input['CopySourceIfUnmodifiedSince']));
$this->expires = !isset($input['Expires']) ? null : ($input['Expires'] instanceof \DateTimeImmutable ? $input['Expires'] : new \DateTimeImmutable($input['Expires']));
$this->expires = $input['Expires'] ?? null;
$this->grantFullControl = $input['GrantFullControl'] ?? null;
$this->grantRead = $input['GrantRead'] ?? null;
$this->grantReadAcp = $input['GrantReadACP'] ?? null;
Expand Down Expand Up @@ -850,6 +881,9 @@ public function __construct(array $input = [])
$this->objectLockMode = $input['ObjectLockMode'] ?? null;
$this->objectLockRetainUntilDate = !isset($input['ObjectLockRetainUntilDate']) ? null : ($input['ObjectLockRetainUntilDate'] instanceof \DateTimeImmutable ? $input['ObjectLockRetainUntilDate'] : new \DateTimeImmutable($input['ObjectLockRetainUntilDate']));
$this->objectLockLegalHoldStatus = $input['ObjectLockLegalHoldStatus'] ?? null;
$this->objectLockEventHold = $input['ObjectLockEventHold'] ?? null;
$this->objectLockEventHoldDurationDays = $input['ObjectLockEventHoldDurationDays'] ?? null;
$this->objectLockEventHoldDurationYears = $input['ObjectLockEventHoldDurationYears'] ?? null;
$this->expectedBucketOwner = $input['ExpectedBucketOwner'] ?? null;
$this->expectedSourceBucketOwner = $input['ExpectedSourceBucketOwner'] ?? null;
parent::__construct($input);
Expand All @@ -870,7 +904,7 @@ public function __construct(array $input = [])
* CopySourceIfModifiedSince?: \DateTimeImmutable|string|null,
* CopySourceIfNoneMatch?: string|null,
* CopySourceIfUnmodifiedSince?: \DateTimeImmutable|string|null,
* Expires?: \DateTimeImmutable|string|null,
* Expires?: string|null,
* GrantFullControl?: string|null,
* GrantRead?: string|null,
* GrantReadACP?: string|null,
Expand Down Expand Up @@ -899,6 +933,9 @@ public function __construct(array $input = [])
* ObjectLockMode?: ObjectLockMode::*|null,
* ObjectLockRetainUntilDate?: \DateTimeImmutable|string|null,
* ObjectLockLegalHoldStatus?: ObjectLockLegalHoldStatus::*|null,
* ObjectLockEventHold?: ObjectLockEventHold::*|null,
* ObjectLockEventHoldDurationDays?: int|null,
* ObjectLockEventHoldDurationYears?: int|null,
* ExpectedBucketOwner?: string|null,
* ExpectedSourceBucketOwner?: string|null,
* '@region'?: string|null,
Expand Down Expand Up @@ -1018,7 +1055,7 @@ public function getExpectedSourceBucketOwner(): ?string
return $this->expectedSourceBucketOwner;
}

public function getExpires(): ?\DateTimeImmutable
public function getExpires(): ?string
{
return $this->expires;
}
Expand Down Expand Up @@ -1074,6 +1111,24 @@ public function getMetadataDirective(): ?string
return $this->metadataDirective;
}

/**
* @return ObjectLockEventHold::*|null
*/
public function getObjectLockEventHold(): ?string
{
return $this->objectLockEventHold;
}

public function getObjectLockEventHoldDurationDays(): ?int
{
return $this->objectLockEventHoldDurationDays;
}

public function getObjectLockEventHoldDurationYears(): ?int
{
return $this->objectLockEventHoldDurationYears;
}

/**
* @return ObjectLockLegalHoldStatus::*|null
*/
Expand Down Expand Up @@ -1215,7 +1270,7 @@ public function request(): Request
$headers['x-amz-copy-source-if-unmodified-since'] = $this->copySourceIfUnmodifiedSince->setTimezone(new \DateTimeZone('GMT'))->format('D, d M Y H:i:s \G\M\T');
}
if (null !== $this->expires) {
$headers['Expires'] = $this->expires->setTimezone(new \DateTimeZone('GMT'))->format('D, d M Y H:i:s \G\M\T');
$headers['Expires'] = $this->expires;
}
if (null !== $this->grantFullControl) {
$headers['x-amz-grant-full-control'] = $this->grantFullControl;
Expand Down Expand Up @@ -1327,6 +1382,19 @@ public function request(): Request
}
$headers['x-amz-object-lock-legal-hold'] = $this->objectLockLegalHoldStatus;
}
if (null !== $this->objectLockEventHold) {
if (!ObjectLockEventHold::exists($this->objectLockEventHold)) {
/** @psalm-suppress NoValue */
throw new InvalidArgument(\sprintf('Invalid parameter "ObjectLockEventHold" for "%s". The value "%s" is not a valid "ObjectLockEventHold".', __CLASS__, $this->objectLockEventHold));
}
$headers['x-amz-object-lock-event-hold'] = $this->objectLockEventHold;
}
if (null !== $this->objectLockEventHoldDurationDays) {
$headers['x-amz-object-lock-event-hold-duration-days'] = (string) $this->objectLockEventHoldDurationDays;
}
if (null !== $this->objectLockEventHoldDurationYears) {
$headers['x-amz-object-lock-event-hold-duration-years'] = (string) $this->objectLockEventHoldDurationYears;
}
if (null !== $this->expectedBucketOwner) {
$headers['x-amz-expected-bucket-owner'] = $this->expectedBucketOwner;
}
Expand Down Expand Up @@ -1510,7 +1578,7 @@ public function setExpectedSourceBucketOwner(?string $value): self
return $this;
}

public function setExpires(?\DateTimeImmutable $value): self
public function setExpires(?string $value): self
{
$this->expires = $value;

Expand Down Expand Up @@ -1586,6 +1654,30 @@ public function setMetadataDirective(?string $value): self
return $this;
}

/**
* @param ObjectLockEventHold::*|null $value
*/
public function setObjectLockEventHold(?string $value): self
{
$this->objectLockEventHold = $value;

return $this;
}

public function setObjectLockEventHoldDurationDays(?int $value): self
{
$this->objectLockEventHoldDurationDays = $value;

return $this;
}

public function setObjectLockEventHoldDurationYears(?int $value): self
{
$this->objectLockEventHoldDurationYears = $value;

return $this;
}

/**
* @param ObjectLockLegalHoldStatus::*|null $value
*/
Expand Down
Loading
Loading