Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code #1836

Merged
merged 1 commit into from
Jan 16, 2025
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.336.15"
"${LATEST}": "3.337.1"
},
"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: This change enhances integrity protections for new SDK requests to S3. S3 SDKs now support the CRC64NVME checksum algorithm, full object checksums for multipart S3 objects, and new default integrity protections for S3 requests.

## 2.7.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.7-dev"
"dev-master": "2.8-dev"
}
}
}
2 changes: 2 additions & 0 deletions src/Service/S3/src/Enum/ChecksumAlgorithm.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ final class ChecksumAlgorithm
{
public const CRC32 = 'CRC32';
public const CRC32C = 'CRC32C';
public const CRC64NVME = 'CRC64NVME';
public const SHA1 = 'SHA1';
public const SHA256 = 'SHA256';

Expand All @@ -14,6 +15,7 @@ public static function exists(string $value): bool
return isset([
self::CRC32 => true,
self::CRC32C => true,
self::CRC64NVME => true,
self::SHA1 => true,
self::SHA256 => true,
][$value]);
Expand Down
17 changes: 17 additions & 0 deletions src/Service/S3/src/Enum/ChecksumType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace AsyncAws\S3\Enum;

final class ChecksumType
{
public const COMPOSITE = 'COMPOSITE';
public const FULL_OBJECT = 'FULL_OBJECT';

public static function exists(string $value): bool
{
return isset([
self::COMPOSITE => true,
self::FULL_OBJECT => true,
][$value]);
}
}
105 changes: 100 additions & 5 deletions src/Service/S3/src/Input/CompleteMultipartUploadRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use AsyncAws\Core\Input;
use AsyncAws\Core\Request;
use AsyncAws\Core\Stream\StreamFactory;
use AsyncAws\S3\Enum\ChecksumType;
use AsyncAws\S3\Enum\RequestPayer;
use AsyncAws\S3\ValueObject\CompletedMultipartUpload;

Expand Down Expand Up @@ -73,7 +74,7 @@ final class CompleteMultipartUploadRequest extends Input

/**
* This header can be used as a data integrity check to verify that the data received is the same data that was
* originally sent. This header specifies the base64-encoded, 32-bit CRC-32 checksum of the object. For more
* originally sent. This header specifies the Base64 encoded, 32-bit `CRC-32` checksum of the object. For more
* information, see Checking object integrity [^1] in the *Amazon S3 User Guide*.
*
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
Expand All @@ -84,7 +85,7 @@ final class CompleteMultipartUploadRequest extends Input

/**
* This header can be used as a data integrity check to verify that the data received is the same data that was
* originally sent. This header specifies the base64-encoded, 32-bit CRC-32C checksum of the object. For more
* originally sent. This header specifies the Base64 encoded, 32-bit `CRC-32C` checksum of the object. For more
* information, see Checking object integrity [^1] in the *Amazon S3 User Guide*.
*
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
Expand All @@ -95,8 +96,20 @@ final class CompleteMultipartUploadRequest extends Input

/**
* This header can be used as a data integrity check to verify that the data received is the same data that was
* originally sent. This header specifies the base64-encoded, 160-bit SHA-1 digest of the object. For more information,
* see Checking object integrity [^1] in the *Amazon S3 User Guide*.
* originally sent. This header specifies the Base64 encoded, 64-bit `CRC-64NVME` checksum of the object. The
* `CRC-64NVME` checksum is always a full object checksum. For more information, see Checking object integrity in the
* Amazon S3 User Guide [^1].
*
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
*
* @var string|null
*/
private $checksumCrc64Nvme;

/**
* This header can be used as a data integrity check to verify that the data received is the same data that was
* originally sent. This header specifies the Base64 encoded, 160-bit `SHA-1` digest of the object. For more
* information, see Checking object integrity [^1] in the *Amazon S3 User Guide*.
*
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
*
Expand All @@ -106,7 +119,7 @@ final class CompleteMultipartUploadRequest extends Input

/**
* This header can be used as a data integrity check to verify that the data received is the same data that was
* originally sent. This header specifies the base64-encoded, 256-bit SHA-256 digest of the object. For more
* originally sent. This header specifies the Base64 encoded, 256-bit `SHA-256` digest of the object. For more
* information, see Checking object integrity [^1] in the *Amazon S3 User Guide*.
*
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
Expand All @@ -115,6 +128,25 @@ final class CompleteMultipartUploadRequest extends Input
*/
private $checksumSha256;

/**
* This header specifies the checksum type of the object, which determines how part-level checksums are combined to
* create an object-level checksum for multipart objects. You can use this header as a data integrity check to verify
* that the checksum type that is received is the same checksum that was specified. If the checksum type doesn’t match
* the checksum type that was specified for the object during the `CreateMultipartUpload` request, it’ll result in a
* `BadDigest` error. For more information, see Checking object integrity in the Amazon S3 User Guide.
*
* @var ChecksumType::*|null
*/
private $checksumType;

/**
* The expected total object size of the multipart upload request. If there’s a mismatch between the specified object
* size value and the actual object size value, it results in an `HTTP 400 InvalidRequest` error.
*
* @var int|null
*/
private $mpuObjectSize;

/**
* @var RequestPayer::*|null
*/
Expand Down Expand Up @@ -214,8 +246,11 @@ final class CompleteMultipartUploadRequest extends Input
* UploadId?: string,
* ChecksumCRC32?: null|string,
* ChecksumCRC32C?: null|string,
* ChecksumCRC64NVME?: null|string,
* ChecksumSHA1?: null|string,
* ChecksumSHA256?: null|string,
* ChecksumType?: null|ChecksumType::*,
* MpuObjectSize?: null|int,
* RequestPayer?: null|RequestPayer::*,
* ExpectedBucketOwner?: null|string,
* IfMatch?: null|string,
Expand All @@ -234,8 +269,11 @@ public function __construct(array $input = [])
$this->uploadId = $input['UploadId'] ?? null;
$this->checksumCrc32 = $input['ChecksumCRC32'] ?? null;
$this->checksumCrc32C = $input['ChecksumCRC32C'] ?? null;
$this->checksumCrc64Nvme = $input['ChecksumCRC64NVME'] ?? null;
$this->checksumSha1 = $input['ChecksumSHA1'] ?? null;
$this->checksumSha256 = $input['ChecksumSHA256'] ?? null;
$this->checksumType = $input['ChecksumType'] ?? null;
$this->mpuObjectSize = $input['MpuObjectSize'] ?? null;
$this->requestPayer = $input['RequestPayer'] ?? null;
$this->expectedBucketOwner = $input['ExpectedBucketOwner'] ?? null;
$this->ifMatch = $input['IfMatch'] ?? null;
Expand All @@ -254,8 +292,11 @@ public function __construct(array $input = [])
* UploadId?: string,
* ChecksumCRC32?: null|string,
* ChecksumCRC32C?: null|string,
* ChecksumCRC64NVME?: null|string,
* ChecksumSHA1?: null|string,
* ChecksumSHA256?: null|string,
* ChecksumType?: null|ChecksumType::*,
* MpuObjectSize?: null|int,
* RequestPayer?: null|RequestPayer::*,
* ExpectedBucketOwner?: null|string,
* IfMatch?: null|string,
Expand Down Expand Up @@ -286,6 +327,11 @@ public function getChecksumCrc32C(): ?string
return $this->checksumCrc32C;
}

public function getChecksumCrc64Nvme(): ?string
{
return $this->checksumCrc64Nvme;
}

public function getChecksumSha1(): ?string
{
return $this->checksumSha1;
Expand All @@ -296,6 +342,14 @@ public function getChecksumSha256(): ?string
return $this->checksumSha256;
}

/**
* @return ChecksumType::*|null
*/
public function getChecksumType(): ?string
{
return $this->checksumType;
}

public function getExpectedBucketOwner(): ?string
{
return $this->expectedBucketOwner;
Expand All @@ -316,6 +370,11 @@ public function getKey(): ?string
return $this->key;
}

public function getMpuObjectSize(): ?int
{
return $this->mpuObjectSize;
}

public function getMultipartUpload(): ?CompletedMultipartUpload
{
return $this->multipartUpload;
Expand Down Expand Up @@ -362,12 +421,24 @@ public function request(): Request
if (null !== $this->checksumCrc32C) {
$headers['x-amz-checksum-crc32c'] = $this->checksumCrc32C;
}
if (null !== $this->checksumCrc64Nvme) {
$headers['x-amz-checksum-crc64nvme'] = $this->checksumCrc64Nvme;
}
if (null !== $this->checksumSha1) {
$headers['x-amz-checksum-sha1'] = $this->checksumSha1;
}
if (null !== $this->checksumSha256) {
$headers['x-amz-checksum-sha256'] = $this->checksumSha256;
}
if (null !== $this->checksumType) {
if (!ChecksumType::exists($this->checksumType)) {
throw new InvalidArgument(\sprintf('Invalid parameter "ChecksumType" for "%s". The value "%s" is not a valid "ChecksumType".', __CLASS__, $this->checksumType));
}
$headers['x-amz-checksum-type'] = $this->checksumType;
}
if (null !== $this->mpuObjectSize) {
$headers['x-amz-mp-object-size'] = (string) $this->mpuObjectSize;
}
if (null !== $this->requestPayer) {
if (!RequestPayer::exists($this->requestPayer)) {
throw new InvalidArgument(\sprintf('Invalid parameter "RequestPayer" for "%s". The value "%s" is not a valid "RequestPayer".', __CLASS__, $this->requestPayer));
Expand Down Expand Up @@ -444,6 +515,13 @@ public function setChecksumCrc32C(?string $value): self
return $this;
}

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

return $this;
}

public function setChecksumSha1(?string $value): self
{
$this->checksumSha1 = $value;
Expand All @@ -458,6 +536,16 @@ public function setChecksumSha256(?string $value): self
return $this;
}

/**
* @param ChecksumType::*|null $value
*/
public function setChecksumType(?string $value): self
{
$this->checksumType = $value;

return $this;
}

public function setExpectedBucketOwner(?string $value): self
{
$this->expectedBucketOwner = $value;
Expand Down Expand Up @@ -486,6 +574,13 @@ public function setKey(?string $value): self
return $this;
}

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

return $this;
}

public function setMultipartUpload(?CompletedMultipartUpload $value): self
{
$this->multipartUpload = $value;
Expand Down
40 changes: 39 additions & 1 deletion src/Service/S3/src/Input/CreateMultipartUploadRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use AsyncAws\Core\Request;
use AsyncAws\Core\Stream\StreamFactory;
use AsyncAws\S3\Enum\ChecksumAlgorithm;
use AsyncAws\S3\Enum\ChecksumType;
use AsyncAws\S3\Enum\ObjectCannedACL;
use AsyncAws\S3\Enum\ObjectLockLegalHoldStatus;
use AsyncAws\S3\Enum\ObjectLockMode;
Expand Down Expand Up @@ -435,7 +436,7 @@ final class CreateMultipartUploadRequest extends Input

/**
* Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a
* Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs.
* Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs.
*
* **Directory buckets** - You can optionally provide an explicit encryption context value. The value must match the
* default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not
Expand Down Expand Up @@ -527,6 +528,16 @@ final class CreateMultipartUploadRequest extends Input
*/
private $checksumAlgorithm;

/**
* Indicates the checksum type that you want Amazon S3 to use to calculate the object’s checksum value. For more
* information, see Checking object integrity in the Amazon S3 User Guide [^1].
*
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
*
* @var ChecksumType::*|null
*/
private $checksumType;

/**
* @param array{
* ACL?: null|ObjectCannedACL::*,
Expand Down Expand Up @@ -559,6 +570,7 @@ final class CreateMultipartUploadRequest extends Input
* ObjectLockLegalHoldStatus?: null|ObjectLockLegalHoldStatus::*,
* ExpectedBucketOwner?: null|string,
* ChecksumAlgorithm?: null|ChecksumAlgorithm::*,
* ChecksumType?: null|ChecksumType::*,
* '@region'?: string|null,
* } $input
*/
Expand Down Expand Up @@ -594,6 +606,7 @@ public function __construct(array $input = [])
$this->objectLockLegalHoldStatus = $input['ObjectLockLegalHoldStatus'] ?? null;
$this->expectedBucketOwner = $input['ExpectedBucketOwner'] ?? null;
$this->checksumAlgorithm = $input['ChecksumAlgorithm'] ?? null;
$this->checksumType = $input['ChecksumType'] ?? null;
parent::__construct($input);
}

Expand Down Expand Up @@ -629,6 +642,7 @@ public function __construct(array $input = [])
* ObjectLockLegalHoldStatus?: null|ObjectLockLegalHoldStatus::*,
* ExpectedBucketOwner?: null|string,
* ChecksumAlgorithm?: null|ChecksumAlgorithm::*,
* ChecksumType?: null|ChecksumType::*,
* '@region'?: string|null,
* }|CreateMultipartUploadRequest $input
*/
Expand Down Expand Up @@ -668,6 +682,14 @@ public function getChecksumAlgorithm(): ?string
return $this->checksumAlgorithm;
}

/**
* @return ChecksumType::*|null
*/
public function getChecksumType(): ?string
{
return $this->checksumType;
}

public function getContentDisposition(): ?string
{
return $this->contentDisposition;
Expand Down Expand Up @@ -920,6 +942,12 @@ public function request(): Request
}
$headers['x-amz-checksum-algorithm'] = $this->checksumAlgorithm;
}
if (null !== $this->checksumType) {
if (!ChecksumType::exists($this->checksumType)) {
throw new InvalidArgument(\sprintf('Invalid parameter "ChecksumType" for "%s". The value "%s" is not a valid "ChecksumType".', __CLASS__, $this->checksumType));
}
$headers['x-amz-checksum-type'] = $this->checksumType;
}
if (null !== $this->metadata) {
foreach ($this->metadata as $key => $value) {
$headers["x-amz-meta-$key"] = $value;
Expand Down Expand Up @@ -989,6 +1017,16 @@ public function setChecksumAlgorithm(?string $value): self
return $this;
}

/**
* @param ChecksumType::*|null $value
*/
public function setChecksumType(?string $value): self
{
$this->checksumType = $value;

return $this;
}

public function setContentDisposition(?string $value): self
{
$this->contentDisposition = $value;
Expand Down
Loading
Loading