From c35b7218f429afc977952724aacd4b20c65e56b5 Mon Sep 17 00:00:00 2001 From: awstools Date: Mon, 16 Sep 2024 18:23:01 +0000 Subject: [PATCH] feat(client-rds): Launching Global Cluster tagging. --- .../commands/CreateGlobalClusterCommand.ts | 12 +++ .../commands/DeleteGlobalClusterCommand.ts | 6 ++ .../commands/DescribeGlobalClustersCommand.ts | 6 ++ .../commands/FailoverGlobalClusterCommand.ts | 6 ++ .../commands/ListTagsForResourceCommand.ts | 4 +- .../commands/ModifyGlobalClusterCommand.ts | 6 ++ .../RemoveFromGlobalClusterCommand.ts | 6 ++ .../commands/RemoveTagsFromResourceCommand.ts | 5 +- .../SwitchoverGlobalClusterCommand.ts | 6 ++ clients/client-rds/src/models/models_0.ts | 83 +++++-------------- clients/client-rds/src/protocols/Aws_query.ts | 15 ++++ codegen/sdk-codegen/aws-models/rds.json | 17 +++- 12 files changed, 101 insertions(+), 71 deletions(-) diff --git a/clients/client-rds/src/commands/CreateGlobalClusterCommand.ts b/clients/client-rds/src/commands/CreateGlobalClusterCommand.ts index 7f8138b15d9b..2917ed849b5b 100644 --- a/clients/client-rds/src/commands/CreateGlobalClusterCommand.ts +++ b/clients/client-rds/src/commands/CreateGlobalClusterCommand.ts @@ -56,6 +56,12 @@ export interface CreateGlobalClusterCommandOutput extends CreateGlobalClusterRes * DeletionProtection: true || false, * DatabaseName: "STRING_VALUE", * StorageEncrypted: true || false, + * Tags: [ // TagList + * { // Tag + * Key: "STRING_VALUE", + * Value: "STRING_VALUE", + * }, + * ], * }; * const command = new CreateGlobalClusterCommand(input); * const response = await client.send(command); @@ -88,6 +94,12 @@ export interface CreateGlobalClusterCommandOutput extends CreateGlobalClusterRes * // ToDbClusterArn: "STRING_VALUE", * // IsDataLossAllowed: true || false, * // }, + * // TagList: [ // TagList + * // { // Tag + * // Key: "STRING_VALUE", + * // Value: "STRING_VALUE", + * // }, + * // ], * // }, * // }; * diff --git a/clients/client-rds/src/commands/DeleteGlobalClusterCommand.ts b/clients/client-rds/src/commands/DeleteGlobalClusterCommand.ts index 56969a99b501..4fee179177cf 100644 --- a/clients/client-rds/src/commands/DeleteGlobalClusterCommand.ts +++ b/clients/client-rds/src/commands/DeleteGlobalClusterCommand.ts @@ -73,6 +73,12 @@ export interface DeleteGlobalClusterCommandOutput extends DeleteGlobalClusterRes * // ToDbClusterArn: "STRING_VALUE", * // IsDataLossAllowed: true || false, * // }, + * // TagList: [ // TagList + * // { // Tag + * // Key: "STRING_VALUE", + * // Value: "STRING_VALUE", + * // }, + * // ], * // }, * // }; * diff --git a/clients/client-rds/src/commands/DescribeGlobalClustersCommand.ts b/clients/client-rds/src/commands/DescribeGlobalClustersCommand.ts index 1c1fadac8922..2b9e5fcf7dac 100644 --- a/clients/client-rds/src/commands/DescribeGlobalClustersCommand.ts +++ b/clients/client-rds/src/commands/DescribeGlobalClustersCommand.ts @@ -86,6 +86,12 @@ export interface DescribeGlobalClustersCommandOutput extends GlobalClustersMessa * // ToDbClusterArn: "STRING_VALUE", * // IsDataLossAllowed: true || false, * // }, + * // TagList: [ // TagList + * // { // Tag + * // Key: "STRING_VALUE", + * // Value: "STRING_VALUE", + * // }, + * // ], * // }, * // ], * // }; diff --git a/clients/client-rds/src/commands/FailoverGlobalClusterCommand.ts b/clients/client-rds/src/commands/FailoverGlobalClusterCommand.ts index cfac2c607685..634e60ebf32e 100644 --- a/clients/client-rds/src/commands/FailoverGlobalClusterCommand.ts +++ b/clients/client-rds/src/commands/FailoverGlobalClusterCommand.ts @@ -107,6 +107,12 @@ export interface FailoverGlobalClusterCommandOutput extends FailoverGlobalCluste * // ToDbClusterArn: "STRING_VALUE", * // IsDataLossAllowed: true || false, * // }, + * // TagList: [ // TagList + * // { // Tag + * // Key: "STRING_VALUE", + * // Value: "STRING_VALUE", + * // }, + * // ], * // }, * // }; * diff --git a/clients/client-rds/src/commands/ListTagsForResourceCommand.ts b/clients/client-rds/src/commands/ListTagsForResourceCommand.ts index 97b3d63c4aed..0609036e0800 100644 --- a/clients/client-rds/src/commands/ListTagsForResourceCommand.ts +++ b/clients/client-rds/src/commands/ListTagsForResourceCommand.ts @@ -30,8 +30,8 @@ export interface ListTagsForResourceCommandOutput extends TagListMessage, __Meta /** *

Lists all tags on an Amazon RDS resource.

*

For an overview on tagging an Amazon RDS resource, - * see Tagging Amazon RDS Resources - * in the Amazon RDS User Guide.

+ * see Tagging Amazon RDS Resources in the Amazon RDS User Guide + * or Tagging Amazon Aurora and Amazon RDS Resources in the Amazon Aurora User Guide.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript diff --git a/clients/client-rds/src/commands/ModifyGlobalClusterCommand.ts b/clients/client-rds/src/commands/ModifyGlobalClusterCommand.ts index 3d5cd994f76c..cc93437320d6 100644 --- a/clients/client-rds/src/commands/ModifyGlobalClusterCommand.ts +++ b/clients/client-rds/src/commands/ModifyGlobalClusterCommand.ts @@ -79,6 +79,12 @@ export interface ModifyGlobalClusterCommandOutput extends ModifyGlobalClusterRes * // ToDbClusterArn: "STRING_VALUE", * // IsDataLossAllowed: true || false, * // }, + * // TagList: [ // TagList + * // { // Tag + * // Key: "STRING_VALUE", + * // Value: "STRING_VALUE", + * // }, + * // ], * // }, * // }; * diff --git a/clients/client-rds/src/commands/RemoveFromGlobalClusterCommand.ts b/clients/client-rds/src/commands/RemoveFromGlobalClusterCommand.ts index d0fb6d8ea0cf..b976f6e6f60e 100644 --- a/clients/client-rds/src/commands/RemoveFromGlobalClusterCommand.ts +++ b/clients/client-rds/src/commands/RemoveFromGlobalClusterCommand.ts @@ -75,6 +75,12 @@ export interface RemoveFromGlobalClusterCommandOutput extends RemoveFromGlobalCl * // ToDbClusterArn: "STRING_VALUE", * // IsDataLossAllowed: true || false, * // }, + * // TagList: [ // TagList + * // { // Tag + * // Key: "STRING_VALUE", + * // Value: "STRING_VALUE", + * // }, + * // ], * // }, * // }; * diff --git a/clients/client-rds/src/commands/RemoveTagsFromResourceCommand.ts b/clients/client-rds/src/commands/RemoveTagsFromResourceCommand.ts index 55df2edcaa84..add7f8ad4efa 100644 --- a/clients/client-rds/src/commands/RemoveTagsFromResourceCommand.ts +++ b/clients/client-rds/src/commands/RemoveTagsFromResourceCommand.ts @@ -30,9 +30,8 @@ export interface RemoveTagsFromResourceCommandOutput extends __MetadataBearer {} /** *

Removes metadata tags from an Amazon RDS resource.

*

For an overview on tagging an Amazon RDS resource, - * see Tagging Amazon RDS Resources - * in the Amazon RDS User Guide. - *

+ * see Tagging Amazon RDS Resources in the Amazon RDS User Guide + * or Tagging Amazon Aurora and Amazon RDS Resources in the Amazon Aurora User Guide.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript diff --git a/clients/client-rds/src/commands/SwitchoverGlobalClusterCommand.ts b/clients/client-rds/src/commands/SwitchoverGlobalClusterCommand.ts index be502241462a..592bf045429d 100644 --- a/clients/client-rds/src/commands/SwitchoverGlobalClusterCommand.ts +++ b/clients/client-rds/src/commands/SwitchoverGlobalClusterCommand.ts @@ -80,6 +80,12 @@ export interface SwitchoverGlobalClusterCommandOutput extends SwitchoverGlobalCl * // ToDbClusterArn: "STRING_VALUE", * // IsDataLossAllowed: true || false, * // }, + * // TagList: [ // TagList + * // { // Tag + * // Key: "STRING_VALUE", + * // Value: "STRING_VALUE", + * // }, + * // ], * // }, * // }; * diff --git a/clients/client-rds/src/models/models_0.ts b/clients/client-rds/src/models/models_0.ts index 851941cad241..3140a30f72e6 100644 --- a/clients/client-rds/src/models/models_0.ts +++ b/clients/client-rds/src/models/models_0.ts @@ -771,37 +771,9 @@ export interface ApplyPendingMaintenanceActionMessage { /** *

The pending maintenance action to apply to this resource.

- *

Valid Values:

- * - *

For more information about these actions, see - * Maintenance actions for Amazon Aurora or - * Maintenance actions for Amazon RDS.

+ *

Valid Values: system-update, db-upgrade, + * hardware-maintenance, ca-certificate-rotation + *

* @public */ ApplyAction: string | undefined; @@ -839,37 +811,8 @@ export interface PendingMaintenanceAction { /** *

The type of pending maintenance action that is available for the resource.

*

For more information about maintenance actions, see Maintaining a DB instance.

- *

Valid Values:

- * - *

For more information about these actions, see - * Maintenance actions for Amazon Aurora or - * Maintenance actions for Amazon RDS.

+ *

Valid Values: system-update | db-upgrade | hardware-maintenance | ca-certificate-rotation + *

* @public */ Action?: string; @@ -12237,6 +12180,12 @@ export interface CreateGlobalClusterMessage { * @public */ StorageEncrypted?: boolean; + + /** + *

Tags to assign to the global cluster.

+ * @public + */ + Tags?: Tag[]; } /** @@ -12442,6 +12391,16 @@ export interface GlobalCluster { * @public */ FailoverState?: FailoverState; + + /** + *

A list of tags.

+ *

For more information, see + * Tagging Amazon RDS resources in the Amazon RDS User Guide or + * Tagging Amazon Aurora and Amazon RDS resources in the Amazon Aurora User Guide. + *

+ * @public + */ + TagList?: Tag[]; } /** diff --git a/clients/client-rds/src/protocols/Aws_query.ts b/clients/client-rds/src/protocols/Aws_query.ts index b9e5baaa3485..f24cca9ee451 100644 --- a/clients/client-rds/src/protocols/Aws_query.ts +++ b/clients/client-rds/src/protocols/Aws_query.ts @@ -11385,6 +11385,16 @@ const se_CreateGlobalClusterMessage = (input: CreateGlobalClusterMessage, contex if (input[_SE] != null) { entries[_SE] = input[_SE]; } + if (input[_T] != null) { + const memberEntries = se_TagList(input[_T], context); + if (input[_T]?.length === 0) { + entries.Tags = []; + } + Object.entries(memberEntries).forEach(([key, value]) => { + const loc = `Tags.${key}`; + entries[loc] = value; + }); + } return entries; }; @@ -21289,6 +21299,11 @@ const de_GlobalCluster = (output: any, context: __SerdeContext): GlobalCluster = if (output[_FSa] != null) { contents[_FSa] = de_FailoverState(output[_FSa], context); } + if (output.TagList === "") { + contents[_TL] = []; + } else if (output[_TL] != null && output[_TL][_Tag] != null) { + contents[_TL] = de_TagList(__getArrayIfSingleItem(output[_TL][_Tag]), context); + } return contents; }; diff --git a/codegen/sdk-codegen/aws-models/rds.json b/codegen/sdk-codegen/aws-models/rds.json index 880572f2c822..b81993c16284 100644 --- a/codegen/sdk-codegen/aws-models/rds.json +++ b/codegen/sdk-codegen/aws-models/rds.json @@ -2075,7 +2075,7 @@ "target": "com.amazonaws.rds#String", "traits": { "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The pending maintenance action to apply to this resource.

\n

Valid Values:

\n \n

For more information about these actions, see \n Maintenance actions for Amazon Aurora or \n Maintenance actions for Amazon RDS.

", + "smithy.api#documentation": "

The pending maintenance action to apply to this resource.

\n

Valid Values: system-update, db-upgrade, \n hardware-maintenance, ca-certificate-rotation\n

", "smithy.api#required": {} } }, @@ -6565,6 +6565,12 @@ "traits": { "smithy.api#documentation": "

Specifies whether to enable storage encryption for the new global database cluster.

\n

Constraints:

\n " } + }, + "Tags": { + "target": "com.amazonaws.rds#TagList", + "traits": { + "smithy.api#documentation": "

Tags to assign to the global cluster.

" + } } }, "traits": { @@ -19376,6 +19382,9 @@ "traits": { "smithy.api#documentation": "

A data object containing all properties for the current state of an in-process or pending switchover or failover process for this global cluster (Aurora global database).\n This object is empty unless the SwitchoverGlobalCluster or FailoverGlobalCluster operation was called on this global cluster.

" } + }, + "TagList": { + "target": "com.amazonaws.rds#TagList" } }, "traits": { @@ -20670,7 +20679,7 @@ } ], "traits": { - "smithy.api#documentation": "

Lists all tags on an Amazon RDS resource.

\n

For an overview on tagging an Amazon RDS resource, \n see Tagging Amazon RDS Resources \n in the Amazon RDS User Guide.

", + "smithy.api#documentation": "

Lists all tags on an Amazon RDS resource.

\n

For an overview on tagging an Amazon RDS resource, \n see Tagging Amazon RDS Resources in the Amazon RDS User Guide\n or Tagging Amazon Aurora and Amazon RDS Resources in the Amazon Aurora User Guide.

", "smithy.api#examples": [ { "title": "To list tags on an Amazon RDS resource", @@ -24594,7 +24603,7 @@ "Action": { "target": "com.amazonaws.rds#String", "traits": { - "smithy.api#documentation": "

The type of pending maintenance action that is available for the resource.

\n

For more information about maintenance actions, see Maintaining a DB instance.

\n

Valid Values:

\n \n

For more information about these actions, see \n Maintenance actions for Amazon Aurora or \n Maintenance actions for Amazon RDS.

" + "smithy.api#documentation": "

The type of pending maintenance action that is available for the resource.

\n

For more information about maintenance actions, see Maintaining a DB instance.

\n

Valid Values: system-update | db-upgrade | hardware-maintenance | ca-certificate-rotation\n

" } }, "AutoAppliedAfterDate": { @@ -26012,7 +26021,7 @@ } ], "traits": { - "smithy.api#documentation": "

Removes metadata tags from an Amazon RDS resource.

\n

For an overview on tagging an Amazon RDS resource, \n see Tagging Amazon RDS Resources \n in the Amazon RDS User Guide.\n

", + "smithy.api#documentation": "

Removes metadata tags from an Amazon RDS resource.

\n

For an overview on tagging an Amazon RDS resource, \n see Tagging Amazon RDS Resources in the Amazon RDS User Guide\n or Tagging Amazon Aurora and Amazon RDS Resources in the Amazon Aurora User Guide.

", "smithy.api#examples": [ { "title": "To remove tags from a resource",