Skip to content

Commit 93f5656

Browse files
Update generated code (#1979)
update generated code
1 parent b150a40 commit 93f5656

14 files changed

+302
-114
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
- AWS api-change: Added `us-isob-west-1` region
1212
- Added `S3Client::putPublicAccessBlock()` method
13+
- AWS api-change: Amazon Simple Storage Service / Features: Add conditional writes in CopyObject on destination key to prevent unintended object modifications.
1314

1415
### Dependency bumped
1516

src/Input/CopyObjectRequest.php

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,37 @@ final class CopyObjectRequest extends Input
304304
*/
305305
private $grantWriteAcp;
306306

307+
/**
308+
* Copies the object if the entity tag (ETag) of the destination object matches the specified tag. If the ETag values do
309+
* not match, the operation returns a `412 Precondition Failed` error. If a concurrent operation occurs during the
310+
* upload S3 returns a `409 ConditionalRequestConflict` response. On a 409 failure you should fetch the object's ETag
311+
* and retry the upload.
312+
*
313+
* Expects the ETag value as a string.
314+
*
315+
* For more information about conditional requests, see RFC 7232 [^1].
316+
*
317+
* [^1]: https://tools.ietf.org/html/rfc7232
318+
*
319+
* @var string|null
320+
*/
321+
private $ifMatch;
322+
323+
/**
324+
* Copies the object only if the object key name at the destination does not already exist in the bucket specified.
325+
* Otherwise, Amazon S3 returns a `412 Precondition Failed` error. If a concurrent operation occurs during the upload S3
326+
* returns a `409 ConditionalRequestConflict` response. On a 409 failure you should retry the upload.
327+
*
328+
* Expects the '*' (asterisk) character.
329+
*
330+
* For more information about conditional requests, see RFC 7232 [^1].
331+
*
332+
* [^1]: https://tools.ietf.org/html/rfc7232
333+
*
334+
* @var string|null
335+
*/
336+
private $ifNoneMatch;
337+
307338
/**
308339
* The key of the destination object.
309340
*
@@ -718,6 +749,8 @@ final class CopyObjectRequest extends Input
718749
* GrantRead?: string|null,
719750
* GrantReadACP?: string|null,
720751
* GrantWriteACP?: string|null,
752+
* IfMatch?: string|null,
753+
* IfNoneMatch?: string|null,
721754
* Key?: string,
722755
* Metadata?: array<string, string>|null,
723756
* MetadataDirective?: MetadataDirective::*|null,
@@ -764,6 +797,8 @@ public function __construct(array $input = [])
764797
$this->grantRead = $input['GrantRead'] ?? null;
765798
$this->grantReadAcp = $input['GrantReadACP'] ?? null;
766799
$this->grantWriteAcp = $input['GrantWriteACP'] ?? null;
800+
$this->ifMatch = $input['IfMatch'] ?? null;
801+
$this->ifNoneMatch = $input['IfNoneMatch'] ?? null;
767802
$this->key = $input['Key'] ?? null;
768803
$this->metadata = $input['Metadata'] ?? null;
769804
$this->metadataDirective = $input['MetadataDirective'] ?? null;
@@ -810,6 +845,8 @@ public function __construct(array $input = [])
810845
* GrantRead?: string|null,
811846
* GrantReadACP?: string|null,
812847
* GrantWriteACP?: string|null,
848+
* IfMatch?: string|null,
849+
* IfNoneMatch?: string|null,
813850
* Key?: string,
814851
* Metadata?: array<string, string>|null,
815852
* MetadataDirective?: MetadataDirective::*|null,
@@ -967,6 +1004,16 @@ public function getGrantWriteAcp(): ?string
9671004
return $this->grantWriteAcp;
9681005
}
9691006

1007+
public function getIfMatch(): ?string
1008+
{
1009+
return $this->ifMatch;
1010+
}
1011+
1012+
public function getIfNoneMatch(): ?string
1013+
{
1014+
return $this->ifNoneMatch;
1015+
}
1016+
9701017
public function getKey(): ?string
9711018
{
9721019
return $this->key;
@@ -1141,6 +1188,12 @@ public function request(): Request
11411188
if (null !== $this->grantWriteAcp) {
11421189
$headers['x-amz-grant-write-acp'] = $this->grantWriteAcp;
11431190
}
1191+
if (null !== $this->ifMatch) {
1192+
$headers['If-Match'] = $this->ifMatch;
1193+
}
1194+
if (null !== $this->ifNoneMatch) {
1195+
$headers['If-None-Match'] = $this->ifNoneMatch;
1196+
}
11441197
if (null !== $this->metadataDirective) {
11451198
if (!MetadataDirective::exists($this->metadataDirective)) {
11461199
throw new InvalidArgument(\sprintf('Invalid parameter "MetadataDirective" for "%s". The value "%s" is not a valid "MetadataDirective".', __CLASS__, $this->metadataDirective));
@@ -1427,6 +1480,20 @@ public function setGrantWriteAcp(?string $value): self
14271480
return $this;
14281481
}
14291482

1483+
public function setIfMatch(?string $value): self
1484+
{
1485+
$this->ifMatch = $value;
1486+
1487+
return $this;
1488+
}
1489+
1490+
public function setIfNoneMatch(?string $value): self
1491+
{
1492+
$this->ifNoneMatch = $value;
1493+
1494+
return $this;
1495+
}
1496+
14301497
public function setKey(?string $value): self
14311498
{
14321499
$this->key = $value;

src/Input/DeleteObjectRequest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ final class DeleteObjectRequest extends Input
9999
private $expectedBucketOwner;
100100

101101
/**
102-
* The `If-Match` header field makes the request method conditional on ETags. If the ETag value does not match, the
103-
* operation returns a `412 Precondition Failed` error. If the ETag matches or if the object doesn't exist, the
104-
* operation will return a `204 Success (No Content) response`.
102+
* Deletes the object if the ETag (entity tag) value provided during the delete operation matches the ETag of the object
103+
* in S3. If the ETag values do not match, the operation returns a `412 Precondition Failed` error.
105104
*
106-
* For more information about conditional requests, see RFC 7232 [^1].
105+
* Expects the ETag value as a string. `If-Match` does accept a string value of an '*' (asterisk) character to denote a
106+
* match of any ETag.
107107
*
108-
* > This functionality is only supported for directory buckets.
108+
* For more information about conditional requests, see RFC 7232 [^1].
109109
*
110110
* [^1]: https://tools.ietf.org/html/rfc7232
111111
*

src/Input/PutObjectTaggingRequest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ final class PutObjectTaggingRequest extends Input
9797
private $expectedBucketOwner;
9898

9999
/**
100+
* Confirms that the requester knows that she or he will be charged for the tagging object request. Bucket owners need
101+
* not specify this parameter in their requests.
102+
*
100103
* @var RequestPayer::*|null
101104
*/
102105
private $requestPayer;

src/Result/CompleteMultipartUploadOutput.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ class CompleteMultipartUploadOutput extends Result
5858
private $etag;
5959

6060
/**
61-
* The Base64 encoded, 32-bit `CRC32 checksum` of the object. This checksum is only be present if the checksum was
62-
* uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this
63-
* value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values
64-
* of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking
65-
* object integrity [^1] in the *Amazon S3 User Guide*.
61+
* The Base64 encoded, 32-bit `CRC32 checksum` of the object. This checksum is only present if the checksum was uploaded
62+
* with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may
63+
* not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each
64+
* individual part. For more information about how checksums are calculated with multipart uploads, see Checking object
65+
* integrity [^1] in the *Amazon S3 User Guide*.
6666
*
6767
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums
6868
*
@@ -96,11 +96,11 @@ class CompleteMultipartUploadOutput extends Result
9696
private $checksumCrc64Nvme;
9797

9898
/**
99-
* The Base64 encoded, 160-bit `SHA1` digest of the object. This will only be present if the object was uploaded with
100-
* the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not
101-
* be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each
102-
* individual part. For more information about how checksums are calculated with multipart uploads, see Checking object
103-
* integrity [^1] in the *Amazon S3 User Guide*.
99+
* The Base64 encoded, 160-bit `SHA1` digest of the object. This checksum is only present if the checksum was uploaded
100+
* with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value
101+
* may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of
102+
* each individual part. For more information about how checksums are calculated with multipart uploads, see Checking
103+
* object integrity [^1] in the *Amazon S3 User Guide*.
104104
*
105105
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums
106106
*
@@ -109,9 +109,9 @@ class CompleteMultipartUploadOutput extends Result
109109
private $checksumSha1;
110110

111111
/**
112-
* The Base64 encoded, 256-bit `SHA256` digest of the object. This will only be present if the object was uploaded with
113-
* the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not
114-
* be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each
112+
* The Base64 encoded, 256-bit `SHA256` digest of the object. This checksum is only present if the checksum was uploaded
113+
* with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may
114+
* not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each
115115
* individual part. For more information about how checksums are calculated with multipart uploads, see Checking object
116116
* integrity [^1] in the *Amazon S3 User Guide*.
117117
*

src/Result/GetObjectOutput.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ class GetObjectOutput extends Result
105105
private $checksumCrc32;
106106

107107
/**
108-
* The Base64 encoded, 32-bit `CRC32C` checksum of the object. This will only be present if the object was uploaded with
109-
* the object. For more information, see Checking object integrity [^1] in the *Amazon S3 User Guide*.
108+
* The Base64 encoded, 32-bit `CRC32C` checksum of the object. This checksum is only present if the checksum was
109+
* uploaded with the object. For more information, see Checking object integrity [^1] in the *Amazon S3 User Guide*.
110110
*
111111
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
112112
*
@@ -125,8 +125,8 @@ class GetObjectOutput extends Result
125125
private $checksumCrc64Nvme;
126126

127127
/**
128-
* The Base64 encoded, 160-bit `SHA1` digest of the object. This will only be present if the object was uploaded with
129-
* the object. For more information, see Checking object integrity [^1] in the *Amazon S3 User Guide*.
128+
* The Base64 encoded, 160-bit `SHA1` digest of the object. This checksum is only present if the checksum was uploaded
129+
* with the object. For more information, see Checking object integrity [^1] in the *Amazon S3 User Guide*.
130130
*
131131
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
132132
*
@@ -135,8 +135,8 @@ class GetObjectOutput extends Result
135135
private $checksumSha1;
136136

137137
/**
138-
* The Base64 encoded, 256-bit `SHA256` digest of the object. This will only be present if the object was uploaded with
139-
* the object. For more information, see Checking object integrity [^1] in the *Amazon S3 User Guide*.
138+
* The Base64 encoded, 256-bit `SHA256` digest of the object. This checksum is only present if the checksum was uploaded
139+
* with the object. For more information, see Checking object integrity [^1] in the *Amazon S3 User Guide*.
140140
*
141141
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html
142142
*

src/Result/HeadObjectOutput.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ class HeadObjectOutput extends Result
9494
private $contentLength;
9595

9696
/**
97-
* The Base64 encoded, 32-bit `CRC32 checksum` of the object. This checksum is only be present if the checksum was
98-
* uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this
99-
* value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values
100-
* of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking
101-
* object integrity [^1] in the *Amazon S3 User Guide*.
97+
* The Base64 encoded, 32-bit `CRC32 checksum` of the object. This checksum is only present if the checksum was uploaded
98+
* with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may
99+
* not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each
100+
* individual part. For more information about how checksums are calculated with multipart uploads, see Checking object
101+
* integrity [^1] in the *Amazon S3 User Guide*.
102102
*
103103
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums
104104
*
@@ -130,11 +130,11 @@ class HeadObjectOutput extends Result
130130
private $checksumCrc64Nvme;
131131

132132
/**
133-
* The Base64 encoded, 160-bit `SHA1` digest of the object. This will only be present if the object was uploaded with
134-
* the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not
135-
* be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each
136-
* individual part. For more information about how checksums are calculated with multipart uploads, see Checking object
137-
* integrity [^1] in the *Amazon S3 User Guide*.
133+
* The Base64 encoded, 160-bit `SHA1` digest of the object. This checksum is only present if the checksum was uploaded
134+
* with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value
135+
* may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of
136+
* each individual part. For more information about how checksums are calculated with multipart uploads, see Checking
137+
* object integrity [^1] in the *Amazon S3 User Guide*.
138138
*
139139
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums
140140
*
@@ -143,9 +143,9 @@ class HeadObjectOutput extends Result
143143
private $checksumSha1;
144144

145145
/**
146-
* The Base64 encoded, 256-bit `SHA256` digest of the object. This will only be present if the object was uploaded with
147-
* the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not
148-
* be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each
146+
* The Base64 encoded, 256-bit `SHA256` digest of the object. This checksum is only present if the checksum was uploaded
147+
* with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may
148+
* not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each
149149
* individual part. For more information about how checksums are calculated with multipart uploads, see Checking object
150150
* integrity [^1] in the *Amazon S3 User Guide*.
151151
*

src/Result/PutObjectOutput.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ class PutObjectOutput extends Result
3838
private $etag;
3939

4040
/**
41-
* The Base64 encoded, 32-bit `CRC32 checksum` of the object. This checksum is only be present if the checksum was
42-
* uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this
43-
* value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values
44-
* of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking
45-
* object integrity [^1] in the *Amazon S3 User Guide*.
41+
* The Base64 encoded, 32-bit `CRC32 checksum` of the object. This checksum is only present if the checksum was uploaded
42+
* with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may
43+
* not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each
44+
* individual part. For more information about how checksums are calculated with multipart uploads, see Checking object
45+
* integrity [^1] in the *Amazon S3 User Guide*.
4646
*
4747
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums
4848
*
@@ -76,11 +76,11 @@ class PutObjectOutput extends Result
7676
private $checksumCrc64Nvme;
7777

7878
/**
79-
* The Base64 encoded, 160-bit `SHA1` digest of the object. This will only be present if the object was uploaded with
80-
* the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not
81-
* be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each
82-
* individual part. For more information about how checksums are calculated with multipart uploads, see Checking object
83-
* integrity [^1] in the *Amazon S3 User Guide*.
79+
* The Base64 encoded, 160-bit `SHA1` digest of the object. This checksum is only present if the checksum was uploaded
80+
* with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value
81+
* may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of
82+
* each individual part. For more information about how checksums are calculated with multipart uploads, see Checking
83+
* object integrity [^1] in the *Amazon S3 User Guide*.
8484
*
8585
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums
8686
*
@@ -89,9 +89,9 @@ class PutObjectOutput extends Result
8989
private $checksumSha1;
9090

9191
/**
92-
* The Base64 encoded, 256-bit `SHA256` digest of the object. This will only be present if the object was uploaded with
93-
* the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not
94-
* be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each
92+
* The Base64 encoded, 256-bit `SHA256` digest of the object. This checksum is only present if the checksum was uploaded
93+
* with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may
94+
* not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each
9595
* individual part. For more information about how checksums are calculated with multipart uploads, see Checking object
9696
* integrity [^1] in the *Amazon S3 User Guide*.
9797
*

0 commit comments

Comments
 (0)