Skip to content

Commit 82c6ffd

Browse files
author
awstools
committed
feat(client-secrets-manager): Add SortBy parameter to ListSecrets
1 parent b4aea82 commit 82c6ffd

File tree

7 files changed

+64
-3
lines changed

7 files changed

+64
-3
lines changed

clients/client-secrets-manager/src/commands/ListSecretsCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export interface ListSecretsCommandOutput extends ListSecretsResponse, __Metadat
7070
* },
7171
* ],
7272
* SortOrder: "asc" || "desc",
73+
* SortBy: "created-date" || "last-accessed-date" || "last-changed-date" || "name",
7374
* };
7475
* const command = new ListSecretsCommand(input);
7576
* const response = await client.send(command);

clients/client-secrets-manager/src/models/enums.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,21 @@ export const StatusType = {
3131
*/
3232
export type StatusType = (typeof StatusType)[keyof typeof StatusType];
3333

34+
/**
35+
* @public
36+
* @enum
37+
*/
38+
export const SortByType = {
39+
created_date: "created-date",
40+
last_accessed_date: "last-accessed-date",
41+
last_changed_date: "last-changed-date",
42+
name: "name",
43+
} as const;
44+
/**
45+
* @public
46+
*/
47+
export type SortByType = (typeof SortByType)[keyof typeof SortByType];
48+
3449
/**
3550
* @public
3651
* @enum

clients/client-secrets-manager/src/models/models_0.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// smithy-typescript generated code
2-
import { FilterNameStringType, SortOrderType, StatusType } from "./enums";
2+
import { FilterNameStringType, SortByType, SortOrderType, StatusType } from "./enums";
33

44
/**
55
* <p>A custom type that specifies a <code>Region</code> and the <code>KmsKeyId</code> for a
@@ -1153,6 +1153,12 @@ export interface ListSecretsRequest {
11531153
* @public
11541154
*/
11551155
SortOrder?: SortOrderType | undefined;
1156+
1157+
/**
1158+
* <p>If not specified, secrets are listed by <code>CreatedDate</code>.</p>
1159+
* @public
1160+
*/
1161+
SortBy?: SortByType | undefined;
11561162
}
11571163

11581164
/**

clients/client-secrets-manager/src/schemas/schemas_0.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ const _RWID = "RecoveryWindowInDays";
133133
const _S = "Status";
134134
const _SB = "SecretBinary";
135135
const _SBT = "SecretBinaryType";
136+
const _SBo = "SortBy";
136137
const _SE = "ScheduleExpression";
137138
const _SI = "SecretId";
138139
const _SIL = "SecretIdList";
@@ -370,8 +371,8 @@ export var ListSecretsRequest: StaticStructureSchema = [
370371
n0,
371372
_LSR,
372373
0,
373-
[_IPD, _MR, _NT, _F, _SO],
374-
[2, 1, 0, () => FiltersListType, 0],
374+
[_IPD, _MR, _NT, _F, _SO, _SBo],
375+
[2, 1, 0, () => FiltersListType, 0, 0],
375376
];
376377
export var ListSecretsResponse: StaticStructureSchema = [3, n0, _LSRi, 0, [_SL, _NT], [() => SecretListType, 0]];
377378
export var ListSecretVersionIdsRequest: StaticStructureSchema = [3, n0, _LSVIR, 0, [_SI, _MR, _NT, _ID], [0, 1, 0, 2]];

clients/client-secrets-manager/test/index-objects.spec.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
SecretsManager,
3333
SecretsManagerClient,
3434
SecretsManagerServiceException,
35+
SortByType,
3536
SortOrderType,
3637
StatusType,
3738
StopReplicationToReplicaCommand,
@@ -74,6 +75,7 @@ assert(typeof UpdateSecretVersionStageCommand === "function");
7475
assert(typeof ValidateResourcePolicyCommand === "function");
7576
// enums
7677
assert(typeof FilterNameStringType === "object");
78+
assert(typeof SortByType === "object");
7779
assert(typeof SortOrderType === "object");
7880
assert(typeof StatusType === "object");
7981
// errors

clients/client-secrets-manager/test/index-types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export type {
7272
ValidateResourcePolicyCommandInput,
7373
ValidateResourcePolicyCommandOutput,
7474
FilterNameStringType,
75+
SortByType,
7576
SortOrderType,
7677
StatusType,
7778
APIErrorType,

codegen/sdk-codegen/aws-models/secrets-manager.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,6 +1691,12 @@
16911691
"traits": {
16921692
"smithy.api#documentation": "<p>Secrets are listed by <code>CreatedDate</code>. </p>"
16931693
}
1694+
},
1695+
"SortBy": {
1696+
"target": "com.amazonaws.secretsmanager#SortByType",
1697+
"traits": {
1698+
"smithy.api#documentation": "<p>If not specified, secrets are listed by <code>CreatedDate</code>.</p>"
1699+
}
16941700
}
16951701
},
16961702
"traits": {
@@ -2969,6 +2975,35 @@
29692975
"target": "com.amazonaws.secretsmanager#SecretVersionStagesType"
29702976
}
29712977
},
2978+
"com.amazonaws.secretsmanager#SortByType": {
2979+
"type": "enum",
2980+
"members": {
2981+
"created_date": {
2982+
"target": "smithy.api#Unit",
2983+
"traits": {
2984+
"smithy.api#enumValue": "created-date"
2985+
}
2986+
},
2987+
"last_accessed_date": {
2988+
"target": "smithy.api#Unit",
2989+
"traits": {
2990+
"smithy.api#enumValue": "last-accessed-date"
2991+
}
2992+
},
2993+
"last_changed_date": {
2994+
"target": "smithy.api#Unit",
2995+
"traits": {
2996+
"smithy.api#enumValue": "last-changed-date"
2997+
}
2998+
},
2999+
"name": {
3000+
"target": "smithy.api#Unit",
3001+
"traits": {
3002+
"smithy.api#enumValue": "name"
3003+
}
3004+
}
3005+
}
3006+
},
29723007
"com.amazonaws.secretsmanager#SortOrderType": {
29733008
"type": "enum",
29743009
"members": {

0 commit comments

Comments
 (0)