Skip to content

Commit 6dd43df

Browse files
authored
DateTimeInterface::ISO8601 Incompatibility with ISO8601 (#1576)
* Incompatibility DateTimeInterface::ISO8601 * Revert "Incompatibility DateTimeInterface::ISO8601" This reverts commit 4b5264a. * CodeGenerator DateTimeInterface::ATOM vs ISO8601 * Check timestampFormat Return * Generate All * Changelog fixed ATOM vs ISO8601 * iso8601 / timestampFormat * Description of what is fixed
1 parent b15f8a3 commit 6dd43df

File tree

5 files changed

+11
-3
lines changed

5 files changed

+11
-3
lines changed

src/CodeGenerator/src/Generator/InputGenerator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,10 @@ private function stringify(string $variable, Member $member, string $part): stri
562562
switch ($shape->getType()) {
563563
case 'timestamp':
564564
$format = strtoupper($shape->get('timestampFormat') ?? ('header' === $part ? 'rfc822' : 'iso8601'));
565+
if ('ISO8601' === $format) {
566+
$format = 'ATOM';
567+
}
568+
565569
if (!\defined('\DateTimeInterface::' . $format)) {
566570
throw new \InvalidArgumentException('Constant "\DateTimeInterface::' . $format . '" does not exists.');
567571
}

src/Service/S3/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## NOT RELEASED
44

5+
### Fixed
6+
7+
- Fix the format of the `objectLockRetainUntilDate` field in requests
8+
59
### Changed
610

711
- Allow passing explicit null values for optional fields of input objects

src/Service/S3/src/Input/CopyObjectRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ public function request(): Request
906906
$headers['x-amz-object-lock-mode'] = $this->objectLockMode;
907907
}
908908
if (null !== $this->objectLockRetainUntilDate) {
909-
$headers['x-amz-object-lock-retain-until-date'] = $this->objectLockRetainUntilDate->format(\DateTimeInterface::ISO8601);
909+
$headers['x-amz-object-lock-retain-until-date'] = $this->objectLockRetainUntilDate->format(\DateTimeInterface::ATOM);
910910
}
911911
if (null !== $this->objectLockLegalHoldStatus) {
912912
if (!ObjectLockLegalHoldStatus::exists($this->objectLockLegalHoldStatus)) {

src/Service/S3/src/Input/CreateMultipartUploadRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ public function request(): Request
652652
$headers['x-amz-object-lock-mode'] = $this->objectLockMode;
653653
}
654654
if (null !== $this->objectLockRetainUntilDate) {
655-
$headers['x-amz-object-lock-retain-until-date'] = $this->objectLockRetainUntilDate->format(\DateTimeInterface::ISO8601);
655+
$headers['x-amz-object-lock-retain-until-date'] = $this->objectLockRetainUntilDate->format(\DateTimeInterface::ATOM);
656656
}
657657
if (null !== $this->objectLockLegalHoldStatus) {
658658
if (!ObjectLockLegalHoldStatus::exists($this->objectLockLegalHoldStatus)) {

src/Service/S3/src/Input/PutObjectRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ public function request(): Request
851851
$headers['x-amz-object-lock-mode'] = $this->objectLockMode;
852852
}
853853
if (null !== $this->objectLockRetainUntilDate) {
854-
$headers['x-amz-object-lock-retain-until-date'] = $this->objectLockRetainUntilDate->format(\DateTimeInterface::ISO8601);
854+
$headers['x-amz-object-lock-retain-until-date'] = $this->objectLockRetainUntilDate->format(\DateTimeInterface::ATOM);
855855
}
856856
if (null !== $this->objectLockLegalHoldStatus) {
857857
if (!ObjectLockLegalHoldStatus::exists($this->objectLockLegalHoldStatus)) {

0 commit comments

Comments
 (0)