From 07f9765e25fb60aea6a42c0ed9fdbf79d028b118 Mon Sep 17 00:00:00 2001 From: awstools Date: Fri, 8 Apr 2022 18:17:42 +0000 Subject: [PATCH] feat(client-wafv2): Add a new CurrentDefaultVersion field to ListAvailableManagedRuleGroupVersions API response; add a new VersioningSupported boolean to each ManagedRuleGroup returned from ListAvailableManagedRuleGroups API response. --- clients/client-wafv2/src/models/models_0.ts | 20 +++++++++++-- .../client-wafv2/src/protocols/Aws_json1_1.ts | 5 ++++ codegen/sdk-codegen/aws-models/wafv2.json | 29 ++++++++++++++++--- 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/clients/client-wafv2/src/models/models_0.ts b/clients/client-wafv2/src/models/models_0.ts index 5dfcf362cd28..ae7274f5919b 100644 --- a/clients/client-wafv2/src/models/models_0.ts +++ b/clients/client-wafv2/src/models/models_0.ts @@ -1367,6 +1367,7 @@ export namespace UsernameField { *

Additional information that's used by a managed rule group. Most managed rule groups don't require this.

*

Use this for the account takeover prevention managed rule group * AWSManagedRulesATPRuleSet, to provide information about the sign-in page of your application.

+ *

You can provide multiple individual ManagedRuleGroupConfig objects for any rule group configuration, for example UsernameField and PasswordField. The configuration that you provide depends on the needs of the managed rule group. For the ATP managed rule group, you provide the following individual configuration objects: LoginPath, PasswordField, PayloadType and UsernameField.

*/ export interface ManagedRuleGroupConfig { /** @@ -4743,6 +4744,11 @@ export interface ManagedRuleGroupSummary { */ Name?: string; + /** + *

Indicates whether the managed rule group is versioned. If it is, you can retrieve the versions list by calling ListAvailableManagedRuleGroupVersions.

+ */ + VersioningSupported?: boolean; + /** *

The description of the managed rule group, provided by Amazon Web Services Managed Rules or the Amazon Web Services Marketplace seller who manages it.

*/ @@ -4867,6 +4873,11 @@ export interface ListAvailableManagedRuleGroupVersionsResponse { *

The versions that are currently available for the specified managed rule group.

*/ Versions?: ManagedRuleGroupVersion[]; + + /** + *

The name of the version that's currently set as the default.

+ */ + CurrentDefaultVersion?: string; } export namespace ListAvailableManagedRuleGroupVersionsResponse { @@ -5726,7 +5737,9 @@ export interface PutPermissionPolicyRequest { * *
  • *

    - * Action must specify wafv2:CreateWebACL, wafv2:UpdateWebACL, and wafv2:PutFirewallManagerRuleGroups. WAF rejects any extra actions or wildcard actions in the policy.

    + * Action must specify wafv2:CreateWebACL, wafv2:UpdateWebACL, and + * wafv2:PutFirewallManagerRuleGroups and may optionally specify wafv2:GetRuleGroup. + * WAF rejects any extra actions or wildcard actions in the policy.

    *
  • *
  • *

    The policy must not include a Resource parameter.

    @@ -5774,7 +5787,9 @@ export namespace PutPermissionPolicyResponse { *
  • *
  • *

    - * Action must specify wafv2:CreateWebACL, wafv2:UpdateWebACL, and wafv2:PutFirewallManagerRuleGroups. WAF rejects any extra actions or wildcard actions in the policy.

    + * Action must specify wafv2:CreateWebACL, wafv2:UpdateWebACL, and + * wafv2:PutFirewallManagerRuleGroups and may optionally specify wafv2:GetRuleGroup. + * WAF rejects any extra actions or wildcard actions in the policy.

    *
  • *
  • *

    The policy must not include a Resource parameter.

    @@ -6300,6 +6315,7 @@ export interface ManagedRuleGroupStatement { *

    Additional information that's used by a managed rule group. Most managed rule groups don't require this.

    *

    Use this for the account takeover prevention managed rule group * AWSManagedRulesATPRuleSet, to provide information about the sign-in page of your application.

    + *

    You can provide multiple individual ManagedRuleGroupConfig objects for any rule group configuration, for example UsernameField and PasswordField. The configuration that you provide depends on the needs of the managed rule group. For the ATP managed rule group, you provide the following individual configuration objects: LoginPath, PasswordField, PayloadType and UsernameField.

    */ ManagedRuleGroupConfigs?: ManagedRuleGroupConfig[]; } diff --git a/clients/client-wafv2/src/protocols/Aws_json1_1.ts b/clients/client-wafv2/src/protocols/Aws_json1_1.ts index 92d2a0207dff..d38433af5891 100644 --- a/clients/client-wafv2/src/protocols/Aws_json1_1.ts +++ b/clients/client-wafv2/src/protocols/Aws_json1_1.ts @@ -2596,6 +2596,9 @@ const deserializeAws_json1_1ListAvailableManagedRuleGroupVersionsCommandError = case "WAFInvalidParameterException": case "com.amazonaws.wafv2#WAFInvalidParameterException": throw await deserializeAws_json1_1WAFInvalidParameterExceptionResponse(parsedOutput, context); + case "WAFNonexistentItemException": + case "com.amazonaws.wafv2#WAFNonexistentItemException": + throw await deserializeAws_json1_1WAFNonexistentItemExceptionResponse(parsedOutput, context); default: const parsedBody = parsedOutput.body; response = new __BaseException({ @@ -6154,6 +6157,7 @@ const deserializeAws_json1_1ListAvailableManagedRuleGroupVersionsResponse = ( context: __SerdeContext ): ListAvailableManagedRuleGroupVersionsResponse => { return { + CurrentDefaultVersion: __expectString(output.CurrentDefaultVersion), NextMarker: __expectString(output.NextMarker), Versions: output.Versions !== undefined && output.Versions !== null @@ -6398,6 +6402,7 @@ const deserializeAws_json1_1ManagedRuleGroupSummary = ( Description: __expectString(output.Description), Name: __expectString(output.Name), VendorName: __expectString(output.VendorName), + VersioningSupported: __expectBoolean(output.VersioningSupported), } as any; }; diff --git a/codegen/sdk-codegen/aws-models/wafv2.json b/codegen/sdk-codegen/aws-models/wafv2.json index daba23728bef..b47cbb830da9 100644 --- a/codegen/sdk-codegen/aws-models/wafv2.json +++ b/codegen/sdk-codegen/aws-models/wafv2.json @@ -2872,6 +2872,12 @@ "type": "list", "member": { "target": "com.amazonaws.wafv2#ExcludedRule" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 100 + } } }, "com.amazonaws.wafv2#FailureReason": { @@ -4463,6 +4469,9 @@ }, { "target": "com.amazonaws.wafv2#WAFInvalidParameterException" + }, + { + "target": "com.amazonaws.wafv2#WAFNonexistentItemException" } ], "traits": { @@ -4521,6 +4530,12 @@ "traits": { "smithy.api#documentation": "

    The versions that are currently available for the specified managed rule group.

    " } + }, + "CurrentDefaultVersion": { + "target": "com.amazonaws.wafv2#VersionKeyString", + "traits": { + "smithy.api#documentation": "

    The name of the version that's currently set as the default.

    " + } } } }, @@ -5302,7 +5317,7 @@ } }, "traits": { - "smithy.api#documentation": "

    Additional information that's used by a managed rule group. Most managed rule groups don't require this.

    \n

    Use this for the account takeover prevention managed rule group \n AWSManagedRulesATPRuleSet, to provide information about the sign-in page of your application.

    " + "smithy.api#documentation": "

    Additional information that's used by a managed rule group. Most managed rule groups don't require this.

    \n

    Use this for the account takeover prevention managed rule group \n AWSManagedRulesATPRuleSet, to provide information about the sign-in page of your application.

    \n

    You can provide multiple individual ManagedRuleGroupConfig objects for any rule group configuration, for example UsernameField and PasswordField. The configuration that you provide depends on the needs of the managed rule group. For the ATP managed rule group, you provide the following individual configuration objects: LoginPath, PasswordField, PayloadType and UsernameField.

    " } }, "com.amazonaws.wafv2#ManagedRuleGroupConfigs": { @@ -5354,7 +5369,7 @@ "ManagedRuleGroupConfigs": { "target": "com.amazonaws.wafv2#ManagedRuleGroupConfigs", "traits": { - "smithy.api#documentation": "

    Additional information that's used by a managed rule group. Most managed rule groups don't require this.

    \n

    Use this for the account takeover prevention managed rule group \n AWSManagedRulesATPRuleSet, to provide information about the sign-in page of your application.

    " + "smithy.api#documentation": "

    Additional information that's used by a managed rule group. Most managed rule groups don't require this.

    \n

    Use this for the account takeover prevention managed rule group \n AWSManagedRulesATPRuleSet, to provide information about the sign-in page of your application.

    \n

    You can provide multiple individual ManagedRuleGroupConfig objects for any rule group configuration, for example UsernameField and PasswordField. The configuration that you provide depends on the needs of the managed rule group. For the ATP managed rule group, you provide the following individual configuration objects: LoginPath, PasswordField, PayloadType and UsernameField.

    " } } }, @@ -5383,6 +5398,12 @@ "smithy.api#documentation": "

    The name of the managed rule group. You use this, along with the vendor name, to identify the rule group.

    " } }, + "VersioningSupported": { + "target": "com.amazonaws.wafv2#Boolean", + "traits": { + "smithy.api#documentation": "

    Indicates whether the managed rule group is versioned. If it is, you can retrieve the versions list by calling ListAvailableManagedRuleGroupVersions.

    " + } + }, "Description": { "target": "com.amazonaws.wafv2#EntityDescription", "traits": { @@ -6226,7 +6247,7 @@ "Policy": { "target": "com.amazonaws.wafv2#PolicyString", "traits": { - "smithy.api#documentation": "

    The policy to attach to the specified rule group.

    \n \n

    The policy specifications must conform to the following:

    \n \n

    For more information, see IAM Policies.

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

    The policy to attach to the specified rule group.

    \n \n

    The policy specifications must conform to the following:

    \n \n

    For more information, see IAM Policies.

    ", "smithy.api#required": {} } } @@ -8287,7 +8308,7 @@ } }, "traits": { - "smithy.api#documentation": "

    The operation failed because the specified policy isn't in the proper format.

    \n \n

    The policy specifications must conform to the following:

    \n \n

    For more information, see IAM Policies.

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

    The operation failed because the specified policy isn't in the proper format.

    \n \n

    The policy specifications must conform to the following:

    \n \n

    For more information, see IAM Policies.

    ", "smithy.api#error": "client" } },