Skip to content

Commit c77bea8

Browse files
Update generated code (#2008)
* update generated code * Fix tests * Remove ResultWrapper for JSON * Update src/Service/CloudWatch/CHANGELOG.md --------- Co-authored-by: Jérémy Derussé <[email protected]>
1 parent c354954 commit c77bea8

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- AWS api-change: Added `us-isob-west-1` region
88
- AWS api-change: Adds support to create, update, retrieve, rotate, and delete managed external secrets.
99
- AWS api-change: Added `eusc-de-east-1` region
10+
- AWS api-change: Add SortBy parameter to ListSecrets
1011

1112
### Dependency bumped
1213

src/Enum/SortByType.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace AsyncAws\SecretsManager\Enum;
4+
5+
final class SortByType
6+
{
7+
public const CREATED_DATE = 'created-date';
8+
public const LAST_ACCESSED_DATE = 'last-accessed-date';
9+
public const LAST_CHANGED_DATE = 'last-changed-date';
10+
public const NAME = 'name';
11+
12+
public static function exists(string $value): bool
13+
{
14+
return isset([
15+
self::CREATED_DATE => true,
16+
self::LAST_ACCESSED_DATE => true,
17+
self::LAST_CHANGED_DATE => true,
18+
self::NAME => true,
19+
][$value]);
20+
}
21+
}

src/Input/ListSecretsRequest.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use AsyncAws\Core\Input;
77
use AsyncAws\Core\Request;
88
use AsyncAws\Core\Stream\StreamFactory;
9+
use AsyncAws\SecretsManager\Enum\SortByType;
910
use AsyncAws\SecretsManager\Enum\SortOrderType;
1011
use AsyncAws\SecretsManager\ValueObject\Filter;
1112

@@ -51,13 +52,21 @@ final class ListSecretsRequest extends Input
5152
*/
5253
private $sortOrder;
5354

55+
/**
56+
* If not specified, secrets are listed by `CreatedDate`.
57+
*
58+
* @var SortByType::*|null
59+
*/
60+
private $sortBy;
61+
5462
/**
5563
* @param array{
5664
* IncludePlannedDeletion?: bool|null,
5765
* MaxResults?: int|null,
5866
* NextToken?: string|null,
5967
* Filters?: array<Filter|array>|null,
6068
* SortOrder?: SortOrderType::*|null,
69+
* SortBy?: SortByType::*|null,
6170
* '@region'?: string|null,
6271
* } $input
6372
*/
@@ -68,6 +77,7 @@ public function __construct(array $input = [])
6877
$this->nextToken = $input['NextToken'] ?? null;
6978
$this->filters = isset($input['Filters']) ? array_map([Filter::class, 'create'], $input['Filters']) : null;
7079
$this->sortOrder = $input['SortOrder'] ?? null;
80+
$this->sortBy = $input['SortBy'] ?? null;
7181
parent::__construct($input);
7282
}
7383

@@ -78,6 +88,7 @@ public function __construct(array $input = [])
7888
* NextToken?: string|null,
7989
* Filters?: array<Filter|array>|null,
8090
* SortOrder?: SortOrderType::*|null,
91+
* SortBy?: SortByType::*|null,
8192
* '@region'?: string|null,
8293
* }|ListSecretsRequest $input
8394
*/
@@ -109,6 +120,14 @@ public function getNextToken(): ?string
109120
return $this->nextToken;
110121
}
111122

123+
/**
124+
* @return SortByType::*|null
125+
*/
126+
public function getSortBy(): ?string
127+
{
128+
return $this->sortBy;
129+
}
130+
112131
/**
113132
* @return SortOrderType::*|null
114133
*/
@@ -174,6 +193,16 @@ public function setNextToken(?string $value): self
174193
return $this;
175194
}
176195

196+
/**
197+
* @param SortByType::*|null $value
198+
*/
199+
public function setSortBy(?string $value): self
200+
{
201+
$this->sortBy = $value;
202+
203+
return $this;
204+
}
205+
177206
/**
178207
* @param SortOrderType::*|null $value
179208
*/
@@ -210,6 +239,12 @@ private function requestBody(): array
210239
}
211240
$payload['SortOrder'] = $v;
212241
}
242+
if (null !== $v = $this->sortBy) {
243+
if (!SortByType::exists($v)) {
244+
throw new InvalidArgument(\sprintf('Invalid parameter "SortBy" for "%s". The value "%s" is not a valid "SortByType".', __CLASS__, $v));
245+
}
246+
$payload['SortBy'] = $v;
247+
}
213248

214249
return $payload;
215250
}

src/SecretsManagerClient.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use AsyncAws\Core\AwsError\JsonRpcAwsErrorFactory;
88
use AsyncAws\Core\Configuration;
99
use AsyncAws\Core\RequestContext;
10+
use AsyncAws\SecretsManager\Enum\SortByType;
1011
use AsyncAws\SecretsManager\Enum\SortOrderType;
1112
use AsyncAws\SecretsManager\Exception\DecryptionFailureException;
1213
use AsyncAws\SecretsManager\Exception\EncryptionFailureException;
@@ -293,6 +294,7 @@ public function getSecretValue($input): GetSecretValueResponse
293294
* NextToken?: string|null,
294295
* Filters?: array<Filter|array>|null,
295296
* SortOrder?: SortOrderType::*|null,
297+
* SortBy?: SortByType::*|null,
296298
* '@region'?: string|null,
297299
* }|ListSecretsRequest $input
298300
*

0 commit comments

Comments
 (0)