Skip to content

Commit fa0df1c

Browse files
Update generated code (#1633)
* update generated code * Update src/Service/RdsDataService/CHANGELOG.md --------- Co-authored-by: Jérémy Derussé <jeremy@derusse.com>
1 parent c05b436 commit fa0df1c

8 files changed

+84
-1
lines changed

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+
### Added
6+
7+
- AWS api-change: AWS CodeCommit now supports customer managed keys from AWS Key Management Service. UpdateRepositoryEncryptionKey is added for updating the key configuration. CreateRepository, GetRepository, BatchGetRepositories are updated with new input or output parameters.
8+
59
## 1.0.2
610

711
### Changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
},
2828
"extra": {
2929
"branch-alias": {
30-
"dev-master": "1.0-dev"
30+
"dev-master": "1.1-dev"
3131
}
3232
}
3333
}

src/CodeCommitClient.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
use AsyncAws\CodeCommit\Exception\EncryptionIntegrityChecksFailedException;
1616
use AsyncAws\CodeCommit\Exception\EncryptionKeyAccessDeniedException;
1717
use AsyncAws\CodeCommit\Exception\EncryptionKeyDisabledException;
18+
use AsyncAws\CodeCommit\Exception\EncryptionKeyInvalidIdException;
19+
use AsyncAws\CodeCommit\Exception\EncryptionKeyInvalidUsageException;
1820
use AsyncAws\CodeCommit\Exception\EncryptionKeyNotFoundException;
1921
use AsyncAws\CodeCommit\Exception\EncryptionKeyUnavailableException;
2022
use AsyncAws\CodeCommit\Exception\FileTooLargeException;
@@ -86,6 +88,7 @@ class CodeCommitClient extends AbstractApi
8688
* repositoryName: string,
8789
* repositoryDescription?: null|string,
8890
* tags?: null|array<string, string>,
91+
* kmsKeyId?: null|string,
8992
* '@region'?: string|null,
9093
* }|CreateRepositoryInput $input
9194
*
@@ -99,6 +102,8 @@ class CodeCommitClient extends AbstractApi
99102
* @throws EncryptionKeyDisabledException
100103
* @throws EncryptionKeyNotFoundException
101104
* @throws EncryptionKeyUnavailableException
105+
* @throws EncryptionKeyInvalidIdException
106+
* @throws EncryptionKeyInvalidUsageException
102107
* @throws InvalidTagsMapException
103108
* @throws TooManyTagsException
104109
* @throws InvalidSystemTagUsageException
@@ -118,6 +123,8 @@ public function createRepository($input): CreateRepositoryOutput
118123
'EncryptionKeyDisabledException' => EncryptionKeyDisabledException::class,
119124
'EncryptionKeyNotFoundException' => EncryptionKeyNotFoundException::class,
120125
'EncryptionKeyUnavailableException' => EncryptionKeyUnavailableException::class,
126+
'EncryptionKeyInvalidIdException' => EncryptionKeyInvalidIdException::class,
127+
'EncryptionKeyInvalidUsageException' => EncryptionKeyInvalidUsageException::class,
121128
'InvalidTagsMapException' => InvalidTagsMapException::class,
122129
'TooManyTagsException' => TooManyTagsException::class,
123130
'InvalidSystemTagUsageException' => InvalidSystemTagUsageException::class,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
namespace AsyncAws\CodeCommit\Exception;
4+
5+
use AsyncAws\Core\Exception\Http\ClientException;
6+
7+
/**
8+
* The Key Management Service encryption key is not valid.
9+
*/
10+
final class EncryptionKeyInvalidIdException extends ClientException
11+
{
12+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace AsyncAws\CodeCommit\Exception;
4+
5+
use AsyncAws\Core\Exception\Http\ClientException;
6+
7+
/**
8+
* A KMS encryption key was used to try and encrypt or decrypt a repository, but either the repository or the key was
9+
* not in a valid state to support the operation.
10+
*/
11+
final class EncryptionKeyInvalidUsageException extends ClientException
12+
{
13+
}

src/Input/CreateRepositoryInput.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,25 @@ final class CreateRepositoryInput extends Input
4747
*/
4848
private $tags;
4949

50+
/**
51+
* The ID of the encryption key. You can view the ID of an encryption key in the KMS console, or use the KMS APIs to
52+
* programmatically retrieve a key ID. For more information about acceptable values for kmsKeyID, see KeyId [^1] in the
53+
* Decrypt API description in the *Key Management Service API Reference*.
54+
*
55+
* If no key is specified, the default `aws/codecommit` Amazon Web Services managed key is used.
56+
*
57+
* [^1]: https://docs.aws.amazon.com/APIReference/API_Decrypt.html#KMS-Decrypt-request-KeyId
58+
*
59+
* @var string|null
60+
*/
61+
private $kmsKeyId;
62+
5063
/**
5164
* @param array{
5265
* repositoryName?: string,
5366
* repositoryDescription?: null|string,
5467
* tags?: null|array<string, string>,
68+
* kmsKeyId?: null|string,
5569
* '@region'?: string|null,
5670
* } $input
5771
*/
@@ -60,6 +74,7 @@ public function __construct(array $input = [])
6074
$this->repositoryName = $input['repositoryName'] ?? null;
6175
$this->repositoryDescription = $input['repositoryDescription'] ?? null;
6276
$this->tags = $input['tags'] ?? null;
77+
$this->kmsKeyId = $input['kmsKeyId'] ?? null;
6378
parent::__construct($input);
6479
}
6580

@@ -68,6 +83,7 @@ public function __construct(array $input = [])
6883
* repositoryName?: string,
6984
* repositoryDescription?: null|string,
7085
* tags?: null|array<string, string>,
86+
* kmsKeyId?: null|string,
7187
* '@region'?: string|null,
7288
* }|CreateRepositoryInput $input
7389
*/
@@ -76,6 +92,11 @@ public static function create($input): self
7692
return $input instanceof self ? $input : new self($input);
7793
}
7894

95+
public function getKmsKeyId(): ?string
96+
{
97+
return $this->kmsKeyId;
98+
}
99+
79100
public function getRepositoryDescription(): ?string
80101
{
81102
return $this->repositoryDescription;
@@ -119,6 +140,13 @@ public function request(): Request
119140
return new Request('POST', $uriString, $query, $headers, StreamFactory::create($body));
120141
}
121142

143+
public function setKmsKeyId(?string $value): self
144+
{
145+
$this->kmsKeyId = $value;
146+
147+
return $this;
148+
}
149+
122150
public function setRepositoryDescription(?string $value): self
123151
{
124152
$this->repositoryDescription = $value;
@@ -163,6 +191,9 @@ private function requestBody(): array
163191
}
164192
}
165193
}
194+
if (null !== $v = $this->kmsKeyId) {
195+
$payload['kmsKeyId'] = $v;
196+
}
166197

167198
return $payload;
168199
}

src/Result/CreateRepositoryOutput.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ private function populateResultRepositoryMetadata(array $json): RepositoryMetada
4545
'cloneUrlHttp' => isset($json['cloneUrlHttp']) ? (string) $json['cloneUrlHttp'] : null,
4646
'cloneUrlSsh' => isset($json['cloneUrlSsh']) ? (string) $json['cloneUrlSsh'] : null,
4747
'Arn' => isset($json['Arn']) ? (string) $json['Arn'] : null,
48+
'kmsKeyId' => isset($json['kmsKeyId']) ? (string) $json['kmsKeyId'] : null,
4849
]);
4950
}
5051
}

src/ValueObject/RepositoryMetadata.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ final class RepositoryMetadata
7777
*/
7878
private $arn;
7979

80+
/**
81+
* The ID of the Key Management Service encryption key used to encrypt and decrypt the repository.
82+
*
83+
* @var string|null
84+
*/
85+
private $kmsKeyId;
86+
8087
/**
8188
* @param array{
8289
* accountId?: null|string,
@@ -89,6 +96,7 @@ final class RepositoryMetadata
8996
* cloneUrlHttp?: null|string,
9097
* cloneUrlSsh?: null|string,
9198
* Arn?: null|string,
99+
* kmsKeyId?: null|string,
92100
* } $input
93101
*/
94102
public function __construct(array $input)
@@ -103,6 +111,7 @@ public function __construct(array $input)
103111
$this->cloneUrlHttp = $input['cloneUrlHttp'] ?? null;
104112
$this->cloneUrlSsh = $input['cloneUrlSsh'] ?? null;
105113
$this->arn = $input['Arn'] ?? null;
114+
$this->kmsKeyId = $input['kmsKeyId'] ?? null;
106115
}
107116

108117
/**
@@ -117,6 +126,7 @@ public function __construct(array $input)
117126
* cloneUrlHttp?: null|string,
118127
* cloneUrlSsh?: null|string,
119128
* Arn?: null|string,
129+
* kmsKeyId?: null|string,
120130
* }|RepositoryMetadata $input
121131
*/
122132
public static function create($input): self
@@ -154,6 +164,11 @@ public function getDefaultBranch(): ?string
154164
return $this->defaultBranch;
155165
}
156166

167+
public function getKmsKeyId(): ?string
168+
{
169+
return $this->kmsKeyId;
170+
}
171+
157172
public function getLastModifiedDate(): ?\DateTimeImmutable
158173
{
159174
return $this->lastModifiedDate;

0 commit comments

Comments
 (0)