Skip to content

Commit

Permalink
Update generated code (#1731)
Browse files Browse the repository at this point in the history
update generated code
  • Loading branch information
async-aws-bot committed Jul 3, 2024
1 parent eb53ac6 commit 30c4933
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 10 deletions.
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.314.3"
"${LATEST}": "3.315.4"
},
"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: Added response overrides to Head Object requests.

### Fixed

- Exception NoSuchKeyException not fired for `HeadObject` request.
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.2-dev"
"dev-master": "2.3-dev"
}
}
}
150 changes: 150 additions & 0 deletions src/Service/S3/src/Input/HeadObjectRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,48 @@ final class HeadObjectRequest extends Input
*/
private $range;

/**
* Sets the `Cache-Control` header of the response.
*
* @var string|null
*/
private $responseCacheControl;

/**
* Sets the `Content-Disposition` header of the response.
*
* @var string|null
*/
private $responseContentDisposition;

/**
* Sets the `Content-Encoding` header of the response.
*
* @var string|null
*/
private $responseContentEncoding;

/**
* Sets the `Content-Language` header of the response.
*
* @var string|null
*/
private $responseContentLanguage;

/**
* Sets the `Content-Type` header of the response.
*
* @var string|null
*/
private $responseContentType;

/**
* Sets the `Expires` header of the response.
*
* @var \DateTimeImmutable|null
*/
private $responseExpires;

/**
* Version ID used to reference a specific version of the object.
*
Expand Down Expand Up @@ -218,6 +260,12 @@ final class HeadObjectRequest extends Input
* IfUnmodifiedSince?: null|\DateTimeImmutable|string,
* Key?: string,
* Range?: null|string,
* ResponseCacheControl?: null|string,
* ResponseContentDisposition?: null|string,
* ResponseContentEncoding?: null|string,
* ResponseContentLanguage?: null|string,
* ResponseContentType?: null|string,
* ResponseExpires?: null|\DateTimeImmutable|string,
* VersionId?: null|string,
* SSECustomerAlgorithm?: null|string,
* SSECustomerKey?: null|string,
Expand All @@ -238,6 +286,12 @@ public function __construct(array $input = [])
$this->ifUnmodifiedSince = !isset($input['IfUnmodifiedSince']) ? null : ($input['IfUnmodifiedSince'] instanceof \DateTimeImmutable ? $input['IfUnmodifiedSince'] : new \DateTimeImmutable($input['IfUnmodifiedSince']));
$this->key = $input['Key'] ?? null;
$this->range = $input['Range'] ?? null;
$this->responseCacheControl = $input['ResponseCacheControl'] ?? null;
$this->responseContentDisposition = $input['ResponseContentDisposition'] ?? null;
$this->responseContentEncoding = $input['ResponseContentEncoding'] ?? null;
$this->responseContentLanguage = $input['ResponseContentLanguage'] ?? null;
$this->responseContentType = $input['ResponseContentType'] ?? null;
$this->responseExpires = !isset($input['ResponseExpires']) ? null : ($input['ResponseExpires'] instanceof \DateTimeImmutable ? $input['ResponseExpires'] : new \DateTimeImmutable($input['ResponseExpires']));
$this->versionId = $input['VersionId'] ?? null;
$this->sseCustomerAlgorithm = $input['SSECustomerAlgorithm'] ?? null;
$this->sseCustomerKey = $input['SSECustomerKey'] ?? null;
Expand All @@ -258,6 +312,12 @@ public function __construct(array $input = [])
* IfUnmodifiedSince?: null|\DateTimeImmutable|string,
* Key?: string,
* Range?: null|string,
* ResponseCacheControl?: null|string,
* ResponseContentDisposition?: null|string,
* ResponseContentEncoding?: null|string,
* ResponseContentLanguage?: null|string,
* ResponseContentType?: null|string,
* ResponseExpires?: null|\DateTimeImmutable|string,
* VersionId?: null|string,
* SSECustomerAlgorithm?: null|string,
* SSECustomerKey?: null|string,
Expand Down Expand Up @@ -335,6 +395,36 @@ public function getRequestPayer(): ?string
return $this->requestPayer;
}

public function getResponseCacheControl(): ?string
{
return $this->responseCacheControl;
}

public function getResponseContentDisposition(): ?string
{
return $this->responseContentDisposition;
}

public function getResponseContentEncoding(): ?string
{
return $this->responseContentEncoding;
}

public function getResponseContentLanguage(): ?string
{
return $this->responseContentLanguage;
}

public function getResponseContentType(): ?string
{
return $this->responseContentType;
}

public function getResponseExpires(): ?\DateTimeImmutable
{
return $this->responseExpires;
}

public function getSseCustomerAlgorithm(): ?string
{
return $this->sseCustomerAlgorithm;
Expand Down Expand Up @@ -404,6 +494,24 @@ public function request(): Request

// Prepare query
$query = [];
if (null !== $this->responseCacheControl) {
$query['response-cache-control'] = $this->responseCacheControl;
}
if (null !== $this->responseContentDisposition) {
$query['response-content-disposition'] = $this->responseContentDisposition;
}
if (null !== $this->responseContentEncoding) {
$query['response-content-encoding'] = $this->responseContentEncoding;
}
if (null !== $this->responseContentLanguage) {
$query['response-content-language'] = $this->responseContentLanguage;
}
if (null !== $this->responseContentType) {
$query['response-content-type'] = $this->responseContentType;
}
if (null !== $this->responseExpires) {
$query['response-expires'] = $this->responseExpires->setTimezone(new \DateTimeZone('GMT'))->format(\DateTimeInterface::RFC7231);
}
if (null !== $this->versionId) {
$query['versionId'] = $this->versionId;
}
Expand Down Expand Up @@ -513,6 +621,48 @@ public function setRequestPayer(?string $value): self
return $this;
}

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

return $this;
}

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

return $this;
}

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

return $this;
}

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

return $this;
}

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

return $this;
}

public function setResponseExpires(?\DateTimeImmutable $value): self
{
$this->responseExpires = $value;

return $this;
}

public function setSseCustomerAlgorithm(?string $value): self
{
$this->sseCustomerAlgorithm = $value;
Expand Down
4 changes: 2 additions & 2 deletions src/Service/S3/src/Input/ListObjectsV2Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ final class ListObjectsV2Request extends Input

/**
* Encoding type used by Amazon S3 to encode object keys in the response. If using `url`, non-ASCII characters used in
* an object's key name will be URL encoded. For example, the object test_file(3).png will appear as
* test_file%283%29.png.
* an object's key name will be URL encoded. For example, the object `test_file(3).png` will appear as
* `test_file%283%29.png`.
*
* @var EncodingType::*|null
*/
Expand Down
30 changes: 24 additions & 6 deletions src/Service/S3/src/S3Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ public function completeMultipartUpload($input): CompleteMultipartUploadOutput
*
* When the request is an HTTP 1.1 request, the response is chunk encoded. When the request is not an HTTP 1.1
* request, the response would not contain the `Content-Length`. You always need to read the entire response body to
* check if the copy succeeds. to keep the connection alive while we copy the data.
* check if the copy succeeds.
*
* - If the copy is successful, you receive a response with information about the copied object.
* - A copy request might return an error when Amazon S3 receives the copy request or while Amazon S3 is copying the
Expand Down Expand Up @@ -1099,7 +1099,7 @@ public function deleteObjectTagging($input): DeleteObjectTaggingOutput
*
* - **`s3:DeleteObject`** - To delete an object from a bucket, you must always specify the `s3:DeleteObject`
* permission.
* - **`s3:DeleteObjectVersion`** - To delete a specific version of an object from a versiong-enabled bucket, you
* - **`s3:DeleteObjectVersion`** - To delete a specific version of an object from a versioning-enabled bucket, you
* must specify the `s3:DeleteObjectVersion` permission.
*
* - **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that
Expand Down Expand Up @@ -1612,6 +1612,12 @@ public function getObjectTagging($input): GetObjectTaggingOutput
* IfUnmodifiedSince?: null|\DateTimeImmutable|string,
* Key: string,
* Range?: null|string,
* ResponseCacheControl?: null|string,
* ResponseContentDisposition?: null|string,
* ResponseContentEncoding?: null|string,
* ResponseContentLanguage?: null|string,
* ResponseContentType?: null|string,
* ResponseExpires?: null|\DateTimeImmutable|string,
* VersionId?: null|string,
* SSECustomerAlgorithm?: null|string,
* SSECustomerKey?: null|string,
Expand Down Expand Up @@ -2007,6 +2013,12 @@ public function listParts($input): ListPartsOutput
* IfUnmodifiedSince?: null|\DateTimeImmutable|string,
* Key: string,
* Range?: null|string,
* ResponseCacheControl?: null|string,
* ResponseContentDisposition?: null|string,
* ResponseContentEncoding?: null|string,
* ResponseContentLanguage?: null|string,
* ResponseContentType?: null|string,
* ResponseExpires?: null|\DateTimeImmutable|string,
* VersionId?: null|string,
* SSECustomerAlgorithm?: null|string,
* SSECustomerKey?: null|string,
Expand Down Expand Up @@ -2039,6 +2051,12 @@ public function objectExists($input): ObjectExistsWaiter
* IfUnmodifiedSince?: null|\DateTimeImmutable|string,
* Key: string,
* Range?: null|string,
* ResponseCacheControl?: null|string,
* ResponseContentDisposition?: null|string,
* ResponseContentEncoding?: null|string,
* ResponseContentLanguage?: null|string,
* ResponseContentType?: null|string,
* ResponseExpires?: null|\DateTimeImmutable|string,
* VersionId?: null|string,
* SSECustomerAlgorithm?: null|string,
* SSECustomerKey?: null|string,
Expand Down Expand Up @@ -2803,13 +2821,13 @@ public function uploadPart($input): UploadPartOutput
* - If the destination bucket is a general purpose bucket, you must have the **`s3:PutObject`** permission to write
* the object copy to the destination bucket.
*
* For information about permissions required to use the multipart upload API, see Multipart Upload and Permissions
* [^7] in the *Amazon S3 User Guide*.
* For information about permissions required to use the multipart upload API, see Multipart upload API and
* permissions [^7] in the *Amazon S3 User Guide*.
* - **Directory bucket permissions** - You must have permissions in a bucket policy or an IAM identity-based policy
* based on the source and destination bucket types in an `UploadPartCopy` operation.
*
* - If the source object that you want to copy is in a directory bucket, you must have the
* **`s3express:CreateSession`** permission in the `Action` element of a policy to read the object . By default,
* **`s3express:CreateSession`** permission in the `Action` element of a policy to read the object. By default,
* the session is in the `ReadWrite` mode. If you want to restrict the access, you can explicitly set the
* `s3express:SessionMode` condition key to `ReadOnly` on the copy source bucket.
* - If the copy destination is a directory bucket, you must have the **`s3express:CreateSession`** permission in
Expand Down Expand Up @@ -2859,7 +2877,7 @@ public function uploadPart($input): UploadPartOutput
* [^4]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectOperations.html
* [^5]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html
* [^6]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html
* [^7]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html
* [^7]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html#mpuAndPermissions
* [^8]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html
* [^9]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-identity-policies.html
* [^10]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html
Expand Down

0 comments on commit 30c4933

Please sign in to comment.