Skip to content

Commit

Permalink
feat(client-location): This release introduces a new parameter to byp…
Browse files Browse the repository at this point in the history
…asses an API key's expiry conditions and delete the key.
  • Loading branch information
awstools committed Dec 29, 2023
1 parent 8b874f7 commit e713dfd
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
1 change: 1 addition & 0 deletions clients/client-location/src/commands/DeleteKeyCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export interface DeleteKeyCommandOutput extends DeleteKeyResponse, __MetadataBea
* const client = new LocationClient(config);
* const input = { // DeleteKeyRequest
* KeyName: "STRING_VALUE", // required
* ForceDelete: true || false,
* };
* const command = new DeleteKeyCommand(input);
* const response = await client.send(command);
Expand Down
13 changes: 12 additions & 1 deletion clients/client-location/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export interface ApiKeyRestrictions {
* <li>
* <p>Other than wildcards, you must include the full ARN, including the
* <code>arn</code>, <code>partition</code>, <code>service</code>,
* <code>region</code>, <code>account-id</code> and <code>resource-id</code>,
* <code>region</code>, <code>account-id</code> and <code>resource-id</code>
* delimited by colons (:).</p>
* </li>
* <li>
Expand Down Expand Up @@ -469,6 +469,17 @@ export interface DeleteKeyRequest {
* <p>The name of the API key to delete.</p>
*/
KeyName: string | undefined;

/**
* @public
* <p>ForceDelete bypasses an API key's expiry conditions and deletes the key. Set the parameter <code>true</code> to delete the key or to <code>false</code> to not preemptively delete the API key.</p>
* <p>Valid values: <code>true</code>, or <code>false</code>.</p>
* <p>Required: No</p>
* <note>
* <p>This action is irreversible. Only use ForceDelete if you are certain the key is no longer in use.</p>
* </note>
*/
ForceDelete?: boolean;
}

/**
Expand Down
7 changes: 6 additions & 1 deletion clients/client-location/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,9 @@ export const se_DeleteKeyCommand = async (
const headers: any = {};
b.bp("/metadata/v0/keys/{KeyName}");
b.p("KeyName", () => input.KeyName!, "{KeyName}", false);
const query: any = map({
[_fD]: [() => input.ForceDelete !== void 0, () => input[_FD]!.toString()],
});
let body: any;
let { hostname: resolvedHostname } = await context.endpoint();
if (context.disableHostPrefix !== true) {
Expand All @@ -774,7 +777,7 @@ export const se_DeleteKeyCommand = async (
}
}
b.hn(resolvedHostname);
b.m("DELETE").h(headers).b(body);
b.m("DELETE").h(headers).q(query).b(body);
return b.build();
};

Expand Down Expand Up @@ -6594,11 +6597,13 @@ const isSerializableHeaderValue = (value: any): boolean =>

const _CC = "CacheControl";
const _CT = "ContentType";
const _FD = "ForceDelete";
const _K = "Key";
const _L = "Language";
const _TK = "TagKeys";
const _cc = "cache-control";
const _ct = "content-type";
const _fD = "forceDelete";
const _k = "key";
const _l = "language";
const _tK = "tagKeys";
Expand Down
9 changes: 8 additions & 1 deletion codegen/sdk-codegen/aws-models/location.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"AllowResources": {
"target": "com.amazonaws.location#GeoArnList",
"traits": {
"smithy.api#documentation": "<p>A list of allowed resource ARNs that a API key bearer can perform actions on.</p>\n <ul>\n <li>\n <p>The ARN must be the correct ARN for a map, place, or route ARN. You may \n include wildcards in the resource-id to match multiple resources of the \n same type.</p>\n </li>\n <li>\n <p>The resources must be in the same <code>partition</code>, \n <code>region</code>, and <code>account-id</code> as the key that is being \n created.</p>\n </li>\n <li>\n <p>Other than wildcards, you must include the full ARN, including the \n <code>arn</code>, <code>partition</code>, <code>service</code>,\n <code>region</code>, <code>account-id</code> and <code>resource-id</code>,\n delimited by colons (:).</p>\n </li>\n <li>\n <p>No spaces allowed, even with wildcards. For example,\n <code>arn:aws:geo:region:<i>account-id</i>:map/ExampleMap*</code>.</p>\n </li>\n </ul>\n <p>For more information about ARN format, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Names\n (ARNs)</a>.</p>",
"smithy.api#documentation": "<p>A list of allowed resource ARNs that a API key bearer can perform actions on.</p>\n <ul>\n <li>\n <p>The ARN must be the correct ARN for a map, place, or route ARN. You may \n include wildcards in the resource-id to match multiple resources of the \n same type.</p>\n </li>\n <li>\n <p>The resources must be in the same <code>partition</code>, \n <code>region</code>, and <code>account-id</code> as the key that is being \n created.</p>\n </li>\n <li>\n <p>Other than wildcards, you must include the full ARN, including the \n <code>arn</code>, <code>partition</code>, <code>service</code>,\n <code>region</code>, <code>account-id</code> and <code>resource-id</code>\n delimited by colons (:).</p>\n </li>\n <li>\n <p>No spaces allowed, even with wildcards. For example,\n <code>arn:aws:geo:region:<i>account-id</i>:map/ExampleMap*</code>.</p>\n </li>\n </ul>\n <p>For more information about ARN format, see <a href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\">Amazon Resource Names\n (ARNs)</a>.</p>",
"smithy.api#length": {
"min": 1,
"max": 5
Expand Down Expand Up @@ -2331,6 +2331,13 @@
"smithy.api#httpLabel": {},
"smithy.api#required": {}
}
},
"ForceDelete": {
"target": "smithy.api#Boolean",
"traits": {
"smithy.api#documentation": "<p>ForceDelete bypasses an API key's expiry conditions and deletes the key. Set the parameter <code>true</code> to delete the key or to <code>false</code> to not preemptively delete the API key.</p>\n <p>Valid values: <code>true</code>, or <code>false</code>.</p>\n <p>Required: No</p>\n <note>\n <p>This action is irreversible. Only use ForceDelete if you are certain the key is no longer in use.</p>\n </note>",
"smithy.api#httpQuery": "forceDelete"
}
}
}
},
Expand Down

0 comments on commit e713dfd

Please sign in to comment.