repo_name
stringlengths 1
52
| repo_creator
stringclasses 6
values | programming_language
stringclasses 4
values | code
stringlengths 0
9.68M
| num_lines
int64 1
234k
|
---|---|---|---|---|
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafregional
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafregional/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Inserts or deletes SizeConstraint objects (filters) in a
// SizeConstraintSet . For each SizeConstraint object, you specify the following
// values:
// - Whether to insert or delete the object from the array. If you want to
// change a SizeConstraintSetUpdate object, you delete the existing object and
// add a new one.
// - The part of a web request that you want AWS WAF to evaluate, such as the
// length of a query string or the length of the User-Agent header.
// - Whether to perform any transformations on the request, such as converting
// it to lowercase, before checking its length. Note that transformations of the
// request body are not supported because the AWS resource forwards only the first
// 8192 bytes of your request to AWS WAF. You can only specify a single type of
// TextTransformation.
// - A ComparisonOperator used for evaluating the selected part of the request
// against the specified Size , such as equals, greater than, less than, and so
// on.
// - The length, in bytes, that you want AWS WAF to watch for in selected part
// of the request. The length is computed after applying the transformation.
//
// For example, you can add a SizeConstraintSetUpdate object that matches web
// requests in which the length of the User-Agent header is greater than 100
// bytes. You can then configure AWS WAF to block those requests. To create and
// configure a SizeConstraintSet , perform the following steps:
// - Create a SizeConstraintSet. For more information, see
// CreateSizeConstraintSet .
// - Use GetChangeToken to get the change token that you provide in the
// ChangeToken parameter of an UpdateSizeConstraintSet request.
// - Submit an UpdateSizeConstraintSet request to specify the part of the request
// that you want AWS WAF to inspect (for example, the header or the URI) and the
// value that you want AWS WAF to watch for.
//
// For more information about how to use the AWS WAF API to allow or block HTTP
// requests, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/)
// .
func (c *Client) UpdateSizeConstraintSet(ctx context.Context, params *UpdateSizeConstraintSetInput, optFns ...func(*Options)) (*UpdateSizeConstraintSetOutput, error) {
if params == nil {
params = &UpdateSizeConstraintSetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateSizeConstraintSet", params, optFns, c.addOperationUpdateSizeConstraintSetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateSizeConstraintSetOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateSizeConstraintSetInput struct {
// The value returned by the most recent call to GetChangeToken .
//
// This member is required.
ChangeToken *string
// The SizeConstraintSetId of the SizeConstraintSet that you want to update.
// SizeConstraintSetId is returned by CreateSizeConstraintSet and by
// ListSizeConstraintSets .
//
// This member is required.
SizeConstraintSetId *string
// An array of SizeConstraintSetUpdate objects that you want to insert into or
// delete from a SizeConstraintSet . For more information, see the applicable data
// types:
// - SizeConstraintSetUpdate : Contains Action and SizeConstraint
// - SizeConstraint : Contains FieldToMatch , TextTransformation ,
// ComparisonOperator , and Size
// - FieldToMatch : Contains Data and Type
//
// This member is required.
Updates []types.SizeConstraintSetUpdate
noSmithyDocumentSerde
}
type UpdateSizeConstraintSetOutput struct {
// The ChangeToken that you used to submit the UpdateSizeConstraintSet request.
// You can also use this value to query the status of the request. For more
// information, see GetChangeTokenStatus .
ChangeToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateSizeConstraintSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateSizeConstraintSet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateSizeConstraintSet{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateSizeConstraintSetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSizeConstraintSet(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateSizeConstraintSet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "waf-regional",
OperationName: "UpdateSizeConstraintSet",
}
}
| 182 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafregional
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafregional/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Inserts or deletes SqlInjectionMatchTuple objects (filters) in
// a SqlInjectionMatchSet . For each SqlInjectionMatchTuple object, you specify
// the following values:
// - Action : Whether to insert the object into or delete the object from the
// array. To change a SqlInjectionMatchTuple , you delete the existing object and
// add a new one.
// - FieldToMatch : The part of web requests that you want AWS WAF to inspect
// and, if you want AWS WAF to inspect a header or custom query parameter, the name
// of the header or parameter.
// - TextTransformation : Which text transformation, if any, to perform on the
// web request before inspecting the request for snippets of malicious SQL code.
// You can only specify a single type of TextTransformation.
//
// You use SqlInjectionMatchSet objects to specify which CloudFront requests that
// you want to allow, block, or count. For example, if you're receiving requests
// that contain snippets of SQL code in the query string and you want to block the
// requests, you can create a SqlInjectionMatchSet with the applicable settings,
// and then configure AWS WAF to block the requests. To create and configure a
// SqlInjectionMatchSet , perform the following steps:
// - Submit a CreateSqlInjectionMatchSet request.
// - Use GetChangeToken to get the change token that you provide in the
// ChangeToken parameter of an UpdateIPSet request.
// - Submit an UpdateSqlInjectionMatchSet request to specify the parts of web
// requests that you want AWS WAF to inspect for snippets of SQL code.
//
// For more information about how to use the AWS WAF API to allow or block HTTP
// requests, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/)
// .
func (c *Client) UpdateSqlInjectionMatchSet(ctx context.Context, params *UpdateSqlInjectionMatchSetInput, optFns ...func(*Options)) (*UpdateSqlInjectionMatchSetOutput, error) {
if params == nil {
params = &UpdateSqlInjectionMatchSetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateSqlInjectionMatchSet", params, optFns, c.addOperationUpdateSqlInjectionMatchSetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateSqlInjectionMatchSetOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to update a SqlInjectionMatchSet .
type UpdateSqlInjectionMatchSetInput struct {
// The value returned by the most recent call to GetChangeToken .
//
// This member is required.
ChangeToken *string
// The SqlInjectionMatchSetId of the SqlInjectionMatchSet that you want to update.
// SqlInjectionMatchSetId is returned by CreateSqlInjectionMatchSet and by
// ListSqlInjectionMatchSets .
//
// This member is required.
SqlInjectionMatchSetId *string
// An array of SqlInjectionMatchSetUpdate objects that you want to insert into or
// delete from a SqlInjectionMatchSet . For more information, see the applicable
// data types:
// - SqlInjectionMatchSetUpdate : Contains Action and SqlInjectionMatchTuple
// - SqlInjectionMatchTuple : Contains FieldToMatch and TextTransformation
// - FieldToMatch : Contains Data and Type
//
// This member is required.
Updates []types.SqlInjectionMatchSetUpdate
noSmithyDocumentSerde
}
// The response to an UpdateSqlInjectionMatchSets request.
type UpdateSqlInjectionMatchSetOutput struct {
// The ChangeToken that you used to submit the UpdateSqlInjectionMatchSet request.
// You can also use this value to query the status of the request. For more
// information, see GetChangeTokenStatus .
ChangeToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateSqlInjectionMatchSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateSqlInjectionMatchSet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateSqlInjectionMatchSet{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateSqlInjectionMatchSetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSqlInjectionMatchSet(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateSqlInjectionMatchSet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "waf-regional",
OperationName: "UpdateSqlInjectionMatchSet",
}
}
| 177 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafregional
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafregional/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Inserts or deletes ActivatedRule objects in a WebACL . Each Rule
// identifies web requests that you want to allow, block, or count. When you update
// a WebACL , you specify the following values:
// - A default action for the WebACL , either ALLOW or BLOCK . AWS WAF performs
// the default action if a request doesn't match the criteria in any of the Rules
// in a WebACL .
// - The Rules that you want to add or delete. If you want to replace one Rule
// with another, you delete the existing Rule and add the new one.
// - For each Rule , whether you want AWS WAF to allow requests, block requests,
// or count requests that match the conditions in the Rule .
// - The order in which you want AWS WAF to evaluate the Rules in a WebACL . If
// you add more than one Rule to a WebACL , AWS WAF evaluates each request
// against the Rules in order based on the value of Priority . (The Rule that has
// the lowest value for Priority is evaluated first.) When a web request matches
// all the predicates (such as ByteMatchSets and IPSets ) in a Rule , AWS WAF
// immediately takes the corresponding action, allow or block, and doesn't evaluate
// the request against the remaining Rules in the WebACL , if any.
//
// To create and configure a WebACL , perform the following steps:
// - Create and update the predicates that you want to include in Rules . For
// more information, see CreateByteMatchSet , UpdateByteMatchSet , CreateIPSet ,
// UpdateIPSet , CreateSqlInjectionMatchSet , and UpdateSqlInjectionMatchSet .
// - Create and update the Rules that you want to include in the WebACL . For
// more information, see CreateRule and UpdateRule .
// - Create a WebACL . See CreateWebACL .
// - Use GetChangeToken to get the change token that you provide in the
// ChangeToken parameter of an UpdateWebACL request.
// - Submit an UpdateWebACL request to specify the Rules that you want to include
// in the WebACL , to specify the default action, and to associate the WebACL
// with a CloudFront distribution. The ActivatedRule can be a rule group. If you
// specify a rule group as your ActivatedRule , you can exclude specific rules
// from that rule group. If you already have a rule group associated with a web ACL
// and want to submit an UpdateWebACL request to exclude certain rules from that
// rule group, you must first remove the rule group from the web ACL, the re-insert
// it again, specifying the excluded rules. For details, see
// ActivatedRule$ExcludedRules .
//
// Be aware that if you try to add a RATE_BASED rule to a web ACL without setting
// the rule type when first creating the rule, the UpdateWebACL request will fail
// because the request tries to add a REGULAR rule (the default rule type) with the
// specified ID, which does not exist. For more information about how to use the
// AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/)
// .
func (c *Client) UpdateWebACL(ctx context.Context, params *UpdateWebACLInput, optFns ...func(*Options)) (*UpdateWebACLOutput, error) {
if params == nil {
params = &UpdateWebACLInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateWebACL", params, optFns, c.addOperationUpdateWebACLMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateWebACLOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateWebACLInput struct {
// The value returned by the most recent call to GetChangeToken .
//
// This member is required.
ChangeToken *string
// The WebACLId of the WebACL that you want to update. WebACLId is returned by
// CreateWebACL and by ListWebACLs .
//
// This member is required.
WebACLId *string
// A default action for the web ACL, either ALLOW or BLOCK. AWS WAF performs the
// default action if a request doesn't match the criteria in any of the rules in a
// web ACL.
DefaultAction *types.WafAction
// An array of updates to make to the WebACL . An array of WebACLUpdate objects
// that you want to insert into or delete from a WebACL . For more information, see
// the applicable data types:
// - WebACLUpdate : Contains Action and ActivatedRule
// - ActivatedRule : Contains Action , OverrideAction , Priority , RuleId , and
// Type . ActivatedRule|OverrideAction applies only when updating or adding a
// RuleGroup to a WebACL . In this case, you do not use ActivatedRule|Action .
// For all other update requests, ActivatedRule|Action is used instead of
// ActivatedRule|OverrideAction .
// - WafAction : Contains Type
Updates []types.WebACLUpdate
noSmithyDocumentSerde
}
type UpdateWebACLOutput struct {
// The ChangeToken that you used to submit the UpdateWebACL request. You can also
// use this value to query the status of the request. For more information, see
// GetChangeTokenStatus .
ChangeToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateWebACLMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateWebACL{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateWebACL{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateWebACLValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateWebACL(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateWebACL(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "waf-regional",
OperationName: "UpdateWebACL",
}
}
| 196 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafregional
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafregional/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Inserts or deletes XssMatchTuple objects (filters) in an
// XssMatchSet . For each XssMatchTuple object, you specify the following values:
// - Action : Whether to insert the object into or delete the object from the
// array. To change an XssMatchTuple , you delete the existing object and add a
// new one.
// - FieldToMatch : The part of web requests that you want AWS WAF to inspect
// and, if you want AWS WAF to inspect a header or custom query parameter, the name
// of the header or parameter.
// - TextTransformation : Which text transformation, if any, to perform on the
// web request before inspecting the request for cross-site scripting attacks. You
// can only specify a single type of TextTransformation.
//
// You use XssMatchSet objects to specify which CloudFront requests that you want
// to allow, block, or count. For example, if you're receiving requests that
// contain cross-site scripting attacks in the request body and you want to block
// the requests, you can create an XssMatchSet with the applicable settings, and
// then configure AWS WAF to block the requests. To create and configure an
// XssMatchSet , perform the following steps:
// - Submit a CreateXssMatchSet request.
// - Use GetChangeToken to get the change token that you provide in the
// ChangeToken parameter of an UpdateIPSet request.
// - Submit an UpdateXssMatchSet request to specify the parts of web requests
// that you want AWS WAF to inspect for cross-site scripting attacks.
//
// For more information about how to use the AWS WAF API to allow or block HTTP
// requests, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/)
// .
func (c *Client) UpdateXssMatchSet(ctx context.Context, params *UpdateXssMatchSetInput, optFns ...func(*Options)) (*UpdateXssMatchSetOutput, error) {
if params == nil {
params = &UpdateXssMatchSetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateXssMatchSet", params, optFns, c.addOperationUpdateXssMatchSetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateXssMatchSetOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to update an XssMatchSet .
type UpdateXssMatchSetInput struct {
// The value returned by the most recent call to GetChangeToken .
//
// This member is required.
ChangeToken *string
// An array of XssMatchSetUpdate objects that you want to insert into or delete
// from an XssMatchSet . For more information, see the applicable data types:
// - XssMatchSetUpdate : Contains Action and XssMatchTuple
// - XssMatchTuple : Contains FieldToMatch and TextTransformation
// - FieldToMatch : Contains Data and Type
//
// This member is required.
Updates []types.XssMatchSetUpdate
// The XssMatchSetId of the XssMatchSet that you want to update. XssMatchSetId is
// returned by CreateXssMatchSet and by ListXssMatchSets .
//
// This member is required.
XssMatchSetId *string
noSmithyDocumentSerde
}
// The response to an UpdateXssMatchSets request.
type UpdateXssMatchSetOutput struct {
// The ChangeToken that you used to submit the UpdateXssMatchSet request. You can
// also use this value to query the status of the request. For more information,
// see GetChangeTokenStatus .
ChangeToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateXssMatchSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateXssMatchSet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateXssMatchSet{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateXssMatchSetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateXssMatchSet(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateXssMatchSet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "waf-regional",
OperationName: "UpdateXssMatchSet",
}
}
| 174 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafregional
import (
"bytes"
"context"
"encoding/base64"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/wafregional/types"
smithy "github.com/aws/smithy-go"
smithyio "github.com/aws/smithy-go/io"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"strings"
)
type awsAwsjson11_deserializeOpAssociateWebACL struct {
}
func (*awsAwsjson11_deserializeOpAssociateWebACL) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAssociateWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorAssociateWebACL(response, &metadata)
}
output := &AssociateWebACLOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentAssociateWebACLOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorAssociateWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFUnavailableEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFUnavailableEntityException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateByteMatchSet struct {
}
func (*awsAwsjson11_deserializeOpCreateByteMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateByteMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateByteMatchSet(response, &metadata)
}
output := &CreateByteMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateByteMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateByteMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFDisallowedNameException", errorCode):
return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateGeoMatchSet struct {
}
func (*awsAwsjson11_deserializeOpCreateGeoMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateGeoMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateGeoMatchSet(response, &metadata)
}
output := &CreateGeoMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateGeoMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateGeoMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFDisallowedNameException", errorCode):
return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateIPSet struct {
}
func (*awsAwsjson11_deserializeOpCreateIPSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateIPSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateIPSet(response, &metadata)
}
output := &CreateIPSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateIPSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateIPSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFDisallowedNameException", errorCode):
return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateRateBasedRule struct {
}
func (*awsAwsjson11_deserializeOpCreateRateBasedRule) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateRateBasedRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateRateBasedRule(response, &metadata)
}
output := &CreateRateBasedRuleOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateRateBasedRuleOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateRateBasedRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFBadRequestException", errorCode):
return awsAwsjson11_deserializeErrorWAFBadRequestException(response, errorBody)
case strings.EqualFold("WAFDisallowedNameException", errorCode):
return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateRegexMatchSet struct {
}
func (*awsAwsjson11_deserializeOpCreateRegexMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateRegexMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateRegexMatchSet(response, &metadata)
}
output := &CreateRegexMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateRegexMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateRegexMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFDisallowedNameException", errorCode):
return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateRegexPatternSet struct {
}
func (*awsAwsjson11_deserializeOpCreateRegexPatternSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateRegexPatternSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateRegexPatternSet(response, &metadata)
}
output := &CreateRegexPatternSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateRegexPatternSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateRegexPatternSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFDisallowedNameException", errorCode):
return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateRule struct {
}
func (*awsAwsjson11_deserializeOpCreateRule) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateRule(response, &metadata)
}
output := &CreateRuleOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateRuleOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFBadRequestException", errorCode):
return awsAwsjson11_deserializeErrorWAFBadRequestException(response, errorBody)
case strings.EqualFold("WAFDisallowedNameException", errorCode):
return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateRuleGroup struct {
}
func (*awsAwsjson11_deserializeOpCreateRuleGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateRuleGroup(response, &metadata)
}
output := &CreateRuleGroupOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateRuleGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFBadRequestException", errorCode):
return awsAwsjson11_deserializeErrorWAFBadRequestException(response, errorBody)
case strings.EqualFold("WAFDisallowedNameException", errorCode):
return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateSizeConstraintSet struct {
}
func (*awsAwsjson11_deserializeOpCreateSizeConstraintSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateSizeConstraintSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateSizeConstraintSet(response, &metadata)
}
output := &CreateSizeConstraintSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateSizeConstraintSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateSizeConstraintSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFDisallowedNameException", errorCode):
return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateSqlInjectionMatchSet struct {
}
func (*awsAwsjson11_deserializeOpCreateSqlInjectionMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateSqlInjectionMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateSqlInjectionMatchSet(response, &metadata)
}
output := &CreateSqlInjectionMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateSqlInjectionMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateSqlInjectionMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFDisallowedNameException", errorCode):
return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateWebACL struct {
}
func (*awsAwsjson11_deserializeOpCreateWebACL) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateWebACL(response, &metadata)
}
output := &CreateWebACLOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateWebACLOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFBadRequestException", errorCode):
return awsAwsjson11_deserializeErrorWAFBadRequestException(response, errorBody)
case strings.EqualFold("WAFDisallowedNameException", errorCode):
return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateWebACLMigrationStack struct {
}
func (*awsAwsjson11_deserializeOpCreateWebACLMigrationStack) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateWebACLMigrationStack) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateWebACLMigrationStack(response, &metadata)
}
output := &CreateWebACLMigrationStackOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateWebACLMigrationStackOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateWebACLMigrationStack(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFEntityMigrationException", errorCode):
return awsAwsjson11_deserializeErrorWAFEntityMigrationException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateXssMatchSet struct {
}
func (*awsAwsjson11_deserializeOpCreateXssMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateXssMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateXssMatchSet(response, &metadata)
}
output := &CreateXssMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateXssMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateXssMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFDisallowedNameException", errorCode):
return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteByteMatchSet struct {
}
func (*awsAwsjson11_deserializeOpDeleteByteMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteByteMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteByteMatchSet(response, &metadata)
}
output := &DeleteByteMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteByteMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteByteMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonEmptyEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFReferencedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteGeoMatchSet struct {
}
func (*awsAwsjson11_deserializeOpDeleteGeoMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteGeoMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteGeoMatchSet(response, &metadata)
}
output := &DeleteGeoMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteGeoMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteGeoMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonEmptyEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFReferencedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteIPSet struct {
}
func (*awsAwsjson11_deserializeOpDeleteIPSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteIPSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteIPSet(response, &metadata)
}
output := &DeleteIPSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteIPSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteIPSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonEmptyEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFReferencedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteLoggingConfiguration struct {
}
func (*awsAwsjson11_deserializeOpDeleteLoggingConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteLoggingConfiguration(response, &metadata)
}
output := &DeleteLoggingConfigurationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteLoggingConfigurationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeletePermissionPolicy struct {
}
func (*awsAwsjson11_deserializeOpDeletePermissionPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeletePermissionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeletePermissionPolicy(response, &metadata)
}
output := &DeletePermissionPolicyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeletePermissionPolicyOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeletePermissionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteRateBasedRule struct {
}
func (*awsAwsjson11_deserializeOpDeleteRateBasedRule) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteRateBasedRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRateBasedRule(response, &metadata)
}
output := &DeleteRateBasedRuleOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteRateBasedRuleOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteRateBasedRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonEmptyEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFReferencedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteRegexMatchSet struct {
}
func (*awsAwsjson11_deserializeOpDeleteRegexMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteRegexMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRegexMatchSet(response, &metadata)
}
output := &DeleteRegexMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteRegexMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteRegexMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonEmptyEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFReferencedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteRegexPatternSet struct {
}
func (*awsAwsjson11_deserializeOpDeleteRegexPatternSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteRegexPatternSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRegexPatternSet(response, &metadata)
}
output := &DeleteRegexPatternSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteRegexPatternSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteRegexPatternSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonEmptyEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFReferencedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteRule struct {
}
func (*awsAwsjson11_deserializeOpDeleteRule) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRule(response, &metadata)
}
output := &DeleteRuleOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteRuleOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonEmptyEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFReferencedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteRuleGroup struct {
}
func (*awsAwsjson11_deserializeOpDeleteRuleGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRuleGroup(response, &metadata)
}
output := &DeleteRuleGroupOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteRuleGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFNonEmptyEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFReferencedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteSizeConstraintSet struct {
}
func (*awsAwsjson11_deserializeOpDeleteSizeConstraintSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteSizeConstraintSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteSizeConstraintSet(response, &metadata)
}
output := &DeleteSizeConstraintSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteSizeConstraintSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteSizeConstraintSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonEmptyEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFReferencedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteSqlInjectionMatchSet struct {
}
func (*awsAwsjson11_deserializeOpDeleteSqlInjectionMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteSqlInjectionMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteSqlInjectionMatchSet(response, &metadata)
}
output := &DeleteSqlInjectionMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteSqlInjectionMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteSqlInjectionMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonEmptyEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFReferencedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteWebACL struct {
}
func (*awsAwsjson11_deserializeOpDeleteWebACL) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteWebACL(response, &metadata)
}
output := &DeleteWebACLOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteWebACLOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonEmptyEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFReferencedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteXssMatchSet struct {
}
func (*awsAwsjson11_deserializeOpDeleteXssMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteXssMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteXssMatchSet(response, &metadata)
}
output := &DeleteXssMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteXssMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteXssMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonEmptyEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFReferencedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDisassociateWebACL struct {
}
func (*awsAwsjson11_deserializeOpDisassociateWebACL) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDisassociateWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDisassociateWebACL(response, &metadata)
}
output := &DisassociateWebACLOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDisassociateWebACLOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDisassociateWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetByteMatchSet struct {
}
func (*awsAwsjson11_deserializeOpGetByteMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetByteMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetByteMatchSet(response, &metadata)
}
output := &GetByteMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetByteMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetByteMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetChangeToken struct {
}
func (*awsAwsjson11_deserializeOpGetChangeToken) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetChangeToken) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetChangeToken(response, &metadata)
}
output := &GetChangeTokenOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetChangeTokenOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetChangeToken(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetChangeTokenStatus struct {
}
func (*awsAwsjson11_deserializeOpGetChangeTokenStatus) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetChangeTokenStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetChangeTokenStatus(response, &metadata)
}
output := &GetChangeTokenStatusOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetChangeTokenStatusOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetChangeTokenStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetGeoMatchSet struct {
}
func (*awsAwsjson11_deserializeOpGetGeoMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetGeoMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetGeoMatchSet(response, &metadata)
}
output := &GetGeoMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetGeoMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetGeoMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetIPSet struct {
}
func (*awsAwsjson11_deserializeOpGetIPSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetIPSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetIPSet(response, &metadata)
}
output := &GetIPSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetIPSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetIPSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetLoggingConfiguration struct {
}
func (*awsAwsjson11_deserializeOpGetLoggingConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetLoggingConfiguration(response, &metadata)
}
output := &GetLoggingConfigurationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetLoggingConfigurationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetPermissionPolicy struct {
}
func (*awsAwsjson11_deserializeOpGetPermissionPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetPermissionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetPermissionPolicy(response, &metadata)
}
output := &GetPermissionPolicyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetPermissionPolicyOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetPermissionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetRateBasedRule struct {
}
func (*awsAwsjson11_deserializeOpGetRateBasedRule) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetRateBasedRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetRateBasedRule(response, &metadata)
}
output := &GetRateBasedRuleOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetRateBasedRuleOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetRateBasedRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetRateBasedRuleManagedKeys struct {
}
func (*awsAwsjson11_deserializeOpGetRateBasedRuleManagedKeys) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetRateBasedRuleManagedKeys) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetRateBasedRuleManagedKeys(response, &metadata)
}
output := &GetRateBasedRuleManagedKeysOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetRateBasedRuleManagedKeysOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetRateBasedRuleManagedKeys(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetRegexMatchSet struct {
}
func (*awsAwsjson11_deserializeOpGetRegexMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetRegexMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetRegexMatchSet(response, &metadata)
}
output := &GetRegexMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetRegexMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetRegexMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetRegexPatternSet struct {
}
func (*awsAwsjson11_deserializeOpGetRegexPatternSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetRegexPatternSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetRegexPatternSet(response, &metadata)
}
output := &GetRegexPatternSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetRegexPatternSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetRegexPatternSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetRule struct {
}
func (*awsAwsjson11_deserializeOpGetRule) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetRule(response, &metadata)
}
output := &GetRuleOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetRuleOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetRuleGroup struct {
}
func (*awsAwsjson11_deserializeOpGetRuleGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetRuleGroup(response, &metadata)
}
output := &GetRuleGroupOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetRuleGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetSampledRequests struct {
}
func (*awsAwsjson11_deserializeOpGetSampledRequests) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetSampledRequests) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetSampledRequests(response, &metadata)
}
output := &GetSampledRequestsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetSampledRequestsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetSampledRequests(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetSizeConstraintSet struct {
}
func (*awsAwsjson11_deserializeOpGetSizeConstraintSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetSizeConstraintSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetSizeConstraintSet(response, &metadata)
}
output := &GetSizeConstraintSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetSizeConstraintSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetSizeConstraintSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetSqlInjectionMatchSet struct {
}
func (*awsAwsjson11_deserializeOpGetSqlInjectionMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetSqlInjectionMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetSqlInjectionMatchSet(response, &metadata)
}
output := &GetSqlInjectionMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetSqlInjectionMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetSqlInjectionMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetWebACL struct {
}
func (*awsAwsjson11_deserializeOpGetWebACL) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetWebACL(response, &metadata)
}
output := &GetWebACLOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetWebACLOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetWebACLForResource struct {
}
func (*awsAwsjson11_deserializeOpGetWebACLForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetWebACLForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetWebACLForResource(response, &metadata)
}
output := &GetWebACLForResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetWebACLForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetWebACLForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFUnavailableEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFUnavailableEntityException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetXssMatchSet struct {
}
func (*awsAwsjson11_deserializeOpGetXssMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetXssMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetXssMatchSet(response, &metadata)
}
output := &GetXssMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetXssMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetXssMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListActivatedRulesInRuleGroup struct {
}
func (*awsAwsjson11_deserializeOpListActivatedRulesInRuleGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListActivatedRulesInRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListActivatedRulesInRuleGroup(response, &metadata)
}
output := &ListActivatedRulesInRuleGroupOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListActivatedRulesInRuleGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListActivatedRulesInRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListByteMatchSets struct {
}
func (*awsAwsjson11_deserializeOpListByteMatchSets) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListByteMatchSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListByteMatchSets(response, &metadata)
}
output := &ListByteMatchSetsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListByteMatchSetsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListByteMatchSets(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListGeoMatchSets struct {
}
func (*awsAwsjson11_deserializeOpListGeoMatchSets) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListGeoMatchSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListGeoMatchSets(response, &metadata)
}
output := &ListGeoMatchSetsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListGeoMatchSetsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListGeoMatchSets(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListIPSets struct {
}
func (*awsAwsjson11_deserializeOpListIPSets) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListIPSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListIPSets(response, &metadata)
}
output := &ListIPSetsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListIPSetsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListIPSets(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListLoggingConfigurations struct {
}
func (*awsAwsjson11_deserializeOpListLoggingConfigurations) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListLoggingConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListLoggingConfigurations(response, &metadata)
}
output := &ListLoggingConfigurationsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListLoggingConfigurationsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListLoggingConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListRateBasedRules struct {
}
func (*awsAwsjson11_deserializeOpListRateBasedRules) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListRateBasedRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListRateBasedRules(response, &metadata)
}
output := &ListRateBasedRulesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListRateBasedRulesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListRateBasedRules(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListRegexMatchSets struct {
}
func (*awsAwsjson11_deserializeOpListRegexMatchSets) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListRegexMatchSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListRegexMatchSets(response, &metadata)
}
output := &ListRegexMatchSetsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListRegexMatchSetsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListRegexMatchSets(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListRegexPatternSets struct {
}
func (*awsAwsjson11_deserializeOpListRegexPatternSets) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListRegexPatternSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListRegexPatternSets(response, &metadata)
}
output := &ListRegexPatternSetsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListRegexPatternSetsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListRegexPatternSets(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListResourcesForWebACL struct {
}
func (*awsAwsjson11_deserializeOpListResourcesForWebACL) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListResourcesForWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListResourcesForWebACL(response, &metadata)
}
output := &ListResourcesForWebACLOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListResourcesForWebACLOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListResourcesForWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListRuleGroups struct {
}
func (*awsAwsjson11_deserializeOpListRuleGroups) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListRuleGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListRuleGroups(response, &metadata)
}
output := &ListRuleGroupsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListRuleGroupsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListRuleGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListRules struct {
}
func (*awsAwsjson11_deserializeOpListRules) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListRules(response, &metadata)
}
output := &ListRulesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListRulesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListRules(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListSizeConstraintSets struct {
}
func (*awsAwsjson11_deserializeOpListSizeConstraintSets) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListSizeConstraintSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListSizeConstraintSets(response, &metadata)
}
output := &ListSizeConstraintSetsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListSizeConstraintSetsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListSizeConstraintSets(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListSqlInjectionMatchSets struct {
}
func (*awsAwsjson11_deserializeOpListSqlInjectionMatchSets) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListSqlInjectionMatchSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListSqlInjectionMatchSets(response, &metadata)
}
output := &ListSqlInjectionMatchSetsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListSqlInjectionMatchSetsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListSqlInjectionMatchSets(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListSubscribedRuleGroups struct {
}
func (*awsAwsjson11_deserializeOpListSubscribedRuleGroups) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListSubscribedRuleGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListSubscribedRuleGroups(response, &metadata)
}
output := &ListSubscribedRuleGroupsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListSubscribedRuleGroupsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListSubscribedRuleGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListTagsForResource struct {
}
func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata)
}
output := &ListTagsForResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFBadRequestException", errorCode):
return awsAwsjson11_deserializeErrorWAFBadRequestException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListWebACLs struct {
}
func (*awsAwsjson11_deserializeOpListWebACLs) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListWebACLs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListWebACLs(response, &metadata)
}
output := &ListWebACLsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListWebACLsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListWebACLs(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListXssMatchSets struct {
}
func (*awsAwsjson11_deserializeOpListXssMatchSets) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListXssMatchSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListXssMatchSets(response, &metadata)
}
output := &ListXssMatchSetsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListXssMatchSetsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListXssMatchSets(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpPutLoggingConfiguration struct {
}
func (*awsAwsjson11_deserializeOpPutLoggingConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpPutLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorPutLoggingConfiguration(response, &metadata)
}
output := &PutLoggingConfigurationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentPutLoggingConfigurationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorPutLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFServiceLinkedRoleErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFServiceLinkedRoleErrorException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpPutPermissionPolicy struct {
}
func (*awsAwsjson11_deserializeOpPutPermissionPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpPutPermissionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorPutPermissionPolicy(response, &metadata)
}
output := &PutPermissionPolicyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentPutPermissionPolicyOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorPutPermissionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidPermissionPolicyException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidPermissionPolicyException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpTagResource struct {
}
func (*awsAwsjson11_deserializeOpTagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata)
}
output := &TagResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFBadRequestException", errorCode):
return awsAwsjson11_deserializeErrorWAFBadRequestException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUntagResource struct {
}
func (*awsAwsjson11_deserializeOpUntagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata)
}
output := &UntagResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFBadRequestException", errorCode):
return awsAwsjson11_deserializeErrorWAFBadRequestException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateByteMatchSet struct {
}
func (*awsAwsjson11_deserializeOpUpdateByteMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateByteMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateByteMatchSet(response, &metadata)
}
output := &UpdateByteMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateByteMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateByteMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentContainerException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateGeoMatchSet struct {
}
func (*awsAwsjson11_deserializeOpUpdateGeoMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateGeoMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateGeoMatchSet(response, &metadata)
}
output := &UpdateGeoMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateGeoMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateGeoMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentContainerException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFReferencedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateIPSet struct {
}
func (*awsAwsjson11_deserializeOpUpdateIPSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateIPSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateIPSet(response, &metadata)
}
output := &UpdateIPSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateIPSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateIPSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentContainerException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFReferencedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateRateBasedRule struct {
}
func (*awsAwsjson11_deserializeOpUpdateRateBasedRule) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateRateBasedRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateRateBasedRule(response, &metadata)
}
output := &UpdateRateBasedRuleOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateRateBasedRuleOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateRateBasedRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentContainerException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFReferencedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateRegexMatchSet struct {
}
func (*awsAwsjson11_deserializeOpUpdateRegexMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateRegexMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateRegexMatchSet(response, &metadata)
}
output := &UpdateRegexMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateRegexMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateRegexMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFDisallowedNameException", errorCode):
return awsAwsjson11_deserializeErrorWAFDisallowedNameException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentContainerException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateRegexPatternSet struct {
}
func (*awsAwsjson11_deserializeOpUpdateRegexPatternSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateRegexPatternSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateRegexPatternSet(response, &metadata)
}
output := &UpdateRegexPatternSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateRegexPatternSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateRegexPatternSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidRegexPatternException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidRegexPatternException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentContainerException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateRule struct {
}
func (*awsAwsjson11_deserializeOpUpdateRule) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateRule(response, &metadata)
}
output := &UpdateRuleOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateRuleOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateRule(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentContainerException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFReferencedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateRuleGroup struct {
}
func (*awsAwsjson11_deserializeOpUpdateRuleGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateRuleGroup(response, &metadata)
}
output := &UpdateRuleGroupOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateRuleGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentContainerException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateSizeConstraintSet struct {
}
func (*awsAwsjson11_deserializeOpUpdateSizeConstraintSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateSizeConstraintSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateSizeConstraintSet(response, &metadata)
}
output := &UpdateSizeConstraintSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateSizeConstraintSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateSizeConstraintSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentContainerException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFReferencedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateSqlInjectionMatchSet struct {
}
func (*awsAwsjson11_deserializeOpUpdateSqlInjectionMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateSqlInjectionMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateSqlInjectionMatchSet(response, &metadata)
}
output := &UpdateSqlInjectionMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateSqlInjectionMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateSqlInjectionMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentContainerException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateWebACL struct {
}
func (*awsAwsjson11_deserializeOpUpdateWebACL) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateWebACL(response, &metadata)
}
output := &UpdateWebACLOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateWebACLOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentContainerException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFReferencedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFReferencedItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
case strings.EqualFold("WAFSubscriptionNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorWAFSubscriptionNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateXssMatchSet struct {
}
func (*awsAwsjson11_deserializeOpUpdateXssMatchSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateXssMatchSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateXssMatchSet(response, &metadata)
}
output := &UpdateXssMatchSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateXssMatchSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateXssMatchSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidAccountException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidAccountException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentContainerException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFStaleDataException", errorCode):
return awsAwsjson11_deserializeErrorWAFStaleDataException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsAwsjson11_deserializeErrorWAFBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFBadRequestException{}
err := awsAwsjson11_deserializeDocumentWAFBadRequestException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFDisallowedNameException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFDisallowedNameException{}
err := awsAwsjson11_deserializeDocumentWAFDisallowedNameException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFEntityMigrationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFEntityMigrationException{}
err := awsAwsjson11_deserializeDocumentWAFEntityMigrationException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFInternalErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFInternalErrorException{}
err := awsAwsjson11_deserializeDocumentWAFInternalErrorException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFInvalidAccountException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFInvalidAccountException{}
err := awsAwsjson11_deserializeDocumentWAFInvalidAccountException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFInvalidOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFInvalidOperationException{}
err := awsAwsjson11_deserializeDocumentWAFInvalidOperationException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFInvalidParameterException{}
err := awsAwsjson11_deserializeDocumentWAFInvalidParameterException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFInvalidPermissionPolicyException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFInvalidPermissionPolicyException{}
err := awsAwsjson11_deserializeDocumentWAFInvalidPermissionPolicyException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFInvalidRegexPatternException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFInvalidRegexPatternException{}
err := awsAwsjson11_deserializeDocumentWAFInvalidRegexPatternException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFLimitsExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFLimitsExceededException{}
err := awsAwsjson11_deserializeDocumentWAFLimitsExceededException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFNonEmptyEntityException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFNonEmptyEntityException{}
err := awsAwsjson11_deserializeDocumentWAFNonEmptyEntityException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFNonexistentContainerException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFNonexistentContainerException{}
err := awsAwsjson11_deserializeDocumentWAFNonexistentContainerException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFNonexistentItemException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFNonexistentItemException{}
err := awsAwsjson11_deserializeDocumentWAFNonexistentItemException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFReferencedItemException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFReferencedItemException{}
err := awsAwsjson11_deserializeDocumentWAFReferencedItemException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFServiceLinkedRoleErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFServiceLinkedRoleErrorException{}
err := awsAwsjson11_deserializeDocumentWAFServiceLinkedRoleErrorException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFStaleDataException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFStaleDataException{}
err := awsAwsjson11_deserializeDocumentWAFStaleDataException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFSubscriptionNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFSubscriptionNotFoundException{}
err := awsAwsjson11_deserializeDocumentWAFSubscriptionNotFoundException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFTagOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFTagOperationException{}
err := awsAwsjson11_deserializeDocumentWAFTagOperationException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFTagOperationInternalErrorException{}
err := awsAwsjson11_deserializeDocumentWAFTagOperationInternalErrorException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFUnavailableEntityException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFUnavailableEntityException{}
err := awsAwsjson11_deserializeDocumentWAFUnavailableEntityException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeDocumentActivatedRule(v **types.ActivatedRule, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ActivatedRule
if *v == nil {
sv = &types.ActivatedRule{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Action":
if err := awsAwsjson11_deserializeDocumentWafAction(&sv.Action, value); err != nil {
return err
}
case "ExcludedRules":
if err := awsAwsjson11_deserializeDocumentExcludedRules(&sv.ExcludedRules, value); err != nil {
return err
}
case "OverrideAction":
if err := awsAwsjson11_deserializeDocumentWafOverrideAction(&sv.OverrideAction, value); err != nil {
return err
}
case "Priority":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected RulePriority to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Priority = ptr.Int32(int32(i64))
}
case "RuleId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.RuleId = ptr.String(jtv)
}
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WafRuleType to be of type string, got %T instead", value)
}
sv.Type = types.WafRuleType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentActivatedRules(v *[]types.ActivatedRule, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ActivatedRule
if *v == nil {
cv = []types.ActivatedRule{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ActivatedRule
destAddr := &col
if err := awsAwsjson11_deserializeDocumentActivatedRule(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentByteMatchSet(v **types.ByteMatchSet, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ByteMatchSet
if *v == nil {
sv = &types.ByteMatchSet{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ByteMatchSetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.ByteMatchSetId = ptr.String(jtv)
}
case "ByteMatchTuples":
if err := awsAwsjson11_deserializeDocumentByteMatchTuples(&sv.ByteMatchTuples, value); err != nil {
return err
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentByteMatchSetSummaries(v *[]types.ByteMatchSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ByteMatchSetSummary
if *v == nil {
cv = []types.ByteMatchSetSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ByteMatchSetSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentByteMatchSetSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentByteMatchSetSummary(v **types.ByteMatchSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ByteMatchSetSummary
if *v == nil {
sv = &types.ByteMatchSetSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ByteMatchSetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.ByteMatchSetId = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentByteMatchTuple(v **types.ByteMatchTuple, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ByteMatchTuple
if *v == nil {
sv = &types.ByteMatchTuple{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FieldToMatch":
if err := awsAwsjson11_deserializeDocumentFieldToMatch(&sv.FieldToMatch, value); err != nil {
return err
}
case "PositionalConstraint":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PositionalConstraint to be of type string, got %T instead", value)
}
sv.PositionalConstraint = types.PositionalConstraint(jtv)
}
case "TargetString":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ByteMatchTargetString to be []byte, got %T instead", value)
}
dv, err := base64.StdEncoding.DecodeString(jtv)
if err != nil {
return fmt.Errorf("failed to base64 decode ByteMatchTargetString, %w", err)
}
sv.TargetString = dv
}
case "TextTransformation":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TextTransformation to be of type string, got %T instead", value)
}
sv.TextTransformation = types.TextTransformation(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentByteMatchTuples(v *[]types.ByteMatchTuple, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ByteMatchTuple
if *v == nil {
cv = []types.ByteMatchTuple{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ByteMatchTuple
destAddr := &col
if err := awsAwsjson11_deserializeDocumentByteMatchTuple(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentExcludedRule(v **types.ExcludedRule, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ExcludedRule
if *v == nil {
sv = &types.ExcludedRule{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "RuleId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.RuleId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentExcludedRules(v *[]types.ExcludedRule, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ExcludedRule
if *v == nil {
cv = []types.ExcludedRule{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ExcludedRule
destAddr := &col
if err := awsAwsjson11_deserializeDocumentExcludedRule(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentFieldToMatch(v **types.FieldToMatch, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.FieldToMatch
if *v == nil {
sv = &types.FieldToMatch{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Data":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MatchFieldData to be of type string, got %T instead", value)
}
sv.Data = ptr.String(jtv)
}
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MatchFieldType to be of type string, got %T instead", value)
}
sv.Type = types.MatchFieldType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentGeoMatchConstraint(v **types.GeoMatchConstraint, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.GeoMatchConstraint
if *v == nil {
sv = &types.GeoMatchConstraint{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GeoMatchConstraintType to be of type string, got %T instead", value)
}
sv.Type = types.GeoMatchConstraintType(jtv)
}
case "Value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GeoMatchConstraintValue to be of type string, got %T instead", value)
}
sv.Value = types.GeoMatchConstraintValue(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentGeoMatchConstraints(v *[]types.GeoMatchConstraint, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.GeoMatchConstraint
if *v == nil {
cv = []types.GeoMatchConstraint{}
} else {
cv = *v
}
for _, value := range shape {
var col types.GeoMatchConstraint
destAddr := &col
if err := awsAwsjson11_deserializeDocumentGeoMatchConstraint(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentGeoMatchSet(v **types.GeoMatchSet, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.GeoMatchSet
if *v == nil {
sv = &types.GeoMatchSet{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "GeoMatchConstraints":
if err := awsAwsjson11_deserializeDocumentGeoMatchConstraints(&sv.GeoMatchConstraints, value); err != nil {
return err
}
case "GeoMatchSetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.GeoMatchSetId = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentGeoMatchSetSummaries(v *[]types.GeoMatchSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.GeoMatchSetSummary
if *v == nil {
cv = []types.GeoMatchSetSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.GeoMatchSetSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentGeoMatchSetSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentGeoMatchSetSummary(v **types.GeoMatchSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.GeoMatchSetSummary
if *v == nil {
sv = &types.GeoMatchSetSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "GeoMatchSetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.GeoMatchSetId = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentHTTPHeader(v **types.HTTPHeader, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.HTTPHeader
if *v == nil {
sv = &types.HTTPHeader{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HeaderName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HeaderValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentHTTPHeaders(v *[]types.HTTPHeader, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.HTTPHeader
if *v == nil {
cv = []types.HTTPHeader{}
} else {
cv = *v
}
for _, value := range shape {
var col types.HTTPHeader
destAddr := &col
if err := awsAwsjson11_deserializeDocumentHTTPHeader(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentHTTPRequest(v **types.HTTPRequest, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.HTTPRequest
if *v == nil {
sv = &types.HTTPRequest{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ClientIP":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IPString to be of type string, got %T instead", value)
}
sv.ClientIP = ptr.String(jtv)
}
case "Country":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Country to be of type string, got %T instead", value)
}
sv.Country = ptr.String(jtv)
}
case "Headers":
if err := awsAwsjson11_deserializeDocumentHTTPHeaders(&sv.Headers, value); err != nil {
return err
}
case "HTTPVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HTTPVersion to be of type string, got %T instead", value)
}
sv.HTTPVersion = ptr.String(jtv)
}
case "Method":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HTTPMethod to be of type string, got %T instead", value)
}
sv.Method = ptr.String(jtv)
}
case "URI":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected URIString to be of type string, got %T instead", value)
}
sv.URI = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentIPSet(v **types.IPSet, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.IPSet
if *v == nil {
sv = &types.IPSet{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "IPSetDescriptors":
if err := awsAwsjson11_deserializeDocumentIPSetDescriptors(&sv.IPSetDescriptors, value); err != nil {
return err
}
case "IPSetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.IPSetId = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentIPSetDescriptor(v **types.IPSetDescriptor, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.IPSetDescriptor
if *v == nil {
sv = &types.IPSetDescriptor{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IPSetDescriptorType to be of type string, got %T instead", value)
}
sv.Type = types.IPSetDescriptorType(jtv)
}
case "Value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IPSetDescriptorValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentIPSetDescriptors(v *[]types.IPSetDescriptor, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.IPSetDescriptor
if *v == nil {
cv = []types.IPSetDescriptor{}
} else {
cv = *v
}
for _, value := range shape {
var col types.IPSetDescriptor
destAddr := &col
if err := awsAwsjson11_deserializeDocumentIPSetDescriptor(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentIPSetSummaries(v *[]types.IPSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.IPSetSummary
if *v == nil {
cv = []types.IPSetSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.IPSetSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentIPSetSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentIPSetSummary(v **types.IPSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.IPSetSummary
if *v == nil {
sv = &types.IPSetSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "IPSetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.IPSetId = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLogDestinationConfigs(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentLoggingConfiguration(v **types.LoggingConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LoggingConfiguration
if *v == nil {
sv = &types.LoggingConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LogDestinationConfigs":
if err := awsAwsjson11_deserializeDocumentLogDestinationConfigs(&sv.LogDestinationConfigs, value); err != nil {
return err
}
case "RedactedFields":
if err := awsAwsjson11_deserializeDocumentRedactedFields(&sv.RedactedFields, value); err != nil {
return err
}
case "ResourceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ResourceArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLoggingConfigurations(v *[]types.LoggingConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.LoggingConfiguration
if *v == nil {
cv = []types.LoggingConfiguration{}
} else {
cv = *v
}
for _, value := range shape {
var col types.LoggingConfiguration
destAddr := &col
if err := awsAwsjson11_deserializeDocumentLoggingConfiguration(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentManagedKeys(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ManagedKey to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentPredicate(v **types.Predicate, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Predicate
if *v == nil {
sv = &types.Predicate{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DataId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.DataId = ptr.String(jtv)
}
case "Negated":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Negated to be of type *bool, got %T instead", value)
}
sv.Negated = ptr.Bool(jtv)
}
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PredicateType to be of type string, got %T instead", value)
}
sv.Type = types.PredicateType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentPredicates(v *[]types.Predicate, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Predicate
if *v == nil {
cv = []types.Predicate{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Predicate
destAddr := &col
if err := awsAwsjson11_deserializeDocumentPredicate(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRateBasedRule(v **types.RateBasedRule, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RateBasedRule
if *v == nil {
sv = &types.RateBasedRule{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MatchPredicates":
if err := awsAwsjson11_deserializeDocumentPredicates(&sv.MatchPredicates, value); err != nil {
return err
}
case "MetricName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MetricName to be of type string, got %T instead", value)
}
sv.MetricName = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "RateKey":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RateKey to be of type string, got %T instead", value)
}
sv.RateKey = types.RateKey(jtv)
}
case "RateLimit":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected RateLimit to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.RateLimit = i64
}
case "RuleId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.RuleId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRedactedFields(v *[]types.FieldToMatch, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.FieldToMatch
if *v == nil {
cv = []types.FieldToMatch{}
} else {
cv = *v
}
for _, value := range shape {
var col types.FieldToMatch
destAddr := &col
if err := awsAwsjson11_deserializeDocumentFieldToMatch(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRegexMatchSet(v **types.RegexMatchSet, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RegexMatchSet
if *v == nil {
sv = &types.RegexMatchSet{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "RegexMatchSetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.RegexMatchSetId = ptr.String(jtv)
}
case "RegexMatchTuples":
if err := awsAwsjson11_deserializeDocumentRegexMatchTuples(&sv.RegexMatchTuples, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRegexMatchSetSummaries(v *[]types.RegexMatchSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.RegexMatchSetSummary
if *v == nil {
cv = []types.RegexMatchSetSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.RegexMatchSetSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentRegexMatchSetSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRegexMatchSetSummary(v **types.RegexMatchSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RegexMatchSetSummary
if *v == nil {
sv = &types.RegexMatchSetSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "RegexMatchSetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.RegexMatchSetId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRegexMatchTuple(v **types.RegexMatchTuple, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RegexMatchTuple
if *v == nil {
sv = &types.RegexMatchTuple{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FieldToMatch":
if err := awsAwsjson11_deserializeDocumentFieldToMatch(&sv.FieldToMatch, value); err != nil {
return err
}
case "RegexPatternSetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.RegexPatternSetId = ptr.String(jtv)
}
case "TextTransformation":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TextTransformation to be of type string, got %T instead", value)
}
sv.TextTransformation = types.TextTransformation(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRegexMatchTuples(v *[]types.RegexMatchTuple, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.RegexMatchTuple
if *v == nil {
cv = []types.RegexMatchTuple{}
} else {
cv = *v
}
for _, value := range shape {
var col types.RegexMatchTuple
destAddr := &col
if err := awsAwsjson11_deserializeDocumentRegexMatchTuple(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRegexPatternSet(v **types.RegexPatternSet, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RegexPatternSet
if *v == nil {
sv = &types.RegexPatternSet{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "RegexPatternSetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.RegexPatternSetId = ptr.String(jtv)
}
case "RegexPatternStrings":
if err := awsAwsjson11_deserializeDocumentRegexPatternStrings(&sv.RegexPatternStrings, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRegexPatternSetSummaries(v *[]types.RegexPatternSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.RegexPatternSetSummary
if *v == nil {
cv = []types.RegexPatternSetSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.RegexPatternSetSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentRegexPatternSetSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRegexPatternSetSummary(v **types.RegexPatternSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RegexPatternSetSummary
if *v == nil {
sv = &types.RegexPatternSetSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "RegexPatternSetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.RegexPatternSetId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRegexPatternStrings(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RegexPatternString to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentResourceArns(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRule(v **types.Rule, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Rule
if *v == nil {
sv = &types.Rule{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MetricName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MetricName to be of type string, got %T instead", value)
}
sv.MetricName = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Predicates":
if err := awsAwsjson11_deserializeDocumentPredicates(&sv.Predicates, value); err != nil {
return err
}
case "RuleId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.RuleId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRuleGroup(v **types.RuleGroup, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RuleGroup
if *v == nil {
sv = &types.RuleGroup{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MetricName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MetricName to be of type string, got %T instead", value)
}
sv.MetricName = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "RuleGroupId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.RuleGroupId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRuleGroupSummaries(v *[]types.RuleGroupSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.RuleGroupSummary
if *v == nil {
cv = []types.RuleGroupSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.RuleGroupSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentRuleGroupSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRuleGroupSummary(v **types.RuleGroupSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RuleGroupSummary
if *v == nil {
sv = &types.RuleGroupSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "RuleGroupId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.RuleGroupId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRuleSummaries(v *[]types.RuleSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.RuleSummary
if *v == nil {
cv = []types.RuleSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.RuleSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentRuleSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRuleSummary(v **types.RuleSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RuleSummary
if *v == nil {
sv = &types.RuleSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "RuleId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.RuleId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSampledHTTPRequest(v **types.SampledHTTPRequest, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SampledHTTPRequest
if *v == nil {
sv = &types.SampledHTTPRequest{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Action":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Action to be of type string, got %T instead", value)
}
sv.Action = ptr.String(jtv)
}
case "Request":
if err := awsAwsjson11_deserializeDocumentHTTPRequest(&sv.Request, value); err != nil {
return err
}
case "RuleWithinRuleGroup":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.RuleWithinRuleGroup = ptr.String(jtv)
}
case "Timestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Timestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "Weight":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected SampleWeight to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Weight = i64
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSampledHTTPRequests(v *[]types.SampledHTTPRequest, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.SampledHTTPRequest
if *v == nil {
cv = []types.SampledHTTPRequest{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SampledHTTPRequest
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSampledHTTPRequest(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSizeConstraint(v **types.SizeConstraint, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SizeConstraint
if *v == nil {
sv = &types.SizeConstraint{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ComparisonOperator":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComparisonOperator to be of type string, got %T instead", value)
}
sv.ComparisonOperator = types.ComparisonOperator(jtv)
}
case "FieldToMatch":
if err := awsAwsjson11_deserializeDocumentFieldToMatch(&sv.FieldToMatch, value); err != nil {
return err
}
case "Size":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Size to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Size = i64
}
case "TextTransformation":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TextTransformation to be of type string, got %T instead", value)
}
sv.TextTransformation = types.TextTransformation(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSizeConstraints(v *[]types.SizeConstraint, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.SizeConstraint
if *v == nil {
cv = []types.SizeConstraint{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SizeConstraint
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSizeConstraint(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSizeConstraintSet(v **types.SizeConstraintSet, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SizeConstraintSet
if *v == nil {
sv = &types.SizeConstraintSet{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "SizeConstraints":
if err := awsAwsjson11_deserializeDocumentSizeConstraints(&sv.SizeConstraints, value); err != nil {
return err
}
case "SizeConstraintSetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.SizeConstraintSetId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSizeConstraintSetSummaries(v *[]types.SizeConstraintSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.SizeConstraintSetSummary
if *v == nil {
cv = []types.SizeConstraintSetSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SizeConstraintSetSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSizeConstraintSetSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSizeConstraintSetSummary(v **types.SizeConstraintSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SizeConstraintSetSummary
if *v == nil {
sv = &types.SizeConstraintSetSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "SizeConstraintSetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.SizeConstraintSetId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSqlInjectionMatchSet(v **types.SqlInjectionMatchSet, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SqlInjectionMatchSet
if *v == nil {
sv = &types.SqlInjectionMatchSet{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "SqlInjectionMatchSetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.SqlInjectionMatchSetId = ptr.String(jtv)
}
case "SqlInjectionMatchTuples":
if err := awsAwsjson11_deserializeDocumentSqlInjectionMatchTuples(&sv.SqlInjectionMatchTuples, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSqlInjectionMatchSetSummaries(v *[]types.SqlInjectionMatchSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.SqlInjectionMatchSetSummary
if *v == nil {
cv = []types.SqlInjectionMatchSetSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SqlInjectionMatchSetSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSqlInjectionMatchSetSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSqlInjectionMatchSetSummary(v **types.SqlInjectionMatchSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SqlInjectionMatchSetSummary
if *v == nil {
sv = &types.SqlInjectionMatchSetSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "SqlInjectionMatchSetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.SqlInjectionMatchSetId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSqlInjectionMatchTuple(v **types.SqlInjectionMatchTuple, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SqlInjectionMatchTuple
if *v == nil {
sv = &types.SqlInjectionMatchTuple{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FieldToMatch":
if err := awsAwsjson11_deserializeDocumentFieldToMatch(&sv.FieldToMatch, value); err != nil {
return err
}
case "TextTransformation":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TextTransformation to be of type string, got %T instead", value)
}
sv.TextTransformation = types.TextTransformation(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSqlInjectionMatchTuples(v *[]types.SqlInjectionMatchTuple, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.SqlInjectionMatchTuple
if *v == nil {
cv = []types.SqlInjectionMatchTuple{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SqlInjectionMatchTuple
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSqlInjectionMatchTuple(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSubscribedRuleGroupSummaries(v *[]types.SubscribedRuleGroupSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.SubscribedRuleGroupSummary
if *v == nil {
cv = []types.SubscribedRuleGroupSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SubscribedRuleGroupSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSubscribedRuleGroupSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSubscribedRuleGroupSummary(v **types.SubscribedRuleGroupSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SubscribedRuleGroupSummary
if *v == nil {
sv = &types.SubscribedRuleGroupSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MetricName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MetricName to be of type string, got %T instead", value)
}
sv.MetricName = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "RuleGroupId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.RuleGroupId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Tag
if *v == nil {
sv = &types.Tag{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagKey to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
case "Value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTagInfoForResource(v **types.TagInfoForResource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TagInfoForResource
if *v == nil {
sv = &types.TagInfoForResource{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ResourceARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ResourceARN = ptr.String(jtv)
}
case "TagList":
if err := awsAwsjson11_deserializeDocumentTagList(&sv.TagList, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Tag
if *v == nil {
cv = []types.Tag{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Tag
destAddr := &col
if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentTimeWindow(v **types.TimeWindow, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TimeWindow
if *v == nil {
sv = &types.TimeWindow{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EndTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWafAction(v **types.WafAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WafAction
if *v == nil {
sv = &types.WafAction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WafActionType to be of type string, got %T instead", value)
}
sv.Type = types.WafActionType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFBadRequestException(v **types.WAFBadRequestException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFBadRequestException
if *v == nil {
sv = &types.WAFBadRequestException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFDisallowedNameException(v **types.WAFDisallowedNameException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFDisallowedNameException
if *v == nil {
sv = &types.WAFDisallowedNameException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFEntityMigrationException(v **types.WAFEntityMigrationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFEntityMigrationException
if *v == nil {
sv = &types.WAFEntityMigrationException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "MigrationErrorReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorReason to be of type string, got %T instead", value)
}
sv.MigrationErrorReason = ptr.String(jtv)
}
case "MigrationErrorType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MigrationErrorType to be of type string, got %T instead", value)
}
sv.MigrationErrorType = types.MigrationErrorType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFInternalErrorException(v **types.WAFInternalErrorException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFInternalErrorException
if *v == nil {
sv = &types.WAFInternalErrorException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFInvalidAccountException(v **types.WAFInvalidAccountException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFInvalidAccountException
if *v == nil {
sv = &types.WAFInvalidAccountException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFInvalidOperationException(v **types.WAFInvalidOperationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFInvalidOperationException
if *v == nil {
sv = &types.WAFInvalidOperationException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFInvalidParameterException(v **types.WAFInvalidParameterException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFInvalidParameterException
if *v == nil {
sv = &types.WAFInvalidParameterException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "field":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ParameterExceptionField to be of type string, got %T instead", value)
}
sv.Field = types.ParameterExceptionField(jtv)
}
case "parameter":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ParameterExceptionParameter to be of type string, got %T instead", value)
}
sv.Parameter = ptr.String(jtv)
}
case "reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ParameterExceptionReason to be of type string, got %T instead", value)
}
sv.Reason = types.ParameterExceptionReason(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFInvalidPermissionPolicyException(v **types.WAFInvalidPermissionPolicyException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFInvalidPermissionPolicyException
if *v == nil {
sv = &types.WAFInvalidPermissionPolicyException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFInvalidRegexPatternException(v **types.WAFInvalidRegexPatternException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFInvalidRegexPatternException
if *v == nil {
sv = &types.WAFInvalidRegexPatternException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFLimitsExceededException(v **types.WAFLimitsExceededException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFLimitsExceededException
if *v == nil {
sv = &types.WAFLimitsExceededException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFNonEmptyEntityException(v **types.WAFNonEmptyEntityException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFNonEmptyEntityException
if *v == nil {
sv = &types.WAFNonEmptyEntityException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFNonexistentContainerException(v **types.WAFNonexistentContainerException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFNonexistentContainerException
if *v == nil {
sv = &types.WAFNonexistentContainerException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFNonexistentItemException(v **types.WAFNonexistentItemException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFNonexistentItemException
if *v == nil {
sv = &types.WAFNonexistentItemException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWafOverrideAction(v **types.WafOverrideAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WafOverrideAction
if *v == nil {
sv = &types.WafOverrideAction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WafOverrideActionType to be of type string, got %T instead", value)
}
sv.Type = types.WafOverrideActionType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFReferencedItemException(v **types.WAFReferencedItemException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFReferencedItemException
if *v == nil {
sv = &types.WAFReferencedItemException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFServiceLinkedRoleErrorException(v **types.WAFServiceLinkedRoleErrorException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFServiceLinkedRoleErrorException
if *v == nil {
sv = &types.WAFServiceLinkedRoleErrorException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFStaleDataException(v **types.WAFStaleDataException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFStaleDataException
if *v == nil {
sv = &types.WAFStaleDataException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFSubscriptionNotFoundException(v **types.WAFSubscriptionNotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFSubscriptionNotFoundException
if *v == nil {
sv = &types.WAFSubscriptionNotFoundException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFTagOperationException(v **types.WAFTagOperationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFTagOperationException
if *v == nil {
sv = &types.WAFTagOperationException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFTagOperationInternalErrorException(v **types.WAFTagOperationInternalErrorException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFTagOperationInternalErrorException
if *v == nil {
sv = &types.WAFTagOperationInternalErrorException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFUnavailableEntityException(v **types.WAFUnavailableEntityException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFUnavailableEntityException
if *v == nil {
sv = &types.WAFUnavailableEntityException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWebACL(v **types.WebACL, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WebACL
if *v == nil {
sv = &types.WebACL{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DefaultAction":
if err := awsAwsjson11_deserializeDocumentWafAction(&sv.DefaultAction, value); err != nil {
return err
}
case "MetricName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MetricName to be of type string, got %T instead", value)
}
sv.MetricName = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Rules":
if err := awsAwsjson11_deserializeDocumentActivatedRules(&sv.Rules, value); err != nil {
return err
}
case "WebACLArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.WebACLArn = ptr.String(jtv)
}
case "WebACLId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.WebACLId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWebACLSummaries(v *[]types.WebACLSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.WebACLSummary
if *v == nil {
cv = []types.WebACLSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.WebACLSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentWebACLSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentWebACLSummary(v **types.WebACLSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WebACLSummary
if *v == nil {
sv = &types.WebACLSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "WebACLId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.WebACLId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentXssMatchSet(v **types.XssMatchSet, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.XssMatchSet
if *v == nil {
sv = &types.XssMatchSet{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "XssMatchSetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.XssMatchSetId = ptr.String(jtv)
}
case "XssMatchTuples":
if err := awsAwsjson11_deserializeDocumentXssMatchTuples(&sv.XssMatchTuples, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentXssMatchSetSummaries(v *[]types.XssMatchSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.XssMatchSetSummary
if *v == nil {
cv = []types.XssMatchSetSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.XssMatchSetSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentXssMatchSetSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentXssMatchSetSummary(v **types.XssMatchSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.XssMatchSetSummary
if *v == nil {
sv = &types.XssMatchSetSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "XssMatchSetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value)
}
sv.XssMatchSetId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentXssMatchTuple(v **types.XssMatchTuple, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.XssMatchTuple
if *v == nil {
sv = &types.XssMatchTuple{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FieldToMatch":
if err := awsAwsjson11_deserializeDocumentFieldToMatch(&sv.FieldToMatch, value); err != nil {
return err
}
case "TextTransformation":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TextTransformation to be of type string, got %T instead", value)
}
sv.TextTransformation = types.TextTransformation(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentXssMatchTuples(v *[]types.XssMatchTuple, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.XssMatchTuple
if *v == nil {
cv = []types.XssMatchTuple{}
} else {
cv = *v
}
for _, value := range shape {
var col types.XssMatchTuple
destAddr := &col
if err := awsAwsjson11_deserializeDocumentXssMatchTuple(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeOpDocumentAssociateWebACLOutput(v **AssociateWebACLOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AssociateWebACLOutput
if *v == nil {
sv = &AssociateWebACLOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateByteMatchSetOutput(v **CreateByteMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateByteMatchSetOutput
if *v == nil {
sv = &CreateByteMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ByteMatchSet":
if err := awsAwsjson11_deserializeDocumentByteMatchSet(&sv.ByteMatchSet, value); err != nil {
return err
}
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateGeoMatchSetOutput(v **CreateGeoMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateGeoMatchSetOutput
if *v == nil {
sv = &CreateGeoMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
case "GeoMatchSet":
if err := awsAwsjson11_deserializeDocumentGeoMatchSet(&sv.GeoMatchSet, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateIPSetOutput(v **CreateIPSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateIPSetOutput
if *v == nil {
sv = &CreateIPSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
case "IPSet":
if err := awsAwsjson11_deserializeDocumentIPSet(&sv.IPSet, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateRateBasedRuleOutput(v **CreateRateBasedRuleOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateRateBasedRuleOutput
if *v == nil {
sv = &CreateRateBasedRuleOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
case "Rule":
if err := awsAwsjson11_deserializeDocumentRateBasedRule(&sv.Rule, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateRegexMatchSetOutput(v **CreateRegexMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateRegexMatchSetOutput
if *v == nil {
sv = &CreateRegexMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
case "RegexMatchSet":
if err := awsAwsjson11_deserializeDocumentRegexMatchSet(&sv.RegexMatchSet, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateRegexPatternSetOutput(v **CreateRegexPatternSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateRegexPatternSetOutput
if *v == nil {
sv = &CreateRegexPatternSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
case "RegexPatternSet":
if err := awsAwsjson11_deserializeDocumentRegexPatternSet(&sv.RegexPatternSet, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateRuleGroupOutput(v **CreateRuleGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateRuleGroupOutput
if *v == nil {
sv = &CreateRuleGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
case "RuleGroup":
if err := awsAwsjson11_deserializeDocumentRuleGroup(&sv.RuleGroup, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateRuleOutput(v **CreateRuleOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateRuleOutput
if *v == nil {
sv = &CreateRuleOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
case "Rule":
if err := awsAwsjson11_deserializeDocumentRule(&sv.Rule, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateSizeConstraintSetOutput(v **CreateSizeConstraintSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateSizeConstraintSetOutput
if *v == nil {
sv = &CreateSizeConstraintSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
case "SizeConstraintSet":
if err := awsAwsjson11_deserializeDocumentSizeConstraintSet(&sv.SizeConstraintSet, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateSqlInjectionMatchSetOutput(v **CreateSqlInjectionMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateSqlInjectionMatchSetOutput
if *v == nil {
sv = &CreateSqlInjectionMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
case "SqlInjectionMatchSet":
if err := awsAwsjson11_deserializeDocumentSqlInjectionMatchSet(&sv.SqlInjectionMatchSet, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateWebACLMigrationStackOutput(v **CreateWebACLMigrationStackOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateWebACLMigrationStackOutput
if *v == nil {
sv = &CreateWebACLMigrationStackOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "S3ObjectUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected S3ObjectUrl to be of type string, got %T instead", value)
}
sv.S3ObjectUrl = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateWebACLOutput(v **CreateWebACLOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateWebACLOutput
if *v == nil {
sv = &CreateWebACLOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
case "WebACL":
if err := awsAwsjson11_deserializeDocumentWebACL(&sv.WebACL, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateXssMatchSetOutput(v **CreateXssMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateXssMatchSetOutput
if *v == nil {
sv = &CreateXssMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
case "XssMatchSet":
if err := awsAwsjson11_deserializeDocumentXssMatchSet(&sv.XssMatchSet, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteByteMatchSetOutput(v **DeleteByteMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteByteMatchSetOutput
if *v == nil {
sv = &DeleteByteMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteGeoMatchSetOutput(v **DeleteGeoMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteGeoMatchSetOutput
if *v == nil {
sv = &DeleteGeoMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteIPSetOutput(v **DeleteIPSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteIPSetOutput
if *v == nil {
sv = &DeleteIPSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteLoggingConfigurationOutput(v **DeleteLoggingConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteLoggingConfigurationOutput
if *v == nil {
sv = &DeleteLoggingConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeletePermissionPolicyOutput(v **DeletePermissionPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeletePermissionPolicyOutput
if *v == nil {
sv = &DeletePermissionPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteRateBasedRuleOutput(v **DeleteRateBasedRuleOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteRateBasedRuleOutput
if *v == nil {
sv = &DeleteRateBasedRuleOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteRegexMatchSetOutput(v **DeleteRegexMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteRegexMatchSetOutput
if *v == nil {
sv = &DeleteRegexMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteRegexPatternSetOutput(v **DeleteRegexPatternSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteRegexPatternSetOutput
if *v == nil {
sv = &DeleteRegexPatternSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteRuleGroupOutput(v **DeleteRuleGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteRuleGroupOutput
if *v == nil {
sv = &DeleteRuleGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteRuleOutput(v **DeleteRuleOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteRuleOutput
if *v == nil {
sv = &DeleteRuleOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteSizeConstraintSetOutput(v **DeleteSizeConstraintSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteSizeConstraintSetOutput
if *v == nil {
sv = &DeleteSizeConstraintSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteSqlInjectionMatchSetOutput(v **DeleteSqlInjectionMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteSqlInjectionMatchSetOutput
if *v == nil {
sv = &DeleteSqlInjectionMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteWebACLOutput(v **DeleteWebACLOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteWebACLOutput
if *v == nil {
sv = &DeleteWebACLOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteXssMatchSetOutput(v **DeleteXssMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteXssMatchSetOutput
if *v == nil {
sv = &DeleteXssMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDisassociateWebACLOutput(v **DisassociateWebACLOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DisassociateWebACLOutput
if *v == nil {
sv = &DisassociateWebACLOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetByteMatchSetOutput(v **GetByteMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetByteMatchSetOutput
if *v == nil {
sv = &GetByteMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ByteMatchSet":
if err := awsAwsjson11_deserializeDocumentByteMatchSet(&sv.ByteMatchSet, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetChangeTokenOutput(v **GetChangeTokenOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetChangeTokenOutput
if *v == nil {
sv = &GetChangeTokenOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetChangeTokenStatusOutput(v **GetChangeTokenStatusOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetChangeTokenStatusOutput
if *v == nil {
sv = &GetChangeTokenStatusOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeTokenStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeTokenStatus to be of type string, got %T instead", value)
}
sv.ChangeTokenStatus = types.ChangeTokenStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetGeoMatchSetOutput(v **GetGeoMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetGeoMatchSetOutput
if *v == nil {
sv = &GetGeoMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "GeoMatchSet":
if err := awsAwsjson11_deserializeDocumentGeoMatchSet(&sv.GeoMatchSet, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetIPSetOutput(v **GetIPSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetIPSetOutput
if *v == nil {
sv = &GetIPSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "IPSet":
if err := awsAwsjson11_deserializeDocumentIPSet(&sv.IPSet, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetLoggingConfigurationOutput(v **GetLoggingConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetLoggingConfigurationOutput
if *v == nil {
sv = &GetLoggingConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LoggingConfiguration":
if err := awsAwsjson11_deserializeDocumentLoggingConfiguration(&sv.LoggingConfiguration, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetPermissionPolicyOutput(v **GetPermissionPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetPermissionPolicyOutput
if *v == nil {
sv = &GetPermissionPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Policy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PolicyString to be of type string, got %T instead", value)
}
sv.Policy = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetRateBasedRuleManagedKeysOutput(v **GetRateBasedRuleManagedKeysOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetRateBasedRuleManagedKeysOutput
if *v == nil {
sv = &GetRateBasedRuleManagedKeysOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ManagedKeys":
if err := awsAwsjson11_deserializeDocumentManagedKeys(&sv.ManagedKeys, value); err != nil {
return err
}
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetRateBasedRuleOutput(v **GetRateBasedRuleOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetRateBasedRuleOutput
if *v == nil {
sv = &GetRateBasedRuleOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Rule":
if err := awsAwsjson11_deserializeDocumentRateBasedRule(&sv.Rule, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetRegexMatchSetOutput(v **GetRegexMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetRegexMatchSetOutput
if *v == nil {
sv = &GetRegexMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "RegexMatchSet":
if err := awsAwsjson11_deserializeDocumentRegexMatchSet(&sv.RegexMatchSet, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetRegexPatternSetOutput(v **GetRegexPatternSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetRegexPatternSetOutput
if *v == nil {
sv = &GetRegexPatternSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "RegexPatternSet":
if err := awsAwsjson11_deserializeDocumentRegexPatternSet(&sv.RegexPatternSet, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetRuleGroupOutput(v **GetRuleGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetRuleGroupOutput
if *v == nil {
sv = &GetRuleGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "RuleGroup":
if err := awsAwsjson11_deserializeDocumentRuleGroup(&sv.RuleGroup, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetRuleOutput(v **GetRuleOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetRuleOutput
if *v == nil {
sv = &GetRuleOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Rule":
if err := awsAwsjson11_deserializeDocumentRule(&sv.Rule, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetSampledRequestsOutput(v **GetSampledRequestsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetSampledRequestsOutput
if *v == nil {
sv = &GetSampledRequestsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "PopulationSize":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected PopulationSize to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.PopulationSize = i64
}
case "SampledRequests":
if err := awsAwsjson11_deserializeDocumentSampledHTTPRequests(&sv.SampledRequests, value); err != nil {
return err
}
case "TimeWindow":
if err := awsAwsjson11_deserializeDocumentTimeWindow(&sv.TimeWindow, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetSizeConstraintSetOutput(v **GetSizeConstraintSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetSizeConstraintSetOutput
if *v == nil {
sv = &GetSizeConstraintSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "SizeConstraintSet":
if err := awsAwsjson11_deserializeDocumentSizeConstraintSet(&sv.SizeConstraintSet, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetSqlInjectionMatchSetOutput(v **GetSqlInjectionMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetSqlInjectionMatchSetOutput
if *v == nil {
sv = &GetSqlInjectionMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "SqlInjectionMatchSet":
if err := awsAwsjson11_deserializeDocumentSqlInjectionMatchSet(&sv.SqlInjectionMatchSet, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetWebACLForResourceOutput(v **GetWebACLForResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetWebACLForResourceOutput
if *v == nil {
sv = &GetWebACLForResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "WebACLSummary":
if err := awsAwsjson11_deserializeDocumentWebACLSummary(&sv.WebACLSummary, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetWebACLOutput(v **GetWebACLOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetWebACLOutput
if *v == nil {
sv = &GetWebACLOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "WebACL":
if err := awsAwsjson11_deserializeDocumentWebACL(&sv.WebACL, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetXssMatchSetOutput(v **GetXssMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetXssMatchSetOutput
if *v == nil {
sv = &GetXssMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "XssMatchSet":
if err := awsAwsjson11_deserializeDocumentXssMatchSet(&sv.XssMatchSet, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListActivatedRulesInRuleGroupOutput(v **ListActivatedRulesInRuleGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListActivatedRulesInRuleGroupOutput
if *v == nil {
sv = &ListActivatedRulesInRuleGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ActivatedRules":
if err := awsAwsjson11_deserializeDocumentActivatedRules(&sv.ActivatedRules, value); err != nil {
return err
}
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListByteMatchSetsOutput(v **ListByteMatchSetsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListByteMatchSetsOutput
if *v == nil {
sv = &ListByteMatchSetsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ByteMatchSets":
if err := awsAwsjson11_deserializeDocumentByteMatchSetSummaries(&sv.ByteMatchSets, value); err != nil {
return err
}
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListGeoMatchSetsOutput(v **ListGeoMatchSetsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListGeoMatchSetsOutput
if *v == nil {
sv = &ListGeoMatchSetsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "GeoMatchSets":
if err := awsAwsjson11_deserializeDocumentGeoMatchSetSummaries(&sv.GeoMatchSets, value); err != nil {
return err
}
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListIPSetsOutput(v **ListIPSetsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListIPSetsOutput
if *v == nil {
sv = &ListIPSetsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "IPSets":
if err := awsAwsjson11_deserializeDocumentIPSetSummaries(&sv.IPSets, value); err != nil {
return err
}
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListLoggingConfigurationsOutput(v **ListLoggingConfigurationsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListLoggingConfigurationsOutput
if *v == nil {
sv = &ListLoggingConfigurationsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LoggingConfigurations":
if err := awsAwsjson11_deserializeDocumentLoggingConfigurations(&sv.LoggingConfigurations, value); err != nil {
return err
}
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListRateBasedRulesOutput(v **ListRateBasedRulesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListRateBasedRulesOutput
if *v == nil {
sv = &ListRateBasedRulesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
case "Rules":
if err := awsAwsjson11_deserializeDocumentRuleSummaries(&sv.Rules, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListRegexMatchSetsOutput(v **ListRegexMatchSetsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListRegexMatchSetsOutput
if *v == nil {
sv = &ListRegexMatchSetsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
case "RegexMatchSets":
if err := awsAwsjson11_deserializeDocumentRegexMatchSetSummaries(&sv.RegexMatchSets, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListRegexPatternSetsOutput(v **ListRegexPatternSetsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListRegexPatternSetsOutput
if *v == nil {
sv = &ListRegexPatternSetsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
case "RegexPatternSets":
if err := awsAwsjson11_deserializeDocumentRegexPatternSetSummaries(&sv.RegexPatternSets, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListResourcesForWebACLOutput(v **ListResourcesForWebACLOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListResourcesForWebACLOutput
if *v == nil {
sv = &ListResourcesForWebACLOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ResourceArns":
if err := awsAwsjson11_deserializeDocumentResourceArns(&sv.ResourceArns, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListRuleGroupsOutput(v **ListRuleGroupsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListRuleGroupsOutput
if *v == nil {
sv = &ListRuleGroupsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
case "RuleGroups":
if err := awsAwsjson11_deserializeDocumentRuleGroupSummaries(&sv.RuleGroups, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListRulesOutput(v **ListRulesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListRulesOutput
if *v == nil {
sv = &ListRulesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
case "Rules":
if err := awsAwsjson11_deserializeDocumentRuleSummaries(&sv.Rules, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListSizeConstraintSetsOutput(v **ListSizeConstraintSetsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListSizeConstraintSetsOutput
if *v == nil {
sv = &ListSizeConstraintSetsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
case "SizeConstraintSets":
if err := awsAwsjson11_deserializeDocumentSizeConstraintSetSummaries(&sv.SizeConstraintSets, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListSqlInjectionMatchSetsOutput(v **ListSqlInjectionMatchSetsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListSqlInjectionMatchSetsOutput
if *v == nil {
sv = &ListSqlInjectionMatchSetsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
case "SqlInjectionMatchSets":
if err := awsAwsjson11_deserializeDocumentSqlInjectionMatchSetSummaries(&sv.SqlInjectionMatchSets, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListSubscribedRuleGroupsOutput(v **ListSubscribedRuleGroupsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListSubscribedRuleGroupsOutput
if *v == nil {
sv = &ListSubscribedRuleGroupsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
case "RuleGroups":
if err := awsAwsjson11_deserializeDocumentSubscribedRuleGroupSummaries(&sv.RuleGroups, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTagsForResourceOutput
if *v == nil {
sv = &ListTagsForResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
case "TagInfoForResource":
if err := awsAwsjson11_deserializeDocumentTagInfoForResource(&sv.TagInfoForResource, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListWebACLsOutput(v **ListWebACLsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListWebACLsOutput
if *v == nil {
sv = &ListWebACLsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
case "WebACLs":
if err := awsAwsjson11_deserializeDocumentWebACLSummaries(&sv.WebACLs, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListXssMatchSetsOutput(v **ListXssMatchSetsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListXssMatchSetsOutput
if *v == nil {
sv = &ListXssMatchSetsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
case "XssMatchSets":
if err := awsAwsjson11_deserializeDocumentXssMatchSetSummaries(&sv.XssMatchSets, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentPutLoggingConfigurationOutput(v **PutLoggingConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutLoggingConfigurationOutput
if *v == nil {
sv = &PutLoggingConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LoggingConfiguration":
if err := awsAwsjson11_deserializeDocumentLoggingConfiguration(&sv.LoggingConfiguration, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentPutPermissionPolicyOutput(v **PutPermissionPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutPermissionPolicyOutput
if *v == nil {
sv = &PutPermissionPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *TagResourceOutput
if *v == nil {
sv = &TagResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UntagResourceOutput
if *v == nil {
sv = &UntagResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateByteMatchSetOutput(v **UpdateByteMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateByteMatchSetOutput
if *v == nil {
sv = &UpdateByteMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateGeoMatchSetOutput(v **UpdateGeoMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateGeoMatchSetOutput
if *v == nil {
sv = &UpdateGeoMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateIPSetOutput(v **UpdateIPSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateIPSetOutput
if *v == nil {
sv = &UpdateIPSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateRateBasedRuleOutput(v **UpdateRateBasedRuleOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateRateBasedRuleOutput
if *v == nil {
sv = &UpdateRateBasedRuleOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateRegexMatchSetOutput(v **UpdateRegexMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateRegexMatchSetOutput
if *v == nil {
sv = &UpdateRegexMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateRegexPatternSetOutput(v **UpdateRegexPatternSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateRegexPatternSetOutput
if *v == nil {
sv = &UpdateRegexPatternSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateRuleGroupOutput(v **UpdateRuleGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateRuleGroupOutput
if *v == nil {
sv = &UpdateRuleGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateRuleOutput(v **UpdateRuleOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateRuleOutput
if *v == nil {
sv = &UpdateRuleOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateSizeConstraintSetOutput(v **UpdateSizeConstraintSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateSizeConstraintSetOutput
if *v == nil {
sv = &UpdateSizeConstraintSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateSqlInjectionMatchSetOutput(v **UpdateSqlInjectionMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateSqlInjectionMatchSetOutput
if *v == nil {
sv = &UpdateSqlInjectionMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateWebACLOutput(v **UpdateWebACLOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateWebACLOutput
if *v == nil {
sv = &UpdateWebACLOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateXssMatchSetOutput(v **UpdateXssMatchSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateXssMatchSetOutput
if *v == nil {
sv = &UpdateXssMatchSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChangeToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeToken to be of type string, got %T instead", value)
}
sv.ChangeToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 18,222 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package wafregional provides the API client, operations, and parameter types
// for AWS WAF Regional.
//
// This is AWS WAF Classic Regional documentation. For more information, see AWS
// WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. This is the AWS WAF Regional Classic API Reference for using AWS
// WAF Classic with the AWS resources, Elastic Load Balancing (ELB) Application
// Load Balancers and API Gateway APIs. The AWS WAF Classic actions and data types
// listed in the reference are available for protecting Elastic Load Balancing
// (ELB) Application Load Balancers and API Gateway APIs. You can use these actions
// and data types by means of the endpoints listed in AWS Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#waf_region)
// . This guide is for developers who need detailed information about the AWS WAF
// Classic API actions, data types, and errors. For detailed information about AWS
// WAF Classic features and an overview of how to use the AWS WAF Classic API, see
// the AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide.
package wafregional
| 23 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafregional
import (
"context"
"errors"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
internalendpoints "github.com/aws/aws-sdk-go-v2/service/wafregional/internal/endpoints"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net/url"
"strings"
)
// EndpointResolverOptions is the service endpoint resolver options
type EndpointResolverOptions = internalendpoints.Options
// EndpointResolver interface for resolving service endpoints.
type EndpointResolver interface {
ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)
}
var _ EndpointResolver = &internalendpoints.Resolver{}
// NewDefaultEndpointResolver constructs a new service endpoint resolver
func NewDefaultEndpointResolver() *internalendpoints.Resolver {
return internalendpoints.New()
}
// EndpointResolverFunc is a helper utility that wraps a function so it satisfies
// the EndpointResolver interface. This is useful when you want to add additional
// endpoint resolving logic, or stub out specific endpoints with custom values.
type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)
func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
return fn(region, options)
}
func resolveDefaultEndpointConfiguration(o *Options) {
if o.EndpointResolver != nil {
return
}
o.EndpointResolver = NewDefaultEndpointResolver()
}
// EndpointResolverFromURL returns an EndpointResolver configured using the
// provided endpoint url. By default, the resolved endpoint resolver uses the
// client region as signing region, and the endpoint source is set to
// EndpointSourceCustom.You can provide functional options to configure endpoint
// values for the resolved endpoint.
func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {
e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}
for _, fn := range optFns {
fn(&e)
}
return EndpointResolverFunc(
func(region string, options EndpointResolverOptions) (aws.Endpoint, error) {
if len(e.SigningRegion) == 0 {
e.SigningRegion = region
}
return e, nil
},
)
}
type ResolveEndpoint struct {
Resolver EndpointResolver
Options EndpointResolverOptions
}
func (*ResolveEndpoint) ID() string {
return "ResolveEndpoint"
}
func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
if m.Resolver == nil {
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
}
eo := m.Options
eo.Logger = middleware.GetLogger(ctx)
var endpoint aws.Endpoint
endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)
if err != nil {
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
}
req.URL, err = url.Parse(endpoint.URL)
if err != nil {
return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err)
}
if len(awsmiddleware.GetSigningName(ctx)) == 0 {
signingName := endpoint.SigningName
if len(signingName) == 0 {
signingName = "waf-regional"
}
ctx = awsmiddleware.SetSigningName(ctx, signingName)
}
ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)
ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable)
ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)
ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID)
return next.HandleSerialize(ctx, in)
}
func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error {
return stack.Serialize.Insert(&ResolveEndpoint{
Resolver: o.EndpointResolver,
Options: o.EndpointOptions,
}, "OperationSerializer", middleware.Before)
}
func removeResolveEndpointMiddleware(stack *middleware.Stack) error {
_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())
return err
}
type wrappedEndpointResolver struct {
awsResolver aws.EndpointResolverWithOptions
resolver EndpointResolver
}
func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
if w.awsResolver == nil {
goto fallback
}
endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options)
if err == nil {
return endpoint, nil
}
if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) {
return endpoint, err
}
fallback:
if w.resolver == nil {
return endpoint, fmt.Errorf("default endpoint resolver provided was nil")
}
return w.resolver.ResolveEndpoint(region, options)
}
type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)
func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {
return a(service, region)
}
var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)
// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver.
// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided
// fallbackResolver for resolution.
//
// fallbackResolver must not be nil
func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver {
var resolver aws.EndpointResolverWithOptions
if awsResolverWithOptions != nil {
resolver = awsResolverWithOptions
} else if awsResolver != nil {
resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)
}
return &wrappedEndpointResolver{
awsResolver: resolver,
resolver: fallbackResolver,
}
}
func finalizeClientEndpointResolverOptions(options *Options) {
options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()
if len(options.EndpointOptions.ResolvedRegion) == 0 {
const fipsInfix = "-fips-"
const fipsPrefix = "fips-"
const fipsSuffix = "-fips"
if strings.Contains(options.Region, fipsInfix) ||
strings.Contains(options.Region, fipsPrefix) ||
strings.Contains(options.Region, fipsSuffix) {
options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(
options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "")
options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled
}
}
}
| 201 |
aws-sdk-go-v2 | aws | Go | // Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
package wafregional
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.13.15"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafregional
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafregional
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/wafregional/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"path"
)
type awsAwsjson11_serializeOpAssociateWebACL struct {
}
func (*awsAwsjson11_serializeOpAssociateWebACL) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAssociateWebACL) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AssociateWebACLInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.AssociateWebACL")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAssociateWebACLInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateByteMatchSet struct {
}
func (*awsAwsjson11_serializeOpCreateByteMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateByteMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateByteMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.CreateByteMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateByteMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateGeoMatchSet struct {
}
func (*awsAwsjson11_serializeOpCreateGeoMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateGeoMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateGeoMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.CreateGeoMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateGeoMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateIPSet struct {
}
func (*awsAwsjson11_serializeOpCreateIPSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateIPSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateIPSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.CreateIPSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateIPSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateRateBasedRule struct {
}
func (*awsAwsjson11_serializeOpCreateRateBasedRule) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateRateBasedRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateRateBasedRuleInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.CreateRateBasedRule")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateRateBasedRuleInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateRegexMatchSet struct {
}
func (*awsAwsjson11_serializeOpCreateRegexMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateRegexMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateRegexMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.CreateRegexMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateRegexMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateRegexPatternSet struct {
}
func (*awsAwsjson11_serializeOpCreateRegexPatternSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateRegexPatternSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateRegexPatternSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.CreateRegexPatternSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateRegexPatternSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateRule struct {
}
func (*awsAwsjson11_serializeOpCreateRule) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateRuleInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.CreateRule")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateRuleInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateRuleGroup struct {
}
func (*awsAwsjson11_serializeOpCreateRuleGroup) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateRuleGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateRuleGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.CreateRuleGroup")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateRuleGroupInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateSizeConstraintSet struct {
}
func (*awsAwsjson11_serializeOpCreateSizeConstraintSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateSizeConstraintSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateSizeConstraintSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.CreateSizeConstraintSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateSizeConstraintSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateSqlInjectionMatchSet struct {
}
func (*awsAwsjson11_serializeOpCreateSqlInjectionMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateSqlInjectionMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateSqlInjectionMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.CreateSqlInjectionMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateSqlInjectionMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateWebACL struct {
}
func (*awsAwsjson11_serializeOpCreateWebACL) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateWebACL) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateWebACLInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.CreateWebACL")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateWebACLInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateWebACLMigrationStack struct {
}
func (*awsAwsjson11_serializeOpCreateWebACLMigrationStack) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateWebACLMigrationStack) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateWebACLMigrationStackInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.CreateWebACLMigrationStack")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateWebACLMigrationStackInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateXssMatchSet struct {
}
func (*awsAwsjson11_serializeOpCreateXssMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateXssMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateXssMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.CreateXssMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateXssMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteByteMatchSet struct {
}
func (*awsAwsjson11_serializeOpDeleteByteMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteByteMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteByteMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.DeleteByteMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteByteMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteGeoMatchSet struct {
}
func (*awsAwsjson11_serializeOpDeleteGeoMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteGeoMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteGeoMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.DeleteGeoMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteGeoMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteIPSet struct {
}
func (*awsAwsjson11_serializeOpDeleteIPSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteIPSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteIPSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.DeleteIPSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteIPSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteLoggingConfiguration struct {
}
func (*awsAwsjson11_serializeOpDeleteLoggingConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteLoggingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteLoggingConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.DeleteLoggingConfiguration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteLoggingConfigurationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeletePermissionPolicy struct {
}
func (*awsAwsjson11_serializeOpDeletePermissionPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeletePermissionPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeletePermissionPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.DeletePermissionPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeletePermissionPolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteRateBasedRule struct {
}
func (*awsAwsjson11_serializeOpDeleteRateBasedRule) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteRateBasedRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteRateBasedRuleInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.DeleteRateBasedRule")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteRateBasedRuleInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteRegexMatchSet struct {
}
func (*awsAwsjson11_serializeOpDeleteRegexMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteRegexMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteRegexMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.DeleteRegexMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteRegexMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteRegexPatternSet struct {
}
func (*awsAwsjson11_serializeOpDeleteRegexPatternSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteRegexPatternSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteRegexPatternSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.DeleteRegexPatternSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteRegexPatternSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteRule struct {
}
func (*awsAwsjson11_serializeOpDeleteRule) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteRuleInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.DeleteRule")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteRuleInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteRuleGroup struct {
}
func (*awsAwsjson11_serializeOpDeleteRuleGroup) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteRuleGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteRuleGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.DeleteRuleGroup")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteRuleGroupInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteSizeConstraintSet struct {
}
func (*awsAwsjson11_serializeOpDeleteSizeConstraintSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteSizeConstraintSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteSizeConstraintSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.DeleteSizeConstraintSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteSizeConstraintSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteSqlInjectionMatchSet struct {
}
func (*awsAwsjson11_serializeOpDeleteSqlInjectionMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteSqlInjectionMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteSqlInjectionMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.DeleteSqlInjectionMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteSqlInjectionMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteWebACL struct {
}
func (*awsAwsjson11_serializeOpDeleteWebACL) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteWebACL) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteWebACLInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.DeleteWebACL")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteWebACLInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteXssMatchSet struct {
}
func (*awsAwsjson11_serializeOpDeleteXssMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteXssMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteXssMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.DeleteXssMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteXssMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDisassociateWebACL struct {
}
func (*awsAwsjson11_serializeOpDisassociateWebACL) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDisassociateWebACL) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DisassociateWebACLInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.DisassociateWebACL")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDisassociateWebACLInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetByteMatchSet struct {
}
func (*awsAwsjson11_serializeOpGetByteMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetByteMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetByteMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.GetByteMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetByteMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetChangeToken struct {
}
func (*awsAwsjson11_serializeOpGetChangeToken) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetChangeToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetChangeTokenInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.GetChangeToken")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetChangeTokenInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetChangeTokenStatus struct {
}
func (*awsAwsjson11_serializeOpGetChangeTokenStatus) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetChangeTokenStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetChangeTokenStatusInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.GetChangeTokenStatus")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetChangeTokenStatusInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetGeoMatchSet struct {
}
func (*awsAwsjson11_serializeOpGetGeoMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetGeoMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetGeoMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.GetGeoMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetGeoMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetIPSet struct {
}
func (*awsAwsjson11_serializeOpGetIPSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetIPSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetIPSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.GetIPSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetIPSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetLoggingConfiguration struct {
}
func (*awsAwsjson11_serializeOpGetLoggingConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetLoggingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetLoggingConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.GetLoggingConfiguration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetLoggingConfigurationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetPermissionPolicy struct {
}
func (*awsAwsjson11_serializeOpGetPermissionPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetPermissionPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetPermissionPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.GetPermissionPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetPermissionPolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetRateBasedRule struct {
}
func (*awsAwsjson11_serializeOpGetRateBasedRule) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRateBasedRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRateBasedRuleInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.GetRateBasedRule")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRateBasedRuleInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetRateBasedRuleManagedKeys struct {
}
func (*awsAwsjson11_serializeOpGetRateBasedRuleManagedKeys) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRateBasedRuleManagedKeys) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRateBasedRuleManagedKeysInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.GetRateBasedRuleManagedKeys")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRateBasedRuleManagedKeysInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetRegexMatchSet struct {
}
func (*awsAwsjson11_serializeOpGetRegexMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRegexMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRegexMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.GetRegexMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRegexMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetRegexPatternSet struct {
}
func (*awsAwsjson11_serializeOpGetRegexPatternSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRegexPatternSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRegexPatternSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.GetRegexPatternSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRegexPatternSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetRule struct {
}
func (*awsAwsjson11_serializeOpGetRule) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRuleInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.GetRule")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRuleInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetRuleGroup struct {
}
func (*awsAwsjson11_serializeOpGetRuleGroup) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRuleGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRuleGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.GetRuleGroup")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRuleGroupInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetSampledRequests struct {
}
func (*awsAwsjson11_serializeOpGetSampledRequests) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetSampledRequests) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetSampledRequestsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.GetSampledRequests")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetSampledRequestsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetSizeConstraintSet struct {
}
func (*awsAwsjson11_serializeOpGetSizeConstraintSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetSizeConstraintSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetSizeConstraintSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.GetSizeConstraintSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetSizeConstraintSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetSqlInjectionMatchSet struct {
}
func (*awsAwsjson11_serializeOpGetSqlInjectionMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetSqlInjectionMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetSqlInjectionMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.GetSqlInjectionMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetSqlInjectionMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetWebACL struct {
}
func (*awsAwsjson11_serializeOpGetWebACL) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetWebACL) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetWebACLInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.GetWebACL")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetWebACLInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetWebACLForResource struct {
}
func (*awsAwsjson11_serializeOpGetWebACLForResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetWebACLForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetWebACLForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.GetWebACLForResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetWebACLForResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetXssMatchSet struct {
}
func (*awsAwsjson11_serializeOpGetXssMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetXssMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetXssMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.GetXssMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetXssMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListActivatedRulesInRuleGroup struct {
}
func (*awsAwsjson11_serializeOpListActivatedRulesInRuleGroup) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListActivatedRulesInRuleGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListActivatedRulesInRuleGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.ListActivatedRulesInRuleGroup")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListActivatedRulesInRuleGroupInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListByteMatchSets struct {
}
func (*awsAwsjson11_serializeOpListByteMatchSets) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListByteMatchSets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListByteMatchSetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.ListByteMatchSets")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListByteMatchSetsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListGeoMatchSets struct {
}
func (*awsAwsjson11_serializeOpListGeoMatchSets) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListGeoMatchSets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListGeoMatchSetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.ListGeoMatchSets")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListGeoMatchSetsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListIPSets struct {
}
func (*awsAwsjson11_serializeOpListIPSets) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListIPSets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListIPSetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.ListIPSets")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListIPSetsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListLoggingConfigurations struct {
}
func (*awsAwsjson11_serializeOpListLoggingConfigurations) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListLoggingConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListLoggingConfigurationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.ListLoggingConfigurations")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListLoggingConfigurationsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListRateBasedRules struct {
}
func (*awsAwsjson11_serializeOpListRateBasedRules) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListRateBasedRules) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListRateBasedRulesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.ListRateBasedRules")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListRateBasedRulesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListRegexMatchSets struct {
}
func (*awsAwsjson11_serializeOpListRegexMatchSets) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListRegexMatchSets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListRegexMatchSetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.ListRegexMatchSets")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListRegexMatchSetsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListRegexPatternSets struct {
}
func (*awsAwsjson11_serializeOpListRegexPatternSets) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListRegexPatternSets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListRegexPatternSetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.ListRegexPatternSets")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListRegexPatternSetsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListResourcesForWebACL struct {
}
func (*awsAwsjson11_serializeOpListResourcesForWebACL) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListResourcesForWebACL) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListResourcesForWebACLInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.ListResourcesForWebACL")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListResourcesForWebACLInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListRuleGroups struct {
}
func (*awsAwsjson11_serializeOpListRuleGroups) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListRuleGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListRuleGroupsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.ListRuleGroups")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListRuleGroupsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListRules struct {
}
func (*awsAwsjson11_serializeOpListRules) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListRules) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListRulesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.ListRules")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListRulesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListSizeConstraintSets struct {
}
func (*awsAwsjson11_serializeOpListSizeConstraintSets) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListSizeConstraintSets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListSizeConstraintSetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.ListSizeConstraintSets")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListSizeConstraintSetsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListSqlInjectionMatchSets struct {
}
func (*awsAwsjson11_serializeOpListSqlInjectionMatchSets) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListSqlInjectionMatchSets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListSqlInjectionMatchSetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.ListSqlInjectionMatchSets")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListSqlInjectionMatchSetsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListSubscribedRuleGroups struct {
}
func (*awsAwsjson11_serializeOpListSubscribedRuleGroups) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListSubscribedRuleGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListSubscribedRuleGroupsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.ListSubscribedRuleGroups")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListSubscribedRuleGroupsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListTagsForResource struct {
}
func (*awsAwsjson11_serializeOpListTagsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTagsForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.ListTagsForResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListWebACLs struct {
}
func (*awsAwsjson11_serializeOpListWebACLs) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListWebACLs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListWebACLsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.ListWebACLs")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListWebACLsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListXssMatchSets struct {
}
func (*awsAwsjson11_serializeOpListXssMatchSets) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListXssMatchSets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListXssMatchSetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.ListXssMatchSets")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListXssMatchSetsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpPutLoggingConfiguration struct {
}
func (*awsAwsjson11_serializeOpPutLoggingConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPutLoggingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutLoggingConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.PutLoggingConfiguration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPutLoggingConfigurationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpPutPermissionPolicy struct {
}
func (*awsAwsjson11_serializeOpPutPermissionPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPutPermissionPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutPermissionPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.PutPermissionPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPutPermissionPolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpTagResource struct {
}
func (*awsAwsjson11_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.TagResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUntagResource struct {
}
func (*awsAwsjson11_serializeOpUntagResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UntagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.UntagResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateByteMatchSet struct {
}
func (*awsAwsjson11_serializeOpUpdateByteMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateByteMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateByteMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.UpdateByteMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateByteMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateGeoMatchSet struct {
}
func (*awsAwsjson11_serializeOpUpdateGeoMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateGeoMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateGeoMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.UpdateGeoMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateGeoMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateIPSet struct {
}
func (*awsAwsjson11_serializeOpUpdateIPSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateIPSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateIPSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.UpdateIPSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateIPSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateRateBasedRule struct {
}
func (*awsAwsjson11_serializeOpUpdateRateBasedRule) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateRateBasedRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateRateBasedRuleInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.UpdateRateBasedRule")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateRateBasedRuleInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateRegexMatchSet struct {
}
func (*awsAwsjson11_serializeOpUpdateRegexMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateRegexMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateRegexMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.UpdateRegexMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateRegexMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateRegexPatternSet struct {
}
func (*awsAwsjson11_serializeOpUpdateRegexPatternSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateRegexPatternSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateRegexPatternSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.UpdateRegexPatternSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateRegexPatternSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateRule struct {
}
func (*awsAwsjson11_serializeOpUpdateRule) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateRuleInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.UpdateRule")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateRuleInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateRuleGroup struct {
}
func (*awsAwsjson11_serializeOpUpdateRuleGroup) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateRuleGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateRuleGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.UpdateRuleGroup")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateRuleGroupInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateSizeConstraintSet struct {
}
func (*awsAwsjson11_serializeOpUpdateSizeConstraintSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateSizeConstraintSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateSizeConstraintSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.UpdateSizeConstraintSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateSizeConstraintSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateSqlInjectionMatchSet struct {
}
func (*awsAwsjson11_serializeOpUpdateSqlInjectionMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateSqlInjectionMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateSqlInjectionMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.UpdateSqlInjectionMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateSqlInjectionMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateWebACL struct {
}
func (*awsAwsjson11_serializeOpUpdateWebACL) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateWebACL) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateWebACLInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.UpdateWebACL")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateWebACLInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateXssMatchSet struct {
}
func (*awsAwsjson11_serializeOpUpdateXssMatchSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateXssMatchSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateXssMatchSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_Regional_20161128.UpdateXssMatchSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateXssMatchSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsAwsjson11_serializeDocumentActivatedRule(v *types.ActivatedRule, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Action != nil {
ok := object.Key("Action")
if err := awsAwsjson11_serializeDocumentWafAction(v.Action, ok); err != nil {
return err
}
}
if v.ExcludedRules != nil {
ok := object.Key("ExcludedRules")
if err := awsAwsjson11_serializeDocumentExcludedRules(v.ExcludedRules, ok); err != nil {
return err
}
}
if v.OverrideAction != nil {
ok := object.Key("OverrideAction")
if err := awsAwsjson11_serializeDocumentWafOverrideAction(v.OverrideAction, ok); err != nil {
return err
}
}
if v.Priority != nil {
ok := object.Key("Priority")
ok.Integer(*v.Priority)
}
if v.RuleId != nil {
ok := object.Key("RuleId")
ok.String(*v.RuleId)
}
if len(v.Type) > 0 {
ok := object.Key("Type")
ok.String(string(v.Type))
}
return nil
}
func awsAwsjson11_serializeDocumentByteMatchSetUpdate(v *types.ByteMatchSetUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Action) > 0 {
ok := object.Key("Action")
ok.String(string(v.Action))
}
if v.ByteMatchTuple != nil {
ok := object.Key("ByteMatchTuple")
if err := awsAwsjson11_serializeDocumentByteMatchTuple(v.ByteMatchTuple, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentByteMatchSetUpdates(v []types.ByteMatchSetUpdate, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentByteMatchSetUpdate(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentByteMatchTuple(v *types.ByteMatchTuple, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FieldToMatch != nil {
ok := object.Key("FieldToMatch")
if err := awsAwsjson11_serializeDocumentFieldToMatch(v.FieldToMatch, ok); err != nil {
return err
}
}
if len(v.PositionalConstraint) > 0 {
ok := object.Key("PositionalConstraint")
ok.String(string(v.PositionalConstraint))
}
if v.TargetString != nil {
ok := object.Key("TargetString")
ok.Base64EncodeBytes(v.TargetString)
}
if len(v.TextTransformation) > 0 {
ok := object.Key("TextTransformation")
ok.String(string(v.TextTransformation))
}
return nil
}
func awsAwsjson11_serializeDocumentExcludedRule(v *types.ExcludedRule, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RuleId != nil {
ok := object.Key("RuleId")
ok.String(*v.RuleId)
}
return nil
}
func awsAwsjson11_serializeDocumentExcludedRules(v []types.ExcludedRule, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentExcludedRule(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentFieldToMatch(v *types.FieldToMatch, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Data != nil {
ok := object.Key("Data")
ok.String(*v.Data)
}
if len(v.Type) > 0 {
ok := object.Key("Type")
ok.String(string(v.Type))
}
return nil
}
func awsAwsjson11_serializeDocumentGeoMatchConstraint(v *types.GeoMatchConstraint, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Type) > 0 {
ok := object.Key("Type")
ok.String(string(v.Type))
}
if len(v.Value) > 0 {
ok := object.Key("Value")
ok.String(string(v.Value))
}
return nil
}
func awsAwsjson11_serializeDocumentGeoMatchSetUpdate(v *types.GeoMatchSetUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Action) > 0 {
ok := object.Key("Action")
ok.String(string(v.Action))
}
if v.GeoMatchConstraint != nil {
ok := object.Key("GeoMatchConstraint")
if err := awsAwsjson11_serializeDocumentGeoMatchConstraint(v.GeoMatchConstraint, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentGeoMatchSetUpdates(v []types.GeoMatchSetUpdate, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentGeoMatchSetUpdate(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentIPSetDescriptor(v *types.IPSetDescriptor, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Type) > 0 {
ok := object.Key("Type")
ok.String(string(v.Type))
}
if v.Value != nil {
ok := object.Key("Value")
ok.String(*v.Value)
}
return nil
}
func awsAwsjson11_serializeDocumentIPSetUpdate(v *types.IPSetUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Action) > 0 {
ok := object.Key("Action")
ok.String(string(v.Action))
}
if v.IPSetDescriptor != nil {
ok := object.Key("IPSetDescriptor")
if err := awsAwsjson11_serializeDocumentIPSetDescriptor(v.IPSetDescriptor, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentIPSetUpdates(v []types.IPSetUpdate, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentIPSetUpdate(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentLogDestinationConfigs(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentLoggingConfiguration(v *types.LoggingConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LogDestinationConfigs != nil {
ok := object.Key("LogDestinationConfigs")
if err := awsAwsjson11_serializeDocumentLogDestinationConfigs(v.LogDestinationConfigs, ok); err != nil {
return err
}
}
if v.RedactedFields != nil {
ok := object.Key("RedactedFields")
if err := awsAwsjson11_serializeDocumentRedactedFields(v.RedactedFields, ok); err != nil {
return err
}
}
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeDocumentPredicate(v *types.Predicate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DataId != nil {
ok := object.Key("DataId")
ok.String(*v.DataId)
}
if v.Negated != nil {
ok := object.Key("Negated")
ok.Boolean(*v.Negated)
}
if len(v.Type) > 0 {
ok := object.Key("Type")
ok.String(string(v.Type))
}
return nil
}
func awsAwsjson11_serializeDocumentRedactedFields(v []types.FieldToMatch, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentFieldToMatch(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRegexMatchSetUpdate(v *types.RegexMatchSetUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Action) > 0 {
ok := object.Key("Action")
ok.String(string(v.Action))
}
if v.RegexMatchTuple != nil {
ok := object.Key("RegexMatchTuple")
if err := awsAwsjson11_serializeDocumentRegexMatchTuple(v.RegexMatchTuple, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRegexMatchSetUpdates(v []types.RegexMatchSetUpdate, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentRegexMatchSetUpdate(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRegexMatchTuple(v *types.RegexMatchTuple, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FieldToMatch != nil {
ok := object.Key("FieldToMatch")
if err := awsAwsjson11_serializeDocumentFieldToMatch(v.FieldToMatch, ok); err != nil {
return err
}
}
if v.RegexPatternSetId != nil {
ok := object.Key("RegexPatternSetId")
ok.String(*v.RegexPatternSetId)
}
if len(v.TextTransformation) > 0 {
ok := object.Key("TextTransformation")
ok.String(string(v.TextTransformation))
}
return nil
}
func awsAwsjson11_serializeDocumentRegexPatternSetUpdate(v *types.RegexPatternSetUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Action) > 0 {
ok := object.Key("Action")
ok.String(string(v.Action))
}
if v.RegexPatternString != nil {
ok := object.Key("RegexPatternString")
ok.String(*v.RegexPatternString)
}
return nil
}
func awsAwsjson11_serializeDocumentRegexPatternSetUpdates(v []types.RegexPatternSetUpdate, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentRegexPatternSetUpdate(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRuleGroupUpdate(v *types.RuleGroupUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Action) > 0 {
ok := object.Key("Action")
ok.String(string(v.Action))
}
if v.ActivatedRule != nil {
ok := object.Key("ActivatedRule")
if err := awsAwsjson11_serializeDocumentActivatedRule(v.ActivatedRule, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRuleGroupUpdates(v []types.RuleGroupUpdate, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentRuleGroupUpdate(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRuleUpdate(v *types.RuleUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Action) > 0 {
ok := object.Key("Action")
ok.String(string(v.Action))
}
if v.Predicate != nil {
ok := object.Key("Predicate")
if err := awsAwsjson11_serializeDocumentPredicate(v.Predicate, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRuleUpdates(v []types.RuleUpdate, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentRuleUpdate(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentSizeConstraint(v *types.SizeConstraint, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ComparisonOperator) > 0 {
ok := object.Key("ComparisonOperator")
ok.String(string(v.ComparisonOperator))
}
if v.FieldToMatch != nil {
ok := object.Key("FieldToMatch")
if err := awsAwsjson11_serializeDocumentFieldToMatch(v.FieldToMatch, ok); err != nil {
return err
}
}
{
ok := object.Key("Size")
ok.Long(v.Size)
}
if len(v.TextTransformation) > 0 {
ok := object.Key("TextTransformation")
ok.String(string(v.TextTransformation))
}
return nil
}
func awsAwsjson11_serializeDocumentSizeConstraintSetUpdate(v *types.SizeConstraintSetUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Action) > 0 {
ok := object.Key("Action")
ok.String(string(v.Action))
}
if v.SizeConstraint != nil {
ok := object.Key("SizeConstraint")
if err := awsAwsjson11_serializeDocumentSizeConstraint(v.SizeConstraint, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentSizeConstraintSetUpdates(v []types.SizeConstraintSetUpdate, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentSizeConstraintSetUpdate(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentSqlInjectionMatchSetUpdate(v *types.SqlInjectionMatchSetUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Action) > 0 {
ok := object.Key("Action")
ok.String(string(v.Action))
}
if v.SqlInjectionMatchTuple != nil {
ok := object.Key("SqlInjectionMatchTuple")
if err := awsAwsjson11_serializeDocumentSqlInjectionMatchTuple(v.SqlInjectionMatchTuple, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentSqlInjectionMatchSetUpdates(v []types.SqlInjectionMatchSetUpdate, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentSqlInjectionMatchSetUpdate(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentSqlInjectionMatchTuple(v *types.SqlInjectionMatchTuple, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FieldToMatch != nil {
ok := object.Key("FieldToMatch")
if err := awsAwsjson11_serializeDocumentFieldToMatch(v.FieldToMatch, ok); err != nil {
return err
}
}
if len(v.TextTransformation) > 0 {
ok := object.Key("TextTransformation")
ok.String(string(v.TextTransformation))
}
return nil
}
func awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Key != nil {
ok := object.Key("Key")
ok.String(*v.Key)
}
if v.Value != nil {
ok := object.Key("Value")
ok.String(*v.Value)
}
return nil
}
func awsAwsjson11_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentTimeWindow(v *types.TimeWindow, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EndTime != nil {
ok := object.Key("EndTime")
ok.Double(smithytime.FormatEpochSeconds(*v.EndTime))
}
if v.StartTime != nil {
ok := object.Key("StartTime")
ok.Double(smithytime.FormatEpochSeconds(*v.StartTime))
}
return nil
}
func awsAwsjson11_serializeDocumentWafAction(v *types.WafAction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Type) > 0 {
ok := object.Key("Type")
ok.String(string(v.Type))
}
return nil
}
func awsAwsjson11_serializeDocumentWafOverrideAction(v *types.WafOverrideAction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Type) > 0 {
ok := object.Key("Type")
ok.String(string(v.Type))
}
return nil
}
func awsAwsjson11_serializeDocumentWebACLUpdate(v *types.WebACLUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Action) > 0 {
ok := object.Key("Action")
ok.String(string(v.Action))
}
if v.ActivatedRule != nil {
ok := object.Key("ActivatedRule")
if err := awsAwsjson11_serializeDocumentActivatedRule(v.ActivatedRule, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentWebACLUpdates(v []types.WebACLUpdate, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentWebACLUpdate(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentXssMatchSetUpdate(v *types.XssMatchSetUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Action) > 0 {
ok := object.Key("Action")
ok.String(string(v.Action))
}
if v.XssMatchTuple != nil {
ok := object.Key("XssMatchTuple")
if err := awsAwsjson11_serializeDocumentXssMatchTuple(v.XssMatchTuple, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentXssMatchSetUpdates(v []types.XssMatchSetUpdate, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentXssMatchSetUpdate(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentXssMatchTuple(v *types.XssMatchTuple, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FieldToMatch != nil {
ok := object.Key("FieldToMatch")
if err := awsAwsjson11_serializeDocumentFieldToMatch(v.FieldToMatch, ok); err != nil {
return err
}
}
if len(v.TextTransformation) > 0 {
ok := object.Key("TextTransformation")
ok.String(string(v.TextTransformation))
}
return nil
}
func awsAwsjson11_serializeOpDocumentAssociateWebACLInput(v *AssociateWebACLInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
if v.WebACLId != nil {
ok := object.Key("WebACLId")
ok.String(*v.WebACLId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateByteMatchSetInput(v *CreateByteMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateGeoMatchSetInput(v *CreateGeoMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateIPSetInput(v *CreateIPSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateRateBasedRuleInput(v *CreateRateBasedRuleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.MetricName != nil {
ok := object.Key("MetricName")
ok.String(*v.MetricName)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if len(v.RateKey) > 0 {
ok := object.Key("RateKey")
ok.String(string(v.RateKey))
}
{
ok := object.Key("RateLimit")
ok.Long(v.RateLimit)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateRegexMatchSetInput(v *CreateRegexMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateRegexPatternSetInput(v *CreateRegexPatternSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateRuleGroupInput(v *CreateRuleGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.MetricName != nil {
ok := object.Key("MetricName")
ok.String(*v.MetricName)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateRuleInput(v *CreateRuleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.MetricName != nil {
ok := object.Key("MetricName")
ok.String(*v.MetricName)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateSizeConstraintSetInput(v *CreateSizeConstraintSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateSqlInjectionMatchSetInput(v *CreateSqlInjectionMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateWebACLInput(v *CreateWebACLInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.DefaultAction != nil {
ok := object.Key("DefaultAction")
if err := awsAwsjson11_serializeDocumentWafAction(v.DefaultAction, ok); err != nil {
return err
}
}
if v.MetricName != nil {
ok := object.Key("MetricName")
ok.String(*v.MetricName)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateWebACLMigrationStackInput(v *CreateWebACLMigrationStackInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IgnoreUnsupportedType != nil {
ok := object.Key("IgnoreUnsupportedType")
ok.Boolean(*v.IgnoreUnsupportedType)
}
if v.S3BucketName != nil {
ok := object.Key("S3BucketName")
ok.String(*v.S3BucketName)
}
if v.WebACLId != nil {
ok := object.Key("WebACLId")
ok.String(*v.WebACLId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateXssMatchSetInput(v *CreateXssMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteByteMatchSetInput(v *DeleteByteMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ByteMatchSetId != nil {
ok := object.Key("ByteMatchSetId")
ok.String(*v.ByteMatchSetId)
}
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteGeoMatchSetInput(v *DeleteGeoMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.GeoMatchSetId != nil {
ok := object.Key("GeoMatchSetId")
ok.String(*v.GeoMatchSetId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteIPSetInput(v *DeleteIPSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.IPSetId != nil {
ok := object.Key("IPSetId")
ok.String(*v.IPSetId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteLoggingConfigurationInput(v *DeleteLoggingConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeletePermissionPolicyInput(v *DeletePermissionPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteRateBasedRuleInput(v *DeleteRateBasedRuleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.RuleId != nil {
ok := object.Key("RuleId")
ok.String(*v.RuleId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteRegexMatchSetInput(v *DeleteRegexMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.RegexMatchSetId != nil {
ok := object.Key("RegexMatchSetId")
ok.String(*v.RegexMatchSetId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteRegexPatternSetInput(v *DeleteRegexPatternSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.RegexPatternSetId != nil {
ok := object.Key("RegexPatternSetId")
ok.String(*v.RegexPatternSetId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteRuleGroupInput(v *DeleteRuleGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.RuleGroupId != nil {
ok := object.Key("RuleGroupId")
ok.String(*v.RuleGroupId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteRuleInput(v *DeleteRuleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.RuleId != nil {
ok := object.Key("RuleId")
ok.String(*v.RuleId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteSizeConstraintSetInput(v *DeleteSizeConstraintSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.SizeConstraintSetId != nil {
ok := object.Key("SizeConstraintSetId")
ok.String(*v.SizeConstraintSetId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteSqlInjectionMatchSetInput(v *DeleteSqlInjectionMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.SqlInjectionMatchSetId != nil {
ok := object.Key("SqlInjectionMatchSetId")
ok.String(*v.SqlInjectionMatchSetId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteWebACLInput(v *DeleteWebACLInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.WebACLId != nil {
ok := object.Key("WebACLId")
ok.String(*v.WebACLId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteXssMatchSetInput(v *DeleteXssMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.XssMatchSetId != nil {
ok := object.Key("XssMatchSetId")
ok.String(*v.XssMatchSetId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDisassociateWebACLInput(v *DisassociateWebACLInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetByteMatchSetInput(v *GetByteMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ByteMatchSetId != nil {
ok := object.Key("ByteMatchSetId")
ok.String(*v.ByteMatchSetId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetChangeTokenInput(v *GetChangeTokenInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentGetChangeTokenStatusInput(v *GetChangeTokenStatusInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetGeoMatchSetInput(v *GetGeoMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GeoMatchSetId != nil {
ok := object.Key("GeoMatchSetId")
ok.String(*v.GeoMatchSetId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetIPSetInput(v *GetIPSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IPSetId != nil {
ok := object.Key("IPSetId")
ok.String(*v.IPSetId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetLoggingConfigurationInput(v *GetLoggingConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetPermissionPolicyInput(v *GetPermissionPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRateBasedRuleInput(v *GetRateBasedRuleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RuleId != nil {
ok := object.Key("RuleId")
ok.String(*v.RuleId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRateBasedRuleManagedKeysInput(v *GetRateBasedRuleManagedKeysInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
if v.RuleId != nil {
ok := object.Key("RuleId")
ok.String(*v.RuleId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRegexMatchSetInput(v *GetRegexMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RegexMatchSetId != nil {
ok := object.Key("RegexMatchSetId")
ok.String(*v.RegexMatchSetId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRegexPatternSetInput(v *GetRegexPatternSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RegexPatternSetId != nil {
ok := object.Key("RegexPatternSetId")
ok.String(*v.RegexPatternSetId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRuleGroupInput(v *GetRuleGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RuleGroupId != nil {
ok := object.Key("RuleGroupId")
ok.String(*v.RuleGroupId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRuleInput(v *GetRuleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RuleId != nil {
ok := object.Key("RuleId")
ok.String(*v.RuleId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetSampledRequestsInput(v *GetSampledRequestsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
{
ok := object.Key("MaxItems")
ok.Long(v.MaxItems)
}
if v.RuleId != nil {
ok := object.Key("RuleId")
ok.String(*v.RuleId)
}
if v.TimeWindow != nil {
ok := object.Key("TimeWindow")
if err := awsAwsjson11_serializeDocumentTimeWindow(v.TimeWindow, ok); err != nil {
return err
}
}
if v.WebAclId != nil {
ok := object.Key("WebAclId")
ok.String(*v.WebAclId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetSizeConstraintSetInput(v *GetSizeConstraintSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SizeConstraintSetId != nil {
ok := object.Key("SizeConstraintSetId")
ok.String(*v.SizeConstraintSetId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetSqlInjectionMatchSetInput(v *GetSqlInjectionMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SqlInjectionMatchSetId != nil {
ok := object.Key("SqlInjectionMatchSetId")
ok.String(*v.SqlInjectionMatchSetId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetWebACLForResourceInput(v *GetWebACLForResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetWebACLInput(v *GetWebACLInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.WebACLId != nil {
ok := object.Key("WebACLId")
ok.String(*v.WebACLId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetXssMatchSetInput(v *GetXssMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.XssMatchSetId != nil {
ok := object.Key("XssMatchSetId")
ok.String(*v.XssMatchSetId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListActivatedRulesInRuleGroupInput(v *ListActivatedRulesInRuleGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != 0 {
ok := object.Key("Limit")
ok.Integer(v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
if v.RuleGroupId != nil {
ok := object.Key("RuleGroupId")
ok.String(*v.RuleGroupId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListByteMatchSetsInput(v *ListByteMatchSetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != 0 {
ok := object.Key("Limit")
ok.Integer(v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListGeoMatchSetsInput(v *ListGeoMatchSetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != 0 {
ok := object.Key("Limit")
ok.Integer(v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListIPSetsInput(v *ListIPSetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != 0 {
ok := object.Key("Limit")
ok.Integer(v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListLoggingConfigurationsInput(v *ListLoggingConfigurationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != 0 {
ok := object.Key("Limit")
ok.Integer(v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListRateBasedRulesInput(v *ListRateBasedRulesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != 0 {
ok := object.Key("Limit")
ok.Integer(v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListRegexMatchSetsInput(v *ListRegexMatchSetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != 0 {
ok := object.Key("Limit")
ok.Integer(v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListRegexPatternSetsInput(v *ListRegexPatternSetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != 0 {
ok := object.Key("Limit")
ok.Integer(v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListResourcesForWebACLInput(v *ListResourcesForWebACLInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ResourceType) > 0 {
ok := object.Key("ResourceType")
ok.String(string(v.ResourceType))
}
if v.WebACLId != nil {
ok := object.Key("WebACLId")
ok.String(*v.WebACLId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListRuleGroupsInput(v *ListRuleGroupsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != 0 {
ok := object.Key("Limit")
ok.Integer(v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListRulesInput(v *ListRulesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != 0 {
ok := object.Key("Limit")
ok.Integer(v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListSizeConstraintSetsInput(v *ListSizeConstraintSetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != 0 {
ok := object.Key("Limit")
ok.Integer(v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListSqlInjectionMatchSetsInput(v *ListSqlInjectionMatchSetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != 0 {
ok := object.Key("Limit")
ok.Integer(v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListSubscribedRuleGroupsInput(v *ListSubscribedRuleGroupsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != 0 {
ok := object.Key("Limit")
ok.Integer(v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != 0 {
ok := object.Key("Limit")
ok.Integer(v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListWebACLsInput(v *ListWebACLsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != 0 {
ok := object.Key("Limit")
ok.Integer(v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListXssMatchSetsInput(v *ListXssMatchSetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != 0 {
ok := object.Key("Limit")
ok.Integer(v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentPutLoggingConfigurationInput(v *PutLoggingConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LoggingConfiguration != nil {
ok := object.Key("LoggingConfiguration")
if err := awsAwsjson11_serializeDocumentLoggingConfiguration(v.LoggingConfiguration, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentPutPermissionPolicyInput(v *PutPermissionPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Policy != nil {
ok := object.Key("Policy")
ok.String(*v.Policy)
}
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
if v.TagKeys != nil {
ok := object.Key("TagKeys")
if err := awsAwsjson11_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateByteMatchSetInput(v *UpdateByteMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ByteMatchSetId != nil {
ok := object.Key("ByteMatchSetId")
ok.String(*v.ByteMatchSetId)
}
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.Updates != nil {
ok := object.Key("Updates")
if err := awsAwsjson11_serializeDocumentByteMatchSetUpdates(v.Updates, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateGeoMatchSetInput(v *UpdateGeoMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.GeoMatchSetId != nil {
ok := object.Key("GeoMatchSetId")
ok.String(*v.GeoMatchSetId)
}
if v.Updates != nil {
ok := object.Key("Updates")
if err := awsAwsjson11_serializeDocumentGeoMatchSetUpdates(v.Updates, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateIPSetInput(v *UpdateIPSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.IPSetId != nil {
ok := object.Key("IPSetId")
ok.String(*v.IPSetId)
}
if v.Updates != nil {
ok := object.Key("Updates")
if err := awsAwsjson11_serializeDocumentIPSetUpdates(v.Updates, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateRateBasedRuleInput(v *UpdateRateBasedRuleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
{
ok := object.Key("RateLimit")
ok.Long(v.RateLimit)
}
if v.RuleId != nil {
ok := object.Key("RuleId")
ok.String(*v.RuleId)
}
if v.Updates != nil {
ok := object.Key("Updates")
if err := awsAwsjson11_serializeDocumentRuleUpdates(v.Updates, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateRegexMatchSetInput(v *UpdateRegexMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.RegexMatchSetId != nil {
ok := object.Key("RegexMatchSetId")
ok.String(*v.RegexMatchSetId)
}
if v.Updates != nil {
ok := object.Key("Updates")
if err := awsAwsjson11_serializeDocumentRegexMatchSetUpdates(v.Updates, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateRegexPatternSetInput(v *UpdateRegexPatternSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.RegexPatternSetId != nil {
ok := object.Key("RegexPatternSetId")
ok.String(*v.RegexPatternSetId)
}
if v.Updates != nil {
ok := object.Key("Updates")
if err := awsAwsjson11_serializeDocumentRegexPatternSetUpdates(v.Updates, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateRuleGroupInput(v *UpdateRuleGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.RuleGroupId != nil {
ok := object.Key("RuleGroupId")
ok.String(*v.RuleGroupId)
}
if v.Updates != nil {
ok := object.Key("Updates")
if err := awsAwsjson11_serializeDocumentRuleGroupUpdates(v.Updates, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateRuleInput(v *UpdateRuleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.RuleId != nil {
ok := object.Key("RuleId")
ok.String(*v.RuleId)
}
if v.Updates != nil {
ok := object.Key("Updates")
if err := awsAwsjson11_serializeDocumentRuleUpdates(v.Updates, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateSizeConstraintSetInput(v *UpdateSizeConstraintSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.SizeConstraintSetId != nil {
ok := object.Key("SizeConstraintSetId")
ok.String(*v.SizeConstraintSetId)
}
if v.Updates != nil {
ok := object.Key("Updates")
if err := awsAwsjson11_serializeDocumentSizeConstraintSetUpdates(v.Updates, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateSqlInjectionMatchSetInput(v *UpdateSqlInjectionMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.SqlInjectionMatchSetId != nil {
ok := object.Key("SqlInjectionMatchSetId")
ok.String(*v.SqlInjectionMatchSetId)
}
if v.Updates != nil {
ok := object.Key("Updates")
if err := awsAwsjson11_serializeDocumentSqlInjectionMatchSetUpdates(v.Updates, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateWebACLInput(v *UpdateWebACLInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.DefaultAction != nil {
ok := object.Key("DefaultAction")
if err := awsAwsjson11_serializeDocumentWafAction(v.DefaultAction, ok); err != nil {
return err
}
}
if v.Updates != nil {
ok := object.Key("Updates")
if err := awsAwsjson11_serializeDocumentWebACLUpdates(v.Updates, ok); err != nil {
return err
}
}
if v.WebACLId != nil {
ok := object.Key("WebACLId")
ok.String(*v.WebACLId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateXssMatchSetInput(v *UpdateXssMatchSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChangeToken != nil {
ok := object.Key("ChangeToken")
ok.String(*v.ChangeToken)
}
if v.Updates != nil {
ok := object.Key("Updates")
if err := awsAwsjson11_serializeDocumentXssMatchSetUpdates(v.Updates, ok); err != nil {
return err
}
}
if v.XssMatchSetId != nil {
ok := object.Key("XssMatchSetId")
ok.String(*v.XssMatchSetId)
}
return nil
}
| 6,676 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafregional
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/wafregional/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpAssociateWebACL struct {
}
func (*validateOpAssociateWebACL) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAssociateWebACL) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AssociateWebACLInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAssociateWebACLInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateByteMatchSet struct {
}
func (*validateOpCreateByteMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateByteMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateByteMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateByteMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateGeoMatchSet struct {
}
func (*validateOpCreateGeoMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateGeoMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateGeoMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateGeoMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateIPSet struct {
}
func (*validateOpCreateIPSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateIPSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateIPSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateIPSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateRateBasedRule struct {
}
func (*validateOpCreateRateBasedRule) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateRateBasedRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateRateBasedRuleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateRateBasedRuleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateRegexMatchSet struct {
}
func (*validateOpCreateRegexMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateRegexMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateRegexMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateRegexMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateRegexPatternSet struct {
}
func (*validateOpCreateRegexPatternSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateRegexPatternSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateRegexPatternSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateRegexPatternSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateRuleGroup struct {
}
func (*validateOpCreateRuleGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateRuleGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateRuleGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateRuleGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateRule struct {
}
func (*validateOpCreateRule) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateRuleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateRuleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateSizeConstraintSet struct {
}
func (*validateOpCreateSizeConstraintSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateSizeConstraintSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateSizeConstraintSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateSizeConstraintSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateSqlInjectionMatchSet struct {
}
func (*validateOpCreateSqlInjectionMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateSqlInjectionMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateSqlInjectionMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateSqlInjectionMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateWebACL struct {
}
func (*validateOpCreateWebACL) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateWebACL) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateWebACLInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateWebACLInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateWebACLMigrationStack struct {
}
func (*validateOpCreateWebACLMigrationStack) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateWebACLMigrationStack) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateWebACLMigrationStackInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateWebACLMigrationStackInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateXssMatchSet struct {
}
func (*validateOpCreateXssMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateXssMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateXssMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateXssMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteByteMatchSet struct {
}
func (*validateOpDeleteByteMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteByteMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteByteMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteByteMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteGeoMatchSet struct {
}
func (*validateOpDeleteGeoMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteGeoMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteGeoMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteGeoMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteIPSet struct {
}
func (*validateOpDeleteIPSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteIPSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteIPSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteIPSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteLoggingConfiguration struct {
}
func (*validateOpDeleteLoggingConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteLoggingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteLoggingConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteLoggingConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeletePermissionPolicy struct {
}
func (*validateOpDeletePermissionPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeletePermissionPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeletePermissionPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeletePermissionPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteRateBasedRule struct {
}
func (*validateOpDeleteRateBasedRule) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteRateBasedRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteRateBasedRuleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteRateBasedRuleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteRegexMatchSet struct {
}
func (*validateOpDeleteRegexMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteRegexMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteRegexMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteRegexMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteRegexPatternSet struct {
}
func (*validateOpDeleteRegexPatternSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteRegexPatternSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteRegexPatternSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteRegexPatternSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteRuleGroup struct {
}
func (*validateOpDeleteRuleGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteRuleGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteRuleGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteRuleGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteRule struct {
}
func (*validateOpDeleteRule) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteRuleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteRuleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteSizeConstraintSet struct {
}
func (*validateOpDeleteSizeConstraintSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteSizeConstraintSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteSizeConstraintSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteSizeConstraintSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteSqlInjectionMatchSet struct {
}
func (*validateOpDeleteSqlInjectionMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteSqlInjectionMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteSqlInjectionMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteSqlInjectionMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteWebACL struct {
}
func (*validateOpDeleteWebACL) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteWebACL) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteWebACLInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteWebACLInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteXssMatchSet struct {
}
func (*validateOpDeleteXssMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteXssMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteXssMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteXssMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDisassociateWebACL struct {
}
func (*validateOpDisassociateWebACL) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDisassociateWebACL) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DisassociateWebACLInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDisassociateWebACLInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetByteMatchSet struct {
}
func (*validateOpGetByteMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetByteMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetByteMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetByteMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetChangeTokenStatus struct {
}
func (*validateOpGetChangeTokenStatus) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetChangeTokenStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetChangeTokenStatusInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetChangeTokenStatusInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetGeoMatchSet struct {
}
func (*validateOpGetGeoMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetGeoMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetGeoMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetGeoMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetIPSet struct {
}
func (*validateOpGetIPSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetIPSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetIPSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetIPSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetLoggingConfiguration struct {
}
func (*validateOpGetLoggingConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetLoggingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetLoggingConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetLoggingConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetPermissionPolicy struct {
}
func (*validateOpGetPermissionPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetPermissionPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetPermissionPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetPermissionPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetRateBasedRule struct {
}
func (*validateOpGetRateBasedRule) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetRateBasedRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetRateBasedRuleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetRateBasedRuleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetRateBasedRuleManagedKeys struct {
}
func (*validateOpGetRateBasedRuleManagedKeys) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetRateBasedRuleManagedKeys) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetRateBasedRuleManagedKeysInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetRateBasedRuleManagedKeysInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetRegexMatchSet struct {
}
func (*validateOpGetRegexMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetRegexMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetRegexMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetRegexMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetRegexPatternSet struct {
}
func (*validateOpGetRegexPatternSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetRegexPatternSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetRegexPatternSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetRegexPatternSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetRuleGroup struct {
}
func (*validateOpGetRuleGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetRuleGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetRuleGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetRuleGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetRule struct {
}
func (*validateOpGetRule) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetRuleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetRuleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetSampledRequests struct {
}
func (*validateOpGetSampledRequests) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetSampledRequests) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetSampledRequestsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetSampledRequestsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetSizeConstraintSet struct {
}
func (*validateOpGetSizeConstraintSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetSizeConstraintSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetSizeConstraintSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetSizeConstraintSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetSqlInjectionMatchSet struct {
}
func (*validateOpGetSqlInjectionMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetSqlInjectionMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetSqlInjectionMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetSqlInjectionMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetWebACLForResource struct {
}
func (*validateOpGetWebACLForResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetWebACLForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetWebACLForResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetWebACLForResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetWebACL struct {
}
func (*validateOpGetWebACL) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetWebACL) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetWebACLInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetWebACLInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetXssMatchSet struct {
}
func (*validateOpGetXssMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetXssMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetXssMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetXssMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListResourcesForWebACL struct {
}
func (*validateOpListResourcesForWebACL) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListResourcesForWebACL) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListResourcesForWebACLInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListResourcesForWebACLInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListTagsForResource struct {
}
func (*validateOpListTagsForResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListTagsForResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListTagsForResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutLoggingConfiguration struct {
}
func (*validateOpPutLoggingConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutLoggingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutLoggingConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutLoggingConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutPermissionPolicy struct {
}
func (*validateOpPutPermissionPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutPermissionPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutPermissionPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutPermissionPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpTagResource struct {
}
func (*validateOpTagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*TagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpTagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUntagResource struct {
}
func (*validateOpUntagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UntagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUntagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateByteMatchSet struct {
}
func (*validateOpUpdateByteMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateByteMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateByteMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateByteMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateGeoMatchSet struct {
}
func (*validateOpUpdateGeoMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateGeoMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateGeoMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateGeoMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateIPSet struct {
}
func (*validateOpUpdateIPSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateIPSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateIPSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateIPSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateRateBasedRule struct {
}
func (*validateOpUpdateRateBasedRule) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateRateBasedRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateRateBasedRuleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateRateBasedRuleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateRegexMatchSet struct {
}
func (*validateOpUpdateRegexMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateRegexMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateRegexMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateRegexMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateRegexPatternSet struct {
}
func (*validateOpUpdateRegexPatternSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateRegexPatternSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateRegexPatternSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateRegexPatternSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateRuleGroup struct {
}
func (*validateOpUpdateRuleGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateRuleGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateRuleGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateRuleGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateRule struct {
}
func (*validateOpUpdateRule) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateRuleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateRuleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateSizeConstraintSet struct {
}
func (*validateOpUpdateSizeConstraintSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateSizeConstraintSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateSizeConstraintSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateSizeConstraintSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateSqlInjectionMatchSet struct {
}
func (*validateOpUpdateSqlInjectionMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateSqlInjectionMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateSqlInjectionMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateSqlInjectionMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateWebACL struct {
}
func (*validateOpUpdateWebACL) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateWebACL) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateWebACLInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateWebACLInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateXssMatchSet struct {
}
func (*validateOpUpdateXssMatchSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateXssMatchSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateXssMatchSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateXssMatchSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpAssociateWebACLValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAssociateWebACL{}, middleware.After)
}
func addOpCreateByteMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateByteMatchSet{}, middleware.After)
}
func addOpCreateGeoMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateGeoMatchSet{}, middleware.After)
}
func addOpCreateIPSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateIPSet{}, middleware.After)
}
func addOpCreateRateBasedRuleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateRateBasedRule{}, middleware.After)
}
func addOpCreateRegexMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateRegexMatchSet{}, middleware.After)
}
func addOpCreateRegexPatternSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateRegexPatternSet{}, middleware.After)
}
func addOpCreateRuleGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateRuleGroup{}, middleware.After)
}
func addOpCreateRuleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateRule{}, middleware.After)
}
func addOpCreateSizeConstraintSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateSizeConstraintSet{}, middleware.After)
}
func addOpCreateSqlInjectionMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateSqlInjectionMatchSet{}, middleware.After)
}
func addOpCreateWebACLValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateWebACL{}, middleware.After)
}
func addOpCreateWebACLMigrationStackValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateWebACLMigrationStack{}, middleware.After)
}
func addOpCreateXssMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateXssMatchSet{}, middleware.After)
}
func addOpDeleteByteMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteByteMatchSet{}, middleware.After)
}
func addOpDeleteGeoMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteGeoMatchSet{}, middleware.After)
}
func addOpDeleteIPSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteIPSet{}, middleware.After)
}
func addOpDeleteLoggingConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteLoggingConfiguration{}, middleware.After)
}
func addOpDeletePermissionPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeletePermissionPolicy{}, middleware.After)
}
func addOpDeleteRateBasedRuleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteRateBasedRule{}, middleware.After)
}
func addOpDeleteRegexMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteRegexMatchSet{}, middleware.After)
}
func addOpDeleteRegexPatternSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteRegexPatternSet{}, middleware.After)
}
func addOpDeleteRuleGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteRuleGroup{}, middleware.After)
}
func addOpDeleteRuleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteRule{}, middleware.After)
}
func addOpDeleteSizeConstraintSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteSizeConstraintSet{}, middleware.After)
}
func addOpDeleteSqlInjectionMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteSqlInjectionMatchSet{}, middleware.After)
}
func addOpDeleteWebACLValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteWebACL{}, middleware.After)
}
func addOpDeleteXssMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteXssMatchSet{}, middleware.After)
}
func addOpDisassociateWebACLValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDisassociateWebACL{}, middleware.After)
}
func addOpGetByteMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetByteMatchSet{}, middleware.After)
}
func addOpGetChangeTokenStatusValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetChangeTokenStatus{}, middleware.After)
}
func addOpGetGeoMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetGeoMatchSet{}, middleware.After)
}
func addOpGetIPSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetIPSet{}, middleware.After)
}
func addOpGetLoggingConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetLoggingConfiguration{}, middleware.After)
}
func addOpGetPermissionPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetPermissionPolicy{}, middleware.After)
}
func addOpGetRateBasedRuleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetRateBasedRule{}, middleware.After)
}
func addOpGetRateBasedRuleManagedKeysValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetRateBasedRuleManagedKeys{}, middleware.After)
}
func addOpGetRegexMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetRegexMatchSet{}, middleware.After)
}
func addOpGetRegexPatternSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetRegexPatternSet{}, middleware.After)
}
func addOpGetRuleGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetRuleGroup{}, middleware.After)
}
func addOpGetRuleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetRule{}, middleware.After)
}
func addOpGetSampledRequestsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetSampledRequests{}, middleware.After)
}
func addOpGetSizeConstraintSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetSizeConstraintSet{}, middleware.After)
}
func addOpGetSqlInjectionMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetSqlInjectionMatchSet{}, middleware.After)
}
func addOpGetWebACLForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetWebACLForResource{}, middleware.After)
}
func addOpGetWebACLValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetWebACL{}, middleware.After)
}
func addOpGetXssMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetXssMatchSet{}, middleware.After)
}
func addOpListResourcesForWebACLValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListResourcesForWebACL{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpPutLoggingConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutLoggingConfiguration{}, middleware.After)
}
func addOpPutPermissionPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutPermissionPolicy{}, middleware.After)
}
func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpTagResource{}, middleware.After)
}
func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After)
}
func addOpUpdateByteMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateByteMatchSet{}, middleware.After)
}
func addOpUpdateGeoMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateGeoMatchSet{}, middleware.After)
}
func addOpUpdateIPSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateIPSet{}, middleware.After)
}
func addOpUpdateRateBasedRuleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateRateBasedRule{}, middleware.After)
}
func addOpUpdateRegexMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateRegexMatchSet{}, middleware.After)
}
func addOpUpdateRegexPatternSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateRegexPatternSet{}, middleware.After)
}
func addOpUpdateRuleGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateRuleGroup{}, middleware.After)
}
func addOpUpdateRuleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateRule{}, middleware.After)
}
func addOpUpdateSizeConstraintSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateSizeConstraintSet{}, middleware.After)
}
func addOpUpdateSqlInjectionMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateSqlInjectionMatchSet{}, middleware.After)
}
func addOpUpdateWebACLValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateWebACL{}, middleware.After)
}
func addOpUpdateXssMatchSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateXssMatchSet{}, middleware.After)
}
func validateActivatedRule(v *types.ActivatedRule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ActivatedRule"}
if v.Priority == nil {
invalidParams.Add(smithy.NewErrParamRequired("Priority"))
}
if v.RuleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RuleId"))
}
if v.Action != nil {
if err := validateWafAction(v.Action); err != nil {
invalidParams.AddNested("Action", err.(smithy.InvalidParamsError))
}
}
if v.OverrideAction != nil {
if err := validateWafOverrideAction(v.OverrideAction); err != nil {
invalidParams.AddNested("OverrideAction", err.(smithy.InvalidParamsError))
}
}
if v.ExcludedRules != nil {
if err := validateExcludedRules(v.ExcludedRules); err != nil {
invalidParams.AddNested("ExcludedRules", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateByteMatchSetUpdate(v *types.ByteMatchSetUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ByteMatchSetUpdate"}
if len(v.Action) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Action"))
}
if v.ByteMatchTuple == nil {
invalidParams.Add(smithy.NewErrParamRequired("ByteMatchTuple"))
} else if v.ByteMatchTuple != nil {
if err := validateByteMatchTuple(v.ByteMatchTuple); err != nil {
invalidParams.AddNested("ByteMatchTuple", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateByteMatchSetUpdates(v []types.ByteMatchSetUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ByteMatchSetUpdates"}
for i := range v {
if err := validateByteMatchSetUpdate(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateByteMatchTuple(v *types.ByteMatchTuple) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ByteMatchTuple"}
if v.FieldToMatch == nil {
invalidParams.Add(smithy.NewErrParamRequired("FieldToMatch"))
} else if v.FieldToMatch != nil {
if err := validateFieldToMatch(v.FieldToMatch); err != nil {
invalidParams.AddNested("FieldToMatch", err.(smithy.InvalidParamsError))
}
}
if v.TargetString == nil {
invalidParams.Add(smithy.NewErrParamRequired("TargetString"))
}
if len(v.TextTransformation) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("TextTransformation"))
}
if len(v.PositionalConstraint) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("PositionalConstraint"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateExcludedRule(v *types.ExcludedRule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExcludedRule"}
if v.RuleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RuleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateExcludedRules(v []types.ExcludedRule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExcludedRules"}
for i := range v {
if err := validateExcludedRule(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFieldToMatch(v *types.FieldToMatch) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "FieldToMatch"}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateGeoMatchConstraint(v *types.GeoMatchConstraint) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GeoMatchConstraint"}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if len(v.Value) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateGeoMatchSetUpdate(v *types.GeoMatchSetUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GeoMatchSetUpdate"}
if len(v.Action) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Action"))
}
if v.GeoMatchConstraint == nil {
invalidParams.Add(smithy.NewErrParamRequired("GeoMatchConstraint"))
} else if v.GeoMatchConstraint != nil {
if err := validateGeoMatchConstraint(v.GeoMatchConstraint); err != nil {
invalidParams.AddNested("GeoMatchConstraint", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateGeoMatchSetUpdates(v []types.GeoMatchSetUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GeoMatchSetUpdates"}
for i := range v {
if err := validateGeoMatchSetUpdate(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateIPSetDescriptor(v *types.IPSetDescriptor) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "IPSetDescriptor"}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateIPSetUpdate(v *types.IPSetUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "IPSetUpdate"}
if len(v.Action) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Action"))
}
if v.IPSetDescriptor == nil {
invalidParams.Add(smithy.NewErrParamRequired("IPSetDescriptor"))
} else if v.IPSetDescriptor != nil {
if err := validateIPSetDescriptor(v.IPSetDescriptor); err != nil {
invalidParams.AddNested("IPSetDescriptor", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateIPSetUpdates(v []types.IPSetUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "IPSetUpdates"}
for i := range v {
if err := validateIPSetUpdate(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLoggingConfiguration(v *types.LoggingConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LoggingConfiguration"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.LogDestinationConfigs == nil {
invalidParams.Add(smithy.NewErrParamRequired("LogDestinationConfigs"))
}
if v.RedactedFields != nil {
if err := validateRedactedFields(v.RedactedFields); err != nil {
invalidParams.AddNested("RedactedFields", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePredicate(v *types.Predicate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Predicate"}
if v.Negated == nil {
invalidParams.Add(smithy.NewErrParamRequired("Negated"))
}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if v.DataId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DataId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRedactedFields(v []types.FieldToMatch) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RedactedFields"}
for i := range v {
if err := validateFieldToMatch(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRegexMatchSetUpdate(v *types.RegexMatchSetUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RegexMatchSetUpdate"}
if len(v.Action) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Action"))
}
if v.RegexMatchTuple == nil {
invalidParams.Add(smithy.NewErrParamRequired("RegexMatchTuple"))
} else if v.RegexMatchTuple != nil {
if err := validateRegexMatchTuple(v.RegexMatchTuple); err != nil {
invalidParams.AddNested("RegexMatchTuple", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRegexMatchSetUpdates(v []types.RegexMatchSetUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RegexMatchSetUpdates"}
for i := range v {
if err := validateRegexMatchSetUpdate(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRegexMatchTuple(v *types.RegexMatchTuple) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RegexMatchTuple"}
if v.FieldToMatch == nil {
invalidParams.Add(smithy.NewErrParamRequired("FieldToMatch"))
} else if v.FieldToMatch != nil {
if err := validateFieldToMatch(v.FieldToMatch); err != nil {
invalidParams.AddNested("FieldToMatch", err.(smithy.InvalidParamsError))
}
}
if len(v.TextTransformation) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("TextTransformation"))
}
if v.RegexPatternSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RegexPatternSetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRegexPatternSetUpdate(v *types.RegexPatternSetUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RegexPatternSetUpdate"}
if len(v.Action) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Action"))
}
if v.RegexPatternString == nil {
invalidParams.Add(smithy.NewErrParamRequired("RegexPatternString"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRegexPatternSetUpdates(v []types.RegexPatternSetUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RegexPatternSetUpdates"}
for i := range v {
if err := validateRegexPatternSetUpdate(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRuleGroupUpdate(v *types.RuleGroupUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RuleGroupUpdate"}
if len(v.Action) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Action"))
}
if v.ActivatedRule == nil {
invalidParams.Add(smithy.NewErrParamRequired("ActivatedRule"))
} else if v.ActivatedRule != nil {
if err := validateActivatedRule(v.ActivatedRule); err != nil {
invalidParams.AddNested("ActivatedRule", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRuleGroupUpdates(v []types.RuleGroupUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RuleGroupUpdates"}
for i := range v {
if err := validateRuleGroupUpdate(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRuleUpdate(v *types.RuleUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RuleUpdate"}
if len(v.Action) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Action"))
}
if v.Predicate == nil {
invalidParams.Add(smithy.NewErrParamRequired("Predicate"))
} else if v.Predicate != nil {
if err := validatePredicate(v.Predicate); err != nil {
invalidParams.AddNested("Predicate", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRuleUpdates(v []types.RuleUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RuleUpdates"}
for i := range v {
if err := validateRuleUpdate(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSizeConstraint(v *types.SizeConstraint) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SizeConstraint"}
if v.FieldToMatch == nil {
invalidParams.Add(smithy.NewErrParamRequired("FieldToMatch"))
} else if v.FieldToMatch != nil {
if err := validateFieldToMatch(v.FieldToMatch); err != nil {
invalidParams.AddNested("FieldToMatch", err.(smithy.InvalidParamsError))
}
}
if len(v.TextTransformation) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("TextTransformation"))
}
if len(v.ComparisonOperator) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ComparisonOperator"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSizeConstraintSetUpdate(v *types.SizeConstraintSetUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SizeConstraintSetUpdate"}
if len(v.Action) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Action"))
}
if v.SizeConstraint == nil {
invalidParams.Add(smithy.NewErrParamRequired("SizeConstraint"))
} else if v.SizeConstraint != nil {
if err := validateSizeConstraint(v.SizeConstraint); err != nil {
invalidParams.AddNested("SizeConstraint", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSizeConstraintSetUpdates(v []types.SizeConstraintSetUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SizeConstraintSetUpdates"}
for i := range v {
if err := validateSizeConstraintSetUpdate(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSqlInjectionMatchSetUpdate(v *types.SqlInjectionMatchSetUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SqlInjectionMatchSetUpdate"}
if len(v.Action) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Action"))
}
if v.SqlInjectionMatchTuple == nil {
invalidParams.Add(smithy.NewErrParamRequired("SqlInjectionMatchTuple"))
} else if v.SqlInjectionMatchTuple != nil {
if err := validateSqlInjectionMatchTuple(v.SqlInjectionMatchTuple); err != nil {
invalidParams.AddNested("SqlInjectionMatchTuple", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSqlInjectionMatchSetUpdates(v []types.SqlInjectionMatchSetUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SqlInjectionMatchSetUpdates"}
for i := range v {
if err := validateSqlInjectionMatchSetUpdate(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSqlInjectionMatchTuple(v *types.SqlInjectionMatchTuple) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SqlInjectionMatchTuple"}
if v.FieldToMatch == nil {
invalidParams.Add(smithy.NewErrParamRequired("FieldToMatch"))
} else if v.FieldToMatch != nil {
if err := validateFieldToMatch(v.FieldToMatch); err != nil {
invalidParams.AddNested("FieldToMatch", err.(smithy.InvalidParamsError))
}
}
if len(v.TextTransformation) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("TextTransformation"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTag(v *types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Tag"}
if v.Key == nil {
invalidParams.Add(smithy.NewErrParamRequired("Key"))
}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTagList(v []types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagList"}
for i := range v {
if err := validateTag(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTimeWindow(v *types.TimeWindow) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TimeWindow"}
if v.StartTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartTime"))
}
if v.EndTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndTime"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateWafAction(v *types.WafAction) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "WafAction"}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateWafOverrideAction(v *types.WafOverrideAction) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "WafOverrideAction"}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateWebACLUpdate(v *types.WebACLUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "WebACLUpdate"}
if len(v.Action) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Action"))
}
if v.ActivatedRule == nil {
invalidParams.Add(smithy.NewErrParamRequired("ActivatedRule"))
} else if v.ActivatedRule != nil {
if err := validateActivatedRule(v.ActivatedRule); err != nil {
invalidParams.AddNested("ActivatedRule", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateWebACLUpdates(v []types.WebACLUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "WebACLUpdates"}
for i := range v {
if err := validateWebACLUpdate(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateXssMatchSetUpdate(v *types.XssMatchSetUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "XssMatchSetUpdate"}
if len(v.Action) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Action"))
}
if v.XssMatchTuple == nil {
invalidParams.Add(smithy.NewErrParamRequired("XssMatchTuple"))
} else if v.XssMatchTuple != nil {
if err := validateXssMatchTuple(v.XssMatchTuple); err != nil {
invalidParams.AddNested("XssMatchTuple", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateXssMatchSetUpdates(v []types.XssMatchSetUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "XssMatchSetUpdates"}
for i := range v {
if err := validateXssMatchSetUpdate(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateXssMatchTuple(v *types.XssMatchTuple) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "XssMatchTuple"}
if v.FieldToMatch == nil {
invalidParams.Add(smithy.NewErrParamRequired("FieldToMatch"))
} else if v.FieldToMatch != nil {
if err := validateFieldToMatch(v.FieldToMatch); err != nil {
invalidParams.AddNested("FieldToMatch", err.(smithy.InvalidParamsError))
}
}
if len(v.TextTransformation) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("TextTransformation"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAssociateWebACLInput(v *AssociateWebACLInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssociateWebACLInput"}
if v.WebACLId == nil {
invalidParams.Add(smithy.NewErrParamRequired("WebACLId"))
}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateByteMatchSetInput(v *CreateByteMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateByteMatchSetInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateGeoMatchSetInput(v *CreateGeoMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateGeoMatchSetInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateIPSetInput(v *CreateIPSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateIPSetInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateRateBasedRuleInput(v *CreateRateBasedRuleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateRateBasedRuleInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.MetricName == nil {
invalidParams.Add(smithy.NewErrParamRequired("MetricName"))
}
if len(v.RateKey) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("RateKey"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateRegexMatchSetInput(v *CreateRegexMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateRegexMatchSetInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateRegexPatternSetInput(v *CreateRegexPatternSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateRegexPatternSetInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateRuleGroupInput(v *CreateRuleGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateRuleGroupInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.MetricName == nil {
invalidParams.Add(smithy.NewErrParamRequired("MetricName"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateRuleInput(v *CreateRuleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateRuleInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.MetricName == nil {
invalidParams.Add(smithy.NewErrParamRequired("MetricName"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateSizeConstraintSetInput(v *CreateSizeConstraintSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateSizeConstraintSetInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateSqlInjectionMatchSetInput(v *CreateSqlInjectionMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateSqlInjectionMatchSetInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateWebACLInput(v *CreateWebACLInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateWebACLInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.MetricName == nil {
invalidParams.Add(smithy.NewErrParamRequired("MetricName"))
}
if v.DefaultAction == nil {
invalidParams.Add(smithy.NewErrParamRequired("DefaultAction"))
} else if v.DefaultAction != nil {
if err := validateWafAction(v.DefaultAction); err != nil {
invalidParams.AddNested("DefaultAction", err.(smithy.InvalidParamsError))
}
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateWebACLMigrationStackInput(v *CreateWebACLMigrationStackInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateWebACLMigrationStackInput"}
if v.WebACLId == nil {
invalidParams.Add(smithy.NewErrParamRequired("WebACLId"))
}
if v.S3BucketName == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3BucketName"))
}
if v.IgnoreUnsupportedType == nil {
invalidParams.Add(smithy.NewErrParamRequired("IgnoreUnsupportedType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateXssMatchSetInput(v *CreateXssMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateXssMatchSetInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteByteMatchSetInput(v *DeleteByteMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteByteMatchSetInput"}
if v.ByteMatchSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ByteMatchSetId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteGeoMatchSetInput(v *DeleteGeoMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteGeoMatchSetInput"}
if v.GeoMatchSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("GeoMatchSetId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteIPSetInput(v *DeleteIPSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteIPSetInput"}
if v.IPSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("IPSetId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteLoggingConfigurationInput(v *DeleteLoggingConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteLoggingConfigurationInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeletePermissionPolicyInput(v *DeletePermissionPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeletePermissionPolicyInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteRateBasedRuleInput(v *DeleteRateBasedRuleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteRateBasedRuleInput"}
if v.RuleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RuleId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteRegexMatchSetInput(v *DeleteRegexMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteRegexMatchSetInput"}
if v.RegexMatchSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RegexMatchSetId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteRegexPatternSetInput(v *DeleteRegexPatternSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteRegexPatternSetInput"}
if v.RegexPatternSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RegexPatternSetId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteRuleGroupInput(v *DeleteRuleGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteRuleGroupInput"}
if v.RuleGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RuleGroupId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteRuleInput(v *DeleteRuleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteRuleInput"}
if v.RuleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RuleId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteSizeConstraintSetInput(v *DeleteSizeConstraintSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteSizeConstraintSetInput"}
if v.SizeConstraintSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SizeConstraintSetId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteSqlInjectionMatchSetInput(v *DeleteSqlInjectionMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteSqlInjectionMatchSetInput"}
if v.SqlInjectionMatchSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SqlInjectionMatchSetId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteWebACLInput(v *DeleteWebACLInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteWebACLInput"}
if v.WebACLId == nil {
invalidParams.Add(smithy.NewErrParamRequired("WebACLId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteXssMatchSetInput(v *DeleteXssMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteXssMatchSetInput"}
if v.XssMatchSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("XssMatchSetId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDisassociateWebACLInput(v *DisassociateWebACLInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DisassociateWebACLInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetByteMatchSetInput(v *GetByteMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetByteMatchSetInput"}
if v.ByteMatchSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ByteMatchSetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetChangeTokenStatusInput(v *GetChangeTokenStatusInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetChangeTokenStatusInput"}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetGeoMatchSetInput(v *GetGeoMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetGeoMatchSetInput"}
if v.GeoMatchSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("GeoMatchSetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetIPSetInput(v *GetIPSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetIPSetInput"}
if v.IPSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("IPSetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetLoggingConfigurationInput(v *GetLoggingConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetLoggingConfigurationInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetPermissionPolicyInput(v *GetPermissionPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetPermissionPolicyInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetRateBasedRuleInput(v *GetRateBasedRuleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetRateBasedRuleInput"}
if v.RuleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RuleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetRateBasedRuleManagedKeysInput(v *GetRateBasedRuleManagedKeysInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetRateBasedRuleManagedKeysInput"}
if v.RuleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RuleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetRegexMatchSetInput(v *GetRegexMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetRegexMatchSetInput"}
if v.RegexMatchSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RegexMatchSetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetRegexPatternSetInput(v *GetRegexPatternSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetRegexPatternSetInput"}
if v.RegexPatternSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RegexPatternSetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetRuleGroupInput(v *GetRuleGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetRuleGroupInput"}
if v.RuleGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RuleGroupId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetRuleInput(v *GetRuleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetRuleInput"}
if v.RuleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RuleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetSampledRequestsInput(v *GetSampledRequestsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetSampledRequestsInput"}
if v.WebAclId == nil {
invalidParams.Add(smithy.NewErrParamRequired("WebAclId"))
}
if v.RuleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RuleId"))
}
if v.TimeWindow == nil {
invalidParams.Add(smithy.NewErrParamRequired("TimeWindow"))
} else if v.TimeWindow != nil {
if err := validateTimeWindow(v.TimeWindow); err != nil {
invalidParams.AddNested("TimeWindow", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetSizeConstraintSetInput(v *GetSizeConstraintSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetSizeConstraintSetInput"}
if v.SizeConstraintSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SizeConstraintSetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetSqlInjectionMatchSetInput(v *GetSqlInjectionMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetSqlInjectionMatchSetInput"}
if v.SqlInjectionMatchSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SqlInjectionMatchSetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetWebACLForResourceInput(v *GetWebACLForResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetWebACLForResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetWebACLInput(v *GetWebACLInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetWebACLInput"}
if v.WebACLId == nil {
invalidParams.Add(smithy.NewErrParamRequired("WebACLId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetXssMatchSetInput(v *GetXssMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetXssMatchSetInput"}
if v.XssMatchSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("XssMatchSetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListResourcesForWebACLInput(v *ListResourcesForWebACLInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListResourcesForWebACLInput"}
if v.WebACLId == nil {
invalidParams.Add(smithy.NewErrParamRequired("WebACLId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutLoggingConfigurationInput(v *PutLoggingConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutLoggingConfigurationInput"}
if v.LoggingConfiguration == nil {
invalidParams.Add(smithy.NewErrParamRequired("LoggingConfiguration"))
} else if v.LoggingConfiguration != nil {
if err := validateLoggingConfiguration(v.LoggingConfiguration); err != nil {
invalidParams.AddNested("LoggingConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutPermissionPolicyInput(v *PutPermissionPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutPermissionPolicyInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.Policy == nil {
invalidParams.Add(smithy.NewErrParamRequired("Policy"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpTagResourceInput(v *TagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
} else if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUntagResourceInput(v *UntagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if v.TagKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateByteMatchSetInput(v *UpdateByteMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateByteMatchSetInput"}
if v.ByteMatchSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ByteMatchSetId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if v.Updates == nil {
invalidParams.Add(smithy.NewErrParamRequired("Updates"))
} else if v.Updates != nil {
if err := validateByteMatchSetUpdates(v.Updates); err != nil {
invalidParams.AddNested("Updates", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateGeoMatchSetInput(v *UpdateGeoMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateGeoMatchSetInput"}
if v.GeoMatchSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("GeoMatchSetId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if v.Updates == nil {
invalidParams.Add(smithy.NewErrParamRequired("Updates"))
} else if v.Updates != nil {
if err := validateGeoMatchSetUpdates(v.Updates); err != nil {
invalidParams.AddNested("Updates", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateIPSetInput(v *UpdateIPSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateIPSetInput"}
if v.IPSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("IPSetId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if v.Updates == nil {
invalidParams.Add(smithy.NewErrParamRequired("Updates"))
} else if v.Updates != nil {
if err := validateIPSetUpdates(v.Updates); err != nil {
invalidParams.AddNested("Updates", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateRateBasedRuleInput(v *UpdateRateBasedRuleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateRateBasedRuleInput"}
if v.RuleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RuleId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if v.Updates == nil {
invalidParams.Add(smithy.NewErrParamRequired("Updates"))
} else if v.Updates != nil {
if err := validateRuleUpdates(v.Updates); err != nil {
invalidParams.AddNested("Updates", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateRegexMatchSetInput(v *UpdateRegexMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateRegexMatchSetInput"}
if v.RegexMatchSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RegexMatchSetId"))
}
if v.Updates == nil {
invalidParams.Add(smithy.NewErrParamRequired("Updates"))
} else if v.Updates != nil {
if err := validateRegexMatchSetUpdates(v.Updates); err != nil {
invalidParams.AddNested("Updates", err.(smithy.InvalidParamsError))
}
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateRegexPatternSetInput(v *UpdateRegexPatternSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateRegexPatternSetInput"}
if v.RegexPatternSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RegexPatternSetId"))
}
if v.Updates == nil {
invalidParams.Add(smithy.NewErrParamRequired("Updates"))
} else if v.Updates != nil {
if err := validateRegexPatternSetUpdates(v.Updates); err != nil {
invalidParams.AddNested("Updates", err.(smithy.InvalidParamsError))
}
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateRuleGroupInput(v *UpdateRuleGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateRuleGroupInput"}
if v.RuleGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RuleGroupId"))
}
if v.Updates == nil {
invalidParams.Add(smithy.NewErrParamRequired("Updates"))
} else if v.Updates != nil {
if err := validateRuleGroupUpdates(v.Updates); err != nil {
invalidParams.AddNested("Updates", err.(smithy.InvalidParamsError))
}
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateRuleInput(v *UpdateRuleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateRuleInput"}
if v.RuleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RuleId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if v.Updates == nil {
invalidParams.Add(smithy.NewErrParamRequired("Updates"))
} else if v.Updates != nil {
if err := validateRuleUpdates(v.Updates); err != nil {
invalidParams.AddNested("Updates", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateSizeConstraintSetInput(v *UpdateSizeConstraintSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateSizeConstraintSetInput"}
if v.SizeConstraintSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SizeConstraintSetId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if v.Updates == nil {
invalidParams.Add(smithy.NewErrParamRequired("Updates"))
} else if v.Updates != nil {
if err := validateSizeConstraintSetUpdates(v.Updates); err != nil {
invalidParams.AddNested("Updates", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateSqlInjectionMatchSetInput(v *UpdateSqlInjectionMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateSqlInjectionMatchSetInput"}
if v.SqlInjectionMatchSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SqlInjectionMatchSetId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if v.Updates == nil {
invalidParams.Add(smithy.NewErrParamRequired("Updates"))
} else if v.Updates != nil {
if err := validateSqlInjectionMatchSetUpdates(v.Updates); err != nil {
invalidParams.AddNested("Updates", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateWebACLInput(v *UpdateWebACLInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateWebACLInput"}
if v.WebACLId == nil {
invalidParams.Add(smithy.NewErrParamRequired("WebACLId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if v.Updates != nil {
if err := validateWebACLUpdates(v.Updates); err != nil {
invalidParams.AddNested("Updates", err.(smithy.InvalidParamsError))
}
}
if v.DefaultAction != nil {
if err := validateWafAction(v.DefaultAction); err != nil {
invalidParams.AddNested("DefaultAction", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateXssMatchSetInput(v *UpdateXssMatchSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateXssMatchSetInput"}
if v.XssMatchSetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("XssMatchSetId"))
}
if v.ChangeToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangeToken"))
}
if v.Updates == nil {
invalidParams.Add(smithy.NewErrParamRequired("Updates"))
} else if v.Updates != nil {
if err := validateXssMatchSetUpdates(v.Updates); err != nil {
invalidParams.AddNested("Updates", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 3,627 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"github.com/aws/aws-sdk-go-v2/aws"
endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2"
"github.com/aws/smithy-go/logging"
"regexp"
)
// Options is the endpoint resolver configuration options
type Options struct {
// Logger is a logging implementation that log events should be sent to.
Logger logging.Logger
// LogDeprecated indicates that deprecated endpoints should be logged to the
// provided logger.
LogDeprecated bool
// ResolvedRegion is used to override the region to be resolved, rather then the
// using the value passed to the ResolveEndpoint method. This value is used by the
// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative
// name. You must not set this value directly in your application.
ResolvedRegion string
// DisableHTTPS informs the resolver to return an endpoint that does not use the
// HTTPS scheme.
DisableHTTPS bool
// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.
UseDualStackEndpoint aws.DualStackEndpointState
// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.
UseFIPSEndpoint aws.FIPSEndpointState
}
func (o Options) GetResolvedRegion() string {
return o.ResolvedRegion
}
func (o Options) GetDisableHTTPS() bool {
return o.DisableHTTPS
}
func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {
return o.UseDualStackEndpoint
}
func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {
return o.UseFIPSEndpoint
}
func transformToSharedOptions(options Options) endpoints.Options {
return endpoints.Options{
Logger: options.Logger,
LogDeprecated: options.LogDeprecated,
ResolvedRegion: options.ResolvedRegion,
DisableHTTPS: options.DisableHTTPS,
UseDualStackEndpoint: options.UseDualStackEndpoint,
UseFIPSEndpoint: options.UseFIPSEndpoint,
}
}
// Resolver WAF Regional endpoint resolver
type Resolver struct {
partitions endpoints.Partitions
}
// ResolveEndpoint resolves the service endpoint for the given region and options
func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {
if len(region) == 0 {
return endpoint, &aws.MissingRegionError{}
}
opt := transformToSharedOptions(options)
return r.partitions.ResolveEndpoint(region, opt)
}
// New returns a new Resolver
func New() *Resolver {
return &Resolver{
partitions: defaultPartitions,
}
}
var partitionRegexp = struct {
Aws *regexp.Regexp
AwsCn *regexp.Regexp
AwsIso *regexp.Regexp
AwsIsoB *regexp.Regexp
AwsIsoE *regexp.Regexp
AwsIsoF *regexp.Regexp
AwsUsGov *regexp.Regexp
}{
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"),
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"),
AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"),
}
var defaultPartitions = endpoints.Partitions{
{
ID: "aws",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "waf-regional.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "waf-regional-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "waf-regional.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "af-south-1",
}: endpoints.Endpoint{
Hostname: "waf-regional.af-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "af-south-1",
},
},
endpoints.EndpointKey{
Region: "af-south-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.af-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "af-south-1",
},
},
endpoints.EndpointKey{
Region: "ap-east-1",
}: endpoints.Endpoint{
Hostname: "waf-regional.ap-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-east-1",
},
},
endpoints.EndpointKey{
Region: "ap-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.ap-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-east-1",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{
Hostname: "waf-regional.ap-northeast-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-1",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.ap-northeast-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-1",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{
Hostname: "waf-regional.ap-northeast-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-2",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.ap-northeast-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-2",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-3",
}: endpoints.Endpoint{
Hostname: "waf-regional.ap-northeast-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-3",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-3",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.ap-northeast-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-3",
},
},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{
Hostname: "waf-regional.ap-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-south-1",
},
},
endpoints.EndpointKey{
Region: "ap-south-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.ap-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-south-1",
},
},
endpoints.EndpointKey{
Region: "ap-south-2",
}: endpoints.Endpoint{
Hostname: "waf-regional.ap-south-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-south-2",
},
},
endpoints.EndpointKey{
Region: "ap-south-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.ap-south-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-south-2",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{
Hostname: "waf-regional.ap-southeast-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-1",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.ap-southeast-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-1",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{
Hostname: "waf-regional.ap-southeast-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-2",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.ap-southeast-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-2",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-3",
}: endpoints.Endpoint{
Hostname: "waf-regional.ap-southeast-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-3",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-3",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.ap-southeast-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-3",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-4",
}: endpoints.Endpoint{
Hostname: "waf-regional.ap-southeast-4.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-4",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-4",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.ap-southeast-4.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-4",
},
},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{
Hostname: "waf-regional.ca-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
},
endpoints.EndpointKey{
Region: "ca-central-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.ca-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{
Hostname: "waf-regional.eu-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-central-1",
},
},
endpoints.EndpointKey{
Region: "eu-central-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.eu-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-central-1",
},
},
endpoints.EndpointKey{
Region: "eu-central-2",
}: endpoints.Endpoint{
Hostname: "waf-regional.eu-central-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-central-2",
},
},
endpoints.EndpointKey{
Region: "eu-central-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.eu-central-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-central-2",
},
},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{
Hostname: "waf-regional.eu-north-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-north-1",
},
},
endpoints.EndpointKey{
Region: "eu-north-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.eu-north-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-north-1",
},
},
endpoints.EndpointKey{
Region: "eu-south-1",
}: endpoints.Endpoint{
Hostname: "waf-regional.eu-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-south-1",
},
},
endpoints.EndpointKey{
Region: "eu-south-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.eu-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-south-1",
},
},
endpoints.EndpointKey{
Region: "eu-south-2",
}: endpoints.Endpoint{
Hostname: "waf-regional.eu-south-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-south-2",
},
},
endpoints.EndpointKey{
Region: "eu-south-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.eu-south-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-south-2",
},
},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{
Hostname: "waf-regional.eu-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-1",
},
},
endpoints.EndpointKey{
Region: "eu-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.eu-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-1",
},
},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{
Hostname: "waf-regional.eu-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-2",
},
},
endpoints.EndpointKey{
Region: "eu-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.eu-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-2",
},
},
endpoints.EndpointKey{
Region: "eu-west-3",
}: endpoints.Endpoint{
Hostname: "waf-regional.eu-west-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-3",
},
},
endpoints.EndpointKey{
Region: "eu-west-3",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.eu-west-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-3",
},
},
endpoints.EndpointKey{
Region: "fips-af-south-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.af-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "af-south-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-east-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.ap-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-northeast-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.ap-northeast-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-northeast-2",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.ap-northeast-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-northeast-3",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.ap-northeast-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-3",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-south-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.ap-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-south-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-south-2",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.ap-south-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-south-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-southeast-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.ap-southeast-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-southeast-2",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.ap-southeast-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-southeast-3",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.ap-southeast-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-3",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-southeast-4",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.ap-southeast-4.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-4",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ca-central-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.ca-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-eu-central-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.eu-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-eu-central-2",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.eu-central-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-central-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-eu-north-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.eu-north-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-north-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-eu-south-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.eu-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-south-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-eu-south-2",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.eu-south-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-south-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-eu-west-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.eu-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-eu-west-2",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.eu-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-eu-west-3",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.eu-west-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-3",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-il-central-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.il-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "il-central-1",
},
},
endpoints.EndpointKey{
Region: "fips-me-central-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.me-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "me-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-me-south-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.me-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "me-south-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-sa-east-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.sa-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "sa-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-east-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-east-2",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.us-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-2",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "me-central-1",
}: endpoints.Endpoint{
Hostname: "waf-regional.me-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "me-central-1",
},
},
endpoints.EndpointKey{
Region: "me-central-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.me-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "me-central-1",
},
},
endpoints.EndpointKey{
Region: "me-south-1",
}: endpoints.Endpoint{
Hostname: "waf-regional.me-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "me-south-1",
},
},
endpoints.EndpointKey{
Region: "me-south-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.me-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "me-south-1",
},
},
endpoints.EndpointKey{
Region: "sa-east-1",
}: endpoints.Endpoint{
Hostname: "waf-regional.sa-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "sa-east-1",
},
},
endpoints.EndpointKey{
Region: "sa-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.sa-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "sa-east-1",
},
},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{
Hostname: "waf-regional.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{
Hostname: "waf-regional.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{
Hostname: "waf-regional.us-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.us-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{
Hostname: "waf-regional.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "waf-regional.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "waf-regional-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "waf-regional.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "cn-north-1",
}: endpoints.Endpoint{
Hostname: "waf-regional.cn-north-1.amazonaws.com.cn",
CredentialScope: endpoints.CredentialScope{
Region: "cn-north-1",
},
},
endpoints.EndpointKey{
Region: "cn-north-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.cn-north-1.amazonaws.com.cn",
CredentialScope: endpoints.CredentialScope{
Region: "cn-north-1",
},
},
endpoints.EndpointKey{
Region: "cn-northwest-1",
}: endpoints.Endpoint{
Hostname: "waf-regional.cn-northwest-1.amazonaws.com.cn",
CredentialScope: endpoints.CredentialScope{
Region: "cn-northwest-1",
},
},
endpoints.EndpointKey{
Region: "cn-northwest-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.cn-northwest-1.amazonaws.com.cn",
CredentialScope: endpoints.CredentialScope{
Region: "cn-northwest-1",
},
},
endpoints.EndpointKey{
Region: "fips-cn-north-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.cn-north-1.amazonaws.com.cn",
CredentialScope: endpoints.CredentialScope{
Region: "cn-north-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-cn-northwest-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.cn-northwest-1.amazonaws.com.cn",
CredentialScope: endpoints.CredentialScope{
Region: "cn-northwest-1",
},
Deprecated: aws.TrueTernary,
},
},
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "waf-regional.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIso,
IsRegionalized: true,
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "waf-regional.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoB,
IsRegionalized: true,
},
{
ID: "aws-iso-e",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "waf-regional.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoE,
IsRegionalized: true,
},
{
ID: "aws-iso-f",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "waf-regional.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoF,
IsRegionalized: true,
},
{
ID: "aws-us-gov",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "waf-regional.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "waf-regional-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "waf-regional.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "fips-us-gov-east-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.us-gov-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-gov-west-1",
}: endpoints.Endpoint{
Hostname: "waf-regional-fips.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
}: endpoints.Endpoint{
Hostname: "waf-regional.us-gov-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.us-gov-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{
Hostname: "waf-regional.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "waf-regional-fips.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
},
},
},
}
| 1,117 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"testing"
)
func TestRegexCompile(t *testing.T) {
_ = defaultPartitions
}
| 12 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
type ChangeAction string
// Enum values for ChangeAction
const (
ChangeActionInsert ChangeAction = "INSERT"
ChangeActionDelete ChangeAction = "DELETE"
)
// Values returns all known values for ChangeAction. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ChangeAction) Values() []ChangeAction {
return []ChangeAction{
"INSERT",
"DELETE",
}
}
type ChangeTokenStatus string
// Enum values for ChangeTokenStatus
const (
ChangeTokenStatusProvisioned ChangeTokenStatus = "PROVISIONED"
ChangeTokenStatusPending ChangeTokenStatus = "PENDING"
ChangeTokenStatusInsync ChangeTokenStatus = "INSYNC"
)
// Values returns all known values for ChangeTokenStatus. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ChangeTokenStatus) Values() []ChangeTokenStatus {
return []ChangeTokenStatus{
"PROVISIONED",
"PENDING",
"INSYNC",
}
}
type ComparisonOperator string
// Enum values for ComparisonOperator
const (
ComparisonOperatorEq ComparisonOperator = "EQ"
ComparisonOperatorNe ComparisonOperator = "NE"
ComparisonOperatorLe ComparisonOperator = "LE"
ComparisonOperatorLt ComparisonOperator = "LT"
ComparisonOperatorGe ComparisonOperator = "GE"
ComparisonOperatorGt ComparisonOperator = "GT"
)
// Values returns all known values for ComparisonOperator. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ComparisonOperator) Values() []ComparisonOperator {
return []ComparisonOperator{
"EQ",
"NE",
"LE",
"LT",
"GE",
"GT",
}
}
type GeoMatchConstraintType string
// Enum values for GeoMatchConstraintType
const (
GeoMatchConstraintTypeCountry GeoMatchConstraintType = "Country"
)
// Values returns all known values for GeoMatchConstraintType. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (GeoMatchConstraintType) Values() []GeoMatchConstraintType {
return []GeoMatchConstraintType{
"Country",
}
}
type GeoMatchConstraintValue string
// Enum values for GeoMatchConstraintValue
const (
GeoMatchConstraintValueAf GeoMatchConstraintValue = "AF"
GeoMatchConstraintValueAx GeoMatchConstraintValue = "AX"
GeoMatchConstraintValueAl GeoMatchConstraintValue = "AL"
GeoMatchConstraintValueDz GeoMatchConstraintValue = "DZ"
GeoMatchConstraintValueAs GeoMatchConstraintValue = "AS"
GeoMatchConstraintValueAd GeoMatchConstraintValue = "AD"
GeoMatchConstraintValueAo GeoMatchConstraintValue = "AO"
GeoMatchConstraintValueAi GeoMatchConstraintValue = "AI"
GeoMatchConstraintValueAq GeoMatchConstraintValue = "AQ"
GeoMatchConstraintValueAg GeoMatchConstraintValue = "AG"
GeoMatchConstraintValueAr GeoMatchConstraintValue = "AR"
GeoMatchConstraintValueAm GeoMatchConstraintValue = "AM"
GeoMatchConstraintValueAw GeoMatchConstraintValue = "AW"
GeoMatchConstraintValueAu GeoMatchConstraintValue = "AU"
GeoMatchConstraintValueAt GeoMatchConstraintValue = "AT"
GeoMatchConstraintValueAz GeoMatchConstraintValue = "AZ"
GeoMatchConstraintValueBs GeoMatchConstraintValue = "BS"
GeoMatchConstraintValueBh GeoMatchConstraintValue = "BH"
GeoMatchConstraintValueBd GeoMatchConstraintValue = "BD"
GeoMatchConstraintValueBb GeoMatchConstraintValue = "BB"
GeoMatchConstraintValueBy GeoMatchConstraintValue = "BY"
GeoMatchConstraintValueBe GeoMatchConstraintValue = "BE"
GeoMatchConstraintValueBz GeoMatchConstraintValue = "BZ"
GeoMatchConstraintValueBj GeoMatchConstraintValue = "BJ"
GeoMatchConstraintValueBm GeoMatchConstraintValue = "BM"
GeoMatchConstraintValueBt GeoMatchConstraintValue = "BT"
GeoMatchConstraintValueBo GeoMatchConstraintValue = "BO"
GeoMatchConstraintValueBq GeoMatchConstraintValue = "BQ"
GeoMatchConstraintValueBa GeoMatchConstraintValue = "BA"
GeoMatchConstraintValueBw GeoMatchConstraintValue = "BW"
GeoMatchConstraintValueBv GeoMatchConstraintValue = "BV"
GeoMatchConstraintValueBr GeoMatchConstraintValue = "BR"
GeoMatchConstraintValueIo GeoMatchConstraintValue = "IO"
GeoMatchConstraintValueBn GeoMatchConstraintValue = "BN"
GeoMatchConstraintValueBg GeoMatchConstraintValue = "BG"
GeoMatchConstraintValueBf GeoMatchConstraintValue = "BF"
GeoMatchConstraintValueBi GeoMatchConstraintValue = "BI"
GeoMatchConstraintValueKh GeoMatchConstraintValue = "KH"
GeoMatchConstraintValueCm GeoMatchConstraintValue = "CM"
GeoMatchConstraintValueCa GeoMatchConstraintValue = "CA"
GeoMatchConstraintValueCv GeoMatchConstraintValue = "CV"
GeoMatchConstraintValueKy GeoMatchConstraintValue = "KY"
GeoMatchConstraintValueCf GeoMatchConstraintValue = "CF"
GeoMatchConstraintValueTd GeoMatchConstraintValue = "TD"
GeoMatchConstraintValueCl GeoMatchConstraintValue = "CL"
GeoMatchConstraintValueCn GeoMatchConstraintValue = "CN"
GeoMatchConstraintValueCx GeoMatchConstraintValue = "CX"
GeoMatchConstraintValueCc GeoMatchConstraintValue = "CC"
GeoMatchConstraintValueCo GeoMatchConstraintValue = "CO"
GeoMatchConstraintValueKm GeoMatchConstraintValue = "KM"
GeoMatchConstraintValueCg GeoMatchConstraintValue = "CG"
GeoMatchConstraintValueCd GeoMatchConstraintValue = "CD"
GeoMatchConstraintValueCk GeoMatchConstraintValue = "CK"
GeoMatchConstraintValueCr GeoMatchConstraintValue = "CR"
GeoMatchConstraintValueCi GeoMatchConstraintValue = "CI"
GeoMatchConstraintValueHr GeoMatchConstraintValue = "HR"
GeoMatchConstraintValueCu GeoMatchConstraintValue = "CU"
GeoMatchConstraintValueCw GeoMatchConstraintValue = "CW"
GeoMatchConstraintValueCy GeoMatchConstraintValue = "CY"
GeoMatchConstraintValueCz GeoMatchConstraintValue = "CZ"
GeoMatchConstraintValueDk GeoMatchConstraintValue = "DK"
GeoMatchConstraintValueDj GeoMatchConstraintValue = "DJ"
GeoMatchConstraintValueDm GeoMatchConstraintValue = "DM"
GeoMatchConstraintValueDo GeoMatchConstraintValue = "DO"
GeoMatchConstraintValueEc GeoMatchConstraintValue = "EC"
GeoMatchConstraintValueEg GeoMatchConstraintValue = "EG"
GeoMatchConstraintValueSv GeoMatchConstraintValue = "SV"
GeoMatchConstraintValueGq GeoMatchConstraintValue = "GQ"
GeoMatchConstraintValueEr GeoMatchConstraintValue = "ER"
GeoMatchConstraintValueEe GeoMatchConstraintValue = "EE"
GeoMatchConstraintValueEt GeoMatchConstraintValue = "ET"
GeoMatchConstraintValueFk GeoMatchConstraintValue = "FK"
GeoMatchConstraintValueFo GeoMatchConstraintValue = "FO"
GeoMatchConstraintValueFj GeoMatchConstraintValue = "FJ"
GeoMatchConstraintValueFi GeoMatchConstraintValue = "FI"
GeoMatchConstraintValueFr GeoMatchConstraintValue = "FR"
GeoMatchConstraintValueGf GeoMatchConstraintValue = "GF"
GeoMatchConstraintValuePf GeoMatchConstraintValue = "PF"
GeoMatchConstraintValueTf GeoMatchConstraintValue = "TF"
GeoMatchConstraintValueGa GeoMatchConstraintValue = "GA"
GeoMatchConstraintValueGm GeoMatchConstraintValue = "GM"
GeoMatchConstraintValueGe GeoMatchConstraintValue = "GE"
GeoMatchConstraintValueDe GeoMatchConstraintValue = "DE"
GeoMatchConstraintValueGh GeoMatchConstraintValue = "GH"
GeoMatchConstraintValueGi GeoMatchConstraintValue = "GI"
GeoMatchConstraintValueGr GeoMatchConstraintValue = "GR"
GeoMatchConstraintValueGl GeoMatchConstraintValue = "GL"
GeoMatchConstraintValueGd GeoMatchConstraintValue = "GD"
GeoMatchConstraintValueGp GeoMatchConstraintValue = "GP"
GeoMatchConstraintValueGu GeoMatchConstraintValue = "GU"
GeoMatchConstraintValueGt GeoMatchConstraintValue = "GT"
GeoMatchConstraintValueGg GeoMatchConstraintValue = "GG"
GeoMatchConstraintValueGn GeoMatchConstraintValue = "GN"
GeoMatchConstraintValueGw GeoMatchConstraintValue = "GW"
GeoMatchConstraintValueGy GeoMatchConstraintValue = "GY"
GeoMatchConstraintValueHt GeoMatchConstraintValue = "HT"
GeoMatchConstraintValueHm GeoMatchConstraintValue = "HM"
GeoMatchConstraintValueVa GeoMatchConstraintValue = "VA"
GeoMatchConstraintValueHn GeoMatchConstraintValue = "HN"
GeoMatchConstraintValueHk GeoMatchConstraintValue = "HK"
GeoMatchConstraintValueHu GeoMatchConstraintValue = "HU"
GeoMatchConstraintValueIs GeoMatchConstraintValue = "IS"
GeoMatchConstraintValueIn GeoMatchConstraintValue = "IN"
GeoMatchConstraintValueId GeoMatchConstraintValue = "ID"
GeoMatchConstraintValueIr GeoMatchConstraintValue = "IR"
GeoMatchConstraintValueIq GeoMatchConstraintValue = "IQ"
GeoMatchConstraintValueIe GeoMatchConstraintValue = "IE"
GeoMatchConstraintValueIm GeoMatchConstraintValue = "IM"
GeoMatchConstraintValueIl GeoMatchConstraintValue = "IL"
GeoMatchConstraintValueIt GeoMatchConstraintValue = "IT"
GeoMatchConstraintValueJm GeoMatchConstraintValue = "JM"
GeoMatchConstraintValueJp GeoMatchConstraintValue = "JP"
GeoMatchConstraintValueJe GeoMatchConstraintValue = "JE"
GeoMatchConstraintValueJo GeoMatchConstraintValue = "JO"
GeoMatchConstraintValueKz GeoMatchConstraintValue = "KZ"
GeoMatchConstraintValueKe GeoMatchConstraintValue = "KE"
GeoMatchConstraintValueKi GeoMatchConstraintValue = "KI"
GeoMatchConstraintValueKp GeoMatchConstraintValue = "KP"
GeoMatchConstraintValueKr GeoMatchConstraintValue = "KR"
GeoMatchConstraintValueKw GeoMatchConstraintValue = "KW"
GeoMatchConstraintValueKg GeoMatchConstraintValue = "KG"
GeoMatchConstraintValueLa GeoMatchConstraintValue = "LA"
GeoMatchConstraintValueLv GeoMatchConstraintValue = "LV"
GeoMatchConstraintValueLb GeoMatchConstraintValue = "LB"
GeoMatchConstraintValueLs GeoMatchConstraintValue = "LS"
GeoMatchConstraintValueLr GeoMatchConstraintValue = "LR"
GeoMatchConstraintValueLy GeoMatchConstraintValue = "LY"
GeoMatchConstraintValueLi GeoMatchConstraintValue = "LI"
GeoMatchConstraintValueLt GeoMatchConstraintValue = "LT"
GeoMatchConstraintValueLu GeoMatchConstraintValue = "LU"
GeoMatchConstraintValueMo GeoMatchConstraintValue = "MO"
GeoMatchConstraintValueMk GeoMatchConstraintValue = "MK"
GeoMatchConstraintValueMg GeoMatchConstraintValue = "MG"
GeoMatchConstraintValueMw GeoMatchConstraintValue = "MW"
GeoMatchConstraintValueMy GeoMatchConstraintValue = "MY"
GeoMatchConstraintValueMv GeoMatchConstraintValue = "MV"
GeoMatchConstraintValueMl GeoMatchConstraintValue = "ML"
GeoMatchConstraintValueMt GeoMatchConstraintValue = "MT"
GeoMatchConstraintValueMh GeoMatchConstraintValue = "MH"
GeoMatchConstraintValueMq GeoMatchConstraintValue = "MQ"
GeoMatchConstraintValueMr GeoMatchConstraintValue = "MR"
GeoMatchConstraintValueMu GeoMatchConstraintValue = "MU"
GeoMatchConstraintValueYt GeoMatchConstraintValue = "YT"
GeoMatchConstraintValueMx GeoMatchConstraintValue = "MX"
GeoMatchConstraintValueFm GeoMatchConstraintValue = "FM"
GeoMatchConstraintValueMd GeoMatchConstraintValue = "MD"
GeoMatchConstraintValueMc GeoMatchConstraintValue = "MC"
GeoMatchConstraintValueMn GeoMatchConstraintValue = "MN"
GeoMatchConstraintValueMe GeoMatchConstraintValue = "ME"
GeoMatchConstraintValueMs GeoMatchConstraintValue = "MS"
GeoMatchConstraintValueMa GeoMatchConstraintValue = "MA"
GeoMatchConstraintValueMz GeoMatchConstraintValue = "MZ"
GeoMatchConstraintValueMm GeoMatchConstraintValue = "MM"
GeoMatchConstraintValueNa GeoMatchConstraintValue = "NA"
GeoMatchConstraintValueNr GeoMatchConstraintValue = "NR"
GeoMatchConstraintValueNp GeoMatchConstraintValue = "NP"
GeoMatchConstraintValueNl GeoMatchConstraintValue = "NL"
GeoMatchConstraintValueNc GeoMatchConstraintValue = "NC"
GeoMatchConstraintValueNz GeoMatchConstraintValue = "NZ"
GeoMatchConstraintValueNi GeoMatchConstraintValue = "NI"
GeoMatchConstraintValueNe GeoMatchConstraintValue = "NE"
GeoMatchConstraintValueNg GeoMatchConstraintValue = "NG"
GeoMatchConstraintValueNu GeoMatchConstraintValue = "NU"
GeoMatchConstraintValueNf GeoMatchConstraintValue = "NF"
GeoMatchConstraintValueMp GeoMatchConstraintValue = "MP"
GeoMatchConstraintValueNo GeoMatchConstraintValue = "NO"
GeoMatchConstraintValueOm GeoMatchConstraintValue = "OM"
GeoMatchConstraintValuePk GeoMatchConstraintValue = "PK"
GeoMatchConstraintValuePw GeoMatchConstraintValue = "PW"
GeoMatchConstraintValuePs GeoMatchConstraintValue = "PS"
GeoMatchConstraintValuePa GeoMatchConstraintValue = "PA"
GeoMatchConstraintValuePg GeoMatchConstraintValue = "PG"
GeoMatchConstraintValuePy GeoMatchConstraintValue = "PY"
GeoMatchConstraintValuePe GeoMatchConstraintValue = "PE"
GeoMatchConstraintValuePh GeoMatchConstraintValue = "PH"
GeoMatchConstraintValuePn GeoMatchConstraintValue = "PN"
GeoMatchConstraintValuePl GeoMatchConstraintValue = "PL"
GeoMatchConstraintValuePt GeoMatchConstraintValue = "PT"
GeoMatchConstraintValuePr GeoMatchConstraintValue = "PR"
GeoMatchConstraintValueQa GeoMatchConstraintValue = "QA"
GeoMatchConstraintValueRe GeoMatchConstraintValue = "RE"
GeoMatchConstraintValueRo GeoMatchConstraintValue = "RO"
GeoMatchConstraintValueRu GeoMatchConstraintValue = "RU"
GeoMatchConstraintValueRw GeoMatchConstraintValue = "RW"
GeoMatchConstraintValueBl GeoMatchConstraintValue = "BL"
GeoMatchConstraintValueSh GeoMatchConstraintValue = "SH"
GeoMatchConstraintValueKn GeoMatchConstraintValue = "KN"
GeoMatchConstraintValueLc GeoMatchConstraintValue = "LC"
GeoMatchConstraintValueMf GeoMatchConstraintValue = "MF"
GeoMatchConstraintValuePm GeoMatchConstraintValue = "PM"
GeoMatchConstraintValueVc GeoMatchConstraintValue = "VC"
GeoMatchConstraintValueWs GeoMatchConstraintValue = "WS"
GeoMatchConstraintValueSm GeoMatchConstraintValue = "SM"
GeoMatchConstraintValueSt GeoMatchConstraintValue = "ST"
GeoMatchConstraintValueSa GeoMatchConstraintValue = "SA"
GeoMatchConstraintValueSn GeoMatchConstraintValue = "SN"
GeoMatchConstraintValueRs GeoMatchConstraintValue = "RS"
GeoMatchConstraintValueSc GeoMatchConstraintValue = "SC"
GeoMatchConstraintValueSl GeoMatchConstraintValue = "SL"
GeoMatchConstraintValueSg GeoMatchConstraintValue = "SG"
GeoMatchConstraintValueSx GeoMatchConstraintValue = "SX"
GeoMatchConstraintValueSk GeoMatchConstraintValue = "SK"
GeoMatchConstraintValueSi GeoMatchConstraintValue = "SI"
GeoMatchConstraintValueSb GeoMatchConstraintValue = "SB"
GeoMatchConstraintValueSo GeoMatchConstraintValue = "SO"
GeoMatchConstraintValueZa GeoMatchConstraintValue = "ZA"
GeoMatchConstraintValueGs GeoMatchConstraintValue = "GS"
GeoMatchConstraintValueSs GeoMatchConstraintValue = "SS"
GeoMatchConstraintValueEs GeoMatchConstraintValue = "ES"
GeoMatchConstraintValueLk GeoMatchConstraintValue = "LK"
GeoMatchConstraintValueSd GeoMatchConstraintValue = "SD"
GeoMatchConstraintValueSr GeoMatchConstraintValue = "SR"
GeoMatchConstraintValueSj GeoMatchConstraintValue = "SJ"
GeoMatchConstraintValueSz GeoMatchConstraintValue = "SZ"
GeoMatchConstraintValueSe GeoMatchConstraintValue = "SE"
GeoMatchConstraintValueCh GeoMatchConstraintValue = "CH"
GeoMatchConstraintValueSy GeoMatchConstraintValue = "SY"
GeoMatchConstraintValueTw GeoMatchConstraintValue = "TW"
GeoMatchConstraintValueTj GeoMatchConstraintValue = "TJ"
GeoMatchConstraintValueTz GeoMatchConstraintValue = "TZ"
GeoMatchConstraintValueTh GeoMatchConstraintValue = "TH"
GeoMatchConstraintValueTl GeoMatchConstraintValue = "TL"
GeoMatchConstraintValueTg GeoMatchConstraintValue = "TG"
GeoMatchConstraintValueTk GeoMatchConstraintValue = "TK"
GeoMatchConstraintValueTo GeoMatchConstraintValue = "TO"
GeoMatchConstraintValueTt GeoMatchConstraintValue = "TT"
GeoMatchConstraintValueTn GeoMatchConstraintValue = "TN"
GeoMatchConstraintValueTr GeoMatchConstraintValue = "TR"
GeoMatchConstraintValueTm GeoMatchConstraintValue = "TM"
GeoMatchConstraintValueTc GeoMatchConstraintValue = "TC"
GeoMatchConstraintValueTv GeoMatchConstraintValue = "TV"
GeoMatchConstraintValueUg GeoMatchConstraintValue = "UG"
GeoMatchConstraintValueUa GeoMatchConstraintValue = "UA"
GeoMatchConstraintValueAe GeoMatchConstraintValue = "AE"
GeoMatchConstraintValueGb GeoMatchConstraintValue = "GB"
GeoMatchConstraintValueUs GeoMatchConstraintValue = "US"
GeoMatchConstraintValueUm GeoMatchConstraintValue = "UM"
GeoMatchConstraintValueUy GeoMatchConstraintValue = "UY"
GeoMatchConstraintValueUz GeoMatchConstraintValue = "UZ"
GeoMatchConstraintValueVu GeoMatchConstraintValue = "VU"
GeoMatchConstraintValueVe GeoMatchConstraintValue = "VE"
GeoMatchConstraintValueVn GeoMatchConstraintValue = "VN"
GeoMatchConstraintValueVg GeoMatchConstraintValue = "VG"
GeoMatchConstraintValueVi GeoMatchConstraintValue = "VI"
GeoMatchConstraintValueWf GeoMatchConstraintValue = "WF"
GeoMatchConstraintValueEh GeoMatchConstraintValue = "EH"
GeoMatchConstraintValueYe GeoMatchConstraintValue = "YE"
GeoMatchConstraintValueZm GeoMatchConstraintValue = "ZM"
GeoMatchConstraintValueZw GeoMatchConstraintValue = "ZW"
)
// Values returns all known values for GeoMatchConstraintValue. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (GeoMatchConstraintValue) Values() []GeoMatchConstraintValue {
return []GeoMatchConstraintValue{
"AF",
"AX",
"AL",
"DZ",
"AS",
"AD",
"AO",
"AI",
"AQ",
"AG",
"AR",
"AM",
"AW",
"AU",
"AT",
"AZ",
"BS",
"BH",
"BD",
"BB",
"BY",
"BE",
"BZ",
"BJ",
"BM",
"BT",
"BO",
"BQ",
"BA",
"BW",
"BV",
"BR",
"IO",
"BN",
"BG",
"BF",
"BI",
"KH",
"CM",
"CA",
"CV",
"KY",
"CF",
"TD",
"CL",
"CN",
"CX",
"CC",
"CO",
"KM",
"CG",
"CD",
"CK",
"CR",
"CI",
"HR",
"CU",
"CW",
"CY",
"CZ",
"DK",
"DJ",
"DM",
"DO",
"EC",
"EG",
"SV",
"GQ",
"ER",
"EE",
"ET",
"FK",
"FO",
"FJ",
"FI",
"FR",
"GF",
"PF",
"TF",
"GA",
"GM",
"GE",
"DE",
"GH",
"GI",
"GR",
"GL",
"GD",
"GP",
"GU",
"GT",
"GG",
"GN",
"GW",
"GY",
"HT",
"HM",
"VA",
"HN",
"HK",
"HU",
"IS",
"IN",
"ID",
"IR",
"IQ",
"IE",
"IM",
"IL",
"IT",
"JM",
"JP",
"JE",
"JO",
"KZ",
"KE",
"KI",
"KP",
"KR",
"KW",
"KG",
"LA",
"LV",
"LB",
"LS",
"LR",
"LY",
"LI",
"LT",
"LU",
"MO",
"MK",
"MG",
"MW",
"MY",
"MV",
"ML",
"MT",
"MH",
"MQ",
"MR",
"MU",
"YT",
"MX",
"FM",
"MD",
"MC",
"MN",
"ME",
"MS",
"MA",
"MZ",
"MM",
"NA",
"NR",
"NP",
"NL",
"NC",
"NZ",
"NI",
"NE",
"NG",
"NU",
"NF",
"MP",
"NO",
"OM",
"PK",
"PW",
"PS",
"PA",
"PG",
"PY",
"PE",
"PH",
"PN",
"PL",
"PT",
"PR",
"QA",
"RE",
"RO",
"RU",
"RW",
"BL",
"SH",
"KN",
"LC",
"MF",
"PM",
"VC",
"WS",
"SM",
"ST",
"SA",
"SN",
"RS",
"SC",
"SL",
"SG",
"SX",
"SK",
"SI",
"SB",
"SO",
"ZA",
"GS",
"SS",
"ES",
"LK",
"SD",
"SR",
"SJ",
"SZ",
"SE",
"CH",
"SY",
"TW",
"TJ",
"TZ",
"TH",
"TL",
"TG",
"TK",
"TO",
"TT",
"TN",
"TR",
"TM",
"TC",
"TV",
"UG",
"UA",
"AE",
"GB",
"US",
"UM",
"UY",
"UZ",
"VU",
"VE",
"VN",
"VG",
"VI",
"WF",
"EH",
"YE",
"ZM",
"ZW",
}
}
type IPSetDescriptorType string
// Enum values for IPSetDescriptorType
const (
IPSetDescriptorTypeIpv4 IPSetDescriptorType = "IPV4"
IPSetDescriptorTypeIpv6 IPSetDescriptorType = "IPV6"
)
// Values returns all known values for IPSetDescriptorType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (IPSetDescriptorType) Values() []IPSetDescriptorType {
return []IPSetDescriptorType{
"IPV4",
"IPV6",
}
}
type MatchFieldType string
// Enum values for MatchFieldType
const (
MatchFieldTypeUri MatchFieldType = "URI"
MatchFieldTypeQueryString MatchFieldType = "QUERY_STRING"
MatchFieldTypeHeader MatchFieldType = "HEADER"
MatchFieldTypeMethod MatchFieldType = "METHOD"
MatchFieldTypeBody MatchFieldType = "BODY"
MatchFieldTypeSingleQueryArg MatchFieldType = "SINGLE_QUERY_ARG"
MatchFieldTypeAllQueryArgs MatchFieldType = "ALL_QUERY_ARGS"
)
// Values returns all known values for MatchFieldType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (MatchFieldType) Values() []MatchFieldType {
return []MatchFieldType{
"URI",
"QUERY_STRING",
"HEADER",
"METHOD",
"BODY",
"SINGLE_QUERY_ARG",
"ALL_QUERY_ARGS",
}
}
type MigrationErrorType string
// Enum values for MigrationErrorType
const (
MigrationErrorTypeEntityNotSupported MigrationErrorType = "ENTITY_NOT_SUPPORTED"
MigrationErrorTypeEntityNotFound MigrationErrorType = "ENTITY_NOT_FOUND"
MigrationErrorTypeS3BucketNoPermission MigrationErrorType = "S3_BUCKET_NO_PERMISSION"
MigrationErrorTypeS3BucketNotAccessible MigrationErrorType = "S3_BUCKET_NOT_ACCESSIBLE"
MigrationErrorTypeS3BucketNotFound MigrationErrorType = "S3_BUCKET_NOT_FOUND"
MigrationErrorTypeS3BucketInvalidRegion MigrationErrorType = "S3_BUCKET_INVALID_REGION"
MigrationErrorTypeS3InternalError MigrationErrorType = "S3_INTERNAL_ERROR"
)
// Values returns all known values for MigrationErrorType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (MigrationErrorType) Values() []MigrationErrorType {
return []MigrationErrorType{
"ENTITY_NOT_SUPPORTED",
"ENTITY_NOT_FOUND",
"S3_BUCKET_NO_PERMISSION",
"S3_BUCKET_NOT_ACCESSIBLE",
"S3_BUCKET_NOT_FOUND",
"S3_BUCKET_INVALID_REGION",
"S3_INTERNAL_ERROR",
}
}
type ParameterExceptionField string
// Enum values for ParameterExceptionField
const (
ParameterExceptionFieldChangeAction ParameterExceptionField = "CHANGE_ACTION"
ParameterExceptionFieldWafAction ParameterExceptionField = "WAF_ACTION"
ParameterExceptionFieldWafOverrideAction ParameterExceptionField = "WAF_OVERRIDE_ACTION"
ParameterExceptionFieldPredicateType ParameterExceptionField = "PREDICATE_TYPE"
ParameterExceptionFieldIpsetType ParameterExceptionField = "IPSET_TYPE"
ParameterExceptionFieldByteMatchFieldType ParameterExceptionField = "BYTE_MATCH_FIELD_TYPE"
ParameterExceptionFieldSqlInjectionMatchFieldType ParameterExceptionField = "SQL_INJECTION_MATCH_FIELD_TYPE"
ParameterExceptionFieldByteMatchTextTransformation ParameterExceptionField = "BYTE_MATCH_TEXT_TRANSFORMATION"
ParameterExceptionFieldByteMatchPositionalConstraint ParameterExceptionField = "BYTE_MATCH_POSITIONAL_CONSTRAINT"
ParameterExceptionFieldSizeConstraintComparisonOperator ParameterExceptionField = "SIZE_CONSTRAINT_COMPARISON_OPERATOR"
ParameterExceptionFieldGeoMatchLocationType ParameterExceptionField = "GEO_MATCH_LOCATION_TYPE"
ParameterExceptionFieldGeoMatchLocationValue ParameterExceptionField = "GEO_MATCH_LOCATION_VALUE"
ParameterExceptionFieldRateKey ParameterExceptionField = "RATE_KEY"
ParameterExceptionFieldRuleType ParameterExceptionField = "RULE_TYPE"
ParameterExceptionFieldNextMarker ParameterExceptionField = "NEXT_MARKER"
ParameterExceptionFieldResourceArn ParameterExceptionField = "RESOURCE_ARN"
ParameterExceptionFieldTags ParameterExceptionField = "TAGS"
ParameterExceptionFieldTagKeys ParameterExceptionField = "TAG_KEYS"
)
// Values returns all known values for ParameterExceptionField. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ParameterExceptionField) Values() []ParameterExceptionField {
return []ParameterExceptionField{
"CHANGE_ACTION",
"WAF_ACTION",
"WAF_OVERRIDE_ACTION",
"PREDICATE_TYPE",
"IPSET_TYPE",
"BYTE_MATCH_FIELD_TYPE",
"SQL_INJECTION_MATCH_FIELD_TYPE",
"BYTE_MATCH_TEXT_TRANSFORMATION",
"BYTE_MATCH_POSITIONAL_CONSTRAINT",
"SIZE_CONSTRAINT_COMPARISON_OPERATOR",
"GEO_MATCH_LOCATION_TYPE",
"GEO_MATCH_LOCATION_VALUE",
"RATE_KEY",
"RULE_TYPE",
"NEXT_MARKER",
"RESOURCE_ARN",
"TAGS",
"TAG_KEYS",
}
}
type ParameterExceptionReason string
// Enum values for ParameterExceptionReason
const (
ParameterExceptionReasonInvalidOption ParameterExceptionReason = "INVALID_OPTION"
ParameterExceptionReasonIllegalCombination ParameterExceptionReason = "ILLEGAL_COMBINATION"
ParameterExceptionReasonIllegalArgument ParameterExceptionReason = "ILLEGAL_ARGUMENT"
ParameterExceptionReasonInvalidTagKey ParameterExceptionReason = "INVALID_TAG_KEY"
)
// Values returns all known values for ParameterExceptionReason. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (ParameterExceptionReason) Values() []ParameterExceptionReason {
return []ParameterExceptionReason{
"INVALID_OPTION",
"ILLEGAL_COMBINATION",
"ILLEGAL_ARGUMENT",
"INVALID_TAG_KEY",
}
}
type PositionalConstraint string
// Enum values for PositionalConstraint
const (
PositionalConstraintExactly PositionalConstraint = "EXACTLY"
PositionalConstraintStartsWith PositionalConstraint = "STARTS_WITH"
PositionalConstraintEndsWith PositionalConstraint = "ENDS_WITH"
PositionalConstraintContains PositionalConstraint = "CONTAINS"
PositionalConstraintContainsWord PositionalConstraint = "CONTAINS_WORD"
)
// Values returns all known values for PositionalConstraint. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (PositionalConstraint) Values() []PositionalConstraint {
return []PositionalConstraint{
"EXACTLY",
"STARTS_WITH",
"ENDS_WITH",
"CONTAINS",
"CONTAINS_WORD",
}
}
type PredicateType string
// Enum values for PredicateType
const (
PredicateTypeIpMatch PredicateType = "IPMatch"
PredicateTypeByteMatch PredicateType = "ByteMatch"
PredicateTypeSqlInjectionMatch PredicateType = "SqlInjectionMatch"
PredicateTypeGeoMatch PredicateType = "GeoMatch"
PredicateTypeSizeConstraint PredicateType = "SizeConstraint"
PredicateTypeXssMatch PredicateType = "XssMatch"
PredicateTypeRegexMatch PredicateType = "RegexMatch"
)
// Values returns all known values for PredicateType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (PredicateType) Values() []PredicateType {
return []PredicateType{
"IPMatch",
"ByteMatch",
"SqlInjectionMatch",
"GeoMatch",
"SizeConstraint",
"XssMatch",
"RegexMatch",
}
}
type RateKey string
// Enum values for RateKey
const (
RateKeyIp RateKey = "IP"
)
// Values returns all known values for RateKey. Note that this can be expanded in
// the future, and so it is only as up to date as the client. The ordering of this
// slice is not guaranteed to be stable across updates.
func (RateKey) Values() []RateKey {
return []RateKey{
"IP",
}
}
type ResourceType string
// Enum values for ResourceType
const (
ResourceTypeApplicationLoadBalancer ResourceType = "APPLICATION_LOAD_BALANCER"
ResourceTypeApiGateway ResourceType = "API_GATEWAY"
)
// Values returns all known values for ResourceType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ResourceType) Values() []ResourceType {
return []ResourceType{
"APPLICATION_LOAD_BALANCER",
"API_GATEWAY",
}
}
type TextTransformation string
// Enum values for TextTransformation
const (
TextTransformationNone TextTransformation = "NONE"
TextTransformationCompressWhiteSpace TextTransformation = "COMPRESS_WHITE_SPACE"
TextTransformationHtmlEntityDecode TextTransformation = "HTML_ENTITY_DECODE"
TextTransformationLowercase TextTransformation = "LOWERCASE"
TextTransformationCmdLine TextTransformation = "CMD_LINE"
TextTransformationUrlDecode TextTransformation = "URL_DECODE"
)
// Values returns all known values for TextTransformation. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (TextTransformation) Values() []TextTransformation {
return []TextTransformation{
"NONE",
"COMPRESS_WHITE_SPACE",
"HTML_ENTITY_DECODE",
"LOWERCASE",
"CMD_LINE",
"URL_DECODE",
}
}
type WafActionType string
// Enum values for WafActionType
const (
WafActionTypeBlock WafActionType = "BLOCK"
WafActionTypeAllow WafActionType = "ALLOW"
WafActionTypeCount WafActionType = "COUNT"
)
// Values returns all known values for WafActionType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (WafActionType) Values() []WafActionType {
return []WafActionType{
"BLOCK",
"ALLOW",
"COUNT",
}
}
type WafOverrideActionType string
// Enum values for WafOverrideActionType
const (
WafOverrideActionTypeNone WafOverrideActionType = "NONE"
WafOverrideActionTypeCount WafOverrideActionType = "COUNT"
)
// Values returns all known values for WafOverrideActionType. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (WafOverrideActionType) Values() []WafOverrideActionType {
return []WafOverrideActionType{
"NONE",
"COUNT",
}
}
type WafRuleType string
// Enum values for WafRuleType
const (
WafRuleTypeRegular WafRuleType = "REGULAR"
WafRuleTypeRateBased WafRuleType = "RATE_BASED"
WafRuleTypeGroup WafRuleType = "GROUP"
)
// Values returns all known values for WafRuleType. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (WafRuleType) Values() []WafRuleType {
return []WafRuleType{
"REGULAR",
"RATE_BASED",
"GROUP",
}
}
| 912 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
type WAFBadRequestException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFBadRequestException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFBadRequestException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFBadRequestException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFBadRequestException"
}
return *e.ErrorCodeOverride
}
func (e *WAFBadRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The name specified is invalid.
type WAFDisallowedNameException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFDisallowedNameException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFDisallowedNameException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFDisallowedNameException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFDisallowedNameException"
}
return *e.ErrorCodeOverride
}
func (e *WAFDisallowedNameException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The operation failed due to a problem with the migration. The failure cause is
// provided in the exception, in the MigrationErrorType :
// - ENTITY_NOT_SUPPORTED - The web ACL has an unsupported entity but the
// IgnoreUnsupportedType is not set to true.
// - ENTITY_NOT_FOUND - The web ACL doesn't exist.
// - S3_BUCKET_NO_PERMISSION - You don't have permission to perform the PutObject
// action to the specified Amazon S3 bucket.
// - S3_BUCKET_NOT_ACCESSIBLE - The bucket policy doesn't allow AWS WAF to
// perform the PutObject action in the bucket.
// - S3_BUCKET_NOT_FOUND - The S3 bucket doesn't exist.
// - S3_BUCKET_INVALID_REGION - The S3 bucket is not in the same Region as the
// web ACL.
// - S3_INTERNAL_ERROR - AWS WAF failed to create the template in the S3 bucket
// for another reason.
type WAFEntityMigrationException struct {
Message *string
ErrorCodeOverride *string
MigrationErrorType MigrationErrorType
MigrationErrorReason *string
noSmithyDocumentSerde
}
func (e *WAFEntityMigrationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFEntityMigrationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFEntityMigrationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFEntityMigrationException"
}
return *e.ErrorCodeOverride
}
func (e *WAFEntityMigrationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The operation failed because of a system problem, even though the request was
// valid. Retry your request.
type WAFInternalErrorException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFInternalErrorException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFInternalErrorException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFInternalErrorException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFInternalErrorException"
}
return *e.ErrorCodeOverride
}
func (e *WAFInternalErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The operation failed because you tried to create, update, or delete an object
// by using an invalid account identifier.
type WAFInvalidAccountException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFInvalidAccountException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFInvalidAccountException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFInvalidAccountException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFInvalidAccountException"
}
return *e.ErrorCodeOverride
}
func (e *WAFInvalidAccountException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The operation failed because there was nothing to do. For example:
// - You tried to remove a Rule from a WebACL , but the Rule isn't in the
// specified WebACL .
// - You tried to remove an IP address from an IPSet , but the IP address isn't
// in the specified IPSet .
// - You tried to remove a ByteMatchTuple from a ByteMatchSet , but the
// ByteMatchTuple isn't in the specified WebACL .
// - You tried to add a Rule to a WebACL , but the Rule already exists in the
// specified WebACL .
// - You tried to add a ByteMatchTuple to a ByteMatchSet , but the ByteMatchTuple
// already exists in the specified WebACL .
type WAFInvalidOperationException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFInvalidOperationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFInvalidOperationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFInvalidOperationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFInvalidOperationException"
}
return *e.ErrorCodeOverride
}
func (e *WAFInvalidOperationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The operation failed because AWS WAF didn't recognize a parameter in the
// request. For example:
// - You specified an invalid parameter name.
// - You specified an invalid value.
// - You tried to update an object ( ByteMatchSet , IPSet , Rule , or WebACL )
// using an action other than INSERT or DELETE .
// - You tried to create a WebACL with a DefaultAction Type other than ALLOW ,
// BLOCK , or COUNT .
// - You tried to create a RateBasedRule with a RateKey value other than IP .
// - You tried to update a WebACL with a WafAction Type other than ALLOW , BLOCK
// , or COUNT .
// - You tried to update a ByteMatchSet with a FieldToMatch Type other than
// HEADER, METHOD, QUERY_STRING, URI, or BODY.
// - You tried to update a ByteMatchSet with a Field of HEADER but no value for
// Data .
// - Your request references an ARN that is malformed, or corresponds to a
// resource with which a web ACL cannot be associated.
type WAFInvalidParameterException struct {
Message *string
ErrorCodeOverride *string
Field ParameterExceptionField
Parameter *string
Reason ParameterExceptionReason
noSmithyDocumentSerde
}
func (e *WAFInvalidParameterException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFInvalidParameterException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFInvalidParameterException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFInvalidParameterException"
}
return *e.ErrorCodeOverride
}
func (e *WAFInvalidParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The operation failed because the specified policy is not in the proper format.
// The policy is subject to the following restrictions:
// - You can attach only one policy with each PutPermissionPolicy request.
// - The policy must include an Effect , Action and Principal .
// - Effect must specify Allow .
// - The Action in the policy must be waf:UpdateWebACL ,
// waf-regional:UpdateWebACL , waf:GetRuleGroup and waf-regional:GetRuleGroup .
// Any extra or wildcard actions in the policy will be rejected.
// - The policy cannot include a Resource parameter.
// - The ARN in the request must be a valid WAF RuleGroup ARN and the RuleGroup
// must exist in the same region.
// - The user making the request must be the owner of the RuleGroup.
// - Your policy must be composed using IAM Policy version 2012-10-17.
type WAFInvalidPermissionPolicyException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFInvalidPermissionPolicyException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFInvalidPermissionPolicyException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFInvalidPermissionPolicyException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFInvalidPermissionPolicyException"
}
return *e.ErrorCodeOverride
}
func (e *WAFInvalidPermissionPolicyException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// The regular expression (regex) you specified in RegexPatternString is invalid.
type WAFInvalidRegexPatternException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFInvalidRegexPatternException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFInvalidRegexPatternException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFInvalidRegexPatternException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFInvalidRegexPatternException"
}
return *e.ErrorCodeOverride
}
func (e *WAFInvalidRegexPatternException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The operation exceeds a resource limit, for example, the maximum number of
// WebACL objects that you can create for an AWS account. For more information, see
// Limits (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) in
// the AWS WAF Developer Guide.
type WAFLimitsExceededException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFLimitsExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFLimitsExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFLimitsExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFLimitsExceededException"
}
return *e.ErrorCodeOverride
}
func (e *WAFLimitsExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The operation failed because you tried to delete an object that isn't empty.
// For example:
// - You tried to delete a WebACL that still contains one or more Rule objects.
// - You tried to delete a Rule that still contains one or more ByteMatchSet
// objects or other predicates.
// - You tried to delete a ByteMatchSet that contains one or more ByteMatchTuple
// objects.
// - You tried to delete an IPSet that references one or more IP addresses.
type WAFNonEmptyEntityException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFNonEmptyEntityException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFNonEmptyEntityException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFNonEmptyEntityException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFNonEmptyEntityException"
}
return *e.ErrorCodeOverride
}
func (e *WAFNonEmptyEntityException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The operation failed because you tried to add an object to or delete an object
// from another object that doesn't exist. For example:
// - You tried to add a Rule to or delete a Rule from a WebACL that doesn't
// exist.
// - You tried to add a ByteMatchSet to or delete a ByteMatchSet from a Rule that
// doesn't exist.
// - You tried to add an IP address to or delete an IP address from an IPSet that
// doesn't exist.
// - You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from a
// ByteMatchSet that doesn't exist.
type WAFNonexistentContainerException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFNonexistentContainerException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFNonexistentContainerException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFNonexistentContainerException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFNonexistentContainerException"
}
return *e.ErrorCodeOverride
}
func (e *WAFNonexistentContainerException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The operation failed because the referenced object doesn't exist.
type WAFNonexistentItemException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFNonexistentItemException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFNonexistentItemException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFNonexistentItemException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFNonexistentItemException"
}
return *e.ErrorCodeOverride
}
func (e *WAFNonexistentItemException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The operation failed because you tried to delete an object that is still in
// use. For example:
// - You tried to delete a ByteMatchSet that is still referenced by a Rule .
// - You tried to delete a Rule that is still referenced by a WebACL .
type WAFReferencedItemException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFReferencedItemException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFReferencedItemException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFReferencedItemException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFReferencedItemException"
}
return *e.ErrorCodeOverride
}
func (e *WAFReferencedItemException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// AWS WAF is not able to access the service linked role. This can be caused by a
// previous PutLoggingConfiguration request, which can lock the service linked
// role for about 20 seconds. Please try your request again. The service linked
// role can also be locked by a previous DeleteServiceLinkedRole request, which
// can lock the role for 15 minutes or more. If you recently made a
// DeleteServiceLinkedRole , wait at least 15 minutes and try the request again. If
// you receive this same exception again, you will have to wait additional time
// until the role is unlocked.
type WAFServiceLinkedRoleErrorException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFServiceLinkedRoleErrorException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFServiceLinkedRoleErrorException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFServiceLinkedRoleErrorException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFServiceLinkedRoleErrorException"
}
return *e.ErrorCodeOverride
}
func (e *WAFServiceLinkedRoleErrorException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// The operation failed because you tried to create, update, or delete an object
// by using a change token that has already been used.
type WAFStaleDataException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFStaleDataException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFStaleDataException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFStaleDataException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFStaleDataException"
}
return *e.ErrorCodeOverride
}
func (e *WAFStaleDataException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The specified subscription does not exist.
type WAFSubscriptionNotFoundException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFSubscriptionNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFSubscriptionNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFSubscriptionNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFSubscriptionNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *WAFSubscriptionNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
type WAFTagOperationException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFTagOperationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFTagOperationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFTagOperationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFTagOperationException"
}
return *e.ErrorCodeOverride
}
func (e *WAFTagOperationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
type WAFTagOperationInternalErrorException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFTagOperationInternalErrorException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFTagOperationInternalErrorException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFTagOperationInternalErrorException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFTagOperationInternalErrorException"
}
return *e.ErrorCodeOverride
}
func (e *WAFTagOperationInternalErrorException) ErrorFault() smithy.ErrorFault {
return smithy.FaultServer
}
// The operation failed because the entity referenced is temporarily unavailable.
// Retry your request.
type WAFUnavailableEntityException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFUnavailableEntityException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFUnavailableEntityException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFUnavailableEntityException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFUnavailableEntityException"
}
return *e.ErrorCodeOverride
}
func (e *WAFUnavailableEntityException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 623 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
"time"
)
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. The ActivatedRule object in an UpdateWebACL request specifies a
// Rule that you want to insert or delete, the priority of the Rule in the WebACL ,
// and the action that you want AWS WAF to take when a web request matches the Rule
// ( ALLOW , BLOCK , or COUNT ). To specify whether to insert or delete a Rule ,
// use the Action parameter in the WebACLUpdate data type.
type ActivatedRule struct {
// Specifies the order in which the Rules in a WebACL are evaluated. Rules with a
// lower value for Priority are evaluated before Rules with a higher value. The
// value must be a unique integer. If you add multiple Rules to a WebACL , the
// values don't need to be consecutive.
//
// This member is required.
Priority *int32
// The RuleId for a Rule . You use RuleId to get more information about a Rule
// (see GetRule ), update a Rule (see UpdateRule ), insert a Rule into a WebACL or
// delete a one from a WebACL (see UpdateWebACL ), or delete a Rule from AWS WAF
// (see DeleteRule ). RuleId is returned by CreateRule and by ListRules .
//
// This member is required.
RuleId *string
// Specifies the action that CloudFront or AWS WAF takes when a web request
// matches the conditions in the Rule . Valid values for Action include the
// following:
// - ALLOW : CloudFront responds with the requested object.
// - BLOCK : CloudFront responds with an HTTP 403 (Forbidden) status code.
// - COUNT : AWS WAF increments a counter of requests that match the conditions
// in the rule and then continues to inspect the web request based on the remaining
// rules in the web ACL.
// ActivatedRule|OverrideAction applies only when updating or adding a RuleGroup
// to a WebACL . In this case, you do not use ActivatedRule|Action . For all other
// update requests, ActivatedRule|Action is used instead of
// ActivatedRule|OverrideAction .
Action *WafAction
// An array of rules to exclude from a rule group. This is applicable only when
// the ActivatedRule refers to a RuleGroup . Sometimes it is necessary to
// troubleshoot rule groups that are blocking traffic unexpectedly (false
// positives). One troubleshooting technique is to identify the specific rule
// within the rule group that is blocking the legitimate traffic and then disable
// (exclude) that particular rule. You can exclude rules from both your own rule
// groups and AWS Marketplace rule groups that have been associated with a web ACL.
// Specifying ExcludedRules does not remove those rules from the rule group.
// Rather, it changes the action for the rules to COUNT . Therefore, requests that
// match an ExcludedRule are counted but not blocked. The RuleGroup owner will
// receive COUNT metrics for each ExcludedRule . If you want to exclude rules from
// a rule group that is already associated with a web ACL, perform the following
// steps:
// - Use the AWS WAF logs to identify the IDs of the rules that you want to
// exclude. For more information about the logs, see Logging Web ACL Traffic
// Information (https://docs.aws.amazon.com/waf/latest/developerguide/logging.html)
// .
// - Submit an UpdateWebACL request that has two actions:
// - The first action deletes the existing rule group from the web ACL. That is,
// in the UpdateWebACL request, the first Updates:Action should be DELETE and
// Updates:ActivatedRule:RuleId should be the rule group that contains the rules
// that you want to exclude.
// - The second action inserts the same rule group back in, but specifying the
// rules to exclude. That is, the second Updates:Action should be INSERT ,
// Updates:ActivatedRule:RuleId should be the rule group that you just removed,
// and ExcludedRules should contain the rules that you want to exclude.
ExcludedRules []ExcludedRule
// Use the OverrideAction to test your RuleGroup . Any rule in a RuleGroup can
// potentially block a request. If you set the OverrideAction to None , the
// RuleGroup will block a request if any individual rule in the RuleGroup matches
// the request and is configured to block that request. However if you first want
// to test the RuleGroup , set the OverrideAction to Count . The RuleGroup will
// then override any block action specified by individual rules contained within
// the group. Instead of blocking matching requests, those requests will be
// counted. You can view a record of counted requests using GetSampledRequests .
// ActivatedRule|OverrideAction applies only when updating or adding a RuleGroup
// to a WebACL . In this case you do not use ActivatedRule|Action . For all other
// update requests, ActivatedRule|Action is used instead of
// ActivatedRule|OverrideAction .
OverrideAction *WafOverrideAction
// The rule type, either REGULAR , as defined by Rule , RATE_BASED , as defined by
// RateBasedRule , or GROUP , as defined by RuleGroup . The default is REGULAR.
// Although this field is optional, be aware that if you try to add a RATE_BASED
// rule to a web ACL without setting the type, the UpdateWebACL request will fail
// because the request tries to add a REGULAR rule with the specified ID, which
// does not exist.
Type WafRuleType
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. In a GetByteMatchSet request, ByteMatchSet is a complex type
// that contains the ByteMatchSetId and Name of a ByteMatchSet , and the values
// that you specified when you updated the ByteMatchSet . A complex type that
// contains ByteMatchTuple objects, which specify the parts of web requests that
// you want AWS WAF to inspect and the values that you want AWS WAF to search for.
// If a ByteMatchSet contains more than one ByteMatchTuple object, a request needs
// to match the settings in only one ByteMatchTuple to be considered a match.
type ByteMatchSet struct {
// The ByteMatchSetId for a ByteMatchSet . You use ByteMatchSetId to get
// information about a ByteMatchSet (see GetByteMatchSet ), update a ByteMatchSet
// (see UpdateByteMatchSet ), insert a ByteMatchSet into a Rule or delete one from
// a Rule (see UpdateRule ), and delete a ByteMatchSet from AWS WAF (see
// DeleteByteMatchSet ). ByteMatchSetId is returned by CreateByteMatchSet and by
// ListByteMatchSets .
//
// This member is required.
ByteMatchSetId *string
// Specifies the bytes (typically a string that corresponds with ASCII characters)
// that you want AWS WAF to search for in web requests, the location in requests
// that you want AWS WAF to search, and other settings.
//
// This member is required.
ByteMatchTuples []ByteMatchTuple
// A friendly name or description of the ByteMatchSet . You can't change Name
// after you create a ByteMatchSet .
Name *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Returned by ListByteMatchSets . Each ByteMatchSetSummary object
// includes the Name and ByteMatchSetId for one ByteMatchSet .
type ByteMatchSetSummary struct {
// The ByteMatchSetId for a ByteMatchSet . You use ByteMatchSetId to get
// information about a ByteMatchSet , update a ByteMatchSet , remove a ByteMatchSet
// from a Rule , and delete a ByteMatchSet from AWS WAF. ByteMatchSetId is
// returned by CreateByteMatchSet and by ListByteMatchSets .
//
// This member is required.
ByteMatchSetId *string
// A friendly name or description of the ByteMatchSet . You can't change Name
// after you create a ByteMatchSet .
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. In an UpdateByteMatchSet request, ByteMatchSetUpdate specifies
// whether to insert or delete a ByteMatchTuple and includes the settings for the
// ByteMatchTuple .
type ByteMatchSetUpdate struct {
// Specifies whether to insert or delete a ByteMatchTuple .
//
// This member is required.
Action ChangeAction
// Information about the part of a web request that you want AWS WAF to inspect
// and the value that you want AWS WAF to search for. If you specify DELETE for
// the value of Action , the ByteMatchTuple values must exactly match the values
// in the ByteMatchTuple that you want to delete from the ByteMatchSet .
//
// This member is required.
ByteMatchTuple *ByteMatchTuple
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. The bytes (typically a string that corresponds with ASCII
// characters) that you want AWS WAF to search for in web requests, the location in
// requests that you want AWS WAF to search, and other settings.
type ByteMatchTuple struct {
// The part of a web request that you want AWS WAF to search, such as a specified
// header or a query string. For more information, see FieldToMatch .
//
// This member is required.
FieldToMatch *FieldToMatch
// Within the portion of a web request that you want to search (for example, in
// the query string, if any), specify where you want AWS WAF to search. Valid
// values include the following: CONTAINS The specified part of the web request
// must include the value of TargetString , but the location doesn't matter.
// CONTAINS_WORD The specified part of the web request must include the value of
// TargetString , and TargetString must contain only alphanumeric characters or
// underscore (A-Z, a-z, 0-9, or _). In addition, TargetString must be a word,
// which means one of the following:
// - TargetString exactly matches the value of the specified part of the web
// request, such as the value of a header.
// - TargetString is at the beginning of the specified part of the web request
// and is followed by a character other than an alphanumeric character or
// underscore (_), for example, BadBot; .
// - TargetString is at the end of the specified part of the web request and is
// preceded by a character other than an alphanumeric character or underscore (_),
// for example, ;BadBot .
// - TargetString is in the middle of the specified part of the web request and
// is preceded and followed by characters other than alphanumeric characters or
// underscore (_), for example, -BadBot; .
// EXACTLY The value of the specified part of the web request must exactly match
// the value of TargetString . STARTS_WITH The value of TargetString must appear
// at the beginning of the specified part of the web request. ENDS_WITH The value
// of TargetString must appear at the end of the specified part of the web request.
//
// This member is required.
PositionalConstraint PositionalConstraint
// The value that you want AWS WAF to search for. AWS WAF searches for the
// specified string in the part of web requests that you specified in FieldToMatch
// . The maximum length of the value is 50 bytes. Valid values depend on the values
// that you specified for FieldToMatch :
// - HEADER : The value that you want AWS WAF to search for in the request header
// that you specified in FieldToMatch , for example, the value of the User-Agent
// or Referer header.
// - METHOD : The HTTP method, which indicates the type of operation specified in
// the request. CloudFront supports the following methods: DELETE , GET , HEAD ,
// OPTIONS , PATCH , POST , and PUT .
// - QUERY_STRING : The value that you want AWS WAF to search for in the query
// string, which is the part of a URL that appears after a ? character.
// - URI : The value that you want AWS WAF to search for in the part of a URL
// that identifies a resource, for example, /images/daily-ad.jpg .
// - BODY : The part of a request that contains any additional data that you want
// to send to your web server as the HTTP request body, such as data from a form.
// The request body immediately follows the request headers. Note that only the
// first 8192 bytes of the request body are forwarded to AWS WAF for inspection.
// To allow or block requests based on the length of the body, you can create a
// size constraint set. For more information, see CreateSizeConstraintSet .
// - SINGLE_QUERY_ARG : The parameter in the query string that you will inspect,
// such as UserName or SalesRegion. The maximum length for SINGLE_QUERY_ARG is 30
// characters.
// - ALL_QUERY_ARGS : Similar to SINGLE_QUERY_ARG , but instead of inspecting a
// single parameter, AWS WAF inspects all parameters within the query string for
// the value or regex pattern that you specify in TargetString .
// If TargetString includes alphabetic characters A-Z and a-z, note that the value
// is case sensitive. If you're using the AWS WAF API Specify a base64-encoded
// version of the value. The maximum length of the value before you base64-encode
// it is 50 bytes. For example, suppose the value of Type is HEADER and the value
// of Data is User-Agent . If you want to search the User-Agent header for the
// value BadBot , you base64-encode BadBot using MIME base64-encoding and include
// the resulting value, QmFkQm90 , in the value of TargetString . If you're using
// the AWS CLI or one of the AWS SDKs The value that you want AWS WAF to search
// for. The SDK automatically base64 encodes the value.
//
// This member is required.
TargetString []byte
// Text transformations eliminate some of the unusual formatting that attackers
// use in web requests in an effort to bypass AWS WAF. If you specify a
// transformation, AWS WAF performs the transformation on FieldToMatch before
// inspecting it for a match. You can only specify a single type of
// TextTransformation. CMD_LINE When you're concerned that attackers are injecting
// an operating system command line command and using unusual formatting to
// disguise some or all of the command, use this option to perform the following
// transformations:
// - Delete the following characters: \ " ' ^
// - Delete spaces before the following characters: / (
// - Replace the following characters with a space: , ;
// - Replace multiple spaces with one space
// - Convert uppercase letters (A-Z) to lowercase (a-z)
// COMPRESS_WHITE_SPACE Use this option to replace the following characters with a
// space character (decimal 32):
// - \f, formfeed, decimal 12
// - \t, tab, decimal 9
// - \n, newline, decimal 10
// - \r, carriage return, decimal 13
// - \v, vertical tab, decimal 11
// - non-breaking space, decimal 160
// COMPRESS_WHITE_SPACE also replaces multiple spaces with one space.
// HTML_ENTITY_DECODE Use this option to replace HTML-encoded characters with
// unencoded characters. HTML_ENTITY_DECODE performs the following operations:
// - Replaces (ampersand)quot; with "
// - Replaces (ampersand)nbsp; with a non-breaking space, decimal 160
// - Replaces (ampersand)lt; with a "less than" symbol
// - Replaces (ampersand)gt; with >
// - Replaces characters that are represented in hexadecimal format,
// (ampersand)#xhhhh; , with the corresponding characters
// - Replaces characters that are represented in decimal format,
// (ampersand)#nnnn; , with the corresponding characters
// LOWERCASE Use this option to convert uppercase letters (A-Z) to lowercase
// (a-z). URL_DECODE Use this option to decode a URL-encoded value. NONE Specify
// NONE if you don't want to perform any text transformations.
//
// This member is required.
TextTransformation TextTransformation
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. The rule to exclude from a rule group. This is applicable only
// when the ActivatedRule refers to a RuleGroup . The rule must belong to the
// RuleGroup that is specified by the ActivatedRule .
type ExcludedRule struct {
// The unique identifier for the rule to exclude from the rule group.
//
// This member is required.
RuleId *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Specifies where in a web request to look for TargetString .
type FieldToMatch struct {
// The part of the web request that you want AWS WAF to search for a specified
// string. Parts of a request that you can search include the following:
// - HEADER : A specified request header, for example, the value of the
// User-Agent or Referer header. If you choose HEADER for the type, specify the
// name of the header in Data .
// - METHOD : The HTTP method, which indicated the type of operation that the
// request is asking the origin to perform. Amazon CloudFront supports the
// following methods: DELETE , GET , HEAD , OPTIONS , PATCH , POST , and PUT .
// - QUERY_STRING : A query string, which is the part of a URL that appears after
// a ? character, if any.
// - URI : The part of a web request that identifies a resource, for example,
// /images/daily-ad.jpg .
// - BODY : The part of a request that contains any additional data that you want
// to send to your web server as the HTTP request body, such as data from a form.
// The request body immediately follows the request headers. Note that only the
// first 8192 bytes of the request body are forwarded to AWS WAF for inspection.
// To allow or block requests based on the length of the body, you can create a
// size constraint set. For more information, see CreateSizeConstraintSet .
// - SINGLE_QUERY_ARG : The parameter in the query string that you will inspect,
// such as UserName or SalesRegion. The maximum length for SINGLE_QUERY_ARG is 30
// characters.
// - ALL_QUERY_ARGS : Similar to SINGLE_QUERY_ARG , but rather than inspecting a
// single parameter, AWS WAF will inspect all parameters within the query for the
// value or regex pattern that you specify in TargetString .
//
// This member is required.
Type MatchFieldType
// When the value of Type is HEADER , enter the name of the header that you want
// AWS WAF to search, for example, User-Agent or Referer . The name of the header
// is not case sensitive. When the value of Type is SINGLE_QUERY_ARG , enter the
// name of the parameter that you want AWS WAF to search, for example, UserName or
// SalesRegion . The parameter name is not case sensitive. If the value of Type is
// any other value, omit Data .
Data *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. The country from which web requests originate that you want AWS
// WAF to search for.
type GeoMatchConstraint struct {
// The type of geographical area you want AWS WAF to search for. Currently Country
// is the only valid value.
//
// This member is required.
Type GeoMatchConstraintType
// The country that you want AWS WAF to search for.
//
// This member is required.
Value GeoMatchConstraintValue
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Contains one or more countries that AWS WAF will search for.
type GeoMatchSet struct {
// An array of GeoMatchConstraint objects, which contain the country that you want
// AWS WAF to search for.
//
// This member is required.
GeoMatchConstraints []GeoMatchConstraint
// The GeoMatchSetId for an GeoMatchSet . You use GeoMatchSetId to get information
// about a GeoMatchSet (see GeoMatchSet ), update a GeoMatchSet (see
// UpdateGeoMatchSet ), insert a GeoMatchSet into a Rule or delete one from a Rule
// (see UpdateRule ), and delete a GeoMatchSet from AWS WAF (see DeleteGeoMatchSet
// ). GeoMatchSetId is returned by CreateGeoMatchSet and by ListGeoMatchSets .
//
// This member is required.
GeoMatchSetId *string
// A friendly name or description of the GeoMatchSet . You can't change the name of
// an GeoMatchSet after you create it.
Name *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Contains the identifier and the name of the GeoMatchSet .
type GeoMatchSetSummary struct {
// The GeoMatchSetId for an GeoMatchSet . You can use GeoMatchSetId in a
// GetGeoMatchSet request to get detailed information about an GeoMatchSet .
//
// This member is required.
GeoMatchSetId *string
// A friendly name or description of the GeoMatchSet . You can't change the name of
// an GeoMatchSet after you create it.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Specifies the type of update to perform to an GeoMatchSet with
// UpdateGeoMatchSet .
type GeoMatchSetUpdate struct {
// Specifies whether to insert or delete a country with UpdateGeoMatchSet .
//
// This member is required.
Action ChangeAction
// The country from which web requests originate that you want AWS WAF to search
// for.
//
// This member is required.
GeoMatchConstraint *GeoMatchConstraint
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. The response from a GetSampledRequests request includes an
// HTTPHeader complex type that appears as Headers in the response syntax.
// HTTPHeader contains the names and values of all of the headers that appear in
// one of the web requests that were returned by GetSampledRequests .
type HTTPHeader struct {
// The name of one of the headers in the sampled web request.
Name *string
// The value of one of the headers in the sampled web request.
Value *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. The response from a GetSampledRequests request includes an
// HTTPRequest complex type that appears as Request in the response syntax.
// HTTPRequest contains information about one of the web requests that were
// returned by GetSampledRequests .
type HTTPRequest struct {
// The IP address that the request originated from. If the WebACL is associated
// with a CloudFront distribution, this is the value of one of the following fields
// in CloudFront access logs:
// - c-ip , if the viewer did not use an HTTP proxy or a load balancer to send
// the request
// - x-forwarded-for , if the viewer did use an HTTP proxy or a load balancer to
// send the request
ClientIP *string
// The two-letter country code for the country that the request originated from.
// For a current list of country codes, see the Wikipedia entry ISO 3166-1 alpha-2 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
// .
Country *string
// The HTTP version specified in the sampled web request, for example, HTTP/1.1 .
HTTPVersion *string
// A complex type that contains two values for each header in the sampled web
// request: the name of the header and the value of the header.
Headers []HTTPHeader
// The HTTP method specified in the sampled web request. CloudFront supports the
// following methods: DELETE , GET , HEAD , OPTIONS , PATCH , POST , and PUT .
Method *string
// The part of a web request that identifies the resource, for example,
// /images/daily-ad.jpg .
URI *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Contains one or more IP addresses or blocks of IP addresses
// specified in Classless Inter-Domain Routing (CIDR) notation. AWS WAF supports
// IPv4 address ranges: /8 and any range between /16 through /32. AWS WAF supports
// IPv6 address ranges: /24, /32, /48, /56, /64, and /128. To specify an individual
// IP address, you specify the four-part IP address followed by a /32 , for
// example, 192.0.2.0/32. To block a range of IP addresses, you can specify /8 or
// any range between /16 through /32 (for IPv4) or /24, /32, /48, /56, /64, or /128
// (for IPv6). For more information about CIDR notation, see the Wikipedia entry
// Classless Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
// .
type IPSet struct {
// The IP address type ( IPV4 or IPV6 ) and the IP address range (in CIDR notation)
// that web requests originate from. If the WebACL is associated with a CloudFront
// distribution and the viewer did not use an HTTP proxy or a load balancer to send
// the request, this is the value of the c-ip field in the CloudFront access logs.
//
// This member is required.
IPSetDescriptors []IPSetDescriptor
// The IPSetId for an IPSet . You use IPSetId to get information about an IPSet
// (see GetIPSet ), update an IPSet (see UpdateIPSet ), insert an IPSet into a Rule
// or delete one from a Rule (see UpdateRule ), and delete an IPSet from AWS WAF
// (see DeleteIPSet ). IPSetId is returned by CreateIPSet and by ListIPSets .
//
// This member is required.
IPSetId *string
// A friendly name or description of the IPSet . You can't change the name of an
// IPSet after you create it.
Name *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Specifies the IP address type ( IPV4 or IPV6 ) and the IP
// address range (in CIDR format) that web requests originate from.
type IPSetDescriptor struct {
// Specify IPV4 or IPV6 .
//
// This member is required.
Type IPSetDescriptorType
// Specify an IPv4 address by using CIDR notation. For example:
// - To configure AWS WAF to allow, block, or count requests that originated
// from the IP address 192.0.2.44, specify 192.0.2.44/32 .
// - To configure AWS WAF to allow, block, or count requests that originated
// from IP addresses from 192.0.2.0 to 192.0.2.255, specify 192.0.2.0/24 .
// For more information about CIDR notation, see the Wikipedia entry Classless
// Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
// . Specify an IPv6 address by using CIDR notation. For example:
// - To configure AWS WAF to allow, block, or count requests that originated
// from the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify
// 1111:0000:0000:0000:0000:0000:0000:0111/128 .
// - To configure AWS WAF to allow, block, or count requests that originated
// from IP addresses 1111:0000:0000:0000:0000:0000:0000:0000 to
// 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify
// 1111:0000:0000:0000:0000:0000:0000:0000/64 .
//
// This member is required.
Value *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Contains the identifier and the name of the IPSet .
type IPSetSummary struct {
// The IPSetId for an IPSet . You can use IPSetId in a GetIPSet request to get
// detailed information about an IPSet .
//
// This member is required.
IPSetId *string
// A friendly name or description of the IPSet . You can't change the name of an
// IPSet after you create it.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Specifies the type of update to perform to an IPSet with
// UpdateIPSet .
type IPSetUpdate struct {
// Specifies whether to insert or delete an IP address with UpdateIPSet .
//
// This member is required.
Action ChangeAction
// The IP address type ( IPV4 or IPV6 ) and the IP address range (in CIDR notation)
// that web requests originate from.
//
// This member is required.
IPSetDescriptor *IPSetDescriptor
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. The Amazon Kinesis Data Firehose, RedactedFields information,
// and the web ACL Amazon Resource Name (ARN).
type LoggingConfiguration struct {
// An array of Amazon Kinesis Data Firehose ARNs.
//
// This member is required.
LogDestinationConfigs []string
// The Amazon Resource Name (ARN) of the web ACL that you want to associate with
// LogDestinationConfigs .
//
// This member is required.
ResourceArn *string
// The parts of the request that you want redacted from the logs. For example, if
// you redact the cookie field, the cookie field in the firehose will be xxx .
RedactedFields []FieldToMatch
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Specifies the ByteMatchSet , IPSet , SqlInjectionMatchSet ,
// XssMatchSet , RegexMatchSet , GeoMatchSet , and SizeConstraintSet objects that
// you want to add to a Rule and, for each object, indicates whether you want to
// negate the settings, for example, requests that do NOT originate from the IP
// address 192.0.2.44.
type Predicate struct {
// A unique identifier for a predicate in a Rule , such as ByteMatchSetId or
// IPSetId . The ID is returned by the corresponding Create or List command.
//
// This member is required.
DataId *string
// Set Negated to False if you want AWS WAF to allow, block, or count requests
// based on the settings in the specified ByteMatchSet , IPSet ,
// SqlInjectionMatchSet , XssMatchSet , RegexMatchSet , GeoMatchSet , or
// SizeConstraintSet . For example, if an IPSet includes the IP address 192.0.2.44
// , AWS WAF will allow or block requests based on that IP address. Set Negated to
// True if you want AWS WAF to allow or block a request based on the negation of
// the settings in the ByteMatchSet , IPSet , SqlInjectionMatchSet , XssMatchSet ,
// RegexMatchSet , GeoMatchSet , or SizeConstraintSet . For example, if an IPSet
// includes the IP address 192.0.2.44 , AWS WAF will allow, block, or count
// requests based on all IP addresses except 192.0.2.44 .
//
// This member is required.
Negated *bool
// The type of predicate in a Rule , such as ByteMatch or IPSet .
//
// This member is required.
Type PredicateType
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. A RateBasedRule is identical to a regular Rule , with one
// addition: a RateBasedRule counts the number of requests that arrive from a
// specified IP address every five minutes. For example, based on recent requests
// that you've seen from an attacker, you might create a RateBasedRule that
// includes the following conditions:
// - The requests come from 192.0.2.44.
// - They contain the value BadBot in the User-Agent header.
//
// In the rule, you also define the rate limit as 1,000. Requests that meet both
// of these conditions and exceed 1,000 requests every five minutes trigger the
// rule's action (block or count), which is defined in the web ACL.
type RateBasedRule struct {
// The Predicates object contains one Predicate element for each ByteMatchSet ,
// IPSet , or SqlInjectionMatchSet object that you want to include in a
// RateBasedRule .
//
// This member is required.
MatchPredicates []Predicate
// The field that AWS WAF uses to determine if requests are likely arriving from
// single source and thus subject to rate monitoring. The only valid value for
// RateKey is IP . IP indicates that requests arriving from the same IP address
// are subject to the RateLimit that is specified in the RateBasedRule .
//
// This member is required.
RateKey RateKey
// The maximum number of requests, which have an identical value in the field
// specified by the RateKey , allowed in a five-minute period. If the number of
// requests exceeds the RateLimit and the other predicates specified in the rule
// are also met, AWS WAF triggers the action that is specified for this rule.
//
// This member is required.
RateLimit int64
// A unique identifier for a RateBasedRule . You use RuleId to get more
// information about a RateBasedRule (see GetRateBasedRule ), update a
// RateBasedRule (see UpdateRateBasedRule ), insert a RateBasedRule into a WebACL
// or delete one from a WebACL (see UpdateWebACL ), or delete a RateBasedRule from
// AWS WAF (see DeleteRateBasedRule ).
//
// This member is required.
RuleId *string
// A friendly name or description for the metrics for a RateBasedRule . The name
// can contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum length
// 128 and minimum length one. It can't contain whitespace or metric names reserved
// for AWS WAF, including "All" and "Default_Action." You can't change the name of
// the metric after you create the RateBasedRule .
MetricName *string
// A friendly name or description for a RateBasedRule . You can't change the name
// of a RateBasedRule after you create it.
Name *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. In a GetRegexMatchSet request, RegexMatchSet is a complex type
// that contains the RegexMatchSetId and Name of a RegexMatchSet , and the values
// that you specified when you updated the RegexMatchSet . The values are contained
// in a RegexMatchTuple object, which specify the parts of web requests that you
// want AWS WAF to inspect and the values that you want AWS WAF to search for. If a
// RegexMatchSet contains more than one RegexMatchTuple object, a request needs to
// match the settings in only one ByteMatchTuple to be considered a match.
type RegexMatchSet struct {
// A friendly name or description of the RegexMatchSet . You can't change Name
// after you create a RegexMatchSet .
Name *string
// The RegexMatchSetId for a RegexMatchSet . You use RegexMatchSetId to get
// information about a RegexMatchSet (see GetRegexMatchSet ), update a
// RegexMatchSet (see UpdateRegexMatchSet ), insert a RegexMatchSet into a Rule or
// delete one from a Rule (see UpdateRule ), and delete a RegexMatchSet from AWS
// WAF (see DeleteRegexMatchSet ). RegexMatchSetId is returned by
// CreateRegexMatchSet and by ListRegexMatchSets .
RegexMatchSetId *string
// Contains an array of RegexMatchTuple objects. Each RegexMatchTuple object
// contains:
// - The part of a web request that you want AWS WAF to inspect, such as a query
// string or the value of the User-Agent header.
// - The identifier of the pattern (a regular expression) that you want AWS WAF
// to look for. For more information, see RegexPatternSet .
// - Whether to perform any conversions on the request, such as converting it to
// lowercase, before inspecting it for the specified string.
RegexMatchTuples []RegexMatchTuple
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Returned by ListRegexMatchSets . Each RegexMatchSetSummary
// object includes the Name and RegexMatchSetId for one RegexMatchSet .
type RegexMatchSetSummary struct {
// A friendly name or description of the RegexMatchSet . You can't change Name
// after you create a RegexMatchSet .
//
// This member is required.
Name *string
// The RegexMatchSetId for a RegexMatchSet . You use RegexMatchSetId to get
// information about a RegexMatchSet , update a RegexMatchSet , remove a
// RegexMatchSet from a Rule , and delete a RegexMatchSet from AWS WAF.
// RegexMatchSetId is returned by CreateRegexMatchSet and by ListRegexMatchSets .
//
// This member is required.
RegexMatchSetId *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. In an UpdateRegexMatchSet request, RegexMatchSetUpdate
// specifies whether to insert or delete a RegexMatchTuple and includes the
// settings for the RegexMatchTuple .
type RegexMatchSetUpdate struct {
// Specifies whether to insert or delete a RegexMatchTuple .
//
// This member is required.
Action ChangeAction
// Information about the part of a web request that you want AWS WAF to inspect
// and the identifier of the regular expression (regex) pattern that you want AWS
// WAF to search for. If you specify DELETE for the value of Action , the
// RegexMatchTuple values must exactly match the values in the RegexMatchTuple
// that you want to delete from the RegexMatchSet .
//
// This member is required.
RegexMatchTuple *RegexMatchTuple
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. The regular expression pattern that you want AWS WAF to search
// for in web requests, the location in requests that you want AWS WAF to search,
// and other settings. Each RegexMatchTuple object contains:
// - The part of a web request that you want AWS WAF to inspect, such as a query
// string or the value of the User-Agent header.
// - The identifier of the pattern (a regular expression) that you want AWS WAF
// to look for. For more information, see RegexPatternSet .
// - Whether to perform any conversions on the request, such as converting it to
// lowercase, before inspecting it for the specified string.
type RegexMatchTuple struct {
// Specifies where in a web request to look for the RegexPatternSet .
//
// This member is required.
FieldToMatch *FieldToMatch
// The RegexPatternSetId for a RegexPatternSet . You use RegexPatternSetId to get
// information about a RegexPatternSet (see GetRegexPatternSet ), update a
// RegexPatternSet (see UpdateRegexPatternSet ), insert a RegexPatternSet into a
// RegexMatchSet or delete one from a RegexMatchSet (see UpdateRegexMatchSet ), and
// delete an RegexPatternSet from AWS WAF (see DeleteRegexPatternSet ).
// RegexPatternSetId is returned by CreateRegexPatternSet and by
// ListRegexPatternSets .
//
// This member is required.
RegexPatternSetId *string
// Text transformations eliminate some of the unusual formatting that attackers
// use in web requests in an effort to bypass AWS WAF. If you specify a
// transformation, AWS WAF performs the transformation on RegexPatternSet before
// inspecting a request for a match. You can only specify a single type of
// TextTransformation. CMD_LINE When you're concerned that attackers are injecting
// an operating system commandline command and using unusual formatting to disguise
// some or all of the command, use this option to perform the following
// transformations:
// - Delete the following characters: \ " ' ^
// - Delete spaces before the following characters: / (
// - Replace the following characters with a space: , ;
// - Replace multiple spaces with one space
// - Convert uppercase letters (A-Z) to lowercase (a-z)
// COMPRESS_WHITE_SPACE Use this option to replace the following characters with a
// space character (decimal 32):
// - \f, formfeed, decimal 12
// - \t, tab, decimal 9
// - \n, newline, decimal 10
// - \r, carriage return, decimal 13
// - \v, vertical tab, decimal 11
// - non-breaking space, decimal 160
// COMPRESS_WHITE_SPACE also replaces multiple spaces with one space.
// HTML_ENTITY_DECODE Use this option to replace HTML-encoded characters with
// unencoded characters. HTML_ENTITY_DECODE performs the following operations:
// - Replaces (ampersand)quot; with "
// - Replaces (ampersand)nbsp; with a non-breaking space, decimal 160
// - Replaces (ampersand)lt; with a "less than" symbol
// - Replaces (ampersand)gt; with >
// - Replaces characters that are represented in hexadecimal format,
// (ampersand)#xhhhh; , with the corresponding characters
// - Replaces characters that are represented in decimal format,
// (ampersand)#nnnn; , with the corresponding characters
// LOWERCASE Use this option to convert uppercase letters (A-Z) to lowercase
// (a-z). URL_DECODE Use this option to decode a URL-encoded value. NONE Specify
// NONE if you don't want to perform any text transformations.
//
// This member is required.
TextTransformation TextTransformation
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. The RegexPatternSet specifies the regular expression (regex)
// pattern that you want AWS WAF to search for, such as B[a@]dB[o0]t . You can then
// configure AWS WAF to reject those requests.
type RegexPatternSet struct {
// The identifier for the RegexPatternSet . You use RegexPatternSetId to get
// information about a RegexPatternSet , update a RegexPatternSet , remove a
// RegexPatternSet from a RegexMatchSet , and delete a RegexPatternSet from AWS
// WAF. RegexMatchSetId is returned by CreateRegexPatternSet and by
// ListRegexPatternSets .
//
// This member is required.
RegexPatternSetId *string
// Specifies the regular expression (regex) patterns that you want AWS WAF to
// search for, such as B[a@]dB[o0]t .
//
// This member is required.
RegexPatternStrings []string
// A friendly name or description of the RegexPatternSet . You can't change Name
// after you create a RegexPatternSet .
Name *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Returned by ListRegexPatternSets . Each RegexPatternSetSummary
// object includes the Name and RegexPatternSetId for one RegexPatternSet .
type RegexPatternSetSummary struct {
// A friendly name or description of the RegexPatternSet . You can't change Name
// after you create a RegexPatternSet .
//
// This member is required.
Name *string
// The RegexPatternSetId for a RegexPatternSet . You use RegexPatternSetId to get
// information about a RegexPatternSet , update a RegexPatternSet , remove a
// RegexPatternSet from a RegexMatchSet , and delete a RegexPatternSet from AWS
// WAF. RegexPatternSetId is returned by CreateRegexPatternSet and by
// ListRegexPatternSets .
//
// This member is required.
RegexPatternSetId *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. In an UpdateRegexPatternSet request, RegexPatternSetUpdate
// specifies whether to insert or delete a RegexPatternString and includes the
// settings for the RegexPatternString .
type RegexPatternSetUpdate struct {
// Specifies whether to insert or delete a RegexPatternString .
//
// This member is required.
Action ChangeAction
// Specifies the regular expression (regex) pattern that you want AWS WAF to
// search for, such as B[a@]dB[o0]t .
//
// This member is required.
RegexPatternString *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. A combination of ByteMatchSet , IPSet , and/or
// SqlInjectionMatchSet objects that identify the web requests that you want to
// allow, block, or count. For example, you might create a Rule that includes the
// following predicates:
// - An IPSet that causes AWS WAF to search for web requests that originate from
// the IP address 192.0.2.44
// - A ByteMatchSet that causes AWS WAF to search for web requests for which the
// value of the User-Agent header is BadBot .
//
// To match the settings in this Rule , a request must originate from 192.0.2.44
// AND include a User-Agent header for which the value is BadBot .
type Rule struct {
// The Predicates object contains one Predicate element for each ByteMatchSet ,
// IPSet , or SqlInjectionMatchSet object that you want to include in a Rule .
//
// This member is required.
Predicates []Predicate
// A unique identifier for a Rule . You use RuleId to get more information about a
// Rule (see GetRule ), update a Rule (see UpdateRule ), insert a Rule into a
// WebACL or delete a one from a WebACL (see UpdateWebACL ), or delete a Rule from
// AWS WAF (see DeleteRule ). RuleId is returned by CreateRule and by ListRules .
//
// This member is required.
RuleId *string
// A friendly name or description for the metrics for this Rule . The name can
// contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum length 128
// and minimum length one. It can't contain whitespace or metric names reserved for
// AWS WAF, including "All" and "Default_Action." You can't change MetricName
// after you create the Rule .
MetricName *string
// The friendly name or description for the Rule . You can't change the name of a
// Rule after you create it.
Name *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. A collection of predefined rules that you can add to a web ACL.
// Rule groups are subject to the following limits:
// - Three rule groups per account. You can request an increase to this limit by
// contacting customer support.
// - One rule group per web ACL.
// - Ten rules per rule group.
type RuleGroup struct {
// A unique identifier for a RuleGroup . You use RuleGroupId to get more
// information about a RuleGroup (see GetRuleGroup ), update a RuleGroup (see
// UpdateRuleGroup ), insert a RuleGroup into a WebACL or delete a one from a
// WebACL (see UpdateWebACL ), or delete a RuleGroup from AWS WAF (see
// DeleteRuleGroup ). RuleGroupId is returned by CreateRuleGroup and by
// ListRuleGroups .
//
// This member is required.
RuleGroupId *string
// A friendly name or description for the metrics for this RuleGroup . The name can
// contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum length 128
// and minimum length one. It can't contain whitespace or metric names reserved for
// AWS WAF, including "All" and "Default_Action." You can't change the name of the
// metric after you create the RuleGroup .
MetricName *string
// The friendly name or description for the RuleGroup . You can't change the name
// of a RuleGroup after you create it.
Name *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Contains the identifier and the friendly name or description of
// the RuleGroup .
type RuleGroupSummary struct {
// A friendly name or description of the RuleGroup . You can't change the name of a
// RuleGroup after you create it.
//
// This member is required.
Name *string
// A unique identifier for a RuleGroup . You use RuleGroupId to get more
// information about a RuleGroup (see GetRuleGroup ), update a RuleGroup (see
// UpdateRuleGroup ), insert a RuleGroup into a WebACL or delete one from a WebACL
// (see UpdateWebACL ), or delete a RuleGroup from AWS WAF (see DeleteRuleGroup ).
// RuleGroupId is returned by CreateRuleGroup and by ListRuleGroups .
//
// This member is required.
RuleGroupId *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Specifies an ActivatedRule and indicates whether you want to
// add it to a RuleGroup or delete it from a RuleGroup .
type RuleGroupUpdate struct {
// Specify INSERT to add an ActivatedRule to a RuleGroup . Use DELETE to remove an
// ActivatedRule from a RuleGroup .
//
// This member is required.
Action ChangeAction
// The ActivatedRule object specifies a Rule that you want to insert or delete,
// the priority of the Rule in the WebACL , and the action that you want AWS WAF to
// take when a web request matches the Rule ( ALLOW , BLOCK , or COUNT ).
//
// This member is required.
ActivatedRule *ActivatedRule
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Contains the identifier and the friendly name or description of
// the Rule .
type RuleSummary struct {
// A friendly name or description of the Rule . You can't change the name of a Rule
// after you create it.
//
// This member is required.
Name *string
// A unique identifier for a Rule . You use RuleId to get more information about a
// Rule (see GetRule ), update a Rule (see UpdateRule ), insert a Rule into a
// WebACL or delete one from a WebACL (see UpdateWebACL ), or delete a Rule from
// AWS WAF (see DeleteRule ). RuleId is returned by CreateRule and by ListRules .
//
// This member is required.
RuleId *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Specifies a Predicate (such as an IPSet ) and indicates whether
// you want to add it to a Rule or delete it from a Rule .
type RuleUpdate struct {
// Specify INSERT to add a Predicate to a Rule . Use DELETE to remove a Predicate
// from a Rule .
//
// This member is required.
Action ChangeAction
// The ID of the Predicate (such as an IPSet ) that you want to add to a Rule .
//
// This member is required.
Predicate *Predicate
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. The response from a GetSampledRequests request includes a
// SampledHTTPRequests complex type that appears as SampledRequests in the
// response syntax. SampledHTTPRequests contains one SampledHTTPRequest object for
// each web request that is returned by GetSampledRequests .
type SampledHTTPRequest struct {
// A complex type that contains detailed information about the request.
//
// This member is required.
Request *HTTPRequest
// A value that indicates how one result in the response relates proportionally to
// other results in the response. A result that has a weight of 2 represents
// roughly twice as many CloudFront web requests as a result that has a weight of 1
// .
//
// This member is required.
Weight int64
// The action for the Rule that the request matched: ALLOW , BLOCK , or COUNT .
Action *string
// This value is returned if the GetSampledRequests request specifies the ID of a
// RuleGroup rather than the ID of an individual rule. RuleWithinRuleGroup is the
// rule within the specified RuleGroup that matched the request listed in the
// response.
RuleWithinRuleGroup *string
// The time at which AWS WAF received the request from your AWS resource, in Unix
// time format (in seconds).
Timestamp *time.Time
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Specifies a constraint on the size of a part of the web request.
// AWS WAF uses the Size , ComparisonOperator , and FieldToMatch to build an
// expression in the form of " Size ComparisonOperator size in bytes of
// FieldToMatch ". If that expression is true, the SizeConstraint is considered to
// match.
type SizeConstraint struct {
// The type of comparison you want AWS WAF to perform. AWS WAF uses this in
// combination with the provided Size and FieldToMatch to build an expression in
// the form of " Size ComparisonOperator size in bytes of FieldToMatch ". If that
// expression is true, the SizeConstraint is considered to match. EQ: Used to test
// if the Size is equal to the size of the FieldToMatch NE: Used to test if the
// Size is not equal to the size of the FieldToMatch LE: Used to test if the Size
// is less than or equal to the size of the FieldToMatch LT: Used to test if the
// Size is strictly less than the size of the FieldToMatch GE: Used to test if the
// Size is greater than or equal to the size of the FieldToMatch GT: Used to test
// if the Size is strictly greater than the size of the FieldToMatch
//
// This member is required.
ComparisonOperator ComparisonOperator
// Specifies where in a web request to look for the size constraint.
//
// This member is required.
FieldToMatch *FieldToMatch
// The size in bytes that you want AWS WAF to compare against the size of the
// specified FieldToMatch . AWS WAF uses this in combination with
// ComparisonOperator and FieldToMatch to build an expression in the form of " Size
// ComparisonOperator size in bytes of FieldToMatch ". If that expression is true,
// the SizeConstraint is considered to match. Valid values for size are 0 -
// 21474836480 bytes (0 - 20 GB). If you specify URI for the value of Type , the /
// in the URI counts as one character. For example, the URI /logo.jpg is nine
// characters long.
//
// This member is required.
Size int64
// Text transformations eliminate some of the unusual formatting that attackers
// use in web requests in an effort to bypass AWS WAF. If you specify a
// transformation, AWS WAF performs the transformation on FieldToMatch before
// inspecting it for a match. You can only specify a single type of
// TextTransformation. Note that if you choose BODY for the value of Type , you
// must choose NONE for TextTransformation because CloudFront forwards only the
// first 8192 bytes for inspection. NONE Specify NONE if you don't want to perform
// any text transformations. CMD_LINE When you're concerned that attackers are
// injecting an operating system command line command and using unusual formatting
// to disguise some or all of the command, use this option to perform the following
// transformations:
// - Delete the following characters: \ " ' ^
// - Delete spaces before the following characters: / (
// - Replace the following characters with a space: , ;
// - Replace multiple spaces with one space
// - Convert uppercase letters (A-Z) to lowercase (a-z)
// COMPRESS_WHITE_SPACE Use this option to replace the following characters with a
// space character (decimal 32):
// - \f, formfeed, decimal 12
// - \t, tab, decimal 9
// - \n, newline, decimal 10
// - \r, carriage return, decimal 13
// - \v, vertical tab, decimal 11
// - non-breaking space, decimal 160
// COMPRESS_WHITE_SPACE also replaces multiple spaces with one space.
// HTML_ENTITY_DECODE Use this option to replace HTML-encoded characters with
// unencoded characters. HTML_ENTITY_DECODE performs the following operations:
// - Replaces (ampersand)quot; with "
// - Replaces (ampersand)nbsp; with a non-breaking space, decimal 160
// - Replaces (ampersand)lt; with a "less than" symbol
// - Replaces (ampersand)gt; with >
// - Replaces characters that are represented in hexadecimal format,
// (ampersand)#xhhhh; , with the corresponding characters
// - Replaces characters that are represented in decimal format,
// (ampersand)#nnnn; , with the corresponding characters
// LOWERCASE Use this option to convert uppercase letters (A-Z) to lowercase
// (a-z). URL_DECODE Use this option to decode a URL-encoded value.
//
// This member is required.
TextTransformation TextTransformation
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. A complex type that contains SizeConstraint objects, which
// specify the parts of web requests that you want AWS WAF to inspect the size of.
// If a SizeConstraintSet contains more than one SizeConstraint object, a request
// only needs to match one constraint to be considered a match.
type SizeConstraintSet struct {
// A unique identifier for a SizeConstraintSet . You use SizeConstraintSetId to
// get information about a SizeConstraintSet (see GetSizeConstraintSet ), update a
// SizeConstraintSet (see UpdateSizeConstraintSet ), insert a SizeConstraintSet
// into a Rule or delete one from a Rule (see UpdateRule ), and delete a
// SizeConstraintSet from AWS WAF (see DeleteSizeConstraintSet ).
// SizeConstraintSetId is returned by CreateSizeConstraintSet and by
// ListSizeConstraintSets .
//
// This member is required.
SizeConstraintSetId *string
// Specifies the parts of web requests that you want to inspect the size of.
//
// This member is required.
SizeConstraints []SizeConstraint
// The name, if any, of the SizeConstraintSet .
Name *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. The Id and Name of a SizeConstraintSet .
type SizeConstraintSetSummary struct {
// The name of the SizeConstraintSet , if any.
//
// This member is required.
Name *string
// A unique identifier for a SizeConstraintSet . You use SizeConstraintSetId to
// get information about a SizeConstraintSet (see GetSizeConstraintSet ), update a
// SizeConstraintSet (see UpdateSizeConstraintSet ), insert a SizeConstraintSet
// into a Rule or delete one from a Rule (see UpdateRule ), and delete a
// SizeConstraintSet from AWS WAF (see DeleteSizeConstraintSet ).
// SizeConstraintSetId is returned by CreateSizeConstraintSet and by
// ListSizeConstraintSets .
//
// This member is required.
SizeConstraintSetId *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Specifies the part of a web request that you want to inspect the
// size of and indicates whether you want to add the specification to a
// SizeConstraintSet or delete it from a SizeConstraintSet .
type SizeConstraintSetUpdate struct {
// Specify INSERT to add a SizeConstraintSetUpdate to a SizeConstraintSet . Use
// DELETE to remove a SizeConstraintSetUpdate from a SizeConstraintSet .
//
// This member is required.
Action ChangeAction
// Specifies a constraint on the size of a part of the web request. AWS WAF uses
// the Size , ComparisonOperator , and FieldToMatch to build an expression in the
// form of " Size ComparisonOperator size in bytes of FieldToMatch ". If that
// expression is true, the SizeConstraint is considered to match.
//
// This member is required.
SizeConstraint *SizeConstraint
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. A complex type that contains SqlInjectionMatchTuple objects,
// which specify the parts of web requests that you want AWS WAF to inspect for
// snippets of malicious SQL code and, if you want AWS WAF to inspect a header, the
// name of the header. If a SqlInjectionMatchSet contains more than one
// SqlInjectionMatchTuple object, a request needs to include snippets of SQL code
// in only one of the specified parts of the request to be considered a match.
type SqlInjectionMatchSet struct {
// A unique identifier for a SqlInjectionMatchSet . You use SqlInjectionMatchSetId
// to get information about a SqlInjectionMatchSet (see GetSqlInjectionMatchSet ),
// update a SqlInjectionMatchSet (see UpdateSqlInjectionMatchSet ), insert a
// SqlInjectionMatchSet into a Rule or delete one from a Rule (see UpdateRule ),
// and delete a SqlInjectionMatchSet from AWS WAF (see DeleteSqlInjectionMatchSet
// ). SqlInjectionMatchSetId is returned by CreateSqlInjectionMatchSet and by
// ListSqlInjectionMatchSets .
//
// This member is required.
SqlInjectionMatchSetId *string
// Specifies the parts of web requests that you want to inspect for snippets of
// malicious SQL code.
//
// This member is required.
SqlInjectionMatchTuples []SqlInjectionMatchTuple
// The name, if any, of the SqlInjectionMatchSet .
Name *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. The Id and Name of a SqlInjectionMatchSet .
type SqlInjectionMatchSetSummary struct {
// The name of the SqlInjectionMatchSet , if any, specified by Id .
//
// This member is required.
Name *string
// A unique identifier for a SqlInjectionMatchSet . You use SqlInjectionMatchSetId
// to get information about a SqlInjectionMatchSet (see GetSqlInjectionMatchSet ),
// update a SqlInjectionMatchSet (see UpdateSqlInjectionMatchSet ), insert a
// SqlInjectionMatchSet into a Rule or delete one from a Rule (see UpdateRule ),
// and delete a SqlInjectionMatchSet from AWS WAF (see DeleteSqlInjectionMatchSet
// ). SqlInjectionMatchSetId is returned by CreateSqlInjectionMatchSet and by
// ListSqlInjectionMatchSets .
//
// This member is required.
SqlInjectionMatchSetId *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Specifies the part of a web request that you want to inspect for
// snippets of malicious SQL code and indicates whether you want to add the
// specification to a SqlInjectionMatchSet or delete it from a SqlInjectionMatchSet
// .
type SqlInjectionMatchSetUpdate struct {
// Specify INSERT to add a SqlInjectionMatchSetUpdate to a SqlInjectionMatchSet .
// Use DELETE to remove a SqlInjectionMatchSetUpdate from a SqlInjectionMatchSet .
//
// This member is required.
Action ChangeAction
// Specifies the part of a web request that you want AWS WAF to inspect for
// snippets of malicious SQL code and, if you want AWS WAF to inspect a header, the
// name of the header.
//
// This member is required.
SqlInjectionMatchTuple *SqlInjectionMatchTuple
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Specifies the part of a web request that you want AWS WAF to
// inspect for snippets of malicious SQL code and, if you want AWS WAF to inspect a
// header, the name of the header.
type SqlInjectionMatchTuple struct {
// Specifies where in a web request to look for snippets of malicious SQL code.
//
// This member is required.
FieldToMatch *FieldToMatch
// Text transformations eliminate some of the unusual formatting that attackers
// use in web requests in an effort to bypass AWS WAF. If you specify a
// transformation, AWS WAF performs the transformation on FieldToMatch before
// inspecting it for a match. You can only specify a single type of
// TextTransformation. CMD_LINE When you're concerned that attackers are injecting
// an operating system command line command and using unusual formatting to
// disguise some or all of the command, use this option to perform the following
// transformations:
// - Delete the following characters: \ " ' ^
// - Delete spaces before the following characters: / (
// - Replace the following characters with a space: , ;
// - Replace multiple spaces with one space
// - Convert uppercase letters (A-Z) to lowercase (a-z)
// COMPRESS_WHITE_SPACE Use this option to replace the following characters with a
// space character (decimal 32):
// - \f, formfeed, decimal 12
// - \t, tab, decimal 9
// - \n, newline, decimal 10
// - \r, carriage return, decimal 13
// - \v, vertical tab, decimal 11
// - non-breaking space, decimal 160
// COMPRESS_WHITE_SPACE also replaces multiple spaces with one space.
// HTML_ENTITY_DECODE Use this option to replace HTML-encoded characters with
// unencoded characters. HTML_ENTITY_DECODE performs the following operations:
// - Replaces (ampersand)quot; with "
// - Replaces (ampersand)nbsp; with a non-breaking space, decimal 160
// - Replaces (ampersand)lt; with a "less than" symbol
// - Replaces (ampersand)gt; with >
// - Replaces characters that are represented in hexadecimal format,
// (ampersand)#xhhhh; , with the corresponding characters
// - Replaces characters that are represented in decimal format,
// (ampersand)#nnnn; , with the corresponding characters
// LOWERCASE Use this option to convert uppercase letters (A-Z) to lowercase
// (a-z). URL_DECODE Use this option to decode a URL-encoded value. NONE Specify
// NONE if you don't want to perform any text transformations.
//
// This member is required.
TextTransformation TextTransformation
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. A summary of the rule groups you are subscribed to.
type SubscribedRuleGroupSummary struct {
// A friendly name or description for the metrics for this RuleGroup . The name can
// contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum length 128
// and minimum length one. It can't contain whitespace or metric names reserved for
// AWS WAF, including "All" and "Default_Action." You can't change the name of the
// metric after you create the RuleGroup .
//
// This member is required.
MetricName *string
// A friendly name or description of the RuleGroup . You can't change the name of a
// RuleGroup after you create it.
//
// This member is required.
Name *string
// A unique identifier for a RuleGroup .
//
// This member is required.
RuleGroupId *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. A tag associated with an AWS resource. Tags are key:value pairs
// that you can use to categorize and manage your resources, for purposes like
// billing. For example, you might set the tag key to "customer" and the value to
// the customer name or ID. You can specify one or more tags to add to each AWS
// resource, up to 50 tags for a resource. Tagging is only available through the
// API, SDKs, and CLI. You can't manage or view tags through the AWS WAF Classic
// console. You can tag the AWS resources that you manage through AWS WAF Classic:
// web ACLs, rule groups, and rules.
type Tag struct {
//
//
// This member is required.
Key *string
//
//
// This member is required.
Value *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Information for a tag associated with an AWS resource. Tags are
// key:value pairs that you can use to categorize and manage your resources, for
// purposes like billing. For example, you might set the tag key to "customer" and
// the value to the customer name or ID. You can specify one or more tags to add to
// each AWS resource, up to 50 tags for a resource. Tagging is only available
// through the API, SDKs, and CLI. You can't manage or view tags through the AWS
// WAF Classic console. You can tag the AWS resources that you manage through AWS
// WAF Classic: web ACLs, rule groups, and rules.
type TagInfoForResource struct {
//
ResourceARN *string
//
TagList []Tag
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. In a GetSampledRequests request, the StartTime and EndTime
// objects specify the time range for which you want AWS WAF to return a sample of
// web requests. You must specify the times in Coordinated Universal Time (UTC)
// format. UTC format includes the special designator, Z . For example,
// "2016-09-27T14:50Z" . In a GetSampledRequests response, the StartTime and
// EndTime objects specify the time range for which AWS WAF actually returned a
// sample of web requests. AWS WAF gets the specified number of requests from among
// the first 5,000 requests that your AWS resource receives during the specified
// time period. If your resource receives more than 5,000 requests during that
// period, AWS WAF stops sampling after the 5,000th request. In that case, EndTime
// is the time that AWS WAF received the 5,000th request.
type TimeWindow struct {
// The end of the time range from which you want GetSampledRequests to return a
// sample of the requests that your AWS resource received. You must specify the
// date and time in Coordinated Universal Time (UTC) format. UTC format includes
// the special designator, Z . For example, "2016-09-27T14:50Z" . You can specify
// any time range in the previous three hours.
//
// This member is required.
EndTime *time.Time
// The beginning of the time range from which you want GetSampledRequests to
// return a sample of the requests that your AWS resource received. You must
// specify the date and time in Coordinated Universal Time (UTC) format. UTC format
// includes the special designator, Z . For example, "2016-09-27T14:50Z" . You can
// specify any time range in the previous three hours.
//
// This member is required.
StartTime *time.Time
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. For the action that is associated with a rule in a WebACL ,
// specifies the action that you want AWS WAF to perform when a web request matches
// all of the conditions in a rule. For the default action in a WebACL , specifies
// the action that you want AWS WAF to take when a web request doesn't match all of
// the conditions in any of the rules in a WebACL .
type WafAction struct {
// Specifies how you want AWS WAF to respond to requests that match the settings
// in a Rule . Valid settings include the following:
// - ALLOW : AWS WAF allows requests
// - BLOCK : AWS WAF blocks requests
// - COUNT : AWS WAF increments a counter of the requests that match all of the
// conditions in the rule. AWS WAF then continues to inspect the web request based
// on the remaining rules in the web ACL. You can't specify COUNT for the default
// action for a WebACL .
//
// This member is required.
Type WafActionType
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. The action to take if any rule within the RuleGroup matches a
// request.
type WafOverrideAction struct {
// COUNT overrides the action specified by the individual rule within a RuleGroup
// . If set to NONE , the rule's action will take place.
//
// This member is required.
Type WafOverrideActionType
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Contains the Rules that identify the requests that you want to
// allow, block, or count. In a WebACL , you also specify a default action ( ALLOW
// or BLOCK ), and the action for each Rule that you add to a WebACL , for example,
// block requests from specified IP addresses or block requests from specified
// referrers. You also associate the WebACL with a CloudFront distribution to
// identify the requests that you want AWS WAF to filter. If you add more than one
// Rule to a WebACL , a request needs to match only one of the specifications to be
// allowed, blocked, or counted. For more information, see UpdateWebACL .
type WebACL struct {
// The action to perform if none of the Rules contained in the WebACL match. The
// action is specified by the WafAction object.
//
// This member is required.
DefaultAction *WafAction
// An array that contains the action for each Rule in a WebACL , the priority of
// the Rule , and the ID of the Rule .
//
// This member is required.
Rules []ActivatedRule
// A unique identifier for a WebACL . You use WebACLId to get information about a
// WebACL (see GetWebACL ), update a WebACL (see UpdateWebACL ), and delete a
// WebACL from AWS WAF (see DeleteWebACL ). WebACLId is returned by CreateWebACL
// and by ListWebACLs .
//
// This member is required.
WebACLId *string
// A friendly name or description for the metrics for this WebACL . The name can
// contain only alphanumeric characters (A-Z, a-z, 0-9), with maximum length 128
// and minimum length one. It can't contain whitespace or metric names reserved for
// AWS WAF, including "All" and "Default_Action." You can't change MetricName
// after you create the WebACL .
MetricName *string
// A friendly name or description of the WebACL . You can't change the name of a
// WebACL after you create it.
Name *string
// Tha Amazon Resource Name (ARN) of the web ACL.
WebACLArn *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Contains the identifier and the name or description of the
// WebACL .
type WebACLSummary struct {
// A friendly name or description of the WebACL . You can't change the name of a
// WebACL after you create it.
//
// This member is required.
Name *string
// A unique identifier for a WebACL . You use WebACLId to get information about a
// WebACL (see GetWebACL ), update a WebACL (see UpdateWebACL ), and delete a
// WebACL from AWS WAF (see DeleteWebACL ). WebACLId is returned by CreateWebACL
// and by ListWebACLs .
//
// This member is required.
WebACLId *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Specifies whether to insert a Rule into or delete a Rule from a
// WebACL .
type WebACLUpdate struct {
// Specifies whether to insert a Rule into or delete a Rule from a WebACL .
//
// This member is required.
Action ChangeAction
// The ActivatedRule object in an UpdateWebACL request specifies a Rule that you
// want to insert or delete, the priority of the Rule in the WebACL , and the
// action that you want AWS WAF to take when a web request matches the Rule ( ALLOW
// , BLOCK , or COUNT ).
//
// This member is required.
ActivatedRule *ActivatedRule
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. A complex type that contains XssMatchTuple objects, which
// specify the parts of web requests that you want AWS WAF to inspect for
// cross-site scripting attacks and, if you want AWS WAF to inspect a header, the
// name of the header. If a XssMatchSet contains more than one XssMatchTuple
// object, a request needs to include cross-site scripting attacks in only one of
// the specified parts of the request to be considered a match.
type XssMatchSet struct {
// A unique identifier for an XssMatchSet . You use XssMatchSetId to get
// information about an XssMatchSet (see GetXssMatchSet ), update an XssMatchSet
// (see UpdateXssMatchSet ), insert an XssMatchSet into a Rule or delete one from
// a Rule (see UpdateRule ), and delete an XssMatchSet from AWS WAF (see
// DeleteXssMatchSet ). XssMatchSetId is returned by CreateXssMatchSet and by
// ListXssMatchSets .
//
// This member is required.
XssMatchSetId *string
// Specifies the parts of web requests that you want to inspect for cross-site
// scripting attacks.
//
// This member is required.
XssMatchTuples []XssMatchTuple
// The name, if any, of the XssMatchSet .
Name *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. The Id and Name of an XssMatchSet .
type XssMatchSetSummary struct {
// The name of the XssMatchSet , if any, specified by Id .
//
// This member is required.
Name *string
// A unique identifier for an XssMatchSet . You use XssMatchSetId to get
// information about a XssMatchSet (see GetXssMatchSet ), update an XssMatchSet
// (see UpdateXssMatchSet ), insert an XssMatchSet into a Rule or delete one from
// a Rule (see UpdateRule ), and delete an XssMatchSet from AWS WAF (see
// DeleteXssMatchSet ). XssMatchSetId is returned by CreateXssMatchSet and by
// ListXssMatchSets .
//
// This member is required.
XssMatchSetId *string
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Specifies the part of a web request that you want to inspect for
// cross-site scripting attacks and indicates whether you want to add the
// specification to an XssMatchSet or delete it from an XssMatchSet .
type XssMatchSetUpdate struct {
// Specify INSERT to add an XssMatchSetUpdate to an XssMatchSet . Use DELETE to
// remove an XssMatchSetUpdate from an XssMatchSet .
//
// This member is required.
Action ChangeAction
// Specifies the part of a web request that you want AWS WAF to inspect for
// cross-site scripting attacks and, if you want AWS WAF to inspect a header, the
// name of the header.
//
// This member is required.
XssMatchTuple *XssMatchTuple
noSmithyDocumentSerde
}
// This is AWS WAF Classic documentation. For more information, see AWS WAF Classic (https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html)
// in the developer guide. For the latest version of AWS WAF, use the AWS WAFV2 API
// and see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . With the latest version, AWS WAF has a single set of endpoints for regional
// and global use. Specifies the part of a web request that you want AWS WAF to
// inspect for cross-site scripting attacks and, if you want AWS WAF to inspect a
// header, the name of the header.
type XssMatchTuple struct {
// Specifies where in a web request to look for cross-site scripting attacks.
//
// This member is required.
FieldToMatch *FieldToMatch
// Text transformations eliminate some of the unusual formatting that attackers
// use in web requests in an effort to bypass AWS WAF. If you specify a
// transformation, AWS WAF performs the transformation on FieldToMatch before
// inspecting it for a match. You can only specify a single type of
// TextTransformation. CMD_LINE When you're concerned that attackers are injecting
// an operating system command line command and using unusual formatting to
// disguise some or all of the command, use this option to perform the following
// transformations:
// - Delete the following characters: \ " ' ^
// - Delete spaces before the following characters: / (
// - Replace the following characters with a space: , ;
// - Replace multiple spaces with one space
// - Convert uppercase letters (A-Z) to lowercase (a-z)
// COMPRESS_WHITE_SPACE Use this option to replace the following characters with a
// space character (decimal 32):
// - \f, formfeed, decimal 12
// - \t, tab, decimal 9
// - \n, newline, decimal 10
// - \r, carriage return, decimal 13
// - \v, vertical tab, decimal 11
// - non-breaking space, decimal 160
// COMPRESS_WHITE_SPACE also replaces multiple spaces with one space.
// HTML_ENTITY_DECODE Use this option to replace HTML-encoded characters with
// unencoded characters. HTML_ENTITY_DECODE performs the following operations:
// - Replaces (ampersand)quot; with "
// - Replaces (ampersand)nbsp; with a non-breaking space, decimal 160
// - Replaces (ampersand)lt; with a "less than" symbol
// - Replaces (ampersand)gt; with >
// - Replaces characters that are represented in hexadecimal format,
// (ampersand)#xhhhh; , with the corresponding characters
// - Replaces characters that are represented in decimal format,
// (ampersand)#nnnn; , with the corresponding characters
// LOWERCASE Use this option to convert uppercase letters (A-Z) to lowercase
// (a-z). URL_DECODE Use this option to decode a URL-encoded value. NONE Specify
// NONE if you don't want to perform any text transformations.
//
// This member is required.
TextTransformation TextTransformation
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 1,953 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "WAFV2"
const ServiceAPIVersion = "2019-07-29"
// Client provides the API client to make operations call for AWS WAFV2.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "wafv2", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 434 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io/ioutil"
"net/http"
"strings"
"testing"
)
func TestClient_resolveRetryOptions(t *testing.T) {
nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) {
return &http.Response{
StatusCode: 200,
Header: http.Header{},
Body: ioutil.NopCloser(strings.NewReader("")),
}, nil
})
cases := map[string]struct {
defaultsMode aws.DefaultsMode
retryer aws.Retryer
retryMaxAttempts int
opRetryMaxAttempts *int
retryMode aws.RetryMode
expectClientRetryMode aws.RetryMode
expectClientMaxAttempts int
expectOpMaxAttempts int
}{
"defaults": {
defaultsMode: aws.DefaultsModeStandard,
expectClientRetryMode: aws.RetryModeStandard,
expectClientMaxAttempts: 3,
expectOpMaxAttempts: 3,
},
"custom default retry": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(2),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 2,
},
"custom op no change max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(10),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op 0 max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(0),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
}
for name, c := range cases {
t.Run(name, func(t *testing.T) {
client := NewFromConfig(aws.Config{
DefaultsMode: c.defaultsMode,
Retryer: func() func() aws.Retryer {
if c.retryer == nil {
return nil
}
return func() aws.Retryer { return c.retryer }
}(),
HTTPClient: nopClient,
RetryMaxAttempts: c.retryMaxAttempts,
RetryMode: c.retryMode,
})
if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a {
t.Errorf("expect %v retry mode, got %v", e, a)
}
if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v max attempts, got %v", e, a)
}
_, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{},
[]func(*Options){
func(o *Options) {
if c.opRetryMaxAttempts == nil {
return
}
o.RetryMaxAttempts = *c.opRetryMaxAttempts
},
},
func(s *middleware.Stack, o Options) error {
s.Initialize.Clear()
s.Serialize.Clear()
s.Build.Clear()
s.Finalize.Clear()
s.Deserialize.Clear()
if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v op max attempts, got %v", e, a)
}
return nil
})
if err != nil {
t.Fatalf("expect no operation error, got %v", err)
}
})
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Associates a web ACL with a regional application resource, to protect the
// resource. A regional application can be an Application Load Balancer (ALB), an
// Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito user
// pool, an App Runner service, or an Amazon Web Services Verified Access instance.
// For Amazon CloudFront, don't use this call. Instead, use your CloudFront
// distribution configuration. To associate a web ACL, in the CloudFront call
// UpdateDistribution , set the web ACL ID to the Amazon Resource Name (ARN) of the
// web ACL. For information, see UpdateDistribution (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_UpdateDistribution.html)
// in the Amazon CloudFront Developer Guide. When you make changes to web ACLs or
// web ACL components, like rules and rule groups, WAF propagates the changes
// everywhere that the web ACL and its components are stored and used. Your changes
// are applied within seconds, but there might be a brief period of inconsistency
// when the changes have arrived in some places and not in others. So, for example,
// if you change a rule action setting, the action might be the old action in one
// area and the new action in another area. Or if you add an IP address to an IP
// set used in a blocking rule, the new address might briefly be blocked in one
// area while still allowed in another. This temporary inconsistency can occur when
// you first associate a web ACL with an Amazon Web Services resource and when you
// change a web ACL that is already associated with a resource. Generally, any
// inconsistencies of this type last only a few seconds.
func (c *Client) AssociateWebACL(ctx context.Context, params *AssociateWebACLInput, optFns ...func(*Options)) (*AssociateWebACLOutput, error) {
if params == nil {
params = &AssociateWebACLInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociateWebACL", params, optFns, c.addOperationAssociateWebACLMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociateWebACLOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssociateWebACLInput struct {
// The Amazon Resource Name (ARN) of the resource to associate with the web ACL.
// The ARN must be in one of the following formats:
// - For an Application Load Balancer:
// arn:partition:elasticloadbalancing:region:account-id:loadbalancer/app/load-balancer-name/load-balancer-id
//
// - For an Amazon API Gateway REST API:
// arn:partition:apigateway:region::/restapis/api-id/stages/stage-name
// - For an AppSync GraphQL API:
// arn:partition:appsync:region:account-id:apis/GraphQLApiId
// - For an Amazon Cognito user pool:
// arn:partition:cognito-idp:region:account-id:userpool/user-pool-id
// - For an App Runner service:
// arn:partition:apprunner:region:account-id:service/apprunner-service-name/apprunner-service-id
//
// - For an Amazon Web Services Verified Access instance:
// arn:partition:ec2:region:account-id:verified-access-instance/instance-id
//
// This member is required.
ResourceArn *string
// The Amazon Resource Name (ARN) of the web ACL that you want to associate with
// the resource.
//
// This member is required.
WebACLArn *string
noSmithyDocumentSerde
}
type AssociateWebACLOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociateWebACLMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateWebACL{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateWebACL{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssociateWebACLValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateWebACL(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAssociateWebACL(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "AssociateWebACL",
}
}
| 160 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the web ACL capacity unit (WCU) requirements for a specified scope and
// set of rules. You can use this to check the capacity requirements for the rules
// you want to use in a RuleGroup or WebACL . WAF uses WCUs to calculate and
// control the operating resources that are used to run your rules, rule groups,
// and web ACLs. WAF calculates capacity differently for each rule type, to reflect
// the relative cost of each rule. Simple rules that cost little to run use fewer
// WCUs than more complex rules that use more processing power. Rule group capacity
// is fixed at creation, which helps users plan their web ACL WCU usage when they
// use a rule group. For more information, see WAF web ACL capacity units (WCU) (https://docs.aws.amazon.com/waf/latest/developerguide/aws-waf-capacity-units.html)
// in the WAF Developer Guide.
func (c *Client) CheckCapacity(ctx context.Context, params *CheckCapacityInput, optFns ...func(*Options)) (*CheckCapacityOutput, error) {
if params == nil {
params = &CheckCapacityInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CheckCapacity", params, optFns, c.addOperationCheckCapacityMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CheckCapacityOutput)
out.ResultMetadata = metadata
return out, nil
}
type CheckCapacityInput struct {
// An array of Rule that you're configuring to use in a rule group or web ACL.
//
// This member is required.
Rules []types.Rule
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
noSmithyDocumentSerde
}
type CheckCapacityOutput struct {
// The capacity required by the rules and scope.
Capacity int64
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCheckCapacityMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCheckCapacity{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCheckCapacity{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCheckCapacityValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCheckCapacity(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCheckCapacity(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "CheckCapacity",
}
}
| 147 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an API key that contains a set of token domains. API keys are required
// for the integration of the CAPTCHA API in your JavaScript client applications.
// The API lets you customize the placement and characteristics of the CAPTCHA
// puzzle for your end users. For more information about the CAPTCHA JavaScript
// integration, see WAF client application integration (https://docs.aws.amazon.com/waf/latest/developerguide/waf-application-integration.html)
// in the WAF Developer Guide. You can use a single key for up to 5 domains. After
// you generate a key, you can copy it for use in your JavaScript integration.
func (c *Client) CreateAPIKey(ctx context.Context, params *CreateAPIKeyInput, optFns ...func(*Options)) (*CreateAPIKeyOutput, error) {
if params == nil {
params = &CreateAPIKeyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateAPIKey", params, optFns, c.addOperationCreateAPIKeyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateAPIKeyOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateAPIKeyInput struct {
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// The client application domains that you want to use this API key for. Example
// JSON: "TokenDomains": ["abc.com", "store.abc.com"] Public suffixes aren't
// allowed. For example, you can't use usa.gov or co.uk as token domains.
//
// This member is required.
TokenDomains []string
noSmithyDocumentSerde
}
type CreateAPIKeyOutput struct {
// The generated, encrypted API key. You can copy this for use in your JavaScript
// CAPTCHA integration.
APIKey *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateAPIKeyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAPIKey{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAPIKey{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateAPIKeyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAPIKey(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateAPIKey(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "CreateAPIKey",
}
}
| 147 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an IPSet , which you use to identify web requests that originate from
// specific IP addresses or ranges of IP addresses. For example, if you're
// receiving a lot of requests from a ranges of IP addresses, you can configure WAF
// to block them using an IPSet that lists those IP addresses.
func (c *Client) CreateIPSet(ctx context.Context, params *CreateIPSetInput, optFns ...func(*Options)) (*CreateIPSetOutput, error) {
if params == nil {
params = &CreateIPSetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateIPSet", params, optFns, c.addOperationCreateIPSetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateIPSetOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateIPSetInput struct {
// Contains an array of strings that specifies zero or more IP addresses or blocks
// of IP addresses. All addresses must be specified using Classless Inter-Domain
// Routing (CIDR) notation. WAF supports all IPv4 and IPv6 CIDR ranges except for
// /0 . Example address strings:
// - To configure WAF to allow, block, or count requests that originated from
// the IP address 192.0.2.44, specify 192.0.2.44/32 .
// - To configure WAF to allow, block, or count requests that originated from IP
// addresses from 192.0.2.0 to 192.0.2.255, specify 192.0.2.0/24 .
// - To configure WAF to allow, block, or count requests that originated from
// the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify
// 1111:0000:0000:0000:0000:0000:0000:0111/128 .
// - To configure WAF to allow, block, or count requests that originated from IP
// addresses 1111:0000:0000:0000:0000:0000:0000:0000 to
// 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify
// 1111:0000:0000:0000:0000:0000:0000:0000/64 .
// For more information about CIDR notation, see the Wikipedia entry Classless
// Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
// . Example JSON Addresses specifications:
// - Empty array: "Addresses": []
// - Array with one address: "Addresses": ["192.0.2.44/32"]
// - Array with three addresses: "Addresses": ["192.0.2.44/32", "192.0.2.0/24",
// "192.0.0.0/16"]
// - INVALID specification: "Addresses": [""] INVALID
//
// This member is required.
Addresses []string
// The version of the IP addresses, either IPV4 or IPV6 .
//
// This member is required.
IPAddressVersion types.IPAddressVersion
// The name of the IP set. You cannot change the name of an IPSet after you create
// it.
//
// This member is required.
Name *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// A description of the IP set that helps with identification.
Description *string
// An array of key:value pairs to associate with the resource.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateIPSetOutput struct {
// High-level information about an IPSet , returned by operations like create and
// list. This provides information like the ID, that you can use to retrieve and
// manage an IPSet , and the ARN, that you provide to the IPSetReferenceStatement
// to use the address set in a Rule .
Summary *types.IPSetSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateIPSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateIPSet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateIPSet{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateIPSetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateIPSet(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateIPSet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "CreateIPSet",
}
}
| 183 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a RegexPatternSet , which you reference in a
// RegexPatternSetReferenceStatement , to have WAF inspect a web request component
// for the specified patterns.
func (c *Client) CreateRegexPatternSet(ctx context.Context, params *CreateRegexPatternSetInput, optFns ...func(*Options)) (*CreateRegexPatternSetOutput, error) {
if params == nil {
params = &CreateRegexPatternSetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateRegexPatternSet", params, optFns, c.addOperationCreateRegexPatternSetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateRegexPatternSetOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateRegexPatternSetInput struct {
// The name of the set. You cannot change the name after you create the set.
//
// This member is required.
Name *string
// Array of regular expression strings.
//
// This member is required.
RegularExpressionList []types.Regex
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// A description of the set that helps with identification.
Description *string
// An array of key:value pairs to associate with the resource.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateRegexPatternSetOutput struct {
// High-level information about a RegexPatternSet , returned by operations like
// create and list. This provides information like the ID, that you can use to
// retrieve and manage a RegexPatternSet , and the ARN, that you provide to the
// RegexPatternSetReferenceStatement to use the pattern set in a Rule .
Summary *types.RegexPatternSetSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateRegexPatternSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateRegexPatternSet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateRegexPatternSet{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateRegexPatternSetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRegexPatternSet(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateRegexPatternSet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "CreateRegexPatternSet",
}
}
| 154 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a RuleGroup per the specifications provided. A rule group defines a
// collection of rules to inspect and control web requests that you can use in a
// WebACL . When you create a rule group, you define an immutable capacity limit.
// If you update a rule group, you must stay within the capacity. This allows
// others to reuse the rule group with confidence in its capacity requirements.
func (c *Client) CreateRuleGroup(ctx context.Context, params *CreateRuleGroupInput, optFns ...func(*Options)) (*CreateRuleGroupOutput, error) {
if params == nil {
params = &CreateRuleGroupInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateRuleGroup", params, optFns, c.addOperationCreateRuleGroupMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateRuleGroupOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateRuleGroupInput struct {
// The web ACL capacity units (WCUs) required for this rule group. When you create
// your own rule group, you define this, and you cannot change it after creation.
// When you add or modify the rules in a rule group, WAF enforces this limit. You
// can check the capacity for a set of rules using CheckCapacity . WAF uses WCUs to
// calculate and control the operating resources that are used to run your rules,
// rule groups, and web ACLs. WAF calculates capacity differently for each rule
// type, to reflect the relative cost of each rule. Simple rules that cost little
// to run use fewer WCUs than more complex rules that use more processing power.
// Rule group capacity is fixed at creation, which helps users plan their web ACL
// WCU usage when they use a rule group. For more information, see WAF web ACL
// capacity units (WCU) (https://docs.aws.amazon.com/waf/latest/developerguide/aws-waf-capacity-units.html)
// in the WAF Developer Guide.
//
// This member is required.
Capacity int64
// The name of the rule group. You cannot change the name of a rule group after
// you create it.
//
// This member is required.
Name *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// Defines and enables Amazon CloudWatch metrics and web request sample collection.
//
// This member is required.
VisibilityConfig *types.VisibilityConfig
// A map of custom response keys and content bodies. When you create a rule with a
// block action, you can send a custom response to the web request. You define
// these for the rule group, and then use them in the rules that you define in the
// rule group. For information about customizing web requests and responses, see
// Customizing web requests and responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html)
// in the WAF Developer Guide. For information about the limits on count and size
// for custom request and response settings, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html)
// in the WAF Developer Guide.
CustomResponseBodies map[string]types.CustomResponseBody
// A description of the rule group that helps with identification.
Description *string
// The Rule statements used to identify the web requests that you want to allow,
// block, or count. Each rule includes one top-level statement that WAF uses to
// identify matching web requests, and parameters that govern how WAF handles them.
Rules []types.Rule
// An array of key:value pairs to associate with the resource.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateRuleGroupOutput struct {
// High-level information about a RuleGroup , returned by operations like create
// and list. This provides information like the ID, that you can use to retrieve
// and manage a RuleGroup , and the ARN, that you provide to the
// RuleGroupReferenceStatement to use the rule group in a Rule .
Summary *types.RuleGroupSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateRuleGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateRuleGroup{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateRuleGroup{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateRuleGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRuleGroup(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateRuleGroup(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "CreateRuleGroup",
}
}
| 188 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a WebACL per the specifications provided. A web ACL defines a
// collection of rules to use to inspect and control web requests. Each rule has an
// action defined (allow, block, or count) for requests that match the statement of
// the rule. In the web ACL, you assign a default action to take (allow, block) for
// any request that does not match any of the rules. The rules in a web ACL can be
// a combination of the types Rule , RuleGroup , and managed rule group. You can
// associate a web ACL with one or more Amazon Web Services resources to protect.
// The resources can be an Amazon CloudFront distribution, an Amazon API Gateway
// REST API, an Application Load Balancer, an AppSync GraphQL API, an Amazon
// Cognito user pool, an App Runner service, or an Amazon Web Services Verified
// Access instance.
func (c *Client) CreateWebACL(ctx context.Context, params *CreateWebACLInput, optFns ...func(*Options)) (*CreateWebACLOutput, error) {
if params == nil {
params = &CreateWebACLInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateWebACL", params, optFns, c.addOperationCreateWebACLMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateWebACLOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateWebACLInput struct {
// The action to perform if none of the Rules contained in the WebACL match.
//
// This member is required.
DefaultAction *types.DefaultAction
// The name of the web ACL. You cannot change the name of a web ACL after you
// create it.
//
// This member is required.
Name *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// Defines and enables Amazon CloudWatch metrics and web request sample collection.
//
// This member is required.
VisibilityConfig *types.VisibilityConfig
// Specifies custom configurations for the associations between the web ACL and
// protected resources. Use this to customize the maximum size of the request body
// that your protected CloudFront distributions forward to WAF for inspection. The
// default is 16 KB (16,384 kilobytes). You are charged additional fees when your
// protected resources forward body sizes that are larger than the default. For
// more information, see WAF Pricing (http://aws.amazon.com/waf/pricing/) .
AssociationConfig *types.AssociationConfig
// Specifies how WAF should handle CAPTCHA evaluations for rules that don't have
// their own CaptchaConfig settings. If you don't specify this, WAF uses its
// default settings for CaptchaConfig .
CaptchaConfig *types.CaptchaConfig
// Specifies how WAF should handle challenge evaluations for rules that don't have
// their own ChallengeConfig settings. If you don't specify this, WAF uses its
// default settings for ChallengeConfig .
ChallengeConfig *types.ChallengeConfig
// A map of custom response keys and content bodies. When you create a rule with a
// block action, you can send a custom response to the web request. You define
// these for the web ACL, and then use them in the rules and default actions that
// you define in the web ACL. For information about customizing web requests and
// responses, see Customizing web requests and responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html)
// in the WAF Developer Guide. For information about the limits on count and size
// for custom request and response settings, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html)
// in the WAF Developer Guide.
CustomResponseBodies map[string]types.CustomResponseBody
// A description of the web ACL that helps with identification.
Description *string
// The Rule statements used to identify the web requests that you want to allow,
// block, or count. Each rule includes one top-level statement that WAF uses to
// identify matching web requests, and parameters that govern how WAF handles them.
Rules []types.Rule
// An array of key:value pairs to associate with the resource.
Tags []types.Tag
// Specifies the domains that WAF should accept in a web request token. This
// enables the use of tokens across multiple protected websites. When WAF provides
// a token, it uses the domain of the Amazon Web Services resource that the web ACL
// is protecting. If you don't specify a list of token domains, WAF accepts tokens
// only for the domain of the protected resource. With a token domain list, WAF
// accepts the resource's host domain plus all domains in the token domain list,
// including their prefixed subdomains. Example JSON: "TokenDomains": {
// "mywebsite.com", "myotherwebsite.com" } Public suffixes aren't allowed. For
// example, you can't use usa.gov or co.uk as token domains.
TokenDomains []string
noSmithyDocumentSerde
}
type CreateWebACLOutput struct {
// High-level information about a WebACL , returned by operations like create and
// list. This provides information like the ID, that you can use to retrieve and
// manage a WebACL , and the ARN, that you provide to operations like
// AssociateWebACL .
Summary *types.WebACLSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateWebACLMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateWebACL{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateWebACL{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateWebACLValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWebACL(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateWebACL(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "CreateWebACL",
}
}
| 212 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes all rule groups that are managed by Firewall Manager for the specified
// web ACL. You can only use this if ManagedByFirewallManager is false in the
// specified WebACL .
func (c *Client) DeleteFirewallManagerRuleGroups(ctx context.Context, params *DeleteFirewallManagerRuleGroupsInput, optFns ...func(*Options)) (*DeleteFirewallManagerRuleGroupsOutput, error) {
if params == nil {
params = &DeleteFirewallManagerRuleGroupsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteFirewallManagerRuleGroups", params, optFns, c.addOperationDeleteFirewallManagerRuleGroupsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteFirewallManagerRuleGroupsOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteFirewallManagerRuleGroupsInput struct {
// The Amazon Resource Name (ARN) of the web ACL.
//
// This member is required.
WebACLArn *string
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
//
// This member is required.
WebACLLockToken *string
noSmithyDocumentSerde
}
type DeleteFirewallManagerRuleGroupsOutput struct {
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
NextWebACLLockToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteFirewallManagerRuleGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteFirewallManagerRuleGroups{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteFirewallManagerRuleGroups{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteFirewallManagerRuleGroupsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteFirewallManagerRuleGroups(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteFirewallManagerRuleGroups(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "DeleteFirewallManagerRuleGroups",
}
}
| 143 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified IPSet .
func (c *Client) DeleteIPSet(ctx context.Context, params *DeleteIPSetInput, optFns ...func(*Options)) (*DeleteIPSetOutput, error) {
if params == nil {
params = &DeleteIPSetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteIPSet", params, optFns, c.addOperationDeleteIPSetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteIPSetOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteIPSetInput struct {
// A unique identifier for the set. This ID is returned in the responses to create
// and list commands. You provide it to operations like update and delete.
//
// This member is required.
Id *string
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
//
// This member is required.
LockToken *string
// The name of the IP set. You cannot change the name of an IPSet after you create
// it.
//
// This member is required.
Name *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
noSmithyDocumentSerde
}
type DeleteIPSetOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteIPSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteIPSet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteIPSet{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteIPSetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIPSet(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteIPSet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "DeleteIPSet",
}
}
| 152 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the LoggingConfiguration from the specified web ACL.
func (c *Client) DeleteLoggingConfiguration(ctx context.Context, params *DeleteLoggingConfigurationInput, optFns ...func(*Options)) (*DeleteLoggingConfigurationOutput, error) {
if params == nil {
params = &DeleteLoggingConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteLoggingConfiguration", params, optFns, c.addOperationDeleteLoggingConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteLoggingConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteLoggingConfigurationInput struct {
// The Amazon Resource Name (ARN) of the web ACL from which you want to delete the
// LoggingConfiguration .
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type DeleteLoggingConfigurationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteLoggingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteLoggingConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteLoggingConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteLoggingConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLoggingConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteLoggingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "DeleteLoggingConfiguration",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Permanently deletes an IAM policy from the specified rule group. You must be
// the owner of the rule group to perform this operation.
func (c *Client) DeletePermissionPolicy(ctx context.Context, params *DeletePermissionPolicyInput, optFns ...func(*Options)) (*DeletePermissionPolicyOutput, error) {
if params == nil {
params = &DeletePermissionPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeletePermissionPolicy", params, optFns, c.addOperationDeletePermissionPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeletePermissionPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeletePermissionPolicyInput struct {
// The Amazon Resource Name (ARN) of the rule group from which you want to delete
// the policy. You must be the owner of the rule group to perform this operation.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type DeletePermissionPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeletePermissionPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeletePermissionPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeletePermissionPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeletePermissionPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePermissionPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeletePermissionPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "DeletePermissionPolicy",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified RegexPatternSet .
func (c *Client) DeleteRegexPatternSet(ctx context.Context, params *DeleteRegexPatternSetInput, optFns ...func(*Options)) (*DeleteRegexPatternSetOutput, error) {
if params == nil {
params = &DeleteRegexPatternSetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteRegexPatternSet", params, optFns, c.addOperationDeleteRegexPatternSetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteRegexPatternSetOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteRegexPatternSetInput struct {
// A unique identifier for the set. This ID is returned in the responses to create
// and list commands. You provide it to operations like update and delete.
//
// This member is required.
Id *string
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
//
// This member is required.
LockToken *string
// The name of the set. You cannot change the name after you create the set.
//
// This member is required.
Name *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
noSmithyDocumentSerde
}
type DeleteRegexPatternSetOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteRegexPatternSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteRegexPatternSet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteRegexPatternSet{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteRegexPatternSetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRegexPatternSet(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteRegexPatternSet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "DeleteRegexPatternSet",
}
}
| 151 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified RuleGroup .
func (c *Client) DeleteRuleGroup(ctx context.Context, params *DeleteRuleGroupInput, optFns ...func(*Options)) (*DeleteRuleGroupOutput, error) {
if params == nil {
params = &DeleteRuleGroupInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteRuleGroup", params, optFns, c.addOperationDeleteRuleGroupMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteRuleGroupOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteRuleGroupInput struct {
// A unique identifier for the rule group. This ID is returned in the responses to
// create and list commands. You provide it to operations like update and delete.
//
// This member is required.
Id *string
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
//
// This member is required.
LockToken *string
// The name of the rule group. You cannot change the name of a rule group after
// you create it.
//
// This member is required.
Name *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
noSmithyDocumentSerde
}
type DeleteRuleGroupOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteRuleGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteRuleGroup{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteRuleGroup{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteRuleGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRuleGroup(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteRuleGroup(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "DeleteRuleGroup",
}
}
| 152 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified WebACL . You can only use this if ManagedByFirewallManager
// is false in the specified WebACL . Before deleting any web ACL, first
// disassociate it from all resources.
// - To retrieve a list of the resources that are associated with a web ACL, use
// the following calls:
// - For regional resources, call ListResourcesForWebACL .
// - For Amazon CloudFront distributions, use the CloudFront call
// ListDistributionsByWebACLId . For information, see ListDistributionsByWebACLId (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_ListDistributionsByWebACLId.html)
// in the Amazon CloudFront API Reference.
// - To disassociate a resource from a web ACL, use the following calls:
// - For regional resources, call DisassociateWebACL .
// - For Amazon CloudFront distributions, provide an empty web ACL ID in the
// CloudFront call UpdateDistribution . For information, see UpdateDistribution (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_UpdateDistribution.html)
// in the Amazon CloudFront API Reference.
func (c *Client) DeleteWebACL(ctx context.Context, params *DeleteWebACLInput, optFns ...func(*Options)) (*DeleteWebACLOutput, error) {
if params == nil {
params = &DeleteWebACLInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteWebACL", params, optFns, c.addOperationDeleteWebACLMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteWebACLOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteWebACLInput struct {
// The unique identifier for the web ACL. This ID is returned in the responses to
// create and list commands. You provide it to operations like update and delete.
//
// This member is required.
Id *string
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
//
// This member is required.
LockToken *string
// The name of the web ACL. You cannot change the name of a web ACL after you
// create it.
//
// This member is required.
Name *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
noSmithyDocumentSerde
}
type DeleteWebACLOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteWebACLMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteWebACL{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteWebACL{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteWebACLValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteWebACL(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteWebACL(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "DeleteWebACL",
}
}
| 165 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides high-level information for the Amazon Web Services Managed Rules rule
// groups and Amazon Web Services Marketplace managed rule groups.
func (c *Client) DescribeAllManagedProducts(ctx context.Context, params *DescribeAllManagedProductsInput, optFns ...func(*Options)) (*DescribeAllManagedProductsOutput, error) {
if params == nil {
params = &DescribeAllManagedProductsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeAllManagedProducts", params, optFns, c.addOperationDescribeAllManagedProductsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeAllManagedProductsOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeAllManagedProductsInput struct {
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
noSmithyDocumentSerde
}
type DescribeAllManagedProductsOutput struct {
// High-level information for the Amazon Web Services Managed Rules rule groups
// and Amazon Web Services Marketplace managed rule groups.
ManagedProducts []types.ManagedProductDescriptor
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeAllManagedProductsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAllManagedProducts{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAllManagedProducts{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeAllManagedProductsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAllManagedProducts(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeAllManagedProducts(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "DescribeAllManagedProducts",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides high-level information for the managed rule groups owned by a specific
// vendor.
func (c *Client) DescribeManagedProductsByVendor(ctx context.Context, params *DescribeManagedProductsByVendorInput, optFns ...func(*Options)) (*DescribeManagedProductsByVendorOutput, error) {
if params == nil {
params = &DescribeManagedProductsByVendorInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeManagedProductsByVendor", params, optFns, c.addOperationDescribeManagedProductsByVendorMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeManagedProductsByVendorOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeManagedProductsByVendorInput struct {
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// The name of the managed rule group vendor. You use this, along with the rule
// group name, to identify a rule group.
//
// This member is required.
VendorName *string
noSmithyDocumentSerde
}
type DescribeManagedProductsByVendorOutput struct {
// High-level information for the managed rule groups owned by the specified
// vendor.
ManagedProducts []types.ManagedProductDescriptor
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeManagedProductsByVendorMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeManagedProductsByVendor{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeManagedProductsByVendor{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeManagedProductsByVendorValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeManagedProductsByVendor(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeManagedProductsByVendor(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "DescribeManagedProductsByVendor",
}
}
| 141 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides high-level information for a managed rule group, including
// descriptions of the rules.
func (c *Client) DescribeManagedRuleGroup(ctx context.Context, params *DescribeManagedRuleGroupInput, optFns ...func(*Options)) (*DescribeManagedRuleGroupOutput, error) {
if params == nil {
params = &DescribeManagedRuleGroupInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeManagedRuleGroup", params, optFns, c.addOperationDescribeManagedRuleGroupMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeManagedRuleGroupOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeManagedRuleGroupInput struct {
// The name of the managed rule group. You use this, along with the vendor name,
// to identify the rule group.
//
// This member is required.
Name *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// The name of the managed rule group vendor. You use this, along with the rule
// group name, to identify a rule group.
//
// This member is required.
VendorName *string
// The version of the rule group. You can only use a version that is not scheduled
// for expiration. If you don't provide this, WAF uses the vendor's default
// version.
VersionName *string
noSmithyDocumentSerde
}
type DescribeManagedRuleGroupOutput struct {
// The labels that one or more rules in this rule group add to matching web
// requests. These labels are defined in the RuleLabels for a Rule .
AvailableLabels []types.LabelSummary
// The web ACL capacity units (WCUs) required for this rule group. WAF uses WCUs
// to calculate and control the operating resources that are used to run your
// rules, rule groups, and web ACLs. WAF calculates capacity differently for each
// rule type, to reflect the relative cost of each rule. Simple rules that cost
// little to run use fewer WCUs than more complex rules that use more processing
// power. Rule group capacity is fixed at creation, which helps users plan their
// web ACL WCU usage when they use a rule group. For more information, see WAF web
// ACL capacity units (WCU) (https://docs.aws.amazon.com/waf/latest/developerguide/aws-waf-capacity-units.html)
// in the WAF Developer Guide.
Capacity int64
// The labels that one or more rules in this rule group match against in label
// match statements. These labels are defined in a LabelMatchStatement
// specification, in the Statement definition of a rule.
ConsumedLabels []types.LabelSummary
// The label namespace prefix for this rule group. All labels added by rules in
// this rule group have this prefix.
// - The syntax for the label namespace prefix for a managed rule group is the
// following: awswaf:managed:: :
// - When a rule with a label matches a web request, WAF adds the fully
// qualified label to the request. A fully qualified label is made up of the label
// namespace from the rule group or web ACL where the rule is defined and the label
// from the rule, separated by a colon: :
LabelNamespace *string
//
Rules []types.RuleSummary
// The Amazon resource name (ARN) of the Amazon Simple Notification Service SNS
// topic that's used to provide notification of changes to the managed rule group.
// You can subscribe to the SNS topic to receive notifications when the managed
// rule group is modified, such as for new versions and for version expiration. For
// more information, see the Amazon Simple Notification Service Developer Guide (https://docs.aws.amazon.com/sns/latest/dg/welcome.html)
// .
SnsTopicArn *string
// The managed rule group's version.
VersionName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeManagedRuleGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeManagedRuleGroup{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeManagedRuleGroup{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeManagedRuleGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeManagedRuleGroup(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeManagedRuleGroup(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "DescribeManagedRuleGroup",
}
}
| 192 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Disassociates the specified regional application resource from any existing web
// ACL association. A resource can have at most one web ACL association. A regional
// application can be an Application Load Balancer (ALB), an Amazon API Gateway
// REST API, an AppSync GraphQL API, an Amazon Cognito user pool, an App Runner
// service, or an Amazon Web Services Verified Access instance. For Amazon
// CloudFront, don't use this call. Instead, use your CloudFront distribution
// configuration. To disassociate a web ACL, provide an empty web ACL ID in the
// CloudFront call UpdateDistribution . For information, see UpdateDistribution (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_UpdateDistribution.html)
// in the Amazon CloudFront API Reference.
func (c *Client) DisassociateWebACL(ctx context.Context, params *DisassociateWebACLInput, optFns ...func(*Options)) (*DisassociateWebACLOutput, error) {
if params == nil {
params = &DisassociateWebACLInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DisassociateWebACL", params, optFns, c.addOperationDisassociateWebACLMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DisassociateWebACLOutput)
out.ResultMetadata = metadata
return out, nil
}
type DisassociateWebACLInput struct {
// The Amazon Resource Name (ARN) of the resource to disassociate from the web
// ACL. The ARN must be in one of the following formats:
// - For an Application Load Balancer:
// arn:partition:elasticloadbalancing:region:account-id:loadbalancer/app/load-balancer-name/load-balancer-id
//
// - For an Amazon API Gateway REST API:
// arn:partition:apigateway:region::/restapis/api-id/stages/stage-name
// - For an AppSync GraphQL API:
// arn:partition:appsync:region:account-id:apis/GraphQLApiId
// - For an Amazon Cognito user pool:
// arn:partition:cognito-idp:region:account-id:userpool/user-pool-id
// - For an App Runner service:
// arn:partition:apprunner:region:account-id:service/apprunner-service-name/apprunner-service-id
//
// - For an Amazon Web Services Verified Access instance:
// arn:partition:ec2:region:account-id:verified-access-instance/instance-id
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type DisassociateWebACLOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDisassociateWebACLMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisassociateWebACL{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisassociateWebACL{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDisassociateWebACLValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateWebACL(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDisassociateWebACL(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "DisassociateWebACL",
}
}
| 143 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Generates a presigned download URL for the specified release of the mobile SDK.
// The mobile SDK is not generally available. Customers who have access to the
// mobile SDK can use it to establish and manage WAF tokens for use in HTTP(S)
// requests from a mobile device to WAF. For more information, see WAF client
// application integration (https://docs.aws.amazon.com/waf/latest/developerguide/waf-application-integration.html)
// in the WAF Developer Guide.
func (c *Client) GenerateMobileSdkReleaseUrl(ctx context.Context, params *GenerateMobileSdkReleaseUrlInput, optFns ...func(*Options)) (*GenerateMobileSdkReleaseUrlOutput, error) {
if params == nil {
params = &GenerateMobileSdkReleaseUrlInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GenerateMobileSdkReleaseUrl", params, optFns, c.addOperationGenerateMobileSdkReleaseUrlMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GenerateMobileSdkReleaseUrlOutput)
out.ResultMetadata = metadata
return out, nil
}
type GenerateMobileSdkReleaseUrlInput struct {
// The device platform.
//
// This member is required.
Platform types.Platform
// The release version. For the latest available version, specify LATEST .
//
// This member is required.
ReleaseVersion *string
noSmithyDocumentSerde
}
type GenerateMobileSdkReleaseUrlOutput struct {
// The presigned download URL for the specified SDK release.
Url *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGenerateMobileSdkReleaseUrlMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGenerateMobileSdkReleaseUrl{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGenerateMobileSdkReleaseUrl{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGenerateMobileSdkReleaseUrlValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGenerateMobileSdkReleaseUrl(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGenerateMobileSdkReleaseUrl(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "GenerateMobileSdkReleaseUrl",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Returns your API key in decrypted form. Use this to check the token domains
// that you have defined for the key. API keys are required for the integration of
// the CAPTCHA API in your JavaScript client applications. The API lets you
// customize the placement and characteristics of the CAPTCHA puzzle for your end
// users. For more information about the CAPTCHA JavaScript integration, see WAF
// client application integration (https://docs.aws.amazon.com/waf/latest/developerguide/waf-application-integration.html)
// in the WAF Developer Guide.
func (c *Client) GetDecryptedAPIKey(ctx context.Context, params *GetDecryptedAPIKeyInput, optFns ...func(*Options)) (*GetDecryptedAPIKeyOutput, error) {
if params == nil {
params = &GetDecryptedAPIKeyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetDecryptedAPIKey", params, optFns, c.addOperationGetDecryptedAPIKeyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetDecryptedAPIKeyOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetDecryptedAPIKeyInput struct {
// The encrypted API key.
//
// This member is required.
APIKey *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
noSmithyDocumentSerde
}
type GetDecryptedAPIKeyOutput struct {
// The date and time that the key was created.
CreationTimestamp *time.Time
// The token domains that are defined in this API key.
TokenDomains []string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetDecryptedAPIKeyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDecryptedAPIKey{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetDecryptedAPIKey{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetDecryptedAPIKeyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDecryptedAPIKey(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetDecryptedAPIKey(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "GetDecryptedAPIKey",
}
}
| 148 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the specified IPSet .
func (c *Client) GetIPSet(ctx context.Context, params *GetIPSetInput, optFns ...func(*Options)) (*GetIPSetOutput, error) {
if params == nil {
params = &GetIPSetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetIPSet", params, optFns, c.addOperationGetIPSetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetIPSetOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetIPSetInput struct {
// A unique identifier for the set. This ID is returned in the responses to create
// and list commands. You provide it to operations like update and delete.
//
// This member is required.
Id *string
// The name of the IP set. You cannot change the name of an IPSet after you create
// it.
//
// This member is required.
Name *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
noSmithyDocumentSerde
}
type GetIPSetOutput struct {
//
IPSet *types.IPSet
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
LockToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetIPSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetIPSet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetIPSet{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetIPSetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIPSet(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetIPSet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "GetIPSet",
}
}
| 154 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the LoggingConfiguration for the specified web ACL.
func (c *Client) GetLoggingConfiguration(ctx context.Context, params *GetLoggingConfigurationInput, optFns ...func(*Options)) (*GetLoggingConfigurationOutput, error) {
if params == nil {
params = &GetLoggingConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetLoggingConfiguration", params, optFns, c.addOperationGetLoggingConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetLoggingConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetLoggingConfigurationInput struct {
// The Amazon Resource Name (ARN) of the web ACL for which you want to get the
// LoggingConfiguration .
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type GetLoggingConfigurationOutput struct {
// The LoggingConfiguration for the specified web ACL.
LoggingConfiguration *types.LoggingConfiguration
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetLoggingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetLoggingConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetLoggingConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetLoggingConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLoggingConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetLoggingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "GetLoggingConfiguration",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the specified managed rule set. This is intended for use only by
// vendors of managed rule sets. Vendors are Amazon Web Services and Amazon Web
// Services Marketplace sellers. Vendors, you can use the managed rule set APIs to
// provide controlled rollout of your versioned managed rule group offerings for
// your customers. The APIs are ListManagedRuleSets , GetManagedRuleSet ,
// PutManagedRuleSetVersions , and UpdateManagedRuleSetVersionExpiryDate .
func (c *Client) GetManagedRuleSet(ctx context.Context, params *GetManagedRuleSetInput, optFns ...func(*Options)) (*GetManagedRuleSetOutput, error) {
if params == nil {
params = &GetManagedRuleSetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetManagedRuleSet", params, optFns, c.addOperationGetManagedRuleSetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetManagedRuleSetOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetManagedRuleSetInput struct {
// A unique identifier for the managed rule set. The ID is returned in the
// responses to commands like list . You provide it to operations like get and
// update .
//
// This member is required.
Id *string
// The name of the managed rule set. You use this, along with the rule set ID, to
// identify the rule set. This name is assigned to the corresponding managed rule
// group, which your customers can access and use.
//
// This member is required.
Name *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
noSmithyDocumentSerde
}
type GetManagedRuleSetOutput struct {
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
LockToken *string
// The managed rule set that you requested.
ManagedRuleSet *types.ManagedRuleSet
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetManagedRuleSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetManagedRuleSet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetManagedRuleSet{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetManagedRuleSetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetManagedRuleSet(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetManagedRuleSet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "GetManagedRuleSet",
}
}
| 161 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves information for the specified mobile SDK release, including release
// notes and tags. The mobile SDK is not generally available. Customers who have
// access to the mobile SDK can use it to establish and manage WAF tokens for use
// in HTTP(S) requests from a mobile device to WAF. For more information, see WAF
// client application integration (https://docs.aws.amazon.com/waf/latest/developerguide/waf-application-integration.html)
// in the WAF Developer Guide.
func (c *Client) GetMobileSdkRelease(ctx context.Context, params *GetMobileSdkReleaseInput, optFns ...func(*Options)) (*GetMobileSdkReleaseOutput, error) {
if params == nil {
params = &GetMobileSdkReleaseInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetMobileSdkRelease", params, optFns, c.addOperationGetMobileSdkReleaseMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetMobileSdkReleaseOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetMobileSdkReleaseInput struct {
// The device platform.
//
// This member is required.
Platform types.Platform
// The release version. For the latest available version, specify LATEST .
//
// This member is required.
ReleaseVersion *string
noSmithyDocumentSerde
}
type GetMobileSdkReleaseOutput struct {
// Information for a specified SDK release, including release notes and tags.
MobileSdkRelease *types.MobileSdkRelease
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetMobileSdkReleaseMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetMobileSdkRelease{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetMobileSdkRelease{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetMobileSdkReleaseValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMobileSdkRelease(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetMobileSdkRelease(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "GetMobileSdkRelease",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the IAM policy that is attached to the specified rule group. You must
// be the owner of the rule group to perform this operation.
func (c *Client) GetPermissionPolicy(ctx context.Context, params *GetPermissionPolicyInput, optFns ...func(*Options)) (*GetPermissionPolicyOutput, error) {
if params == nil {
params = &GetPermissionPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetPermissionPolicy", params, optFns, c.addOperationGetPermissionPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetPermissionPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetPermissionPolicyInput struct {
// The Amazon Resource Name (ARN) of the rule group for which you want to get the
// policy.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type GetPermissionPolicyOutput struct {
// The IAM policy that is attached to the specified rule group.
Policy *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetPermissionPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetPermissionPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetPermissionPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetPermissionPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPermissionPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetPermissionPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "GetPermissionPolicy",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the IP addresses that are currently blocked by a rate-based rule
// instance. This is only available for rate-based rules that aggregate solely on
// the IP address or on the forwarded IP address. The maximum number of addresses
// that can be blocked for a single rate-based rule instance is 10,000. If more
// than 10,000 addresses exceed the rate limit, those with the highest rates are
// blocked. For a rate-based rule that you've defined inside a rule group, provide
// the name of the rule group reference statement in your request, in addition to
// the rate-based rule name and the web ACL name. WAF monitors web requests and
// manages keys independently for each unique combination of web ACL, optional rule
// group, and rate-based rule. For example, if you define a rate-based rule inside
// a rule group, and then use the rule group in a web ACL, WAF monitors web
// requests and manages keys for that web ACL, rule group reference statement, and
// rate-based rule instance. If you use the same rule group in a second web ACL,
// WAF monitors web requests and manages keys for this second usage completely
// independent of your first.
func (c *Client) GetRateBasedStatementManagedKeys(ctx context.Context, params *GetRateBasedStatementManagedKeysInput, optFns ...func(*Options)) (*GetRateBasedStatementManagedKeysOutput, error) {
if params == nil {
params = &GetRateBasedStatementManagedKeysInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetRateBasedStatementManagedKeys", params, optFns, c.addOperationGetRateBasedStatementManagedKeysMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetRateBasedStatementManagedKeysOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetRateBasedStatementManagedKeysInput struct {
// The name of the rate-based rule to get the keys for. If you have the rule
// defined inside a rule group that you're using in your web ACL, also provide the
// name of the rule group reference statement in the request parameter
// RuleGroupRuleName .
//
// This member is required.
RuleName *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// The unique identifier for the web ACL. This ID is returned in the responses to
// create and list commands. You provide it to operations like update and delete.
//
// This member is required.
WebACLId *string
// The name of the web ACL. You cannot change the name of a web ACL after you
// create it.
//
// This member is required.
WebACLName *string
// The name of the rule group reference statement in your web ACL. This is
// required only when you have the rate-based rule nested inside a rule group.
RuleGroupRuleName *string
noSmithyDocumentSerde
}
type GetRateBasedStatementManagedKeysOutput struct {
// The keys that are of Internet Protocol version 4 (IPv4).
ManagedKeysIPV4 *types.RateBasedStatementManagedKeysIPSet
// The keys that are of Internet Protocol version 6 (IPv6).
ManagedKeysIPV6 *types.RateBasedStatementManagedKeysIPSet
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetRateBasedStatementManagedKeysMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRateBasedStatementManagedKeys{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetRateBasedStatementManagedKeys{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetRateBasedStatementManagedKeysValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRateBasedStatementManagedKeys(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetRateBasedStatementManagedKeys(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "GetRateBasedStatementManagedKeys",
}
}
| 174 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the specified RegexPatternSet .
func (c *Client) GetRegexPatternSet(ctx context.Context, params *GetRegexPatternSetInput, optFns ...func(*Options)) (*GetRegexPatternSetOutput, error) {
if params == nil {
params = &GetRegexPatternSetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetRegexPatternSet", params, optFns, c.addOperationGetRegexPatternSetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetRegexPatternSetOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetRegexPatternSetInput struct {
// A unique identifier for the set. This ID is returned in the responses to create
// and list commands. You provide it to operations like update and delete.
//
// This member is required.
Id *string
// The name of the set. You cannot change the name after you create the set.
//
// This member is required.
Name *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
noSmithyDocumentSerde
}
type GetRegexPatternSetOutput struct {
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
LockToken *string
//
RegexPatternSet *types.RegexPatternSet
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetRegexPatternSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRegexPatternSet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetRegexPatternSet{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetRegexPatternSetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRegexPatternSet(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetRegexPatternSet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "GetRegexPatternSet",
}
}
| 153 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the specified RuleGroup .
func (c *Client) GetRuleGroup(ctx context.Context, params *GetRuleGroupInput, optFns ...func(*Options)) (*GetRuleGroupOutput, error) {
if params == nil {
params = &GetRuleGroupInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetRuleGroup", params, optFns, c.addOperationGetRuleGroupMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetRuleGroupOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetRuleGroupInput struct {
// The Amazon Resource Name (ARN) of the entity.
ARN *string
// A unique identifier for the rule group. This ID is returned in the responses to
// create and list commands. You provide it to operations like update and delete.
Id *string
// The name of the rule group. You cannot change the name of a rule group after
// you create it.
Name *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
Scope types.Scope
noSmithyDocumentSerde
}
type GetRuleGroupOutput struct {
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
LockToken *string
//
RuleGroup *types.RuleGroup
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetRuleGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRuleGroup{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetRuleGroup{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRuleGroup(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetRuleGroup(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "GetRuleGroup",
}
}
| 148 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets detailed information about a specified number of requests--a sample--that
// WAF randomly selects from among the first 5,000 requests that your Amazon Web
// Services resource received during a time range that you choose. You can specify
// a sample size of up to 500 requests, and you can specify any time range in the
// previous three hours. GetSampledRequests returns a time range, which is usually
// the time range that you specified. However, if your resource (such as a
// CloudFront distribution) received 5,000 requests before the specified time range
// elapsed, GetSampledRequests returns an updated time range. This new time range
// indicates the actual period during which WAF selected the requests in the
// sample.
func (c *Client) GetSampledRequests(ctx context.Context, params *GetSampledRequestsInput, optFns ...func(*Options)) (*GetSampledRequestsOutput, error) {
if params == nil {
params = &GetSampledRequestsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetSampledRequests", params, optFns, c.addOperationGetSampledRequestsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetSampledRequestsOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetSampledRequestsInput struct {
// The number of requests that you want WAF to return from among the first 5,000
// requests that your Amazon Web Services resource received during the time range.
// If your resource received fewer requests than the value of MaxItems ,
// GetSampledRequests returns information about all of them.
//
// This member is required.
MaxItems int64
// The metric name assigned to the Rule or RuleGroup dimension for which you want
// a sample of requests.
//
// This member is required.
RuleMetricName *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// The start date and time and the end date and time of the range for which you
// want GetSampledRequests to return a sample of requests. You must specify the
// times in Coordinated Universal Time (UTC) format. UTC format includes the
// special designator, Z . For example, "2016-09-27T14:50Z" . You can specify any
// time range in the previous three hours. If you specify a start time that's
// earlier than three hours ago, WAF sets it to three hours ago.
//
// This member is required.
TimeWindow *types.TimeWindow
// The Amazon resource name (ARN) of the WebACL for which you want a sample of
// requests.
//
// This member is required.
WebAclArn *string
noSmithyDocumentSerde
}
type GetSampledRequestsOutput struct {
// The total number of requests from which GetSampledRequests got a sample of
// MaxItems requests. If PopulationSize is less than MaxItems , the sample includes
// every request that your Amazon Web Services resource received during the
// specified time range.
PopulationSize int64
// A complex type that contains detailed information about each of the requests in
// the sample.
SampledRequests []types.SampledHTTPRequest
// Usually, TimeWindow is the time range that you specified in the
// GetSampledRequests request. However, if your Amazon Web Services resource
// received more than 5,000 requests during the time range that you specified in
// the request, GetSampledRequests returns the time range for the first 5,000
// requests. Times are in Coordinated Universal Time (UTC) format.
TimeWindow *types.TimeWindow
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetSampledRequestsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetSampledRequests{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetSampledRequests{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetSampledRequestsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSampledRequests(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetSampledRequests(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "GetSampledRequests",
}
}
| 186 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the specified WebACL .
func (c *Client) GetWebACL(ctx context.Context, params *GetWebACLInput, optFns ...func(*Options)) (*GetWebACLOutput, error) {
if params == nil {
params = &GetWebACLInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetWebACL", params, optFns, c.addOperationGetWebACLMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetWebACLOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetWebACLInput struct {
// The unique identifier for the web ACL. This ID is returned in the responses to
// create and list commands. You provide it to operations like update and delete.
//
// This member is required.
Id *string
// The name of the web ACL. You cannot change the name of a web ACL after you
// create it.
//
// This member is required.
Name *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
noSmithyDocumentSerde
}
type GetWebACLOutput struct {
// The URL to use in SDK integrations with Amazon Web Services managed rule
// groups. For example, you can use the integration SDKs with the account takeover
// prevention managed rule group AWSManagedRulesATPRuleSet and the account
// creation fraud prevention managed rule group AWSManagedRulesACFPRuleSet . This
// is only populated if you are using a rule group in your web ACL that integrates
// with your applications in this way. For more information, see WAF client
// application integration (https://docs.aws.amazon.com/waf/latest/developerguide/waf-application-integration.html)
// in the WAF Developer Guide.
ApplicationIntegrationURL *string
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
LockToken *string
// The web ACL specification. You can modify the settings in this web ACL and use
// it to update this web ACL or create a new one.
WebACL *types.WebACL
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetWebACLMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetWebACL{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetWebACL{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetWebACLValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWebACL(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetWebACL(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "GetWebACL",
}
}
| 165 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the WebACL for the specified resource.
func (c *Client) GetWebACLForResource(ctx context.Context, params *GetWebACLForResourceInput, optFns ...func(*Options)) (*GetWebACLForResourceOutput, error) {
if params == nil {
params = &GetWebACLForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetWebACLForResource", params, optFns, c.addOperationGetWebACLForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetWebACLForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetWebACLForResourceInput struct {
// The Amazon Resource Name (ARN) of the resource whose web ACL you want to
// retrieve. The ARN must be in one of the following formats:
// - For an Application Load Balancer:
// arn:partition:elasticloadbalancing:region:account-id:loadbalancer/app/load-balancer-name/load-balancer-id
//
// - For an Amazon API Gateway REST API:
// arn:partition:apigateway:region::/restapis/api-id/stages/stage-name
// - For an AppSync GraphQL API:
// arn:partition:appsync:region:account-id:apis/GraphQLApiId
// - For an Amazon Cognito user pool:
// arn:partition:cognito-idp:region:account-id:userpool/user-pool-id
// - For an App Runner service:
// arn:partition:apprunner:region:account-id:service/apprunner-service-name/apprunner-service-id
//
// - For an Amazon Web Services Verified Access instance:
// arn:partition:ec2:region:account-id:verified-access-instance/instance-id
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type GetWebACLForResourceOutput struct {
// The web ACL that is associated with the resource. If there is no associated
// resource, WAF returns a null web ACL.
WebACL *types.WebACL
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetWebACLForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetWebACLForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetWebACLForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetWebACLForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWebACLForResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetWebACLForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "GetWebACLForResource",
}
}
| 141 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a list of the API keys that you've defined for the specified scope.
// API keys are required for the integration of the CAPTCHA API in your JavaScript
// client applications. The API lets you customize the placement and
// characteristics of the CAPTCHA puzzle for your end users. For more information
// about the CAPTCHA JavaScript integration, see WAF client application integration (https://docs.aws.amazon.com/waf/latest/developerguide/waf-application-integration.html)
// in the WAF Developer Guide.
func (c *Client) ListAPIKeys(ctx context.Context, params *ListAPIKeysInput, optFns ...func(*Options)) (*ListAPIKeysOutput, error) {
if params == nil {
params = &ListAPIKeysInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAPIKeys", params, optFns, c.addOperationListAPIKeysMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAPIKeysOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAPIKeysInput struct {
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// The maximum number of objects that you want WAF to return for this request. If
// more objects are available, in the response, WAF provides a NextMarker value
// that you can use in a subsequent call to get the next batch of objects.
Limit *int32
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
noSmithyDocumentSerde
}
type ListAPIKeysOutput struct {
// The array of key summaries. If you specified a Limit in your request, this
// might not be the full list.
APIKeySummaries []types.APIKeySummary
// The CAPTCHA application integration URL, for use in your JavaScript
// implementation.
ApplicationIntegrationURL *string
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAPIKeysMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAPIKeys{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAPIKeys{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListAPIKeysValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAPIKeys(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListAPIKeys(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "ListAPIKeys",
}
}
| 160 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves an array of managed rule groups that are available for you to use.
// This list includes all Amazon Web Services Managed Rules rule groups and all of
// the Amazon Web Services Marketplace managed rule groups that you're subscribed
// to.
func (c *Client) ListAvailableManagedRuleGroups(ctx context.Context, params *ListAvailableManagedRuleGroupsInput, optFns ...func(*Options)) (*ListAvailableManagedRuleGroupsOutput, error) {
if params == nil {
params = &ListAvailableManagedRuleGroupsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAvailableManagedRuleGroups", params, optFns, c.addOperationListAvailableManagedRuleGroupsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAvailableManagedRuleGroupsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAvailableManagedRuleGroupsInput struct {
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// The maximum number of objects that you want WAF to return for this request. If
// more objects are available, in the response, WAF provides a NextMarker value
// that you can use in a subsequent call to get the next batch of objects.
Limit *int32
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
noSmithyDocumentSerde
}
type ListAvailableManagedRuleGroupsOutput struct {
// Array of managed rule groups that you can use. If you specified a Limit in your
// request, this might not be the full list.
ManagedRuleGroups []types.ManagedRuleGroupSummary
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAvailableManagedRuleGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAvailableManagedRuleGroups{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAvailableManagedRuleGroups{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListAvailableManagedRuleGroupsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAvailableManagedRuleGroups(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListAvailableManagedRuleGroups(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "ListAvailableManagedRuleGroups",
}
}
| 154 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of the available versions for the specified managed rule group.
func (c *Client) ListAvailableManagedRuleGroupVersions(ctx context.Context, params *ListAvailableManagedRuleGroupVersionsInput, optFns ...func(*Options)) (*ListAvailableManagedRuleGroupVersionsOutput, error) {
if params == nil {
params = &ListAvailableManagedRuleGroupVersionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAvailableManagedRuleGroupVersions", params, optFns, c.addOperationListAvailableManagedRuleGroupVersionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAvailableManagedRuleGroupVersionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAvailableManagedRuleGroupVersionsInput struct {
// The name of the managed rule group. You use this, along with the vendor name,
// to identify the rule group.
//
// This member is required.
Name *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// The name of the managed rule group vendor. You use this, along with the rule
// group name, to identify a rule group.
//
// This member is required.
VendorName *string
// The maximum number of objects that you want WAF to return for this request. If
// more objects are available, in the response, WAF provides a NextMarker value
// that you can use in a subsequent call to get the next batch of objects.
Limit *int32
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
noSmithyDocumentSerde
}
type ListAvailableManagedRuleGroupVersionsOutput struct {
// The name of the version that's currently set as the default.
CurrentDefaultVersion *string
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
// The versions that are currently available for the specified managed rule group.
// If you specified a Limit in your request, this might not be the full list.
Versions []types.ManagedRuleGroupVersion
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAvailableManagedRuleGroupVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAvailableManagedRuleGroupVersions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAvailableManagedRuleGroupVersions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListAvailableManagedRuleGroupVersionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAvailableManagedRuleGroupVersions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListAvailableManagedRuleGroupVersions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "ListAvailableManagedRuleGroupVersions",
}
}
| 166 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves an array of IPSetSummary objects for the IP sets that you manage.
func (c *Client) ListIPSets(ctx context.Context, params *ListIPSetsInput, optFns ...func(*Options)) (*ListIPSetsOutput, error) {
if params == nil {
params = &ListIPSetsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListIPSets", params, optFns, c.addOperationListIPSetsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListIPSetsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListIPSetsInput struct {
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// The maximum number of objects that you want WAF to return for this request. If
// more objects are available, in the response, WAF provides a NextMarker value
// that you can use in a subsequent call to get the next batch of objects.
Limit *int32
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
noSmithyDocumentSerde
}
type ListIPSetsOutput struct {
// Array of IPSets. If you specified a Limit in your request, this might not be
// the full list.
IPSets []types.IPSetSummary
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListIPSetsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListIPSets{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListIPSets{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListIPSetsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListIPSets(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListIPSets(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "ListIPSets",
}
}
| 151 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves an array of your LoggingConfiguration objects.
func (c *Client) ListLoggingConfigurations(ctx context.Context, params *ListLoggingConfigurationsInput, optFns ...func(*Options)) (*ListLoggingConfigurationsOutput, error) {
if params == nil {
params = &ListLoggingConfigurationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListLoggingConfigurations", params, optFns, c.addOperationListLoggingConfigurationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListLoggingConfigurationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListLoggingConfigurationsInput struct {
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// The maximum number of objects that you want WAF to return for this request. If
// more objects are available, in the response, WAF provides a NextMarker value
// that you can use in a subsequent call to get the next batch of objects.
Limit *int32
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
noSmithyDocumentSerde
}
type ListLoggingConfigurationsOutput struct {
// Array of logging configurations. If you specified a Limit in your request, this
// might not be the full list.
LoggingConfigurations []types.LoggingConfiguration
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListLoggingConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListLoggingConfigurations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListLoggingConfigurations{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListLoggingConfigurationsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListLoggingConfigurations(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListLoggingConfigurations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "ListLoggingConfigurations",
}
}
| 151 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the managed rule sets that you own. This is intended for use only by
// vendors of managed rule sets. Vendors are Amazon Web Services and Amazon Web
// Services Marketplace sellers. Vendors, you can use the managed rule set APIs to
// provide controlled rollout of your versioned managed rule group offerings for
// your customers. The APIs are ListManagedRuleSets , GetManagedRuleSet ,
// PutManagedRuleSetVersions , and UpdateManagedRuleSetVersionExpiryDate .
func (c *Client) ListManagedRuleSets(ctx context.Context, params *ListManagedRuleSetsInput, optFns ...func(*Options)) (*ListManagedRuleSetsOutput, error) {
if params == nil {
params = &ListManagedRuleSetsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListManagedRuleSets", params, optFns, c.addOperationListManagedRuleSetsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListManagedRuleSetsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListManagedRuleSetsInput struct {
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// The maximum number of objects that you want WAF to return for this request. If
// more objects are available, in the response, WAF provides a NextMarker value
// that you can use in a subsequent call to get the next batch of objects.
Limit *int32
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
noSmithyDocumentSerde
}
type ListManagedRuleSetsOutput struct {
// Your managed rule sets. If you specified a Limit in your request, this might
// not be the full list.
ManagedRuleSets []types.ManagedRuleSetSummary
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListManagedRuleSetsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListManagedRuleSets{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListManagedRuleSets{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListManagedRuleSetsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListManagedRuleSets(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListManagedRuleSets(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "ListManagedRuleSets",
}
}
| 156 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a list of the available releases for the mobile SDK and the specified
// device platform. The mobile SDK is not generally available. Customers who have
// access to the mobile SDK can use it to establish and manage WAF tokens for use
// in HTTP(S) requests from a mobile device to WAF. For more information, see WAF
// client application integration (https://docs.aws.amazon.com/waf/latest/developerguide/waf-application-integration.html)
// in the WAF Developer Guide.
func (c *Client) ListMobileSdkReleases(ctx context.Context, params *ListMobileSdkReleasesInput, optFns ...func(*Options)) (*ListMobileSdkReleasesOutput, error) {
if params == nil {
params = &ListMobileSdkReleasesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListMobileSdkReleases", params, optFns, c.addOperationListMobileSdkReleasesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListMobileSdkReleasesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListMobileSdkReleasesInput struct {
// The device platform to retrieve the list for.
//
// This member is required.
Platform types.Platform
// The maximum number of objects that you want WAF to return for this request. If
// more objects are available, in the response, WAF provides a NextMarker value
// that you can use in a subsequent call to get the next batch of objects.
Limit *int32
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
noSmithyDocumentSerde
}
type ListMobileSdkReleasesOutput struct {
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
// The high level information for the available SDK releases. If you specified a
// Limit in your request, this might not be the full list.
ReleaseSummaries []types.ReleaseSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListMobileSdkReleasesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListMobileSdkReleases{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListMobileSdkReleases{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListMobileSdkReleasesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListMobileSdkReleases(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListMobileSdkReleases(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "ListMobileSdkReleases",
}
}
| 148 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves an array of RegexPatternSetSummary objects for the regex pattern sets
// that you manage.
func (c *Client) ListRegexPatternSets(ctx context.Context, params *ListRegexPatternSetsInput, optFns ...func(*Options)) (*ListRegexPatternSetsOutput, error) {
if params == nil {
params = &ListRegexPatternSetsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListRegexPatternSets", params, optFns, c.addOperationListRegexPatternSetsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListRegexPatternSetsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListRegexPatternSetsInput struct {
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// The maximum number of objects that you want WAF to return for this request. If
// more objects are available, in the response, WAF provides a NextMarker value
// that you can use in a subsequent call to get the next batch of objects.
Limit *int32
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
noSmithyDocumentSerde
}
type ListRegexPatternSetsOutput struct {
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
// Array of regex pattern sets. If you specified a Limit in your request, this
// might not be the full list.
RegexPatternSets []types.RegexPatternSetSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListRegexPatternSetsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListRegexPatternSets{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListRegexPatternSets{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListRegexPatternSetsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRegexPatternSets(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListRegexPatternSets(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "ListRegexPatternSets",
}
}
| 152 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves an array of the Amazon Resource Names (ARNs) for the regional
// resources that are associated with the specified web ACL. If you want the list
// of Amazon CloudFront resources, use the CloudFront call
// ListDistributionsByWebACLId .
func (c *Client) ListResourcesForWebACL(ctx context.Context, params *ListResourcesForWebACLInput, optFns ...func(*Options)) (*ListResourcesForWebACLOutput, error) {
if params == nil {
params = &ListResourcesForWebACLInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListResourcesForWebACL", params, optFns, c.addOperationListResourcesForWebACLMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListResourcesForWebACLOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListResourcesForWebACLInput struct {
// The Amazon Resource Name (ARN) of the web ACL.
//
// This member is required.
WebACLArn *string
// Used for web ACLs that are scoped for regional applications. A regional
// application can be an Application Load Balancer (ALB), an Amazon API Gateway
// REST API, an AppSync GraphQL API, an Amazon Cognito user pool, an App Runner
// service, or an Amazon Web Services Verified Access instance. If you don't
// provide a resource type, the call uses the resource type
// APPLICATION_LOAD_BALANCER . Default: APPLICATION_LOAD_BALANCER
ResourceType types.ResourceType
noSmithyDocumentSerde
}
type ListResourcesForWebACLOutput struct {
// The array of Amazon Resource Names (ARNs) of the associated resources.
ResourceArns []string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListResourcesForWebACLMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListResourcesForWebACL{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListResourcesForWebACL{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListResourcesForWebACLValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListResourcesForWebACL(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListResourcesForWebACL(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "ListResourcesForWebACL",
}
}
| 136 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves an array of RuleGroupSummary objects for the rule groups that you
// manage.
func (c *Client) ListRuleGroups(ctx context.Context, params *ListRuleGroupsInput, optFns ...func(*Options)) (*ListRuleGroupsOutput, error) {
if params == nil {
params = &ListRuleGroupsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListRuleGroups", params, optFns, c.addOperationListRuleGroupsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListRuleGroupsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListRuleGroupsInput struct {
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// The maximum number of objects that you want WAF to return for this request. If
// more objects are available, in the response, WAF provides a NextMarker value
// that you can use in a subsequent call to get the next batch of objects.
Limit *int32
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
noSmithyDocumentSerde
}
type ListRuleGroupsOutput struct {
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
// Array of rule groups. If you specified a Limit in your request, this might not
// be the full list.
RuleGroups []types.RuleGroupSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListRuleGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListRuleGroups{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListRuleGroups{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListRuleGroupsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRuleGroups(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListRuleGroups(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "ListRuleGroups",
}
}
| 152 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the TagInfoForResource for the specified resource. Tags are key:value
// pairs that you can use to categorize and manage your resources, for purposes
// like billing. For example, you might set the tag key to "customer" and the value
// to the customer name or ID. You can specify one or more tags to add to each
// Amazon Web Services resource, up to 50 tags for a resource. You can tag the
// Amazon Web Services resources that you manage through WAF: web ACLs, rule
// groups, IP sets, and regex pattern sets. You can't manage or view tags through
// the WAF console.
func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {
if params == nil {
params = &ListTagsForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTagsForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTagsForResourceInput struct {
// The Amazon Resource Name (ARN) of the resource.
//
// This member is required.
ResourceARN *string
// The maximum number of objects that you want WAF to return for this request. If
// more objects are available, in the response, WAF provides a NextMarker value
// that you can use in a subsequent call to get the next batch of objects.
Limit *int32
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
// The collection of tagging definitions for the resource. If you specified a Limit
// in your request, this might not be the full list.
TagInfoForResource *types.TagInfoForResource
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "ListTagsForResource",
}
}
| 150 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves an array of WebACLSummary objects for the web ACLs that you manage.
func (c *Client) ListWebACLs(ctx context.Context, params *ListWebACLsInput, optFns ...func(*Options)) (*ListWebACLsOutput, error) {
if params == nil {
params = &ListWebACLsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListWebACLs", params, optFns, c.addOperationListWebACLsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListWebACLsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListWebACLsInput struct {
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// The maximum number of objects that you want WAF to return for this request. If
// more objects are available, in the response, WAF provides a NextMarker value
// that you can use in a subsequent call to get the next batch of objects.
Limit *int32
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
noSmithyDocumentSerde
}
type ListWebACLsOutput struct {
// When you request a list of objects with a Limit setting, if the number of
// objects that are still available for retrieval exceeds the limit, WAF returns a
// NextMarker value in the response. To retrieve the next batch of objects, provide
// the marker from the prior call in your next request.
NextMarker *string
// Array of web ACLs. If you specified a Limit in your request, this might not be
// the full list.
WebACLs []types.WebACLSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListWebACLsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListWebACLs{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListWebACLs{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListWebACLsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListWebACLs(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListWebACLs(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "ListWebACLs",
}
}
| 151 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Enables the specified LoggingConfiguration , to start logging from a web ACL,
// according to the configuration provided. This operation completely replaces any
// mutable specifications that you already have for a logging configuration with
// the ones that you provide to this call. To modify an existing logging
// configuration, do the following:
// - Retrieve it by calling GetLoggingConfiguration
// - Update its settings as needed
// - Provide the complete logging configuration specification to this call
//
// You can define one logging destination per web ACL. You can access information
// about the traffic that WAF inspects using the following steps:
// - Create your logging destination. You can use an Amazon CloudWatch Logs log
// group, an Amazon Simple Storage Service (Amazon S3) bucket, or an Amazon Kinesis
// Data Firehose. The name that you give the destination must start with
// aws-waf-logs- . Depending on the type of destination, you might need to
// configure additional settings or permissions. For configuration requirements and
// pricing information for each destination type, see Logging web ACL traffic (https://docs.aws.amazon.com/waf/latest/developerguide/logging.html)
// in the WAF Developer Guide.
// - Associate your logging destination to your web ACL using a
// PutLoggingConfiguration request.
//
// When you successfully enable logging using a PutLoggingConfiguration request,
// WAF creates an additional role or policy that is required to write logs to the
// logging destination. For an Amazon CloudWatch Logs log group, WAF creates a
// resource policy on the log group. For an Amazon S3 bucket, WAF creates a bucket
// policy. For an Amazon Kinesis Data Firehose, WAF creates a service-linked role.
// For additional information about web ACL logging, see Logging web ACL traffic
// information (https://docs.aws.amazon.com/waf/latest/developerguide/logging.html)
// in the WAF Developer Guide.
func (c *Client) PutLoggingConfiguration(ctx context.Context, params *PutLoggingConfigurationInput, optFns ...func(*Options)) (*PutLoggingConfigurationOutput, error) {
if params == nil {
params = &PutLoggingConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutLoggingConfiguration", params, optFns, c.addOperationPutLoggingConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutLoggingConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutLoggingConfigurationInput struct {
//
//
// This member is required.
LoggingConfiguration *types.LoggingConfiguration
noSmithyDocumentSerde
}
type PutLoggingConfigurationOutput struct {
//
LoggingConfiguration *types.LoggingConfiguration
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutLoggingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutLoggingConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutLoggingConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutLoggingConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutLoggingConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opPutLoggingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "PutLoggingConfiguration",
}
}
| 153 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Defines the versions of your managed rule set that you are offering to the
// customers. Customers see your offerings as managed rule groups with versioning.
// This is intended for use only by vendors of managed rule sets. Vendors are
// Amazon Web Services and Amazon Web Services Marketplace sellers. Vendors, you
// can use the managed rule set APIs to provide controlled rollout of your
// versioned managed rule group offerings for your customers. The APIs are
// ListManagedRuleSets , GetManagedRuleSet , PutManagedRuleSetVersions , and
// UpdateManagedRuleSetVersionExpiryDate . Customers retrieve their managed rule
// group list by calling ListAvailableManagedRuleGroups . The name that you provide
// here for your managed rule set is the name the customer sees for the
// corresponding managed rule group. Customers can retrieve the available versions
// for a managed rule group by calling ListAvailableManagedRuleGroupVersions . You
// provide a rule group specification for each version. For each managed rule set,
// you must specify a version that you recommend using. To initiate the expiration
// of a managed rule group version, use UpdateManagedRuleSetVersionExpiryDate .
func (c *Client) PutManagedRuleSetVersions(ctx context.Context, params *PutManagedRuleSetVersionsInput, optFns ...func(*Options)) (*PutManagedRuleSetVersionsOutput, error) {
if params == nil {
params = &PutManagedRuleSetVersionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutManagedRuleSetVersions", params, optFns, c.addOperationPutManagedRuleSetVersionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutManagedRuleSetVersionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutManagedRuleSetVersionsInput struct {
// A unique identifier for the managed rule set. The ID is returned in the
// responses to commands like list . You provide it to operations like get and
// update .
//
// This member is required.
Id *string
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
//
// This member is required.
LockToken *string
// The name of the managed rule set. You use this, along with the rule set ID, to
// identify the rule set. This name is assigned to the corresponding managed rule
// group, which your customers can access and use.
//
// This member is required.
Name *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// The version of the named managed rule group that you'd like your customers to
// choose, from among your version offerings.
RecommendedVersion *string
// The versions of the named managed rule group that you want to offer to your
// customers.
VersionsToPublish map[string]types.VersionToPublish
noSmithyDocumentSerde
}
type PutManagedRuleSetVersionsOutput struct {
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
NextLockToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutManagedRuleSetVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutManagedRuleSetVersions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutManagedRuleSetVersions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutManagedRuleSetVersionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutManagedRuleSetVersions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opPutManagedRuleSetVersions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "PutManagedRuleSetVersions",
}
}
| 186 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Attaches an IAM policy to the specified resource. Use this to share a rule
// group across accounts. You must be the owner of the rule group to perform this
// operation. This action is subject to the following restrictions:
// - You can attach only one policy with each PutPermissionPolicy request.
// - The ARN in the request must be a valid WAF RuleGroup ARN and the rule group
// must exist in the same Region.
// - The user making the request must be the owner of the rule group.
func (c *Client) PutPermissionPolicy(ctx context.Context, params *PutPermissionPolicyInput, optFns ...func(*Options)) (*PutPermissionPolicyOutput, error) {
if params == nil {
params = &PutPermissionPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutPermissionPolicy", params, optFns, c.addOperationPutPermissionPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutPermissionPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutPermissionPolicyInput struct {
// The policy to attach to the specified rule group. The policy specifications
// must conform to the following:
// - The policy must be composed using IAM Policy version 2012-10-17.
// - The policy must include specifications for Effect , Action , and Principal .
// - Effect must specify Allow .
// - 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.
// For more information, see IAM Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)
// .
//
// This member is required.
Policy *string
// The Amazon Resource Name (ARN) of the RuleGroup to which you want to attach the
// policy.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type PutPermissionPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutPermissionPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutPermissionPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutPermissionPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutPermissionPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutPermissionPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opPutPermissionPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "PutPermissionPolicy",
}
}
| 143 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Associates tags with the specified Amazon Web Services resource. Tags are
// key:value pairs that you can use to categorize and manage your resources, for
// purposes like billing. For example, you might set the tag key to "customer" and
// the value to the customer name or ID. You can specify one or more tags to add to
// each Amazon Web Services resource, up to 50 tags for a resource. You can tag the
// Amazon Web Services resources that you manage through WAF: web ACLs, rule
// groups, IP sets, and regex pattern sets. You can't manage or view tags through
// the WAF console.
func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) {
if params == nil {
params = &TagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*TagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type TagResourceInput struct {
// The Amazon Resource Name (ARN) of the resource.
//
// This member is required.
ResourceARN *string
// An array of key:value pairs to associate with the resource.
//
// This member is required.
Tags []types.Tag
noSmithyDocumentSerde
}
type TagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpTagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "TagResource",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Disassociates tags from an Amazon Web Services resource. Tags are key:value
// pairs that you can associate with Amazon Web Services resources. For example,
// the tag key might be "customer" and the tag value might be "companyA." You can
// specify one or more tags to add to each container. You can add up to 50 tags to
// each Amazon Web Services resource.
func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) {
if params == nil {
params = &UntagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UntagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type UntagResourceInput struct {
// The Amazon Resource Name (ARN) of the resource.
//
// This member is required.
ResourceARN *string
// An array of keys identifying the tags to disassociate from the resource.
//
// This member is required.
TagKeys []string
noSmithyDocumentSerde
}
type UntagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUntagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "UntagResource",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the specified IPSet . This operation completely replaces the mutable
// specifications that you already have for the IP set with the ones that you
// provide to this call. To modify an IP set, do the following:
// - Retrieve it by calling GetIPSet
// - Update its settings as needed
// - Provide the complete IP set specification to this call
//
// When you make changes to web ACLs or web ACL components, like rules and rule
// groups, WAF propagates the changes everywhere that the web ACL and its
// components are stored and used. Your changes are applied within seconds, but
// there might be a brief period of inconsistency when the changes have arrived in
// some places and not in others. So, for example, if you change a rule action
// setting, the action might be the old action in one area and the new action in
// another area. Or if you add an IP address to an IP set used in a blocking rule,
// the new address might briefly be blocked in one area while still allowed in
// another. This temporary inconsistency can occur when you first associate a web
// ACL with an Amazon Web Services resource and when you change a web ACL that is
// already associated with a resource. Generally, any inconsistencies of this type
// last only a few seconds.
func (c *Client) UpdateIPSet(ctx context.Context, params *UpdateIPSetInput, optFns ...func(*Options)) (*UpdateIPSetOutput, error) {
if params == nil {
params = &UpdateIPSetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateIPSet", params, optFns, c.addOperationUpdateIPSetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateIPSetOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateIPSetInput struct {
// Contains an array of strings that specifies zero or more IP addresses or blocks
// of IP addresses. All addresses must be specified using Classless Inter-Domain
// Routing (CIDR) notation. WAF supports all IPv4 and IPv6 CIDR ranges except for
// /0 . Example address strings:
// - To configure WAF to allow, block, or count requests that originated from
// the IP address 192.0.2.44, specify 192.0.2.44/32 .
// - To configure WAF to allow, block, or count requests that originated from IP
// addresses from 192.0.2.0 to 192.0.2.255, specify 192.0.2.0/24 .
// - To configure WAF to allow, block, or count requests that originated from
// the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify
// 1111:0000:0000:0000:0000:0000:0000:0111/128 .
// - To configure WAF to allow, block, or count requests that originated from IP
// addresses 1111:0000:0000:0000:0000:0000:0000:0000 to
// 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify
// 1111:0000:0000:0000:0000:0000:0000:0000/64 .
// For more information about CIDR notation, see the Wikipedia entry Classless
// Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
// . Example JSON Addresses specifications:
// - Empty array: "Addresses": []
// - Array with one address: "Addresses": ["192.0.2.44/32"]
// - Array with three addresses: "Addresses": ["192.0.2.44/32", "192.0.2.0/24",
// "192.0.0.0/16"]
// - INVALID specification: "Addresses": [""] INVALID
//
// This member is required.
Addresses []string
// A unique identifier for the set. This ID is returned in the responses to create
// and list commands. You provide it to operations like update and delete.
//
// This member is required.
Id *string
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
//
// This member is required.
LockToken *string
// The name of the IP set. You cannot change the name of an IPSet after you create
// it.
//
// This member is required.
Name *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// A description of the IP set that helps with identification.
Description *string
noSmithyDocumentSerde
}
type UpdateIPSetOutput struct {
// A token used for optimistic locking. WAF returns this token to your update
// requests. You use NextLockToken in the same manner as you use LockToken .
NextLockToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateIPSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateIPSet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateIPSet{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateIPSetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateIPSet(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateIPSet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "UpdateIPSet",
}
}
| 205 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates the expiration information for your managed rule set. Use this to
// initiate the expiration of a managed rule group version. After you initiate
// expiration for a version, WAF excludes it from the response to
// ListAvailableManagedRuleGroupVersions for the managed rule group. This is
// intended for use only by vendors of managed rule sets. Vendors are Amazon Web
// Services and Amazon Web Services Marketplace sellers. Vendors, you can use the
// managed rule set APIs to provide controlled rollout of your versioned managed
// rule group offerings for your customers. The APIs are ListManagedRuleSets ,
// GetManagedRuleSet , PutManagedRuleSetVersions , and
// UpdateManagedRuleSetVersionExpiryDate .
func (c *Client) UpdateManagedRuleSetVersionExpiryDate(ctx context.Context, params *UpdateManagedRuleSetVersionExpiryDateInput, optFns ...func(*Options)) (*UpdateManagedRuleSetVersionExpiryDateOutput, error) {
if params == nil {
params = &UpdateManagedRuleSetVersionExpiryDateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateManagedRuleSetVersionExpiryDate", params, optFns, c.addOperationUpdateManagedRuleSetVersionExpiryDateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateManagedRuleSetVersionExpiryDateOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateManagedRuleSetVersionExpiryDateInput struct {
// The time that you want the version to expire. Times are in Coordinated
// Universal Time (UTC) format. UTC format includes the special designator, Z. For
// example, "2016-09-27T14:50Z".
//
// This member is required.
ExpiryTimestamp *time.Time
// A unique identifier for the managed rule set. The ID is returned in the
// responses to commands like list . You provide it to operations like get and
// update .
//
// This member is required.
Id *string
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
//
// This member is required.
LockToken *string
// The name of the managed rule set. You use this, along with the rule set ID, to
// identify the rule set. This name is assigned to the corresponding managed rule
// group, which your customers can access and use.
//
// This member is required.
Name *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// The version that you want to remove from your list of offerings for the named
// managed rule group.
//
// This member is required.
VersionToExpire *string
noSmithyDocumentSerde
}
type UpdateManagedRuleSetVersionExpiryDateOutput struct {
// The version that is set to expire.
ExpiringVersion *string
// The time that the version will expire. Times are in Coordinated Universal Time
// (UTC) format. UTC format includes the special designator, Z. For example,
// "2016-09-27T14:50Z".
ExpiryTimestamp *time.Time
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
NextLockToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateManagedRuleSetVersionExpiryDateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateManagedRuleSetVersionExpiryDate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateManagedRuleSetVersionExpiryDate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateManagedRuleSetVersionExpiryDateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateManagedRuleSetVersionExpiryDate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateManagedRuleSetVersionExpiryDate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "UpdateManagedRuleSetVersionExpiryDate",
}
}
| 195 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the specified RegexPatternSet . This operation completely replaces the
// mutable specifications that you already have for the regex pattern set with the
// ones that you provide to this call. To modify a regex pattern set, do the
// following:
// - Retrieve it by calling GetRegexPatternSet
// - Update its settings as needed
// - Provide the complete regex pattern set specification to this call
//
// When you make changes to web ACLs or web ACL components, like rules and rule
// groups, WAF propagates the changes everywhere that the web ACL and its
// components are stored and used. Your changes are applied within seconds, but
// there might be a brief period of inconsistency when the changes have arrived in
// some places and not in others. So, for example, if you change a rule action
// setting, the action might be the old action in one area and the new action in
// another area. Or if you add an IP address to an IP set used in a blocking rule,
// the new address might briefly be blocked in one area while still allowed in
// another. This temporary inconsistency can occur when you first associate a web
// ACL with an Amazon Web Services resource and when you change a web ACL that is
// already associated with a resource. Generally, any inconsistencies of this type
// last only a few seconds.
func (c *Client) UpdateRegexPatternSet(ctx context.Context, params *UpdateRegexPatternSetInput, optFns ...func(*Options)) (*UpdateRegexPatternSetOutput, error) {
if params == nil {
params = &UpdateRegexPatternSetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateRegexPatternSet", params, optFns, c.addOperationUpdateRegexPatternSetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateRegexPatternSetOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateRegexPatternSetInput struct {
// A unique identifier for the set. This ID is returned in the responses to create
// and list commands. You provide it to operations like update and delete.
//
// This member is required.
Id *string
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
//
// This member is required.
LockToken *string
// The name of the set. You cannot change the name after you create the set.
//
// This member is required.
Name *string
//
//
// This member is required.
RegularExpressionList []types.Regex
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// A description of the set that helps with identification.
Description *string
noSmithyDocumentSerde
}
type UpdateRegexPatternSetOutput struct {
// A token used for optimistic locking. WAF returns this token to your update
// requests. You use NextLockToken in the same manner as you use LockToken .
NextLockToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateRegexPatternSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateRegexPatternSet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateRegexPatternSet{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateRegexPatternSetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRegexPatternSet(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateRegexPatternSet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "UpdateRegexPatternSet",
}
}
| 183 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the specified RuleGroup . This operation completely replaces the mutable
// specifications that you already have for the rule group with the ones that you
// provide to this call. To modify a rule group, do the following:
// - Retrieve it by calling GetRuleGroup
// - Update its settings as needed
// - Provide the complete rule group specification to this call
//
// When you make changes to web ACLs or web ACL components, like rules and rule
// groups, WAF propagates the changes everywhere that the web ACL and its
// components are stored and used. Your changes are applied within seconds, but
// there might be a brief period of inconsistency when the changes have arrived in
// some places and not in others. So, for example, if you change a rule action
// setting, the action might be the old action in one area and the new action in
// another area. Or if you add an IP address to an IP set used in a blocking rule,
// the new address might briefly be blocked in one area while still allowed in
// another. This temporary inconsistency can occur when you first associate a web
// ACL with an Amazon Web Services resource and when you change a web ACL that is
// already associated with a resource. Generally, any inconsistencies of this type
// last only a few seconds. A rule group defines a collection of rules to inspect
// and control web requests that you can use in a WebACL . When you create a rule
// group, you define an immutable capacity limit. If you update a rule group, you
// must stay within the capacity. This allows others to reuse the rule group with
// confidence in its capacity requirements.
func (c *Client) UpdateRuleGroup(ctx context.Context, params *UpdateRuleGroupInput, optFns ...func(*Options)) (*UpdateRuleGroupOutput, error) {
if params == nil {
params = &UpdateRuleGroupInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateRuleGroup", params, optFns, c.addOperationUpdateRuleGroupMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateRuleGroupOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateRuleGroupInput struct {
// A unique identifier for the rule group. This ID is returned in the responses to
// create and list commands. You provide it to operations like update and delete.
//
// This member is required.
Id *string
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
//
// This member is required.
LockToken *string
// The name of the rule group. You cannot change the name of a rule group after
// you create it.
//
// This member is required.
Name *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// Defines and enables Amazon CloudWatch metrics and web request sample collection.
//
// This member is required.
VisibilityConfig *types.VisibilityConfig
// A map of custom response keys and content bodies. When you create a rule with a
// block action, you can send a custom response to the web request. You define
// these for the rule group, and then use them in the rules that you define in the
// rule group. For information about customizing web requests and responses, see
// Customizing web requests and responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html)
// in the WAF Developer Guide. For information about the limits on count and size
// for custom request and response settings, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html)
// in the WAF Developer Guide.
CustomResponseBodies map[string]types.CustomResponseBody
// A description of the rule group that helps with identification.
Description *string
// The Rule statements used to identify the web requests that you want to allow,
// block, or count. Each rule includes one top-level statement that WAF uses to
// identify matching web requests, and parameters that govern how WAF handles them.
Rules []types.Rule
noSmithyDocumentSerde
}
type UpdateRuleGroupOutput struct {
// A token used for optimistic locking. WAF returns this token to your update
// requests. You use NextLockToken in the same manner as you use LockToken .
NextLockToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateRuleGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateRuleGroup{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateRuleGroup{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateRuleGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRuleGroup(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateRuleGroup(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "UpdateRuleGroup",
}
}
| 202 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the specified WebACL . While updating a web ACL, WAF provides continuous
// coverage to the resources that you have associated with the web ACL. This
// operation completely replaces the mutable specifications that you already have
// for the web ACL with the ones that you provide to this call. To modify a web
// ACL, do the following:
// - Retrieve it by calling GetWebACL
// - Update its settings as needed
// - Provide the complete web ACL specification to this call
//
// When you make changes to web ACLs or web ACL components, like rules and rule
// groups, WAF propagates the changes everywhere that the web ACL and its
// components are stored and used. Your changes are applied within seconds, but
// there might be a brief period of inconsistency when the changes have arrived in
// some places and not in others. So, for example, if you change a rule action
// setting, the action might be the old action in one area and the new action in
// another area. Or if you add an IP address to an IP set used in a blocking rule,
// the new address might briefly be blocked in one area while still allowed in
// another. This temporary inconsistency can occur when you first associate a web
// ACL with an Amazon Web Services resource and when you change a web ACL that is
// already associated with a resource. Generally, any inconsistencies of this type
// last only a few seconds. A web ACL defines a collection of rules to use to
// inspect and control web requests. Each rule has an action defined (allow, block,
// or count) for requests that match the statement of the rule. In the web ACL, you
// assign a default action to take (allow, block) for any request that does not
// match any of the rules. The rules in a web ACL can be a combination of the types
// Rule , RuleGroup , and managed rule group. You can associate a web ACL with one
// or more Amazon Web Services resources to protect. The resources can be an Amazon
// CloudFront distribution, an Amazon API Gateway REST API, an Application Load
// Balancer, an AppSync GraphQL API, an Amazon Cognito user pool, an App Runner
// service, or an Amazon Web Services Verified Access instance.
func (c *Client) UpdateWebACL(ctx context.Context, params *UpdateWebACLInput, optFns ...func(*Options)) (*UpdateWebACLOutput, error) {
if params == nil {
params = &UpdateWebACLInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateWebACL", params, optFns, c.addOperationUpdateWebACLMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateWebACLOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateWebACLInput struct {
// The action to perform if none of the Rules contained in the WebACL match.
//
// This member is required.
DefaultAction *types.DefaultAction
// The unique identifier for the web ACL. This ID is returned in the responses to
// create and list commands. You provide it to operations like update and delete.
//
// This member is required.
Id *string
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
//
// This member is required.
LockToken *string
// The name of the web ACL. You cannot change the name of a web ACL after you
// create it.
//
// This member is required.
Name *string
// Specifies whether this is for an Amazon CloudFront distribution or for a
// regional application. A regional application can be an Application Load Balancer
// (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito
// user pool, an App Runner service, or an Amazon Web Services Verified Access
// instance. To work with CloudFront, you must also specify the Region US East (N.
// Virginia) as follows:
// - CLI - Specify the Region when you use the CloudFront scope:
// --scope=CLOUDFRONT --region=us-east-1 .
// - API and SDKs - For all calls, use the Region endpoint us-east-1.
//
// This member is required.
Scope types.Scope
// Defines and enables Amazon CloudWatch metrics and web request sample collection.
//
// This member is required.
VisibilityConfig *types.VisibilityConfig
// Specifies custom configurations for the associations between the web ACL and
// protected resources. Use this to customize the maximum size of the request body
// that your protected CloudFront distributions forward to WAF for inspection. The
// default is 16 KB (16,384 kilobytes). You are charged additional fees when your
// protected resources forward body sizes that are larger than the default. For
// more information, see WAF Pricing (http://aws.amazon.com/waf/pricing/) .
AssociationConfig *types.AssociationConfig
// Specifies how WAF should handle CAPTCHA evaluations for rules that don't have
// their own CaptchaConfig settings. If you don't specify this, WAF uses its
// default settings for CaptchaConfig .
CaptchaConfig *types.CaptchaConfig
// Specifies how WAF should handle challenge evaluations for rules that don't have
// their own ChallengeConfig settings. If you don't specify this, WAF uses its
// default settings for ChallengeConfig .
ChallengeConfig *types.ChallengeConfig
// A map of custom response keys and content bodies. When you create a rule with a
// block action, you can send a custom response to the web request. You define
// these for the web ACL, and then use them in the rules and default actions that
// you define in the web ACL. For information about customizing web requests and
// responses, see Customizing web requests and responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html)
// in the WAF Developer Guide. For information about the limits on count and size
// for custom request and response settings, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html)
// in the WAF Developer Guide.
CustomResponseBodies map[string]types.CustomResponseBody
// A description of the web ACL that helps with identification.
Description *string
// The Rule statements used to identify the web requests that you want to allow,
// block, or count. Each rule includes one top-level statement that WAF uses to
// identify matching web requests, and parameters that govern how WAF handles them.
Rules []types.Rule
// Specifies the domains that WAF should accept in a web request token. This
// enables the use of tokens across multiple protected websites. When WAF provides
// a token, it uses the domain of the Amazon Web Services resource that the web ACL
// is protecting. If you don't specify a list of token domains, WAF accepts tokens
// only for the domain of the protected resource. With a token domain list, WAF
// accepts the resource's host domain plus all domains in the token domain list,
// including their prefixed subdomains. Example JSON: "TokenDomains": {
// "mywebsite.com", "myotherwebsite.com" } Public suffixes aren't allowed. For
// example, you can't use usa.gov or co.uk as token domains.
TokenDomains []string
noSmithyDocumentSerde
}
type UpdateWebACLOutput struct {
// A token used for optimistic locking. WAF returns this token to your update
// requests. You use NextLockToken in the same manner as you use LockToken .
NextLockToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateWebACLMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateWebACL{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateWebACL{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateWebACLValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateWebACL(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateWebACL(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wafv2",
OperationName: "UpdateWebACL",
}
}
| 243 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"bytes"
"context"
"encoding/base64"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
smithy "github.com/aws/smithy-go"
smithyio "github.com/aws/smithy-go/io"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"strings"
)
type awsAwsjson11_deserializeOpAssociateWebACL struct {
}
func (*awsAwsjson11_deserializeOpAssociateWebACL) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAssociateWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorAssociateWebACL(response, &metadata)
}
output := &AssociateWebACLOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentAssociateWebACLOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorAssociateWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFUnavailableEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFUnavailableEntityException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCheckCapacity struct {
}
func (*awsAwsjson11_deserializeOpCheckCapacity) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCheckCapacity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCheckCapacity(response, &metadata)
}
output := &CheckCapacityOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCheckCapacityOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCheckCapacity(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFExpiredManagedRuleGroupVersionException", errorCode):
return awsAwsjson11_deserializeErrorWAFExpiredManagedRuleGroupVersionException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFInvalidResourceException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidResourceException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFSubscriptionNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorWAFSubscriptionNotFoundException(response, errorBody)
case strings.EqualFold("WAFUnavailableEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFUnavailableEntityException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateAPIKey struct {
}
func (*awsAwsjson11_deserializeOpCreateAPIKey) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateAPIKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateAPIKey(response, &metadata)
}
output := &CreateAPIKeyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateAPIKeyOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateAPIKey(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateIPSet struct {
}
func (*awsAwsjson11_deserializeOpCreateIPSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateIPSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateIPSet(response, &metadata)
}
output := &CreateIPSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateIPSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateIPSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFDuplicateItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFDuplicateItemException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFOptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorWAFOptimisticLockException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateRegexPatternSet struct {
}
func (*awsAwsjson11_deserializeOpCreateRegexPatternSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateRegexPatternSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateRegexPatternSet(response, &metadata)
}
output := &CreateRegexPatternSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateRegexPatternSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateRegexPatternSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFDuplicateItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFDuplicateItemException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFOptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorWAFOptimisticLockException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateRuleGroup struct {
}
func (*awsAwsjson11_deserializeOpCreateRuleGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateRuleGroup(response, &metadata)
}
output := &CreateRuleGroupOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateRuleGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFDuplicateItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFDuplicateItemException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFOptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorWAFOptimisticLockException(response, errorBody)
case strings.EqualFold("WAFSubscriptionNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorWAFSubscriptionNotFoundException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
case strings.EqualFold("WAFUnavailableEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFUnavailableEntityException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateWebACL struct {
}
func (*awsAwsjson11_deserializeOpCreateWebACL) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateWebACL(response, &metadata)
}
output := &CreateWebACLOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateWebACLOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFConfigurationWarningException", errorCode):
return awsAwsjson11_deserializeErrorWAFConfigurationWarningException(response, errorBody)
case strings.EqualFold("WAFDuplicateItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFDuplicateItemException(response, errorBody)
case strings.EqualFold("WAFExpiredManagedRuleGroupVersionException", errorCode):
return awsAwsjson11_deserializeErrorWAFExpiredManagedRuleGroupVersionException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFInvalidResourceException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidResourceException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFOptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorWAFOptimisticLockException(response, errorBody)
case strings.EqualFold("WAFSubscriptionNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorWAFSubscriptionNotFoundException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
case strings.EqualFold("WAFUnavailableEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFUnavailableEntityException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteFirewallManagerRuleGroups struct {
}
func (*awsAwsjson11_deserializeOpDeleteFirewallManagerRuleGroups) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteFirewallManagerRuleGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteFirewallManagerRuleGroups(response, &metadata)
}
output := &DeleteFirewallManagerRuleGroupsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteFirewallManagerRuleGroupsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteFirewallManagerRuleGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFOptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorWAFOptimisticLockException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteIPSet struct {
}
func (*awsAwsjson11_deserializeOpDeleteIPSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteIPSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteIPSet(response, &metadata)
}
output := &DeleteIPSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteIPSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteIPSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFAssociatedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFAssociatedItemException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFOptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorWAFOptimisticLockException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteLoggingConfiguration struct {
}
func (*awsAwsjson11_deserializeOpDeleteLoggingConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteLoggingConfiguration(response, &metadata)
}
output := &DeleteLoggingConfigurationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteLoggingConfigurationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFOptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorWAFOptimisticLockException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeletePermissionPolicy struct {
}
func (*awsAwsjson11_deserializeOpDeletePermissionPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeletePermissionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeletePermissionPolicy(response, &metadata)
}
output := &DeletePermissionPolicyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeletePermissionPolicyOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeletePermissionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteRegexPatternSet struct {
}
func (*awsAwsjson11_deserializeOpDeleteRegexPatternSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteRegexPatternSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRegexPatternSet(response, &metadata)
}
output := &DeleteRegexPatternSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteRegexPatternSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteRegexPatternSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFAssociatedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFAssociatedItemException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFOptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorWAFOptimisticLockException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteRuleGroup struct {
}
func (*awsAwsjson11_deserializeOpDeleteRuleGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRuleGroup(response, &metadata)
}
output := &DeleteRuleGroupOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteRuleGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFAssociatedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFAssociatedItemException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFOptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorWAFOptimisticLockException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteWebACL struct {
}
func (*awsAwsjson11_deserializeOpDeleteWebACL) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteWebACL(response, &metadata)
}
output := &DeleteWebACLOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteWebACLOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFAssociatedItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFAssociatedItemException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFOptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorWAFOptimisticLockException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeAllManagedProducts struct {
}
func (*awsAwsjson11_deserializeOpDescribeAllManagedProducts) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeAllManagedProducts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDescribeAllManagedProducts(response, &metadata)
}
output := &DescribeAllManagedProductsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDescribeAllManagedProductsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDescribeAllManagedProducts(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeManagedProductsByVendor struct {
}
func (*awsAwsjson11_deserializeOpDescribeManagedProductsByVendor) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeManagedProductsByVendor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDescribeManagedProductsByVendor(response, &metadata)
}
output := &DescribeManagedProductsByVendorOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDescribeManagedProductsByVendorOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDescribeManagedProductsByVendor(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeManagedRuleGroup struct {
}
func (*awsAwsjson11_deserializeOpDescribeManagedRuleGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeManagedRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDescribeManagedRuleGroup(response, &metadata)
}
output := &DescribeManagedRuleGroupOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDescribeManagedRuleGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDescribeManagedRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFExpiredManagedRuleGroupVersionException", errorCode):
return awsAwsjson11_deserializeErrorWAFExpiredManagedRuleGroupVersionException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFInvalidResourceException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidResourceException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDisassociateWebACL struct {
}
func (*awsAwsjson11_deserializeOpDisassociateWebACL) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDisassociateWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDisassociateWebACL(response, &metadata)
}
output := &DisassociateWebACLOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDisassociateWebACLOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDisassociateWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGenerateMobileSdkReleaseUrl struct {
}
func (*awsAwsjson11_deserializeOpGenerateMobileSdkReleaseUrl) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGenerateMobileSdkReleaseUrl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGenerateMobileSdkReleaseUrl(response, &metadata)
}
output := &GenerateMobileSdkReleaseUrlOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGenerateMobileSdkReleaseUrlOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGenerateMobileSdkReleaseUrl(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetDecryptedAPIKey struct {
}
func (*awsAwsjson11_deserializeOpGetDecryptedAPIKey) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetDecryptedAPIKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetDecryptedAPIKey(response, &metadata)
}
output := &GetDecryptedAPIKeyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetDecryptedAPIKeyOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetDecryptedAPIKey(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFInvalidResourceException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidResourceException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetIPSet struct {
}
func (*awsAwsjson11_deserializeOpGetIPSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetIPSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetIPSet(response, &metadata)
}
output := &GetIPSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetIPSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetIPSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetLoggingConfiguration struct {
}
func (*awsAwsjson11_deserializeOpGetLoggingConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetLoggingConfiguration(response, &metadata)
}
output := &GetLoggingConfigurationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetLoggingConfigurationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetManagedRuleSet struct {
}
func (*awsAwsjson11_deserializeOpGetManagedRuleSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetManagedRuleSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetManagedRuleSet(response, &metadata)
}
output := &GetManagedRuleSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetManagedRuleSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetManagedRuleSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetMobileSdkRelease struct {
}
func (*awsAwsjson11_deserializeOpGetMobileSdkRelease) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetMobileSdkRelease) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetMobileSdkRelease(response, &metadata)
}
output := &GetMobileSdkReleaseOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetMobileSdkReleaseOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetMobileSdkRelease(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetPermissionPolicy struct {
}
func (*awsAwsjson11_deserializeOpGetPermissionPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetPermissionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetPermissionPolicy(response, &metadata)
}
output := &GetPermissionPolicyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetPermissionPolicyOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetPermissionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetRateBasedStatementManagedKeys struct {
}
func (*awsAwsjson11_deserializeOpGetRateBasedStatementManagedKeys) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetRateBasedStatementManagedKeys) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetRateBasedStatementManagedKeys(response, &metadata)
}
output := &GetRateBasedStatementManagedKeysOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetRateBasedStatementManagedKeysOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetRateBasedStatementManagedKeys(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFUnsupportedAggregateKeyTypeException", errorCode):
return awsAwsjson11_deserializeErrorWAFUnsupportedAggregateKeyTypeException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetRegexPatternSet struct {
}
func (*awsAwsjson11_deserializeOpGetRegexPatternSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetRegexPatternSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetRegexPatternSet(response, &metadata)
}
output := &GetRegexPatternSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetRegexPatternSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetRegexPatternSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetRuleGroup struct {
}
func (*awsAwsjson11_deserializeOpGetRuleGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetRuleGroup(response, &metadata)
}
output := &GetRuleGroupOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetRuleGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetSampledRequests struct {
}
func (*awsAwsjson11_deserializeOpGetSampledRequests) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetSampledRequests) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetSampledRequests(response, &metadata)
}
output := &GetSampledRequestsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetSampledRequestsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetSampledRequests(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetWebACL struct {
}
func (*awsAwsjson11_deserializeOpGetWebACL) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetWebACL(response, &metadata)
}
output := &GetWebACLOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetWebACLOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetWebACLForResource struct {
}
func (*awsAwsjson11_deserializeOpGetWebACLForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetWebACLForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetWebACLForResource(response, &metadata)
}
output := &GetWebACLForResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetWebACLForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetWebACLForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFUnavailableEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFUnavailableEntityException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListAPIKeys struct {
}
func (*awsAwsjson11_deserializeOpListAPIKeys) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListAPIKeys) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListAPIKeys(response, &metadata)
}
output := &ListAPIKeysOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListAPIKeysOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListAPIKeys(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFInvalidResourceException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidResourceException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListAvailableManagedRuleGroups struct {
}
func (*awsAwsjson11_deserializeOpListAvailableManagedRuleGroups) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListAvailableManagedRuleGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListAvailableManagedRuleGroups(response, &metadata)
}
output := &ListAvailableManagedRuleGroupsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListAvailableManagedRuleGroupsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListAvailableManagedRuleGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListAvailableManagedRuleGroupVersions struct {
}
func (*awsAwsjson11_deserializeOpListAvailableManagedRuleGroupVersions) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListAvailableManagedRuleGroupVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListAvailableManagedRuleGroupVersions(response, &metadata)
}
output := &ListAvailableManagedRuleGroupVersionsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListAvailableManagedRuleGroupVersionsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListAvailableManagedRuleGroupVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListIPSets struct {
}
func (*awsAwsjson11_deserializeOpListIPSets) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListIPSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListIPSets(response, &metadata)
}
output := &ListIPSetsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListIPSetsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListIPSets(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListLoggingConfigurations struct {
}
func (*awsAwsjson11_deserializeOpListLoggingConfigurations) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListLoggingConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListLoggingConfigurations(response, &metadata)
}
output := &ListLoggingConfigurationsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListLoggingConfigurationsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListLoggingConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListManagedRuleSets struct {
}
func (*awsAwsjson11_deserializeOpListManagedRuleSets) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListManagedRuleSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListManagedRuleSets(response, &metadata)
}
output := &ListManagedRuleSetsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListManagedRuleSetsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListManagedRuleSets(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListMobileSdkReleases struct {
}
func (*awsAwsjson11_deserializeOpListMobileSdkReleases) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListMobileSdkReleases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListMobileSdkReleases(response, &metadata)
}
output := &ListMobileSdkReleasesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListMobileSdkReleasesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListMobileSdkReleases(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListRegexPatternSets struct {
}
func (*awsAwsjson11_deserializeOpListRegexPatternSets) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListRegexPatternSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListRegexPatternSets(response, &metadata)
}
output := &ListRegexPatternSetsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListRegexPatternSetsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListRegexPatternSets(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListResourcesForWebACL struct {
}
func (*awsAwsjson11_deserializeOpListResourcesForWebACL) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListResourcesForWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListResourcesForWebACL(response, &metadata)
}
output := &ListResourcesForWebACLOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListResourcesForWebACLOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListResourcesForWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListRuleGroups struct {
}
func (*awsAwsjson11_deserializeOpListRuleGroups) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListRuleGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListRuleGroups(response, &metadata)
}
output := &ListRuleGroupsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListRuleGroupsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListRuleGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListTagsForResource struct {
}
func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata)
}
output := &ListTagsForResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListWebACLs struct {
}
func (*awsAwsjson11_deserializeOpListWebACLs) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListWebACLs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListWebACLs(response, &metadata)
}
output := &ListWebACLsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListWebACLsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListWebACLs(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpPutLoggingConfiguration struct {
}
func (*awsAwsjson11_deserializeOpPutLoggingConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpPutLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorPutLoggingConfiguration(response, &metadata)
}
output := &PutLoggingConfigurationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentPutLoggingConfigurationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorPutLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFLogDestinationPermissionIssueException", errorCode):
return awsAwsjson11_deserializeErrorWAFLogDestinationPermissionIssueException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFOptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorWAFOptimisticLockException(response, errorBody)
case strings.EqualFold("WAFServiceLinkedRoleErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFServiceLinkedRoleErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpPutManagedRuleSetVersions struct {
}
func (*awsAwsjson11_deserializeOpPutManagedRuleSetVersions) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpPutManagedRuleSetVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorPutManagedRuleSetVersions(response, &metadata)
}
output := &PutManagedRuleSetVersionsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentPutManagedRuleSetVersionsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorPutManagedRuleSetVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFOptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorWAFOptimisticLockException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpPutPermissionPolicy struct {
}
func (*awsAwsjson11_deserializeOpPutPermissionPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpPutPermissionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorPutPermissionPolicy(response, &metadata)
}
output := &PutPermissionPolicyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentPutPermissionPolicyOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorPutPermissionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFInvalidPermissionPolicyException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidPermissionPolicyException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpTagResource struct {
}
func (*awsAwsjson11_deserializeOpTagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata)
}
output := &TagResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUntagResource struct {
}
func (*awsAwsjson11_deserializeOpUntagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata)
}
output := &UntagResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFTagOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationException(response, errorBody)
case strings.EqualFold("WAFTagOperationInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateIPSet struct {
}
func (*awsAwsjson11_deserializeOpUpdateIPSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateIPSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateIPSet(response, &metadata)
}
output := &UpdateIPSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateIPSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateIPSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFDuplicateItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFDuplicateItemException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFOptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorWAFOptimisticLockException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateManagedRuleSetVersionExpiryDate struct {
}
func (*awsAwsjson11_deserializeOpUpdateManagedRuleSetVersionExpiryDate) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateManagedRuleSetVersionExpiryDate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateManagedRuleSetVersionExpiryDate(response, &metadata)
}
output := &UpdateManagedRuleSetVersionExpiryDateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateManagedRuleSetVersionExpiryDateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateManagedRuleSetVersionExpiryDate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFOptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorWAFOptimisticLockException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateRegexPatternSet struct {
}
func (*awsAwsjson11_deserializeOpUpdateRegexPatternSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateRegexPatternSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateRegexPatternSet(response, &metadata)
}
output := &UpdateRegexPatternSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateRegexPatternSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateRegexPatternSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFDuplicateItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFDuplicateItemException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFOptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorWAFOptimisticLockException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateRuleGroup struct {
}
func (*awsAwsjson11_deserializeOpUpdateRuleGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateRuleGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateRuleGroup(response, &metadata)
}
output := &UpdateRuleGroupOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateRuleGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateRuleGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFConfigurationWarningException", errorCode):
return awsAwsjson11_deserializeErrorWAFConfigurationWarningException(response, errorBody)
case strings.EqualFold("WAFDuplicateItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFDuplicateItemException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFOptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorWAFOptimisticLockException(response, errorBody)
case strings.EqualFold("WAFSubscriptionNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorWAFSubscriptionNotFoundException(response, errorBody)
case strings.EqualFold("WAFUnavailableEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFUnavailableEntityException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateWebACL struct {
}
func (*awsAwsjson11_deserializeOpUpdateWebACL) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateWebACL) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateWebACL(response, &metadata)
}
output := &UpdateWebACLOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateWebACLOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateWebACL(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("WAFConfigurationWarningException", errorCode):
return awsAwsjson11_deserializeErrorWAFConfigurationWarningException(response, errorBody)
case strings.EqualFold("WAFDuplicateItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFDuplicateItemException(response, errorBody)
case strings.EqualFold("WAFExpiredManagedRuleGroupVersionException", errorCode):
return awsAwsjson11_deserializeErrorWAFExpiredManagedRuleGroupVersionException(response, errorBody)
case strings.EqualFold("WAFInternalErrorException", errorCode):
return awsAwsjson11_deserializeErrorWAFInternalErrorException(response, errorBody)
case strings.EqualFold("WAFInvalidOperationException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidOperationException(response, errorBody)
case strings.EqualFold("WAFInvalidParameterException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidParameterException(response, errorBody)
case strings.EqualFold("WAFInvalidResourceException", errorCode):
return awsAwsjson11_deserializeErrorWAFInvalidResourceException(response, errorBody)
case strings.EqualFold("WAFLimitsExceededException", errorCode):
return awsAwsjson11_deserializeErrorWAFLimitsExceededException(response, errorBody)
case strings.EqualFold("WAFNonexistentItemException", errorCode):
return awsAwsjson11_deserializeErrorWAFNonexistentItemException(response, errorBody)
case strings.EqualFold("WAFOptimisticLockException", errorCode):
return awsAwsjson11_deserializeErrorWAFOptimisticLockException(response, errorBody)
case strings.EqualFold("WAFSubscriptionNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorWAFSubscriptionNotFoundException(response, errorBody)
case strings.EqualFold("WAFUnavailableEntityException", errorCode):
return awsAwsjson11_deserializeErrorWAFUnavailableEntityException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsAwsjson11_deserializeErrorWAFAssociatedItemException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFAssociatedItemException{}
err := awsAwsjson11_deserializeDocumentWAFAssociatedItemException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFConfigurationWarningException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFConfigurationWarningException{}
err := awsAwsjson11_deserializeDocumentWAFConfigurationWarningException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFDuplicateItemException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFDuplicateItemException{}
err := awsAwsjson11_deserializeDocumentWAFDuplicateItemException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFExpiredManagedRuleGroupVersionException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFExpiredManagedRuleGroupVersionException{}
err := awsAwsjson11_deserializeDocumentWAFExpiredManagedRuleGroupVersionException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFInternalErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFInternalErrorException{}
err := awsAwsjson11_deserializeDocumentWAFInternalErrorException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFInvalidOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFInvalidOperationException{}
err := awsAwsjson11_deserializeDocumentWAFInvalidOperationException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFInvalidParameterException{}
err := awsAwsjson11_deserializeDocumentWAFInvalidParameterException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFInvalidPermissionPolicyException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFInvalidPermissionPolicyException{}
err := awsAwsjson11_deserializeDocumentWAFInvalidPermissionPolicyException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFInvalidResourceException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFInvalidResourceException{}
err := awsAwsjson11_deserializeDocumentWAFInvalidResourceException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFLimitsExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFLimitsExceededException{}
err := awsAwsjson11_deserializeDocumentWAFLimitsExceededException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFLogDestinationPermissionIssueException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFLogDestinationPermissionIssueException{}
err := awsAwsjson11_deserializeDocumentWAFLogDestinationPermissionIssueException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFNonexistentItemException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFNonexistentItemException{}
err := awsAwsjson11_deserializeDocumentWAFNonexistentItemException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFOptimisticLockException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFOptimisticLockException{}
err := awsAwsjson11_deserializeDocumentWAFOptimisticLockException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFServiceLinkedRoleErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFServiceLinkedRoleErrorException{}
err := awsAwsjson11_deserializeDocumentWAFServiceLinkedRoleErrorException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFSubscriptionNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFSubscriptionNotFoundException{}
err := awsAwsjson11_deserializeDocumentWAFSubscriptionNotFoundException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFTagOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFTagOperationException{}
err := awsAwsjson11_deserializeDocumentWAFTagOperationException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFTagOperationInternalErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFTagOperationInternalErrorException{}
err := awsAwsjson11_deserializeDocumentWAFTagOperationInternalErrorException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFUnavailableEntityException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFUnavailableEntityException{}
err := awsAwsjson11_deserializeDocumentWAFUnavailableEntityException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorWAFUnsupportedAggregateKeyTypeException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.WAFUnsupportedAggregateKeyTypeException{}
err := awsAwsjson11_deserializeDocumentWAFUnsupportedAggregateKeyTypeException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeDocumentActionCondition(v **types.ActionCondition, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ActionCondition
if *v == nil {
sv = &types.ActionCondition{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Action":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ActionValue to be of type string, got %T instead", value)
}
sv.Action = types.ActionValue(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAddressField(v **types.AddressField, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AddressField
if *v == nil {
sv = &types.AddressField{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Identifier":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FieldIdentifier to be of type string, got %T instead", value)
}
sv.Identifier = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAddressFields(v *[]types.AddressField, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.AddressField
if *v == nil {
cv = []types.AddressField{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AddressField
destAddr := &col
if err := awsAwsjson11_deserializeDocumentAddressField(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAll(v **types.All, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.All
if *v == nil {
sv = &types.All{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAllowAction(v **types.AllowAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AllowAction
if *v == nil {
sv = &types.AllowAction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CustomRequestHandling":
if err := awsAwsjson11_deserializeDocumentCustomRequestHandling(&sv.CustomRequestHandling, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAllQueryArguments(v **types.AllQueryArguments, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AllQueryArguments
if *v == nil {
sv = &types.AllQueryArguments{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAndStatement(v **types.AndStatement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AndStatement
if *v == nil {
sv = &types.AndStatement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Statements":
if err := awsAwsjson11_deserializeDocumentStatements(&sv.Statements, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAPIKeySummaries(v *[]types.APIKeySummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.APIKeySummary
if *v == nil {
cv = []types.APIKeySummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.APIKeySummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentAPIKeySummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAPIKeySummary(v **types.APIKeySummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.APIKeySummary
if *v == nil {
sv = &types.APIKeySummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "APIKey":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected APIKey to be of type string, got %T instead", value)
}
sv.APIKey = ptr.String(jtv)
}
case "CreationTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "TokenDomains":
if err := awsAwsjson11_deserializeDocumentTokenDomains(&sv.TokenDomains, value); err != nil {
return err
}
case "Version":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected APIKeyVersion to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Version = int32(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAssociationConfig(v **types.AssociationConfig, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AssociationConfig
if *v == nil {
sv = &types.AssociationConfig{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "RequestBody":
if err := awsAwsjson11_deserializeDocumentRequestBody(&sv.RequestBody, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAWSManagedRulesACFPRuleSet(v **types.AWSManagedRulesACFPRuleSet, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AWSManagedRulesACFPRuleSet
if *v == nil {
sv = &types.AWSManagedRulesACFPRuleSet{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreationPath":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CreationPathString to be of type string, got %T instead", value)
}
sv.CreationPath = ptr.String(jtv)
}
case "EnableRegexInPath":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.EnableRegexInPath = jtv
}
case "RegistrationPagePath":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RegistrationPagePathString to be of type string, got %T instead", value)
}
sv.RegistrationPagePath = ptr.String(jtv)
}
case "RequestInspection":
if err := awsAwsjson11_deserializeDocumentRequestInspectionACFP(&sv.RequestInspection, value); err != nil {
return err
}
case "ResponseInspection":
if err := awsAwsjson11_deserializeDocumentResponseInspection(&sv.ResponseInspection, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAWSManagedRulesATPRuleSet(v **types.AWSManagedRulesATPRuleSet, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AWSManagedRulesATPRuleSet
if *v == nil {
sv = &types.AWSManagedRulesATPRuleSet{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EnableRegexInPath":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.EnableRegexInPath = jtv
}
case "LoginPath":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LoginPath = ptr.String(jtv)
}
case "RequestInspection":
if err := awsAwsjson11_deserializeDocumentRequestInspection(&sv.RequestInspection, value); err != nil {
return err
}
case "ResponseInspection":
if err := awsAwsjson11_deserializeDocumentResponseInspection(&sv.ResponseInspection, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAWSManagedRulesBotControlRuleSet(v **types.AWSManagedRulesBotControlRuleSet, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AWSManagedRulesBotControlRuleSet
if *v == nil {
sv = &types.AWSManagedRulesBotControlRuleSet{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "InspectionLevel":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InspectionLevel to be of type string, got %T instead", value)
}
sv.InspectionLevel = types.InspectionLevel(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentBlockAction(v **types.BlockAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BlockAction
if *v == nil {
sv = &types.BlockAction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CustomResponse":
if err := awsAwsjson11_deserializeDocumentCustomResponse(&sv.CustomResponse, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentBody(v **types.Body, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Body
if *v == nil {
sv = &types.Body{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "OversizeHandling":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OversizeHandling to be of type string, got %T instead", value)
}
sv.OversizeHandling = types.OversizeHandling(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentByteMatchStatement(v **types.ByteMatchStatement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ByteMatchStatement
if *v == nil {
sv = &types.ByteMatchStatement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FieldToMatch":
if err := awsAwsjson11_deserializeDocumentFieldToMatch(&sv.FieldToMatch, value); err != nil {
return err
}
case "PositionalConstraint":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PositionalConstraint to be of type string, got %T instead", value)
}
sv.PositionalConstraint = types.PositionalConstraint(jtv)
}
case "SearchString":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SearchString to be []byte, got %T instead", value)
}
dv, err := base64.StdEncoding.DecodeString(jtv)
if err != nil {
return fmt.Errorf("failed to base64 decode SearchString, %w", err)
}
sv.SearchString = dv
}
case "TextTransformations":
if err := awsAwsjson11_deserializeDocumentTextTransformations(&sv.TextTransformations, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCaptchaAction(v **types.CaptchaAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CaptchaAction
if *v == nil {
sv = &types.CaptchaAction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CustomRequestHandling":
if err := awsAwsjson11_deserializeDocumentCustomRequestHandling(&sv.CustomRequestHandling, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCaptchaConfig(v **types.CaptchaConfig, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CaptchaConfig
if *v == nil {
sv = &types.CaptchaConfig{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ImmunityTimeProperty":
if err := awsAwsjson11_deserializeDocumentImmunityTimeProperty(&sv.ImmunityTimeProperty, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCaptchaResponse(v **types.CaptchaResponse, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CaptchaResponse
if *v == nil {
sv = &types.CaptchaResponse{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FailureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value)
}
sv.FailureReason = types.FailureReason(jtv)
}
case "ResponseCode":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ResponseCode to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ResponseCode = ptr.Int32(int32(i64))
}
case "SolveTimestamp":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected SolveTimestamp to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.SolveTimestamp = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentChallengeAction(v **types.ChallengeAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ChallengeAction
if *v == nil {
sv = &types.ChallengeAction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CustomRequestHandling":
if err := awsAwsjson11_deserializeDocumentCustomRequestHandling(&sv.CustomRequestHandling, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentChallengeConfig(v **types.ChallengeConfig, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ChallengeConfig
if *v == nil {
sv = &types.ChallengeConfig{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ImmunityTimeProperty":
if err := awsAwsjson11_deserializeDocumentImmunityTimeProperty(&sv.ImmunityTimeProperty, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentChallengeResponse(v **types.ChallengeResponse, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ChallengeResponse
if *v == nil {
sv = &types.ChallengeResponse{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FailureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value)
}
sv.FailureReason = types.FailureReason(jtv)
}
case "ResponseCode":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ResponseCode to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ResponseCode = ptr.Int32(int32(i64))
}
case "SolveTimestamp":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected SolveTimestamp to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.SolveTimestamp = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCondition(v **types.Condition, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Condition
if *v == nil {
sv = &types.Condition{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ActionCondition":
if err := awsAwsjson11_deserializeDocumentActionCondition(&sv.ActionCondition, value); err != nil {
return err
}
case "LabelNameCondition":
if err := awsAwsjson11_deserializeDocumentLabelNameCondition(&sv.LabelNameCondition, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentConditions(v *[]types.Condition, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Condition
if *v == nil {
cv = []types.Condition{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Condition
destAddr := &col
if err := awsAwsjson11_deserializeDocumentCondition(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentCookieMatchPattern(v **types.CookieMatchPattern, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CookieMatchPattern
if *v == nil {
sv = &types.CookieMatchPattern{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "All":
if err := awsAwsjson11_deserializeDocumentAll(&sv.All, value); err != nil {
return err
}
case "ExcludedCookies":
if err := awsAwsjson11_deserializeDocumentCookieNames(&sv.ExcludedCookies, value); err != nil {
return err
}
case "IncludedCookies":
if err := awsAwsjson11_deserializeDocumentCookieNames(&sv.IncludedCookies, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCookieNames(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SingleCookieName to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentCookies(v **types.Cookies, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Cookies
if *v == nil {
sv = &types.Cookies{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MatchPattern":
if err := awsAwsjson11_deserializeDocumentCookieMatchPattern(&sv.MatchPattern, value); err != nil {
return err
}
case "MatchScope":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MapMatchScope to be of type string, got %T instead", value)
}
sv.MatchScope = types.MapMatchScope(jtv)
}
case "OversizeHandling":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OversizeHandling to be of type string, got %T instead", value)
}
sv.OversizeHandling = types.OversizeHandling(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCountAction(v **types.CountAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CountAction
if *v == nil {
sv = &types.CountAction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CustomRequestHandling":
if err := awsAwsjson11_deserializeDocumentCustomRequestHandling(&sv.CustomRequestHandling, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCountryCodes(v *[]types.CountryCode, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.CountryCode
if *v == nil {
cv = []types.CountryCode{}
} else {
cv = *v
}
for _, value := range shape {
var col types.CountryCode
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CountryCode to be of type string, got %T instead", value)
}
col = types.CountryCode(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentCustomHTTPHeader(v **types.CustomHTTPHeader, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CustomHTTPHeader
if *v == nil {
sv = &types.CustomHTTPHeader{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CustomHTTPHeaderName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CustomHTTPHeaderValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCustomHTTPHeaders(v *[]types.CustomHTTPHeader, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.CustomHTTPHeader
if *v == nil {
cv = []types.CustomHTTPHeader{}
} else {
cv = *v
}
for _, value := range shape {
var col types.CustomHTTPHeader
destAddr := &col
if err := awsAwsjson11_deserializeDocumentCustomHTTPHeader(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentCustomRequestHandling(v **types.CustomRequestHandling, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CustomRequestHandling
if *v == nil {
sv = &types.CustomRequestHandling{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "InsertHeaders":
if err := awsAwsjson11_deserializeDocumentCustomHTTPHeaders(&sv.InsertHeaders, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCustomResponse(v **types.CustomResponse, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CustomResponse
if *v == nil {
sv = &types.CustomResponse{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CustomResponseBodyKey":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.CustomResponseBodyKey = ptr.String(jtv)
}
case "ResponseCode":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ResponseStatusCode to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ResponseCode = ptr.Int32(int32(i64))
}
case "ResponseHeaders":
if err := awsAwsjson11_deserializeDocumentCustomHTTPHeaders(&sv.ResponseHeaders, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCustomResponseBodies(v *map[string]types.CustomResponseBody, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]types.CustomResponseBody
if *v == nil {
mv = map[string]types.CustomResponseBody{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.CustomResponseBody
mapVar := parsedVal
destAddr := &mapVar
if err := awsAwsjson11_deserializeDocumentCustomResponseBody(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsAwsjson11_deserializeDocumentCustomResponseBody(v **types.CustomResponseBody, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CustomResponseBody
if *v == nil {
sv = &types.CustomResponseBody{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Content":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResponseContent to be of type string, got %T instead", value)
}
sv.Content = ptr.String(jtv)
}
case "ContentType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResponseContentType to be of type string, got %T instead", value)
}
sv.ContentType = types.ResponseContentType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentDefaultAction(v **types.DefaultAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DefaultAction
if *v == nil {
sv = &types.DefaultAction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Allow":
if err := awsAwsjson11_deserializeDocumentAllowAction(&sv.Allow, value); err != nil {
return err
}
case "Block":
if err := awsAwsjson11_deserializeDocumentBlockAction(&sv.Block, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentEmailField(v **types.EmailField, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.EmailField
if *v == nil {
sv = &types.EmailField{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Identifier":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FieldIdentifier to be of type string, got %T instead", value)
}
sv.Identifier = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentExcludedRule(v **types.ExcludedRule, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ExcludedRule
if *v == nil {
sv = &types.ExcludedRule{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentExcludedRules(v *[]types.ExcludedRule, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ExcludedRule
if *v == nil {
cv = []types.ExcludedRule{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ExcludedRule
destAddr := &col
if err := awsAwsjson11_deserializeDocumentExcludedRule(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentFieldToMatch(v **types.FieldToMatch, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.FieldToMatch
if *v == nil {
sv = &types.FieldToMatch{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AllQueryArguments":
if err := awsAwsjson11_deserializeDocumentAllQueryArguments(&sv.AllQueryArguments, value); err != nil {
return err
}
case "Body":
if err := awsAwsjson11_deserializeDocumentBody(&sv.Body, value); err != nil {
return err
}
case "Cookies":
if err := awsAwsjson11_deserializeDocumentCookies(&sv.Cookies, value); err != nil {
return err
}
case "HeaderOrder":
if err := awsAwsjson11_deserializeDocumentHeaderOrder(&sv.HeaderOrder, value); err != nil {
return err
}
case "Headers":
if err := awsAwsjson11_deserializeDocumentHeaders(&sv.Headers, value); err != nil {
return err
}
case "JsonBody":
if err := awsAwsjson11_deserializeDocumentJsonBody(&sv.JsonBody, value); err != nil {
return err
}
case "Method":
if err := awsAwsjson11_deserializeDocumentMethod(&sv.Method, value); err != nil {
return err
}
case "QueryString":
if err := awsAwsjson11_deserializeDocumentQueryString(&sv.QueryString, value); err != nil {
return err
}
case "SingleHeader":
if err := awsAwsjson11_deserializeDocumentSingleHeader(&sv.SingleHeader, value); err != nil {
return err
}
case "SingleQueryArgument":
if err := awsAwsjson11_deserializeDocumentSingleQueryArgument(&sv.SingleQueryArgument, value); err != nil {
return err
}
case "UriPath":
if err := awsAwsjson11_deserializeDocumentUriPath(&sv.UriPath, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentFilter(v **types.Filter, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Filter
if *v == nil {
sv = &types.Filter{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Behavior":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FilterBehavior to be of type string, got %T instead", value)
}
sv.Behavior = types.FilterBehavior(jtv)
}
case "Conditions":
if err := awsAwsjson11_deserializeDocumentConditions(&sv.Conditions, value); err != nil {
return err
}
case "Requirement":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FilterRequirement to be of type string, got %T instead", value)
}
sv.Requirement = types.FilterRequirement(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentFilters(v *[]types.Filter, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Filter
if *v == nil {
cv = []types.Filter{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Filter
destAddr := &col
if err := awsAwsjson11_deserializeDocumentFilter(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentFirewallManagerRuleGroup(v **types.FirewallManagerRuleGroup, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.FirewallManagerRuleGroup
if *v == nil {
sv = &types.FirewallManagerRuleGroup{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FirewallManagerStatement":
if err := awsAwsjson11_deserializeDocumentFirewallManagerStatement(&sv.FirewallManagerStatement, value); err != nil {
return err
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "OverrideAction":
if err := awsAwsjson11_deserializeDocumentOverrideAction(&sv.OverrideAction, value); err != nil {
return err
}
case "Priority":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected RulePriority to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Priority = int32(i64)
}
case "VisibilityConfig":
if err := awsAwsjson11_deserializeDocumentVisibilityConfig(&sv.VisibilityConfig, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentFirewallManagerRuleGroups(v *[]types.FirewallManagerRuleGroup, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.FirewallManagerRuleGroup
if *v == nil {
cv = []types.FirewallManagerRuleGroup{}
} else {
cv = *v
}
for _, value := range shape {
var col types.FirewallManagerRuleGroup
destAddr := &col
if err := awsAwsjson11_deserializeDocumentFirewallManagerRuleGroup(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentFirewallManagerStatement(v **types.FirewallManagerStatement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.FirewallManagerStatement
if *v == nil {
sv = &types.FirewallManagerStatement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ManagedRuleGroupStatement":
if err := awsAwsjson11_deserializeDocumentManagedRuleGroupStatement(&sv.ManagedRuleGroupStatement, value); err != nil {
return err
}
case "RuleGroupReferenceStatement":
if err := awsAwsjson11_deserializeDocumentRuleGroupReferenceStatement(&sv.RuleGroupReferenceStatement, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentForwardedIPConfig(v **types.ForwardedIPConfig, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ForwardedIPConfig
if *v == nil {
sv = &types.ForwardedIPConfig{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FallbackBehavior":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FallbackBehavior to be of type string, got %T instead", value)
}
sv.FallbackBehavior = types.FallbackBehavior(jtv)
}
case "HeaderName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ForwardedIPHeaderName to be of type string, got %T instead", value)
}
sv.HeaderName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentGeoMatchStatement(v **types.GeoMatchStatement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.GeoMatchStatement
if *v == nil {
sv = &types.GeoMatchStatement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CountryCodes":
if err := awsAwsjson11_deserializeDocumentCountryCodes(&sv.CountryCodes, value); err != nil {
return err
}
case "ForwardedIPConfig":
if err := awsAwsjson11_deserializeDocumentForwardedIPConfig(&sv.ForwardedIPConfig, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentHeaderMatchPattern(v **types.HeaderMatchPattern, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.HeaderMatchPattern
if *v == nil {
sv = &types.HeaderMatchPattern{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "All":
if err := awsAwsjson11_deserializeDocumentAll(&sv.All, value); err != nil {
return err
}
case "ExcludedHeaders":
if err := awsAwsjson11_deserializeDocumentHeaderNames(&sv.ExcludedHeaders, value); err != nil {
return err
}
case "IncludedHeaders":
if err := awsAwsjson11_deserializeDocumentHeaderNames(&sv.IncludedHeaders, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentHeaderNames(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FieldToMatchData to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentHeaderOrder(v **types.HeaderOrder, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.HeaderOrder
if *v == nil {
sv = &types.HeaderOrder{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "OversizeHandling":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OversizeHandling to be of type string, got %T instead", value)
}
sv.OversizeHandling = types.OversizeHandling(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentHeaders(v **types.Headers, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Headers
if *v == nil {
sv = &types.Headers{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MatchPattern":
if err := awsAwsjson11_deserializeDocumentHeaderMatchPattern(&sv.MatchPattern, value); err != nil {
return err
}
case "MatchScope":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MapMatchScope to be of type string, got %T instead", value)
}
sv.MatchScope = types.MapMatchScope(jtv)
}
case "OversizeHandling":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OversizeHandling to be of type string, got %T instead", value)
}
sv.OversizeHandling = types.OversizeHandling(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentHTTPHeader(v **types.HTTPHeader, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.HTTPHeader
if *v == nil {
sv = &types.HTTPHeader{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HeaderName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HeaderValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentHTTPHeaders(v *[]types.HTTPHeader, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.HTTPHeader
if *v == nil {
cv = []types.HTTPHeader{}
} else {
cv = *v
}
for _, value := range shape {
var col types.HTTPHeader
destAddr := &col
if err := awsAwsjson11_deserializeDocumentHTTPHeader(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentHTTPRequest(v **types.HTTPRequest, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.HTTPRequest
if *v == nil {
sv = &types.HTTPRequest{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ClientIP":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IPString to be of type string, got %T instead", value)
}
sv.ClientIP = ptr.String(jtv)
}
case "Country":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Country to be of type string, got %T instead", value)
}
sv.Country = ptr.String(jtv)
}
case "Headers":
if err := awsAwsjson11_deserializeDocumentHTTPHeaders(&sv.Headers, value); err != nil {
return err
}
case "HTTPVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HTTPVersion to be of type string, got %T instead", value)
}
sv.HTTPVersion = ptr.String(jtv)
}
case "Method":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HTTPMethod to be of type string, got %T instead", value)
}
sv.Method = ptr.String(jtv)
}
case "URI":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected URIString to be of type string, got %T instead", value)
}
sv.URI = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentImmunityTimeProperty(v **types.ImmunityTimeProperty, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ImmunityTimeProperty
if *v == nil {
sv = &types.ImmunityTimeProperty{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ImmunityTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimeWindowSecond to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ImmunityTime = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentIPAddresses(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IPAddress to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentIPSet(v **types.IPSet, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.IPSet
if *v == nil {
sv = &types.IPSet{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Addresses":
if err := awsAwsjson11_deserializeDocumentIPAddresses(&sv.Addresses, value); err != nil {
return err
}
case "ARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ARN = ptr.String(jtv)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "IPAddressVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IPAddressVersion to be of type string, got %T instead", value)
}
sv.IPAddressVersion = types.IPAddressVersion(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentIPSetForwardedIPConfig(v **types.IPSetForwardedIPConfig, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.IPSetForwardedIPConfig
if *v == nil {
sv = &types.IPSetForwardedIPConfig{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FallbackBehavior":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FallbackBehavior to be of type string, got %T instead", value)
}
sv.FallbackBehavior = types.FallbackBehavior(jtv)
}
case "HeaderName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ForwardedIPHeaderName to be of type string, got %T instead", value)
}
sv.HeaderName = ptr.String(jtv)
}
case "Position":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ForwardedIPPosition to be of type string, got %T instead", value)
}
sv.Position = types.ForwardedIPPosition(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentIPSetReferenceStatement(v **types.IPSetReferenceStatement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.IPSetReferenceStatement
if *v == nil {
sv = &types.IPSetReferenceStatement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ARN = ptr.String(jtv)
}
case "IPSetForwardedIPConfig":
if err := awsAwsjson11_deserializeDocumentIPSetForwardedIPConfig(&sv.IPSetForwardedIPConfig, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentIPSetSummaries(v *[]types.IPSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.IPSetSummary
if *v == nil {
cv = []types.IPSetSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.IPSetSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentIPSetSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentIPSetSummary(v **types.IPSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.IPSetSummary
if *v == nil {
sv = &types.IPSetSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ARN = ptr.String(jtv)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "LockToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LockToken to be of type string, got %T instead", value)
}
sv.LockToken = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentJsonBody(v **types.JsonBody, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.JsonBody
if *v == nil {
sv = &types.JsonBody{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "InvalidFallbackBehavior":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BodyParsingFallbackBehavior to be of type string, got %T instead", value)
}
sv.InvalidFallbackBehavior = types.BodyParsingFallbackBehavior(jtv)
}
case "MatchPattern":
if err := awsAwsjson11_deserializeDocumentJsonMatchPattern(&sv.MatchPattern, value); err != nil {
return err
}
case "MatchScope":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected JsonMatchScope to be of type string, got %T instead", value)
}
sv.MatchScope = types.JsonMatchScope(jtv)
}
case "OversizeHandling":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OversizeHandling to be of type string, got %T instead", value)
}
sv.OversizeHandling = types.OversizeHandling(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentJsonMatchPattern(v **types.JsonMatchPattern, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.JsonMatchPattern
if *v == nil {
sv = &types.JsonMatchPattern{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "All":
if err := awsAwsjson11_deserializeDocumentAll(&sv.All, value); err != nil {
return err
}
case "IncludedPaths":
if err := awsAwsjson11_deserializeDocumentJsonPointerPaths(&sv.IncludedPaths, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentJsonPointerPaths(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected JsonPointerPath to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentLabel(v **types.Label, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Label
if *v == nil {
sv = &types.Label{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LabelName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLabelMatchStatement(v **types.LabelMatchStatement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LabelMatchStatement
if *v == nil {
sv = &types.LabelMatchStatement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LabelMatchKey to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
case "Scope":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LabelMatchScope to be of type string, got %T instead", value)
}
sv.Scope = types.LabelMatchScope(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLabelNameCondition(v **types.LabelNameCondition, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LabelNameCondition
if *v == nil {
sv = &types.LabelNameCondition{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LabelName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LabelName to be of type string, got %T instead", value)
}
sv.LabelName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLabels(v *[]types.Label, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Label
if *v == nil {
cv = []types.Label{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Label
destAddr := &col
if err := awsAwsjson11_deserializeDocumentLabel(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentLabelSummaries(v *[]types.LabelSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.LabelSummary
if *v == nil {
cv = []types.LabelSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.LabelSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentLabelSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentLabelSummary(v **types.LabelSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LabelSummary
if *v == nil {
sv = &types.LabelSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LabelName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLogDestinationConfigs(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentLoggingConfiguration(v **types.LoggingConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LoggingConfiguration
if *v == nil {
sv = &types.LoggingConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LogDestinationConfigs":
if err := awsAwsjson11_deserializeDocumentLogDestinationConfigs(&sv.LogDestinationConfigs, value); err != nil {
return err
}
case "LoggingFilter":
if err := awsAwsjson11_deserializeDocumentLoggingFilter(&sv.LoggingFilter, value); err != nil {
return err
}
case "ManagedByFirewallManager":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.ManagedByFirewallManager = jtv
}
case "RedactedFields":
if err := awsAwsjson11_deserializeDocumentRedactedFields(&sv.RedactedFields, value); err != nil {
return err
}
case "ResourceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ResourceArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLoggingConfigurations(v *[]types.LoggingConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.LoggingConfiguration
if *v == nil {
cv = []types.LoggingConfiguration{}
} else {
cv = *v
}
for _, value := range shape {
var col types.LoggingConfiguration
destAddr := &col
if err := awsAwsjson11_deserializeDocumentLoggingConfiguration(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentLoggingFilter(v **types.LoggingFilter, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LoggingFilter
if *v == nil {
sv = &types.LoggingFilter{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DefaultBehavior":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FilterBehavior to be of type string, got %T instead", value)
}
sv.DefaultBehavior = types.FilterBehavior(jtv)
}
case "Filters":
if err := awsAwsjson11_deserializeDocumentFilters(&sv.Filters, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentManagedProductDescriptor(v **types.ManagedProductDescriptor, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ManagedProductDescriptor
if *v == nil {
sv = &types.ManagedProductDescriptor{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "IsAdvancedManagedRuleSet":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.IsAdvancedManagedRuleSet = jtv
}
case "IsVersioningSupported":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.IsVersioningSupported = jtv
}
case "ManagedRuleSetName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.ManagedRuleSetName = ptr.String(jtv)
}
case "ProductDescription":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProductDescription to be of type string, got %T instead", value)
}
sv.ProductDescription = ptr.String(jtv)
}
case "ProductId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProductId to be of type string, got %T instead", value)
}
sv.ProductId = ptr.String(jtv)
}
case "ProductLink":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProductLink to be of type string, got %T instead", value)
}
sv.ProductLink = ptr.String(jtv)
}
case "ProductTitle":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProductTitle to be of type string, got %T instead", value)
}
sv.ProductTitle = ptr.String(jtv)
}
case "SnsTopicArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.SnsTopicArn = ptr.String(jtv)
}
case "VendorName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VendorName to be of type string, got %T instead", value)
}
sv.VendorName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentManagedProductDescriptors(v *[]types.ManagedProductDescriptor, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ManagedProductDescriptor
if *v == nil {
cv = []types.ManagedProductDescriptor{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ManagedProductDescriptor
destAddr := &col
if err := awsAwsjson11_deserializeDocumentManagedProductDescriptor(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentManagedRuleGroupConfig(v **types.ManagedRuleGroupConfig, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ManagedRuleGroupConfig
if *v == nil {
sv = &types.ManagedRuleGroupConfig{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AWSManagedRulesACFPRuleSet":
if err := awsAwsjson11_deserializeDocumentAWSManagedRulesACFPRuleSet(&sv.AWSManagedRulesACFPRuleSet, value); err != nil {
return err
}
case "AWSManagedRulesATPRuleSet":
if err := awsAwsjson11_deserializeDocumentAWSManagedRulesATPRuleSet(&sv.AWSManagedRulesATPRuleSet, value); err != nil {
return err
}
case "AWSManagedRulesBotControlRuleSet":
if err := awsAwsjson11_deserializeDocumentAWSManagedRulesBotControlRuleSet(&sv.AWSManagedRulesBotControlRuleSet, value); err != nil {
return err
}
case "LoginPath":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LoginPathString to be of type string, got %T instead", value)
}
sv.LoginPath = ptr.String(jtv)
}
case "PasswordField":
if err := awsAwsjson11_deserializeDocumentPasswordField(&sv.PasswordField, value); err != nil {
return err
}
case "PayloadType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PayloadType to be of type string, got %T instead", value)
}
sv.PayloadType = types.PayloadType(jtv)
}
case "UsernameField":
if err := awsAwsjson11_deserializeDocumentUsernameField(&sv.UsernameField, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentManagedRuleGroupConfigs(v *[]types.ManagedRuleGroupConfig, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ManagedRuleGroupConfig
if *v == nil {
cv = []types.ManagedRuleGroupConfig{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ManagedRuleGroupConfig
destAddr := &col
if err := awsAwsjson11_deserializeDocumentManagedRuleGroupConfig(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentManagedRuleGroupStatement(v **types.ManagedRuleGroupStatement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ManagedRuleGroupStatement
if *v == nil {
sv = &types.ManagedRuleGroupStatement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ExcludedRules":
if err := awsAwsjson11_deserializeDocumentExcludedRules(&sv.ExcludedRules, value); err != nil {
return err
}
case "ManagedRuleGroupConfigs":
if err := awsAwsjson11_deserializeDocumentManagedRuleGroupConfigs(&sv.ManagedRuleGroupConfigs, value); err != nil {
return err
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "RuleActionOverrides":
if err := awsAwsjson11_deserializeDocumentRuleActionOverrides(&sv.RuleActionOverrides, value); err != nil {
return err
}
case "ScopeDownStatement":
if err := awsAwsjson11_deserializeDocumentStatement(&sv.ScopeDownStatement, value); err != nil {
return err
}
case "VendorName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VendorName to be of type string, got %T instead", value)
}
sv.VendorName = ptr.String(jtv)
}
case "Version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VersionKeyString to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentManagedRuleGroupSummaries(v *[]types.ManagedRuleGroupSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ManagedRuleGroupSummary
if *v == nil {
cv = []types.ManagedRuleGroupSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ManagedRuleGroupSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentManagedRuleGroupSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentManagedRuleGroupSummary(v **types.ManagedRuleGroupSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ManagedRuleGroupSummary
if *v == nil {
sv = &types.ManagedRuleGroupSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "VendorName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VendorName to be of type string, got %T instead", value)
}
sv.VendorName = ptr.String(jtv)
}
case "VersioningSupported":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.VersioningSupported = jtv
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentManagedRuleGroupVersion(v **types.ManagedRuleGroupVersion, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ManagedRuleGroupVersion
if *v == nil {
sv = &types.ManagedRuleGroupVersion{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LastUpdateTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdateTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VersionKeyString to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentManagedRuleGroupVersions(v *[]types.ManagedRuleGroupVersion, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ManagedRuleGroupVersion
if *v == nil {
cv = []types.ManagedRuleGroupVersion{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ManagedRuleGroupVersion
destAddr := &col
if err := awsAwsjson11_deserializeDocumentManagedRuleGroupVersion(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentManagedRuleSet(v **types.ManagedRuleSet, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ManagedRuleSet
if *v == nil {
sv = &types.ManagedRuleSet{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ARN = ptr.String(jtv)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "LabelNamespace":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LabelName to be of type string, got %T instead", value)
}
sv.LabelNamespace = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "PublishedVersions":
if err := awsAwsjson11_deserializeDocumentPublishedVersions(&sv.PublishedVersions, value); err != nil {
return err
}
case "RecommendedVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VersionKeyString to be of type string, got %T instead", value)
}
sv.RecommendedVersion = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentManagedRuleSetSummaries(v *[]types.ManagedRuleSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ManagedRuleSetSummary
if *v == nil {
cv = []types.ManagedRuleSetSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ManagedRuleSetSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentManagedRuleSetSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentManagedRuleSetSummary(v **types.ManagedRuleSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ManagedRuleSetSummary
if *v == nil {
sv = &types.ManagedRuleSetSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ARN = ptr.String(jtv)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "LabelNamespace":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LabelName to be of type string, got %T instead", value)
}
sv.LabelNamespace = ptr.String(jtv)
}
case "LockToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LockToken to be of type string, got %T instead", value)
}
sv.LockToken = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentManagedRuleSetVersion(v **types.ManagedRuleSetVersion, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ManagedRuleSetVersion
if *v == nil {
sv = &types.ManagedRuleSetVersion{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AssociatedRuleGroupArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.AssociatedRuleGroupArn = ptr.String(jtv)
}
case "Capacity":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected CapacityUnit to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Capacity = i64
}
case "ExpiryTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ExpiryTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "ForecastedLifetime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimeWindowDay to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ForecastedLifetime = ptr.Int32(int32(i64))
}
case "LastUpdateTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdateTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "PublishTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.PublishTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentMethod(v **types.Method, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Method
if *v == nil {
sv = &types.Method{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentMobileSdkRelease(v **types.MobileSdkRelease, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.MobileSdkRelease
if *v == nil {
sv = &types.MobileSdkRelease{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ReleaseNotes":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ReleaseNotes to be of type string, got %T instead", value)
}
sv.ReleaseNotes = ptr.String(jtv)
}
case "ReleaseVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VersionKeyString to be of type string, got %T instead", value)
}
sv.ReleaseVersion = ptr.String(jtv)
}
case "Tags":
if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
case "Timestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Timestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentNoneAction(v **types.NoneAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.NoneAction
if *v == nil {
sv = &types.NoneAction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentNotStatement(v **types.NotStatement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.NotStatement
if *v == nil {
sv = &types.NotStatement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Statement":
if err := awsAwsjson11_deserializeDocumentStatement(&sv.Statement, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentOrStatement(v **types.OrStatement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.OrStatement
if *v == nil {
sv = &types.OrStatement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Statements":
if err := awsAwsjson11_deserializeDocumentStatements(&sv.Statements, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentOverrideAction(v **types.OverrideAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.OverrideAction
if *v == nil {
sv = &types.OverrideAction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Count":
if err := awsAwsjson11_deserializeDocumentCountAction(&sv.Count, value); err != nil {
return err
}
case "None":
if err := awsAwsjson11_deserializeDocumentNoneAction(&sv.None, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentPasswordField(v **types.PasswordField, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.PasswordField
if *v == nil {
sv = &types.PasswordField{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Identifier":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FieldIdentifier to be of type string, got %T instead", value)
}
sv.Identifier = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentPhoneNumberField(v **types.PhoneNumberField, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.PhoneNumberField
if *v == nil {
sv = &types.PhoneNumberField{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Identifier":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FieldIdentifier to be of type string, got %T instead", value)
}
sv.Identifier = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentPhoneNumberFields(v *[]types.PhoneNumberField, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.PhoneNumberField
if *v == nil {
cv = []types.PhoneNumberField{}
} else {
cv = *v
}
for _, value := range shape {
var col types.PhoneNumberField
destAddr := &col
if err := awsAwsjson11_deserializeDocumentPhoneNumberField(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentPublishedVersions(v *map[string]types.ManagedRuleSetVersion, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]types.ManagedRuleSetVersion
if *v == nil {
mv = map[string]types.ManagedRuleSetVersion{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.ManagedRuleSetVersion
mapVar := parsedVal
destAddr := &mapVar
if err := awsAwsjson11_deserializeDocumentManagedRuleSetVersion(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsAwsjson11_deserializeDocumentQueryString(v **types.QueryString, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.QueryString
if *v == nil {
sv = &types.QueryString{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRateBasedStatement(v **types.RateBasedStatement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RateBasedStatement
if *v == nil {
sv = &types.RateBasedStatement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AggregateKeyType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RateBasedStatementAggregateKeyType to be of type string, got %T instead", value)
}
sv.AggregateKeyType = types.RateBasedStatementAggregateKeyType(jtv)
}
case "CustomKeys":
if err := awsAwsjson11_deserializeDocumentRateBasedStatementCustomKeys(&sv.CustomKeys, value); err != nil {
return err
}
case "ForwardedIPConfig":
if err := awsAwsjson11_deserializeDocumentForwardedIPConfig(&sv.ForwardedIPConfig, value); err != nil {
return err
}
case "Limit":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected RateLimit to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Limit = i64
}
case "ScopeDownStatement":
if err := awsAwsjson11_deserializeDocumentStatement(&sv.ScopeDownStatement, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRateBasedStatementCustomKey(v **types.RateBasedStatementCustomKey, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RateBasedStatementCustomKey
if *v == nil {
sv = &types.RateBasedStatementCustomKey{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Cookie":
if err := awsAwsjson11_deserializeDocumentRateLimitCookie(&sv.Cookie, value); err != nil {
return err
}
case "ForwardedIP":
if err := awsAwsjson11_deserializeDocumentRateLimitForwardedIP(&sv.ForwardedIP, value); err != nil {
return err
}
case "Header":
if err := awsAwsjson11_deserializeDocumentRateLimitHeader(&sv.Header, value); err != nil {
return err
}
case "HTTPMethod":
if err := awsAwsjson11_deserializeDocumentRateLimitHTTPMethod(&sv.HTTPMethod, value); err != nil {
return err
}
case "IP":
if err := awsAwsjson11_deserializeDocumentRateLimitIP(&sv.IP, value); err != nil {
return err
}
case "LabelNamespace":
if err := awsAwsjson11_deserializeDocumentRateLimitLabelNamespace(&sv.LabelNamespace, value); err != nil {
return err
}
case "QueryArgument":
if err := awsAwsjson11_deserializeDocumentRateLimitQueryArgument(&sv.QueryArgument, value); err != nil {
return err
}
case "QueryString":
if err := awsAwsjson11_deserializeDocumentRateLimitQueryString(&sv.QueryString, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRateBasedStatementCustomKeys(v *[]types.RateBasedStatementCustomKey, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.RateBasedStatementCustomKey
if *v == nil {
cv = []types.RateBasedStatementCustomKey{}
} else {
cv = *v
}
for _, value := range shape {
var col types.RateBasedStatementCustomKey
destAddr := &col
if err := awsAwsjson11_deserializeDocumentRateBasedStatementCustomKey(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRateBasedStatementManagedKeysIPSet(v **types.RateBasedStatementManagedKeysIPSet, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RateBasedStatementManagedKeysIPSet
if *v == nil {
sv = &types.RateBasedStatementManagedKeysIPSet{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Addresses":
if err := awsAwsjson11_deserializeDocumentIPAddresses(&sv.Addresses, value); err != nil {
return err
}
case "IPAddressVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IPAddressVersion to be of type string, got %T instead", value)
}
sv.IPAddressVersion = types.IPAddressVersion(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRateLimitCookie(v **types.RateLimitCookie, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RateLimitCookie
if *v == nil {
sv = &types.RateLimitCookie{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FieldToMatchData to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "TextTransformations":
if err := awsAwsjson11_deserializeDocumentTextTransformations(&sv.TextTransformations, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRateLimitForwardedIP(v **types.RateLimitForwardedIP, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RateLimitForwardedIP
if *v == nil {
sv = &types.RateLimitForwardedIP{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRateLimitHeader(v **types.RateLimitHeader, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RateLimitHeader
if *v == nil {
sv = &types.RateLimitHeader{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FieldToMatchData to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "TextTransformations":
if err := awsAwsjson11_deserializeDocumentTextTransformations(&sv.TextTransformations, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRateLimitHTTPMethod(v **types.RateLimitHTTPMethod, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RateLimitHTTPMethod
if *v == nil {
sv = &types.RateLimitHTTPMethod{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRateLimitIP(v **types.RateLimitIP, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RateLimitIP
if *v == nil {
sv = &types.RateLimitIP{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRateLimitLabelNamespace(v **types.RateLimitLabelNamespace, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RateLimitLabelNamespace
if *v == nil {
sv = &types.RateLimitLabelNamespace{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Namespace":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LabelNamespace to be of type string, got %T instead", value)
}
sv.Namespace = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRateLimitQueryArgument(v **types.RateLimitQueryArgument, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RateLimitQueryArgument
if *v == nil {
sv = &types.RateLimitQueryArgument{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FieldToMatchData to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "TextTransformations":
if err := awsAwsjson11_deserializeDocumentTextTransformations(&sv.TextTransformations, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRateLimitQueryString(v **types.RateLimitQueryString, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RateLimitQueryString
if *v == nil {
sv = &types.RateLimitQueryString{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "TextTransformations":
if err := awsAwsjson11_deserializeDocumentTextTransformations(&sv.TextTransformations, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRedactedFields(v *[]types.FieldToMatch, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.FieldToMatch
if *v == nil {
cv = []types.FieldToMatch{}
} else {
cv = *v
}
for _, value := range shape {
var col types.FieldToMatch
destAddr := &col
if err := awsAwsjson11_deserializeDocumentFieldToMatch(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRegex(v **types.Regex, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Regex
if *v == nil {
sv = &types.Regex{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "RegexString":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RegexPatternString to be of type string, got %T instead", value)
}
sv.RegexString = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRegexMatchStatement(v **types.RegexMatchStatement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RegexMatchStatement
if *v == nil {
sv = &types.RegexMatchStatement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FieldToMatch":
if err := awsAwsjson11_deserializeDocumentFieldToMatch(&sv.FieldToMatch, value); err != nil {
return err
}
case "RegexString":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RegexPatternString to be of type string, got %T instead", value)
}
sv.RegexString = ptr.String(jtv)
}
case "TextTransformations":
if err := awsAwsjson11_deserializeDocumentTextTransformations(&sv.TextTransformations, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRegexPatternSet(v **types.RegexPatternSet, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RegexPatternSet
if *v == nil {
sv = &types.RegexPatternSet{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ARN = ptr.String(jtv)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "RegularExpressionList":
if err := awsAwsjson11_deserializeDocumentRegularExpressionList(&sv.RegularExpressionList, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRegexPatternSetReferenceStatement(v **types.RegexPatternSetReferenceStatement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RegexPatternSetReferenceStatement
if *v == nil {
sv = &types.RegexPatternSetReferenceStatement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ARN = ptr.String(jtv)
}
case "FieldToMatch":
if err := awsAwsjson11_deserializeDocumentFieldToMatch(&sv.FieldToMatch, value); err != nil {
return err
}
case "TextTransformations":
if err := awsAwsjson11_deserializeDocumentTextTransformations(&sv.TextTransformations, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRegexPatternSetSummaries(v *[]types.RegexPatternSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.RegexPatternSetSummary
if *v == nil {
cv = []types.RegexPatternSetSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.RegexPatternSetSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentRegexPatternSetSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRegexPatternSetSummary(v **types.RegexPatternSetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RegexPatternSetSummary
if *v == nil {
sv = &types.RegexPatternSetSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ARN = ptr.String(jtv)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "LockToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LockToken to be of type string, got %T instead", value)
}
sv.LockToken = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRegularExpressionList(v *[]types.Regex, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Regex
if *v == nil {
cv = []types.Regex{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Regex
destAddr := &col
if err := awsAwsjson11_deserializeDocumentRegex(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentReleaseSummaries(v *[]types.ReleaseSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ReleaseSummary
if *v == nil {
cv = []types.ReleaseSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ReleaseSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentReleaseSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentReleaseSummary(v **types.ReleaseSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ReleaseSummary
if *v == nil {
sv = &types.ReleaseSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ReleaseVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VersionKeyString to be of type string, got %T instead", value)
}
sv.ReleaseVersion = ptr.String(jtv)
}
case "Timestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Timestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRequestBody(v *map[string]types.RequestBodyAssociatedResourceTypeConfig, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]types.RequestBodyAssociatedResourceTypeConfig
if *v == nil {
mv = map[string]types.RequestBodyAssociatedResourceTypeConfig{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.RequestBodyAssociatedResourceTypeConfig
mapVar := parsedVal
destAddr := &mapVar
if err := awsAwsjson11_deserializeDocumentRequestBodyAssociatedResourceTypeConfig(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsAwsjson11_deserializeDocumentRequestBodyAssociatedResourceTypeConfig(v **types.RequestBodyAssociatedResourceTypeConfig, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RequestBodyAssociatedResourceTypeConfig
if *v == nil {
sv = &types.RequestBodyAssociatedResourceTypeConfig{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DefaultSizeInspectionLimit":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SizeInspectionLimit to be of type string, got %T instead", value)
}
sv.DefaultSizeInspectionLimit = types.SizeInspectionLimit(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRequestInspection(v **types.RequestInspection, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RequestInspection
if *v == nil {
sv = &types.RequestInspection{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "PasswordField":
if err := awsAwsjson11_deserializeDocumentPasswordField(&sv.PasswordField, value); err != nil {
return err
}
case "PayloadType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PayloadType to be of type string, got %T instead", value)
}
sv.PayloadType = types.PayloadType(jtv)
}
case "UsernameField":
if err := awsAwsjson11_deserializeDocumentUsernameField(&sv.UsernameField, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRequestInspectionACFP(v **types.RequestInspectionACFP, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RequestInspectionACFP
if *v == nil {
sv = &types.RequestInspectionACFP{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AddressFields":
if err := awsAwsjson11_deserializeDocumentAddressFields(&sv.AddressFields, value); err != nil {
return err
}
case "EmailField":
if err := awsAwsjson11_deserializeDocumentEmailField(&sv.EmailField, value); err != nil {
return err
}
case "PasswordField":
if err := awsAwsjson11_deserializeDocumentPasswordField(&sv.PasswordField, value); err != nil {
return err
}
case "PayloadType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PayloadType to be of type string, got %T instead", value)
}
sv.PayloadType = types.PayloadType(jtv)
}
case "PhoneNumberFields":
if err := awsAwsjson11_deserializeDocumentPhoneNumberFields(&sv.PhoneNumberFields, value); err != nil {
return err
}
case "UsernameField":
if err := awsAwsjson11_deserializeDocumentUsernameField(&sv.UsernameField, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentResourceArns(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentResponseInspection(v **types.ResponseInspection, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResponseInspection
if *v == nil {
sv = &types.ResponseInspection{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BodyContains":
if err := awsAwsjson11_deserializeDocumentResponseInspectionBodyContains(&sv.BodyContains, value); err != nil {
return err
}
case "Header":
if err := awsAwsjson11_deserializeDocumentResponseInspectionHeader(&sv.Header, value); err != nil {
return err
}
case "Json":
if err := awsAwsjson11_deserializeDocumentResponseInspectionJson(&sv.Json, value); err != nil {
return err
}
case "StatusCode":
if err := awsAwsjson11_deserializeDocumentResponseInspectionStatusCode(&sv.StatusCode, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentResponseInspectionBodyContains(v **types.ResponseInspectionBodyContains, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResponseInspectionBodyContains
if *v == nil {
sv = &types.ResponseInspectionBodyContains{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FailureStrings":
if err := awsAwsjson11_deserializeDocumentResponseInspectionBodyContainsFailureStrings(&sv.FailureStrings, value); err != nil {
return err
}
case "SuccessStrings":
if err := awsAwsjson11_deserializeDocumentResponseInspectionBodyContainsSuccessStrings(&sv.SuccessStrings, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentResponseInspectionBodyContainsFailureStrings(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureValue to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentResponseInspectionBodyContainsSuccessStrings(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SuccessValue to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentResponseInspectionHeader(v **types.ResponseInspectionHeader, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResponseInspectionHeader
if *v == nil {
sv = &types.ResponseInspectionHeader{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FailureValues":
if err := awsAwsjson11_deserializeDocumentResponseInspectionHeaderFailureValues(&sv.FailureValues, value); err != nil {
return err
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResponseInspectionHeaderName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "SuccessValues":
if err := awsAwsjson11_deserializeDocumentResponseInspectionHeaderSuccessValues(&sv.SuccessValues, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentResponseInspectionHeaderFailureValues(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureValue to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentResponseInspectionHeaderSuccessValues(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SuccessValue to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentResponseInspectionJson(v **types.ResponseInspectionJson, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResponseInspectionJson
if *v == nil {
sv = &types.ResponseInspectionJson{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FailureValues":
if err := awsAwsjson11_deserializeDocumentResponseInspectionJsonFailureValues(&sv.FailureValues, value); err != nil {
return err
}
case "Identifier":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FieldIdentifier to be of type string, got %T instead", value)
}
sv.Identifier = ptr.String(jtv)
}
case "SuccessValues":
if err := awsAwsjson11_deserializeDocumentResponseInspectionJsonSuccessValues(&sv.SuccessValues, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentResponseInspectionJsonFailureValues(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureValue to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentResponseInspectionJsonSuccessValues(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SuccessValue to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentResponseInspectionStatusCode(v **types.ResponseInspectionStatusCode, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResponseInspectionStatusCode
if *v == nil {
sv = &types.ResponseInspectionStatusCode{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FailureCodes":
if err := awsAwsjson11_deserializeDocumentResponseInspectionStatusCodeFailureCodes(&sv.FailureCodes, value); err != nil {
return err
}
case "SuccessCodes":
if err := awsAwsjson11_deserializeDocumentResponseInspectionStatusCodeSuccessCodes(&sv.SuccessCodes, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentResponseInspectionStatusCodeFailureCodes(v *[]int32, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []int32
if *v == nil {
cv = []int32{}
} else {
cv = *v
}
for _, value := range shape {
var col int32
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected FailureCode to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
col = int32(i64)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentResponseInspectionStatusCodeSuccessCodes(v *[]int32, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []int32
if *v == nil {
cv = []int32{}
} else {
cv = *v
}
for _, value := range shape {
var col int32
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected SuccessCode to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
col = int32(i64)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRule(v **types.Rule, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Rule
if *v == nil {
sv = &types.Rule{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Action":
if err := awsAwsjson11_deserializeDocumentRuleAction(&sv.Action, value); err != nil {
return err
}
case "CaptchaConfig":
if err := awsAwsjson11_deserializeDocumentCaptchaConfig(&sv.CaptchaConfig, value); err != nil {
return err
}
case "ChallengeConfig":
if err := awsAwsjson11_deserializeDocumentChallengeConfig(&sv.ChallengeConfig, value); err != nil {
return err
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "OverrideAction":
if err := awsAwsjson11_deserializeDocumentOverrideAction(&sv.OverrideAction, value); err != nil {
return err
}
case "Priority":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected RulePriority to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Priority = int32(i64)
}
case "RuleLabels":
if err := awsAwsjson11_deserializeDocumentLabels(&sv.RuleLabels, value); err != nil {
return err
}
case "Statement":
if err := awsAwsjson11_deserializeDocumentStatement(&sv.Statement, value); err != nil {
return err
}
case "VisibilityConfig":
if err := awsAwsjson11_deserializeDocumentVisibilityConfig(&sv.VisibilityConfig, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRuleAction(v **types.RuleAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RuleAction
if *v == nil {
sv = &types.RuleAction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Allow":
if err := awsAwsjson11_deserializeDocumentAllowAction(&sv.Allow, value); err != nil {
return err
}
case "Block":
if err := awsAwsjson11_deserializeDocumentBlockAction(&sv.Block, value); err != nil {
return err
}
case "Captcha":
if err := awsAwsjson11_deserializeDocumentCaptchaAction(&sv.Captcha, value); err != nil {
return err
}
case "Challenge":
if err := awsAwsjson11_deserializeDocumentChallengeAction(&sv.Challenge, value); err != nil {
return err
}
case "Count":
if err := awsAwsjson11_deserializeDocumentCountAction(&sv.Count, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRuleActionOverride(v **types.RuleActionOverride, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RuleActionOverride
if *v == nil {
sv = &types.RuleActionOverride{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ActionToUse":
if err := awsAwsjson11_deserializeDocumentRuleAction(&sv.ActionToUse, value); err != nil {
return err
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRuleActionOverrides(v *[]types.RuleActionOverride, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.RuleActionOverride
if *v == nil {
cv = []types.RuleActionOverride{}
} else {
cv = *v
}
for _, value := range shape {
var col types.RuleActionOverride
destAddr := &col
if err := awsAwsjson11_deserializeDocumentRuleActionOverride(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRuleGroup(v **types.RuleGroup, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RuleGroup
if *v == nil {
sv = &types.RuleGroup{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ARN = ptr.String(jtv)
}
case "AvailableLabels":
if err := awsAwsjson11_deserializeDocumentLabelSummaries(&sv.AvailableLabels, value); err != nil {
return err
}
case "Capacity":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected CapacityUnit to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Capacity = i64
}
case "ConsumedLabels":
if err := awsAwsjson11_deserializeDocumentLabelSummaries(&sv.ConsumedLabels, value); err != nil {
return err
}
case "CustomResponseBodies":
if err := awsAwsjson11_deserializeDocumentCustomResponseBodies(&sv.CustomResponseBodies, value); err != nil {
return err
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "LabelNamespace":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LabelName to be of type string, got %T instead", value)
}
sv.LabelNamespace = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Rules":
if err := awsAwsjson11_deserializeDocumentRules(&sv.Rules, value); err != nil {
return err
}
case "VisibilityConfig":
if err := awsAwsjson11_deserializeDocumentVisibilityConfig(&sv.VisibilityConfig, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRuleGroupReferenceStatement(v **types.RuleGroupReferenceStatement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RuleGroupReferenceStatement
if *v == nil {
sv = &types.RuleGroupReferenceStatement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ARN = ptr.String(jtv)
}
case "ExcludedRules":
if err := awsAwsjson11_deserializeDocumentExcludedRules(&sv.ExcludedRules, value); err != nil {
return err
}
case "RuleActionOverrides":
if err := awsAwsjson11_deserializeDocumentRuleActionOverrides(&sv.RuleActionOverrides, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRuleGroupSummaries(v *[]types.RuleGroupSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.RuleGroupSummary
if *v == nil {
cv = []types.RuleGroupSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.RuleGroupSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentRuleGroupSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRuleGroupSummary(v **types.RuleGroupSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RuleGroupSummary
if *v == nil {
sv = &types.RuleGroupSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ARN = ptr.String(jtv)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "LockToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LockToken to be of type string, got %T instead", value)
}
sv.LockToken = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRules(v *[]types.Rule, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Rule
if *v == nil {
cv = []types.Rule{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Rule
destAddr := &col
if err := awsAwsjson11_deserializeDocumentRule(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRuleSummaries(v *[]types.RuleSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.RuleSummary
if *v == nil {
cv = []types.RuleSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.RuleSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentRuleSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRuleSummary(v **types.RuleSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RuleSummary
if *v == nil {
sv = &types.RuleSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Action":
if err := awsAwsjson11_deserializeDocumentRuleAction(&sv.Action, value); err != nil {
return err
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSampledHTTPRequest(v **types.SampledHTTPRequest, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SampledHTTPRequest
if *v == nil {
sv = &types.SampledHTTPRequest{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Action":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Action to be of type string, got %T instead", value)
}
sv.Action = ptr.String(jtv)
}
case "CaptchaResponse":
if err := awsAwsjson11_deserializeDocumentCaptchaResponse(&sv.CaptchaResponse, value); err != nil {
return err
}
case "ChallengeResponse":
if err := awsAwsjson11_deserializeDocumentChallengeResponse(&sv.ChallengeResponse, value); err != nil {
return err
}
case "Labels":
if err := awsAwsjson11_deserializeDocumentLabels(&sv.Labels, value); err != nil {
return err
}
case "OverriddenAction":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Action to be of type string, got %T instead", value)
}
sv.OverriddenAction = ptr.String(jtv)
}
case "Request":
if err := awsAwsjson11_deserializeDocumentHTTPRequest(&sv.Request, value); err != nil {
return err
}
case "RequestHeadersInserted":
if err := awsAwsjson11_deserializeDocumentHTTPHeaders(&sv.RequestHeadersInserted, value); err != nil {
return err
}
case "ResponseCodeSent":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ResponseStatusCode to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ResponseCodeSent = ptr.Int32(int32(i64))
}
case "RuleNameWithinRuleGroup":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.RuleNameWithinRuleGroup = ptr.String(jtv)
}
case "Timestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Timestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "Weight":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected SampleWeight to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Weight = i64
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSampledHTTPRequests(v *[]types.SampledHTTPRequest, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.SampledHTTPRequest
if *v == nil {
cv = []types.SampledHTTPRequest{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SampledHTTPRequest
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSampledHTTPRequest(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSingleHeader(v **types.SingleHeader, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SingleHeader
if *v == nil {
sv = &types.SingleHeader{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FieldToMatchData to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSingleQueryArgument(v **types.SingleQueryArgument, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SingleQueryArgument
if *v == nil {
sv = &types.SingleQueryArgument{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FieldToMatchData to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSizeConstraintStatement(v **types.SizeConstraintStatement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SizeConstraintStatement
if *v == nil {
sv = &types.SizeConstraintStatement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ComparisonOperator":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComparisonOperator to be of type string, got %T instead", value)
}
sv.ComparisonOperator = types.ComparisonOperator(jtv)
}
case "FieldToMatch":
if err := awsAwsjson11_deserializeDocumentFieldToMatch(&sv.FieldToMatch, value); err != nil {
return err
}
case "Size":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Size to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Size = i64
}
case "TextTransformations":
if err := awsAwsjson11_deserializeDocumentTextTransformations(&sv.TextTransformations, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSqliMatchStatement(v **types.SqliMatchStatement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SqliMatchStatement
if *v == nil {
sv = &types.SqliMatchStatement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FieldToMatch":
if err := awsAwsjson11_deserializeDocumentFieldToMatch(&sv.FieldToMatch, value); err != nil {
return err
}
case "SensitivityLevel":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitivityLevel to be of type string, got %T instead", value)
}
sv.SensitivityLevel = types.SensitivityLevel(jtv)
}
case "TextTransformations":
if err := awsAwsjson11_deserializeDocumentTextTransformations(&sv.TextTransformations, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentStatement(v **types.Statement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Statement
if *v == nil {
sv = &types.Statement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AndStatement":
if err := awsAwsjson11_deserializeDocumentAndStatement(&sv.AndStatement, value); err != nil {
return err
}
case "ByteMatchStatement":
if err := awsAwsjson11_deserializeDocumentByteMatchStatement(&sv.ByteMatchStatement, value); err != nil {
return err
}
case "GeoMatchStatement":
if err := awsAwsjson11_deserializeDocumentGeoMatchStatement(&sv.GeoMatchStatement, value); err != nil {
return err
}
case "IPSetReferenceStatement":
if err := awsAwsjson11_deserializeDocumentIPSetReferenceStatement(&sv.IPSetReferenceStatement, value); err != nil {
return err
}
case "LabelMatchStatement":
if err := awsAwsjson11_deserializeDocumentLabelMatchStatement(&sv.LabelMatchStatement, value); err != nil {
return err
}
case "ManagedRuleGroupStatement":
if err := awsAwsjson11_deserializeDocumentManagedRuleGroupStatement(&sv.ManagedRuleGroupStatement, value); err != nil {
return err
}
case "NotStatement":
if err := awsAwsjson11_deserializeDocumentNotStatement(&sv.NotStatement, value); err != nil {
return err
}
case "OrStatement":
if err := awsAwsjson11_deserializeDocumentOrStatement(&sv.OrStatement, value); err != nil {
return err
}
case "RateBasedStatement":
if err := awsAwsjson11_deserializeDocumentRateBasedStatement(&sv.RateBasedStatement, value); err != nil {
return err
}
case "RegexMatchStatement":
if err := awsAwsjson11_deserializeDocumentRegexMatchStatement(&sv.RegexMatchStatement, value); err != nil {
return err
}
case "RegexPatternSetReferenceStatement":
if err := awsAwsjson11_deserializeDocumentRegexPatternSetReferenceStatement(&sv.RegexPatternSetReferenceStatement, value); err != nil {
return err
}
case "RuleGroupReferenceStatement":
if err := awsAwsjson11_deserializeDocumentRuleGroupReferenceStatement(&sv.RuleGroupReferenceStatement, value); err != nil {
return err
}
case "SizeConstraintStatement":
if err := awsAwsjson11_deserializeDocumentSizeConstraintStatement(&sv.SizeConstraintStatement, value); err != nil {
return err
}
case "SqliMatchStatement":
if err := awsAwsjson11_deserializeDocumentSqliMatchStatement(&sv.SqliMatchStatement, value); err != nil {
return err
}
case "XssMatchStatement":
if err := awsAwsjson11_deserializeDocumentXssMatchStatement(&sv.XssMatchStatement, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentStatements(v *[]types.Statement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Statement
if *v == nil {
cv = []types.Statement{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Statement
destAddr := &col
if err := awsAwsjson11_deserializeDocumentStatement(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Tag
if *v == nil {
sv = &types.Tag{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagKey to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
case "Value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTagInfoForResource(v **types.TagInfoForResource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TagInfoForResource
if *v == nil {
sv = &types.TagInfoForResource{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ResourceARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ResourceARN = ptr.String(jtv)
}
case "TagList":
if err := awsAwsjson11_deserializeDocumentTagList(&sv.TagList, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Tag
if *v == nil {
cv = []types.Tag{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Tag
destAddr := &col
if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentTextTransformation(v **types.TextTransformation, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TextTransformation
if *v == nil {
sv = &types.TextTransformation{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Priority":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TextTransformationPriority to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Priority = int32(i64)
}
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TextTransformationType to be of type string, got %T instead", value)
}
sv.Type = types.TextTransformationType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTextTransformations(v *[]types.TextTransformation, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.TextTransformation
if *v == nil {
cv = []types.TextTransformation{}
} else {
cv = *v
}
for _, value := range shape {
var col types.TextTransformation
destAddr := &col
if err := awsAwsjson11_deserializeDocumentTextTransformation(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentTimeWindow(v **types.TimeWindow, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TimeWindow
if *v == nil {
sv = &types.TimeWindow{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EndTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTokenDomains(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TokenDomain to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentUriPath(v **types.UriPath, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.UriPath
if *v == nil {
sv = &types.UriPath{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentUsernameField(v **types.UsernameField, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.UsernameField
if *v == nil {
sv = &types.UsernameField{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Identifier":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FieldIdentifier to be of type string, got %T instead", value)
}
sv.Identifier = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentVisibilityConfig(v **types.VisibilityConfig, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.VisibilityConfig
if *v == nil {
sv = &types.VisibilityConfig{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CloudWatchMetricsEnabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.CloudWatchMetricsEnabled = jtv
}
case "MetricName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MetricName to be of type string, got %T instead", value)
}
sv.MetricName = ptr.String(jtv)
}
case "SampledRequestsEnabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.SampledRequestsEnabled = jtv
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFAssociatedItemException(v **types.WAFAssociatedItemException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFAssociatedItemException
if *v == nil {
sv = &types.WAFAssociatedItemException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFConfigurationWarningException(v **types.WAFConfigurationWarningException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFConfigurationWarningException
if *v == nil {
sv = &types.WAFConfigurationWarningException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFDuplicateItemException(v **types.WAFDuplicateItemException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFDuplicateItemException
if *v == nil {
sv = &types.WAFDuplicateItemException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFExpiredManagedRuleGroupVersionException(v **types.WAFExpiredManagedRuleGroupVersionException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFExpiredManagedRuleGroupVersionException
if *v == nil {
sv = &types.WAFExpiredManagedRuleGroupVersionException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFInternalErrorException(v **types.WAFInternalErrorException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFInternalErrorException
if *v == nil {
sv = &types.WAFInternalErrorException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFInvalidOperationException(v **types.WAFInvalidOperationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFInvalidOperationException
if *v == nil {
sv = &types.WAFInvalidOperationException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFInvalidParameterException(v **types.WAFInvalidParameterException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFInvalidParameterException
if *v == nil {
sv = &types.WAFInvalidParameterException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Field":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ParameterExceptionField to be of type string, got %T instead", value)
}
sv.Field = types.ParameterExceptionField(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "Parameter":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ParameterExceptionParameter to be of type string, got %T instead", value)
}
sv.Parameter = ptr.String(jtv)
}
case "Reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorReason to be of type string, got %T instead", value)
}
sv.Reason = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFInvalidPermissionPolicyException(v **types.WAFInvalidPermissionPolicyException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFInvalidPermissionPolicyException
if *v == nil {
sv = &types.WAFInvalidPermissionPolicyException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFInvalidResourceException(v **types.WAFInvalidResourceException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFInvalidResourceException
if *v == nil {
sv = &types.WAFInvalidResourceException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFLimitsExceededException(v **types.WAFLimitsExceededException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFLimitsExceededException
if *v == nil {
sv = &types.WAFLimitsExceededException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFLogDestinationPermissionIssueException(v **types.WAFLogDestinationPermissionIssueException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFLogDestinationPermissionIssueException
if *v == nil {
sv = &types.WAFLogDestinationPermissionIssueException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFNonexistentItemException(v **types.WAFNonexistentItemException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFNonexistentItemException
if *v == nil {
sv = &types.WAFNonexistentItemException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFOptimisticLockException(v **types.WAFOptimisticLockException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFOptimisticLockException
if *v == nil {
sv = &types.WAFOptimisticLockException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFServiceLinkedRoleErrorException(v **types.WAFServiceLinkedRoleErrorException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFServiceLinkedRoleErrorException
if *v == nil {
sv = &types.WAFServiceLinkedRoleErrorException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFSubscriptionNotFoundException(v **types.WAFSubscriptionNotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFSubscriptionNotFoundException
if *v == nil {
sv = &types.WAFSubscriptionNotFoundException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFTagOperationException(v **types.WAFTagOperationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFTagOperationException
if *v == nil {
sv = &types.WAFTagOperationException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFTagOperationInternalErrorException(v **types.WAFTagOperationInternalErrorException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFTagOperationInternalErrorException
if *v == nil {
sv = &types.WAFTagOperationInternalErrorException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFUnavailableEntityException(v **types.WAFUnavailableEntityException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFUnavailableEntityException
if *v == nil {
sv = &types.WAFUnavailableEntityException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWAFUnsupportedAggregateKeyTypeException(v **types.WAFUnsupportedAggregateKeyTypeException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WAFUnsupportedAggregateKeyTypeException
if *v == nil {
sv = &types.WAFUnsupportedAggregateKeyTypeException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWebACL(v **types.WebACL, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WebACL
if *v == nil {
sv = &types.WebACL{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ARN = ptr.String(jtv)
}
case "AssociationConfig":
if err := awsAwsjson11_deserializeDocumentAssociationConfig(&sv.AssociationConfig, value); err != nil {
return err
}
case "Capacity":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ConsumedCapacity to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Capacity = i64
}
case "CaptchaConfig":
if err := awsAwsjson11_deserializeDocumentCaptchaConfig(&sv.CaptchaConfig, value); err != nil {
return err
}
case "ChallengeConfig":
if err := awsAwsjson11_deserializeDocumentChallengeConfig(&sv.ChallengeConfig, value); err != nil {
return err
}
case "CustomResponseBodies":
if err := awsAwsjson11_deserializeDocumentCustomResponseBodies(&sv.CustomResponseBodies, value); err != nil {
return err
}
case "DefaultAction":
if err := awsAwsjson11_deserializeDocumentDefaultAction(&sv.DefaultAction, value); err != nil {
return err
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "LabelNamespace":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LabelName to be of type string, got %T instead", value)
}
sv.LabelNamespace = ptr.String(jtv)
}
case "ManagedByFirewallManager":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.ManagedByFirewallManager = jtv
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "PostProcessFirewallManagerRuleGroups":
if err := awsAwsjson11_deserializeDocumentFirewallManagerRuleGroups(&sv.PostProcessFirewallManagerRuleGroups, value); err != nil {
return err
}
case "PreProcessFirewallManagerRuleGroups":
if err := awsAwsjson11_deserializeDocumentFirewallManagerRuleGroups(&sv.PreProcessFirewallManagerRuleGroups, value); err != nil {
return err
}
case "Rules":
if err := awsAwsjson11_deserializeDocumentRules(&sv.Rules, value); err != nil {
return err
}
case "TokenDomains":
if err := awsAwsjson11_deserializeDocumentTokenDomains(&sv.TokenDomains, value); err != nil {
return err
}
case "VisibilityConfig":
if err := awsAwsjson11_deserializeDocumentVisibilityConfig(&sv.VisibilityConfig, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentWebACLSummaries(v *[]types.WebACLSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.WebACLSummary
if *v == nil {
cv = []types.WebACLSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.WebACLSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentWebACLSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentWebACLSummary(v **types.WebACLSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.WebACLSummary
if *v == nil {
sv = &types.WebACLSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ARN = ptr.String(jtv)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "LockToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LockToken to be of type string, got %T instead", value)
}
sv.LockToken = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentXssMatchStatement(v **types.XssMatchStatement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.XssMatchStatement
if *v == nil {
sv = &types.XssMatchStatement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FieldToMatch":
if err := awsAwsjson11_deserializeDocumentFieldToMatch(&sv.FieldToMatch, value); err != nil {
return err
}
case "TextTransformations":
if err := awsAwsjson11_deserializeDocumentTextTransformations(&sv.TextTransformations, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentAssociateWebACLOutput(v **AssociateWebACLOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AssociateWebACLOutput
if *v == nil {
sv = &AssociateWebACLOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCheckCapacityOutput(v **CheckCapacityOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CheckCapacityOutput
if *v == nil {
sv = &CheckCapacityOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Capacity":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ConsumedCapacity to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Capacity = i64
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateAPIKeyOutput(v **CreateAPIKeyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateAPIKeyOutput
if *v == nil {
sv = &CreateAPIKeyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "APIKey":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected APIKey to be of type string, got %T instead", value)
}
sv.APIKey = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateIPSetOutput(v **CreateIPSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateIPSetOutput
if *v == nil {
sv = &CreateIPSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Summary":
if err := awsAwsjson11_deserializeDocumentIPSetSummary(&sv.Summary, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateRegexPatternSetOutput(v **CreateRegexPatternSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateRegexPatternSetOutput
if *v == nil {
sv = &CreateRegexPatternSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Summary":
if err := awsAwsjson11_deserializeDocumentRegexPatternSetSummary(&sv.Summary, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateRuleGroupOutput(v **CreateRuleGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateRuleGroupOutput
if *v == nil {
sv = &CreateRuleGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Summary":
if err := awsAwsjson11_deserializeDocumentRuleGroupSummary(&sv.Summary, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateWebACLOutput(v **CreateWebACLOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateWebACLOutput
if *v == nil {
sv = &CreateWebACLOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Summary":
if err := awsAwsjson11_deserializeDocumentWebACLSummary(&sv.Summary, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteFirewallManagerRuleGroupsOutput(v **DeleteFirewallManagerRuleGroupsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteFirewallManagerRuleGroupsOutput
if *v == nil {
sv = &DeleteFirewallManagerRuleGroupsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextWebACLLockToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LockToken to be of type string, got %T instead", value)
}
sv.NextWebACLLockToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteIPSetOutput(v **DeleteIPSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteIPSetOutput
if *v == nil {
sv = &DeleteIPSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteLoggingConfigurationOutput(v **DeleteLoggingConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteLoggingConfigurationOutput
if *v == nil {
sv = &DeleteLoggingConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeletePermissionPolicyOutput(v **DeletePermissionPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeletePermissionPolicyOutput
if *v == nil {
sv = &DeletePermissionPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteRegexPatternSetOutput(v **DeleteRegexPatternSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteRegexPatternSetOutput
if *v == nil {
sv = &DeleteRegexPatternSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteRuleGroupOutput(v **DeleteRuleGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteRuleGroupOutput
if *v == nil {
sv = &DeleteRuleGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteWebACLOutput(v **DeleteWebACLOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteWebACLOutput
if *v == nil {
sv = &DeleteWebACLOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeAllManagedProductsOutput(v **DescribeAllManagedProductsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeAllManagedProductsOutput
if *v == nil {
sv = &DescribeAllManagedProductsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ManagedProducts":
if err := awsAwsjson11_deserializeDocumentManagedProductDescriptors(&sv.ManagedProducts, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeManagedProductsByVendorOutput(v **DescribeManagedProductsByVendorOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeManagedProductsByVendorOutput
if *v == nil {
sv = &DescribeManagedProductsByVendorOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ManagedProducts":
if err := awsAwsjson11_deserializeDocumentManagedProductDescriptors(&sv.ManagedProducts, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeManagedRuleGroupOutput(v **DescribeManagedRuleGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeManagedRuleGroupOutput
if *v == nil {
sv = &DescribeManagedRuleGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AvailableLabels":
if err := awsAwsjson11_deserializeDocumentLabelSummaries(&sv.AvailableLabels, value); err != nil {
return err
}
case "Capacity":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected CapacityUnit to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Capacity = i64
}
case "ConsumedLabels":
if err := awsAwsjson11_deserializeDocumentLabelSummaries(&sv.ConsumedLabels, value); err != nil {
return err
}
case "LabelNamespace":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LabelName to be of type string, got %T instead", value)
}
sv.LabelNamespace = ptr.String(jtv)
}
case "Rules":
if err := awsAwsjson11_deserializeDocumentRuleSummaries(&sv.Rules, value); err != nil {
return err
}
case "SnsTopicArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.SnsTopicArn = ptr.String(jtv)
}
case "VersionName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VersionKeyString to be of type string, got %T instead", value)
}
sv.VersionName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDisassociateWebACLOutput(v **DisassociateWebACLOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DisassociateWebACLOutput
if *v == nil {
sv = &DisassociateWebACLOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGenerateMobileSdkReleaseUrlOutput(v **GenerateMobileSdkReleaseUrlOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GenerateMobileSdkReleaseUrlOutput
if *v == nil {
sv = &GenerateMobileSdkReleaseUrlOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Url":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DownloadUrl to be of type string, got %T instead", value)
}
sv.Url = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetDecryptedAPIKeyOutput(v **GetDecryptedAPIKeyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetDecryptedAPIKeyOutput
if *v == nil {
sv = &GetDecryptedAPIKeyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreationTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "TokenDomains":
if err := awsAwsjson11_deserializeDocumentTokenDomains(&sv.TokenDomains, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetIPSetOutput(v **GetIPSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetIPSetOutput
if *v == nil {
sv = &GetIPSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "IPSet":
if err := awsAwsjson11_deserializeDocumentIPSet(&sv.IPSet, value); err != nil {
return err
}
case "LockToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LockToken to be of type string, got %T instead", value)
}
sv.LockToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetLoggingConfigurationOutput(v **GetLoggingConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetLoggingConfigurationOutput
if *v == nil {
sv = &GetLoggingConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LoggingConfiguration":
if err := awsAwsjson11_deserializeDocumentLoggingConfiguration(&sv.LoggingConfiguration, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetManagedRuleSetOutput(v **GetManagedRuleSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetManagedRuleSetOutput
if *v == nil {
sv = &GetManagedRuleSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LockToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LockToken to be of type string, got %T instead", value)
}
sv.LockToken = ptr.String(jtv)
}
case "ManagedRuleSet":
if err := awsAwsjson11_deserializeDocumentManagedRuleSet(&sv.ManagedRuleSet, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetMobileSdkReleaseOutput(v **GetMobileSdkReleaseOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetMobileSdkReleaseOutput
if *v == nil {
sv = &GetMobileSdkReleaseOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MobileSdkRelease":
if err := awsAwsjson11_deserializeDocumentMobileSdkRelease(&sv.MobileSdkRelease, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetPermissionPolicyOutput(v **GetPermissionPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetPermissionPolicyOutput
if *v == nil {
sv = &GetPermissionPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Policy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PolicyString to be of type string, got %T instead", value)
}
sv.Policy = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetRateBasedStatementManagedKeysOutput(v **GetRateBasedStatementManagedKeysOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetRateBasedStatementManagedKeysOutput
if *v == nil {
sv = &GetRateBasedStatementManagedKeysOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ManagedKeysIPV4":
if err := awsAwsjson11_deserializeDocumentRateBasedStatementManagedKeysIPSet(&sv.ManagedKeysIPV4, value); err != nil {
return err
}
case "ManagedKeysIPV6":
if err := awsAwsjson11_deserializeDocumentRateBasedStatementManagedKeysIPSet(&sv.ManagedKeysIPV6, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetRegexPatternSetOutput(v **GetRegexPatternSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetRegexPatternSetOutput
if *v == nil {
sv = &GetRegexPatternSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LockToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LockToken to be of type string, got %T instead", value)
}
sv.LockToken = ptr.String(jtv)
}
case "RegexPatternSet":
if err := awsAwsjson11_deserializeDocumentRegexPatternSet(&sv.RegexPatternSet, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetRuleGroupOutput(v **GetRuleGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetRuleGroupOutput
if *v == nil {
sv = &GetRuleGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LockToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LockToken to be of type string, got %T instead", value)
}
sv.LockToken = ptr.String(jtv)
}
case "RuleGroup":
if err := awsAwsjson11_deserializeDocumentRuleGroup(&sv.RuleGroup, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetSampledRequestsOutput(v **GetSampledRequestsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetSampledRequestsOutput
if *v == nil {
sv = &GetSampledRequestsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "PopulationSize":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected PopulationSize to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.PopulationSize = i64
}
case "SampledRequests":
if err := awsAwsjson11_deserializeDocumentSampledHTTPRequests(&sv.SampledRequests, value); err != nil {
return err
}
case "TimeWindow":
if err := awsAwsjson11_deserializeDocumentTimeWindow(&sv.TimeWindow, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetWebACLForResourceOutput(v **GetWebACLForResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetWebACLForResourceOutput
if *v == nil {
sv = &GetWebACLForResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "WebACL":
if err := awsAwsjson11_deserializeDocumentWebACL(&sv.WebACL, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetWebACLOutput(v **GetWebACLOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetWebACLOutput
if *v == nil {
sv = &GetWebACLOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ApplicationIntegrationURL":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OutputUrl to be of type string, got %T instead", value)
}
sv.ApplicationIntegrationURL = ptr.String(jtv)
}
case "LockToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LockToken to be of type string, got %T instead", value)
}
sv.LockToken = ptr.String(jtv)
}
case "WebACL":
if err := awsAwsjson11_deserializeDocumentWebACL(&sv.WebACL, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListAPIKeysOutput(v **ListAPIKeysOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListAPIKeysOutput
if *v == nil {
sv = &ListAPIKeysOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "APIKeySummaries":
if err := awsAwsjson11_deserializeDocumentAPIKeySummaries(&sv.APIKeySummaries, value); err != nil {
return err
}
case "ApplicationIntegrationURL":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OutputUrl to be of type string, got %T instead", value)
}
sv.ApplicationIntegrationURL = ptr.String(jtv)
}
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListAvailableManagedRuleGroupsOutput(v **ListAvailableManagedRuleGroupsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListAvailableManagedRuleGroupsOutput
if *v == nil {
sv = &ListAvailableManagedRuleGroupsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ManagedRuleGroups":
if err := awsAwsjson11_deserializeDocumentManagedRuleGroupSummaries(&sv.ManagedRuleGroups, value); err != nil {
return err
}
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListAvailableManagedRuleGroupVersionsOutput(v **ListAvailableManagedRuleGroupVersionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListAvailableManagedRuleGroupVersionsOutput
if *v == nil {
sv = &ListAvailableManagedRuleGroupVersionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CurrentDefaultVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VersionKeyString to be of type string, got %T instead", value)
}
sv.CurrentDefaultVersion = ptr.String(jtv)
}
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
case "Versions":
if err := awsAwsjson11_deserializeDocumentManagedRuleGroupVersions(&sv.Versions, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListIPSetsOutput(v **ListIPSetsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListIPSetsOutput
if *v == nil {
sv = &ListIPSetsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "IPSets":
if err := awsAwsjson11_deserializeDocumentIPSetSummaries(&sv.IPSets, value); err != nil {
return err
}
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListLoggingConfigurationsOutput(v **ListLoggingConfigurationsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListLoggingConfigurationsOutput
if *v == nil {
sv = &ListLoggingConfigurationsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LoggingConfigurations":
if err := awsAwsjson11_deserializeDocumentLoggingConfigurations(&sv.LoggingConfigurations, value); err != nil {
return err
}
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListManagedRuleSetsOutput(v **ListManagedRuleSetsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListManagedRuleSetsOutput
if *v == nil {
sv = &ListManagedRuleSetsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ManagedRuleSets":
if err := awsAwsjson11_deserializeDocumentManagedRuleSetSummaries(&sv.ManagedRuleSets, value); err != nil {
return err
}
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListMobileSdkReleasesOutput(v **ListMobileSdkReleasesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListMobileSdkReleasesOutput
if *v == nil {
sv = &ListMobileSdkReleasesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
case "ReleaseSummaries":
if err := awsAwsjson11_deserializeDocumentReleaseSummaries(&sv.ReleaseSummaries, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListRegexPatternSetsOutput(v **ListRegexPatternSetsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListRegexPatternSetsOutput
if *v == nil {
sv = &ListRegexPatternSetsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
case "RegexPatternSets":
if err := awsAwsjson11_deserializeDocumentRegexPatternSetSummaries(&sv.RegexPatternSets, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListResourcesForWebACLOutput(v **ListResourcesForWebACLOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListResourcesForWebACLOutput
if *v == nil {
sv = &ListResourcesForWebACLOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ResourceArns":
if err := awsAwsjson11_deserializeDocumentResourceArns(&sv.ResourceArns, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListRuleGroupsOutput(v **ListRuleGroupsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListRuleGroupsOutput
if *v == nil {
sv = &ListRuleGroupsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
case "RuleGroups":
if err := awsAwsjson11_deserializeDocumentRuleGroupSummaries(&sv.RuleGroups, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTagsForResourceOutput
if *v == nil {
sv = &ListTagsForResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
case "TagInfoForResource":
if err := awsAwsjson11_deserializeDocumentTagInfoForResource(&sv.TagInfoForResource, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListWebACLsOutput(v **ListWebACLsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListWebACLsOutput
if *v == nil {
sv = &ListWebACLsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextMarker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextMarker to be of type string, got %T instead", value)
}
sv.NextMarker = ptr.String(jtv)
}
case "WebACLs":
if err := awsAwsjson11_deserializeDocumentWebACLSummaries(&sv.WebACLs, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentPutLoggingConfigurationOutput(v **PutLoggingConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutLoggingConfigurationOutput
if *v == nil {
sv = &PutLoggingConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LoggingConfiguration":
if err := awsAwsjson11_deserializeDocumentLoggingConfiguration(&sv.LoggingConfiguration, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentPutManagedRuleSetVersionsOutput(v **PutManagedRuleSetVersionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutManagedRuleSetVersionsOutput
if *v == nil {
sv = &PutManagedRuleSetVersionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextLockToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LockToken to be of type string, got %T instead", value)
}
sv.NextLockToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentPutPermissionPolicyOutput(v **PutPermissionPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutPermissionPolicyOutput
if *v == nil {
sv = &PutPermissionPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *TagResourceOutput
if *v == nil {
sv = &TagResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UntagResourceOutput
if *v == nil {
sv = &UntagResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateIPSetOutput(v **UpdateIPSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateIPSetOutput
if *v == nil {
sv = &UpdateIPSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextLockToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LockToken to be of type string, got %T instead", value)
}
sv.NextLockToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateManagedRuleSetVersionExpiryDateOutput(v **UpdateManagedRuleSetVersionExpiryDateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateManagedRuleSetVersionExpiryDateOutput
if *v == nil {
sv = &UpdateManagedRuleSetVersionExpiryDateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ExpiringVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VersionKeyString to be of type string, got %T instead", value)
}
sv.ExpiringVersion = ptr.String(jtv)
}
case "ExpiryTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ExpiryTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "NextLockToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LockToken to be of type string, got %T instead", value)
}
sv.NextLockToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateRegexPatternSetOutput(v **UpdateRegexPatternSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateRegexPatternSetOutput
if *v == nil {
sv = &UpdateRegexPatternSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextLockToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LockToken to be of type string, got %T instead", value)
}
sv.NextLockToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateRuleGroupOutput(v **UpdateRuleGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateRuleGroupOutput
if *v == nil {
sv = &UpdateRuleGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextLockToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LockToken to be of type string, got %T instead", value)
}
sv.NextLockToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateWebACLOutput(v **UpdateWebACLOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateWebACLOutput
if *v == nil {
sv = &UpdateWebACLOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NextLockToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LockToken to be of type string, got %T instead", value)
}
sv.NextLockToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 18,458 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package wafv2 provides the API client, operations, and parameter types for AWS
// WAFV2.
//
// WAF This is the latest version of the WAF API, released in November, 2019. The
// names of the entities that you use to access this API, like endpoints and
// namespaces, all have the versioning information added, like "V2" or "v2", to
// distinguish from the prior version. We recommend migrating your resources to
// this version, because it has a number of significant improvements. If you used
// WAF prior to this release, you can't use this WAFV2 API to access any WAF
// resources that you created before. You can access your old rules, web ACLs, and
// other WAF resources only through the WAF Classic APIs. The WAF Classic APIs have
// retained the prior names, endpoints, and namespaces. For information, including
// how to migrate your WAF resources to this version, see the WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// . WAF is a web application firewall that lets you monitor the HTTP and HTTPS
// requests that are forwarded to an Amazon CloudFront distribution, Amazon API
// Gateway REST API, Application Load Balancer, AppSync GraphQL API, Amazon Cognito
// user pool, App Runner service, or Amazon Web Services Verified Access instance.
// WAF also lets you control access to your content, to protect the Amazon Web
// Services resource that WAF is monitoring. Based on conditions that you specify,
// such as the IP addresses that requests originate from or the values of query
// strings, the protected resource responds to requests with either the requested
// content, an HTTP 403 status code (Forbidden), or with a custom response. This
// API guide is for developers who need detailed information about WAF API actions,
// data types, and errors. For detailed information about WAF features and guidance
// for configuring and using WAF, see the WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/what-is-aws-waf.html)
// . You can make calls using the endpoints listed in WAF endpoints and quotas (https://docs.aws.amazon.com/general/latest/gr/waf.html)
// .
// - For regional applications, you can use any of the endpoints in the list. A
// regional application can be an Application Load Balancer (ALB), an Amazon API
// Gateway REST API, an AppSync GraphQL API, an Amazon Cognito user pool, an App
// Runner service, or an Amazon Web Services Verified Access instance.
// - For Amazon CloudFront applications, you must use the API endpoint listed
// for US East (N. Virginia): us-east-1.
//
// Alternatively, you can use one of the Amazon Web Services SDKs to access an API
// that's tailored to the programming language or platform that you're using. For
// more information, see Amazon Web Services SDKs (http://aws.amazon.com/tools/#SDKs)
// . We currently provide two versions of the WAF API: this API and the prior
// versions, the classic WAF APIs. This new API provides the same functionality as
// the older versions, with the following major improvements:
// - You use one API for both global and regional applications. Where you need
// to distinguish the scope, you specify a Scope parameter and set it to
// CLOUDFRONT or REGIONAL .
// - You can define a web ACL or rule group with a single call, and update it
// with a single call. You define all rule specifications in JSON format, and pass
// them to your rule group or web ACL calls.
// - The limits WAF places on the use of rules more closely reflects the cost of
// running each type of rule. Rule groups include capacity settings, so you know
// the maximum cost of a rule group when you use it.
package wafv2
| 53 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
"errors"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
internalendpoints "github.com/aws/aws-sdk-go-v2/service/wafv2/internal/endpoints"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net/url"
"strings"
)
// EndpointResolverOptions is the service endpoint resolver options
type EndpointResolverOptions = internalendpoints.Options
// EndpointResolver interface for resolving service endpoints.
type EndpointResolver interface {
ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)
}
var _ EndpointResolver = &internalendpoints.Resolver{}
// NewDefaultEndpointResolver constructs a new service endpoint resolver
func NewDefaultEndpointResolver() *internalendpoints.Resolver {
return internalendpoints.New()
}
// EndpointResolverFunc is a helper utility that wraps a function so it satisfies
// the EndpointResolver interface. This is useful when you want to add additional
// endpoint resolving logic, or stub out specific endpoints with custom values.
type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)
func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
return fn(region, options)
}
func resolveDefaultEndpointConfiguration(o *Options) {
if o.EndpointResolver != nil {
return
}
o.EndpointResolver = NewDefaultEndpointResolver()
}
// EndpointResolverFromURL returns an EndpointResolver configured using the
// provided endpoint url. By default, the resolved endpoint resolver uses the
// client region as signing region, and the endpoint source is set to
// EndpointSourceCustom.You can provide functional options to configure endpoint
// values for the resolved endpoint.
func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {
e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}
for _, fn := range optFns {
fn(&e)
}
return EndpointResolverFunc(
func(region string, options EndpointResolverOptions) (aws.Endpoint, error) {
if len(e.SigningRegion) == 0 {
e.SigningRegion = region
}
return e, nil
},
)
}
type ResolveEndpoint struct {
Resolver EndpointResolver
Options EndpointResolverOptions
}
func (*ResolveEndpoint) ID() string {
return "ResolveEndpoint"
}
func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
if m.Resolver == nil {
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
}
eo := m.Options
eo.Logger = middleware.GetLogger(ctx)
var endpoint aws.Endpoint
endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)
if err != nil {
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
}
req.URL, err = url.Parse(endpoint.URL)
if err != nil {
return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err)
}
if len(awsmiddleware.GetSigningName(ctx)) == 0 {
signingName := endpoint.SigningName
if len(signingName) == 0 {
signingName = "wafv2"
}
ctx = awsmiddleware.SetSigningName(ctx, signingName)
}
ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)
ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable)
ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)
ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID)
return next.HandleSerialize(ctx, in)
}
func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error {
return stack.Serialize.Insert(&ResolveEndpoint{
Resolver: o.EndpointResolver,
Options: o.EndpointOptions,
}, "OperationSerializer", middleware.Before)
}
func removeResolveEndpointMiddleware(stack *middleware.Stack) error {
_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())
return err
}
type wrappedEndpointResolver struct {
awsResolver aws.EndpointResolverWithOptions
resolver EndpointResolver
}
func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
if w.awsResolver == nil {
goto fallback
}
endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options)
if err == nil {
return endpoint, nil
}
if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) {
return endpoint, err
}
fallback:
if w.resolver == nil {
return endpoint, fmt.Errorf("default endpoint resolver provided was nil")
}
return w.resolver.ResolveEndpoint(region, options)
}
type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)
func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {
return a(service, region)
}
var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)
// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver.
// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided
// fallbackResolver for resolution.
//
// fallbackResolver must not be nil
func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver {
var resolver aws.EndpointResolverWithOptions
if awsResolverWithOptions != nil {
resolver = awsResolverWithOptions
} else if awsResolver != nil {
resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)
}
return &wrappedEndpointResolver{
awsResolver: resolver,
resolver: fallbackResolver,
}
}
func finalizeClientEndpointResolverOptions(options *Options) {
options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()
if len(options.EndpointOptions.ResolvedRegion) == 0 {
const fipsInfix = "-fips-"
const fipsPrefix = "fips-"
const fipsSuffix = "-fips"
if strings.Contains(options.Region, fipsInfix) ||
strings.Contains(options.Region, fipsPrefix) ||
strings.Contains(options.Region, fipsSuffix) {
options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(
options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "")
options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled
}
}
}
| 201 |
aws-sdk-go-v2 | aws | Go | // Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
package wafv2
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.35.1"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"path"
)
type awsAwsjson11_serializeOpAssociateWebACL struct {
}
func (*awsAwsjson11_serializeOpAssociateWebACL) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAssociateWebACL) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AssociateWebACLInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.AssociateWebACL")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAssociateWebACLInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCheckCapacity struct {
}
func (*awsAwsjson11_serializeOpCheckCapacity) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCheckCapacity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CheckCapacityInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.CheckCapacity")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCheckCapacityInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateAPIKey struct {
}
func (*awsAwsjson11_serializeOpCreateAPIKey) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateAPIKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateAPIKeyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.CreateAPIKey")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateAPIKeyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateIPSet struct {
}
func (*awsAwsjson11_serializeOpCreateIPSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateIPSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateIPSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.CreateIPSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateIPSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateRegexPatternSet struct {
}
func (*awsAwsjson11_serializeOpCreateRegexPatternSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateRegexPatternSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateRegexPatternSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.CreateRegexPatternSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateRegexPatternSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateRuleGroup struct {
}
func (*awsAwsjson11_serializeOpCreateRuleGroup) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateRuleGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateRuleGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.CreateRuleGroup")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateRuleGroupInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateWebACL struct {
}
func (*awsAwsjson11_serializeOpCreateWebACL) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateWebACL) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateWebACLInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.CreateWebACL")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateWebACLInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteFirewallManagerRuleGroups struct {
}
func (*awsAwsjson11_serializeOpDeleteFirewallManagerRuleGroups) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteFirewallManagerRuleGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteFirewallManagerRuleGroupsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.DeleteFirewallManagerRuleGroups")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteFirewallManagerRuleGroupsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteIPSet struct {
}
func (*awsAwsjson11_serializeOpDeleteIPSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteIPSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteIPSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.DeleteIPSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteIPSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteLoggingConfiguration struct {
}
func (*awsAwsjson11_serializeOpDeleteLoggingConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteLoggingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteLoggingConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.DeleteLoggingConfiguration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteLoggingConfigurationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeletePermissionPolicy struct {
}
func (*awsAwsjson11_serializeOpDeletePermissionPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeletePermissionPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeletePermissionPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.DeletePermissionPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeletePermissionPolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteRegexPatternSet struct {
}
func (*awsAwsjson11_serializeOpDeleteRegexPatternSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteRegexPatternSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteRegexPatternSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.DeleteRegexPatternSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteRegexPatternSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteRuleGroup struct {
}
func (*awsAwsjson11_serializeOpDeleteRuleGroup) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteRuleGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteRuleGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.DeleteRuleGroup")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteRuleGroupInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteWebACL struct {
}
func (*awsAwsjson11_serializeOpDeleteWebACL) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteWebACL) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteWebACLInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.DeleteWebACL")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteWebACLInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeAllManagedProducts struct {
}
func (*awsAwsjson11_serializeOpDescribeAllManagedProducts) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeAllManagedProducts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeAllManagedProductsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.DescribeAllManagedProducts")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeAllManagedProductsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeManagedProductsByVendor struct {
}
func (*awsAwsjson11_serializeOpDescribeManagedProductsByVendor) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeManagedProductsByVendor) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeManagedProductsByVendorInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.DescribeManagedProductsByVendor")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeManagedProductsByVendorInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeManagedRuleGroup struct {
}
func (*awsAwsjson11_serializeOpDescribeManagedRuleGroup) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeManagedRuleGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeManagedRuleGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.DescribeManagedRuleGroup")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeManagedRuleGroupInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDisassociateWebACL struct {
}
func (*awsAwsjson11_serializeOpDisassociateWebACL) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDisassociateWebACL) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DisassociateWebACLInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.DisassociateWebACL")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDisassociateWebACLInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGenerateMobileSdkReleaseUrl struct {
}
func (*awsAwsjson11_serializeOpGenerateMobileSdkReleaseUrl) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGenerateMobileSdkReleaseUrl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GenerateMobileSdkReleaseUrlInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.GenerateMobileSdkReleaseUrl")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGenerateMobileSdkReleaseUrlInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetDecryptedAPIKey struct {
}
func (*awsAwsjson11_serializeOpGetDecryptedAPIKey) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetDecryptedAPIKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetDecryptedAPIKeyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.GetDecryptedAPIKey")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetDecryptedAPIKeyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetIPSet struct {
}
func (*awsAwsjson11_serializeOpGetIPSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetIPSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetIPSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.GetIPSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetIPSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetLoggingConfiguration struct {
}
func (*awsAwsjson11_serializeOpGetLoggingConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetLoggingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetLoggingConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.GetLoggingConfiguration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetLoggingConfigurationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetManagedRuleSet struct {
}
func (*awsAwsjson11_serializeOpGetManagedRuleSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetManagedRuleSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetManagedRuleSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.GetManagedRuleSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetManagedRuleSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetMobileSdkRelease struct {
}
func (*awsAwsjson11_serializeOpGetMobileSdkRelease) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetMobileSdkRelease) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetMobileSdkReleaseInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.GetMobileSdkRelease")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetMobileSdkReleaseInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetPermissionPolicy struct {
}
func (*awsAwsjson11_serializeOpGetPermissionPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetPermissionPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetPermissionPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.GetPermissionPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetPermissionPolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetRateBasedStatementManagedKeys struct {
}
func (*awsAwsjson11_serializeOpGetRateBasedStatementManagedKeys) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRateBasedStatementManagedKeys) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRateBasedStatementManagedKeysInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.GetRateBasedStatementManagedKeys")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRateBasedStatementManagedKeysInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetRegexPatternSet struct {
}
func (*awsAwsjson11_serializeOpGetRegexPatternSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRegexPatternSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRegexPatternSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.GetRegexPatternSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRegexPatternSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetRuleGroup struct {
}
func (*awsAwsjson11_serializeOpGetRuleGroup) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRuleGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRuleGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.GetRuleGroup")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRuleGroupInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetSampledRequests struct {
}
func (*awsAwsjson11_serializeOpGetSampledRequests) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetSampledRequests) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetSampledRequestsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.GetSampledRequests")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetSampledRequestsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetWebACL struct {
}
func (*awsAwsjson11_serializeOpGetWebACL) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetWebACL) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetWebACLInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.GetWebACL")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetWebACLInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetWebACLForResource struct {
}
func (*awsAwsjson11_serializeOpGetWebACLForResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetWebACLForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetWebACLForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.GetWebACLForResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetWebACLForResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListAPIKeys struct {
}
func (*awsAwsjson11_serializeOpListAPIKeys) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListAPIKeys) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListAPIKeysInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.ListAPIKeys")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListAPIKeysInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListAvailableManagedRuleGroups struct {
}
func (*awsAwsjson11_serializeOpListAvailableManagedRuleGroups) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListAvailableManagedRuleGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListAvailableManagedRuleGroupsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.ListAvailableManagedRuleGroups")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListAvailableManagedRuleGroupsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListAvailableManagedRuleGroupVersions struct {
}
func (*awsAwsjson11_serializeOpListAvailableManagedRuleGroupVersions) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListAvailableManagedRuleGroupVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListAvailableManagedRuleGroupVersionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.ListAvailableManagedRuleGroupVersions")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListAvailableManagedRuleGroupVersionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListIPSets struct {
}
func (*awsAwsjson11_serializeOpListIPSets) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListIPSets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListIPSetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.ListIPSets")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListIPSetsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListLoggingConfigurations struct {
}
func (*awsAwsjson11_serializeOpListLoggingConfigurations) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListLoggingConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListLoggingConfigurationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.ListLoggingConfigurations")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListLoggingConfigurationsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListManagedRuleSets struct {
}
func (*awsAwsjson11_serializeOpListManagedRuleSets) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListManagedRuleSets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListManagedRuleSetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.ListManagedRuleSets")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListManagedRuleSetsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListMobileSdkReleases struct {
}
func (*awsAwsjson11_serializeOpListMobileSdkReleases) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListMobileSdkReleases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListMobileSdkReleasesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.ListMobileSdkReleases")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListMobileSdkReleasesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListRegexPatternSets struct {
}
func (*awsAwsjson11_serializeOpListRegexPatternSets) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListRegexPatternSets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListRegexPatternSetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.ListRegexPatternSets")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListRegexPatternSetsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListResourcesForWebACL struct {
}
func (*awsAwsjson11_serializeOpListResourcesForWebACL) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListResourcesForWebACL) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListResourcesForWebACLInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.ListResourcesForWebACL")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListResourcesForWebACLInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListRuleGroups struct {
}
func (*awsAwsjson11_serializeOpListRuleGroups) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListRuleGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListRuleGroupsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.ListRuleGroups")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListRuleGroupsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListTagsForResource struct {
}
func (*awsAwsjson11_serializeOpListTagsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTagsForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.ListTagsForResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListWebACLs struct {
}
func (*awsAwsjson11_serializeOpListWebACLs) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListWebACLs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListWebACLsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.ListWebACLs")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListWebACLsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpPutLoggingConfiguration struct {
}
func (*awsAwsjson11_serializeOpPutLoggingConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPutLoggingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutLoggingConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.PutLoggingConfiguration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPutLoggingConfigurationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpPutManagedRuleSetVersions struct {
}
func (*awsAwsjson11_serializeOpPutManagedRuleSetVersions) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPutManagedRuleSetVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutManagedRuleSetVersionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.PutManagedRuleSetVersions")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPutManagedRuleSetVersionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpPutPermissionPolicy struct {
}
func (*awsAwsjson11_serializeOpPutPermissionPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPutPermissionPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutPermissionPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.PutPermissionPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPutPermissionPolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpTagResource struct {
}
func (*awsAwsjson11_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.TagResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUntagResource struct {
}
func (*awsAwsjson11_serializeOpUntagResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UntagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.UntagResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateIPSet struct {
}
func (*awsAwsjson11_serializeOpUpdateIPSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateIPSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateIPSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.UpdateIPSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateIPSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateManagedRuleSetVersionExpiryDate struct {
}
func (*awsAwsjson11_serializeOpUpdateManagedRuleSetVersionExpiryDate) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateManagedRuleSetVersionExpiryDate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateManagedRuleSetVersionExpiryDateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.UpdateManagedRuleSetVersionExpiryDate")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateManagedRuleSetVersionExpiryDateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateRegexPatternSet struct {
}
func (*awsAwsjson11_serializeOpUpdateRegexPatternSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateRegexPatternSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateRegexPatternSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.UpdateRegexPatternSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateRegexPatternSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateRuleGroup struct {
}
func (*awsAwsjson11_serializeOpUpdateRuleGroup) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateRuleGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateRuleGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.UpdateRuleGroup")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateRuleGroupInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateWebACL struct {
}
func (*awsAwsjson11_serializeOpUpdateWebACL) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateWebACL) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateWebACLInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSWAF_20190729.UpdateWebACL")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateWebACLInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsAwsjson11_serializeDocumentActionCondition(v *types.ActionCondition, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Action) > 0 {
ok := object.Key("Action")
ok.String(string(v.Action))
}
return nil
}
func awsAwsjson11_serializeDocumentAddressField(v *types.AddressField, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Identifier != nil {
ok := object.Key("Identifier")
ok.String(*v.Identifier)
}
return nil
}
func awsAwsjson11_serializeDocumentAddressFields(v []types.AddressField, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentAddressField(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAll(v *types.All, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeDocumentAllowAction(v *types.AllowAction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CustomRequestHandling != nil {
ok := object.Key("CustomRequestHandling")
if err := awsAwsjson11_serializeDocumentCustomRequestHandling(v.CustomRequestHandling, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAllQueryArguments(v *types.AllQueryArguments, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeDocumentAndStatement(v *types.AndStatement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Statements != nil {
ok := object.Key("Statements")
if err := awsAwsjson11_serializeDocumentStatements(v.Statements, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAPIKeyTokenDomains(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentAssociationConfig(v *types.AssociationConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RequestBody != nil {
ok := object.Key("RequestBody")
if err := awsAwsjson11_serializeDocumentRequestBody(v.RequestBody, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAWSManagedRulesACFPRuleSet(v *types.AWSManagedRulesACFPRuleSet, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CreationPath != nil {
ok := object.Key("CreationPath")
ok.String(*v.CreationPath)
}
if v.EnableRegexInPath {
ok := object.Key("EnableRegexInPath")
ok.Boolean(v.EnableRegexInPath)
}
if v.RegistrationPagePath != nil {
ok := object.Key("RegistrationPagePath")
ok.String(*v.RegistrationPagePath)
}
if v.RequestInspection != nil {
ok := object.Key("RequestInspection")
if err := awsAwsjson11_serializeDocumentRequestInspectionACFP(v.RequestInspection, ok); err != nil {
return err
}
}
if v.ResponseInspection != nil {
ok := object.Key("ResponseInspection")
if err := awsAwsjson11_serializeDocumentResponseInspection(v.ResponseInspection, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAWSManagedRulesATPRuleSet(v *types.AWSManagedRulesATPRuleSet, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EnableRegexInPath {
ok := object.Key("EnableRegexInPath")
ok.Boolean(v.EnableRegexInPath)
}
if v.LoginPath != nil {
ok := object.Key("LoginPath")
ok.String(*v.LoginPath)
}
if v.RequestInspection != nil {
ok := object.Key("RequestInspection")
if err := awsAwsjson11_serializeDocumentRequestInspection(v.RequestInspection, ok); err != nil {
return err
}
}
if v.ResponseInspection != nil {
ok := object.Key("ResponseInspection")
if err := awsAwsjson11_serializeDocumentResponseInspection(v.ResponseInspection, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAWSManagedRulesBotControlRuleSet(v *types.AWSManagedRulesBotControlRuleSet, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.InspectionLevel) > 0 {
ok := object.Key("InspectionLevel")
ok.String(string(v.InspectionLevel))
}
return nil
}
func awsAwsjson11_serializeDocumentBlockAction(v *types.BlockAction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CustomResponse != nil {
ok := object.Key("CustomResponse")
if err := awsAwsjson11_serializeDocumentCustomResponse(v.CustomResponse, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentBody(v *types.Body, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.OversizeHandling) > 0 {
ok := object.Key("OversizeHandling")
ok.String(string(v.OversizeHandling))
}
return nil
}
func awsAwsjson11_serializeDocumentByteMatchStatement(v *types.ByteMatchStatement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FieldToMatch != nil {
ok := object.Key("FieldToMatch")
if err := awsAwsjson11_serializeDocumentFieldToMatch(v.FieldToMatch, ok); err != nil {
return err
}
}
if len(v.PositionalConstraint) > 0 {
ok := object.Key("PositionalConstraint")
ok.String(string(v.PositionalConstraint))
}
if v.SearchString != nil {
ok := object.Key("SearchString")
ok.Base64EncodeBytes(v.SearchString)
}
if v.TextTransformations != nil {
ok := object.Key("TextTransformations")
if err := awsAwsjson11_serializeDocumentTextTransformations(v.TextTransformations, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentCaptchaAction(v *types.CaptchaAction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CustomRequestHandling != nil {
ok := object.Key("CustomRequestHandling")
if err := awsAwsjson11_serializeDocumentCustomRequestHandling(v.CustomRequestHandling, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentCaptchaConfig(v *types.CaptchaConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ImmunityTimeProperty != nil {
ok := object.Key("ImmunityTimeProperty")
if err := awsAwsjson11_serializeDocumentImmunityTimeProperty(v.ImmunityTimeProperty, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentChallengeAction(v *types.ChallengeAction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CustomRequestHandling != nil {
ok := object.Key("CustomRequestHandling")
if err := awsAwsjson11_serializeDocumentCustomRequestHandling(v.CustomRequestHandling, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentChallengeConfig(v *types.ChallengeConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ImmunityTimeProperty != nil {
ok := object.Key("ImmunityTimeProperty")
if err := awsAwsjson11_serializeDocumentImmunityTimeProperty(v.ImmunityTimeProperty, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentCondition(v *types.Condition, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ActionCondition != nil {
ok := object.Key("ActionCondition")
if err := awsAwsjson11_serializeDocumentActionCondition(v.ActionCondition, ok); err != nil {
return err
}
}
if v.LabelNameCondition != nil {
ok := object.Key("LabelNameCondition")
if err := awsAwsjson11_serializeDocumentLabelNameCondition(v.LabelNameCondition, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentConditions(v []types.Condition, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentCondition(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentCookieMatchPattern(v *types.CookieMatchPattern, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.All != nil {
ok := object.Key("All")
if err := awsAwsjson11_serializeDocumentAll(v.All, ok); err != nil {
return err
}
}
if v.ExcludedCookies != nil {
ok := object.Key("ExcludedCookies")
if err := awsAwsjson11_serializeDocumentCookieNames(v.ExcludedCookies, ok); err != nil {
return err
}
}
if v.IncludedCookies != nil {
ok := object.Key("IncludedCookies")
if err := awsAwsjson11_serializeDocumentCookieNames(v.IncludedCookies, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentCookieNames(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentCookies(v *types.Cookies, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MatchPattern != nil {
ok := object.Key("MatchPattern")
if err := awsAwsjson11_serializeDocumentCookieMatchPattern(v.MatchPattern, ok); err != nil {
return err
}
}
if len(v.MatchScope) > 0 {
ok := object.Key("MatchScope")
ok.String(string(v.MatchScope))
}
if len(v.OversizeHandling) > 0 {
ok := object.Key("OversizeHandling")
ok.String(string(v.OversizeHandling))
}
return nil
}
func awsAwsjson11_serializeDocumentCountAction(v *types.CountAction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CustomRequestHandling != nil {
ok := object.Key("CustomRequestHandling")
if err := awsAwsjson11_serializeDocumentCustomRequestHandling(v.CustomRequestHandling, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentCountryCodes(v []types.CountryCode, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsAwsjson11_serializeDocumentCustomHTTPHeader(v *types.CustomHTTPHeader, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.Value != nil {
ok := object.Key("Value")
ok.String(*v.Value)
}
return nil
}
func awsAwsjson11_serializeDocumentCustomHTTPHeaders(v []types.CustomHTTPHeader, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentCustomHTTPHeader(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentCustomRequestHandling(v *types.CustomRequestHandling, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InsertHeaders != nil {
ok := object.Key("InsertHeaders")
if err := awsAwsjson11_serializeDocumentCustomHTTPHeaders(v.InsertHeaders, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentCustomResponse(v *types.CustomResponse, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CustomResponseBodyKey != nil {
ok := object.Key("CustomResponseBodyKey")
ok.String(*v.CustomResponseBodyKey)
}
if v.ResponseCode != nil {
ok := object.Key("ResponseCode")
ok.Integer(*v.ResponseCode)
}
if v.ResponseHeaders != nil {
ok := object.Key("ResponseHeaders")
if err := awsAwsjson11_serializeDocumentCustomHTTPHeaders(v.ResponseHeaders, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentCustomResponseBodies(v map[string]types.CustomResponseBody, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsAwsjson11_serializeDocumentCustomResponseBody(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentCustomResponseBody(v *types.CustomResponseBody, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Content != nil {
ok := object.Key("Content")
ok.String(*v.Content)
}
if len(v.ContentType) > 0 {
ok := object.Key("ContentType")
ok.String(string(v.ContentType))
}
return nil
}
func awsAwsjson11_serializeDocumentDefaultAction(v *types.DefaultAction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Allow != nil {
ok := object.Key("Allow")
if err := awsAwsjson11_serializeDocumentAllowAction(v.Allow, ok); err != nil {
return err
}
}
if v.Block != nil {
ok := object.Key("Block")
if err := awsAwsjson11_serializeDocumentBlockAction(v.Block, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentEmailField(v *types.EmailField, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Identifier != nil {
ok := object.Key("Identifier")
ok.String(*v.Identifier)
}
return nil
}
func awsAwsjson11_serializeDocumentExcludedRule(v *types.ExcludedRule, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeDocumentExcludedRules(v []types.ExcludedRule, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentExcludedRule(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentFieldToMatch(v *types.FieldToMatch, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllQueryArguments != nil {
ok := object.Key("AllQueryArguments")
if err := awsAwsjson11_serializeDocumentAllQueryArguments(v.AllQueryArguments, ok); err != nil {
return err
}
}
if v.Body != nil {
ok := object.Key("Body")
if err := awsAwsjson11_serializeDocumentBody(v.Body, ok); err != nil {
return err
}
}
if v.Cookies != nil {
ok := object.Key("Cookies")
if err := awsAwsjson11_serializeDocumentCookies(v.Cookies, ok); err != nil {
return err
}
}
if v.HeaderOrder != nil {
ok := object.Key("HeaderOrder")
if err := awsAwsjson11_serializeDocumentHeaderOrder(v.HeaderOrder, ok); err != nil {
return err
}
}
if v.Headers != nil {
ok := object.Key("Headers")
if err := awsAwsjson11_serializeDocumentHeaders(v.Headers, ok); err != nil {
return err
}
}
if v.JsonBody != nil {
ok := object.Key("JsonBody")
if err := awsAwsjson11_serializeDocumentJsonBody(v.JsonBody, ok); err != nil {
return err
}
}
if v.Method != nil {
ok := object.Key("Method")
if err := awsAwsjson11_serializeDocumentMethod(v.Method, ok); err != nil {
return err
}
}
if v.QueryString != nil {
ok := object.Key("QueryString")
if err := awsAwsjson11_serializeDocumentQueryString(v.QueryString, ok); err != nil {
return err
}
}
if v.SingleHeader != nil {
ok := object.Key("SingleHeader")
if err := awsAwsjson11_serializeDocumentSingleHeader(v.SingleHeader, ok); err != nil {
return err
}
}
if v.SingleQueryArgument != nil {
ok := object.Key("SingleQueryArgument")
if err := awsAwsjson11_serializeDocumentSingleQueryArgument(v.SingleQueryArgument, ok); err != nil {
return err
}
}
if v.UriPath != nil {
ok := object.Key("UriPath")
if err := awsAwsjson11_serializeDocumentUriPath(v.UriPath, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentFilter(v *types.Filter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Behavior) > 0 {
ok := object.Key("Behavior")
ok.String(string(v.Behavior))
}
if v.Conditions != nil {
ok := object.Key("Conditions")
if err := awsAwsjson11_serializeDocumentConditions(v.Conditions, ok); err != nil {
return err
}
}
if len(v.Requirement) > 0 {
ok := object.Key("Requirement")
ok.String(string(v.Requirement))
}
return nil
}
func awsAwsjson11_serializeDocumentFilters(v []types.Filter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentForwardedIPConfig(v *types.ForwardedIPConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.FallbackBehavior) > 0 {
ok := object.Key("FallbackBehavior")
ok.String(string(v.FallbackBehavior))
}
if v.HeaderName != nil {
ok := object.Key("HeaderName")
ok.String(*v.HeaderName)
}
return nil
}
func awsAwsjson11_serializeDocumentGeoMatchStatement(v *types.GeoMatchStatement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CountryCodes != nil {
ok := object.Key("CountryCodes")
if err := awsAwsjson11_serializeDocumentCountryCodes(v.CountryCodes, ok); err != nil {
return err
}
}
if v.ForwardedIPConfig != nil {
ok := object.Key("ForwardedIPConfig")
if err := awsAwsjson11_serializeDocumentForwardedIPConfig(v.ForwardedIPConfig, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentHeaderMatchPattern(v *types.HeaderMatchPattern, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.All != nil {
ok := object.Key("All")
if err := awsAwsjson11_serializeDocumentAll(v.All, ok); err != nil {
return err
}
}
if v.ExcludedHeaders != nil {
ok := object.Key("ExcludedHeaders")
if err := awsAwsjson11_serializeDocumentHeaderNames(v.ExcludedHeaders, ok); err != nil {
return err
}
}
if v.IncludedHeaders != nil {
ok := object.Key("IncludedHeaders")
if err := awsAwsjson11_serializeDocumentHeaderNames(v.IncludedHeaders, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentHeaderNames(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentHeaderOrder(v *types.HeaderOrder, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.OversizeHandling) > 0 {
ok := object.Key("OversizeHandling")
ok.String(string(v.OversizeHandling))
}
return nil
}
func awsAwsjson11_serializeDocumentHeaders(v *types.Headers, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MatchPattern != nil {
ok := object.Key("MatchPattern")
if err := awsAwsjson11_serializeDocumentHeaderMatchPattern(v.MatchPattern, ok); err != nil {
return err
}
}
if len(v.MatchScope) > 0 {
ok := object.Key("MatchScope")
ok.String(string(v.MatchScope))
}
if len(v.OversizeHandling) > 0 {
ok := object.Key("OversizeHandling")
ok.String(string(v.OversizeHandling))
}
return nil
}
func awsAwsjson11_serializeDocumentImmunityTimeProperty(v *types.ImmunityTimeProperty, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ImmunityTime != nil {
ok := object.Key("ImmunityTime")
ok.Long(*v.ImmunityTime)
}
return nil
}
func awsAwsjson11_serializeDocumentIPAddresses(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentIPSetForwardedIPConfig(v *types.IPSetForwardedIPConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.FallbackBehavior) > 0 {
ok := object.Key("FallbackBehavior")
ok.String(string(v.FallbackBehavior))
}
if v.HeaderName != nil {
ok := object.Key("HeaderName")
ok.String(*v.HeaderName)
}
if len(v.Position) > 0 {
ok := object.Key("Position")
ok.String(string(v.Position))
}
return nil
}
func awsAwsjson11_serializeDocumentIPSetReferenceStatement(v *types.IPSetReferenceStatement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ARN != nil {
ok := object.Key("ARN")
ok.String(*v.ARN)
}
if v.IPSetForwardedIPConfig != nil {
ok := object.Key("IPSetForwardedIPConfig")
if err := awsAwsjson11_serializeDocumentIPSetForwardedIPConfig(v.IPSetForwardedIPConfig, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentJsonBody(v *types.JsonBody, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.InvalidFallbackBehavior) > 0 {
ok := object.Key("InvalidFallbackBehavior")
ok.String(string(v.InvalidFallbackBehavior))
}
if v.MatchPattern != nil {
ok := object.Key("MatchPattern")
if err := awsAwsjson11_serializeDocumentJsonMatchPattern(v.MatchPattern, ok); err != nil {
return err
}
}
if len(v.MatchScope) > 0 {
ok := object.Key("MatchScope")
ok.String(string(v.MatchScope))
}
if len(v.OversizeHandling) > 0 {
ok := object.Key("OversizeHandling")
ok.String(string(v.OversizeHandling))
}
return nil
}
func awsAwsjson11_serializeDocumentJsonMatchPattern(v *types.JsonMatchPattern, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.All != nil {
ok := object.Key("All")
if err := awsAwsjson11_serializeDocumentAll(v.All, ok); err != nil {
return err
}
}
if v.IncludedPaths != nil {
ok := object.Key("IncludedPaths")
if err := awsAwsjson11_serializeDocumentJsonPointerPaths(v.IncludedPaths, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentJsonPointerPaths(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentLabel(v *types.Label, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeDocumentLabelMatchStatement(v *types.LabelMatchStatement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Key != nil {
ok := object.Key("Key")
ok.String(*v.Key)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeDocumentLabelNameCondition(v *types.LabelNameCondition, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LabelName != nil {
ok := object.Key("LabelName")
ok.String(*v.LabelName)
}
return nil
}
func awsAwsjson11_serializeDocumentLabels(v []types.Label, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentLabel(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentLogDestinationConfigs(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentLoggingConfiguration(v *types.LoggingConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LogDestinationConfigs != nil {
ok := object.Key("LogDestinationConfigs")
if err := awsAwsjson11_serializeDocumentLogDestinationConfigs(v.LogDestinationConfigs, ok); err != nil {
return err
}
}
if v.LoggingFilter != nil {
ok := object.Key("LoggingFilter")
if err := awsAwsjson11_serializeDocumentLoggingFilter(v.LoggingFilter, ok); err != nil {
return err
}
}
if v.ManagedByFirewallManager {
ok := object.Key("ManagedByFirewallManager")
ok.Boolean(v.ManagedByFirewallManager)
}
if v.RedactedFields != nil {
ok := object.Key("RedactedFields")
if err := awsAwsjson11_serializeDocumentRedactedFields(v.RedactedFields, ok); err != nil {
return err
}
}
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeDocumentLoggingFilter(v *types.LoggingFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.DefaultBehavior) > 0 {
ok := object.Key("DefaultBehavior")
ok.String(string(v.DefaultBehavior))
}
if v.Filters != nil {
ok := object.Key("Filters")
if err := awsAwsjson11_serializeDocumentFilters(v.Filters, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentManagedRuleGroupConfig(v *types.ManagedRuleGroupConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AWSManagedRulesACFPRuleSet != nil {
ok := object.Key("AWSManagedRulesACFPRuleSet")
if err := awsAwsjson11_serializeDocumentAWSManagedRulesACFPRuleSet(v.AWSManagedRulesACFPRuleSet, ok); err != nil {
return err
}
}
if v.AWSManagedRulesATPRuleSet != nil {
ok := object.Key("AWSManagedRulesATPRuleSet")
if err := awsAwsjson11_serializeDocumentAWSManagedRulesATPRuleSet(v.AWSManagedRulesATPRuleSet, ok); err != nil {
return err
}
}
if v.AWSManagedRulesBotControlRuleSet != nil {
ok := object.Key("AWSManagedRulesBotControlRuleSet")
if err := awsAwsjson11_serializeDocumentAWSManagedRulesBotControlRuleSet(v.AWSManagedRulesBotControlRuleSet, ok); err != nil {
return err
}
}
if v.LoginPath != nil {
ok := object.Key("LoginPath")
ok.String(*v.LoginPath)
}
if v.PasswordField != nil {
ok := object.Key("PasswordField")
if err := awsAwsjson11_serializeDocumentPasswordField(v.PasswordField, ok); err != nil {
return err
}
}
if len(v.PayloadType) > 0 {
ok := object.Key("PayloadType")
ok.String(string(v.PayloadType))
}
if v.UsernameField != nil {
ok := object.Key("UsernameField")
if err := awsAwsjson11_serializeDocumentUsernameField(v.UsernameField, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentManagedRuleGroupConfigs(v []types.ManagedRuleGroupConfig, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentManagedRuleGroupConfig(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentManagedRuleGroupStatement(v *types.ManagedRuleGroupStatement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ExcludedRules != nil {
ok := object.Key("ExcludedRules")
if err := awsAwsjson11_serializeDocumentExcludedRules(v.ExcludedRules, ok); err != nil {
return err
}
}
if v.ManagedRuleGroupConfigs != nil {
ok := object.Key("ManagedRuleGroupConfigs")
if err := awsAwsjson11_serializeDocumentManagedRuleGroupConfigs(v.ManagedRuleGroupConfigs, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.RuleActionOverrides != nil {
ok := object.Key("RuleActionOverrides")
if err := awsAwsjson11_serializeDocumentRuleActionOverrides(v.RuleActionOverrides, ok); err != nil {
return err
}
}
if v.ScopeDownStatement != nil {
ok := object.Key("ScopeDownStatement")
if err := awsAwsjson11_serializeDocumentStatement(v.ScopeDownStatement, ok); err != nil {
return err
}
}
if v.VendorName != nil {
ok := object.Key("VendorName")
ok.String(*v.VendorName)
}
if v.Version != nil {
ok := object.Key("Version")
ok.String(*v.Version)
}
return nil
}
func awsAwsjson11_serializeDocumentMethod(v *types.Method, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeDocumentNoneAction(v *types.NoneAction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeDocumentNotStatement(v *types.NotStatement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Statement != nil {
ok := object.Key("Statement")
if err := awsAwsjson11_serializeDocumentStatement(v.Statement, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentOrStatement(v *types.OrStatement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Statements != nil {
ok := object.Key("Statements")
if err := awsAwsjson11_serializeDocumentStatements(v.Statements, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentOverrideAction(v *types.OverrideAction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Count != nil {
ok := object.Key("Count")
if err := awsAwsjson11_serializeDocumentCountAction(v.Count, ok); err != nil {
return err
}
}
if v.None != nil {
ok := object.Key("None")
if err := awsAwsjson11_serializeDocumentNoneAction(v.None, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentPasswordField(v *types.PasswordField, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Identifier != nil {
ok := object.Key("Identifier")
ok.String(*v.Identifier)
}
return nil
}
func awsAwsjson11_serializeDocumentPhoneNumberField(v *types.PhoneNumberField, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Identifier != nil {
ok := object.Key("Identifier")
ok.String(*v.Identifier)
}
return nil
}
func awsAwsjson11_serializeDocumentPhoneNumberFields(v []types.PhoneNumberField, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentPhoneNumberField(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentQueryString(v *types.QueryString, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeDocumentRateBasedStatement(v *types.RateBasedStatement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.AggregateKeyType) > 0 {
ok := object.Key("AggregateKeyType")
ok.String(string(v.AggregateKeyType))
}
if v.CustomKeys != nil {
ok := object.Key("CustomKeys")
if err := awsAwsjson11_serializeDocumentRateBasedStatementCustomKeys(v.CustomKeys, ok); err != nil {
return err
}
}
if v.ForwardedIPConfig != nil {
ok := object.Key("ForwardedIPConfig")
if err := awsAwsjson11_serializeDocumentForwardedIPConfig(v.ForwardedIPConfig, ok); err != nil {
return err
}
}
{
ok := object.Key("Limit")
ok.Long(v.Limit)
}
if v.ScopeDownStatement != nil {
ok := object.Key("ScopeDownStatement")
if err := awsAwsjson11_serializeDocumentStatement(v.ScopeDownStatement, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRateBasedStatementCustomKey(v *types.RateBasedStatementCustomKey, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Cookie != nil {
ok := object.Key("Cookie")
if err := awsAwsjson11_serializeDocumentRateLimitCookie(v.Cookie, ok); err != nil {
return err
}
}
if v.ForwardedIP != nil {
ok := object.Key("ForwardedIP")
if err := awsAwsjson11_serializeDocumentRateLimitForwardedIP(v.ForwardedIP, ok); err != nil {
return err
}
}
if v.Header != nil {
ok := object.Key("Header")
if err := awsAwsjson11_serializeDocumentRateLimitHeader(v.Header, ok); err != nil {
return err
}
}
if v.HTTPMethod != nil {
ok := object.Key("HTTPMethod")
if err := awsAwsjson11_serializeDocumentRateLimitHTTPMethod(v.HTTPMethod, ok); err != nil {
return err
}
}
if v.IP != nil {
ok := object.Key("IP")
if err := awsAwsjson11_serializeDocumentRateLimitIP(v.IP, ok); err != nil {
return err
}
}
if v.LabelNamespace != nil {
ok := object.Key("LabelNamespace")
if err := awsAwsjson11_serializeDocumentRateLimitLabelNamespace(v.LabelNamespace, ok); err != nil {
return err
}
}
if v.QueryArgument != nil {
ok := object.Key("QueryArgument")
if err := awsAwsjson11_serializeDocumentRateLimitQueryArgument(v.QueryArgument, ok); err != nil {
return err
}
}
if v.QueryString != nil {
ok := object.Key("QueryString")
if err := awsAwsjson11_serializeDocumentRateLimitQueryString(v.QueryString, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRateBasedStatementCustomKeys(v []types.RateBasedStatementCustomKey, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentRateBasedStatementCustomKey(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRateLimitCookie(v *types.RateLimitCookie, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.TextTransformations != nil {
ok := object.Key("TextTransformations")
if err := awsAwsjson11_serializeDocumentTextTransformations(v.TextTransformations, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRateLimitForwardedIP(v *types.RateLimitForwardedIP, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeDocumentRateLimitHeader(v *types.RateLimitHeader, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.TextTransformations != nil {
ok := object.Key("TextTransformations")
if err := awsAwsjson11_serializeDocumentTextTransformations(v.TextTransformations, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRateLimitHTTPMethod(v *types.RateLimitHTTPMethod, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeDocumentRateLimitIP(v *types.RateLimitIP, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeDocumentRateLimitLabelNamespace(v *types.RateLimitLabelNamespace, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Namespace != nil {
ok := object.Key("Namespace")
ok.String(*v.Namespace)
}
return nil
}
func awsAwsjson11_serializeDocumentRateLimitQueryArgument(v *types.RateLimitQueryArgument, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.TextTransformations != nil {
ok := object.Key("TextTransformations")
if err := awsAwsjson11_serializeDocumentTextTransformations(v.TextTransformations, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRateLimitQueryString(v *types.RateLimitQueryString, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TextTransformations != nil {
ok := object.Key("TextTransformations")
if err := awsAwsjson11_serializeDocumentTextTransformations(v.TextTransformations, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRedactedFields(v []types.FieldToMatch, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentFieldToMatch(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRegex(v *types.Regex, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RegexString != nil {
ok := object.Key("RegexString")
ok.String(*v.RegexString)
}
return nil
}
func awsAwsjson11_serializeDocumentRegexMatchStatement(v *types.RegexMatchStatement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FieldToMatch != nil {
ok := object.Key("FieldToMatch")
if err := awsAwsjson11_serializeDocumentFieldToMatch(v.FieldToMatch, ok); err != nil {
return err
}
}
if v.RegexString != nil {
ok := object.Key("RegexString")
ok.String(*v.RegexString)
}
if v.TextTransformations != nil {
ok := object.Key("TextTransformations")
if err := awsAwsjson11_serializeDocumentTextTransformations(v.TextTransformations, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRegexPatternSetReferenceStatement(v *types.RegexPatternSetReferenceStatement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ARN != nil {
ok := object.Key("ARN")
ok.String(*v.ARN)
}
if v.FieldToMatch != nil {
ok := object.Key("FieldToMatch")
if err := awsAwsjson11_serializeDocumentFieldToMatch(v.FieldToMatch, ok); err != nil {
return err
}
}
if v.TextTransformations != nil {
ok := object.Key("TextTransformations")
if err := awsAwsjson11_serializeDocumentTextTransformations(v.TextTransformations, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRegularExpressionList(v []types.Regex, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentRegex(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRequestBody(v map[string]types.RequestBodyAssociatedResourceTypeConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsAwsjson11_serializeDocumentRequestBodyAssociatedResourceTypeConfig(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRequestBodyAssociatedResourceTypeConfig(v *types.RequestBodyAssociatedResourceTypeConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.DefaultSizeInspectionLimit) > 0 {
ok := object.Key("DefaultSizeInspectionLimit")
ok.String(string(v.DefaultSizeInspectionLimit))
}
return nil
}
func awsAwsjson11_serializeDocumentRequestInspection(v *types.RequestInspection, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PasswordField != nil {
ok := object.Key("PasswordField")
if err := awsAwsjson11_serializeDocumentPasswordField(v.PasswordField, ok); err != nil {
return err
}
}
if len(v.PayloadType) > 0 {
ok := object.Key("PayloadType")
ok.String(string(v.PayloadType))
}
if v.UsernameField != nil {
ok := object.Key("UsernameField")
if err := awsAwsjson11_serializeDocumentUsernameField(v.UsernameField, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRequestInspectionACFP(v *types.RequestInspectionACFP, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AddressFields != nil {
ok := object.Key("AddressFields")
if err := awsAwsjson11_serializeDocumentAddressFields(v.AddressFields, ok); err != nil {
return err
}
}
if v.EmailField != nil {
ok := object.Key("EmailField")
if err := awsAwsjson11_serializeDocumentEmailField(v.EmailField, ok); err != nil {
return err
}
}
if v.PasswordField != nil {
ok := object.Key("PasswordField")
if err := awsAwsjson11_serializeDocumentPasswordField(v.PasswordField, ok); err != nil {
return err
}
}
if len(v.PayloadType) > 0 {
ok := object.Key("PayloadType")
ok.String(string(v.PayloadType))
}
if v.PhoneNumberFields != nil {
ok := object.Key("PhoneNumberFields")
if err := awsAwsjson11_serializeDocumentPhoneNumberFields(v.PhoneNumberFields, ok); err != nil {
return err
}
}
if v.UsernameField != nil {
ok := object.Key("UsernameField")
if err := awsAwsjson11_serializeDocumentUsernameField(v.UsernameField, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentResponseInspection(v *types.ResponseInspection, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BodyContains != nil {
ok := object.Key("BodyContains")
if err := awsAwsjson11_serializeDocumentResponseInspectionBodyContains(v.BodyContains, ok); err != nil {
return err
}
}
if v.Header != nil {
ok := object.Key("Header")
if err := awsAwsjson11_serializeDocumentResponseInspectionHeader(v.Header, ok); err != nil {
return err
}
}
if v.Json != nil {
ok := object.Key("Json")
if err := awsAwsjson11_serializeDocumentResponseInspectionJson(v.Json, ok); err != nil {
return err
}
}
if v.StatusCode != nil {
ok := object.Key("StatusCode")
if err := awsAwsjson11_serializeDocumentResponseInspectionStatusCode(v.StatusCode, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentResponseInspectionBodyContains(v *types.ResponseInspectionBodyContains, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FailureStrings != nil {
ok := object.Key("FailureStrings")
if err := awsAwsjson11_serializeDocumentResponseInspectionBodyContainsFailureStrings(v.FailureStrings, ok); err != nil {
return err
}
}
if v.SuccessStrings != nil {
ok := object.Key("SuccessStrings")
if err := awsAwsjson11_serializeDocumentResponseInspectionBodyContainsSuccessStrings(v.SuccessStrings, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentResponseInspectionBodyContainsFailureStrings(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentResponseInspectionBodyContainsSuccessStrings(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentResponseInspectionHeader(v *types.ResponseInspectionHeader, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FailureValues != nil {
ok := object.Key("FailureValues")
if err := awsAwsjson11_serializeDocumentResponseInspectionHeaderFailureValues(v.FailureValues, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.SuccessValues != nil {
ok := object.Key("SuccessValues")
if err := awsAwsjson11_serializeDocumentResponseInspectionHeaderSuccessValues(v.SuccessValues, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentResponseInspectionHeaderFailureValues(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentResponseInspectionHeaderSuccessValues(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentResponseInspectionJson(v *types.ResponseInspectionJson, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FailureValues != nil {
ok := object.Key("FailureValues")
if err := awsAwsjson11_serializeDocumentResponseInspectionJsonFailureValues(v.FailureValues, ok); err != nil {
return err
}
}
if v.Identifier != nil {
ok := object.Key("Identifier")
ok.String(*v.Identifier)
}
if v.SuccessValues != nil {
ok := object.Key("SuccessValues")
if err := awsAwsjson11_serializeDocumentResponseInspectionJsonSuccessValues(v.SuccessValues, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentResponseInspectionJsonFailureValues(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentResponseInspectionJsonSuccessValues(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentResponseInspectionStatusCode(v *types.ResponseInspectionStatusCode, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FailureCodes != nil {
ok := object.Key("FailureCodes")
if err := awsAwsjson11_serializeDocumentResponseInspectionStatusCodeFailureCodes(v.FailureCodes, ok); err != nil {
return err
}
}
if v.SuccessCodes != nil {
ok := object.Key("SuccessCodes")
if err := awsAwsjson11_serializeDocumentResponseInspectionStatusCodeSuccessCodes(v.SuccessCodes, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentResponseInspectionStatusCodeFailureCodes(v []int32, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.Integer(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentResponseInspectionStatusCodeSuccessCodes(v []int32, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.Integer(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentRule(v *types.Rule, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Action != nil {
ok := object.Key("Action")
if err := awsAwsjson11_serializeDocumentRuleAction(v.Action, ok); err != nil {
return err
}
}
if v.CaptchaConfig != nil {
ok := object.Key("CaptchaConfig")
if err := awsAwsjson11_serializeDocumentCaptchaConfig(v.CaptchaConfig, ok); err != nil {
return err
}
}
if v.ChallengeConfig != nil {
ok := object.Key("ChallengeConfig")
if err := awsAwsjson11_serializeDocumentChallengeConfig(v.ChallengeConfig, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.OverrideAction != nil {
ok := object.Key("OverrideAction")
if err := awsAwsjson11_serializeDocumentOverrideAction(v.OverrideAction, ok); err != nil {
return err
}
}
{
ok := object.Key("Priority")
ok.Integer(v.Priority)
}
if v.RuleLabels != nil {
ok := object.Key("RuleLabels")
if err := awsAwsjson11_serializeDocumentLabels(v.RuleLabels, ok); err != nil {
return err
}
}
if v.Statement != nil {
ok := object.Key("Statement")
if err := awsAwsjson11_serializeDocumentStatement(v.Statement, ok); err != nil {
return err
}
}
if v.VisibilityConfig != nil {
ok := object.Key("VisibilityConfig")
if err := awsAwsjson11_serializeDocumentVisibilityConfig(v.VisibilityConfig, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRuleAction(v *types.RuleAction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Allow != nil {
ok := object.Key("Allow")
if err := awsAwsjson11_serializeDocumentAllowAction(v.Allow, ok); err != nil {
return err
}
}
if v.Block != nil {
ok := object.Key("Block")
if err := awsAwsjson11_serializeDocumentBlockAction(v.Block, ok); err != nil {
return err
}
}
if v.Captcha != nil {
ok := object.Key("Captcha")
if err := awsAwsjson11_serializeDocumentCaptchaAction(v.Captcha, ok); err != nil {
return err
}
}
if v.Challenge != nil {
ok := object.Key("Challenge")
if err := awsAwsjson11_serializeDocumentChallengeAction(v.Challenge, ok); err != nil {
return err
}
}
if v.Count != nil {
ok := object.Key("Count")
if err := awsAwsjson11_serializeDocumentCountAction(v.Count, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRuleActionOverride(v *types.RuleActionOverride, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ActionToUse != nil {
ok := object.Key("ActionToUse")
if err := awsAwsjson11_serializeDocumentRuleAction(v.ActionToUse, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeDocumentRuleActionOverrides(v []types.RuleActionOverride, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentRuleActionOverride(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRuleGroupReferenceStatement(v *types.RuleGroupReferenceStatement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ARN != nil {
ok := object.Key("ARN")
ok.String(*v.ARN)
}
if v.ExcludedRules != nil {
ok := object.Key("ExcludedRules")
if err := awsAwsjson11_serializeDocumentExcludedRules(v.ExcludedRules, ok); err != nil {
return err
}
}
if v.RuleActionOverrides != nil {
ok := object.Key("RuleActionOverrides")
if err := awsAwsjson11_serializeDocumentRuleActionOverrides(v.RuleActionOverrides, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRules(v []types.Rule, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentRule(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentSingleHeader(v *types.SingleHeader, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeDocumentSingleQueryArgument(v *types.SingleQueryArgument, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeDocumentSizeConstraintStatement(v *types.SizeConstraintStatement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ComparisonOperator) > 0 {
ok := object.Key("ComparisonOperator")
ok.String(string(v.ComparisonOperator))
}
if v.FieldToMatch != nil {
ok := object.Key("FieldToMatch")
if err := awsAwsjson11_serializeDocumentFieldToMatch(v.FieldToMatch, ok); err != nil {
return err
}
}
{
ok := object.Key("Size")
ok.Long(v.Size)
}
if v.TextTransformations != nil {
ok := object.Key("TextTransformations")
if err := awsAwsjson11_serializeDocumentTextTransformations(v.TextTransformations, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentSqliMatchStatement(v *types.SqliMatchStatement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FieldToMatch != nil {
ok := object.Key("FieldToMatch")
if err := awsAwsjson11_serializeDocumentFieldToMatch(v.FieldToMatch, ok); err != nil {
return err
}
}
if len(v.SensitivityLevel) > 0 {
ok := object.Key("SensitivityLevel")
ok.String(string(v.SensitivityLevel))
}
if v.TextTransformations != nil {
ok := object.Key("TextTransformations")
if err := awsAwsjson11_serializeDocumentTextTransformations(v.TextTransformations, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentStatement(v *types.Statement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AndStatement != nil {
ok := object.Key("AndStatement")
if err := awsAwsjson11_serializeDocumentAndStatement(v.AndStatement, ok); err != nil {
return err
}
}
if v.ByteMatchStatement != nil {
ok := object.Key("ByteMatchStatement")
if err := awsAwsjson11_serializeDocumentByteMatchStatement(v.ByteMatchStatement, ok); err != nil {
return err
}
}
if v.GeoMatchStatement != nil {
ok := object.Key("GeoMatchStatement")
if err := awsAwsjson11_serializeDocumentGeoMatchStatement(v.GeoMatchStatement, ok); err != nil {
return err
}
}
if v.IPSetReferenceStatement != nil {
ok := object.Key("IPSetReferenceStatement")
if err := awsAwsjson11_serializeDocumentIPSetReferenceStatement(v.IPSetReferenceStatement, ok); err != nil {
return err
}
}
if v.LabelMatchStatement != nil {
ok := object.Key("LabelMatchStatement")
if err := awsAwsjson11_serializeDocumentLabelMatchStatement(v.LabelMatchStatement, ok); err != nil {
return err
}
}
if v.ManagedRuleGroupStatement != nil {
ok := object.Key("ManagedRuleGroupStatement")
if err := awsAwsjson11_serializeDocumentManagedRuleGroupStatement(v.ManagedRuleGroupStatement, ok); err != nil {
return err
}
}
if v.NotStatement != nil {
ok := object.Key("NotStatement")
if err := awsAwsjson11_serializeDocumentNotStatement(v.NotStatement, ok); err != nil {
return err
}
}
if v.OrStatement != nil {
ok := object.Key("OrStatement")
if err := awsAwsjson11_serializeDocumentOrStatement(v.OrStatement, ok); err != nil {
return err
}
}
if v.RateBasedStatement != nil {
ok := object.Key("RateBasedStatement")
if err := awsAwsjson11_serializeDocumentRateBasedStatement(v.RateBasedStatement, ok); err != nil {
return err
}
}
if v.RegexMatchStatement != nil {
ok := object.Key("RegexMatchStatement")
if err := awsAwsjson11_serializeDocumentRegexMatchStatement(v.RegexMatchStatement, ok); err != nil {
return err
}
}
if v.RegexPatternSetReferenceStatement != nil {
ok := object.Key("RegexPatternSetReferenceStatement")
if err := awsAwsjson11_serializeDocumentRegexPatternSetReferenceStatement(v.RegexPatternSetReferenceStatement, ok); err != nil {
return err
}
}
if v.RuleGroupReferenceStatement != nil {
ok := object.Key("RuleGroupReferenceStatement")
if err := awsAwsjson11_serializeDocumentRuleGroupReferenceStatement(v.RuleGroupReferenceStatement, ok); err != nil {
return err
}
}
if v.SizeConstraintStatement != nil {
ok := object.Key("SizeConstraintStatement")
if err := awsAwsjson11_serializeDocumentSizeConstraintStatement(v.SizeConstraintStatement, ok); err != nil {
return err
}
}
if v.SqliMatchStatement != nil {
ok := object.Key("SqliMatchStatement")
if err := awsAwsjson11_serializeDocumentSqliMatchStatement(v.SqliMatchStatement, ok); err != nil {
return err
}
}
if v.XssMatchStatement != nil {
ok := object.Key("XssMatchStatement")
if err := awsAwsjson11_serializeDocumentXssMatchStatement(v.XssMatchStatement, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentStatements(v []types.Statement, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentStatement(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Key != nil {
ok := object.Key("Key")
ok.String(*v.Key)
}
if v.Value != nil {
ok := object.Key("Value")
ok.String(*v.Value)
}
return nil
}
func awsAwsjson11_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentTextTransformation(v *types.TextTransformation, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
{
ok := object.Key("Priority")
ok.Integer(v.Priority)
}
if len(v.Type) > 0 {
ok := object.Key("Type")
ok.String(string(v.Type))
}
return nil
}
func awsAwsjson11_serializeDocumentTextTransformations(v []types.TextTransformation, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentTextTransformation(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentTimeWindow(v *types.TimeWindow, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EndTime != nil {
ok := object.Key("EndTime")
ok.Double(smithytime.FormatEpochSeconds(*v.EndTime))
}
if v.StartTime != nil {
ok := object.Key("StartTime")
ok.Double(smithytime.FormatEpochSeconds(*v.StartTime))
}
return nil
}
func awsAwsjson11_serializeDocumentTokenDomains(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentUriPath(v *types.UriPath, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeDocumentUsernameField(v *types.UsernameField, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Identifier != nil {
ok := object.Key("Identifier")
ok.String(*v.Identifier)
}
return nil
}
func awsAwsjson11_serializeDocumentVersionsToPublish(v map[string]types.VersionToPublish, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsAwsjson11_serializeDocumentVersionToPublish(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentVersionToPublish(v *types.VersionToPublish, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssociatedRuleGroupArn != nil {
ok := object.Key("AssociatedRuleGroupArn")
ok.String(*v.AssociatedRuleGroupArn)
}
if v.ForecastedLifetime != nil {
ok := object.Key("ForecastedLifetime")
ok.Integer(*v.ForecastedLifetime)
}
return nil
}
func awsAwsjson11_serializeDocumentVisibilityConfig(v *types.VisibilityConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
{
ok := object.Key("CloudWatchMetricsEnabled")
ok.Boolean(v.CloudWatchMetricsEnabled)
}
if v.MetricName != nil {
ok := object.Key("MetricName")
ok.String(*v.MetricName)
}
{
ok := object.Key("SampledRequestsEnabled")
ok.Boolean(v.SampledRequestsEnabled)
}
return nil
}
func awsAwsjson11_serializeDocumentXssMatchStatement(v *types.XssMatchStatement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FieldToMatch != nil {
ok := object.Key("FieldToMatch")
if err := awsAwsjson11_serializeDocumentFieldToMatch(v.FieldToMatch, ok); err != nil {
return err
}
}
if v.TextTransformations != nil {
ok := object.Key("TextTransformations")
if err := awsAwsjson11_serializeDocumentTextTransformations(v.TextTransformations, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentAssociateWebACLInput(v *AssociateWebACLInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
if v.WebACLArn != nil {
ok := object.Key("WebACLArn")
ok.String(*v.WebACLArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCheckCapacityInput(v *CheckCapacityInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Rules != nil {
ok := object.Key("Rules")
if err := awsAwsjson11_serializeDocumentRules(v.Rules, ok); err != nil {
return err
}
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateAPIKeyInput(v *CreateAPIKeyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
if v.TokenDomains != nil {
ok := object.Key("TokenDomains")
if err := awsAwsjson11_serializeDocumentAPIKeyTokenDomains(v.TokenDomains, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateIPSetInput(v *CreateIPSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Addresses != nil {
ok := object.Key("Addresses")
if err := awsAwsjson11_serializeDocumentIPAddresses(v.Addresses, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if len(v.IPAddressVersion) > 0 {
ok := object.Key("IPAddressVersion")
ok.String(string(v.IPAddressVersion))
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateRegexPatternSetInput(v *CreateRegexPatternSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.RegularExpressionList != nil {
ok := object.Key("RegularExpressionList")
if err := awsAwsjson11_serializeDocumentRegularExpressionList(v.RegularExpressionList, ok); err != nil {
return err
}
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateRuleGroupInput(v *CreateRuleGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
{
ok := object.Key("Capacity")
ok.Long(v.Capacity)
}
if v.CustomResponseBodies != nil {
ok := object.Key("CustomResponseBodies")
if err := awsAwsjson11_serializeDocumentCustomResponseBodies(v.CustomResponseBodies, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.Rules != nil {
ok := object.Key("Rules")
if err := awsAwsjson11_serializeDocumentRules(v.Rules, ok); err != nil {
return err
}
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
if v.VisibilityConfig != nil {
ok := object.Key("VisibilityConfig")
if err := awsAwsjson11_serializeDocumentVisibilityConfig(v.VisibilityConfig, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateWebACLInput(v *CreateWebACLInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssociationConfig != nil {
ok := object.Key("AssociationConfig")
if err := awsAwsjson11_serializeDocumentAssociationConfig(v.AssociationConfig, ok); err != nil {
return err
}
}
if v.CaptchaConfig != nil {
ok := object.Key("CaptchaConfig")
if err := awsAwsjson11_serializeDocumentCaptchaConfig(v.CaptchaConfig, ok); err != nil {
return err
}
}
if v.ChallengeConfig != nil {
ok := object.Key("ChallengeConfig")
if err := awsAwsjson11_serializeDocumentChallengeConfig(v.ChallengeConfig, ok); err != nil {
return err
}
}
if v.CustomResponseBodies != nil {
ok := object.Key("CustomResponseBodies")
if err := awsAwsjson11_serializeDocumentCustomResponseBodies(v.CustomResponseBodies, ok); err != nil {
return err
}
}
if v.DefaultAction != nil {
ok := object.Key("DefaultAction")
if err := awsAwsjson11_serializeDocumentDefaultAction(v.DefaultAction, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.Rules != nil {
ok := object.Key("Rules")
if err := awsAwsjson11_serializeDocumentRules(v.Rules, ok); err != nil {
return err
}
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
if v.TokenDomains != nil {
ok := object.Key("TokenDomains")
if err := awsAwsjson11_serializeDocumentTokenDomains(v.TokenDomains, ok); err != nil {
return err
}
}
if v.VisibilityConfig != nil {
ok := object.Key("VisibilityConfig")
if err := awsAwsjson11_serializeDocumentVisibilityConfig(v.VisibilityConfig, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteFirewallManagerRuleGroupsInput(v *DeleteFirewallManagerRuleGroupsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.WebACLArn != nil {
ok := object.Key("WebACLArn")
ok.String(*v.WebACLArn)
}
if v.WebACLLockToken != nil {
ok := object.Key("WebACLLockToken")
ok.String(*v.WebACLLockToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteIPSetInput(v *DeleteIPSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("Id")
ok.String(*v.Id)
}
if v.LockToken != nil {
ok := object.Key("LockToken")
ok.String(*v.LockToken)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteLoggingConfigurationInput(v *DeleteLoggingConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeletePermissionPolicyInput(v *DeletePermissionPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteRegexPatternSetInput(v *DeleteRegexPatternSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("Id")
ok.String(*v.Id)
}
if v.LockToken != nil {
ok := object.Key("LockToken")
ok.String(*v.LockToken)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteRuleGroupInput(v *DeleteRuleGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("Id")
ok.String(*v.Id)
}
if v.LockToken != nil {
ok := object.Key("LockToken")
ok.String(*v.LockToken)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteWebACLInput(v *DeleteWebACLInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("Id")
ok.String(*v.Id)
}
if v.LockToken != nil {
ok := object.Key("LockToken")
ok.String(*v.LockToken)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeAllManagedProductsInput(v *DescribeAllManagedProductsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeManagedProductsByVendorInput(v *DescribeManagedProductsByVendorInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
if v.VendorName != nil {
ok := object.Key("VendorName")
ok.String(*v.VendorName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeManagedRuleGroupInput(v *DescribeManagedRuleGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
if v.VendorName != nil {
ok := object.Key("VendorName")
ok.String(*v.VendorName)
}
if v.VersionName != nil {
ok := object.Key("VersionName")
ok.String(*v.VersionName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDisassociateWebACLInput(v *DisassociateWebACLInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGenerateMobileSdkReleaseUrlInput(v *GenerateMobileSdkReleaseUrlInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Platform) > 0 {
ok := object.Key("Platform")
ok.String(string(v.Platform))
}
if v.ReleaseVersion != nil {
ok := object.Key("ReleaseVersion")
ok.String(*v.ReleaseVersion)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetDecryptedAPIKeyInput(v *GetDecryptedAPIKeyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.APIKey != nil {
ok := object.Key("APIKey")
ok.String(*v.APIKey)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetIPSetInput(v *GetIPSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("Id")
ok.String(*v.Id)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetLoggingConfigurationInput(v *GetLoggingConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetManagedRuleSetInput(v *GetManagedRuleSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("Id")
ok.String(*v.Id)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetMobileSdkReleaseInput(v *GetMobileSdkReleaseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Platform) > 0 {
ok := object.Key("Platform")
ok.String(string(v.Platform))
}
if v.ReleaseVersion != nil {
ok := object.Key("ReleaseVersion")
ok.String(*v.ReleaseVersion)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetPermissionPolicyInput(v *GetPermissionPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRateBasedStatementManagedKeysInput(v *GetRateBasedStatementManagedKeysInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RuleGroupRuleName != nil {
ok := object.Key("RuleGroupRuleName")
ok.String(*v.RuleGroupRuleName)
}
if v.RuleName != nil {
ok := object.Key("RuleName")
ok.String(*v.RuleName)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
if v.WebACLId != nil {
ok := object.Key("WebACLId")
ok.String(*v.WebACLId)
}
if v.WebACLName != nil {
ok := object.Key("WebACLName")
ok.String(*v.WebACLName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRegexPatternSetInput(v *GetRegexPatternSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("Id")
ok.String(*v.Id)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRuleGroupInput(v *GetRuleGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ARN != nil {
ok := object.Key("ARN")
ok.String(*v.ARN)
}
if v.Id != nil {
ok := object.Key("Id")
ok.String(*v.Id)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetSampledRequestsInput(v *GetSampledRequestsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
{
ok := object.Key("MaxItems")
ok.Long(v.MaxItems)
}
if v.RuleMetricName != nil {
ok := object.Key("RuleMetricName")
ok.String(*v.RuleMetricName)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
if v.TimeWindow != nil {
ok := object.Key("TimeWindow")
if err := awsAwsjson11_serializeDocumentTimeWindow(v.TimeWindow, ok); err != nil {
return err
}
}
if v.WebAclArn != nil {
ok := object.Key("WebAclArn")
ok.String(*v.WebAclArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetWebACLForResourceInput(v *GetWebACLForResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetWebACLInput(v *GetWebACLInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("Id")
ok.String(*v.Id)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentListAPIKeysInput(v *ListAPIKeysInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentListAvailableManagedRuleGroupsInput(v *ListAvailableManagedRuleGroupsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentListAvailableManagedRuleGroupVersionsInput(v *ListAvailableManagedRuleGroupVersionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
if v.VendorName != nil {
ok := object.Key("VendorName")
ok.String(*v.VendorName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListIPSetsInput(v *ListIPSetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentListLoggingConfigurationsInput(v *ListLoggingConfigurationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentListManagedRuleSetsInput(v *ListManagedRuleSetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentListMobileSdkReleasesInput(v *ListMobileSdkReleasesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
if len(v.Platform) > 0 {
ok := object.Key("Platform")
ok.String(string(v.Platform))
}
return nil
}
func awsAwsjson11_serializeOpDocumentListRegexPatternSetsInput(v *ListRegexPatternSetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentListResourcesForWebACLInput(v *ListResourcesForWebACLInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ResourceType) > 0 {
ok := object.Key("ResourceType")
ok.String(string(v.ResourceType))
}
if v.WebACLArn != nil {
ok := object.Key("WebACLArn")
ok.String(*v.WebACLArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListRuleGroupsInput(v *ListRuleGroupsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListWebACLsInput(v *ListWebACLsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.NextMarker != nil {
ok := object.Key("NextMarker")
ok.String(*v.NextMarker)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentPutLoggingConfigurationInput(v *PutLoggingConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LoggingConfiguration != nil {
ok := object.Key("LoggingConfiguration")
if err := awsAwsjson11_serializeDocumentLoggingConfiguration(v.LoggingConfiguration, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentPutManagedRuleSetVersionsInput(v *PutManagedRuleSetVersionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("Id")
ok.String(*v.Id)
}
if v.LockToken != nil {
ok := object.Key("LockToken")
ok.String(*v.LockToken)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.RecommendedVersion != nil {
ok := object.Key("RecommendedVersion")
ok.String(*v.RecommendedVersion)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
if v.VersionsToPublish != nil {
ok := object.Key("VersionsToPublish")
if err := awsAwsjson11_serializeDocumentVersionsToPublish(v.VersionsToPublish, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentPutPermissionPolicyInput(v *PutPermissionPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Policy != nil {
ok := object.Key("Policy")
ok.String(*v.Policy)
}
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
if v.TagKeys != nil {
ok := object.Key("TagKeys")
if err := awsAwsjson11_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateIPSetInput(v *UpdateIPSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Addresses != nil {
ok := object.Key("Addresses")
if err := awsAwsjson11_serializeDocumentIPAddresses(v.Addresses, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.Id != nil {
ok := object.Key("Id")
ok.String(*v.Id)
}
if v.LockToken != nil {
ok := object.Key("LockToken")
ok.String(*v.LockToken)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateManagedRuleSetVersionExpiryDateInput(v *UpdateManagedRuleSetVersionExpiryDateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ExpiryTimestamp != nil {
ok := object.Key("ExpiryTimestamp")
ok.Double(smithytime.FormatEpochSeconds(*v.ExpiryTimestamp))
}
if v.Id != nil {
ok := object.Key("Id")
ok.String(*v.Id)
}
if v.LockToken != nil {
ok := object.Key("LockToken")
ok.String(*v.LockToken)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
if v.VersionToExpire != nil {
ok := object.Key("VersionToExpire")
ok.String(*v.VersionToExpire)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateRegexPatternSetInput(v *UpdateRegexPatternSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.Id != nil {
ok := object.Key("Id")
ok.String(*v.Id)
}
if v.LockToken != nil {
ok := object.Key("LockToken")
ok.String(*v.LockToken)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.RegularExpressionList != nil {
ok := object.Key("RegularExpressionList")
if err := awsAwsjson11_serializeDocumentRegularExpressionList(v.RegularExpressionList, ok); err != nil {
return err
}
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateRuleGroupInput(v *UpdateRuleGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CustomResponseBodies != nil {
ok := object.Key("CustomResponseBodies")
if err := awsAwsjson11_serializeDocumentCustomResponseBodies(v.CustomResponseBodies, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.Id != nil {
ok := object.Key("Id")
ok.String(*v.Id)
}
if v.LockToken != nil {
ok := object.Key("LockToken")
ok.String(*v.LockToken)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.Rules != nil {
ok := object.Key("Rules")
if err := awsAwsjson11_serializeDocumentRules(v.Rules, ok); err != nil {
return err
}
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
if v.VisibilityConfig != nil {
ok := object.Key("VisibilityConfig")
if err := awsAwsjson11_serializeDocumentVisibilityConfig(v.VisibilityConfig, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateWebACLInput(v *UpdateWebACLInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssociationConfig != nil {
ok := object.Key("AssociationConfig")
if err := awsAwsjson11_serializeDocumentAssociationConfig(v.AssociationConfig, ok); err != nil {
return err
}
}
if v.CaptchaConfig != nil {
ok := object.Key("CaptchaConfig")
if err := awsAwsjson11_serializeDocumentCaptchaConfig(v.CaptchaConfig, ok); err != nil {
return err
}
}
if v.ChallengeConfig != nil {
ok := object.Key("ChallengeConfig")
if err := awsAwsjson11_serializeDocumentChallengeConfig(v.ChallengeConfig, ok); err != nil {
return err
}
}
if v.CustomResponseBodies != nil {
ok := object.Key("CustomResponseBodies")
if err := awsAwsjson11_serializeDocumentCustomResponseBodies(v.CustomResponseBodies, ok); err != nil {
return err
}
}
if v.DefaultAction != nil {
ok := object.Key("DefaultAction")
if err := awsAwsjson11_serializeDocumentDefaultAction(v.DefaultAction, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.Id != nil {
ok := object.Key("Id")
ok.String(*v.Id)
}
if v.LockToken != nil {
ok := object.Key("LockToken")
ok.String(*v.LockToken)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.Rules != nil {
ok := object.Key("Rules")
if err := awsAwsjson11_serializeDocumentRules(v.Rules, ok); err != nil {
return err
}
}
if len(v.Scope) > 0 {
ok := object.Key("Scope")
ok.String(string(v.Scope))
}
if v.TokenDomains != nil {
ok := object.Key("TokenDomains")
if err := awsAwsjson11_serializeDocumentTokenDomains(v.TokenDomains, ok); err != nil {
return err
}
}
if v.VisibilityConfig != nil {
ok := object.Key("VisibilityConfig")
if err := awsAwsjson11_serializeDocumentVisibilityConfig(v.VisibilityConfig, ok); err != nil {
return err
}
}
return nil
}
| 6,801 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wafv2
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/wafv2/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpAssociateWebACL struct {
}
func (*validateOpAssociateWebACL) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAssociateWebACL) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AssociateWebACLInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAssociateWebACLInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCheckCapacity struct {
}
func (*validateOpCheckCapacity) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCheckCapacity) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CheckCapacityInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCheckCapacityInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateAPIKey struct {
}
func (*validateOpCreateAPIKey) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateAPIKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateAPIKeyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateAPIKeyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateIPSet struct {
}
func (*validateOpCreateIPSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateIPSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateIPSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateIPSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateRegexPatternSet struct {
}
func (*validateOpCreateRegexPatternSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateRegexPatternSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateRegexPatternSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateRegexPatternSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateRuleGroup struct {
}
func (*validateOpCreateRuleGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateRuleGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateRuleGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateRuleGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateWebACL struct {
}
func (*validateOpCreateWebACL) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateWebACL) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateWebACLInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateWebACLInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteFirewallManagerRuleGroups struct {
}
func (*validateOpDeleteFirewallManagerRuleGroups) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteFirewallManagerRuleGroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteFirewallManagerRuleGroupsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteFirewallManagerRuleGroupsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteIPSet struct {
}
func (*validateOpDeleteIPSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteIPSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteIPSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteIPSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteLoggingConfiguration struct {
}
func (*validateOpDeleteLoggingConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteLoggingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteLoggingConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteLoggingConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeletePermissionPolicy struct {
}
func (*validateOpDeletePermissionPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeletePermissionPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeletePermissionPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeletePermissionPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteRegexPatternSet struct {
}
func (*validateOpDeleteRegexPatternSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteRegexPatternSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteRegexPatternSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteRegexPatternSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteRuleGroup struct {
}
func (*validateOpDeleteRuleGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteRuleGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteRuleGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteRuleGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteWebACL struct {
}
func (*validateOpDeleteWebACL) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteWebACL) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteWebACLInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteWebACLInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeAllManagedProducts struct {
}
func (*validateOpDescribeAllManagedProducts) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeAllManagedProducts) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeAllManagedProductsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeAllManagedProductsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeManagedProductsByVendor struct {
}
func (*validateOpDescribeManagedProductsByVendor) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeManagedProductsByVendor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeManagedProductsByVendorInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeManagedProductsByVendorInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeManagedRuleGroup struct {
}
func (*validateOpDescribeManagedRuleGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeManagedRuleGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeManagedRuleGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeManagedRuleGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDisassociateWebACL struct {
}
func (*validateOpDisassociateWebACL) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDisassociateWebACL) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DisassociateWebACLInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDisassociateWebACLInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGenerateMobileSdkReleaseUrl struct {
}
func (*validateOpGenerateMobileSdkReleaseUrl) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGenerateMobileSdkReleaseUrl) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GenerateMobileSdkReleaseUrlInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGenerateMobileSdkReleaseUrlInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetDecryptedAPIKey struct {
}
func (*validateOpGetDecryptedAPIKey) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetDecryptedAPIKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetDecryptedAPIKeyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetDecryptedAPIKeyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetIPSet struct {
}
func (*validateOpGetIPSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetIPSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetIPSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetIPSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetLoggingConfiguration struct {
}
func (*validateOpGetLoggingConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetLoggingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetLoggingConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetLoggingConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetManagedRuleSet struct {
}
func (*validateOpGetManagedRuleSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetManagedRuleSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetManagedRuleSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetManagedRuleSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetMobileSdkRelease struct {
}
func (*validateOpGetMobileSdkRelease) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetMobileSdkRelease) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetMobileSdkReleaseInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetMobileSdkReleaseInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetPermissionPolicy struct {
}
func (*validateOpGetPermissionPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetPermissionPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetPermissionPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetPermissionPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetRateBasedStatementManagedKeys struct {
}
func (*validateOpGetRateBasedStatementManagedKeys) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetRateBasedStatementManagedKeys) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetRateBasedStatementManagedKeysInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetRateBasedStatementManagedKeysInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetRegexPatternSet struct {
}
func (*validateOpGetRegexPatternSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetRegexPatternSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetRegexPatternSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetRegexPatternSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetSampledRequests struct {
}
func (*validateOpGetSampledRequests) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetSampledRequests) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetSampledRequestsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetSampledRequestsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetWebACLForResource struct {
}
func (*validateOpGetWebACLForResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetWebACLForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetWebACLForResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetWebACLForResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetWebACL struct {
}
func (*validateOpGetWebACL) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetWebACL) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetWebACLInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetWebACLInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAPIKeys struct {
}
func (*validateOpListAPIKeys) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAPIKeys) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAPIKeysInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAPIKeysInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAvailableManagedRuleGroups struct {
}
func (*validateOpListAvailableManagedRuleGroups) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAvailableManagedRuleGroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAvailableManagedRuleGroupsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAvailableManagedRuleGroupsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAvailableManagedRuleGroupVersions struct {
}
func (*validateOpListAvailableManagedRuleGroupVersions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAvailableManagedRuleGroupVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAvailableManagedRuleGroupVersionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAvailableManagedRuleGroupVersionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListIPSets struct {
}
func (*validateOpListIPSets) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListIPSets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListIPSetsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListIPSetsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListLoggingConfigurations struct {
}
func (*validateOpListLoggingConfigurations) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListLoggingConfigurations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListLoggingConfigurationsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListLoggingConfigurationsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListManagedRuleSets struct {
}
func (*validateOpListManagedRuleSets) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListManagedRuleSets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListManagedRuleSetsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListManagedRuleSetsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListMobileSdkReleases struct {
}
func (*validateOpListMobileSdkReleases) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListMobileSdkReleases) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListMobileSdkReleasesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListMobileSdkReleasesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListRegexPatternSets struct {
}
func (*validateOpListRegexPatternSets) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListRegexPatternSets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListRegexPatternSetsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListRegexPatternSetsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListResourcesForWebACL struct {
}
func (*validateOpListResourcesForWebACL) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListResourcesForWebACL) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListResourcesForWebACLInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListResourcesForWebACLInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListRuleGroups struct {
}
func (*validateOpListRuleGroups) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListRuleGroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListRuleGroupsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListRuleGroupsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListTagsForResource struct {
}
func (*validateOpListTagsForResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListTagsForResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListTagsForResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListWebACLs struct {
}
func (*validateOpListWebACLs) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListWebACLs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListWebACLsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListWebACLsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutLoggingConfiguration struct {
}
func (*validateOpPutLoggingConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutLoggingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutLoggingConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutLoggingConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutManagedRuleSetVersions struct {
}
func (*validateOpPutManagedRuleSetVersions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutManagedRuleSetVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutManagedRuleSetVersionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutManagedRuleSetVersionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutPermissionPolicy struct {
}
func (*validateOpPutPermissionPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutPermissionPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutPermissionPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutPermissionPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpTagResource struct {
}
func (*validateOpTagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*TagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpTagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUntagResource struct {
}
func (*validateOpUntagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UntagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUntagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateIPSet struct {
}
func (*validateOpUpdateIPSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateIPSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateIPSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateIPSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateManagedRuleSetVersionExpiryDate struct {
}
func (*validateOpUpdateManagedRuleSetVersionExpiryDate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateManagedRuleSetVersionExpiryDate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateManagedRuleSetVersionExpiryDateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateManagedRuleSetVersionExpiryDateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateRegexPatternSet struct {
}
func (*validateOpUpdateRegexPatternSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateRegexPatternSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateRegexPatternSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateRegexPatternSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateRuleGroup struct {
}
func (*validateOpUpdateRuleGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateRuleGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateRuleGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateRuleGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateWebACL struct {
}
func (*validateOpUpdateWebACL) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateWebACL) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateWebACLInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateWebACLInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpAssociateWebACLValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAssociateWebACL{}, middleware.After)
}
func addOpCheckCapacityValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCheckCapacity{}, middleware.After)
}
func addOpCreateAPIKeyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateAPIKey{}, middleware.After)
}
func addOpCreateIPSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateIPSet{}, middleware.After)
}
func addOpCreateRegexPatternSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateRegexPatternSet{}, middleware.After)
}
func addOpCreateRuleGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateRuleGroup{}, middleware.After)
}
func addOpCreateWebACLValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateWebACL{}, middleware.After)
}
func addOpDeleteFirewallManagerRuleGroupsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteFirewallManagerRuleGroups{}, middleware.After)
}
func addOpDeleteIPSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteIPSet{}, middleware.After)
}
func addOpDeleteLoggingConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteLoggingConfiguration{}, middleware.After)
}
func addOpDeletePermissionPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeletePermissionPolicy{}, middleware.After)
}
func addOpDeleteRegexPatternSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteRegexPatternSet{}, middleware.After)
}
func addOpDeleteRuleGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteRuleGroup{}, middleware.After)
}
func addOpDeleteWebACLValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteWebACL{}, middleware.After)
}
func addOpDescribeAllManagedProductsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeAllManagedProducts{}, middleware.After)
}
func addOpDescribeManagedProductsByVendorValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeManagedProductsByVendor{}, middleware.After)
}
func addOpDescribeManagedRuleGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeManagedRuleGroup{}, middleware.After)
}
func addOpDisassociateWebACLValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDisassociateWebACL{}, middleware.After)
}
func addOpGenerateMobileSdkReleaseUrlValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGenerateMobileSdkReleaseUrl{}, middleware.After)
}
func addOpGetDecryptedAPIKeyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetDecryptedAPIKey{}, middleware.After)
}
func addOpGetIPSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetIPSet{}, middleware.After)
}
func addOpGetLoggingConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetLoggingConfiguration{}, middleware.After)
}
func addOpGetManagedRuleSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetManagedRuleSet{}, middleware.After)
}
func addOpGetMobileSdkReleaseValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetMobileSdkRelease{}, middleware.After)
}
func addOpGetPermissionPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetPermissionPolicy{}, middleware.After)
}
func addOpGetRateBasedStatementManagedKeysValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetRateBasedStatementManagedKeys{}, middleware.After)
}
func addOpGetRegexPatternSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetRegexPatternSet{}, middleware.After)
}
func addOpGetSampledRequestsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetSampledRequests{}, middleware.After)
}
func addOpGetWebACLForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetWebACLForResource{}, middleware.After)
}
func addOpGetWebACLValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetWebACL{}, middleware.After)
}
func addOpListAPIKeysValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAPIKeys{}, middleware.After)
}
func addOpListAvailableManagedRuleGroupsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAvailableManagedRuleGroups{}, middleware.After)
}
func addOpListAvailableManagedRuleGroupVersionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAvailableManagedRuleGroupVersions{}, middleware.After)
}
func addOpListIPSetsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListIPSets{}, middleware.After)
}
func addOpListLoggingConfigurationsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListLoggingConfigurations{}, middleware.After)
}
func addOpListManagedRuleSetsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListManagedRuleSets{}, middleware.After)
}
func addOpListMobileSdkReleasesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListMobileSdkReleases{}, middleware.After)
}
func addOpListRegexPatternSetsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListRegexPatternSets{}, middleware.After)
}
func addOpListResourcesForWebACLValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListResourcesForWebACL{}, middleware.After)
}
func addOpListRuleGroupsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListRuleGroups{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpListWebACLsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListWebACLs{}, middleware.After)
}
func addOpPutLoggingConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutLoggingConfiguration{}, middleware.After)
}
func addOpPutManagedRuleSetVersionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutManagedRuleSetVersions{}, middleware.After)
}
func addOpPutPermissionPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutPermissionPolicy{}, middleware.After)
}
func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpTagResource{}, middleware.After)
}
func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After)
}
func addOpUpdateIPSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateIPSet{}, middleware.After)
}
func addOpUpdateManagedRuleSetVersionExpiryDateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateManagedRuleSetVersionExpiryDate{}, middleware.After)
}
func addOpUpdateRegexPatternSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateRegexPatternSet{}, middleware.After)
}
func addOpUpdateRuleGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateRuleGroup{}, middleware.After)
}
func addOpUpdateWebACLValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateWebACL{}, middleware.After)
}
func validateActionCondition(v *types.ActionCondition) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ActionCondition"}
if len(v.Action) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Action"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAddressField(v *types.AddressField) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddressField"}
if v.Identifier == nil {
invalidParams.Add(smithy.NewErrParamRequired("Identifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAddressFields(v []types.AddressField) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddressFields"}
for i := range v {
if err := validateAddressField(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAllowAction(v *types.AllowAction) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AllowAction"}
if v.CustomRequestHandling != nil {
if err := validateCustomRequestHandling(v.CustomRequestHandling); err != nil {
invalidParams.AddNested("CustomRequestHandling", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAndStatement(v *types.AndStatement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AndStatement"}
if v.Statements == nil {
invalidParams.Add(smithy.NewErrParamRequired("Statements"))
} else if v.Statements != nil {
if err := validateStatements(v.Statements); err != nil {
invalidParams.AddNested("Statements", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAssociationConfig(v *types.AssociationConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssociationConfig"}
if v.RequestBody != nil {
if err := validateRequestBody(v.RequestBody); err != nil {
invalidParams.AddNested("RequestBody", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAWSManagedRulesACFPRuleSet(v *types.AWSManagedRulesACFPRuleSet) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AWSManagedRulesACFPRuleSet"}
if v.CreationPath == nil {
invalidParams.Add(smithy.NewErrParamRequired("CreationPath"))
}
if v.RegistrationPagePath == nil {
invalidParams.Add(smithy.NewErrParamRequired("RegistrationPagePath"))
}
if v.RequestInspection == nil {
invalidParams.Add(smithy.NewErrParamRequired("RequestInspection"))
} else if v.RequestInspection != nil {
if err := validateRequestInspectionACFP(v.RequestInspection); err != nil {
invalidParams.AddNested("RequestInspection", err.(smithy.InvalidParamsError))
}
}
if v.ResponseInspection != nil {
if err := validateResponseInspection(v.ResponseInspection); err != nil {
invalidParams.AddNested("ResponseInspection", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAWSManagedRulesATPRuleSet(v *types.AWSManagedRulesATPRuleSet) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AWSManagedRulesATPRuleSet"}
if v.LoginPath == nil {
invalidParams.Add(smithy.NewErrParamRequired("LoginPath"))
}
if v.RequestInspection != nil {
if err := validateRequestInspection(v.RequestInspection); err != nil {
invalidParams.AddNested("RequestInspection", err.(smithy.InvalidParamsError))
}
}
if v.ResponseInspection != nil {
if err := validateResponseInspection(v.ResponseInspection); err != nil {
invalidParams.AddNested("ResponseInspection", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAWSManagedRulesBotControlRuleSet(v *types.AWSManagedRulesBotControlRuleSet) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AWSManagedRulesBotControlRuleSet"}
if len(v.InspectionLevel) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("InspectionLevel"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBlockAction(v *types.BlockAction) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BlockAction"}
if v.CustomResponse != nil {
if err := validateCustomResponse(v.CustomResponse); err != nil {
invalidParams.AddNested("CustomResponse", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateByteMatchStatement(v *types.ByteMatchStatement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ByteMatchStatement"}
if v.SearchString == nil {
invalidParams.Add(smithy.NewErrParamRequired("SearchString"))
}
if v.FieldToMatch == nil {
invalidParams.Add(smithy.NewErrParamRequired("FieldToMatch"))
} else if v.FieldToMatch != nil {
if err := validateFieldToMatch(v.FieldToMatch); err != nil {
invalidParams.AddNested("FieldToMatch", err.(smithy.InvalidParamsError))
}
}
if v.TextTransformations == nil {
invalidParams.Add(smithy.NewErrParamRequired("TextTransformations"))
} else if v.TextTransformations != nil {
if err := validateTextTransformations(v.TextTransformations); err != nil {
invalidParams.AddNested("TextTransformations", err.(smithy.InvalidParamsError))
}
}
if len(v.PositionalConstraint) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("PositionalConstraint"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCaptchaAction(v *types.CaptchaAction) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CaptchaAction"}
if v.CustomRequestHandling != nil {
if err := validateCustomRequestHandling(v.CustomRequestHandling); err != nil {
invalidParams.AddNested("CustomRequestHandling", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCaptchaConfig(v *types.CaptchaConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CaptchaConfig"}
if v.ImmunityTimeProperty != nil {
if err := validateImmunityTimeProperty(v.ImmunityTimeProperty); err != nil {
invalidParams.AddNested("ImmunityTimeProperty", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateChallengeAction(v *types.ChallengeAction) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ChallengeAction"}
if v.CustomRequestHandling != nil {
if err := validateCustomRequestHandling(v.CustomRequestHandling); err != nil {
invalidParams.AddNested("CustomRequestHandling", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateChallengeConfig(v *types.ChallengeConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ChallengeConfig"}
if v.ImmunityTimeProperty != nil {
if err := validateImmunityTimeProperty(v.ImmunityTimeProperty); err != nil {
invalidParams.AddNested("ImmunityTimeProperty", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCondition(v *types.Condition) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Condition"}
if v.ActionCondition != nil {
if err := validateActionCondition(v.ActionCondition); err != nil {
invalidParams.AddNested("ActionCondition", err.(smithy.InvalidParamsError))
}
}
if v.LabelNameCondition != nil {
if err := validateLabelNameCondition(v.LabelNameCondition); err != nil {
invalidParams.AddNested("LabelNameCondition", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateConditions(v []types.Condition) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Conditions"}
for i := range v {
if err := validateCondition(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCookies(v *types.Cookies) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Cookies"}
if v.MatchPattern == nil {
invalidParams.Add(smithy.NewErrParamRequired("MatchPattern"))
}
if len(v.MatchScope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("MatchScope"))
}
if len(v.OversizeHandling) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("OversizeHandling"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCountAction(v *types.CountAction) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CountAction"}
if v.CustomRequestHandling != nil {
if err := validateCustomRequestHandling(v.CustomRequestHandling); err != nil {
invalidParams.AddNested("CustomRequestHandling", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCustomHTTPHeader(v *types.CustomHTTPHeader) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CustomHTTPHeader"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCustomHTTPHeaders(v []types.CustomHTTPHeader) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CustomHTTPHeaders"}
for i := range v {
if err := validateCustomHTTPHeader(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCustomRequestHandling(v *types.CustomRequestHandling) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CustomRequestHandling"}
if v.InsertHeaders == nil {
invalidParams.Add(smithy.NewErrParamRequired("InsertHeaders"))
} else if v.InsertHeaders != nil {
if err := validateCustomHTTPHeaders(v.InsertHeaders); err != nil {
invalidParams.AddNested("InsertHeaders", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCustomResponse(v *types.CustomResponse) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CustomResponse"}
if v.ResponseCode == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResponseCode"))
}
if v.ResponseHeaders != nil {
if err := validateCustomHTTPHeaders(v.ResponseHeaders); err != nil {
invalidParams.AddNested("ResponseHeaders", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCustomResponseBodies(v map[string]types.CustomResponseBody) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CustomResponseBodies"}
for key := range v {
value := v[key]
if err := validateCustomResponseBody(&value); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCustomResponseBody(v *types.CustomResponseBody) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CustomResponseBody"}
if len(v.ContentType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ContentType"))
}
if v.Content == nil {
invalidParams.Add(smithy.NewErrParamRequired("Content"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDefaultAction(v *types.DefaultAction) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DefaultAction"}
if v.Block != nil {
if err := validateBlockAction(v.Block); err != nil {
invalidParams.AddNested("Block", err.(smithy.InvalidParamsError))
}
}
if v.Allow != nil {
if err := validateAllowAction(v.Allow); err != nil {
invalidParams.AddNested("Allow", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEmailField(v *types.EmailField) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EmailField"}
if v.Identifier == nil {
invalidParams.Add(smithy.NewErrParamRequired("Identifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateExcludedRule(v *types.ExcludedRule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExcludedRule"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateExcludedRules(v []types.ExcludedRule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExcludedRules"}
for i := range v {
if err := validateExcludedRule(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFieldToMatch(v *types.FieldToMatch) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "FieldToMatch"}
if v.SingleHeader != nil {
if err := validateSingleHeader(v.SingleHeader); err != nil {
invalidParams.AddNested("SingleHeader", err.(smithy.InvalidParamsError))
}
}
if v.SingleQueryArgument != nil {
if err := validateSingleQueryArgument(v.SingleQueryArgument); err != nil {
invalidParams.AddNested("SingleQueryArgument", err.(smithy.InvalidParamsError))
}
}
if v.JsonBody != nil {
if err := validateJsonBody(v.JsonBody); err != nil {
invalidParams.AddNested("JsonBody", err.(smithy.InvalidParamsError))
}
}
if v.Headers != nil {
if err := validateHeaders(v.Headers); err != nil {
invalidParams.AddNested("Headers", err.(smithy.InvalidParamsError))
}
}
if v.Cookies != nil {
if err := validateCookies(v.Cookies); err != nil {
invalidParams.AddNested("Cookies", err.(smithy.InvalidParamsError))
}
}
if v.HeaderOrder != nil {
if err := validateHeaderOrder(v.HeaderOrder); err != nil {
invalidParams.AddNested("HeaderOrder", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFilter(v *types.Filter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Filter"}
if len(v.Behavior) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Behavior"))
}
if len(v.Requirement) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Requirement"))
}
if v.Conditions == nil {
invalidParams.Add(smithy.NewErrParamRequired("Conditions"))
} else if v.Conditions != nil {
if err := validateConditions(v.Conditions); err != nil {
invalidParams.AddNested("Conditions", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFilters(v []types.Filter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Filters"}
for i := range v {
if err := validateFilter(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateForwardedIPConfig(v *types.ForwardedIPConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ForwardedIPConfig"}
if v.HeaderName == nil {
invalidParams.Add(smithy.NewErrParamRequired("HeaderName"))
}
if len(v.FallbackBehavior) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("FallbackBehavior"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateGeoMatchStatement(v *types.GeoMatchStatement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GeoMatchStatement"}
if v.ForwardedIPConfig != nil {
if err := validateForwardedIPConfig(v.ForwardedIPConfig); err != nil {
invalidParams.AddNested("ForwardedIPConfig", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateHeaderOrder(v *types.HeaderOrder) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "HeaderOrder"}
if len(v.OversizeHandling) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("OversizeHandling"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateHeaders(v *types.Headers) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Headers"}
if v.MatchPattern == nil {
invalidParams.Add(smithy.NewErrParamRequired("MatchPattern"))
}
if len(v.MatchScope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("MatchScope"))
}
if len(v.OversizeHandling) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("OversizeHandling"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateImmunityTimeProperty(v *types.ImmunityTimeProperty) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ImmunityTimeProperty"}
if v.ImmunityTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImmunityTime"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateIPSetForwardedIPConfig(v *types.IPSetForwardedIPConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "IPSetForwardedIPConfig"}
if v.HeaderName == nil {
invalidParams.Add(smithy.NewErrParamRequired("HeaderName"))
}
if len(v.FallbackBehavior) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("FallbackBehavior"))
}
if len(v.Position) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Position"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateIPSetReferenceStatement(v *types.IPSetReferenceStatement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "IPSetReferenceStatement"}
if v.ARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ARN"))
}
if v.IPSetForwardedIPConfig != nil {
if err := validateIPSetForwardedIPConfig(v.IPSetForwardedIPConfig); err != nil {
invalidParams.AddNested("IPSetForwardedIPConfig", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateJsonBody(v *types.JsonBody) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "JsonBody"}
if v.MatchPattern == nil {
invalidParams.Add(smithy.NewErrParamRequired("MatchPattern"))
}
if len(v.MatchScope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("MatchScope"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLabel(v *types.Label) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Label"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLabelMatchStatement(v *types.LabelMatchStatement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LabelMatchStatement"}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.Key == nil {
invalidParams.Add(smithy.NewErrParamRequired("Key"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLabelNameCondition(v *types.LabelNameCondition) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LabelNameCondition"}
if v.LabelName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LabelName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLabels(v []types.Label) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Labels"}
for i := range v {
if err := validateLabel(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLoggingConfiguration(v *types.LoggingConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LoggingConfiguration"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.LogDestinationConfigs == nil {
invalidParams.Add(smithy.NewErrParamRequired("LogDestinationConfigs"))
}
if v.RedactedFields != nil {
if err := validateRedactedFields(v.RedactedFields); err != nil {
invalidParams.AddNested("RedactedFields", err.(smithy.InvalidParamsError))
}
}
if v.LoggingFilter != nil {
if err := validateLoggingFilter(v.LoggingFilter); err != nil {
invalidParams.AddNested("LoggingFilter", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLoggingFilter(v *types.LoggingFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LoggingFilter"}
if v.Filters == nil {
invalidParams.Add(smithy.NewErrParamRequired("Filters"))
} else if v.Filters != nil {
if err := validateFilters(v.Filters); err != nil {
invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError))
}
}
if len(v.DefaultBehavior) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("DefaultBehavior"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateManagedRuleGroupConfig(v *types.ManagedRuleGroupConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ManagedRuleGroupConfig"}
if v.UsernameField != nil {
if err := validateUsernameField(v.UsernameField); err != nil {
invalidParams.AddNested("UsernameField", err.(smithy.InvalidParamsError))
}
}
if v.PasswordField != nil {
if err := validatePasswordField(v.PasswordField); err != nil {
invalidParams.AddNested("PasswordField", err.(smithy.InvalidParamsError))
}
}
if v.AWSManagedRulesBotControlRuleSet != nil {
if err := validateAWSManagedRulesBotControlRuleSet(v.AWSManagedRulesBotControlRuleSet); err != nil {
invalidParams.AddNested("AWSManagedRulesBotControlRuleSet", err.(smithy.InvalidParamsError))
}
}
if v.AWSManagedRulesATPRuleSet != nil {
if err := validateAWSManagedRulesATPRuleSet(v.AWSManagedRulesATPRuleSet); err != nil {
invalidParams.AddNested("AWSManagedRulesATPRuleSet", err.(smithy.InvalidParamsError))
}
}
if v.AWSManagedRulesACFPRuleSet != nil {
if err := validateAWSManagedRulesACFPRuleSet(v.AWSManagedRulesACFPRuleSet); err != nil {
invalidParams.AddNested("AWSManagedRulesACFPRuleSet", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateManagedRuleGroupConfigs(v []types.ManagedRuleGroupConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ManagedRuleGroupConfigs"}
for i := range v {
if err := validateManagedRuleGroupConfig(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateManagedRuleGroupStatement(v *types.ManagedRuleGroupStatement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ManagedRuleGroupStatement"}
if v.VendorName == nil {
invalidParams.Add(smithy.NewErrParamRequired("VendorName"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.ExcludedRules != nil {
if err := validateExcludedRules(v.ExcludedRules); err != nil {
invalidParams.AddNested("ExcludedRules", err.(smithy.InvalidParamsError))
}
}
if v.ScopeDownStatement != nil {
if err := validateStatement(v.ScopeDownStatement); err != nil {
invalidParams.AddNested("ScopeDownStatement", err.(smithy.InvalidParamsError))
}
}
if v.ManagedRuleGroupConfigs != nil {
if err := validateManagedRuleGroupConfigs(v.ManagedRuleGroupConfigs); err != nil {
invalidParams.AddNested("ManagedRuleGroupConfigs", err.(smithy.InvalidParamsError))
}
}
if v.RuleActionOverrides != nil {
if err := validateRuleActionOverrides(v.RuleActionOverrides); err != nil {
invalidParams.AddNested("RuleActionOverrides", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateNotStatement(v *types.NotStatement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "NotStatement"}
if v.Statement == nil {
invalidParams.Add(smithy.NewErrParamRequired("Statement"))
} else if v.Statement != nil {
if err := validateStatement(v.Statement); err != nil {
invalidParams.AddNested("Statement", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOrStatement(v *types.OrStatement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "OrStatement"}
if v.Statements == nil {
invalidParams.Add(smithy.NewErrParamRequired("Statements"))
} else if v.Statements != nil {
if err := validateStatements(v.Statements); err != nil {
invalidParams.AddNested("Statements", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOverrideAction(v *types.OverrideAction) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "OverrideAction"}
if v.Count != nil {
if err := validateCountAction(v.Count); err != nil {
invalidParams.AddNested("Count", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePasswordField(v *types.PasswordField) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PasswordField"}
if v.Identifier == nil {
invalidParams.Add(smithy.NewErrParamRequired("Identifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePhoneNumberField(v *types.PhoneNumberField) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PhoneNumberField"}
if v.Identifier == nil {
invalidParams.Add(smithy.NewErrParamRequired("Identifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePhoneNumberFields(v []types.PhoneNumberField) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PhoneNumberFields"}
for i := range v {
if err := validatePhoneNumberField(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRateBasedStatement(v *types.RateBasedStatement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RateBasedStatement"}
if len(v.AggregateKeyType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("AggregateKeyType"))
}
if v.ScopeDownStatement != nil {
if err := validateStatement(v.ScopeDownStatement); err != nil {
invalidParams.AddNested("ScopeDownStatement", err.(smithy.InvalidParamsError))
}
}
if v.ForwardedIPConfig != nil {
if err := validateForwardedIPConfig(v.ForwardedIPConfig); err != nil {
invalidParams.AddNested("ForwardedIPConfig", err.(smithy.InvalidParamsError))
}
}
if v.CustomKeys != nil {
if err := validateRateBasedStatementCustomKeys(v.CustomKeys); err != nil {
invalidParams.AddNested("CustomKeys", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRateBasedStatementCustomKey(v *types.RateBasedStatementCustomKey) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RateBasedStatementCustomKey"}
if v.Header != nil {
if err := validateRateLimitHeader(v.Header); err != nil {
invalidParams.AddNested("Header", err.(smithy.InvalidParamsError))
}
}
if v.Cookie != nil {
if err := validateRateLimitCookie(v.Cookie); err != nil {
invalidParams.AddNested("Cookie", err.(smithy.InvalidParamsError))
}
}
if v.QueryArgument != nil {
if err := validateRateLimitQueryArgument(v.QueryArgument); err != nil {
invalidParams.AddNested("QueryArgument", err.(smithy.InvalidParamsError))
}
}
if v.QueryString != nil {
if err := validateRateLimitQueryString(v.QueryString); err != nil {
invalidParams.AddNested("QueryString", err.(smithy.InvalidParamsError))
}
}
if v.LabelNamespace != nil {
if err := validateRateLimitLabelNamespace(v.LabelNamespace); err != nil {
invalidParams.AddNested("LabelNamespace", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRateBasedStatementCustomKeys(v []types.RateBasedStatementCustomKey) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RateBasedStatementCustomKeys"}
for i := range v {
if err := validateRateBasedStatementCustomKey(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRateLimitCookie(v *types.RateLimitCookie) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RateLimitCookie"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.TextTransformations == nil {
invalidParams.Add(smithy.NewErrParamRequired("TextTransformations"))
} else if v.TextTransformations != nil {
if err := validateTextTransformations(v.TextTransformations); err != nil {
invalidParams.AddNested("TextTransformations", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRateLimitHeader(v *types.RateLimitHeader) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RateLimitHeader"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.TextTransformations == nil {
invalidParams.Add(smithy.NewErrParamRequired("TextTransformations"))
} else if v.TextTransformations != nil {
if err := validateTextTransformations(v.TextTransformations); err != nil {
invalidParams.AddNested("TextTransformations", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRateLimitLabelNamespace(v *types.RateLimitLabelNamespace) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RateLimitLabelNamespace"}
if v.Namespace == nil {
invalidParams.Add(smithy.NewErrParamRequired("Namespace"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRateLimitQueryArgument(v *types.RateLimitQueryArgument) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RateLimitQueryArgument"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.TextTransformations == nil {
invalidParams.Add(smithy.NewErrParamRequired("TextTransformations"))
} else if v.TextTransformations != nil {
if err := validateTextTransformations(v.TextTransformations); err != nil {
invalidParams.AddNested("TextTransformations", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRateLimitQueryString(v *types.RateLimitQueryString) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RateLimitQueryString"}
if v.TextTransformations == nil {
invalidParams.Add(smithy.NewErrParamRequired("TextTransformations"))
} else if v.TextTransformations != nil {
if err := validateTextTransformations(v.TextTransformations); err != nil {
invalidParams.AddNested("TextTransformations", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRedactedFields(v []types.FieldToMatch) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RedactedFields"}
for i := range v {
if err := validateFieldToMatch(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRegexMatchStatement(v *types.RegexMatchStatement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RegexMatchStatement"}
if v.RegexString == nil {
invalidParams.Add(smithy.NewErrParamRequired("RegexString"))
}
if v.FieldToMatch == nil {
invalidParams.Add(smithy.NewErrParamRequired("FieldToMatch"))
} else if v.FieldToMatch != nil {
if err := validateFieldToMatch(v.FieldToMatch); err != nil {
invalidParams.AddNested("FieldToMatch", err.(smithy.InvalidParamsError))
}
}
if v.TextTransformations == nil {
invalidParams.Add(smithy.NewErrParamRequired("TextTransformations"))
} else if v.TextTransformations != nil {
if err := validateTextTransformations(v.TextTransformations); err != nil {
invalidParams.AddNested("TextTransformations", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRegexPatternSetReferenceStatement(v *types.RegexPatternSetReferenceStatement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RegexPatternSetReferenceStatement"}
if v.ARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ARN"))
}
if v.FieldToMatch == nil {
invalidParams.Add(smithy.NewErrParamRequired("FieldToMatch"))
} else if v.FieldToMatch != nil {
if err := validateFieldToMatch(v.FieldToMatch); err != nil {
invalidParams.AddNested("FieldToMatch", err.(smithy.InvalidParamsError))
}
}
if v.TextTransformations == nil {
invalidParams.Add(smithy.NewErrParamRequired("TextTransformations"))
} else if v.TextTransformations != nil {
if err := validateTextTransformations(v.TextTransformations); err != nil {
invalidParams.AddNested("TextTransformations", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRequestBody(v map[string]types.RequestBodyAssociatedResourceTypeConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RequestBody"}
for key := range v {
value := v[key]
if err := validateRequestBodyAssociatedResourceTypeConfig(&value); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRequestBodyAssociatedResourceTypeConfig(v *types.RequestBodyAssociatedResourceTypeConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RequestBodyAssociatedResourceTypeConfig"}
if len(v.DefaultSizeInspectionLimit) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("DefaultSizeInspectionLimit"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRequestInspection(v *types.RequestInspection) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RequestInspection"}
if len(v.PayloadType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("PayloadType"))
}
if v.UsernameField == nil {
invalidParams.Add(smithy.NewErrParamRequired("UsernameField"))
} else if v.UsernameField != nil {
if err := validateUsernameField(v.UsernameField); err != nil {
invalidParams.AddNested("UsernameField", err.(smithy.InvalidParamsError))
}
}
if v.PasswordField == nil {
invalidParams.Add(smithy.NewErrParamRequired("PasswordField"))
} else if v.PasswordField != nil {
if err := validatePasswordField(v.PasswordField); err != nil {
invalidParams.AddNested("PasswordField", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRequestInspectionACFP(v *types.RequestInspectionACFP) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RequestInspectionACFP"}
if len(v.PayloadType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("PayloadType"))
}
if v.UsernameField != nil {
if err := validateUsernameField(v.UsernameField); err != nil {
invalidParams.AddNested("UsernameField", err.(smithy.InvalidParamsError))
}
}
if v.PasswordField != nil {
if err := validatePasswordField(v.PasswordField); err != nil {
invalidParams.AddNested("PasswordField", err.(smithy.InvalidParamsError))
}
}
if v.EmailField != nil {
if err := validateEmailField(v.EmailField); err != nil {
invalidParams.AddNested("EmailField", err.(smithy.InvalidParamsError))
}
}
if v.PhoneNumberFields != nil {
if err := validatePhoneNumberFields(v.PhoneNumberFields); err != nil {
invalidParams.AddNested("PhoneNumberFields", err.(smithy.InvalidParamsError))
}
}
if v.AddressFields != nil {
if err := validateAddressFields(v.AddressFields); err != nil {
invalidParams.AddNested("AddressFields", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateResponseInspection(v *types.ResponseInspection) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ResponseInspection"}
if v.StatusCode != nil {
if err := validateResponseInspectionStatusCode(v.StatusCode); err != nil {
invalidParams.AddNested("StatusCode", err.(smithy.InvalidParamsError))
}
}
if v.Header != nil {
if err := validateResponseInspectionHeader(v.Header); err != nil {
invalidParams.AddNested("Header", err.(smithy.InvalidParamsError))
}
}
if v.BodyContains != nil {
if err := validateResponseInspectionBodyContains(v.BodyContains); err != nil {
invalidParams.AddNested("BodyContains", err.(smithy.InvalidParamsError))
}
}
if v.Json != nil {
if err := validateResponseInspectionJson(v.Json); err != nil {
invalidParams.AddNested("Json", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateResponseInspectionBodyContains(v *types.ResponseInspectionBodyContains) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ResponseInspectionBodyContains"}
if v.SuccessStrings == nil {
invalidParams.Add(smithy.NewErrParamRequired("SuccessStrings"))
}
if v.FailureStrings == nil {
invalidParams.Add(smithy.NewErrParamRequired("FailureStrings"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateResponseInspectionHeader(v *types.ResponseInspectionHeader) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ResponseInspectionHeader"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.SuccessValues == nil {
invalidParams.Add(smithy.NewErrParamRequired("SuccessValues"))
}
if v.FailureValues == nil {
invalidParams.Add(smithy.NewErrParamRequired("FailureValues"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateResponseInspectionJson(v *types.ResponseInspectionJson) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ResponseInspectionJson"}
if v.Identifier == nil {
invalidParams.Add(smithy.NewErrParamRequired("Identifier"))
}
if v.SuccessValues == nil {
invalidParams.Add(smithy.NewErrParamRequired("SuccessValues"))
}
if v.FailureValues == nil {
invalidParams.Add(smithy.NewErrParamRequired("FailureValues"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateResponseInspectionStatusCode(v *types.ResponseInspectionStatusCode) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ResponseInspectionStatusCode"}
if v.SuccessCodes == nil {
invalidParams.Add(smithy.NewErrParamRequired("SuccessCodes"))
}
if v.FailureCodes == nil {
invalidParams.Add(smithy.NewErrParamRequired("FailureCodes"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRule(v *types.Rule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Rule"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Statement == nil {
invalidParams.Add(smithy.NewErrParamRequired("Statement"))
} else if v.Statement != nil {
if err := validateStatement(v.Statement); err != nil {
invalidParams.AddNested("Statement", err.(smithy.InvalidParamsError))
}
}
if v.Action != nil {
if err := validateRuleAction(v.Action); err != nil {
invalidParams.AddNested("Action", err.(smithy.InvalidParamsError))
}
}
if v.OverrideAction != nil {
if err := validateOverrideAction(v.OverrideAction); err != nil {
invalidParams.AddNested("OverrideAction", err.(smithy.InvalidParamsError))
}
}
if v.RuleLabels != nil {
if err := validateLabels(v.RuleLabels); err != nil {
invalidParams.AddNested("RuleLabels", err.(smithy.InvalidParamsError))
}
}
if v.VisibilityConfig == nil {
invalidParams.Add(smithy.NewErrParamRequired("VisibilityConfig"))
} else if v.VisibilityConfig != nil {
if err := validateVisibilityConfig(v.VisibilityConfig); err != nil {
invalidParams.AddNested("VisibilityConfig", err.(smithy.InvalidParamsError))
}
}
if v.CaptchaConfig != nil {
if err := validateCaptchaConfig(v.CaptchaConfig); err != nil {
invalidParams.AddNested("CaptchaConfig", err.(smithy.InvalidParamsError))
}
}
if v.ChallengeConfig != nil {
if err := validateChallengeConfig(v.ChallengeConfig); err != nil {
invalidParams.AddNested("ChallengeConfig", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRuleAction(v *types.RuleAction) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RuleAction"}
if v.Block != nil {
if err := validateBlockAction(v.Block); err != nil {
invalidParams.AddNested("Block", err.(smithy.InvalidParamsError))
}
}
if v.Allow != nil {
if err := validateAllowAction(v.Allow); err != nil {
invalidParams.AddNested("Allow", err.(smithy.InvalidParamsError))
}
}
if v.Count != nil {
if err := validateCountAction(v.Count); err != nil {
invalidParams.AddNested("Count", err.(smithy.InvalidParamsError))
}
}
if v.Captcha != nil {
if err := validateCaptchaAction(v.Captcha); err != nil {
invalidParams.AddNested("Captcha", err.(smithy.InvalidParamsError))
}
}
if v.Challenge != nil {
if err := validateChallengeAction(v.Challenge); err != nil {
invalidParams.AddNested("Challenge", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRuleActionOverride(v *types.RuleActionOverride) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RuleActionOverride"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.ActionToUse == nil {
invalidParams.Add(smithy.NewErrParamRequired("ActionToUse"))
} else if v.ActionToUse != nil {
if err := validateRuleAction(v.ActionToUse); err != nil {
invalidParams.AddNested("ActionToUse", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRuleActionOverrides(v []types.RuleActionOverride) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RuleActionOverrides"}
for i := range v {
if err := validateRuleActionOverride(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRuleGroupReferenceStatement(v *types.RuleGroupReferenceStatement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RuleGroupReferenceStatement"}
if v.ARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ARN"))
}
if v.ExcludedRules != nil {
if err := validateExcludedRules(v.ExcludedRules); err != nil {
invalidParams.AddNested("ExcludedRules", err.(smithy.InvalidParamsError))
}
}
if v.RuleActionOverrides != nil {
if err := validateRuleActionOverrides(v.RuleActionOverrides); err != nil {
invalidParams.AddNested("RuleActionOverrides", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRules(v []types.Rule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Rules"}
for i := range v {
if err := validateRule(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSingleHeader(v *types.SingleHeader) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SingleHeader"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSingleQueryArgument(v *types.SingleQueryArgument) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SingleQueryArgument"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSizeConstraintStatement(v *types.SizeConstraintStatement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SizeConstraintStatement"}
if v.FieldToMatch == nil {
invalidParams.Add(smithy.NewErrParamRequired("FieldToMatch"))
} else if v.FieldToMatch != nil {
if err := validateFieldToMatch(v.FieldToMatch); err != nil {
invalidParams.AddNested("FieldToMatch", err.(smithy.InvalidParamsError))
}
}
if len(v.ComparisonOperator) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ComparisonOperator"))
}
if v.TextTransformations == nil {
invalidParams.Add(smithy.NewErrParamRequired("TextTransformations"))
} else if v.TextTransformations != nil {
if err := validateTextTransformations(v.TextTransformations); err != nil {
invalidParams.AddNested("TextTransformations", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSqliMatchStatement(v *types.SqliMatchStatement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SqliMatchStatement"}
if v.FieldToMatch == nil {
invalidParams.Add(smithy.NewErrParamRequired("FieldToMatch"))
} else if v.FieldToMatch != nil {
if err := validateFieldToMatch(v.FieldToMatch); err != nil {
invalidParams.AddNested("FieldToMatch", err.(smithy.InvalidParamsError))
}
}
if v.TextTransformations == nil {
invalidParams.Add(smithy.NewErrParamRequired("TextTransformations"))
} else if v.TextTransformations != nil {
if err := validateTextTransformations(v.TextTransformations); err != nil {
invalidParams.AddNested("TextTransformations", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateStatement(v *types.Statement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Statement"}
if v.ByteMatchStatement != nil {
if err := validateByteMatchStatement(v.ByteMatchStatement); err != nil {
invalidParams.AddNested("ByteMatchStatement", err.(smithy.InvalidParamsError))
}
}
if v.SqliMatchStatement != nil {
if err := validateSqliMatchStatement(v.SqliMatchStatement); err != nil {
invalidParams.AddNested("SqliMatchStatement", err.(smithy.InvalidParamsError))
}
}
if v.XssMatchStatement != nil {
if err := validateXssMatchStatement(v.XssMatchStatement); err != nil {
invalidParams.AddNested("XssMatchStatement", err.(smithy.InvalidParamsError))
}
}
if v.SizeConstraintStatement != nil {
if err := validateSizeConstraintStatement(v.SizeConstraintStatement); err != nil {
invalidParams.AddNested("SizeConstraintStatement", err.(smithy.InvalidParamsError))
}
}
if v.GeoMatchStatement != nil {
if err := validateGeoMatchStatement(v.GeoMatchStatement); err != nil {
invalidParams.AddNested("GeoMatchStatement", err.(smithy.InvalidParamsError))
}
}
if v.RuleGroupReferenceStatement != nil {
if err := validateRuleGroupReferenceStatement(v.RuleGroupReferenceStatement); err != nil {
invalidParams.AddNested("RuleGroupReferenceStatement", err.(smithy.InvalidParamsError))
}
}
if v.IPSetReferenceStatement != nil {
if err := validateIPSetReferenceStatement(v.IPSetReferenceStatement); err != nil {
invalidParams.AddNested("IPSetReferenceStatement", err.(smithy.InvalidParamsError))
}
}
if v.RegexPatternSetReferenceStatement != nil {
if err := validateRegexPatternSetReferenceStatement(v.RegexPatternSetReferenceStatement); err != nil {
invalidParams.AddNested("RegexPatternSetReferenceStatement", err.(smithy.InvalidParamsError))
}
}
if v.RateBasedStatement != nil {
if err := validateRateBasedStatement(v.RateBasedStatement); err != nil {
invalidParams.AddNested("RateBasedStatement", err.(smithy.InvalidParamsError))
}
}
if v.AndStatement != nil {
if err := validateAndStatement(v.AndStatement); err != nil {
invalidParams.AddNested("AndStatement", err.(smithy.InvalidParamsError))
}
}
if v.OrStatement != nil {
if err := validateOrStatement(v.OrStatement); err != nil {
invalidParams.AddNested("OrStatement", err.(smithy.InvalidParamsError))
}
}
if v.NotStatement != nil {
if err := validateNotStatement(v.NotStatement); err != nil {
invalidParams.AddNested("NotStatement", err.(smithy.InvalidParamsError))
}
}
if v.ManagedRuleGroupStatement != nil {
if err := validateManagedRuleGroupStatement(v.ManagedRuleGroupStatement); err != nil {
invalidParams.AddNested("ManagedRuleGroupStatement", err.(smithy.InvalidParamsError))
}
}
if v.LabelMatchStatement != nil {
if err := validateLabelMatchStatement(v.LabelMatchStatement); err != nil {
invalidParams.AddNested("LabelMatchStatement", err.(smithy.InvalidParamsError))
}
}
if v.RegexMatchStatement != nil {
if err := validateRegexMatchStatement(v.RegexMatchStatement); err != nil {
invalidParams.AddNested("RegexMatchStatement", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateStatements(v []types.Statement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Statements"}
for i := range v {
if err := validateStatement(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTag(v *types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Tag"}
if v.Key == nil {
invalidParams.Add(smithy.NewErrParamRequired("Key"))
}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTagList(v []types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagList"}
for i := range v {
if err := validateTag(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTextTransformation(v *types.TextTransformation) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TextTransformation"}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTextTransformations(v []types.TextTransformation) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TextTransformations"}
for i := range v {
if err := validateTextTransformation(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTimeWindow(v *types.TimeWindow) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TimeWindow"}
if v.StartTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartTime"))
}
if v.EndTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndTime"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateUsernameField(v *types.UsernameField) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UsernameField"}
if v.Identifier == nil {
invalidParams.Add(smithy.NewErrParamRequired("Identifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateVisibilityConfig(v *types.VisibilityConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "VisibilityConfig"}
if v.MetricName == nil {
invalidParams.Add(smithy.NewErrParamRequired("MetricName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateXssMatchStatement(v *types.XssMatchStatement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "XssMatchStatement"}
if v.FieldToMatch == nil {
invalidParams.Add(smithy.NewErrParamRequired("FieldToMatch"))
} else if v.FieldToMatch != nil {
if err := validateFieldToMatch(v.FieldToMatch); err != nil {
invalidParams.AddNested("FieldToMatch", err.(smithy.InvalidParamsError))
}
}
if v.TextTransformations == nil {
invalidParams.Add(smithy.NewErrParamRequired("TextTransformations"))
} else if v.TextTransformations != nil {
if err := validateTextTransformations(v.TextTransformations); err != nil {
invalidParams.AddNested("TextTransformations", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAssociateWebACLInput(v *AssociateWebACLInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssociateWebACLInput"}
if v.WebACLArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("WebACLArn"))
}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCheckCapacityInput(v *CheckCapacityInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CheckCapacityInput"}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.Rules == nil {
invalidParams.Add(smithy.NewErrParamRequired("Rules"))
} else if v.Rules != nil {
if err := validateRules(v.Rules); err != nil {
invalidParams.AddNested("Rules", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateAPIKeyInput(v *CreateAPIKeyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateAPIKeyInput"}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.TokenDomains == nil {
invalidParams.Add(smithy.NewErrParamRequired("TokenDomains"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateIPSetInput(v *CreateIPSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateIPSetInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if len(v.IPAddressVersion) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("IPAddressVersion"))
}
if v.Addresses == nil {
invalidParams.Add(smithy.NewErrParamRequired("Addresses"))
}
if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateRegexPatternSetInput(v *CreateRegexPatternSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateRegexPatternSetInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.RegularExpressionList == nil {
invalidParams.Add(smithy.NewErrParamRequired("RegularExpressionList"))
}
if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateRuleGroupInput(v *CreateRuleGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateRuleGroupInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.Rules != nil {
if err := validateRules(v.Rules); err != nil {
invalidParams.AddNested("Rules", err.(smithy.InvalidParamsError))
}
}
if v.VisibilityConfig == nil {
invalidParams.Add(smithy.NewErrParamRequired("VisibilityConfig"))
} else if v.VisibilityConfig != nil {
if err := validateVisibilityConfig(v.VisibilityConfig); err != nil {
invalidParams.AddNested("VisibilityConfig", err.(smithy.InvalidParamsError))
}
}
if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if v.CustomResponseBodies != nil {
if err := validateCustomResponseBodies(v.CustomResponseBodies); err != nil {
invalidParams.AddNested("CustomResponseBodies", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateWebACLInput(v *CreateWebACLInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateWebACLInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.DefaultAction == nil {
invalidParams.Add(smithy.NewErrParamRequired("DefaultAction"))
} else if v.DefaultAction != nil {
if err := validateDefaultAction(v.DefaultAction); err != nil {
invalidParams.AddNested("DefaultAction", err.(smithy.InvalidParamsError))
}
}
if v.Rules != nil {
if err := validateRules(v.Rules); err != nil {
invalidParams.AddNested("Rules", err.(smithy.InvalidParamsError))
}
}
if v.VisibilityConfig == nil {
invalidParams.Add(smithy.NewErrParamRequired("VisibilityConfig"))
} else if v.VisibilityConfig != nil {
if err := validateVisibilityConfig(v.VisibilityConfig); err != nil {
invalidParams.AddNested("VisibilityConfig", err.(smithy.InvalidParamsError))
}
}
if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if v.CustomResponseBodies != nil {
if err := validateCustomResponseBodies(v.CustomResponseBodies); err != nil {
invalidParams.AddNested("CustomResponseBodies", err.(smithy.InvalidParamsError))
}
}
if v.CaptchaConfig != nil {
if err := validateCaptchaConfig(v.CaptchaConfig); err != nil {
invalidParams.AddNested("CaptchaConfig", err.(smithy.InvalidParamsError))
}
}
if v.ChallengeConfig != nil {
if err := validateChallengeConfig(v.ChallengeConfig); err != nil {
invalidParams.AddNested("ChallengeConfig", err.(smithy.InvalidParamsError))
}
}
if v.AssociationConfig != nil {
if err := validateAssociationConfig(v.AssociationConfig); err != nil {
invalidParams.AddNested("AssociationConfig", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteFirewallManagerRuleGroupsInput(v *DeleteFirewallManagerRuleGroupsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteFirewallManagerRuleGroupsInput"}
if v.WebACLArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("WebACLArn"))
}
if v.WebACLLockToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("WebACLLockToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteIPSetInput(v *DeleteIPSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteIPSetInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.LockToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("LockToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteLoggingConfigurationInput(v *DeleteLoggingConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteLoggingConfigurationInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeletePermissionPolicyInput(v *DeletePermissionPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeletePermissionPolicyInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteRegexPatternSetInput(v *DeleteRegexPatternSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteRegexPatternSetInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.LockToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("LockToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteRuleGroupInput(v *DeleteRuleGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteRuleGroupInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.LockToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("LockToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteWebACLInput(v *DeleteWebACLInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteWebACLInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.LockToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("LockToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeAllManagedProductsInput(v *DescribeAllManagedProductsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeAllManagedProductsInput"}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeManagedProductsByVendorInput(v *DescribeManagedProductsByVendorInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeManagedProductsByVendorInput"}
if v.VendorName == nil {
invalidParams.Add(smithy.NewErrParamRequired("VendorName"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeManagedRuleGroupInput(v *DescribeManagedRuleGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeManagedRuleGroupInput"}
if v.VendorName == nil {
invalidParams.Add(smithy.NewErrParamRequired("VendorName"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDisassociateWebACLInput(v *DisassociateWebACLInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DisassociateWebACLInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGenerateMobileSdkReleaseUrlInput(v *GenerateMobileSdkReleaseUrlInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GenerateMobileSdkReleaseUrlInput"}
if len(v.Platform) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Platform"))
}
if v.ReleaseVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("ReleaseVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetDecryptedAPIKeyInput(v *GetDecryptedAPIKeyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetDecryptedAPIKeyInput"}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.APIKey == nil {
invalidParams.Add(smithy.NewErrParamRequired("APIKey"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetIPSetInput(v *GetIPSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetIPSetInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetLoggingConfigurationInput(v *GetLoggingConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetLoggingConfigurationInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetManagedRuleSetInput(v *GetManagedRuleSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetManagedRuleSetInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetMobileSdkReleaseInput(v *GetMobileSdkReleaseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetMobileSdkReleaseInput"}
if len(v.Platform) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Platform"))
}
if v.ReleaseVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("ReleaseVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetPermissionPolicyInput(v *GetPermissionPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetPermissionPolicyInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetRateBasedStatementManagedKeysInput(v *GetRateBasedStatementManagedKeysInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetRateBasedStatementManagedKeysInput"}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.WebACLName == nil {
invalidParams.Add(smithy.NewErrParamRequired("WebACLName"))
}
if v.WebACLId == nil {
invalidParams.Add(smithy.NewErrParamRequired("WebACLId"))
}
if v.RuleName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RuleName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetRegexPatternSetInput(v *GetRegexPatternSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetRegexPatternSetInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetSampledRequestsInput(v *GetSampledRequestsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetSampledRequestsInput"}
if v.WebAclArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("WebAclArn"))
}
if v.RuleMetricName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RuleMetricName"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.TimeWindow == nil {
invalidParams.Add(smithy.NewErrParamRequired("TimeWindow"))
} else if v.TimeWindow != nil {
if err := validateTimeWindow(v.TimeWindow); err != nil {
invalidParams.AddNested("TimeWindow", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetWebACLForResourceInput(v *GetWebACLForResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetWebACLForResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetWebACLInput(v *GetWebACLInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetWebACLInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAPIKeysInput(v *ListAPIKeysInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAPIKeysInput"}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAvailableManagedRuleGroupsInput(v *ListAvailableManagedRuleGroupsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAvailableManagedRuleGroupsInput"}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAvailableManagedRuleGroupVersionsInput(v *ListAvailableManagedRuleGroupVersionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAvailableManagedRuleGroupVersionsInput"}
if v.VendorName == nil {
invalidParams.Add(smithy.NewErrParamRequired("VendorName"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListIPSetsInput(v *ListIPSetsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListIPSetsInput"}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListLoggingConfigurationsInput(v *ListLoggingConfigurationsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListLoggingConfigurationsInput"}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListManagedRuleSetsInput(v *ListManagedRuleSetsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListManagedRuleSetsInput"}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListMobileSdkReleasesInput(v *ListMobileSdkReleasesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListMobileSdkReleasesInput"}
if len(v.Platform) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Platform"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListRegexPatternSetsInput(v *ListRegexPatternSetsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListRegexPatternSetsInput"}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListResourcesForWebACLInput(v *ListResourcesForWebACLInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListResourcesForWebACLInput"}
if v.WebACLArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("WebACLArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListRuleGroupsInput(v *ListRuleGroupsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListRuleGroupsInput"}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListWebACLsInput(v *ListWebACLsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListWebACLsInput"}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutLoggingConfigurationInput(v *PutLoggingConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutLoggingConfigurationInput"}
if v.LoggingConfiguration == nil {
invalidParams.Add(smithy.NewErrParamRequired("LoggingConfiguration"))
} else if v.LoggingConfiguration != nil {
if err := validateLoggingConfiguration(v.LoggingConfiguration); err != nil {
invalidParams.AddNested("LoggingConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutManagedRuleSetVersionsInput(v *PutManagedRuleSetVersionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutManagedRuleSetVersionsInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.LockToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("LockToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutPermissionPolicyInput(v *PutPermissionPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutPermissionPolicyInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.Policy == nil {
invalidParams.Add(smithy.NewErrParamRequired("Policy"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpTagResourceInput(v *TagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
} else if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUntagResourceInput(v *UntagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if v.TagKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateIPSetInput(v *UpdateIPSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateIPSetInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.Addresses == nil {
invalidParams.Add(smithy.NewErrParamRequired("Addresses"))
}
if v.LockToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("LockToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateManagedRuleSetVersionExpiryDateInput(v *UpdateManagedRuleSetVersionExpiryDateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateManagedRuleSetVersionExpiryDateInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.LockToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("LockToken"))
}
if v.VersionToExpire == nil {
invalidParams.Add(smithy.NewErrParamRequired("VersionToExpire"))
}
if v.ExpiryTimestamp == nil {
invalidParams.Add(smithy.NewErrParamRequired("ExpiryTimestamp"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateRegexPatternSetInput(v *UpdateRegexPatternSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateRegexPatternSetInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.RegularExpressionList == nil {
invalidParams.Add(smithy.NewErrParamRequired("RegularExpressionList"))
}
if v.LockToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("LockToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateRuleGroupInput(v *UpdateRuleGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateRuleGroupInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.Rules != nil {
if err := validateRules(v.Rules); err != nil {
invalidParams.AddNested("Rules", err.(smithy.InvalidParamsError))
}
}
if v.VisibilityConfig == nil {
invalidParams.Add(smithy.NewErrParamRequired("VisibilityConfig"))
} else if v.VisibilityConfig != nil {
if err := validateVisibilityConfig(v.VisibilityConfig); err != nil {
invalidParams.AddNested("VisibilityConfig", err.(smithy.InvalidParamsError))
}
}
if v.LockToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("LockToken"))
}
if v.CustomResponseBodies != nil {
if err := validateCustomResponseBodies(v.CustomResponseBodies); err != nil {
invalidParams.AddNested("CustomResponseBodies", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateWebACLInput(v *UpdateWebACLInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateWebACLInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.Scope) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Scope"))
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.DefaultAction == nil {
invalidParams.Add(smithy.NewErrParamRequired("DefaultAction"))
} else if v.DefaultAction != nil {
if err := validateDefaultAction(v.DefaultAction); err != nil {
invalidParams.AddNested("DefaultAction", err.(smithy.InvalidParamsError))
}
}
if v.Rules != nil {
if err := validateRules(v.Rules); err != nil {
invalidParams.AddNested("Rules", err.(smithy.InvalidParamsError))
}
}
if v.VisibilityConfig == nil {
invalidParams.Add(smithy.NewErrParamRequired("VisibilityConfig"))
} else if v.VisibilityConfig != nil {
if err := validateVisibilityConfig(v.VisibilityConfig); err != nil {
invalidParams.AddNested("VisibilityConfig", err.(smithy.InvalidParamsError))
}
}
if v.LockToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("LockToken"))
}
if v.CustomResponseBodies != nil {
if err := validateCustomResponseBodies(v.CustomResponseBodies); err != nil {
invalidParams.AddNested("CustomResponseBodies", err.(smithy.InvalidParamsError))
}
}
if v.CaptchaConfig != nil {
if err := validateCaptchaConfig(v.CaptchaConfig); err != nil {
invalidParams.AddNested("CaptchaConfig", err.(smithy.InvalidParamsError))
}
}
if v.ChallengeConfig != nil {
if err := validateChallengeConfig(v.ChallengeConfig); err != nil {
invalidParams.AddNested("ChallengeConfig", err.(smithy.InvalidParamsError))
}
}
if v.AssociationConfig != nil {
if err := validateAssociationConfig(v.AssociationConfig); err != nil {
invalidParams.AddNested("AssociationConfig", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 4,452 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"github.com/aws/aws-sdk-go-v2/aws"
endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2"
"github.com/aws/smithy-go/logging"
"regexp"
)
// Options is the endpoint resolver configuration options
type Options struct {
// Logger is a logging implementation that log events should be sent to.
Logger logging.Logger
// LogDeprecated indicates that deprecated endpoints should be logged to the
// provided logger.
LogDeprecated bool
// ResolvedRegion is used to override the region to be resolved, rather then the
// using the value passed to the ResolveEndpoint method. This value is used by the
// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative
// name. You must not set this value directly in your application.
ResolvedRegion string
// DisableHTTPS informs the resolver to return an endpoint that does not use the
// HTTPS scheme.
DisableHTTPS bool
// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.
UseDualStackEndpoint aws.DualStackEndpointState
// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.
UseFIPSEndpoint aws.FIPSEndpointState
}
func (o Options) GetResolvedRegion() string {
return o.ResolvedRegion
}
func (o Options) GetDisableHTTPS() bool {
return o.DisableHTTPS
}
func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {
return o.UseDualStackEndpoint
}
func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {
return o.UseFIPSEndpoint
}
func transformToSharedOptions(options Options) endpoints.Options {
return endpoints.Options{
Logger: options.Logger,
LogDeprecated: options.LogDeprecated,
ResolvedRegion: options.ResolvedRegion,
DisableHTTPS: options.DisableHTTPS,
UseDualStackEndpoint: options.UseDualStackEndpoint,
UseFIPSEndpoint: options.UseFIPSEndpoint,
}
}
// Resolver WAFV2 endpoint resolver
type Resolver struct {
partitions endpoints.Partitions
}
// ResolveEndpoint resolves the service endpoint for the given region and options
func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {
if len(region) == 0 {
return endpoint, &aws.MissingRegionError{}
}
opt := transformToSharedOptions(options)
return r.partitions.ResolveEndpoint(region, opt)
}
// New returns a new Resolver
func New() *Resolver {
return &Resolver{
partitions: defaultPartitions,
}
}
var partitionRegexp = struct {
Aws *regexp.Regexp
AwsCn *regexp.Regexp
AwsIso *regexp.Regexp
AwsIsoB *regexp.Regexp
AwsIsoE *regexp.Regexp
AwsIsoF *regexp.Regexp
AwsUsGov *regexp.Regexp
}{
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"),
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"),
AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"),
}
var defaultPartitions = endpoints.Partitions{
{
ID: "aws",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "wafv2.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "wafv2-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "wafv2.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "af-south-1",
}: endpoints.Endpoint{
Hostname: "wafv2.af-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "af-south-1",
},
},
endpoints.EndpointKey{
Region: "af-south-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.af-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "af-south-1",
},
},
endpoints.EndpointKey{
Region: "ap-east-1",
}: endpoints.Endpoint{
Hostname: "wafv2.ap-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-east-1",
},
},
endpoints.EndpointKey{
Region: "ap-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.ap-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-east-1",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{
Hostname: "wafv2.ap-northeast-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-1",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.ap-northeast-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-1",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{
Hostname: "wafv2.ap-northeast-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-2",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.ap-northeast-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-2",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-3",
}: endpoints.Endpoint{
Hostname: "wafv2.ap-northeast-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-3",
},
},
endpoints.EndpointKey{
Region: "ap-northeast-3",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.ap-northeast-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-3",
},
},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{
Hostname: "wafv2.ap-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-south-1",
},
},
endpoints.EndpointKey{
Region: "ap-south-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.ap-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-south-1",
},
},
endpoints.EndpointKey{
Region: "ap-south-2",
}: endpoints.Endpoint{
Hostname: "wafv2.ap-south-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-south-2",
},
},
endpoints.EndpointKey{
Region: "ap-south-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.ap-south-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-south-2",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{
Hostname: "wafv2.ap-southeast-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-1",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.ap-southeast-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-1",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{
Hostname: "wafv2.ap-southeast-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-2",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.ap-southeast-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-2",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-3",
}: endpoints.Endpoint{
Hostname: "wafv2.ap-southeast-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-3",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-3",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.ap-southeast-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-3",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-4",
}: endpoints.Endpoint{
Hostname: "wafv2.ap-southeast-4.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-4",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-4",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.ap-southeast-4.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-4",
},
},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{
Hostname: "wafv2.ca-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
},
endpoints.EndpointKey{
Region: "ca-central-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.ca-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{
Hostname: "wafv2.eu-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-central-1",
},
},
endpoints.EndpointKey{
Region: "eu-central-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.eu-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-central-1",
},
},
endpoints.EndpointKey{
Region: "eu-central-2",
}: endpoints.Endpoint{
Hostname: "wafv2.eu-central-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-central-2",
},
},
endpoints.EndpointKey{
Region: "eu-central-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.eu-central-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-central-2",
},
},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{
Hostname: "wafv2.eu-north-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-north-1",
},
},
endpoints.EndpointKey{
Region: "eu-north-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.eu-north-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-north-1",
},
},
endpoints.EndpointKey{
Region: "eu-south-1",
}: endpoints.Endpoint{
Hostname: "wafv2.eu-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-south-1",
},
},
endpoints.EndpointKey{
Region: "eu-south-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.eu-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-south-1",
},
},
endpoints.EndpointKey{
Region: "eu-south-2",
}: endpoints.Endpoint{
Hostname: "wafv2.eu-south-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-south-2",
},
},
endpoints.EndpointKey{
Region: "eu-south-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.eu-south-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-south-2",
},
},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{
Hostname: "wafv2.eu-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-1",
},
},
endpoints.EndpointKey{
Region: "eu-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.eu-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-1",
},
},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{
Hostname: "wafv2.eu-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-2",
},
},
endpoints.EndpointKey{
Region: "eu-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.eu-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-2",
},
},
endpoints.EndpointKey{
Region: "eu-west-3",
}: endpoints.Endpoint{
Hostname: "wafv2.eu-west-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-3",
},
},
endpoints.EndpointKey{
Region: "eu-west-3",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.eu-west-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-3",
},
},
endpoints.EndpointKey{
Region: "fips-af-south-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.af-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "af-south-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-east-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.ap-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-northeast-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.ap-northeast-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-northeast-2",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.ap-northeast-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-northeast-3",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.ap-northeast-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-northeast-3",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-south-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.ap-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-south-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-south-2",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.ap-south-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-south-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-southeast-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.ap-southeast-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-southeast-2",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.ap-southeast-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-southeast-3",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.ap-southeast-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-3",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ap-southeast-4",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.ap-southeast-4.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-4",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-ca-central-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.ca-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-eu-central-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.eu-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-eu-central-2",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.eu-central-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-central-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-eu-north-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.eu-north-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-north-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-eu-south-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.eu-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-south-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-eu-south-2",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.eu-south-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-south-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-eu-west-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.eu-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-eu-west-2",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.eu-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-eu-west-3",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.eu-west-3.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "eu-west-3",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-il-central-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.il-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "il-central-1",
},
},
endpoints.EndpointKey{
Region: "fips-me-central-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.me-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "me-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-me-south-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.me-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "me-south-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-sa-east-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.sa-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "sa-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-east-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-east-2",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.us-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-2",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "me-central-1",
}: endpoints.Endpoint{
Hostname: "wafv2.me-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "me-central-1",
},
},
endpoints.EndpointKey{
Region: "me-central-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.me-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "me-central-1",
},
},
endpoints.EndpointKey{
Region: "me-south-1",
}: endpoints.Endpoint{
Hostname: "wafv2.me-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "me-south-1",
},
},
endpoints.EndpointKey{
Region: "me-south-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.me-south-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "me-south-1",
},
},
endpoints.EndpointKey{
Region: "sa-east-1",
}: endpoints.Endpoint{
Hostname: "wafv2.sa-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "sa-east-1",
},
},
endpoints.EndpointKey{
Region: "sa-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.sa-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "sa-east-1",
},
},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{
Hostname: "wafv2.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{
Hostname: "wafv2.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{
Hostname: "wafv2.us-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.us-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{
Hostname: "wafv2.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "wafv2.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "wafv2-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "wafv2.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "cn-north-1",
}: endpoints.Endpoint{
Hostname: "wafv2.cn-north-1.amazonaws.com.cn",
CredentialScope: endpoints.CredentialScope{
Region: "cn-north-1",
},
},
endpoints.EndpointKey{
Region: "cn-north-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.cn-north-1.amazonaws.com.cn",
CredentialScope: endpoints.CredentialScope{
Region: "cn-north-1",
},
},
endpoints.EndpointKey{
Region: "cn-northwest-1",
}: endpoints.Endpoint{
Hostname: "wafv2.cn-northwest-1.amazonaws.com.cn",
CredentialScope: endpoints.CredentialScope{
Region: "cn-northwest-1",
},
},
endpoints.EndpointKey{
Region: "cn-northwest-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.cn-northwest-1.amazonaws.com.cn",
CredentialScope: endpoints.CredentialScope{
Region: "cn-northwest-1",
},
},
endpoints.EndpointKey{
Region: "fips-cn-north-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.cn-north-1.amazonaws.com.cn",
CredentialScope: endpoints.CredentialScope{
Region: "cn-north-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-cn-northwest-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.cn-northwest-1.amazonaws.com.cn",
CredentialScope: endpoints.CredentialScope{
Region: "cn-northwest-1",
},
Deprecated: aws.TrueTernary,
},
},
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "wafv2.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIso,
IsRegionalized: true,
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "wafv2.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoB,
IsRegionalized: true,
},
{
ID: "aws-iso-e",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "wafv2.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoE,
IsRegionalized: true,
},
{
ID: "aws-iso-f",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "wafv2.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoF,
IsRegionalized: true,
},
{
ID: "aws-us-gov",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "wafv2.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "wafv2-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "wafv2.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "fips-us-gov-east-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.us-gov-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-gov-west-1",
}: endpoints.Endpoint{
Hostname: "wafv2-fips.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
}: endpoints.Endpoint{
Hostname: "wafv2.us-gov-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.us-gov-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{
Hostname: "wafv2.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "wafv2-fips.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
},
},
},
}
| 1,117 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"testing"
)
func TestRegexCompile(t *testing.T) {
_ = defaultPartitions
}
| 12 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
type ActionValue string
// Enum values for ActionValue
const (
ActionValueAllow ActionValue = "ALLOW"
ActionValueBlock ActionValue = "BLOCK"
ActionValueCount ActionValue = "COUNT"
ActionValueCaptcha ActionValue = "CAPTCHA"
ActionValueChallenge ActionValue = "CHALLENGE"
ActionValueExcludedAsCount ActionValue = "EXCLUDED_AS_COUNT"
)
// Values returns all known values for ActionValue. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (ActionValue) Values() []ActionValue {
return []ActionValue{
"ALLOW",
"BLOCK",
"COUNT",
"CAPTCHA",
"CHALLENGE",
"EXCLUDED_AS_COUNT",
}
}
type AssociatedResourceType string
// Enum values for AssociatedResourceType
const (
AssociatedResourceTypeCloudfront AssociatedResourceType = "CLOUDFRONT"
)
// Values returns all known values for AssociatedResourceType. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (AssociatedResourceType) Values() []AssociatedResourceType {
return []AssociatedResourceType{
"CLOUDFRONT",
}
}
type BodyParsingFallbackBehavior string
// Enum values for BodyParsingFallbackBehavior
const (
BodyParsingFallbackBehaviorMatch BodyParsingFallbackBehavior = "MATCH"
BodyParsingFallbackBehaviorNoMatch BodyParsingFallbackBehavior = "NO_MATCH"
BodyParsingFallbackBehaviorEvaluateAsString BodyParsingFallbackBehavior = "EVALUATE_AS_STRING"
)
// Values returns all known values for BodyParsingFallbackBehavior. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (BodyParsingFallbackBehavior) Values() []BodyParsingFallbackBehavior {
return []BodyParsingFallbackBehavior{
"MATCH",
"NO_MATCH",
"EVALUATE_AS_STRING",
}
}
type ComparisonOperator string
// Enum values for ComparisonOperator
const (
ComparisonOperatorEq ComparisonOperator = "EQ"
ComparisonOperatorNe ComparisonOperator = "NE"
ComparisonOperatorLe ComparisonOperator = "LE"
ComparisonOperatorLt ComparisonOperator = "LT"
ComparisonOperatorGe ComparisonOperator = "GE"
ComparisonOperatorGt ComparisonOperator = "GT"
)
// Values returns all known values for ComparisonOperator. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ComparisonOperator) Values() []ComparisonOperator {
return []ComparisonOperator{
"EQ",
"NE",
"LE",
"LT",
"GE",
"GT",
}
}
type CountryCode string
// Enum values for CountryCode
const (
CountryCodeAf CountryCode = "AF"
CountryCodeAx CountryCode = "AX"
CountryCodeAl CountryCode = "AL"
CountryCodeDz CountryCode = "DZ"
CountryCodeAs CountryCode = "AS"
CountryCodeAd CountryCode = "AD"
CountryCodeAo CountryCode = "AO"
CountryCodeAi CountryCode = "AI"
CountryCodeAq CountryCode = "AQ"
CountryCodeAg CountryCode = "AG"
CountryCodeAr CountryCode = "AR"
CountryCodeAm CountryCode = "AM"
CountryCodeAw CountryCode = "AW"
CountryCodeAu CountryCode = "AU"
CountryCodeAt CountryCode = "AT"
CountryCodeAz CountryCode = "AZ"
CountryCodeBs CountryCode = "BS"
CountryCodeBh CountryCode = "BH"
CountryCodeBd CountryCode = "BD"
CountryCodeBb CountryCode = "BB"
CountryCodeBy CountryCode = "BY"
CountryCodeBe CountryCode = "BE"
CountryCodeBz CountryCode = "BZ"
CountryCodeBj CountryCode = "BJ"
CountryCodeBm CountryCode = "BM"
CountryCodeBt CountryCode = "BT"
CountryCodeBo CountryCode = "BO"
CountryCodeBq CountryCode = "BQ"
CountryCodeBa CountryCode = "BA"
CountryCodeBw CountryCode = "BW"
CountryCodeBv CountryCode = "BV"
CountryCodeBr CountryCode = "BR"
CountryCodeIo CountryCode = "IO"
CountryCodeBn CountryCode = "BN"
CountryCodeBg CountryCode = "BG"
CountryCodeBf CountryCode = "BF"
CountryCodeBi CountryCode = "BI"
CountryCodeKh CountryCode = "KH"
CountryCodeCm CountryCode = "CM"
CountryCodeCa CountryCode = "CA"
CountryCodeCv CountryCode = "CV"
CountryCodeKy CountryCode = "KY"
CountryCodeCf CountryCode = "CF"
CountryCodeTd CountryCode = "TD"
CountryCodeCl CountryCode = "CL"
CountryCodeCn CountryCode = "CN"
CountryCodeCx CountryCode = "CX"
CountryCodeCc CountryCode = "CC"
CountryCodeCo CountryCode = "CO"
CountryCodeKm CountryCode = "KM"
CountryCodeCg CountryCode = "CG"
CountryCodeCd CountryCode = "CD"
CountryCodeCk CountryCode = "CK"
CountryCodeCr CountryCode = "CR"
CountryCodeCi CountryCode = "CI"
CountryCodeHr CountryCode = "HR"
CountryCodeCu CountryCode = "CU"
CountryCodeCw CountryCode = "CW"
CountryCodeCy CountryCode = "CY"
CountryCodeCz CountryCode = "CZ"
CountryCodeDk CountryCode = "DK"
CountryCodeDj CountryCode = "DJ"
CountryCodeDm CountryCode = "DM"
CountryCodeDo CountryCode = "DO"
CountryCodeEc CountryCode = "EC"
CountryCodeEg CountryCode = "EG"
CountryCodeSv CountryCode = "SV"
CountryCodeGq CountryCode = "GQ"
CountryCodeEr CountryCode = "ER"
CountryCodeEe CountryCode = "EE"
CountryCodeEt CountryCode = "ET"
CountryCodeFk CountryCode = "FK"
CountryCodeFo CountryCode = "FO"
CountryCodeFj CountryCode = "FJ"
CountryCodeFi CountryCode = "FI"
CountryCodeFr CountryCode = "FR"
CountryCodeGf CountryCode = "GF"
CountryCodePf CountryCode = "PF"
CountryCodeTf CountryCode = "TF"
CountryCodeGa CountryCode = "GA"
CountryCodeGm CountryCode = "GM"
CountryCodeGe CountryCode = "GE"
CountryCodeDe CountryCode = "DE"
CountryCodeGh CountryCode = "GH"
CountryCodeGi CountryCode = "GI"
CountryCodeGr CountryCode = "GR"
CountryCodeGl CountryCode = "GL"
CountryCodeGd CountryCode = "GD"
CountryCodeGp CountryCode = "GP"
CountryCodeGu CountryCode = "GU"
CountryCodeGt CountryCode = "GT"
CountryCodeGg CountryCode = "GG"
CountryCodeGn CountryCode = "GN"
CountryCodeGw CountryCode = "GW"
CountryCodeGy CountryCode = "GY"
CountryCodeHt CountryCode = "HT"
CountryCodeHm CountryCode = "HM"
CountryCodeVa CountryCode = "VA"
CountryCodeHn CountryCode = "HN"
CountryCodeHk CountryCode = "HK"
CountryCodeHu CountryCode = "HU"
CountryCodeIs CountryCode = "IS"
CountryCodeIn CountryCode = "IN"
CountryCodeId CountryCode = "ID"
CountryCodeIr CountryCode = "IR"
CountryCodeIq CountryCode = "IQ"
CountryCodeIe CountryCode = "IE"
CountryCodeIm CountryCode = "IM"
CountryCodeIl CountryCode = "IL"
CountryCodeIt CountryCode = "IT"
CountryCodeJm CountryCode = "JM"
CountryCodeJp CountryCode = "JP"
CountryCodeJe CountryCode = "JE"
CountryCodeJo CountryCode = "JO"
CountryCodeKz CountryCode = "KZ"
CountryCodeKe CountryCode = "KE"
CountryCodeKi CountryCode = "KI"
CountryCodeKp CountryCode = "KP"
CountryCodeKr CountryCode = "KR"
CountryCodeKw CountryCode = "KW"
CountryCodeKg CountryCode = "KG"
CountryCodeLa CountryCode = "LA"
CountryCodeLv CountryCode = "LV"
CountryCodeLb CountryCode = "LB"
CountryCodeLs CountryCode = "LS"
CountryCodeLr CountryCode = "LR"
CountryCodeLy CountryCode = "LY"
CountryCodeLi CountryCode = "LI"
CountryCodeLt CountryCode = "LT"
CountryCodeLu CountryCode = "LU"
CountryCodeMo CountryCode = "MO"
CountryCodeMk CountryCode = "MK"
CountryCodeMg CountryCode = "MG"
CountryCodeMw CountryCode = "MW"
CountryCodeMy CountryCode = "MY"
CountryCodeMv CountryCode = "MV"
CountryCodeMl CountryCode = "ML"
CountryCodeMt CountryCode = "MT"
CountryCodeMh CountryCode = "MH"
CountryCodeMq CountryCode = "MQ"
CountryCodeMr CountryCode = "MR"
CountryCodeMu CountryCode = "MU"
CountryCodeYt CountryCode = "YT"
CountryCodeMx CountryCode = "MX"
CountryCodeFm CountryCode = "FM"
CountryCodeMd CountryCode = "MD"
CountryCodeMc CountryCode = "MC"
CountryCodeMn CountryCode = "MN"
CountryCodeMe CountryCode = "ME"
CountryCodeMs CountryCode = "MS"
CountryCodeMa CountryCode = "MA"
CountryCodeMz CountryCode = "MZ"
CountryCodeMm CountryCode = "MM"
CountryCodeNa CountryCode = "NA"
CountryCodeNr CountryCode = "NR"
CountryCodeNp CountryCode = "NP"
CountryCodeNl CountryCode = "NL"
CountryCodeNc CountryCode = "NC"
CountryCodeNz CountryCode = "NZ"
CountryCodeNi CountryCode = "NI"
CountryCodeNe CountryCode = "NE"
CountryCodeNg CountryCode = "NG"
CountryCodeNu CountryCode = "NU"
CountryCodeNf CountryCode = "NF"
CountryCodeMp CountryCode = "MP"
CountryCodeNo CountryCode = "NO"
CountryCodeOm CountryCode = "OM"
CountryCodePk CountryCode = "PK"
CountryCodePw CountryCode = "PW"
CountryCodePs CountryCode = "PS"
CountryCodePa CountryCode = "PA"
CountryCodePg CountryCode = "PG"
CountryCodePy CountryCode = "PY"
CountryCodePe CountryCode = "PE"
CountryCodePh CountryCode = "PH"
CountryCodePn CountryCode = "PN"
CountryCodePl CountryCode = "PL"
CountryCodePt CountryCode = "PT"
CountryCodePr CountryCode = "PR"
CountryCodeQa CountryCode = "QA"
CountryCodeRe CountryCode = "RE"
CountryCodeRo CountryCode = "RO"
CountryCodeRu CountryCode = "RU"
CountryCodeRw CountryCode = "RW"
CountryCodeBl CountryCode = "BL"
CountryCodeSh CountryCode = "SH"
CountryCodeKn CountryCode = "KN"
CountryCodeLc CountryCode = "LC"
CountryCodeMf CountryCode = "MF"
CountryCodePm CountryCode = "PM"
CountryCodeVc CountryCode = "VC"
CountryCodeWs CountryCode = "WS"
CountryCodeSm CountryCode = "SM"
CountryCodeSt CountryCode = "ST"
CountryCodeSa CountryCode = "SA"
CountryCodeSn CountryCode = "SN"
CountryCodeRs CountryCode = "RS"
CountryCodeSc CountryCode = "SC"
CountryCodeSl CountryCode = "SL"
CountryCodeSg CountryCode = "SG"
CountryCodeSx CountryCode = "SX"
CountryCodeSk CountryCode = "SK"
CountryCodeSi CountryCode = "SI"
CountryCodeSb CountryCode = "SB"
CountryCodeSo CountryCode = "SO"
CountryCodeZa CountryCode = "ZA"
CountryCodeGs CountryCode = "GS"
CountryCodeSs CountryCode = "SS"
CountryCodeEs CountryCode = "ES"
CountryCodeLk CountryCode = "LK"
CountryCodeSd CountryCode = "SD"
CountryCodeSr CountryCode = "SR"
CountryCodeSj CountryCode = "SJ"
CountryCodeSz CountryCode = "SZ"
CountryCodeSe CountryCode = "SE"
CountryCodeCh CountryCode = "CH"
CountryCodeSy CountryCode = "SY"
CountryCodeTw CountryCode = "TW"
CountryCodeTj CountryCode = "TJ"
CountryCodeTz CountryCode = "TZ"
CountryCodeTh CountryCode = "TH"
CountryCodeTl CountryCode = "TL"
CountryCodeTg CountryCode = "TG"
CountryCodeTk CountryCode = "TK"
CountryCodeTo CountryCode = "TO"
CountryCodeTt CountryCode = "TT"
CountryCodeTn CountryCode = "TN"
CountryCodeTr CountryCode = "TR"
CountryCodeTm CountryCode = "TM"
CountryCodeTc CountryCode = "TC"
CountryCodeTv CountryCode = "TV"
CountryCodeUg CountryCode = "UG"
CountryCodeUa CountryCode = "UA"
CountryCodeAe CountryCode = "AE"
CountryCodeGb CountryCode = "GB"
CountryCodeUs CountryCode = "US"
CountryCodeUm CountryCode = "UM"
CountryCodeUy CountryCode = "UY"
CountryCodeUz CountryCode = "UZ"
CountryCodeVu CountryCode = "VU"
CountryCodeVe CountryCode = "VE"
CountryCodeVn CountryCode = "VN"
CountryCodeVg CountryCode = "VG"
CountryCodeVi CountryCode = "VI"
CountryCodeWf CountryCode = "WF"
CountryCodeEh CountryCode = "EH"
CountryCodeYe CountryCode = "YE"
CountryCodeZm CountryCode = "ZM"
CountryCodeZw CountryCode = "ZW"
CountryCodeXk CountryCode = "XK"
)
// Values returns all known values for CountryCode. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (CountryCode) Values() []CountryCode {
return []CountryCode{
"AF",
"AX",
"AL",
"DZ",
"AS",
"AD",
"AO",
"AI",
"AQ",
"AG",
"AR",
"AM",
"AW",
"AU",
"AT",
"AZ",
"BS",
"BH",
"BD",
"BB",
"BY",
"BE",
"BZ",
"BJ",
"BM",
"BT",
"BO",
"BQ",
"BA",
"BW",
"BV",
"BR",
"IO",
"BN",
"BG",
"BF",
"BI",
"KH",
"CM",
"CA",
"CV",
"KY",
"CF",
"TD",
"CL",
"CN",
"CX",
"CC",
"CO",
"KM",
"CG",
"CD",
"CK",
"CR",
"CI",
"HR",
"CU",
"CW",
"CY",
"CZ",
"DK",
"DJ",
"DM",
"DO",
"EC",
"EG",
"SV",
"GQ",
"ER",
"EE",
"ET",
"FK",
"FO",
"FJ",
"FI",
"FR",
"GF",
"PF",
"TF",
"GA",
"GM",
"GE",
"DE",
"GH",
"GI",
"GR",
"GL",
"GD",
"GP",
"GU",
"GT",
"GG",
"GN",
"GW",
"GY",
"HT",
"HM",
"VA",
"HN",
"HK",
"HU",
"IS",
"IN",
"ID",
"IR",
"IQ",
"IE",
"IM",
"IL",
"IT",
"JM",
"JP",
"JE",
"JO",
"KZ",
"KE",
"KI",
"KP",
"KR",
"KW",
"KG",
"LA",
"LV",
"LB",
"LS",
"LR",
"LY",
"LI",
"LT",
"LU",
"MO",
"MK",
"MG",
"MW",
"MY",
"MV",
"ML",
"MT",
"MH",
"MQ",
"MR",
"MU",
"YT",
"MX",
"FM",
"MD",
"MC",
"MN",
"ME",
"MS",
"MA",
"MZ",
"MM",
"NA",
"NR",
"NP",
"NL",
"NC",
"NZ",
"NI",
"NE",
"NG",
"NU",
"NF",
"MP",
"NO",
"OM",
"PK",
"PW",
"PS",
"PA",
"PG",
"PY",
"PE",
"PH",
"PN",
"PL",
"PT",
"PR",
"QA",
"RE",
"RO",
"RU",
"RW",
"BL",
"SH",
"KN",
"LC",
"MF",
"PM",
"VC",
"WS",
"SM",
"ST",
"SA",
"SN",
"RS",
"SC",
"SL",
"SG",
"SX",
"SK",
"SI",
"SB",
"SO",
"ZA",
"GS",
"SS",
"ES",
"LK",
"SD",
"SR",
"SJ",
"SZ",
"SE",
"CH",
"SY",
"TW",
"TJ",
"TZ",
"TH",
"TL",
"TG",
"TK",
"TO",
"TT",
"TN",
"TR",
"TM",
"TC",
"TV",
"UG",
"UA",
"AE",
"GB",
"US",
"UM",
"UY",
"UZ",
"VU",
"VE",
"VN",
"VG",
"VI",
"WF",
"EH",
"YE",
"ZM",
"ZW",
"XK",
}
}
type FailureReason string
// Enum values for FailureReason
const (
FailureReasonTokenMissing FailureReason = "TOKEN_MISSING"
FailureReasonTokenExpired FailureReason = "TOKEN_EXPIRED"
FailureReasonTokenInvalid FailureReason = "TOKEN_INVALID"
FailureReasonTokenDomainMismatch FailureReason = "TOKEN_DOMAIN_MISMATCH"
)
// Values returns all known values for FailureReason. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (FailureReason) Values() []FailureReason {
return []FailureReason{
"TOKEN_MISSING",
"TOKEN_EXPIRED",
"TOKEN_INVALID",
"TOKEN_DOMAIN_MISMATCH",
}
}
type FallbackBehavior string
// Enum values for FallbackBehavior
const (
FallbackBehaviorMatch FallbackBehavior = "MATCH"
FallbackBehaviorNoMatch FallbackBehavior = "NO_MATCH"
)
// Values returns all known values for FallbackBehavior. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (FallbackBehavior) Values() []FallbackBehavior {
return []FallbackBehavior{
"MATCH",
"NO_MATCH",
}
}
type FilterBehavior string
// Enum values for FilterBehavior
const (
FilterBehaviorKeep FilterBehavior = "KEEP"
FilterBehaviorDrop FilterBehavior = "DROP"
)
// Values returns all known values for FilterBehavior. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (FilterBehavior) Values() []FilterBehavior {
return []FilterBehavior{
"KEEP",
"DROP",
}
}
type FilterRequirement string
// Enum values for FilterRequirement
const (
FilterRequirementMeetsAll FilterRequirement = "MEETS_ALL"
FilterRequirementMeetsAny FilterRequirement = "MEETS_ANY"
)
// Values returns all known values for FilterRequirement. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (FilterRequirement) Values() []FilterRequirement {
return []FilterRequirement{
"MEETS_ALL",
"MEETS_ANY",
}
}
type ForwardedIPPosition string
// Enum values for ForwardedIPPosition
const (
ForwardedIPPositionFirst ForwardedIPPosition = "FIRST"
ForwardedIPPositionLast ForwardedIPPosition = "LAST"
ForwardedIPPositionAny ForwardedIPPosition = "ANY"
)
// Values returns all known values for ForwardedIPPosition. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ForwardedIPPosition) Values() []ForwardedIPPosition {
return []ForwardedIPPosition{
"FIRST",
"LAST",
"ANY",
}
}
type InspectionLevel string
// Enum values for InspectionLevel
const (
InspectionLevelCommon InspectionLevel = "COMMON"
InspectionLevelTargeted InspectionLevel = "TARGETED"
)
// Values returns all known values for InspectionLevel. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (InspectionLevel) Values() []InspectionLevel {
return []InspectionLevel{
"COMMON",
"TARGETED",
}
}
type IPAddressVersion string
// Enum values for IPAddressVersion
const (
IPAddressVersionIpv4 IPAddressVersion = "IPV4"
IPAddressVersionIpv6 IPAddressVersion = "IPV6"
)
// Values returns all known values for IPAddressVersion. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (IPAddressVersion) Values() []IPAddressVersion {
return []IPAddressVersion{
"IPV4",
"IPV6",
}
}
type JsonMatchScope string
// Enum values for JsonMatchScope
const (
JsonMatchScopeAll JsonMatchScope = "ALL"
JsonMatchScopeKey JsonMatchScope = "KEY"
JsonMatchScopeValue JsonMatchScope = "VALUE"
)
// Values returns all known values for JsonMatchScope. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (JsonMatchScope) Values() []JsonMatchScope {
return []JsonMatchScope{
"ALL",
"KEY",
"VALUE",
}
}
type LabelMatchScope string
// Enum values for LabelMatchScope
const (
LabelMatchScopeLabel LabelMatchScope = "LABEL"
LabelMatchScopeNamespace LabelMatchScope = "NAMESPACE"
)
// Values returns all known values for LabelMatchScope. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (LabelMatchScope) Values() []LabelMatchScope {
return []LabelMatchScope{
"LABEL",
"NAMESPACE",
}
}
type MapMatchScope string
// Enum values for MapMatchScope
const (
MapMatchScopeAll MapMatchScope = "ALL"
MapMatchScopeKey MapMatchScope = "KEY"
MapMatchScopeValue MapMatchScope = "VALUE"
)
// Values returns all known values for MapMatchScope. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (MapMatchScope) Values() []MapMatchScope {
return []MapMatchScope{
"ALL",
"KEY",
"VALUE",
}
}
type OversizeHandling string
// Enum values for OversizeHandling
const (
OversizeHandlingContinue OversizeHandling = "CONTINUE"
OversizeHandlingMatch OversizeHandling = "MATCH"
OversizeHandlingNoMatch OversizeHandling = "NO_MATCH"
)
// Values returns all known values for OversizeHandling. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (OversizeHandling) Values() []OversizeHandling {
return []OversizeHandling{
"CONTINUE",
"MATCH",
"NO_MATCH",
}
}
type ParameterExceptionField string
// Enum values for ParameterExceptionField
const (
ParameterExceptionFieldWebAcl ParameterExceptionField = "WEB_ACL"
ParameterExceptionFieldRuleGroup ParameterExceptionField = "RULE_GROUP"
ParameterExceptionFieldRegexPatternSet ParameterExceptionField = "REGEX_PATTERN_SET"
ParameterExceptionFieldIpSet ParameterExceptionField = "IP_SET"
ParameterExceptionFieldManagedRuleSet ParameterExceptionField = "MANAGED_RULE_SET"
ParameterExceptionFieldRule ParameterExceptionField = "RULE"
ParameterExceptionFieldExcludedRule ParameterExceptionField = "EXCLUDED_RULE"
ParameterExceptionFieldStatement ParameterExceptionField = "STATEMENT"
ParameterExceptionFieldByteMatchStatement ParameterExceptionField = "BYTE_MATCH_STATEMENT"
ParameterExceptionFieldSqliMatchStatement ParameterExceptionField = "SQLI_MATCH_STATEMENT"
ParameterExceptionFieldXssMatchStatement ParameterExceptionField = "XSS_MATCH_STATEMENT"
ParameterExceptionFieldSizeConstraintStatement ParameterExceptionField = "SIZE_CONSTRAINT_STATEMENT"
ParameterExceptionFieldGeoMatchStatement ParameterExceptionField = "GEO_MATCH_STATEMENT"
ParameterExceptionFieldRateBasedStatement ParameterExceptionField = "RATE_BASED_STATEMENT"
ParameterExceptionFieldRuleGroupReferenceStatement ParameterExceptionField = "RULE_GROUP_REFERENCE_STATEMENT"
ParameterExceptionFieldRegexPatternReferenceStatement ParameterExceptionField = "REGEX_PATTERN_REFERENCE_STATEMENT"
ParameterExceptionFieldIpSetReferenceStatement ParameterExceptionField = "IP_SET_REFERENCE_STATEMENT"
ParameterExceptionFieldManagedRuleSetStatement ParameterExceptionField = "MANAGED_RULE_SET_STATEMENT"
ParameterExceptionFieldLabelMatchStatement ParameterExceptionField = "LABEL_MATCH_STATEMENT"
ParameterExceptionFieldAndStatement ParameterExceptionField = "AND_STATEMENT"
ParameterExceptionFieldOrStatement ParameterExceptionField = "OR_STATEMENT"
ParameterExceptionFieldNotStatement ParameterExceptionField = "NOT_STATEMENT"
ParameterExceptionFieldIpAddress ParameterExceptionField = "IP_ADDRESS"
ParameterExceptionFieldIpAddressVersion ParameterExceptionField = "IP_ADDRESS_VERSION"
ParameterExceptionFieldFieldToMatch ParameterExceptionField = "FIELD_TO_MATCH"
ParameterExceptionFieldTextTransformation ParameterExceptionField = "TEXT_TRANSFORMATION"
ParameterExceptionFieldSingleQueryArgument ParameterExceptionField = "SINGLE_QUERY_ARGUMENT"
ParameterExceptionFieldSingleHeader ParameterExceptionField = "SINGLE_HEADER"
ParameterExceptionFieldDefaultAction ParameterExceptionField = "DEFAULT_ACTION"
ParameterExceptionFieldRuleAction ParameterExceptionField = "RULE_ACTION"
ParameterExceptionFieldEntityLimit ParameterExceptionField = "ENTITY_LIMIT"
ParameterExceptionFieldOverrideAction ParameterExceptionField = "OVERRIDE_ACTION"
ParameterExceptionFieldScopeValue ParameterExceptionField = "SCOPE_VALUE"
ParameterExceptionFieldResourceArn ParameterExceptionField = "RESOURCE_ARN"
ParameterExceptionFieldResourceType ParameterExceptionField = "RESOURCE_TYPE"
ParameterExceptionFieldTags ParameterExceptionField = "TAGS"
ParameterExceptionFieldTagKeys ParameterExceptionField = "TAG_KEYS"
ParameterExceptionFieldMetricName ParameterExceptionField = "METRIC_NAME"
ParameterExceptionFieldFirewallManagerStatement ParameterExceptionField = "FIREWALL_MANAGER_STATEMENT"
ParameterExceptionFieldFallbackBehavior ParameterExceptionField = "FALLBACK_BEHAVIOR"
ParameterExceptionFieldPosition ParameterExceptionField = "POSITION"
ParameterExceptionFieldForwardedIpConfig ParameterExceptionField = "FORWARDED_IP_CONFIG"
ParameterExceptionFieldIpSetForwardedIpConfig ParameterExceptionField = "IP_SET_FORWARDED_IP_CONFIG"
ParameterExceptionFieldHeaderName ParameterExceptionField = "HEADER_NAME"
ParameterExceptionFieldCustomRequestHandling ParameterExceptionField = "CUSTOM_REQUEST_HANDLING"
ParameterExceptionFieldResponseContentType ParameterExceptionField = "RESPONSE_CONTENT_TYPE"
ParameterExceptionFieldCustomResponse ParameterExceptionField = "CUSTOM_RESPONSE"
ParameterExceptionFieldCustomResponseBody ParameterExceptionField = "CUSTOM_RESPONSE_BODY"
ParameterExceptionFieldJsonMatchPattern ParameterExceptionField = "JSON_MATCH_PATTERN"
ParameterExceptionFieldJsonMatchScope ParameterExceptionField = "JSON_MATCH_SCOPE"
ParameterExceptionFieldBodyParsingFallbackBehavior ParameterExceptionField = "BODY_PARSING_FALLBACK_BEHAVIOR"
ParameterExceptionFieldLoggingFilter ParameterExceptionField = "LOGGING_FILTER"
ParameterExceptionFieldFilterCondition ParameterExceptionField = "FILTER_CONDITION"
ParameterExceptionFieldExpireTimestamp ParameterExceptionField = "EXPIRE_TIMESTAMP"
ParameterExceptionFieldChangePropagationStatus ParameterExceptionField = "CHANGE_PROPAGATION_STATUS"
ParameterExceptionFieldAssociableResource ParameterExceptionField = "ASSOCIABLE_RESOURCE"
ParameterExceptionFieldLogDestination ParameterExceptionField = "LOG_DESTINATION"
ParameterExceptionFieldManagedRuleGroupConfig ParameterExceptionField = "MANAGED_RULE_GROUP_CONFIG"
ParameterExceptionFieldPayloadType ParameterExceptionField = "PAYLOAD_TYPE"
ParameterExceptionFieldHeaderMatchPattern ParameterExceptionField = "HEADER_MATCH_PATTERN"
ParameterExceptionFieldCookieMatchPattern ParameterExceptionField = "COOKIE_MATCH_PATTERN"
ParameterExceptionFieldMapMatchScope ParameterExceptionField = "MAP_MATCH_SCOPE"
ParameterExceptionFieldOversizeHandling ParameterExceptionField = "OVERSIZE_HANDLING"
ParameterExceptionFieldChallengeConfig ParameterExceptionField = "CHALLENGE_CONFIG"
ParameterExceptionFieldTokenDomain ParameterExceptionField = "TOKEN_DOMAIN"
ParameterExceptionFieldAtpRuleSetResponseInspection ParameterExceptionField = "ATP_RULE_SET_RESPONSE_INSPECTION"
ParameterExceptionFieldAssociatedResourceType ParameterExceptionField = "ASSOCIATED_RESOURCE_TYPE"
ParameterExceptionFieldScopeDown ParameterExceptionField = "SCOPE_DOWN"
ParameterExceptionFieldCustomKeys ParameterExceptionField = "CUSTOM_KEYS"
ParameterExceptionFieldAcpRuleSetResponseInspection ParameterExceptionField = "ACP_RULE_SET_RESPONSE_INSPECTION"
)
// Values returns all known values for ParameterExceptionField. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ParameterExceptionField) Values() []ParameterExceptionField {
return []ParameterExceptionField{
"WEB_ACL",
"RULE_GROUP",
"REGEX_PATTERN_SET",
"IP_SET",
"MANAGED_RULE_SET",
"RULE",
"EXCLUDED_RULE",
"STATEMENT",
"BYTE_MATCH_STATEMENT",
"SQLI_MATCH_STATEMENT",
"XSS_MATCH_STATEMENT",
"SIZE_CONSTRAINT_STATEMENT",
"GEO_MATCH_STATEMENT",
"RATE_BASED_STATEMENT",
"RULE_GROUP_REFERENCE_STATEMENT",
"REGEX_PATTERN_REFERENCE_STATEMENT",
"IP_SET_REFERENCE_STATEMENT",
"MANAGED_RULE_SET_STATEMENT",
"LABEL_MATCH_STATEMENT",
"AND_STATEMENT",
"OR_STATEMENT",
"NOT_STATEMENT",
"IP_ADDRESS",
"IP_ADDRESS_VERSION",
"FIELD_TO_MATCH",
"TEXT_TRANSFORMATION",
"SINGLE_QUERY_ARGUMENT",
"SINGLE_HEADER",
"DEFAULT_ACTION",
"RULE_ACTION",
"ENTITY_LIMIT",
"OVERRIDE_ACTION",
"SCOPE_VALUE",
"RESOURCE_ARN",
"RESOURCE_TYPE",
"TAGS",
"TAG_KEYS",
"METRIC_NAME",
"FIREWALL_MANAGER_STATEMENT",
"FALLBACK_BEHAVIOR",
"POSITION",
"FORWARDED_IP_CONFIG",
"IP_SET_FORWARDED_IP_CONFIG",
"HEADER_NAME",
"CUSTOM_REQUEST_HANDLING",
"RESPONSE_CONTENT_TYPE",
"CUSTOM_RESPONSE",
"CUSTOM_RESPONSE_BODY",
"JSON_MATCH_PATTERN",
"JSON_MATCH_SCOPE",
"BODY_PARSING_FALLBACK_BEHAVIOR",
"LOGGING_FILTER",
"FILTER_CONDITION",
"EXPIRE_TIMESTAMP",
"CHANGE_PROPAGATION_STATUS",
"ASSOCIABLE_RESOURCE",
"LOG_DESTINATION",
"MANAGED_RULE_GROUP_CONFIG",
"PAYLOAD_TYPE",
"HEADER_MATCH_PATTERN",
"COOKIE_MATCH_PATTERN",
"MAP_MATCH_SCOPE",
"OVERSIZE_HANDLING",
"CHALLENGE_CONFIG",
"TOKEN_DOMAIN",
"ATP_RULE_SET_RESPONSE_INSPECTION",
"ASSOCIATED_RESOURCE_TYPE",
"SCOPE_DOWN",
"CUSTOM_KEYS",
"ACP_RULE_SET_RESPONSE_INSPECTION",
}
}
type PayloadType string
// Enum values for PayloadType
const (
PayloadTypeJson PayloadType = "JSON"
PayloadTypeFormEncoded PayloadType = "FORM_ENCODED"
)
// Values returns all known values for PayloadType. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (PayloadType) Values() []PayloadType {
return []PayloadType{
"JSON",
"FORM_ENCODED",
}
}
type Platform string
// Enum values for Platform
const (
PlatformIos Platform = "IOS"
PlatformAndroid Platform = "ANDROID"
)
// Values returns all known values for Platform. Note that this can be expanded in
// the future, and so it is only as up to date as the client. The ordering of this
// slice is not guaranteed to be stable across updates.
func (Platform) Values() []Platform {
return []Platform{
"IOS",
"ANDROID",
}
}
type PositionalConstraint string
// Enum values for PositionalConstraint
const (
PositionalConstraintExactly PositionalConstraint = "EXACTLY"
PositionalConstraintStartsWith PositionalConstraint = "STARTS_WITH"
PositionalConstraintEndsWith PositionalConstraint = "ENDS_WITH"
PositionalConstraintContains PositionalConstraint = "CONTAINS"
PositionalConstraintContainsWord PositionalConstraint = "CONTAINS_WORD"
)
// Values returns all known values for PositionalConstraint. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (PositionalConstraint) Values() []PositionalConstraint {
return []PositionalConstraint{
"EXACTLY",
"STARTS_WITH",
"ENDS_WITH",
"CONTAINS",
"CONTAINS_WORD",
}
}
type RateBasedStatementAggregateKeyType string
// Enum values for RateBasedStatementAggregateKeyType
const (
RateBasedStatementAggregateKeyTypeIp RateBasedStatementAggregateKeyType = "IP"
RateBasedStatementAggregateKeyTypeForwardedIp RateBasedStatementAggregateKeyType = "FORWARDED_IP"
RateBasedStatementAggregateKeyTypeCustomKeys RateBasedStatementAggregateKeyType = "CUSTOM_KEYS"
RateBasedStatementAggregateKeyTypeConstant RateBasedStatementAggregateKeyType = "CONSTANT"
)
// Values returns all known values for RateBasedStatementAggregateKeyType. Note
// that this can be expanded in the future, and so it is only as up to date as the
// client. The ordering of this slice is not guaranteed to be stable across
// updates.
func (RateBasedStatementAggregateKeyType) Values() []RateBasedStatementAggregateKeyType {
return []RateBasedStatementAggregateKeyType{
"IP",
"FORWARDED_IP",
"CUSTOM_KEYS",
"CONSTANT",
}
}
type ResourceType string
// Enum values for ResourceType
const (
ResourceTypeApplicationLoadBalancer ResourceType = "APPLICATION_LOAD_BALANCER"
ResourceTypeApiGateway ResourceType = "API_GATEWAY"
ResourceTypeAppsync ResourceType = "APPSYNC"
ResourceTypeCognitioUserPool ResourceType = "COGNITO_USER_POOL"
ResourceTypeAppRunnerService ResourceType = "APP_RUNNER_SERVICE"
ResourceTypeVerifiedAccessInstance ResourceType = "VERIFIED_ACCESS_INSTANCE"
)
// Values returns all known values for ResourceType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ResourceType) Values() []ResourceType {
return []ResourceType{
"APPLICATION_LOAD_BALANCER",
"API_GATEWAY",
"APPSYNC",
"COGNITO_USER_POOL",
"APP_RUNNER_SERVICE",
"VERIFIED_ACCESS_INSTANCE",
}
}
type ResponseContentType string
// Enum values for ResponseContentType
const (
ResponseContentTypeTextPlain ResponseContentType = "TEXT_PLAIN"
ResponseContentTypeTextHtml ResponseContentType = "TEXT_HTML"
ResponseContentTypeApplicationJson ResponseContentType = "APPLICATION_JSON"
)
// Values returns all known values for ResponseContentType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ResponseContentType) Values() []ResponseContentType {
return []ResponseContentType{
"TEXT_PLAIN",
"TEXT_HTML",
"APPLICATION_JSON",
}
}
type Scope string
// Enum values for Scope
const (
ScopeCloudfront Scope = "CLOUDFRONT"
ScopeRegional Scope = "REGIONAL"
)
// Values returns all known values for Scope. Note that this can be expanded in
// the future, and so it is only as up to date as the client. The ordering of this
// slice is not guaranteed to be stable across updates.
func (Scope) Values() []Scope {
return []Scope{
"CLOUDFRONT",
"REGIONAL",
}
}
type SensitivityLevel string
// Enum values for SensitivityLevel
const (
SensitivityLevelLow SensitivityLevel = "LOW"
SensitivityLevelHigh SensitivityLevel = "HIGH"
)
// Values returns all known values for SensitivityLevel. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (SensitivityLevel) Values() []SensitivityLevel {
return []SensitivityLevel{
"LOW",
"HIGH",
}
}
type SizeInspectionLimit string
// Enum values for SizeInspectionLimit
const (
SizeInspectionLimitKb16 SizeInspectionLimit = "KB_16"
SizeInspectionLimitKb32 SizeInspectionLimit = "KB_32"
SizeInspectionLimitKb48 SizeInspectionLimit = "KB_48"
SizeInspectionLimitKb64 SizeInspectionLimit = "KB_64"
)
// Values returns all known values for SizeInspectionLimit. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (SizeInspectionLimit) Values() []SizeInspectionLimit {
return []SizeInspectionLimit{
"KB_16",
"KB_32",
"KB_48",
"KB_64",
}
}
type TextTransformationType string
// Enum values for TextTransformationType
const (
TextTransformationTypeNone TextTransformationType = "NONE"
TextTransformationTypeCompressWhiteSpace TextTransformationType = "COMPRESS_WHITE_SPACE"
TextTransformationTypeHtmlEntityDecode TextTransformationType = "HTML_ENTITY_DECODE"
TextTransformationTypeLowercase TextTransformationType = "LOWERCASE"
TextTransformationTypeCmdLine TextTransformationType = "CMD_LINE"
TextTransformationTypeUrlDecode TextTransformationType = "URL_DECODE"
TextTransformationTypeBase64Decode TextTransformationType = "BASE64_DECODE"
TextTransformationTypeHexDecode TextTransformationType = "HEX_DECODE"
TextTransformationTypeMd5 TextTransformationType = "MD5"
TextTransformationTypeReplaceComments TextTransformationType = "REPLACE_COMMENTS"
TextTransformationTypeEscapeSeqDecode TextTransformationType = "ESCAPE_SEQ_DECODE"
TextTransformationTypeSqlHexDecode TextTransformationType = "SQL_HEX_DECODE"
TextTransformationTypeCssDecode TextTransformationType = "CSS_DECODE"
TextTransformationTypeJsDecode TextTransformationType = "JS_DECODE"
TextTransformationTypeNormalizePath TextTransformationType = "NORMALIZE_PATH"
TextTransformationTypeNormalizePathWin TextTransformationType = "NORMALIZE_PATH_WIN"
TextTransformationTypeRemoveNulls TextTransformationType = "REMOVE_NULLS"
TextTransformationTypeReplaceNulls TextTransformationType = "REPLACE_NULLS"
TextTransformationTypeBase64DecodeExt TextTransformationType = "BASE64_DECODE_EXT"
TextTransformationTypeUrlDecodeUni TextTransformationType = "URL_DECODE_UNI"
TextTransformationTypeUtf8ToUnicode TextTransformationType = "UTF8_TO_UNICODE"
)
// Values returns all known values for TextTransformationType. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (TextTransformationType) Values() []TextTransformationType {
return []TextTransformationType{
"NONE",
"COMPRESS_WHITE_SPACE",
"HTML_ENTITY_DECODE",
"LOWERCASE",
"CMD_LINE",
"URL_DECODE",
"BASE64_DECODE",
"HEX_DECODE",
"MD5",
"REPLACE_COMMENTS",
"ESCAPE_SEQ_DECODE",
"SQL_HEX_DECODE",
"CSS_DECODE",
"JS_DECODE",
"NORMALIZE_PATH",
"NORMALIZE_PATH_WIN",
"REMOVE_NULLS",
"REPLACE_NULLS",
"BASE64_DECODE_EXT",
"URL_DECODE_UNI",
"UTF8_TO_UNICODE",
}
}
| 1,213 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// WAF couldn’t perform the operation because your resource is being used by
// another resource or it’s associated with another resource.
type WAFAssociatedItemException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFAssociatedItemException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFAssociatedItemException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFAssociatedItemException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFAssociatedItemException"
}
return *e.ErrorCodeOverride
}
func (e *WAFAssociatedItemException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The operation failed because you are inspecting the web request body, headers,
// or cookies without specifying how to handle oversize components. Rules that
// inspect the body must either provide an OversizeHandling configuration or they
// must be preceded by a SizeConstraintStatement that blocks the body content from
// being too large. Rules that inspect the headers or cookies must provide an
// OversizeHandling configuration. Provide the handling configuration and retry
// your operation. Alternately, you can suppress this warning by adding the
// following tag to the resource that you provide to this operation: Tag (key:
// WAF:OversizeFieldsHandlingConstraintOptOut , value: true ).
type WAFConfigurationWarningException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFConfigurationWarningException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFConfigurationWarningException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFConfigurationWarningException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFConfigurationWarningException"
}
return *e.ErrorCodeOverride
}
func (e *WAFConfigurationWarningException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// WAF couldn’t perform the operation because the resource that you tried to save
// is a duplicate of an existing one.
type WAFDuplicateItemException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFDuplicateItemException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFDuplicateItemException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFDuplicateItemException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFDuplicateItemException"
}
return *e.ErrorCodeOverride
}
func (e *WAFDuplicateItemException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The operation failed because the specified version for the managed rule group
// has expired. You can retrieve the available versions for the managed rule group
// by calling ListAvailableManagedRuleGroupVersions .
type WAFExpiredManagedRuleGroupVersionException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFExpiredManagedRuleGroupVersionException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFExpiredManagedRuleGroupVersionException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFExpiredManagedRuleGroupVersionException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFExpiredManagedRuleGroupVersionException"
}
return *e.ErrorCodeOverride
}
func (e *WAFExpiredManagedRuleGroupVersionException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// Your request is valid, but WAF couldn’t perform the operation because of a
// system problem. Retry your request.
type WAFInternalErrorException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFInternalErrorException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFInternalErrorException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFInternalErrorException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFInternalErrorException"
}
return *e.ErrorCodeOverride
}
func (e *WAFInternalErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The operation isn't valid.
type WAFInvalidOperationException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFInvalidOperationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFInvalidOperationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFInvalidOperationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFInvalidOperationException"
}
return *e.ErrorCodeOverride
}
func (e *WAFInvalidOperationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The operation failed because WAF didn't recognize a parameter in the request.
// For example:
// - You specified a parameter name or value that isn't valid.
// - Your nested statement isn't valid. You might have tried to nest a statement
// that can’t be nested.
// - You tried to update a WebACL with a DefaultAction that isn't among the types
// available at DefaultAction .
// - Your request references an ARN that is malformed, or corresponds to a
// resource with which a web ACL can't be associated.
type WAFInvalidParameterException struct {
Message *string
ErrorCodeOverride *string
Field ParameterExceptionField
Parameter *string
Reason *string
noSmithyDocumentSerde
}
func (e *WAFInvalidParameterException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFInvalidParameterException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFInvalidParameterException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFInvalidParameterException"
}
return *e.ErrorCodeOverride
}
func (e *WAFInvalidParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The operation failed because the specified policy isn't in the proper format.
// The policy specifications must conform to the following:
// - The policy must be composed using IAM Policy version 2012-10-17.
// - The policy must include specifications for Effect , Action , and Principal .
// - Effect must specify Allow .
// - 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.
//
// For more information, see IAM Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)
// .
type WAFInvalidPermissionPolicyException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFInvalidPermissionPolicyException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFInvalidPermissionPolicyException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFInvalidPermissionPolicyException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFInvalidPermissionPolicyException"
}
return *e.ErrorCodeOverride
}
func (e *WAFInvalidPermissionPolicyException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// WAF couldn’t perform the operation because the resource that you requested
// isn’t valid. Check the resource, and try again.
type WAFInvalidResourceException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFInvalidResourceException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFInvalidResourceException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFInvalidResourceException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFInvalidResourceException"
}
return *e.ErrorCodeOverride
}
func (e *WAFInvalidResourceException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// WAF couldn’t perform the operation because you exceeded your resource limit.
// For example, the maximum number of WebACL objects that you can create for an
// Amazon Web Services account. For more information, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html)
// in the WAF Developer Guide.
type WAFLimitsExceededException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFLimitsExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFLimitsExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFLimitsExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFLimitsExceededException"
}
return *e.ErrorCodeOverride
}
func (e *WAFLimitsExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The operation failed because you don't have the permissions that your logging
// configuration requires. For information, see Logging web ACL traffic information (https://docs.aws.amazon.com/waf/latest/developerguide/logging.html)
// in the WAF Developer Guide.
type WAFLogDestinationPermissionIssueException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFLogDestinationPermissionIssueException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFLogDestinationPermissionIssueException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFLogDestinationPermissionIssueException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFLogDestinationPermissionIssueException"
}
return *e.ErrorCodeOverride
}
func (e *WAFLogDestinationPermissionIssueException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// WAF couldn’t perform the operation because your resource doesn't exist. If
// you've just created a resource that you're using in this operation, you might
// just need to wait a few minutes. It can take from a few seconds to a number of
// minutes for changes to propagate.
type WAFNonexistentItemException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFNonexistentItemException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFNonexistentItemException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFNonexistentItemException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFNonexistentItemException"
}
return *e.ErrorCodeOverride
}
func (e *WAFNonexistentItemException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// WAF couldn’t save your changes because you tried to update or delete a resource
// that has changed since you last retrieved it. Get the resource again, make any
// changes you need to make to the new copy, and retry your operation.
type WAFOptimisticLockException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFOptimisticLockException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFOptimisticLockException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFOptimisticLockException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFOptimisticLockException"
}
return *e.ErrorCodeOverride
}
func (e *WAFOptimisticLockException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// WAF is not able to access the service linked role. This can be caused by a
// previous PutLoggingConfiguration request, which can lock the service linked
// role for about 20 seconds. Please try your request again. The service linked
// role can also be locked by a previous DeleteServiceLinkedRole request, which
// can lock the role for 15 minutes or more. If you recently made a call to
// DeleteServiceLinkedRole , wait at least 15 minutes and try the request again. If
// you receive this same exception again, you will have to wait additional time
// until the role is unlocked.
type WAFServiceLinkedRoleErrorException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFServiceLinkedRoleErrorException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFServiceLinkedRoleErrorException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFServiceLinkedRoleErrorException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFServiceLinkedRoleErrorException"
}
return *e.ErrorCodeOverride
}
func (e *WAFServiceLinkedRoleErrorException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// You tried to use a managed rule group that's available by subscription, but you
// aren't subscribed to it yet.
type WAFSubscriptionNotFoundException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFSubscriptionNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFSubscriptionNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFSubscriptionNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFSubscriptionNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *WAFSubscriptionNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// An error occurred during the tagging operation. Retry your request.
type WAFTagOperationException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFTagOperationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFTagOperationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFTagOperationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFTagOperationException"
}
return *e.ErrorCodeOverride
}
func (e *WAFTagOperationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// WAF couldn’t perform your tagging operation because of an internal error. Retry
// your request.
type WAFTagOperationInternalErrorException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFTagOperationInternalErrorException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFTagOperationInternalErrorException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFTagOperationInternalErrorException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFTagOperationInternalErrorException"
}
return *e.ErrorCodeOverride
}
func (e *WAFTagOperationInternalErrorException) ErrorFault() smithy.ErrorFault {
return smithy.FaultServer
}
// WAF couldn’t retrieve a resource that you specified for this operation. If
// you've just created a resource that you're using in this operation, you might
// just need to wait a few minutes. It can take from a few seconds to a number of
// minutes for changes to propagate. Verify the resources that you are specifying
// in your request parameters and then retry the operation.
type WAFUnavailableEntityException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFUnavailableEntityException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFUnavailableEntityException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFUnavailableEntityException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFUnavailableEntityException"
}
return *e.ErrorCodeOverride
}
func (e *WAFUnavailableEntityException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The rule that you've named doesn't aggregate solely on the IP address or solely
// on the forwarded IP address. This call is only available for rate-based rules
// with an AggregateKeyType setting of IP or FORWARDED_IP .
type WAFUnsupportedAggregateKeyTypeException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *WAFUnsupportedAggregateKeyTypeException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *WAFUnsupportedAggregateKeyTypeException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *WAFUnsupportedAggregateKeyTypeException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "WAFUnsupportedAggregateKeyTypeException"
}
return *e.ErrorCodeOverride
}
func (e *WAFUnsupportedAggregateKeyTypeException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
| 578 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
"time"
)
// A single action condition for a Condition in a logging filter.
type ActionCondition struct {
// The action setting that a log record must contain in order to meet the
// condition. This is the action that WAF applied to the web request. For rule
// groups, this is either the configured rule action setting, or if you've applied
// a rule action override to the rule, it's the override action. The value
// EXCLUDED_AS_COUNT matches on excluded rules and also on rules that have a rule
// action override of Count.
//
// This member is required.
Action ActionValue
noSmithyDocumentSerde
}
// The name of a field in the request payload that contains part or all of your
// customer's primary physical address. This data type is used in the
// RequestInspectionACFP data type.
type AddressField struct {
// The name of a single primary address field. How you specify the address fields
// depends on the request inspection payload type.
// - For JSON payloads, specify the field identifiers in JSON pointer syntax.
// For information about the JSON Pointer syntax, see the Internet Engineering Task
// Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901)
// . For example, for the JSON payload { "form": { "primaryaddressline1":
// "THE_ADDRESS1", "primaryaddressline2": "THE_ADDRESS2", "primaryaddressline3":
// "THE_ADDRESS3" } } , the address field idenfiers are /form/primaryaddressline1
// , /form/primaryaddressline2 , and /form/primaryaddressline3 .
// - For form encoded payload types, use the HTML form names. For example, for
// an HTML form with input elements named primaryaddressline1 ,
// primaryaddressline2 , and primaryaddressline3 , the address fields identifiers
// are primaryaddressline1 , primaryaddressline2 , and primaryaddressline3 .
//
// This member is required.
Identifier *string
noSmithyDocumentSerde
}
// Inspect all of the elements that WAF has parsed and extracted from the web
// request component that you've identified in your FieldToMatch specifications.
// This is used in the FieldToMatch specification for some web request component
// types. JSON specification: "All": {}
type All struct {
noSmithyDocumentSerde
}
// Specifies that WAF should allow the request and optionally defines additional
// custom handling for the request. This is used in the context of other settings,
// for example to specify values for RuleAction and web ACL DefaultAction .
type AllowAction struct {
// Defines custom handling for the web request. For information about customizing
// web requests and responses, see Customizing web requests and responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html)
// in the WAF Developer Guide.
CustomRequestHandling *CustomRequestHandling
noSmithyDocumentSerde
}
// Inspect all query arguments of the web request. This is used in the FieldToMatch
// specification for some web request component types. JSON specification:
// "AllQueryArguments": {}
type AllQueryArguments struct {
noSmithyDocumentSerde
}
// A logical rule statement used to combine other rule statements with AND logic.
// You provide more than one Statement within the AndStatement .
type AndStatement struct {
// The statements to combine with AND logic. You can use any statements that can
// be nested.
//
// This member is required.
Statements []Statement
noSmithyDocumentSerde
}
// Information for a single API key. API keys are required for the integration of
// the CAPTCHA API in your JavaScript client applications. The API lets you
// customize the placement and characteristics of the CAPTCHA puzzle for your end
// users. For more information about the CAPTCHA JavaScript integration, see WAF
// client application integration (https://docs.aws.amazon.com/waf/latest/developerguide/waf-application-integration.html)
// in the WAF Developer Guide.
type APIKeySummary struct {
// The generated, encrypted API key. You can copy this for use in your JavaScript
// CAPTCHA integration.
APIKey *string
// The date and time that the key was created.
CreationTimestamp *time.Time
// The token domains that are defined in this API key.
TokenDomains []string
// Internal value used by WAF to manage the key.
Version int32
noSmithyDocumentSerde
}
// Specifies custom configurations for the associations between the web ACL and
// protected resources. Use this to customize the maximum size of the request body
// that your protected CloudFront distributions forward to WAF for inspection. The
// default is 16 KB (16,384 kilobytes). You are charged additional fees when your
// protected resources forward body sizes that are larger than the default. For
// more information, see WAF Pricing (http://aws.amazon.com/waf/pricing/) .
type AssociationConfig struct {
// Customizes the maximum size of the request body that your protected CloudFront
// distributions forward to WAF for inspection. The default size is 16 KB (16,384
// kilobytes). You are charged additional fees when your protected resources
// forward body sizes that are larger than the default. For more information, see
// WAF Pricing (http://aws.amazon.com/waf/pricing/) .
RequestBody map[string]RequestBodyAssociatedResourceTypeConfig
noSmithyDocumentSerde
}
// Details for your use of the account creation fraud prevention managed rule
// group, AWSManagedRulesACFPRuleSet . This configuration is used in
// ManagedRuleGroupConfig .
type AWSManagedRulesACFPRuleSet struct {
// The path of the account creation endpoint for your application. This is the
// page on your website that accepts the completed registration form for a new
// user. This page must accept POST requests. For example, for the URL
// https://example.com/web/signup , you would provide the path /web/signup .
//
// This member is required.
CreationPath *string
// The path of the account registration endpoint for your application. This is the
// page on your website that presents the registration form to new users. This page
// must accept GET text/html requests. For example, for the URL
// https://example.com/web/register , you would provide the path /web/register .
//
// This member is required.
RegistrationPagePath *string
// The criteria for inspecting account creation requests, used by the ACFP rule
// group to validate and track account creation attempts.
//
// This member is required.
RequestInspection *RequestInspectionACFP
// Allow the use of regular expressions in the registration page path and the
// account creation path.
EnableRegexInPath bool
// The criteria for inspecting responses to account creation requests, used by the
// ACFP rule group to track account creation success rates. Response inspection is
// available only in web ACLs that protect Amazon CloudFront distributions. The
// ACFP rule group evaluates the responses that your protected resources send back
// to client account creation attempts, keeping count of successful and failed
// attempts from each IP address and client session. Using this information, the
// rule group labels and mitigates requests from client sessions and IP addresses
// that have had too many successful account creation attempts in a short amount of
// time.
ResponseInspection *ResponseInspection
noSmithyDocumentSerde
}
// Details for your use of the account takeover prevention managed rule group,
// AWSManagedRulesATPRuleSet . This configuration is used in ManagedRuleGroupConfig
// .
type AWSManagedRulesATPRuleSet struct {
// The path of the login endpoint for your application. For example, for the URL
// https://example.com/web/login , you would provide the path /web/login . The rule
// group inspects only HTTP POST requests to your specified login endpoint.
//
// This member is required.
LoginPath *string
// Allow the use of regular expressions in the login page path.
EnableRegexInPath bool
// The criteria for inspecting login requests, used by the ATP rule group to
// validate credentials usage.
RequestInspection *RequestInspection
// The criteria for inspecting responses to login requests, used by the ATP rule
// group to track login failure rates. Response inspection is available only in web
// ACLs that protect Amazon CloudFront distributions. The ATP rule group evaluates
// the responses that your protected resources send back to client login attempts,
// keeping count of successful and failed attempts for each IP address and client
// session. Using this information, the rule group labels and mitigates requests
// from client sessions and IP addresses that have had too many failed login
// attempts in a short amount of time.
ResponseInspection *ResponseInspection
noSmithyDocumentSerde
}
// Details for your use of the Bot Control managed rule group,
// AWSManagedRulesBotControlRuleSet . This configuration is used in
// ManagedRuleGroupConfig .
type AWSManagedRulesBotControlRuleSet struct {
// The inspection level to use for the Bot Control rule group. The common level is
// the least expensive. The targeted level includes all common level rules and adds
// rules with more advanced inspection criteria. For details, see WAF Bot Control
// rule group (https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-bot.html)
// in the WAF Developer Guide.
//
// This member is required.
InspectionLevel InspectionLevel
noSmithyDocumentSerde
}
// Specifies that WAF should block the request and optionally defines additional
// custom handling for the response to the web request. This is used in the context
// of other settings, for example to specify values for RuleAction and web ACL
// DefaultAction .
type BlockAction struct {
// Defines a custom response for the web request. For information about
// customizing web requests and responses, see Customizing web requests and
// responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html)
// in the WAF Developer Guide.
CustomResponse *CustomResponse
noSmithyDocumentSerde
}
// Inspect the body of the web request. The body immediately follows the request
// headers. This is used to indicate the web request component to inspect, in the
// FieldToMatch specification.
type Body struct {
// What WAF should do if the body is larger than WAF can inspect. WAF does not
// support inspecting the entire contents of the web request body if the body
// exceeds the limit for the resource type. If the body is larger than the limit,
// the underlying host service only forwards the contents that are below the limit
// to WAF for inspection. The default limit is 8 KB (8,192 kilobytes) for regional
// resources and 16 KB (16,384 kilobytes) for CloudFront distributions. For
// CloudFront distributions, you can increase the limit in the web ACL
// AssociationConfig , for additional processing fees. The options for oversize
// handling are the following:
// - CONTINUE - Inspect the available body contents normally, according to the
// rule inspection criteria.
// - MATCH - Treat the web request as matching the rule statement. WAF applies
// the rule action to the request.
// - NO_MATCH - Treat the web request as not matching the rule statement.
// You can combine the MATCH or NO_MATCH settings for oversize handling with your
// rule and web ACL action settings, so that you block any request whose body is
// over the limit. Default: CONTINUE
OversizeHandling OversizeHandling
noSmithyDocumentSerde
}
// A rule statement that defines a string match search for WAF to apply to web
// requests. The byte match statement provides the bytes to search for, the
// location in requests that you want WAF to search, and other settings. The bytes
// to search for are typically a string that corresponds with ASCII characters. In
// the WAF console and the developer guide, this is called a string match
// statement.
type ByteMatchStatement struct {
// The part of the web request that you want WAF to inspect.
//
// This member is required.
FieldToMatch *FieldToMatch
// The area within the portion of the web request that you want WAF to search for
// SearchString . Valid values include the following: CONTAINS The specified part
// of the web request must include the value of SearchString , but the location
// doesn't matter. CONTAINS_WORD The specified part of the web request must include
// the value of SearchString , and SearchString must contain only alphanumeric
// characters or underscore (A-Z, a-z, 0-9, or _). In addition, SearchString must
// be a word, which means that both of the following are true:
// - SearchString is at the beginning of the specified part of the web request or
// is preceded by a character other than an alphanumeric character or underscore
// (_). Examples include the value of a header and ;BadBot .
// - SearchString is at the end of the specified part of the web request or is
// followed by a character other than an alphanumeric character or underscore (_),
// for example, BadBot; and -BadBot; .
// EXACTLY The value of the specified part of the web request must exactly match
// the value of SearchString . STARTS_WITH The value of SearchString must appear
// at the beginning of the specified part of the web request. ENDS_WITH The value
// of SearchString must appear at the end of the specified part of the web request.
//
// This member is required.
PositionalConstraint PositionalConstraint
// A string value that you want WAF to search for. WAF searches only in the part
// of web requests that you designate for inspection in FieldToMatch . The maximum
// length of the value is 200 bytes. Valid values depend on the component that you
// specify for inspection in FieldToMatch :
// - Method : The HTTP method that you want WAF to search for. This indicates the
// type of operation specified in the request.
// - UriPath : The value that you want WAF to search for in the URI path, for
// example, /images/daily-ad.jpg .
// - HeaderOrder : The comma-separated list of header names to match for. WAF
// creates a string that contains the ordered list of header names, from the
// headers in the web request, and then matches against that string.
// If SearchString includes alphabetic characters A-Z and a-z, note that the value
// is case sensitive. If you're using the WAF API Specify a base64-encoded version
// of the value. The maximum length of the value before you base64-encode it is 200
// bytes. For example, suppose the value of Type is HEADER and the value of Data
// is User-Agent . If you want to search the User-Agent header for the value BadBot
// , you base64-encode BadBot using MIME base64-encoding and include the resulting
// value, QmFkQm90 , in the value of SearchString . If you're using the CLI or one
// of the Amazon Web Services SDKs The value that you want WAF to search for. The
// SDK automatically base64 encodes the value.
//
// This member is required.
SearchString []byte
// Text transformations eliminate some of the unusual formatting that attackers
// use in web requests in an effort to bypass detection. Text transformations are
// used in rule match statements, to transform the FieldToMatch request component
// before inspecting it, and they're used in rate-based rule statements, to
// transform request components before using them as custom aggregation keys. If
// you specify one or more transformations to apply, WAF performs all
// transformations on the specified content, starting from the lowest priority
// setting, and then uses the component contents.
//
// This member is required.
TextTransformations []TextTransformation
noSmithyDocumentSerde
}
// Specifies that WAF should run a CAPTCHA check against the request:
// - If the request includes a valid, unexpired CAPTCHA token, WAF applies any
// custom request handling and labels that you've configured and then allows the
// web request inspection to proceed to the next rule, similar to a CountAction .
// - If the request doesn't include a valid, unexpired token, WAF discontinues
// the web ACL evaluation of the request and blocks it from going to its intended
// destination. WAF generates a response that it sends back to the client, which
// includes the following:
// - The header x-amzn-waf-action with a value of captcha .
// - The HTTP status code 405 Method Not Allowed .
// - If the request contains an Accept header with a value of text/html , the
// response includes a CAPTCHA JavaScript page interstitial.
//
// You can configure the expiration time in the CaptchaConfig ImmunityTimeProperty
// setting at the rule and web ACL level. The rule setting overrides the web ACL
// setting. This action option is available for rules. It isn't available for web
// ACL default actions.
type CaptchaAction struct {
// Defines custom handling for the web request, used when the CAPTCHA inspection
// determines that the request's token is valid and unexpired. For information
// about customizing web requests and responses, see Customizing web requests and
// responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html)
// in the WAF Developer Guide.
CustomRequestHandling *CustomRequestHandling
noSmithyDocumentSerde
}
// Specifies how WAF should handle CAPTCHA evaluations. This is available at the
// web ACL level and in each rule.
type CaptchaConfig struct {
// Determines how long a CAPTCHA timestamp in the token remains valid after the
// client successfully solves a CAPTCHA puzzle.
ImmunityTimeProperty *ImmunityTimeProperty
noSmithyDocumentSerde
}
// The result from the inspection of the web request for a valid CAPTCHA token.
type CaptchaResponse struct {
// The reason for failure, populated when the evaluation of the token fails.
FailureReason FailureReason
// The HTTP response code indicating the status of the CAPTCHA token in the web
// request. If the token is missing, invalid, or expired, this code is 405 Method
// Not Allowed .
ResponseCode *int32
// The time that the CAPTCHA was last solved for the supplied token.
SolveTimestamp *int64
noSmithyDocumentSerde
}
// Specifies that WAF should run a Challenge check against the request to verify
// that the request is coming from a legitimate client session:
// - If the request includes a valid, unexpired challenge token, WAF applies any
// custom request handling and labels that you've configured and then allows the
// web request inspection to proceed to the next rule, similar to a CountAction .
// - If the request doesn't include a valid, unexpired challenge token, WAF
// discontinues the web ACL evaluation of the request and blocks it from going to
// its intended destination. WAF then generates a challenge response that it sends
// back to the client, which includes the following:
// - The header x-amzn-waf-action with a value of challenge .
// - The HTTP status code 202 Request Accepted .
// - If the request contains an Accept header with a value of text/html , the
// response includes a JavaScript page interstitial with a challenge script.
// Challenges run silent browser interrogations in the background, and don't
// generally affect the end user experience. A challenge enforces token acquisition
// using an interstitial JavaScript challenge that inspects the client session for
// legitimate behavior. The challenge blocks bots or at least increases the cost of
// operating sophisticated bots. After the client session successfully responds to
// the challenge, it receives a new token from WAF, which the challenge script uses
// to resubmit the original request.
//
// You can configure the expiration time in the ChallengeConfig ImmunityTimeProperty
// setting at the rule and web ACL level. The rule setting overrides the web ACL
// setting. This action option is available for rules. It isn't available for web
// ACL default actions.
type ChallengeAction struct {
// Defines custom handling for the web request, used when the challenge inspection
// determines that the request's token is valid and unexpired. For information
// about customizing web requests and responses, see Customizing web requests and
// responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html)
// in the WAF Developer Guide.
CustomRequestHandling *CustomRequestHandling
noSmithyDocumentSerde
}
// Specifies how WAF should handle Challenge evaluations. This is available at the
// web ACL level and in each rule.
type ChallengeConfig struct {
// Determines how long a challenge timestamp in the token remains valid after the
// client successfully responds to a challenge.
ImmunityTimeProperty *ImmunityTimeProperty
noSmithyDocumentSerde
}
// The result from the inspection of the web request for a valid challenge token.
type ChallengeResponse struct {
// The reason for failure, populated when the evaluation of the token fails.
FailureReason FailureReason
// The HTTP response code indicating the status of the challenge token in the web
// request. If the token is missing, invalid, or expired, this code is 202 Request
// Accepted .
ResponseCode *int32
// The time that the challenge was last solved for the supplied token.
SolveTimestamp *int64
noSmithyDocumentSerde
}
// A single match condition for a Filter .
type Condition struct {
// A single action condition. This is the action setting that a log record must
// contain in order to meet the condition.
ActionCondition *ActionCondition
// A single label name condition. This is the fully qualified label name that a
// log record must contain in order to meet the condition. Fully qualified labels
// have a prefix, optional namespaces, and label name. The prefix identifies the
// rule group or web ACL context of the rule that added the label.
LabelNameCondition *LabelNameCondition
noSmithyDocumentSerde
}
// The filter to use to identify the subset of cookies to inspect in a web
// request. You must specify exactly one setting: either All , IncludedCookies , or
// ExcludedCookies . Example JSON: "MatchPattern": { "IncludedCookies":
// {"KeyToInclude1", "KeyToInclude2", "KeyToInclude3"} }
type CookieMatchPattern struct {
// Inspect all cookies.
All *All
// Inspect only the cookies whose keys don't match any of the strings specified
// here.
ExcludedCookies []string
// Inspect only the cookies that have a key that matches one of the strings
// specified here.
IncludedCookies []string
noSmithyDocumentSerde
}
// Inspect the cookies in the web request. You can specify the parts of the
// cookies to inspect and you can narrow the set of cookies to inspect by including
// or excluding specific keys. This is used to indicate the web request component
// to inspect, in the FieldToMatch specification. Example JSON: "Cookies": {
// "MatchPattern": { "All": {} }, "MatchScope": "KEY", "OversizeHandling": "MATCH"
// }
type Cookies struct {
// The filter to use to identify the subset of cookies to inspect in a web
// request. You must specify exactly one setting: either All , IncludedCookies , or
// ExcludedCookies . Example JSON: "MatchPattern": { "IncludedCookies":
// {"KeyToInclude1", "KeyToInclude2", "KeyToInclude3"} }
//
// This member is required.
MatchPattern *CookieMatchPattern
// The parts of the cookies to inspect with the rule inspection criteria. If you
// specify All , WAF inspects both keys and values.
//
// This member is required.
MatchScope MapMatchScope
// What WAF should do if the cookies of the request are more numerous or larger
// than WAF can inspect. WAF does not support inspecting the entire contents of
// request cookies when they exceed 8 KB (8192 bytes) or 200 total cookies. The
// underlying host service forwards a maximum of 200 cookies and at most 8 KB of
// cookie contents to WAF. The options for oversize handling are the following:
// - CONTINUE - Inspect the available cookies normally, according to the rule
// inspection criteria.
// - MATCH - Treat the web request as matching the rule statement. WAF applies
// the rule action to the request.
// - NO_MATCH - Treat the web request as not matching the rule statement.
//
// This member is required.
OversizeHandling OversizeHandling
noSmithyDocumentSerde
}
// Specifies that WAF should count the request. Optionally defines additional
// custom handling for the request. This is used in the context of other settings,
// for example to specify values for RuleAction and web ACL DefaultAction .
type CountAction struct {
// Defines custom handling for the web request. For information about customizing
// web requests and responses, see Customizing web requests and responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html)
// in the WAF Developer Guide.
CustomRequestHandling *CustomRequestHandling
noSmithyDocumentSerde
}
// A custom header for custom request and response handling. This is used in
// CustomResponse and CustomRequestHandling .
type CustomHTTPHeader struct {
// The name of the custom header. For custom request header insertion, when WAF
// inserts the header into the request, it prefixes this name x-amzn-waf- , to
// avoid confusion with the headers that are already in the request. For example,
// for the header name sample , WAF inserts the header x-amzn-waf-sample .
//
// This member is required.
Name *string
// The value of the custom header.
//
// This member is required.
Value *string
noSmithyDocumentSerde
}
// Custom request handling behavior that inserts custom headers into a web
// request. You can add custom request handling for WAF to use when the rule action
// doesn't block the request. For example, CaptchaAction for requests with valid t
// okens, and AllowAction . For information about customizing web requests and
// responses, see Customizing web requests and responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html)
// in the WAF Developer Guide.
type CustomRequestHandling struct {
// The HTTP headers to insert into the request. Duplicate header names are not
// allowed. For information about the limits on count and size for custom request
// and response settings, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html)
// in the WAF Developer Guide.
//
// This member is required.
InsertHeaders []CustomHTTPHeader
noSmithyDocumentSerde
}
// A custom response to send to the client. You can define a custom response for
// rule actions and default web ACL actions that are set to BlockAction . For
// information about customizing web requests and responses, see Customizing web
// requests and responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html)
// in the WAF Developer Guide.
type CustomResponse struct {
// The HTTP status code to return to the client. For a list of status codes that
// you can use in your custom responses, see Supported status codes for custom
// response (https://docs.aws.amazon.com/waf/latest/developerguide/customizing-the-response-status-codes.html)
// in the WAF Developer Guide.
//
// This member is required.
ResponseCode *int32
// References the response body that you want WAF to return to the web request
// client. You can define a custom response for a rule action or a default web ACL
// action that is set to block. To do this, you first define the response body key
// and value in the CustomResponseBodies setting for the WebACL or RuleGroup where
// you want to use it. Then, in the rule action or web ACL default action
// BlockAction setting, you reference the response body using this key.
CustomResponseBodyKey *string
// The HTTP headers to use in the response. Duplicate header names are not
// allowed. For information about the limits on count and size for custom request
// and response settings, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html)
// in the WAF Developer Guide.
ResponseHeaders []CustomHTTPHeader
noSmithyDocumentSerde
}
// The response body to use in a custom response to a web request. This is
// referenced by key from CustomResponse CustomResponseBodyKey .
type CustomResponseBody struct {
// The payload of the custom response. You can use JSON escape strings in JSON
// content. To do this, you must specify JSON content in the ContentType setting.
// For information about the limits on count and size for custom request and
// response settings, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html)
// in the WAF Developer Guide.
//
// This member is required.
Content *string
// The type of content in the payload that you are defining in the Content string.
//
// This member is required.
ContentType ResponseContentType
noSmithyDocumentSerde
}
// In a WebACL , this is the action that you want WAF to perform when a web request
// doesn't match any of the rules in the WebACL . The default action must be a
// terminating action.
type DefaultAction struct {
// Specifies that WAF should allow requests by default.
Allow *AllowAction
// Specifies that WAF should block requests by default.
Block *BlockAction
noSmithyDocumentSerde
}
// The name of the field in the request payload that contains your customer's
// email. This data type is used in the RequestInspectionACFP data type.
type EmailField struct {
// The name of the email field. How you specify this depends on the request
// inspection payload type.
// - For JSON payloads, specify the field name in JSON pointer syntax. For
// information about the JSON Pointer syntax, see the Internet Engineering Task
// Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901)
// . For example, for the JSON payload { "form": { "email": "THE_EMAIL" } } , the
// email field specification is /form/email .
// - For form encoded payload types, use the HTML form names. For example, for
// an HTML form with the input element named email1 , the email field
// specification is email1 .
//
// This member is required.
Identifier *string
noSmithyDocumentSerde
}
// Specifies a single rule in a rule group whose action you want to override to
// Count . Instead of this option, use RuleActionOverrides . It accepts any valid
// action setting, including Count .
type ExcludedRule struct {
// The name of the rule whose action you want to override to Count .
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
// The part of the web request that you want WAF to inspect. Include the single
// FieldToMatch type that you want to inspect, with additional specifications as
// needed, according to the type. You specify a single request component in
// FieldToMatch for each rule statement that requires it. To inspect more than one
// component of the web request, create a separate rule statement for each
// component. Example JSON for a QueryString field to match: "FieldToMatch": {
// "QueryString": {} } Example JSON for a Method field to match specification:
// "FieldToMatch": { "Method": { "Name": "DELETE" } }
type FieldToMatch struct {
// Inspect all query arguments.
AllQueryArguments *AllQueryArguments
// Inspect the request body as plain text. The request body immediately follows
// the request headers. This is the part of a request that contains any additional
// data that you want to send to your web server as the HTTP request body, such as
// data from a form. A limited amount of the request body is forwarded to WAF for
// inspection by the underlying host service. For regional resources, the limit is
// 8 KB (8,192 kilobytes) and for CloudFront distributions, the limit is 16 KB
// (16,384 kilobytes). For CloudFront distributions, you can increase the limit in
// the web ACL's AssociationConfig , for additional processing fees. For
// information about how to handle oversized request bodies, see the Body object
// configuration.
Body *Body
// Inspect the request cookies. You must configure scope and pattern matching
// filters in the Cookies object, to define the set of cookies and the parts of
// the cookies that WAF inspects. Only the first 8 KB (8192 bytes) of a request's
// cookies and only the first 200 cookies are forwarded to WAF for inspection by
// the underlying host service. You must configure how to handle any oversize
// cookie content in the Cookies object. WAF applies the pattern matching filters
// to the cookies that it receives from the underlying host service.
Cookies *Cookies
// Inspect a string containing the list of the request's header names, ordered as
// they appear in the web request that WAF receives for inspection. WAF generates
// the string and then uses that as the field to match component in its inspection.
// WAF separates the header names in the string using colons and no added spaces,
// for example host:user-agent:accept:authorization:referer .
HeaderOrder *HeaderOrder
// Inspect the request headers. You must configure scope and pattern matching
// filters in the Headers object, to define the set of headers to and the parts of
// the headers that WAF inspects. Only the first 8 KB (8192 bytes) of a request's
// headers and only the first 200 headers are forwarded to WAF for inspection by
// the underlying host service. You must configure how to handle any oversize
// header content in the Headers object. WAF applies the pattern matching filters
// to the headers that it receives from the underlying host service.
Headers *Headers
// Inspect the request body as JSON. The request body immediately follows the
// request headers. This is the part of a request that contains any additional data
// that you want to send to your web server as the HTTP request body, such as data
// from a form. A limited amount of the request body is forwarded to WAF for
// inspection by the underlying host service. For regional resources, the limit is
// 8 KB (8,192 kilobytes) and for CloudFront distributions, the limit is 16 KB
// (16,384 kilobytes). For CloudFront distributions, you can increase the limit in
// the web ACL's AssociationConfig , for additional processing fees. For
// information about how to handle oversized request bodies, see the JsonBody
// object configuration.
JsonBody *JsonBody
// Inspect the HTTP method. The method indicates the type of operation that the
// request is asking the origin to perform.
Method *Method
// Inspect the query string. This is the part of a URL that appears after a ?
// character, if any.
QueryString *QueryString
// Inspect a single header. Provide the name of the header to inspect, for
// example, User-Agent or Referer . This setting isn't case sensitive. Example
// JSON: "SingleHeader": { "Name": "haystack" } Alternately, you can filter and
// inspect all headers with the Headers FieldToMatch setting.
SingleHeader *SingleHeader
// Inspect a single query argument. Provide the name of the query argument to
// inspect, such as UserName or SalesRegion. The name can be up to 30 characters
// long and isn't case sensitive. Example JSON: "SingleQueryArgument": { "Name":
// "myArgument" }
SingleQueryArgument *SingleQueryArgument
// Inspect the request URI path. This is the part of the web request that
// identifies a resource, for example, /images/daily-ad.jpg .
UriPath *UriPath
noSmithyDocumentSerde
}
// A single logging filter, used in LoggingFilter .
type Filter struct {
// How to handle logs that satisfy the filter's conditions and requirement.
//
// This member is required.
Behavior FilterBehavior
// Match conditions for the filter.
//
// This member is required.
Conditions []Condition
// Logic to apply to the filtering conditions. You can specify that, in order to
// satisfy the filter, a log must match all conditions or must match at least one
// condition.
//
// This member is required.
Requirement FilterRequirement
noSmithyDocumentSerde
}
// A rule group that's defined for an Firewall Manager WAF policy.
type FirewallManagerRuleGroup struct {
// The processing guidance for an Firewall Manager rule. This is like a regular
// rule Statement , but it can only contain a rule group reference.
//
// This member is required.
FirewallManagerStatement *FirewallManagerStatement
// The name of the rule group. You cannot change the name of a rule group after
// you create it.
//
// This member is required.
Name *string
// The action to use in the place of the action that results from the rule group
// evaluation. Set the override action to none to leave the result of the rule
// group alone. Set it to count to override the result to count only. You can only
// use this for rule statements that reference a rule group, like
// RuleGroupReferenceStatement and ManagedRuleGroupStatement . This option is
// usually set to none. It does not affect how the rules in the rule group are
// evaluated. If you want the rules in the rule group to only count matches, do not
// use this and instead use the rule action override option, with Count action, in
// your rule group reference statement settings.
//
// This member is required.
OverrideAction *OverrideAction
// If you define more than one rule group in the first or last Firewall Manager
// rule groups, WAF evaluates each request against the rule groups in order,
// starting from the lowest priority setting. The priorities don't need to be
// consecutive, but they must all be different.
//
// This member is required.
Priority int32
// Defines and enables Amazon CloudWatch metrics and web request sample collection.
//
// This member is required.
VisibilityConfig *VisibilityConfig
noSmithyDocumentSerde
}
// The processing guidance for an Firewall Manager rule. This is like a regular
// rule Statement , but it can only contain a single rule group reference.
type FirewallManagerStatement struct {
// A statement used by Firewall Manager to run the rules that are defined in a
// managed rule group. This is managed by Firewall Manager for an Firewall Manager
// WAF policy.
ManagedRuleGroupStatement *ManagedRuleGroupStatement
// A statement used by Firewall Manager to run the rules that are defined in a
// rule group. This is managed by Firewall Manager for an Firewall Manager WAF
// policy.
RuleGroupReferenceStatement *RuleGroupReferenceStatement
noSmithyDocumentSerde
}
// The configuration for inspecting IP addresses in an HTTP header that you
// specify, instead of using the IP address that's reported by the web request
// origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify
// any header name. If the specified header isn't present in the request, WAF
// doesn't apply the rule to the web request at all. This configuration is used for
// GeoMatchStatement and RateBasedStatement . For IPSetReferenceStatement , use
// IPSetForwardedIPConfig instead. WAF only evaluates the first IP address found in
// the specified HTTP header.
type ForwardedIPConfig struct {
// The match status to assign to the web request if the request doesn't have a
// valid IP address in the specified position. If the specified header isn't
// present in the request, WAF doesn't apply the rule to the web request at all.
// You can specify the following fallback behaviors:
// - MATCH - Treat the web request as matching the rule statement. WAF applies
// the rule action to the request.
// - NO_MATCH - Treat the web request as not matching the rule statement.
//
// This member is required.
FallbackBehavior FallbackBehavior
// The name of the HTTP header to use for the IP address. For example, to use the
// X-Forwarded-For (XFF) header, set this to X-Forwarded-For . If the specified
// header isn't present in the request, WAF doesn't apply the rule to the web
// request at all.
//
// This member is required.
HeaderName *string
noSmithyDocumentSerde
}
// A rule statement that labels web requests by country and region and that
// matches against web requests based on country code. A geo match rule labels
// every request that it inspects regardless of whether it finds a match.
// - To manage requests only by country, you can use this statement by itself
// and specify the countries that you want to match against in the CountryCodes
// array.
// - Otherwise, configure your geo match rule with Count action so that it only
// labels requests. Then, add one or more label match rules to run after the geo
// match rule and configure them to match against the geographic labels and handle
// the requests as needed.
//
// WAF labels requests using the alpha-2 country and region codes from the
// International Organization for Standardization (ISO) 3166 standard. WAF
// determines the codes using either the IP address in the web request origin or,
// if you specify it, the address in the geo match ForwardedIPConfig . If you use
// the web request origin, the label formats are awswaf:clientip:geo:region:- and
// awswaf:clientip:geo:country: . If you use a forwarded IP address, the label
// formats are awswaf:forwardedip:geo:region:- and awswaf:forwardedip:geo:country:
// . For additional details, see Geographic match rule statement (https://docs.aws.amazon.com/waf/latest/developerguide/waf-rule-statement-type-geo-match.html)
// in the WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// .
type GeoMatchStatement struct {
// An array of two-character country codes that you want to match against, for
// example, [ "US", "CN" ] , from the alpha-2 country ISO codes of the ISO 3166
// international standard. When you use a geo match statement just for the region
// and country labels that it adds to requests, you still have to supply a country
// code for the rule to evaluate. In this case, you configure the rule to only
// count matching requests, but it will still generate logging and count metrics
// for any matches. You can reduce the logging and metrics that the rule produces
// by specifying a country that's unlikely to be a source of traffic to your site.
CountryCodes []CountryCode
// The configuration for inspecting IP addresses in an HTTP header that you
// specify, instead of using the IP address that's reported by the web request
// origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify
// any header name. If the specified header isn't present in the request, WAF
// doesn't apply the rule to the web request at all.
ForwardedIPConfig *ForwardedIPConfig
noSmithyDocumentSerde
}
// The filter to use to identify the subset of headers to inspect in a web
// request. You must specify exactly one setting: either All , IncludedHeaders , or
// ExcludedHeaders . Example JSON: "MatchPattern": { "ExcludedHeaders":
// {"KeyToExclude1", "KeyToExclude2"} }
type HeaderMatchPattern struct {
// Inspect all headers.
All *All
// Inspect only the headers whose keys don't match any of the strings specified
// here.
ExcludedHeaders []string
// Inspect only the headers that have a key that matches one of the strings
// specified here.
IncludedHeaders []string
noSmithyDocumentSerde
}
// Inspect a string containing the list of the request's header names, ordered as
// they appear in the web request that WAF receives for inspection. WAF generates
// the string and then uses that as the field to match component in its inspection.
// WAF separates the header names in the string using colons and no added spaces,
// for example host:user-agent:accept:authorization:referer .
type HeaderOrder struct {
// What WAF should do if the headers of the request are more numerous or larger
// than WAF can inspect. WAF does not support inspecting the entire contents of
// request headers when they exceed 8 KB (8192 bytes) or 200 total headers. The
// underlying host service forwards a maximum of 200 headers and at most 8 KB of
// header contents to WAF. The options for oversize handling are the following:
// - CONTINUE - Inspect the available headers normally, according to the rule
// inspection criteria.
// - MATCH - Treat the web request as matching the rule statement. WAF applies
// the rule action to the request.
// - NO_MATCH - Treat the web request as not matching the rule statement.
//
// This member is required.
OversizeHandling OversizeHandling
noSmithyDocumentSerde
}
// Inspect all headers in the web request. You can specify the parts of the
// headers to inspect and you can narrow the set of headers to inspect by including
// or excluding specific keys. This is used to indicate the web request component
// to inspect, in the FieldToMatch specification. If you want to inspect just the
// value of a single header, use the SingleHeader FieldToMatch setting instead.
// Example JSON: "Headers": { "MatchPattern": { "All": {} }, "MatchScope": "KEY",
// "OversizeHandling": "MATCH" }
type Headers struct {
// The filter to use to identify the subset of headers to inspect in a web
// request. You must specify exactly one setting: either All , IncludedHeaders , or
// ExcludedHeaders . Example JSON: "MatchPattern": { "ExcludedHeaders":
// {"KeyToExclude1", "KeyToExclude2"} }
//
// This member is required.
MatchPattern *HeaderMatchPattern
// The parts of the headers to match with the rule inspection criteria. If you
// specify All , WAF inspects both keys and values.
//
// This member is required.
MatchScope MapMatchScope
// What WAF should do if the headers of the request are more numerous or larger
// than WAF can inspect. WAF does not support inspecting the entire contents of
// request headers when they exceed 8 KB (8192 bytes) or 200 total headers. The
// underlying host service forwards a maximum of 200 headers and at most 8 KB of
// header contents to WAF. The options for oversize handling are the following:
// - CONTINUE - Inspect the available headers normally, according to the rule
// inspection criteria.
// - MATCH - Treat the web request as matching the rule statement. WAF applies
// the rule action to the request.
// - NO_MATCH - Treat the web request as not matching the rule statement.
//
// This member is required.
OversizeHandling OversizeHandling
noSmithyDocumentSerde
}
// Part of the response from GetSampledRequests . This is a complex type that
// appears as Headers in the response syntax. HTTPHeader contains the names and
// values of all of the headers that appear in one of the web requests.
type HTTPHeader struct {
// The name of the HTTP header.
Name *string
// The value of the HTTP header.
Value *string
noSmithyDocumentSerde
}
// Part of the response from GetSampledRequests . This is a complex type that
// appears as Request in the response syntax. HTTPRequest contains information
// about one of the web requests.
type HTTPRequest struct {
// The IP address that the request originated from. If the web ACL is associated
// with a CloudFront distribution, this is the value of one of the following fields
// in CloudFront access logs:
// - c-ip , if the viewer did not use an HTTP proxy or a load balancer to send
// the request
// - x-forwarded-for , if the viewer did use an HTTP proxy or a load balancer to
// send the request
ClientIP *string
// The two-letter country code for the country that the request originated from.
// For a current list of country codes, see the Wikipedia entry ISO 3166-1 alpha-2 (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
// .
Country *string
// The HTTP version specified in the sampled web request, for example, HTTP/1.1 .
HTTPVersion *string
// A complex type that contains the name and value for each header in the sampled
// web request.
Headers []HTTPHeader
// The HTTP method specified in the sampled web request.
Method *string
// The URI path of the request, which identifies the resource, for example,
// /images/daily-ad.jpg .
URI *string
noSmithyDocumentSerde
}
// Used for CAPTCHA and challenge token settings. Determines how long a CAPTCHA or
// challenge timestamp remains valid after WAF updates it for a successful CAPTCHA
// or challenge response.
type ImmunityTimeProperty struct {
// The amount of time, in seconds, that a CAPTCHA or challenge timestamp is
// considered valid by WAF. The default setting is 300. For the Challenge action,
// the minimum setting is 300.
//
// This member is required.
ImmunityTime *int64
noSmithyDocumentSerde
}
// Contains zero or more IP addresses or blocks of IP addresses specified in
// Classless Inter-Domain Routing (CIDR) notation. WAF supports all IPv4 and IPv6
// CIDR ranges except for /0. For information about CIDR notation, see the
// Wikipedia entry Classless Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
// . WAF assigns an ARN to each IPSet that you create. To use an IP set in a rule,
// you provide the ARN to the Rule statement IPSetReferenceStatement .
type IPSet struct {
// The Amazon Resource Name (ARN) of the entity.
//
// This member is required.
ARN *string
// Contains an array of strings that specifies zero or more IP addresses or blocks
// of IP addresses. All addresses must be specified using Classless Inter-Domain
// Routing (CIDR) notation. WAF supports all IPv4 and IPv6 CIDR ranges except for
// /0 . Example address strings:
// - To configure WAF to allow, block, or count requests that originated from
// the IP address 192.0.2.44, specify 192.0.2.44/32 .
// - To configure WAF to allow, block, or count requests that originated from IP
// addresses from 192.0.2.0 to 192.0.2.255, specify 192.0.2.0/24 .
// - To configure WAF to allow, block, or count requests that originated from
// the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify
// 1111:0000:0000:0000:0000:0000:0000:0111/128 .
// - To configure WAF to allow, block, or count requests that originated from IP
// addresses 1111:0000:0000:0000:0000:0000:0000:0000 to
// 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify
// 1111:0000:0000:0000:0000:0000:0000:0000/64 .
// For more information about CIDR notation, see the Wikipedia entry Classless
// Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
// . Example JSON Addresses specifications:
// - Empty array: "Addresses": []
// - Array with one address: "Addresses": ["192.0.2.44/32"]
// - Array with three addresses: "Addresses": ["192.0.2.44/32", "192.0.2.0/24",
// "192.0.0.0/16"]
// - INVALID specification: "Addresses": [""] INVALID
//
// This member is required.
Addresses []string
// The version of the IP addresses, either IPV4 or IPV6 .
//
// This member is required.
IPAddressVersion IPAddressVersion
// A unique identifier for the set. This ID is returned in the responses to create
// and list commands. You provide it to operations like update and delete.
//
// This member is required.
Id *string
// The name of the IP set. You cannot change the name of an IPSet after you create
// it.
//
// This member is required.
Name *string
// A description of the IP set that helps with identification.
Description *string
noSmithyDocumentSerde
}
// The configuration for inspecting IP addresses in an HTTP header that you
// specify, instead of using the IP address that's reported by the web request
// origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify
// any header name. If the specified header isn't present in the request, WAF
// doesn't apply the rule to the web request at all. This configuration is used
// only for IPSetReferenceStatement . For GeoMatchStatement and RateBasedStatement
// , use ForwardedIPConfig instead.
type IPSetForwardedIPConfig struct {
// The match status to assign to the web request if the request doesn't have a
// valid IP address in the specified position. If the specified header isn't
// present in the request, WAF doesn't apply the rule to the web request at all.
// You can specify the following fallback behaviors:
// - MATCH - Treat the web request as matching the rule statement. WAF applies
// the rule action to the request.
// - NO_MATCH - Treat the web request as not matching the rule statement.
//
// This member is required.
FallbackBehavior FallbackBehavior
// The name of the HTTP header to use for the IP address. For example, to use the
// X-Forwarded-For (XFF) header, set this to X-Forwarded-For . If the specified
// header isn't present in the request, WAF doesn't apply the rule to the web
// request at all.
//
// This member is required.
HeaderName *string
// The position in the header to search for the IP address. The header can contain
// IP addresses of the original client and also of proxies. For example, the header
// value could be 10.1.1.1, 127.0.0.0, 10.10.10.10 where the first IP address
// identifies the original client and the rest identify proxies that the request
// went through. The options for this setting are the following:
// - FIRST - Inspect the first IP address in the list of IP addresses in the
// header. This is usually the client's original IP.
// - LAST - Inspect the last IP address in the list of IP addresses in the
// header.
// - ANY - Inspect all IP addresses in the header for a match. If the header
// contains more than 10 IP addresses, WAF inspects the last 10.
//
// This member is required.
Position ForwardedIPPosition
noSmithyDocumentSerde
}
// A rule statement used to detect web requests coming from particular IP
// addresses or address ranges. To use this, create an IPSet that specifies the
// addresses you want to detect, then use the ARN of that set in this statement. To
// create an IP set, see CreateIPSet . Each IP set rule statement references an IP
// set. You create and maintain the set independent of your rules. This allows you
// to use the single set in multiple rules. When you update the referenced set, WAF
// automatically updates all rules that reference it.
type IPSetReferenceStatement struct {
// The Amazon Resource Name (ARN) of the IPSet that this statement references.
//
// This member is required.
ARN *string
// The configuration for inspecting IP addresses in an HTTP header that you
// specify, instead of using the IP address that's reported by the web request
// origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify
// any header name. If the specified header isn't present in the request, WAF
// doesn't apply the rule to the web request at all.
IPSetForwardedIPConfig *IPSetForwardedIPConfig
noSmithyDocumentSerde
}
// High-level information about an IPSet , returned by operations like create and
// list. This provides information like the ID, that you can use to retrieve and
// manage an IPSet , and the ARN, that you provide to the IPSetReferenceStatement
// to use the address set in a Rule .
type IPSetSummary struct {
// The Amazon Resource Name (ARN) of the entity.
ARN *string
// A description of the IP set that helps with identification.
Description *string
// A unique identifier for the set. This ID is returned in the responses to create
// and list commands. You provide it to operations like update and delete.
Id *string
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
LockToken *string
// The name of the IP set. You cannot change the name of an IPSet after you create
// it.
Name *string
noSmithyDocumentSerde
}
// Inspect the body of the web request as JSON. The body immediately follows the
// request headers. This is used to indicate the web request component to inspect,
// in the FieldToMatch specification. Use the specifications in this object to
// indicate which parts of the JSON body to inspect using the rule's inspection
// criteria. WAF inspects only the parts of the JSON that result from the matches
// that you indicate. Example JSON: "JsonBody": { "MatchPattern": { "All": {} },
// "MatchScope": "ALL" }
type JsonBody struct {
// The patterns to look for in the JSON body. WAF inspects the results of these
// pattern matches against the rule inspection criteria.
//
// This member is required.
MatchPattern *JsonMatchPattern
// The parts of the JSON to match against using the MatchPattern . If you specify
// All , WAF matches against keys and values.
//
// This member is required.
MatchScope JsonMatchScope
// What WAF should do if it fails to completely parse the JSON body. The options
// are the following:
// - EVALUATE_AS_STRING - Inspect the body as plain text. WAF applies the text
// transformations and inspection criteria that you defined for the JSON inspection
// to the body text string.
// - MATCH - Treat the web request as matching the rule statement. WAF applies
// the rule action to the request.
// - NO_MATCH - Treat the web request as not matching the rule statement.
// If you don't provide this setting, WAF parses and evaluates the content only up
// to the first parsing failure that it encounters. WAF does its best to parse the
// entire JSON body, but might be forced to stop for reasons such as invalid
// characters, duplicate keys, truncation, and any content whose root node isn't an
// object or an array. WAF parses the JSON in the following examples as two valid
// key, value pairs:
// - Missing comma: {"key1":"value1""key2":"value2"}
// - Missing colon: {"key1":"value1","key2""value2"}
// - Extra colons: {"key1"::"value1","key2""value2"}
InvalidFallbackBehavior BodyParsingFallbackBehavior
// What WAF should do if the body is larger than WAF can inspect. WAF does not
// support inspecting the entire contents of the web request body if the body
// exceeds the limit for the resource type. If the body is larger than the limit,
// the underlying host service only forwards the contents that are below the limit
// to WAF for inspection. The default limit is 8 KB (8,192 kilobytes) for regional
// resources and 16 KB (16,384 kilobytes) for CloudFront distributions. For
// CloudFront distributions, you can increase the limit in the web ACL
// AssociationConfig , for additional processing fees. The options for oversize
// handling are the following:
// - CONTINUE - Inspect the available body contents normally, according to the
// rule inspection criteria.
// - MATCH - Treat the web request as matching the rule statement. WAF applies
// the rule action to the request.
// - NO_MATCH - Treat the web request as not matching the rule statement.
// You can combine the MATCH or NO_MATCH settings for oversize handling with your
// rule and web ACL action settings, so that you block any request whose body is
// over the limit. Default: CONTINUE
OversizeHandling OversizeHandling
noSmithyDocumentSerde
}
// The patterns to look for in the JSON body. WAF inspects the results of these
// pattern matches against the rule inspection criteria. This is used with the
// FieldToMatch option JsonBody .
type JsonMatchPattern struct {
// Match all of the elements. See also MatchScope in JsonBody . You must specify
// either this setting or the IncludedPaths setting, but not both.
All *All
// Match only the specified include paths. See also MatchScope in JsonBody .
// Provide the include paths using JSON Pointer syntax. For example,
// "IncludedPaths": ["/dogs/0/name", "/dogs/1/name"] . For information about this
// syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript
// Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901) . You must
// specify either this setting or the All setting, but not both. Don't use this
// option to include all paths. Instead, use the All setting.
IncludedPaths []string
noSmithyDocumentSerde
}
// A single label container. This is used as an element of a label array in
// multiple contexts, for example, in RuleLabels inside a Rule and in Labels
// inside a SampledHTTPRequest .
type Label struct {
// The label string.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
// A rule statement to match against labels that have been added to the web
// request by rules that have already run in the web ACL. The label match statement
// provides the label or namespace string to search for. The label string can
// represent a part or all of the fully qualified label name that had been added to
// the web request. Fully qualified labels have a prefix, optional namespaces, and
// label name. The prefix identifies the rule group or web ACL context of the rule
// that added the label. If you do not provide the fully qualified name in your
// label match string, WAF performs the search for labels that were added in the
// same context as the label match statement.
type LabelMatchStatement struct {
// The string to match against. The setting you provide for this depends on the
// match statement's Scope setting:
// - If the Scope indicates LABEL , then this specification must include the name
// and can include any number of preceding namespace specifications and prefix up
// to providing the fully qualified label name.
// - If the Scope indicates NAMESPACE , then this specification can include any
// number of contiguous namespace strings, and can include the entire label
// namespace prefix from the rule group or web ACL where the label originates.
// Labels are case sensitive and components of a label must be separated by colon,
// for example NS1:NS2:name .
//
// This member is required.
Key *string
// Specify whether you want to match using the label name or just the namespace.
//
// This member is required.
Scope LabelMatchScope
noSmithyDocumentSerde
}
// A single label name condition for a Condition in a logging filter.
type LabelNameCondition struct {
// The label name that a log record must contain in order to meet the condition.
// This must be a fully qualified label name. Fully qualified labels have a prefix,
// optional namespaces, and label name. The prefix identifies the rule group or web
// ACL context of the rule that added the label.
//
// This member is required.
LabelName *string
noSmithyDocumentSerde
}
// List of labels used by one or more of the rules of a RuleGroup . This summary
// object is used for the following rule group lists:
// - AvailableLabels - Labels that rules add to matching requests. These labels
// are defined in the RuleLabels for a Rule .
// - ConsumedLabels - Labels that rules match against. These labels are defined
// in a LabelMatchStatement specification, in the Statement definition of a rule.
type LabelSummary struct {
// An individual label specification.
Name *string
noSmithyDocumentSerde
}
// Defines an association between logging destinations and a web ACL resource, for
// logging from WAF. As part of the association, you can specify parts of the
// standard logging fields to keep out of the logs and you can specify filters so
// that you log only a subset of the logging records. You can define one logging
// destination per web ACL. You can access information about the traffic that WAF
// inspects using the following steps:
// - Create your logging destination. You can use an Amazon CloudWatch Logs log
// group, an Amazon Simple Storage Service (Amazon S3) bucket, or an Amazon Kinesis
// Data Firehose. The name that you give the destination must start with
// aws-waf-logs- . Depending on the type of destination, you might need to
// configure additional settings or permissions. For configuration requirements and
// pricing information for each destination type, see Logging web ACL traffic (https://docs.aws.amazon.com/waf/latest/developerguide/logging.html)
// in the WAF Developer Guide.
// - Associate your logging destination to your web ACL using a
// PutLoggingConfiguration request.
//
// When you successfully enable logging using a PutLoggingConfiguration request,
// WAF creates an additional role or policy that is required to write logs to the
// logging destination. For an Amazon CloudWatch Logs log group, WAF creates a
// resource policy on the log group. For an Amazon S3 bucket, WAF creates a bucket
// policy. For an Amazon Kinesis Data Firehose, WAF creates a service-linked role.
// For additional information about web ACL logging, see Logging web ACL traffic
// information (https://docs.aws.amazon.com/waf/latest/developerguide/logging.html)
// in the WAF Developer Guide.
type LoggingConfiguration struct {
// The logging destination configuration that you want to associate with the web
// ACL. You can associate one logging destination to a web ACL.
//
// This member is required.
LogDestinationConfigs []string
// The Amazon Resource Name (ARN) of the web ACL that you want to associate with
// LogDestinationConfigs .
//
// This member is required.
ResourceArn *string
// Filtering that specifies which web requests are kept in the logs and which are
// dropped. You can filter on the rule action and on the web request labels that
// were applied by matching rules during web ACL evaluation.
LoggingFilter *LoggingFilter
// Indicates whether the logging configuration was created by Firewall Manager, as
// part of an WAF policy configuration. If true, only Firewall Manager can modify
// or delete the configuration.
ManagedByFirewallManager bool
// The parts of the request that you want to keep out of the logs. For example, if
// you redact the SingleHeader field, the HEADER field in the logs will be REDACTED
// for all rules that use the SingleHeader FieldToMatch setting. Redaction applies
// only to the component that's specified in the rule's FieldToMatch setting, so
// the SingleHeader redaction doesn't apply to rules that use the Headers
// FieldToMatch . You can specify only the following fields for redaction: UriPath
// , QueryString , SingleHeader , and Method .
RedactedFields []FieldToMatch
noSmithyDocumentSerde
}
// Filtering that specifies which web requests are kept in the logs and which are
// dropped, defined for a web ACL's LoggingConfiguration . You can filter on the
// rule action and on the web request labels that were applied by matching rules
// during web ACL evaluation.
type LoggingFilter struct {
// Default handling for logs that don't match any of the specified filtering
// conditions.
//
// This member is required.
DefaultBehavior FilterBehavior
// The filters that you want to apply to the logs.
//
// This member is required.
Filters []Filter
noSmithyDocumentSerde
}
// The properties of a managed product, such as an Amazon Web Services Managed
// Rules rule group or an Amazon Web Services Marketplace managed rule group.
type ManagedProductDescriptor struct {
// Indicates whether the rule group provides an advanced set of protections, such
// as the the Amazon Web Services Managed Rules rule groups that are used for WAF
// intelligent threat mitigation.
IsAdvancedManagedRuleSet bool
// Indicates whether the rule group is versioned.
IsVersioningSupported bool
// The name of the managed rule group. For example, AWSManagedRulesAnonymousIpList
// or AWSManagedRulesATPRuleSet .
ManagedRuleSetName *string
// A short description of the managed rule group.
ProductDescription *string
// A unique identifier for the rule group. This ID is returned in the responses to
// create and list commands. You provide it to operations like update and delete.
ProductId *string
// For Amazon Web Services Marketplace managed rule groups only, the link to the
// rule group product page.
ProductLink *string
// The display name for the managed rule group. For example, Anonymous IP list or
// Account takeover prevention .
ProductTitle *string
// The Amazon resource name (ARN) of the Amazon Simple Notification Service SNS
// topic that's used to provide notification of changes to the managed rule group.
// You can subscribe to the SNS topic to receive notifications when the managed
// rule group is modified, such as for new versions and for version expiration. For
// more information, see the Amazon Simple Notification Service Developer Guide (https://docs.aws.amazon.com/sns/latest/dg/welcome.html)
// .
SnsTopicArn *string
// The name of the managed rule group vendor. You use this, along with the rule
// group name, to identify a rule group.
VendorName *string
noSmithyDocumentSerde
}
// Additional information that's used by a managed rule group. Many managed rule
// groups don't require this. The rule groups used for intelligent threat
// mitigation require additional configuration:
// - Use the AWSManagedRulesACFPRuleSet configuration object to configure the
// account creation fraud prevention managed rule group. The configuration includes
// the registration and sign-up pages of your application and the locations in the
// account creation request payload of data, such as the user email and phone
// number fields.
// - Use the AWSManagedRulesATPRuleSet configuration object to configure the
// account takeover prevention managed rule group. The configuration includes the
// sign-in page of your application and the locations in the login request payload
// of data such as the username and password.
// - Use the AWSManagedRulesBotControlRuleSet configuration object to configure
// the protection level that you want the Bot Control rule group to use.
//
// For example specifications, see the examples section of CreateWebACL .
type ManagedRuleGroupConfig struct {
// Additional configuration for using the account creation fraud prevention (ACFP)
// managed rule group, AWSManagedRulesACFPRuleSet . Use this to provide account
// creation request information to the rule group. For web ACLs that protect
// CloudFront distributions, use this to also provide the information about how
// your distribution responds to account creation requests. For information about
// using the ACFP managed rule group, see WAF Fraud Control account creation fraud
// prevention (ACFP) rule group (https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-acfp.html)
// and WAF Fraud Control account creation fraud prevention (ACFP) (https://docs.aws.amazon.com/waf/latest/developerguide/waf-acfp.html)
// in the WAF Developer Guide.
AWSManagedRulesACFPRuleSet *AWSManagedRulesACFPRuleSet
// Additional configuration for using the account takeover prevention (ATP)
// managed rule group, AWSManagedRulesATPRuleSet . Use this to provide login
// request information to the rule group. For web ACLs that protect CloudFront
// distributions, use this to also provide the information about how your
// distribution responds to login requests. This configuration replaces the
// individual configuration fields in ManagedRuleGroupConfig and provides
// additional feature configuration. For information about using the ATP managed
// rule group, see WAF Fraud Control account takeover prevention (ATP) rule group (https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-atp.html)
// and WAF Fraud Control account takeover prevention (ATP) (https://docs.aws.amazon.com/waf/latest/developerguide/waf-atp.html)
// in the WAF Developer Guide.
AWSManagedRulesATPRuleSet *AWSManagedRulesATPRuleSet
// Additional configuration for using the Bot Control managed rule group. Use this
// to specify the inspection level that you want to use. For information about
// using the Bot Control managed rule group, see WAF Bot Control rule group (https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-bot.html)
// and WAF Bot Control (https://docs.aws.amazon.com/waf/latest/developerguide/waf-bot-control.html)
// in the WAF Developer Guide.
AWSManagedRulesBotControlRuleSet *AWSManagedRulesBotControlRuleSet
// Instead of this setting, provide your configuration under
// AWSManagedRulesATPRuleSet .
//
// Deprecated: Deprecated. Use AWSManagedRulesATPRuleSet LoginPath
LoginPath *string
// Instead of this setting, provide your configuration under the request
// inspection configuration for AWSManagedRulesATPRuleSet or
// AWSManagedRulesACFPRuleSet .
//
// Deprecated: Deprecated. Use AWSManagedRulesATPRuleSet RequestInspection
// PasswordField
PasswordField *PasswordField
// Instead of this setting, provide your configuration under the request
// inspection configuration for AWSManagedRulesATPRuleSet or
// AWSManagedRulesACFPRuleSet .
//
// Deprecated: Deprecated. Use AWSManagedRulesATPRuleSet RequestInspection
// PayloadType
PayloadType PayloadType
// Instead of this setting, provide your configuration under the request
// inspection configuration for AWSManagedRulesATPRuleSet or
// AWSManagedRulesACFPRuleSet .
//
// Deprecated: Deprecated. Use AWSManagedRulesATPRuleSet RequestInspection
// UsernameField
UsernameField *UsernameField
noSmithyDocumentSerde
}
// A rule statement used to run the rules that are defined in a managed rule
// group. To use this, provide the vendor name and the name of the rule group in
// this statement. You can retrieve the required names by calling
// ListAvailableManagedRuleGroups . You cannot nest a ManagedRuleGroupStatement ,
// for example for use inside a NotStatement or OrStatement . It can only be
// referenced as a top-level statement within a rule. You are charged additional
// fees when you use the WAF Bot Control managed rule group
// AWSManagedRulesBotControlRuleSet , the WAF Fraud Control account takeover
// prevention (ATP) managed rule group AWSManagedRulesATPRuleSet , or the WAF Fraud
// Control account creation fraud prevention (ACFP) managed rule group
// AWSManagedRulesACFPRuleSet . For more information, see WAF Pricing (http://aws.amazon.com/waf/pricing/)
// .
type ManagedRuleGroupStatement struct {
// The name of the managed rule group. You use this, along with the vendor name,
// to identify the rule group.
//
// This member is required.
Name *string
// The name of the managed rule group vendor. You use this, along with the rule
// group name, to identify a rule group.
//
// This member is required.
VendorName *string
// Rules in the referenced rule group whose actions are set to Count . Instead of
// this option, use RuleActionOverrides . It accepts any valid action setting,
// including Count .
ExcludedRules []ExcludedRule
// Additional information that's used by a managed rule group. Many managed rule
// groups don't require this. The rule groups used for intelligent threat
// mitigation require additional configuration:
// - Use the AWSManagedRulesACFPRuleSet configuration object to configure the
// account creation fraud prevention managed rule group. The configuration includes
// the registration and sign-up pages of your application and the locations in the
// account creation request payload of data, such as the user email and phone
// number fields.
// - Use the AWSManagedRulesATPRuleSet configuration object to configure the
// account takeover prevention managed rule group. The configuration includes the
// sign-in page of your application and the locations in the login request payload
// of data such as the username and password.
// - Use the AWSManagedRulesBotControlRuleSet configuration object to configure
// the protection level that you want the Bot Control rule group to use.
ManagedRuleGroupConfigs []ManagedRuleGroupConfig
// Action settings to use in the place of the rule actions that are configured
// inside the rule group. You specify one override for each rule whose action you
// want to change. You can use overrides for testing, for example you can override
// all of rule actions to Count and then monitor the resulting count metrics to
// understand how the rule group would handle your web traffic. You can also
// permanently override some or all actions, to modify how the rule group manages
// your web traffic.
RuleActionOverrides []RuleActionOverride
// An optional nested statement that narrows the scope of the web requests that
// are evaluated by the managed rule group. Requests are only evaluated by the rule
// group if they match the scope-down statement. You can use any nestable Statement
// in the scope-down statement, and you can nest statements at any level, the same
// as you can for a rule statement.
ScopeDownStatement *Statement
// The version of the managed rule group to use. If you specify this, the version
// setting is fixed until you change it. If you don't specify this, WAF uses the
// vendor's default version, and then keeps the version at the vendor's default
// when the vendor updates the managed rule group settings.
Version *string
noSmithyDocumentSerde
}
// High-level information about a managed rule group, returned by
// ListAvailableManagedRuleGroups . This provides information like the name and
// vendor name, that you provide when you add a ManagedRuleGroupStatement to a web
// ACL. Managed rule groups include Amazon Web Services Managed Rules rule groups
// and Amazon Web Services Marketplace managed rule groups. To use any Amazon Web
// Services Marketplace managed rule group, first subscribe to the rule group
// through Amazon Web Services Marketplace.
type ManagedRuleGroupSummary struct {
// The description of the managed rule group, provided by Amazon Web Services
// Managed Rules or the Amazon Web Services Marketplace seller who manages it.
Description *string
// The name of the managed rule group. You use this, along with the vendor name,
// to identify the rule group.
Name *string
// The name of the managed rule group vendor. You use this, along with the rule
// group name, to identify a rule group.
VendorName *string
// Indicates whether the managed rule group is versioned. If it is, you can
// retrieve the versions list by calling ListAvailableManagedRuleGroupVersions .
VersioningSupported bool
noSmithyDocumentSerde
}
// Describes a single version of a managed rule group.
type ManagedRuleGroupVersion struct {
// The date and time that the managed rule group owner updated the rule group
// version information.
LastUpdateTimestamp *time.Time
// The version name.
Name *string
noSmithyDocumentSerde
}
// A set of rules that is managed by Amazon Web Services and Amazon Web Services
// Marketplace sellers to provide versioned managed rule groups for customers of
// WAF. This is intended for use only by vendors of managed rule sets. Vendors are
// Amazon Web Services and Amazon Web Services Marketplace sellers. Vendors, you
// can use the managed rule set APIs to provide controlled rollout of your
// versioned managed rule group offerings for your customers. The APIs are
// ListManagedRuleSets , GetManagedRuleSet , PutManagedRuleSetVersions , and
// UpdateManagedRuleSetVersionExpiryDate .
type ManagedRuleSet struct {
// The Amazon Resource Name (ARN) of the entity.
//
// This member is required.
ARN *string
// A unique identifier for the managed rule set. The ID is returned in the
// responses to commands like list . You provide it to operations like get and
// update .
//
// This member is required.
Id *string
// The name of the managed rule set. You use this, along with the rule set ID, to
// identify the rule set. This name is assigned to the corresponding managed rule
// group, which your customers can access and use.
//
// This member is required.
Name *string
// A description of the set that helps with identification.
Description *string
// The label namespace prefix for the managed rule groups that are offered to
// customers from this managed rule set. All labels that are added by rules in the
// managed rule group have this prefix.
// - The syntax for the label namespace prefix for a managed rule group is the
// following: awswaf:managed:: :
// - When a rule with a label matches a web request, WAF adds the fully
// qualified label to the request. A fully qualified label is made up of the label
// namespace from the rule group or web ACL where the rule is defined and the label
// from the rule, separated by a colon: :
LabelNamespace *string
// The versions of this managed rule set that are available for use by customers.
PublishedVersions map[string]ManagedRuleSetVersion
// The version that you would like your customers to use.
RecommendedVersion *string
noSmithyDocumentSerde
}
// High-level information for a managed rule set. This is intended for use only by
// vendors of managed rule sets. Vendors are Amazon Web Services and Amazon Web
// Services Marketplace sellers. Vendors, you can use the managed rule set APIs to
// provide controlled rollout of your versioned managed rule group offerings for
// your customers. The APIs are ListManagedRuleSets , GetManagedRuleSet ,
// PutManagedRuleSetVersions , and UpdateManagedRuleSetVersionExpiryDate .
type ManagedRuleSetSummary struct {
// The Amazon Resource Name (ARN) of the entity.
ARN *string
// A description of the set that helps with identification.
Description *string
// A unique identifier for the managed rule set. The ID is returned in the
// responses to commands like list . You provide it to operations like get and
// update .
Id *string
// The label namespace prefix for the managed rule groups that are offered to
// customers from this managed rule set. All labels that are added by rules in the
// managed rule group have this prefix.
// - The syntax for the label namespace prefix for a managed rule group is the
// following: awswaf:managed:: :
// - When a rule with a label matches a web request, WAF adds the fully
// qualified label to the request. A fully qualified label is made up of the label
// namespace from the rule group or web ACL where the rule is defined and the label
// from the rule, separated by a colon: :
LabelNamespace *string
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
LockToken *string
// The name of the managed rule set. You use this, along with the rule set ID, to
// identify the rule set. This name is assigned to the corresponding managed rule
// group, which your customers can access and use.
Name *string
noSmithyDocumentSerde
}
// Information for a single version of a managed rule set. This is intended for
// use only by vendors of managed rule sets. Vendors are Amazon Web Services and
// Amazon Web Services Marketplace sellers. Vendors, you can use the managed rule
// set APIs to provide controlled rollout of your versioned managed rule group
// offerings for your customers. The APIs are ListManagedRuleSets ,
// GetManagedRuleSet , PutManagedRuleSetVersions , and
// UpdateManagedRuleSetVersionExpiryDate .
type ManagedRuleSetVersion struct {
// The Amazon Resource Name (ARN) of the vendor rule group that's used to define
// the published version of your managed rule group.
AssociatedRuleGroupArn *string
// The web ACL capacity units (WCUs) required for this rule group. WAF uses WCUs
// to calculate and control the operating resources that are used to run your
// rules, rule groups, and web ACLs. WAF calculates capacity differently for each
// rule type, to reflect the relative cost of each rule. Simple rules that cost
// little to run use fewer WCUs than more complex rules that use more processing
// power. Rule group capacity is fixed at creation, which helps users plan their
// web ACL WCU usage when they use a rule group. For more information, see WAF web
// ACL capacity units (WCU) (https://docs.aws.amazon.com/waf/latest/developerguide/aws-waf-capacity-units.html)
// in the WAF Developer Guide.
Capacity int64
// The time that this version is set to expire. Times are in Coordinated Universal
// Time (UTC) format. UTC format includes the special designator, Z. For example,
// "2016-09-27T14:50Z".
ExpiryTimestamp *time.Time
// The amount of time you expect this version of your managed rule group to last,
// in days.
ForecastedLifetime *int32
// The last time that you updated this version. Times are in Coordinated Universal
// Time (UTC) format. UTC format includes the special designator, Z. For example,
// "2016-09-27T14:50Z".
LastUpdateTimestamp *time.Time
// The time that you first published this version. Times are in Coordinated
// Universal Time (UTC) format. UTC format includes the special designator, Z. For
// example, "2016-09-27T14:50Z".
PublishTimestamp *time.Time
noSmithyDocumentSerde
}
// Inspect the HTTP method of the web request. The method indicates the type of
// operation that the request is asking the origin to perform. This is used in the
// FieldToMatch specification for some web request component types. JSON
// specification: "Method": {}
type Method struct {
noSmithyDocumentSerde
}
// Information for a release of the mobile SDK, including release notes and tags.
// The mobile SDK is not generally available. Customers who have access to the
// mobile SDK can use it to establish and manage WAF tokens for use in HTTP(S)
// requests from a mobile device to WAF. For more information, see WAF client
// application integration (https://docs.aws.amazon.com/waf/latest/developerguide/waf-application-integration.html)
// in the WAF Developer Guide.
type MobileSdkRelease struct {
// Notes describing the release.
ReleaseNotes *string
// The release version.
ReleaseVersion *string
// Tags that are associated with the release.
Tags []Tag
// The timestamp of the release.
Timestamp *time.Time
noSmithyDocumentSerde
}
// Specifies that WAF should do nothing. This is used for the OverrideAction
// setting on a Rule when the rule uses a rule group reference statement. This is
// used in the context of other settings, for example to specify values for
// RuleAction and web ACL DefaultAction . JSON specification: "None": {}
type NoneAction struct {
noSmithyDocumentSerde
}
// A logical rule statement used to negate the results of another rule statement.
// You provide one Statement within the NotStatement .
type NotStatement struct {
// The statement to negate. You can use any statement that can be nested.
//
// This member is required.
Statement *Statement
noSmithyDocumentSerde
}
// A logical rule statement used to combine other rule statements with OR logic.
// You provide more than one Statement within the OrStatement .
type OrStatement struct {
// The statements to combine with OR logic. You can use any statements that can be
// nested.
//
// This member is required.
Statements []Statement
noSmithyDocumentSerde
}
// The action to use in the place of the action that results from the rule group
// evaluation. Set the override action to none to leave the result of the rule
// group alone. Set it to count to override the result to count only. You can only
// use this for rule statements that reference a rule group, like
// RuleGroupReferenceStatement and ManagedRuleGroupStatement . This option is
// usually set to none. It does not affect how the rules in the rule group are
// evaluated. If you want the rules in the rule group to only count matches, do not
// use this and instead use the rule action override option, with Count action, in
// your rule group reference statement settings.
type OverrideAction struct {
// Override the rule group evaluation result to count only. This option is usually
// set to none. It does not affect how the rules in the rule group are evaluated.
// If you want the rules in the rule group to only count matches, do not use this
// and instead use the rule action override option, with Count action, in your
// rule group reference statement settings.
Count *CountAction
// Don't override the rule group evaluation result. This is the most common
// setting.
None *NoneAction
noSmithyDocumentSerde
}
// The name of the field in the request payload that contains your customer's
// password. This data type is used in the RequestInspection and
// RequestInspectionACFP data types.
type PasswordField struct {
// The name of the password field. How you specify this depends on the request
// inspection payload type.
// - For JSON payloads, specify the field name in JSON pointer syntax. For
// information about the JSON Pointer syntax, see the Internet Engineering Task
// Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901)
// . For example, for the JSON payload { "form": { "password": "THE_PASSWORD" } }
// , the password field specification is /form/password .
// - For form encoded payload types, use the HTML form names. For example, for
// an HTML form with the input element named password1 , the password field
// specification is password1 .
//
// This member is required.
Identifier *string
noSmithyDocumentSerde
}
// The name of a field in the request payload that contains part or all of your
// customer's primary phone number. This data type is used in the
// RequestInspectionACFP data type.
type PhoneNumberField struct {
// The name of a single primary phone number field. How you specify the phone
// number fields depends on the request inspection payload type.
// - For JSON payloads, specify the field identifiers in JSON pointer syntax.
// For information about the JSON Pointer syntax, see the Internet Engineering Task
// Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901)
// . For example, for the JSON payload { "form": { "primaryphoneline1":
// "THE_PHONE1", "primaryphoneline2": "THE_PHONE2", "primaryphoneline3":
// "THE_PHONE3" } } , the phone number field identifiers are
// /form/primaryphoneline1 , /form/primaryphoneline2 , and
// /form/primaryphoneline3 .
// - For form encoded payload types, use the HTML form names. For example, for
// an HTML form with input elements named primaryphoneline1 , primaryphoneline2 ,
// and primaryphoneline3 , the phone number field identifiers are
// primaryphoneline1 , primaryphoneline2 , and primaryphoneline3 .
//
// This member is required.
Identifier *string
noSmithyDocumentSerde
}
// Inspect the query string of the web request. This is the part of a URL that
// appears after a ? character, if any. This is used in the FieldToMatch
// specification for some web request component types. JSON specification:
// "QueryString": {}
type QueryString struct {
noSmithyDocumentSerde
}
// A rate-based rule counts incoming requests and rate limits requests when they
// are coming at too fast a rate. The rule categorizes requests according to your
// aggregation criteria, collects them into aggregation instances, and counts and
// rate limits the requests for each instance. You can specify individual
// aggregation keys, like IP address or HTTP method. You can also specify
// aggregation key combinations, like IP address and HTTP method, or HTTP method,
// query argument, and cookie. Each unique set of values for the aggregation keys
// that you specify is a separate aggregation instance, with the value from each
// key contributing to the aggregation instance definition. For example, assume the
// rule evaluates web requests with the following IP address and HTTP method
// values:
// - IP address 10.1.1.1, HTTP method POST
// - IP address 10.1.1.1, HTTP method GET
// - IP address 127.0.0.0, HTTP method POST
// - IP address 10.1.1.1, HTTP method GET
//
// The rule would create different aggregation instances according to your
// aggregation criteria, for example:
// - If the aggregation criteria is just the IP address, then each individual
// address is an aggregation instance, and WAF counts requests separately for each.
// The aggregation instances and request counts for our example would be the
// following:
// - IP address 10.1.1.1: count 3
// - IP address 127.0.0.0: count 1
// - If the aggregation criteria is HTTP method, then each individual HTTP
// method is an aggregation instance. The aggregation instances and request counts
// for our example would be the following:
// - HTTP method POST: count 2
// - HTTP method GET: count 2
// - If the aggregation criteria is IP address and HTTP method, then each IP
// address and each HTTP method would contribute to the combined aggregation
// instance. The aggregation instances and request counts for our example would be
// the following:
// - IP address 10.1.1.1, HTTP method POST: count 1
// - IP address 10.1.1.1, HTTP method GET: count 2
// - IP address 127.0.0.0, HTTP method POST: count 1
//
// For any n-tuple of aggregation keys, each unique combination of values for the
// keys defines a separate aggregation instance, which WAF counts and rate-limits
// individually. You can optionally nest another statement inside the rate-based
// statement, to narrow the scope of the rule so that it only counts and rate
// limits requests that match the nested statement. You can use this nested
// scope-down statement in conjunction with your aggregation key specifications or
// you can just count and rate limit all requests that match the scope-down
// statement, without additional aggregation. When you choose to just manage all
// requests that match a scope-down statement, the aggregation instance is singular
// for the rule. You cannot nest a RateBasedStatement inside another statement,
// for example inside a NotStatement or OrStatement . You can define a
// RateBasedStatement inside a web ACL and inside a rule group. For additional
// information about the options, see Rate limiting web requests using rate-based
// rules (https://docs.aws.amazon.com/waf/latest/developerguide/waf-rate-based-rules.html)
// in the WAF Developer Guide. If you only aggregate on the individual IP address
// or forwarded IP address, you can retrieve the list of IP addresses that WAF is
// currently rate limiting for a rule through the API call
// GetRateBasedStatementManagedKeys . This option is not available for other
// aggregation configurations. WAF tracks and manages web requests separately for
// each instance of a rate-based rule that you use. For example, if you provide the
// same rate-based rule settings in two web ACLs, each of the two rule statements
// represents a separate instance of the rate-based rule and gets its own tracking
// and management by WAF. If you define a rate-based rule inside a rule group, and
// then use that rule group in multiple places, each use creates a separate
// instance of the rate-based rule that gets its own tracking and management by
// WAF.
type RateBasedStatement struct {
// Setting that indicates how to aggregate the request counts. Web requests that
// are missing any of the components specified in the aggregation keys are omitted
// from the rate-based rule evaluation and handling.
// - CONSTANT - Count and limit the requests that match the rate-based rule's
// scope-down statement. With this option, the counted requests aren't further
// aggregated. The scope-down statement is the only specification used. When the
// count of all requests that satisfy the scope-down statement goes over the limit,
// WAF applies the rule action to all requests that satisfy the scope-down
// statement. With this option, you must configure the ScopeDownStatement
// property.
// - CUSTOM_KEYS - Aggregate the request counts using one or more web request
// components as the aggregate keys. With this option, you must specify the
// aggregate keys in the CustomKeys property. To aggregate on only the IP address
// or only the forwarded IP address, don't use custom keys. Instead, set the
// aggregate key type to IP or FORWARDED_IP .
// - FORWARDED_IP - Aggregate the request counts on the first IP address in an
// HTTP header. With this option, you must specify the header to use in the
// ForwardedIPConfig property. To aggregate on a combination of the forwarded IP
// address with other aggregate keys, use CUSTOM_KEYS .
// - IP - Aggregate the request counts on the IP address from the web request
// origin. To aggregate on a combination of the IP address with other aggregate
// keys, use CUSTOM_KEYS .
//
// This member is required.
AggregateKeyType RateBasedStatementAggregateKeyType
// The limit on requests per 5-minute period for a single aggregation instance for
// the rate-based rule. If the rate-based statement includes a ScopeDownStatement ,
// this limit is applied only to the requests that match the statement. Examples:
// - If you aggregate on just the IP address, this is the limit on requests from
// any single IP address.
// - If you aggregate on the HTTP method and the query argument name "city",
// then this is the limit on requests for any single method, city pair.
//
// This member is required.
Limit int64
// Specifies the aggregate keys to use in a rate-base rule.
CustomKeys []RateBasedStatementCustomKey
// The configuration for inspecting IP addresses in an HTTP header that you
// specify, instead of using the IP address that's reported by the web request
// origin. Commonly, this is the X-Forwarded-For (XFF) header, but you can specify
// any header name. If the specified header isn't present in the request, WAF
// doesn't apply the rule to the web request at all. This is required if you
// specify a forwarded IP in the rule's aggregate key settings.
ForwardedIPConfig *ForwardedIPConfig
// An optional nested statement that narrows the scope of the web requests that
// are evaluated and managed by the rate-based statement. When you use a scope-down
// statement, the rate-based rule only tracks and rate limits requests that match
// the scope-down statement. You can use any nestable Statement in the scope-down
// statement, and you can nest statements at any level, the same as you can for a
// rule statement.
ScopeDownStatement *Statement
noSmithyDocumentSerde
}
// Specifies a single custom aggregate key for a rate-base rule. Web requests that
// are missing any of the components specified in the aggregation keys are omitted
// from the rate-based rule evaluation and handling.
type RateBasedStatementCustomKey struct {
// Use the value of a cookie in the request as an aggregate key. Each distinct
// value in the cookie contributes to the aggregation instance. If you use a single
// cookie as your custom key, then each value fully defines an aggregation
// instance.
Cookie *RateLimitCookie
// Use the first IP address in an HTTP header as an aggregate key. Each distinct
// forwarded IP address contributes to the aggregation instance. When you specify
// an IP or forwarded IP in the custom key settings, you must also specify at least
// one other key to use. You can aggregate on only the forwarded IP address by
// specifying FORWARDED_IP in your rate-based statement's AggregateKeyType . With
// this option, you must specify the header to use in the rate-based rule's
// ForwardedIPConfig property.
ForwardedIP *RateLimitForwardedIP
// Use the request's HTTP method as an aggregate key. Each distinct HTTP method
// contributes to the aggregation instance. If you use just the HTTP method as your
// custom key, then each method fully defines an aggregation instance.
HTTPMethod *RateLimitHTTPMethod
// Use the value of a header in the request as an aggregate key. Each distinct
// value in the header contributes to the aggregation instance. If you use a single
// header as your custom key, then each value fully defines an aggregation
// instance.
Header *RateLimitHeader
// Use the request's originating IP address as an aggregate key. Each distinct IP
// address contributes to the aggregation instance. When you specify an IP or
// forwarded IP in the custom key settings, you must also specify at least one
// other key to use. You can aggregate on only the IP address by specifying IP in
// your rate-based statement's AggregateKeyType .
IP *RateLimitIP
// Use the specified label namespace as an aggregate key. Each distinct fully
// qualified label name that has the specified label namespace contributes to the
// aggregation instance. If you use just one label namespace as your custom key,
// then each label name fully defines an aggregation instance. This uses only
// labels that have been added to the request by rules that are evaluated before
// this rate-based rule in the web ACL. For information about label namespaces and
// names, see Label syntax and naming requirements (https://docs.aws.amazon.com/waf/latest/developerguide/waf-rule-label-requirements.html)
// in the WAF Developer Guide.
LabelNamespace *RateLimitLabelNamespace
// Use the specified query argument as an aggregate key. Each distinct value for
// the named query argument contributes to the aggregation instance. If you use a
// single query argument as your custom key, then each value fully defines an
// aggregation instance.
QueryArgument *RateLimitQueryArgument
// Use the request's query string as an aggregate key. Each distinct string
// contributes to the aggregation instance. If you use just the query string as
// your custom key, then each string fully defines an aggregation instance.
QueryString *RateLimitQueryString
noSmithyDocumentSerde
}
// The set of IP addresses that are currently blocked for a RateBasedStatement .
// This is only available for rate-based rules that aggregate on just the IP
// address, with the AggregateKeyType set to IP or FORWARDED_IP . A rate-based rule
// applies its rule action to requests from IP addresses that are in the rule's
// managed keys list and that match the rule's scope-down statement. When a rule
// has no scope-down statement, it applies the action to all requests from the IP
// addresses that are in the list. The rule applies its rule action to rate limit
// the matching requests. The action is usually Block but it can be any valid rule
// action except for Allow. The maximum number of IP addresses that can be rate
// limited by a single rate-based rule instance is 10,000. If more than 10,000
// addresses exceed the rate limit, WAF limits those with the highest rates.
type RateBasedStatementManagedKeysIPSet struct {
// The IP addresses that are currently blocked.
Addresses []string
// The version of the IP addresses, either IPV4 or IPV6 .
IPAddressVersion IPAddressVersion
noSmithyDocumentSerde
}
// Specifies a cookie as an aggregate key for a rate-based rule. Each distinct
// value in the cookie contributes to the aggregation instance. If you use a single
// cookie as your custom key, then each value fully defines an aggregation
// instance.
type RateLimitCookie struct {
// The name of the cookie to use.
//
// This member is required.
Name *string
// Text transformations eliminate some of the unusual formatting that attackers
// use in web requests in an effort to bypass detection. Text transformations are
// used in rule match statements, to transform the FieldToMatch request component
// before inspecting it, and they're used in rate-based rule statements, to
// transform request components before using them as custom aggregation keys. If
// you specify one or more transformations to apply, WAF performs all
// transformations on the specified content, starting from the lowest priority
// setting, and then uses the component contents.
//
// This member is required.
TextTransformations []TextTransformation
noSmithyDocumentSerde
}
// Specifies the first IP address in an HTTP header as an aggregate key for a
// rate-based rule. Each distinct forwarded IP address contributes to the
// aggregation instance. This setting is used only in the
// RateBasedStatementCustomKey specification of a rate-based rule statement. When
// you specify an IP or forwarded IP in the custom key settings, you must also
// specify at least one other key to use. You can aggregate on only the forwarded
// IP address by specifying FORWARDED_IP in your rate-based statement's
// AggregateKeyType . This data type supports using the forwarded IP address in the
// web request aggregation for a rate-based rule, in RateBasedStatementCustomKey .
// The JSON specification for using the forwarded IP address doesn't explicitly use
// this data type. JSON specification: "ForwardedIP": {} When you use this
// specification, you must also configure the forwarded IP address in the
// rate-based statement's ForwardedIPConfig .
type RateLimitForwardedIP struct {
noSmithyDocumentSerde
}
// Specifies a header as an aggregate key for a rate-based rule. Each distinct
// value in the header contributes to the aggregation instance. If you use a single
// header as your custom key, then each value fully defines an aggregation
// instance.
type RateLimitHeader struct {
// The name of the header to use.
//
// This member is required.
Name *string
// Text transformations eliminate some of the unusual formatting that attackers
// use in web requests in an effort to bypass detection. Text transformations are
// used in rule match statements, to transform the FieldToMatch request component
// before inspecting it, and they're used in rate-based rule statements, to
// transform request components before using them as custom aggregation keys. If
// you specify one or more transformations to apply, WAF performs all
// transformations on the specified content, starting from the lowest priority
// setting, and then uses the component contents.
//
// This member is required.
TextTransformations []TextTransformation
noSmithyDocumentSerde
}
// Specifies the request's HTTP method as an aggregate key for a rate-based rule.
// Each distinct HTTP method contributes to the aggregation instance. If you use
// just the HTTP method as your custom key, then each method fully defines an
// aggregation instance. JSON specification: "RateLimitHTTPMethod": {}
type RateLimitHTTPMethod struct {
noSmithyDocumentSerde
}
// Specifies the IP address in the web request as an aggregate key for a
// rate-based rule. Each distinct IP address contributes to the aggregation
// instance. This setting is used only in the RateBasedStatementCustomKey
// specification of a rate-based rule statement. To use this in the custom key
// settings, you must specify at least one other key to use, along with the IP
// address. To aggregate on only the IP address, in your rate-based statement's
// AggregateKeyType , specify IP . JSON specification: "RateLimitIP": {}
type RateLimitIP struct {
noSmithyDocumentSerde
}
// Specifies a label namespace to use as an aggregate key for a rate-based rule.
// Each distinct fully qualified label name that has the specified label namespace
// contributes to the aggregation instance. If you use just one label namespace as
// your custom key, then each label name fully defines an aggregation instance.
// This uses only labels that have been added to the request by rules that are
// evaluated before this rate-based rule in the web ACL. For information about
// label namespaces and names, see Label syntax and naming requirements (https://docs.aws.amazon.com/waf/latest/developerguide/waf-rule-label-requirements.html)
// in the WAF Developer Guide.
type RateLimitLabelNamespace struct {
// The namespace to use for aggregation.
//
// This member is required.
Namespace *string
noSmithyDocumentSerde
}
// Specifies a query argument in the request as an aggregate key for a rate-based
// rule. Each distinct value for the named query argument contributes to the
// aggregation instance. If you use a single query argument as your custom key,
// then each value fully defines an aggregation instance.
type RateLimitQueryArgument struct {
// The name of the query argument to use.
//
// This member is required.
Name *string
// Text transformations eliminate some of the unusual formatting that attackers
// use in web requests in an effort to bypass detection. Text transformations are
// used in rule match statements, to transform the FieldToMatch request component
// before inspecting it, and they're used in rate-based rule statements, to
// transform request components before using them as custom aggregation keys. If
// you specify one or more transformations to apply, WAF performs all
// transformations on the specified content, starting from the lowest priority
// setting, and then uses the component contents.
//
// This member is required.
TextTransformations []TextTransformation
noSmithyDocumentSerde
}
// Specifies the request's query string as an aggregate key for a rate-based rule.
// Each distinct string contributes to the aggregation instance. If you use just
// the query string as your custom key, then each string fully defines an
// aggregation instance.
type RateLimitQueryString struct {
// Text transformations eliminate some of the unusual formatting that attackers
// use in web requests in an effort to bypass detection. Text transformations are
// used in rule match statements, to transform the FieldToMatch request component
// before inspecting it, and they're used in rate-based rule statements, to
// transform request components before using them as custom aggregation keys. If
// you specify one or more transformations to apply, WAF performs all
// transformations on the specified content, starting from the lowest priority
// setting, and then uses the component contents.
//
// This member is required.
TextTransformations []TextTransformation
noSmithyDocumentSerde
}
// A single regular expression. This is used in a RegexPatternSet .
type Regex struct {
// The string representing the regular expression.
RegexString *string
noSmithyDocumentSerde
}
// A rule statement used to search web request components for a match against a
// single regular expression.
type RegexMatchStatement struct {
// The part of the web request that you want WAF to inspect.
//
// This member is required.
FieldToMatch *FieldToMatch
// The string representing the regular expression.
//
// This member is required.
RegexString *string
// Text transformations eliminate some of the unusual formatting that attackers
// use in web requests in an effort to bypass detection. Text transformations are
// used in rule match statements, to transform the FieldToMatch request component
// before inspecting it, and they're used in rate-based rule statements, to
// transform request components before using them as custom aggregation keys. If
// you specify one or more transformations to apply, WAF performs all
// transformations on the specified content, starting from the lowest priority
// setting, and then uses the component contents.
//
// This member is required.
TextTransformations []TextTransformation
noSmithyDocumentSerde
}
// Contains one or more regular expressions. WAF assigns an ARN to each
// RegexPatternSet that you create. To use a set in a rule, you provide the ARN to
// the Rule statement RegexPatternSetReferenceStatement .
type RegexPatternSet struct {
// The Amazon Resource Name (ARN) of the entity.
ARN *string
// A description of the set that helps with identification.
Description *string
// A unique identifier for the set. This ID is returned in the responses to create
// and list commands. You provide it to operations like update and delete.
Id *string
// The name of the set. You cannot change the name after you create the set.
Name *string
// The regular expression patterns in the set.
RegularExpressionList []Regex
noSmithyDocumentSerde
}
// A rule statement used to search web request components for matches with regular
// expressions. To use this, create a RegexPatternSet that specifies the
// expressions that you want to detect, then use the ARN of that set in this
// statement. A web request matches the pattern set rule statement if the request
// component matches any of the patterns in the set. To create a regex pattern set,
// see CreateRegexPatternSet . Each regex pattern set rule statement references a
// regex pattern set. You create and maintain the set independent of your rules.
// This allows you to use the single set in multiple rules. When you update the
// referenced set, WAF automatically updates all rules that reference it.
type RegexPatternSetReferenceStatement struct {
// The Amazon Resource Name (ARN) of the RegexPatternSet that this statement
// references.
//
// This member is required.
ARN *string
// The part of the web request that you want WAF to inspect.
//
// This member is required.
FieldToMatch *FieldToMatch
// Text transformations eliminate some of the unusual formatting that attackers
// use in web requests in an effort to bypass detection. Text transformations are
// used in rule match statements, to transform the FieldToMatch request component
// before inspecting it, and they're used in rate-based rule statements, to
// transform request components before using them as custom aggregation keys. If
// you specify one or more transformations to apply, WAF performs all
// transformations on the specified content, starting from the lowest priority
// setting, and then uses the component contents.
//
// This member is required.
TextTransformations []TextTransformation
noSmithyDocumentSerde
}
// High-level information about a RegexPatternSet , returned by operations like
// create and list. This provides information like the ID, that you can use to
// retrieve and manage a RegexPatternSet , and the ARN, that you provide to the
// RegexPatternSetReferenceStatement to use the pattern set in a Rule .
type RegexPatternSetSummary struct {
// The Amazon Resource Name (ARN) of the entity.
ARN *string
// A description of the set that helps with identification.
Description *string
// A unique identifier for the set. This ID is returned in the responses to create
// and list commands. You provide it to operations like update and delete.
Id *string
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
LockToken *string
// The name of the data type instance. You cannot change the name after you create
// the instance.
Name *string
noSmithyDocumentSerde
}
// High level information for an SDK release.
type ReleaseSummary struct {
// The release version.
ReleaseVersion *string
// The timestamp of the release.
Timestamp *time.Time
noSmithyDocumentSerde
}
// Customizes the maximum size of the request body that your protected CloudFront
// distributions forward to WAF for inspection. The default size is 16 KB (16,384
// kilobytes). You are charged additional fees when your protected resources
// forward body sizes that are larger than the default. For more information, see
// WAF Pricing (http://aws.amazon.com/waf/pricing/) . This is used in the
// AssociationConfig of the web ACL.
type RequestBodyAssociatedResourceTypeConfig struct {
// Specifies the maximum size of the web request body component that an associated
// CloudFront distribution should send to WAF for inspection. This applies to
// statements in the web ACL that inspect the body or JSON body. Default: 16 KB
// (16,384 kilobytes)
//
// This member is required.
DefaultSizeInspectionLimit SizeInspectionLimit
noSmithyDocumentSerde
}
// The criteria for inspecting login requests, used by the ATP rule group to
// validate credentials usage. This is part of the AWSManagedRulesATPRuleSet
// configuration in ManagedRuleGroupConfig . In these settings, you specify how
// your application accepts login attempts by providing the request payload type
// and the names of the fields within the request body where the username and
// password are provided.
type RequestInspection struct {
// The name of the field in the request payload that contains your customer's
// password. How you specify this depends on the request inspection payload type.
// - For JSON payloads, specify the field name in JSON pointer syntax. For
// information about the JSON Pointer syntax, see the Internet Engineering Task
// Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901)
// . For example, for the JSON payload { "form": { "password": "THE_PASSWORD" } }
// , the password field specification is /form/password .
// - For form encoded payload types, use the HTML form names. For example, for
// an HTML form with the input element named password1 , the password field
// specification is password1 .
//
// This member is required.
PasswordField *PasswordField
// The payload type for your login endpoint, either JSON or form encoded.
//
// This member is required.
PayloadType PayloadType
// The name of the field in the request payload that contains your customer's
// username. How you specify this depends on the request inspection payload type.
// - For JSON payloads, specify the field name in JSON pointer syntax. For
// information about the JSON Pointer syntax, see the Internet Engineering Task
// Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901)
// . For example, for the JSON payload { "form": { "username": "THE_USERNAME" } }
// , the username field specification is /form/username .
// - For form encoded payload types, use the HTML form names. For example, for
// an HTML form with the input element named username1 , the username field
// specification is username1
//
// This member is required.
UsernameField *UsernameField
noSmithyDocumentSerde
}
// The criteria for inspecting account creation requests, used by the ACFP rule
// group to validate and track account creation attempts. This is part of the
// AWSManagedRulesACFPRuleSet configuration in ManagedRuleGroupConfig . In these
// settings, you specify how your application accepts account creation attempts by
// providing the request payload type and the names of the fields within the
// request body where the username, password, email, and primary address and phone
// number fields are provided.
type RequestInspectionACFP struct {
// The payload type for your account creation endpoint, either JSON or form
// encoded.
//
// This member is required.
PayloadType PayloadType
// The names of the fields in the request payload that contain your customer's
// primary physical address. Order the address fields in the array exactly as they
// are ordered in the request payload. How you specify the address fields depends
// on the request inspection payload type.
// - For JSON payloads, specify the field identifiers in JSON pointer syntax.
// For information about the JSON Pointer syntax, see the Internet Engineering Task
// Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901)
// . For example, for the JSON payload { "form": { "primaryaddressline1":
// "THE_ADDRESS1", "primaryaddressline2": "THE_ADDRESS2", "primaryaddressline3":
// "THE_ADDRESS3" } } , the address field idenfiers are /form/primaryaddressline1
// , /form/primaryaddressline2 , and /form/primaryaddressline3 .
// - For form encoded payload types, use the HTML form names. For example, for
// an HTML form with input elements named primaryaddressline1 ,
// primaryaddressline2 , and primaryaddressline3 , the address fields identifiers
// are primaryaddressline1 , primaryaddressline2 , and primaryaddressline3 .
AddressFields []AddressField
// The name of the field in the request payload that contains your customer's
// email. How you specify this depends on the request inspection payload type.
// - For JSON payloads, specify the field name in JSON pointer syntax. For
// information about the JSON Pointer syntax, see the Internet Engineering Task
// Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901)
// . For example, for the JSON payload { "form": { "email": "THE_EMAIL" } } , the
// email field specification is /form/email .
// - For form encoded payload types, use the HTML form names. For example, for
// an HTML form with the input element named email1 , the email field
// specification is email1 .
EmailField *EmailField
// The name of the field in the request payload that contains your customer's
// password. How you specify this depends on the request inspection payload type.
// - For JSON payloads, specify the field name in JSON pointer syntax. For
// information about the JSON Pointer syntax, see the Internet Engineering Task
// Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901)
// . For example, for the JSON payload { "form": { "password": "THE_PASSWORD" } }
// , the password field specification is /form/password .
// - For form encoded payload types, use the HTML form names. For example, for
// an HTML form with the input element named password1 , the password field
// specification is password1 .
PasswordField *PasswordField
// The names of the fields in the request payload that contain your customer's
// primary phone number. Order the phone number fields in the array exactly as they
// are ordered in the request payload. How you specify the phone number fields
// depends on the request inspection payload type.
// - For JSON payloads, specify the field identifiers in JSON pointer syntax.
// For information about the JSON Pointer syntax, see the Internet Engineering Task
// Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901)
// . For example, for the JSON payload { "form": { "primaryphoneline1":
// "THE_PHONE1", "primaryphoneline2": "THE_PHONE2", "primaryphoneline3":
// "THE_PHONE3" } } , the phone number field identifiers are
// /form/primaryphoneline1 , /form/primaryphoneline2 , and
// /form/primaryphoneline3 .
// - For form encoded payload types, use the HTML form names. For example, for
// an HTML form with input elements named primaryphoneline1 , primaryphoneline2 ,
// and primaryphoneline3 , the phone number field identifiers are
// primaryphoneline1 , primaryphoneline2 , and primaryphoneline3 .
PhoneNumberFields []PhoneNumberField
// The name of the field in the request payload that contains your customer's
// username. How you specify this depends on the request inspection payload type.
// - For JSON payloads, specify the field name in JSON pointer syntax. For
// information about the JSON Pointer syntax, see the Internet Engineering Task
// Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901)
// . For example, for the JSON payload { "form": { "username": "THE_USERNAME" } }
// , the username field specification is /form/username .
// - For form encoded payload types, use the HTML form names. For example, for
// an HTML form with the input element named username1 , the username field
// specification is username1
UsernameField *UsernameField
noSmithyDocumentSerde
}
// The criteria for inspecting responses to login requests and account creation
// requests, used by the ATP and ACFP rule groups to track login and account
// creation success and failure rates. Response inspection is available only in web
// ACLs that protect Amazon CloudFront distributions. The rule groups evaluates the
// responses that your protected resources send back to client login and account
// creation attempts, keeping count of successful and failed attempts from each IP
// address and client session. Using this information, the rule group labels and
// mitigates requests from client sessions and IP addresses with too much
// suspicious activity in a short amount of time. This is part of the
// AWSManagedRulesATPRuleSet and AWSManagedRulesACFPRuleSet configurations in
// ManagedRuleGroupConfig . Enable response inspection by configuring exactly one
// component of the response to inspect, for example, Header or StatusCode . You
// can't configure more than one component for inspection. If you don't configure
// any of the response inspection options, response inspection is disabled.
type ResponseInspection struct {
// Configures inspection of the response body for success and failure indicators.
// WAF can inspect the first 65,536 bytes (64 KB) of the response body.
BodyContains *ResponseInspectionBodyContains
// Configures inspection of the response header for success and failure indicators.
Header *ResponseInspectionHeader
// Configures inspection of the response JSON for success and failure indicators.
// WAF can inspect the first 65,536 bytes (64 KB) of the response JSON.
Json *ResponseInspectionJson
// Configures inspection of the response status code for success and failure
// indicators.
StatusCode *ResponseInspectionStatusCode
noSmithyDocumentSerde
}
// Configures inspection of the response body. WAF can inspect the first 65,536
// bytes (64 KB) of the response body. This is part of the ResponseInspection
// configuration for AWSManagedRulesATPRuleSet and AWSManagedRulesACFPRuleSet .
// Response inspection is available only in web ACLs that protect Amazon CloudFront
// distributions.
type ResponseInspectionBodyContains struct {
// Strings in the body of the response that indicate a failed login or account
// creation attempt. To be counted as a failure, the string can be anywhere in the
// body and must be an exact match, including case. Each string must be unique
// among the success and failure strings. JSON example: "FailureStrings": [
// "Request failed" ]
//
// This member is required.
FailureStrings []string
// Strings in the body of the response that indicate a successful login or account
// creation attempt. To be counted as a success, the string can be anywhere in the
// body and must be an exact match, including case. Each string must be unique
// among the success and failure strings. JSON examples: "SuccessStrings": [
// "Login successful" ] and "SuccessStrings": [ "Account creation successful",
// "Welcome to our site!" ]
//
// This member is required.
SuccessStrings []string
noSmithyDocumentSerde
}
// Configures inspection of the response header. This is part of the
// ResponseInspection configuration for AWSManagedRulesATPRuleSet and
// AWSManagedRulesACFPRuleSet . Response inspection is available only in web ACLs
// that protect Amazon CloudFront distributions.
type ResponseInspectionHeader struct {
// Values in the response header with the specified name that indicate a failed
// login or account creation attempt. To be counted as a failure, the value must be
// an exact match, including case. Each value must be unique among the success and
// failure values. JSON examples: "FailureValues": [ "LoginFailed", "Failed login"
// ] and "FailureValues": [ "AccountCreationFailed" ]
//
// This member is required.
FailureValues []string
// The name of the header to match against. The name must be an exact match,
// including case. JSON example: "Name": [ "RequestResult" ]
//
// This member is required.
Name *string
// Values in the response header with the specified name that indicate a
// successful login or account creation attempt. To be counted as a success, the
// value must be an exact match, including case. Each value must be unique among
// the success and failure values. JSON examples: "SuccessValues": [
// "LoginPassed", "Successful login" ] and "SuccessValues": [ "AccountCreated",
// "Successful account creation" ]
//
// This member is required.
SuccessValues []string
noSmithyDocumentSerde
}
// Configures inspection of the response JSON. WAF can inspect the first 65,536
// bytes (64 KB) of the response JSON. This is part of the ResponseInspection
// configuration for AWSManagedRulesATPRuleSet and AWSManagedRulesACFPRuleSet .
// Response inspection is available only in web ACLs that protect Amazon CloudFront
// distributions.
type ResponseInspectionJson struct {
// Values for the specified identifier in the response JSON that indicate a failed
// login or account creation attempt. To be counted as a failure, the value must be
// an exact match, including case. Each value must be unique among the success and
// failure values. JSON example: "FailureValues": [ "False", "Failed" ]
//
// This member is required.
FailureValues []string
// The identifier for the value to match against in the JSON. The identifier must
// be an exact match, including case. JSON examples: "Identifier": [
// "/login/success" ] and "Identifier": [ "/sign-up/success" ]
//
// This member is required.
Identifier *string
// Values for the specified identifier in the response JSON that indicate a
// successful login or account creation attempt. To be counted as a success, the
// value must be an exact match, including case. Each value must be unique among
// the success and failure values. JSON example: "SuccessValues": [ "True",
// "Succeeded" ]
//
// This member is required.
SuccessValues []string
noSmithyDocumentSerde
}
// Configures inspection of the response status code. This is part of the
// ResponseInspection configuration for AWSManagedRulesATPRuleSet and
// AWSManagedRulesACFPRuleSet . Response inspection is available only in web ACLs
// that protect Amazon CloudFront distributions.
type ResponseInspectionStatusCode struct {
// Status codes in the response that indicate a failed login or account creation
// attempt. To be counted as a failure, the response status code must match one of
// these. Each code must be unique among the success and failure status codes. JSON
// example: "FailureCodes": [ 400, 404 ]
//
// This member is required.
FailureCodes []int32
// Status codes in the response that indicate a successful login or account
// creation attempt. To be counted as a success, the response status code must
// match one of these. Each code must be unique among the success and failure
// status codes. JSON example: "SuccessCodes": [ 200, 201 ]
//
// This member is required.
SuccessCodes []int32
noSmithyDocumentSerde
}
// A single rule, which you can use in a WebACL or RuleGroup to identify web
// requests that you want to allow, block, or count. Each rule includes one
// top-level Statement that WAF uses to identify matching web requests, and
// parameters that govern how WAF handles them.
type Rule struct {
// The name of the rule. You can't change the name of a Rule after you create it.
//
// This member is required.
Name *string
// If you define more than one Rule in a WebACL , WAF evaluates each request
// against the Rules in order based on the value of Priority . WAF processes rules
// with lower priority first. The priorities don't need to be consecutive, but they
// must all be different.
//
// This member is required.
Priority int32
// The WAF processing statement for the rule, for example ByteMatchStatement or
// SizeConstraintStatement .
//
// This member is required.
Statement *Statement
// Defines and enables Amazon CloudWatch metrics and web request sample collection.
//
// This member is required.
VisibilityConfig *VisibilityConfig
// The action that WAF should take on a web request when it matches the rule
// statement. Settings at the web ACL level can override the rule action setting.
// This is used only for rules whose statements do not reference a rule group. Rule
// statements that reference a rule group include RuleGroupReferenceStatement and
// ManagedRuleGroupStatement . You must specify either this Action setting or the
// rule OverrideAction setting, but not both:
// - If the rule statement does not reference a rule group, use this rule action
// setting and not the rule override action setting.
// - If the rule statement references a rule group, use the override action
// setting and not this action setting.
Action *RuleAction
// Specifies how WAF should handle CAPTCHA evaluations. If you don't specify this,
// WAF uses the CAPTCHA configuration that's defined for the web ACL.
CaptchaConfig *CaptchaConfig
// Specifies how WAF should handle Challenge evaluations. If you don't specify
// this, WAF uses the challenge configuration that's defined for the web ACL.
ChallengeConfig *ChallengeConfig
// The action to use in the place of the action that results from the rule group
// evaluation. Set the override action to none to leave the result of the rule
// group alone. Set it to count to override the result to count only. You can only
// use this for rule statements that reference a rule group, like
// RuleGroupReferenceStatement and ManagedRuleGroupStatement . This option is
// usually set to none. It does not affect how the rules in the rule group are
// evaluated. If you want the rules in the rule group to only count matches, do not
// use this and instead use the rule action override option, with Count action, in
// your rule group reference statement settings.
OverrideAction *OverrideAction
// Labels to apply to web requests that match the rule match statement. WAF
// applies fully qualified labels to matching web requests. A fully qualified label
// is the concatenation of a label namespace and a rule label. The rule's rule
// group or web ACL defines the label namespace. Rules that run after this rule in
// the web ACL can match against these labels using a LabelMatchStatement . For
// each label, provide a case-sensitive string containing optional namespaces and a
// label name, according to the following guidelines:
// - Separate each component of the label with a colon.
// - Each namespace or name can have up to 128 characters.
// - You can specify up to 5 namespaces in a label.
// - Don't use the following reserved words in your label specification: aws ,
// waf , managed , rulegroup , webacl , regexpatternset , or ipset .
// For example, myLabelName or nameSpace1:nameSpace2:myLabelName .
RuleLabels []Label
noSmithyDocumentSerde
}
// The action that WAF should take on a web request when it matches a rule's
// statement. Settings at the web ACL level can override the rule action setting.
type RuleAction struct {
// Instructs WAF to allow the web request.
Allow *AllowAction
// Instructs WAF to block the web request.
Block *BlockAction
// Instructs WAF to run a CAPTCHA check against the web request.
Captcha *CaptchaAction
// Instructs WAF to run a Challenge check against the web request.
Challenge *ChallengeAction
// Instructs WAF to count the web request and then continue evaluating the request
// using the remaining rules in the web ACL.
Count *CountAction
noSmithyDocumentSerde
}
// Action setting to use in the place of a rule action that is configured inside
// the rule group. You specify one override for each rule whose action you want to
// change. You can use overrides for testing, for example you can override all of
// rule actions to Count and then monitor the resulting count metrics to
// understand how the rule group would handle your web traffic. You can also
// permanently override some or all actions, to modify how the rule group manages
// your web traffic.
type RuleActionOverride struct {
// The override action to use, in place of the configured action of the rule in
// the rule group.
//
// This member is required.
ActionToUse *RuleAction
// The name of the rule to override.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
// A rule group defines a collection of rules to inspect and control web requests
// that you can use in a WebACL . When you create a rule group, you define an
// immutable capacity limit. If you update a rule group, you must stay within the
// capacity. This allows others to reuse the rule group with confidence in its
// capacity requirements.
type RuleGroup struct {
// The Amazon Resource Name (ARN) of the entity.
//
// This member is required.
ARN *string
// The web ACL capacity units (WCUs) required for this rule group. When you create
// your own rule group, you define this, and you cannot change it after creation.
// When you add or modify the rules in a rule group, WAF enforces this limit. You
// can check the capacity for a set of rules using CheckCapacity . WAF uses WCUs to
// calculate and control the operating resources that are used to run your rules,
// rule groups, and web ACLs. WAF calculates capacity differently for each rule
// type, to reflect the relative cost of each rule. Simple rules that cost little
// to run use fewer WCUs than more complex rules that use more processing power.
// Rule group capacity is fixed at creation, which helps users plan their web ACL
// WCU usage when they use a rule group. For more information, see WAF web ACL
// capacity units (WCU) (https://docs.aws.amazon.com/waf/latest/developerguide/aws-waf-capacity-units.html)
// in the WAF Developer Guide.
//
// This member is required.
Capacity int64
// A unique identifier for the rule group. This ID is returned in the responses to
// create and list commands. You provide it to operations like update and delete.
//
// This member is required.
Id *string
// The name of the rule group. You cannot change the name of a rule group after
// you create it.
//
// This member is required.
Name *string
// Defines and enables Amazon CloudWatch metrics and web request sample collection.
//
// This member is required.
VisibilityConfig *VisibilityConfig
// The labels that one or more rules in this rule group add to matching web
// requests. These labels are defined in the RuleLabels for a Rule .
AvailableLabels []LabelSummary
// The labels that one or more rules in this rule group match against in label
// match statements. These labels are defined in a LabelMatchStatement
// specification, in the Statement definition of a rule.
ConsumedLabels []LabelSummary
// A map of custom response keys and content bodies. When you create a rule with a
// block action, you can send a custom response to the web request. You define
// these for the rule group, and then use them in the rules that you define in the
// rule group. For information about customizing web requests and responses, see
// Customizing web requests and responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html)
// in the WAF Developer Guide. For information about the limits on count and size
// for custom request and response settings, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html)
// in the WAF Developer Guide.
CustomResponseBodies map[string]CustomResponseBody
// A description of the rule group that helps with identification.
Description *string
// The label namespace prefix for this rule group. All labels added by rules in
// this rule group have this prefix.
// - The syntax for the label namespace prefix for your rule groups is the
// following: awswaf::rulegroup::
// - When a rule with a label matches a web request, WAF adds the fully
// qualified label to the request. A fully qualified label is made up of the label
// namespace from the rule group or web ACL where the rule is defined and the label
// from the rule, separated by a colon: :
LabelNamespace *string
// The Rule statements used to identify the web requests that you want to allow,
// block, or count. Each rule includes one top-level statement that WAF uses to
// identify matching web requests, and parameters that govern how WAF handles them.
Rules []Rule
noSmithyDocumentSerde
}
// A rule statement used to run the rules that are defined in a RuleGroup . To use
// this, create a rule group with your rules, then provide the ARN of the rule
// group in this statement. You cannot nest a RuleGroupReferenceStatement , for
// example for use inside a NotStatement or OrStatement . You can only use a rule
// group reference statement at the top level inside a web ACL.
type RuleGroupReferenceStatement struct {
// The Amazon Resource Name (ARN) of the entity.
//
// This member is required.
ARN *string
// Rules in the referenced rule group whose actions are set to Count . Instead of
// this option, use RuleActionOverrides . It accepts any valid action setting,
// including Count .
ExcludedRules []ExcludedRule
// Action settings to use in the place of the rule actions that are configured
// inside the rule group. You specify one override for each rule whose action you
// want to change. You can use overrides for testing, for example you can override
// all of rule actions to Count and then monitor the resulting count metrics to
// understand how the rule group would handle your web traffic. You can also
// permanently override some or all actions, to modify how the rule group manages
// your web traffic.
RuleActionOverrides []RuleActionOverride
noSmithyDocumentSerde
}
// High-level information about a RuleGroup , returned by operations like create
// and list. This provides information like the ID, that you can use to retrieve
// and manage a RuleGroup , and the ARN, that you provide to the
// RuleGroupReferenceStatement to use the rule group in a Rule .
type RuleGroupSummary struct {
// The Amazon Resource Name (ARN) of the entity.
ARN *string
// A description of the rule group that helps with identification.
Description *string
// A unique identifier for the rule group. This ID is returned in the responses to
// create and list commands. You provide it to operations like update and delete.
Id *string
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
LockToken *string
// The name of the data type instance. You cannot change the name after you create
// the instance.
Name *string
noSmithyDocumentSerde
}
// High-level information about a Rule , returned by operations like
// DescribeManagedRuleGroup . This provides information like the ID, that you can
// use to retrieve and manage a RuleGroup , and the ARN, that you provide to the
// RuleGroupReferenceStatement to use the rule group in a Rule .
type RuleSummary struct {
// The action that WAF should take on a web request when it matches a rule's
// statement. Settings at the web ACL level can override the rule action setting.
Action *RuleAction
// The name of the rule.
Name *string
noSmithyDocumentSerde
}
// Represents a single sampled web request. The response from GetSampledRequests
// includes a SampledHTTPRequests complex type that appears as SampledRequests in
// the response syntax. SampledHTTPRequests contains an array of SampledHTTPRequest
// objects.
type SampledHTTPRequest struct {
// A complex type that contains detailed information about the request.
//
// This member is required.
Request *HTTPRequest
// A value that indicates how one result in the response relates proportionally to
// other results in the response. For example, a result that has a weight of 2
// represents roughly twice as many web requests as a result that has a weight of 1
// .
//
// This member is required.
Weight int64
// The action that WAF applied to the request.
Action *string
// The CAPTCHA response for the request.
CaptchaResponse *CaptchaResponse
// The Challenge response for the request.
ChallengeResponse *ChallengeResponse
// Labels applied to the web request by matching rules. WAF applies fully
// qualified labels to matching web requests. A fully qualified label is the
// concatenation of a label namespace and a rule label. The rule's rule group or
// web ACL defines the label namespace. For example,
// awswaf:111122223333:myRuleGroup:testRules:testNS1:testNS2:labelNameA or
// awswaf:managed:aws:managed-rule-set:header:encoding:utf8 .
Labels []Label
// Used only for rule group rules that have a rule action override in place in the
// web ACL. This is the action that the rule group rule is configured for, and not
// the action that was applied to the request. The action that WAF applied is the
// Action value.
OverriddenAction *string
// Custom request headers inserted by WAF into the request, according to the
// custom request configuration for the matching rule action.
RequestHeadersInserted []HTTPHeader
// The response code that was sent for the request.
ResponseCodeSent *int32
// The name of the Rule that the request matched. For managed rule groups, the
// format for this name is ## . For your own rule groups, the format for this name
// is # . If the rule is not in a rule group, this field is absent.
RuleNameWithinRuleGroup *string
// The time at which WAF received the request from your Amazon Web Services
// resource, in Unix time format (in seconds).
Timestamp *time.Time
noSmithyDocumentSerde
}
// Inspect one of the headers in the web request, identified by name, for example,
// User-Agent or Referer . The name isn't case sensitive. You can filter and
// inspect all headers with the FieldToMatch setting Headers . This is used to
// indicate the web request component to inspect, in the FieldToMatch
// specification. Example JSON: "SingleHeader": { "Name": "haystack" }
type SingleHeader struct {
// The name of the query header to inspect.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
// Inspect one query argument in the web request, identified by name, for example
// UserName or SalesRegion. The name isn't case sensitive. This is used to indicate
// the web request component to inspect, in the FieldToMatch specification.
// Example JSON: "SingleQueryArgument": { "Name": "myArgument" }
type SingleQueryArgument struct {
// The name of the query argument to inspect.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
// A rule statement that compares a number of bytes against the size of a request
// component, using a comparison operator, such as greater than (>) or less than
// (<). For example, you can use a size constraint statement to look for query
// strings that are longer than 100 bytes. If you configure WAF to inspect the
// request body, WAF inspects only the number of bytes of the body up to the limit
// for the web ACL. By default, for regional web ACLs, this limit is 8 KB (8,192
// kilobytes) and for CloudFront web ACLs, this limit is 16 KB (16,384 kilobytes).
// For CloudFront web ACLs, you can increase the limit in the web ACL
// AssociationConfig , for additional fees. If you know that the request body for
// your web requests should never exceed the inspection limit, you could use a size
// constraint statement to block requests that have a larger request body size. If
// you choose URI for the value of Part of the request to filter on, the slash (/)
// in the URI counts as one character. For example, the URI /logo.jpg is nine
// characters long.
type SizeConstraintStatement struct {
// The operator to use to compare the request part to the size setting.
//
// This member is required.
ComparisonOperator ComparisonOperator
// The part of the web request that you want WAF to inspect.
//
// This member is required.
FieldToMatch *FieldToMatch
// The size, in byte, to compare to the request part, after any transformations.
//
// This member is required.
Size int64
// Text transformations eliminate some of the unusual formatting that attackers
// use in web requests in an effort to bypass detection. Text transformations are
// used in rule match statements, to transform the FieldToMatch request component
// before inspecting it, and they're used in rate-based rule statements, to
// transform request components before using them as custom aggregation keys. If
// you specify one or more transformations to apply, WAF performs all
// transformations on the specified content, starting from the lowest priority
// setting, and then uses the component contents.
//
// This member is required.
TextTransformations []TextTransformation
noSmithyDocumentSerde
}
// A rule statement that inspects for malicious SQL code. Attackers insert
// malicious SQL code into web requests to do things like modify your database or
// extract data from it.
type SqliMatchStatement struct {
// The part of the web request that you want WAF to inspect.
//
// This member is required.
FieldToMatch *FieldToMatch
// Text transformations eliminate some of the unusual formatting that attackers
// use in web requests in an effort to bypass detection. Text transformations are
// used in rule match statements, to transform the FieldToMatch request component
// before inspecting it, and they're used in rate-based rule statements, to
// transform request components before using them as custom aggregation keys. If
// you specify one or more transformations to apply, WAF performs all
// transformations on the specified content, starting from the lowest priority
// setting, and then uses the component contents.
//
// This member is required.
TextTransformations []TextTransformation
// The sensitivity that you want WAF to use to inspect for SQL injection attacks.
// HIGH detects more attacks, but might generate more false positives, especially
// if your web requests frequently contain unusual strings. For information about
// identifying and mitigating false positives, see Testing and tuning (https://docs.aws.amazon.com/waf/latest/developerguide/web-acl-testing.html)
// in the WAF Developer Guide. LOW is generally a better choice for resources that
// already have other protections against SQL injection attacks or that have a low
// tolerance for false positives. Default: LOW
SensitivityLevel SensitivityLevel
noSmithyDocumentSerde
}
// The processing guidance for a Rule , used by WAF to determine whether a web
// request matches the rule. For example specifications, see the examples section
// of CreateWebACL .
type Statement struct {
// A logical rule statement used to combine other rule statements with AND logic.
// You provide more than one Statement within the AndStatement .
AndStatement *AndStatement
// A rule statement that defines a string match search for WAF to apply to web
// requests. The byte match statement provides the bytes to search for, the
// location in requests that you want WAF to search, and other settings. The bytes
// to search for are typically a string that corresponds with ASCII characters. In
// the WAF console and the developer guide, this is called a string match
// statement.
ByteMatchStatement *ByteMatchStatement
// A rule statement that labels web requests by country and region and that
// matches against web requests based on country code. A geo match rule labels
// every request that it inspects regardless of whether it finds a match.
// - To manage requests only by country, you can use this statement by itself
// and specify the countries that you want to match against in the CountryCodes
// array.
// - Otherwise, configure your geo match rule with Count action so that it only
// labels requests. Then, add one or more label match rules to run after the geo
// match rule and configure them to match against the geographic labels and handle
// the requests as needed.
// WAF labels requests using the alpha-2 country and region codes from the
// International Organization for Standardization (ISO) 3166 standard. WAF
// determines the codes using either the IP address in the web request origin or,
// if you specify it, the address in the geo match ForwardedIPConfig . If you use
// the web request origin, the label formats are awswaf:clientip:geo:region:- and
// awswaf:clientip:geo:country: . If you use a forwarded IP address, the label
// formats are awswaf:forwardedip:geo:region:- and awswaf:forwardedip:geo:country:
// . For additional details, see Geographic match rule statement (https://docs.aws.amazon.com/waf/latest/developerguide/waf-rule-statement-type-geo-match.html)
// in the WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)
// .
GeoMatchStatement *GeoMatchStatement
// A rule statement used to detect web requests coming from particular IP
// addresses or address ranges. To use this, create an IPSet that specifies the
// addresses you want to detect, then use the ARN of that set in this statement. To
// create an IP set, see CreateIPSet . Each IP set rule statement references an IP
// set. You create and maintain the set independent of your rules. This allows you
// to use the single set in multiple rules. When you update the referenced set, WAF
// automatically updates all rules that reference it.
IPSetReferenceStatement *IPSetReferenceStatement
// A rule statement to match against labels that have been added to the web
// request by rules that have already run in the web ACL. The label match statement
// provides the label or namespace string to search for. The label string can
// represent a part or all of the fully qualified label name that had been added to
// the web request. Fully qualified labels have a prefix, optional namespaces, and
// label name. The prefix identifies the rule group or web ACL context of the rule
// that added the label. If you do not provide the fully qualified name in your
// label match string, WAF performs the search for labels that were added in the
// same context as the label match statement.
LabelMatchStatement *LabelMatchStatement
// A rule statement used to run the rules that are defined in a managed rule
// group. To use this, provide the vendor name and the name of the rule group in
// this statement. You can retrieve the required names by calling
// ListAvailableManagedRuleGroups . You cannot nest a ManagedRuleGroupStatement ,
// for example for use inside a NotStatement or OrStatement . It can only be
// referenced as a top-level statement within a rule. You are charged additional
// fees when you use the WAF Bot Control managed rule group
// AWSManagedRulesBotControlRuleSet , the WAF Fraud Control account takeover
// prevention (ATP) managed rule group AWSManagedRulesATPRuleSet , or the WAF Fraud
// Control account creation fraud prevention (ACFP) managed rule group
// AWSManagedRulesACFPRuleSet . For more information, see WAF Pricing (http://aws.amazon.com/waf/pricing/)
// .
ManagedRuleGroupStatement *ManagedRuleGroupStatement
// A logical rule statement used to negate the results of another rule statement.
// You provide one Statement within the NotStatement .
NotStatement *NotStatement
// A logical rule statement used to combine other rule statements with OR logic.
// You provide more than one Statement within the OrStatement .
OrStatement *OrStatement
// A rate-based rule counts incoming requests and rate limits requests when they
// are coming at too fast a rate. The rule categorizes requests according to your
// aggregation criteria, collects them into aggregation instances, and counts and
// rate limits the requests for each instance. You can specify individual
// aggregation keys, like IP address or HTTP method. You can also specify
// aggregation key combinations, like IP address and HTTP method, or HTTP method,
// query argument, and cookie. Each unique set of values for the aggregation keys
// that you specify is a separate aggregation instance, with the value from each
// key contributing to the aggregation instance definition. For example, assume the
// rule evaluates web requests with the following IP address and HTTP method
// values:
// - IP address 10.1.1.1, HTTP method POST
// - IP address 10.1.1.1, HTTP method GET
// - IP address 127.0.0.0, HTTP method POST
// - IP address 10.1.1.1, HTTP method GET
// The rule would create different aggregation instances according to your
// aggregation criteria, for example:
// - If the aggregation criteria is just the IP address, then each individual
// address is an aggregation instance, and WAF counts requests separately for each.
// The aggregation instances and request counts for our example would be the
// following:
// - IP address 10.1.1.1: count 3
// - IP address 127.0.0.0: count 1
// - If the aggregation criteria is HTTP method, then each individual HTTP
// method is an aggregation instance. The aggregation instances and request counts
// for our example would be the following:
// - HTTP method POST: count 2
// - HTTP method GET: count 2
// - If the aggregation criteria is IP address and HTTP method, then each IP
// address and each HTTP method would contribute to the combined aggregation
// instance. The aggregation instances and request counts for our example would be
// the following:
// - IP address 10.1.1.1, HTTP method POST: count 1
// - IP address 10.1.1.1, HTTP method GET: count 2
// - IP address 127.0.0.0, HTTP method POST: count 1
// For any n-tuple of aggregation keys, each unique combination of values for the
// keys defines a separate aggregation instance, which WAF counts and rate-limits
// individually. You can optionally nest another statement inside the rate-based
// statement, to narrow the scope of the rule so that it only counts and rate
// limits requests that match the nested statement. You can use this nested
// scope-down statement in conjunction with your aggregation key specifications or
// you can just count and rate limit all requests that match the scope-down
// statement, without additional aggregation. When you choose to just manage all
// requests that match a scope-down statement, the aggregation instance is singular
// for the rule. You cannot nest a RateBasedStatement inside another statement,
// for example inside a NotStatement or OrStatement . You can define a
// RateBasedStatement inside a web ACL and inside a rule group. For additional
// information about the options, see Rate limiting web requests using rate-based
// rules (https://docs.aws.amazon.com/waf/latest/developerguide/waf-rate-based-rules.html)
// in the WAF Developer Guide. If you only aggregate on the individual IP address
// or forwarded IP address, you can retrieve the list of IP addresses that WAF is
// currently rate limiting for a rule through the API call
// GetRateBasedStatementManagedKeys . This option is not available for other
// aggregation configurations. WAF tracks and manages web requests separately for
// each instance of a rate-based rule that you use. For example, if you provide the
// same rate-based rule settings in two web ACLs, each of the two rule statements
// represents a separate instance of the rate-based rule and gets its own tracking
// and management by WAF. If you define a rate-based rule inside a rule group, and
// then use that rule group in multiple places, each use creates a separate
// instance of the rate-based rule that gets its own tracking and management by
// WAF.
RateBasedStatement *RateBasedStatement
// A rule statement used to search web request components for a match against a
// single regular expression.
RegexMatchStatement *RegexMatchStatement
// A rule statement used to search web request components for matches with regular
// expressions. To use this, create a RegexPatternSet that specifies the
// expressions that you want to detect, then use the ARN of that set in this
// statement. A web request matches the pattern set rule statement if the request
// component matches any of the patterns in the set. To create a regex pattern set,
// see CreateRegexPatternSet . Each regex pattern set rule statement references a
// regex pattern set. You create and maintain the set independent of your rules.
// This allows you to use the single set in multiple rules. When you update the
// referenced set, WAF automatically updates all rules that reference it.
RegexPatternSetReferenceStatement *RegexPatternSetReferenceStatement
// A rule statement used to run the rules that are defined in a RuleGroup . To use
// this, create a rule group with your rules, then provide the ARN of the rule
// group in this statement. You cannot nest a RuleGroupReferenceStatement , for
// example for use inside a NotStatement or OrStatement . You can only use a rule
// group reference statement at the top level inside a web ACL.
RuleGroupReferenceStatement *RuleGroupReferenceStatement
// A rule statement that compares a number of bytes against the size of a request
// component, using a comparison operator, such as greater than (>) or less than
// (<). For example, you can use a size constraint statement to look for query
// strings that are longer than 100 bytes. If you configure WAF to inspect the
// request body, WAF inspects only the number of bytes of the body up to the limit
// for the web ACL. By default, for regional web ACLs, this limit is 8 KB (8,192
// kilobytes) and for CloudFront web ACLs, this limit is 16 KB (16,384 kilobytes).
// For CloudFront web ACLs, you can increase the limit in the web ACL
// AssociationConfig , for additional fees. If you know that the request body for
// your web requests should never exceed the inspection limit, you could use a size
// constraint statement to block requests that have a larger request body size. If
// you choose URI for the value of Part of the request to filter on, the slash (/)
// in the URI counts as one character. For example, the URI /logo.jpg is nine
// characters long.
SizeConstraintStatement *SizeConstraintStatement
// A rule statement that inspects for malicious SQL code. Attackers insert
// malicious SQL code into web requests to do things like modify your database or
// extract data from it.
SqliMatchStatement *SqliMatchStatement
// A rule statement that inspects for cross-site scripting (XSS) attacks. In XSS
// attacks, the attacker uses vulnerabilities in a benign website as a vehicle to
// inject malicious client-site scripts into other legitimate web browsers.
XssMatchStatement *XssMatchStatement
noSmithyDocumentSerde
}
// A tag associated with an Amazon Web Services resource. Tags are key:value pairs
// that you can use to categorize and manage your resources, for purposes like
// billing or other management. Typically, the tag key represents a category, such
// as "environment", and the tag value represents a specific value within that
// category, such as "test," "development," or "production". Or you might set the
// tag key to "customer" and the value to the customer name or ID. You can specify
// one or more tags to add to each Amazon Web Services resource, up to 50 tags for
// a resource. You can tag the Amazon Web Services resources that you manage
// through WAF: web ACLs, rule groups, IP sets, and regex pattern sets. You can't
// manage or view tags through the WAF console.
type Tag struct {
// Part of the key:value pair that defines a tag. You can use a tag key to
// describe a category of information, such as "customer." Tag keys are
// case-sensitive.
//
// This member is required.
Key *string
// Part of the key:value pair that defines a tag. You can use a tag value to
// describe a specific value within a category, such as "companyA" or "companyB."
// Tag values are case-sensitive.
//
// This member is required.
Value *string
noSmithyDocumentSerde
}
// The collection of tagging definitions for an Amazon Web Services resource. Tags
// are key:value pairs that you can use to categorize and manage your resources,
// for purposes like billing or other management. Typically, the tag key represents
// a category, such as "environment", and the tag value represents a specific value
// within that category, such as "test," "development," or "production". Or you
// might set the tag key to "customer" and the value to the customer name or ID.
// You can specify one or more tags to add to each Amazon Web Services resource, up
// to 50 tags for a resource. You can tag the Amazon Web Services resources that
// you manage through WAF: web ACLs, rule groups, IP sets, and regex pattern sets.
// You can't manage or view tags through the WAF console.
type TagInfoForResource struct {
// The Amazon Resource Name (ARN) of the resource.
ResourceARN *string
// The array of Tag objects defined for the resource.
TagList []Tag
noSmithyDocumentSerde
}
// Text transformations eliminate some of the unusual formatting that attackers
// use in web requests in an effort to bypass detection.
type TextTransformation struct {
// Sets the relative processing order for multiple transformations. WAF processes
// all transformations, from lowest priority to highest, before inspecting the
// transformed content. The priorities don't need to be consecutive, but they must
// all be different.
//
// This member is required.
Priority int32
// You can specify the following transformation types: BASE64_DECODE - Decode a
// Base64 -encoded string. BASE64_DECODE_EXT - Decode a Base64 -encoded string, but
// use a forgiving implementation that ignores characters that aren't valid.
// CMD_LINE - Command-line transformations. These are helpful in reducing
// effectiveness of attackers who inject an operating system command-line command
// and use unusual formatting to disguise some or all of the command.
// - Delete the following characters: \ " ' ^
// - Delete spaces before the following characters: / (
// - Replace the following characters with a space: , ;
// - Replace multiple spaces with one space
// - Convert uppercase letters (A-Z) to lowercase (a-z)
// COMPRESS_WHITE_SPACE - Replace these characters with a space character (decimal
// 32):
// - \f , formfeed, decimal 12
// - \t , tab, decimal 9
// - \n , newline, decimal 10
// - \r , carriage return, decimal 13
// - \v , vertical tab, decimal 11
// - Non-breaking space, decimal 160
// COMPRESS_WHITE_SPACE also replaces multiple spaces with one space. CSS_DECODE -
// Decode characters that were encoded using CSS 2.x escape rules
// syndata.html#characters . This function uses up to two bytes in the decoding
// process, so it can help to uncover ASCII characters that were encoded using CSS
// encoding that wouldn’t typically be encoded. It's also useful in countering
// evasion, which is a combination of a backslash and non-hexadecimal characters.
// For example, ja\vascript for javascript. ESCAPE_SEQ_DECODE - Decode the
// following ANSI C escape sequences: \a , \b , \f , \n , \r , \t , \v , \\ , \? ,
// \' , \" , \xHH (hexadecimal), \0OOO (octal). Encodings that aren't valid remain
// in the output. HEX_DECODE - Decode a string of hexadecimal characters into a
// binary. HTML_ENTITY_DECODE - Replace HTML-encoded characters with unencoded
// characters. HTML_ENTITY_DECODE performs these operations:
// - Replaces (ampersand)quot; with "
// - Replaces (ampersand)nbsp; with a non-breaking space, decimal 160
// - Replaces (ampersand)lt; with a "less than" symbol
// - Replaces (ampersand)gt; with >
// - Replaces characters that are represented in hexadecimal format,
// (ampersand)#xhhhh; , with the corresponding characters
// - Replaces characters that are represented in decimal format,
// (ampersand)#nnnn; , with the corresponding characters
// JS_DECODE - Decode JavaScript escape sequences. If a \
// u
// HHHH code is in the full-width ASCII code range of FF01-FF5E , then the higher
// byte is used to detect and adjust the lower byte. If not, only the lower byte is
// used and the higher byte is zeroed, causing a possible loss of information.
// LOWERCASE - Convert uppercase letters (A-Z) to lowercase (a-z). MD5 - Calculate
// an MD5 hash from the data in the input. The computed hash is in a raw binary
// form. NONE - Specify NONE if you don't want any text transformations.
// NORMALIZE_PATH - Remove multiple slashes, directory self-references, and
// directory back-references that are not at the beginning of the input from an
// input string. NORMALIZE_PATH_WIN - This is the same as NORMALIZE_PATH , but
// first converts backslash characters to forward slashes. REMOVE_NULLS - Remove
// all NULL bytes from the input. REPLACE_COMMENTS - Replace each occurrence of a
// C-style comment ( /* ... */ ) with a single space. Multiple consecutive
// occurrences are not compressed. Unterminated comments are also replaced with a
// space (ASCII 0x20). However, a standalone termination of a comment ( */ ) is not
// acted upon. REPLACE_NULLS - Replace NULL bytes in the input with space
// characters (ASCII 0x20 ). SQL_HEX_DECODE - Decode SQL hex data. Example (
// 0x414243 ) will be decoded to ( ABC ). URL_DECODE - Decode a URL-encoded value.
// URL_DECODE_UNI - Like URL_DECODE , but with support for Microsoft-specific %u
// encoding. If the code is in the full-width ASCII code range of FF01-FF5E , the
// higher byte is used to detect and adjust the lower byte. Otherwise, only the
// lower byte is used and the higher byte is zeroed. UTF8_TO_UNICODE - Convert all
// UTF-8 character sequences to Unicode. This helps input normalization, and
// minimizing false-positives and false-negatives for non-English languages.
//
// This member is required.
Type TextTransformationType
noSmithyDocumentSerde
}
// In a GetSampledRequests request, the StartTime and EndTime objects specify the
// time range for which you want WAF to return a sample of web requests. You must
// specify the times in Coordinated Universal Time (UTC) format. UTC format
// includes the special designator, Z . For example, "2016-09-27T14:50Z" . You can
// specify any time range in the previous three hours. In a GetSampledRequests
// response, the StartTime and EndTime objects specify the time range for which
// WAF actually returned a sample of web requests. WAF gets the specified number of
// requests from among the first 5,000 requests that your Amazon Web Services
// resource receives during the specified time period. If your resource receives
// more than 5,000 requests during that period, WAF stops sampling after the
// 5,000th request. In that case, EndTime is the time that WAF received the
// 5,000th request.
type TimeWindow struct {
// The end of the time range from which you want GetSampledRequests to return a
// sample of the requests that your Amazon Web Services resource received. You must
// specify the times in Coordinated Universal Time (UTC) format. UTC format
// includes the special designator, Z . For example, "2016-09-27T14:50Z" . You can
// specify any time range in the previous three hours.
//
// This member is required.
EndTime *time.Time
// The beginning of the time range from which you want GetSampledRequests to
// return a sample of the requests that your Amazon Web Services resource received.
// You must specify the times in Coordinated Universal Time (UTC) format. UTC
// format includes the special designator, Z . For example, "2016-09-27T14:50Z" .
// You can specify any time range in the previous three hours.
//
// This member is required.
StartTime *time.Time
noSmithyDocumentSerde
}
// Inspect the path component of the URI of the web request. This is the part of
// the web request that identifies a resource. For example, /images/daily-ad.jpg .
// This is used in the FieldToMatch specification for some web request component
// types. JSON specification: "UriPath": {}
type UriPath struct {
noSmithyDocumentSerde
}
// The name of the field in the request payload that contains your customer's
// username. This data type is used in the RequestInspection and
// RequestInspectionACFP data types.
type UsernameField struct {
// The name of the username field. How you specify this depends on the request
// inspection payload type.
// - For JSON payloads, specify the field name in JSON pointer syntax. For
// information about the JSON Pointer syntax, see the Internet Engineering Task
// Force (IETF) documentation JavaScript Object Notation (JSON) Pointer (https://tools.ietf.org/html/rfc6901)
// . For example, for the JSON payload { "form": { "username": "THE_USERNAME" } }
// , the username field specification is /form/username .
// - For form encoded payload types, use the HTML form names. For example, for
// an HTML form with the input element named username1 , the username field
// specification is username1
//
// This member is required.
Identifier *string
noSmithyDocumentSerde
}
// A version of the named managed rule group, that the rule group's vendor
// publishes for use by customers. This is intended for use only by vendors of
// managed rule sets. Vendors are Amazon Web Services and Amazon Web Services
// Marketplace sellers. Vendors, you can use the managed rule set APIs to provide
// controlled rollout of your versioned managed rule group offerings for your
// customers. The APIs are ListManagedRuleSets , GetManagedRuleSet ,
// PutManagedRuleSetVersions , and UpdateManagedRuleSetVersionExpiryDate .
type VersionToPublish struct {
// The Amazon Resource Name (ARN) of the vendor's rule group that's used in the
// published managed rule group version.
AssociatedRuleGroupArn *string
// The amount of time the vendor expects this version of the managed rule group to
// last, in days.
ForecastedLifetime *int32
noSmithyDocumentSerde
}
// Defines and enables Amazon CloudWatch metrics and web request sample collection.
type VisibilityConfig struct {
// Indicates whether the associated resource sends metrics to Amazon CloudWatch.
// For the list of available metrics, see WAF Metrics (https://docs.aws.amazon.com/waf/latest/developerguide/monitoring-cloudwatch.html#waf-metrics)
// in the WAF Developer Guide. For web ACLs, the metrics are for web requests that
// have the web ACL default action applied. WAF applies the default action to web
// requests that pass the inspection of all rules in the web ACL without being
// either allowed or blocked. For more information, see The web ACL default action (https://docs.aws.amazon.com/waf/latest/developerguide/web-acl-default-action.html)
// in the WAF Developer Guide.
//
// This member is required.
CloudWatchMetricsEnabled bool
// A name of the Amazon CloudWatch metric dimension. The name can contain only the
// characters: A-Z, a-z, 0-9, - (hyphen), and _ (underscore). The name can be from
// one to 128 characters long. It can't contain whitespace or metric names that are
// reserved for WAF, for example All and Default_Action .
//
// This member is required.
MetricName *string
// Indicates whether WAF should store a sampling of the web requests that match
// the rules. You can view the sampled requests through the WAF console.
//
// This member is required.
SampledRequestsEnabled bool
noSmithyDocumentSerde
}
// A web ACL defines a collection of rules to use to inspect and control web
// requests. Each rule has an action defined (allow, block, or count) for requests
// that match the statement of the rule. In the web ACL, you assign a default
// action to take (allow, block) for any request that does not match any of the
// rules. The rules in a web ACL can be a combination of the types Rule , RuleGroup
// , and managed rule group. You can associate a web ACL with one or more Amazon
// Web Services resources to protect. The resources can be an Amazon CloudFront
// distribution, an Amazon API Gateway REST API, an Application Load Balancer, an
// AppSync GraphQL API, an Amazon Cognito user pool, an App Runner service, or an
// Amazon Web Services Verified Access instance.
type WebACL struct {
// The Amazon Resource Name (ARN) of the web ACL that you want to associate with
// the resource.
//
// This member is required.
ARN *string
// The action to perform if none of the Rules contained in the WebACL match.
//
// This member is required.
DefaultAction *DefaultAction
// A unique identifier for the WebACL . This ID is returned in the responses to
// create and list commands. You use this ID to do things like get, update, and
// delete a WebACL .
//
// This member is required.
Id *string
// The name of the web ACL. You cannot change the name of a web ACL after you
// create it.
//
// This member is required.
Name *string
// Defines and enables Amazon CloudWatch metrics and web request sample collection.
//
// This member is required.
VisibilityConfig *VisibilityConfig
// Specifies custom configurations for the associations between the web ACL and
// protected resources. Use this to customize the maximum size of the request body
// that your protected CloudFront distributions forward to WAF for inspection. The
// default is 16 KB (16,384 kilobytes). You are charged additional fees when your
// protected resources forward body sizes that are larger than the default. For
// more information, see WAF Pricing (http://aws.amazon.com/waf/pricing/) .
AssociationConfig *AssociationConfig
// The web ACL capacity units (WCUs) currently being used by this web ACL. WAF
// uses WCUs to calculate and control the operating resources that are used to run
// your rules, rule groups, and web ACLs. WAF calculates capacity differently for
// each rule type, to reflect the relative cost of each rule. Simple rules that
// cost little to run use fewer WCUs than more complex rules that use more
// processing power. Rule group capacity is fixed at creation, which helps users
// plan their web ACL WCU usage when they use a rule group. For more information,
// see WAF web ACL capacity units (WCU) (https://docs.aws.amazon.com/waf/latest/developerguide/aws-waf-capacity-units.html)
// in the WAF Developer Guide.
Capacity int64
// Specifies how WAF should handle CAPTCHA evaluations for rules that don't have
// their own CaptchaConfig settings. If you don't specify this, WAF uses its
// default settings for CaptchaConfig .
CaptchaConfig *CaptchaConfig
// Specifies how WAF should handle challenge evaluations for rules that don't have
// their own ChallengeConfig settings. If you don't specify this, WAF uses its
// default settings for ChallengeConfig .
ChallengeConfig *ChallengeConfig
// A map of custom response keys and content bodies. When you create a rule with a
// block action, you can send a custom response to the web request. You define
// these for the web ACL, and then use them in the rules and default actions that
// you define in the web ACL. For information about customizing web requests and
// responses, see Customizing web requests and responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html)
// in the WAF Developer Guide. For information about the limits on count and size
// for custom request and response settings, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html)
// in the WAF Developer Guide.
CustomResponseBodies map[string]CustomResponseBody
// A description of the web ACL that helps with identification.
Description *string
// The label namespace prefix for this web ACL. All labels added by rules in this
// web ACL have this prefix.
// - The syntax for the label namespace prefix for a web ACL is the following:
// awswaf::webacl::
// - When a rule with a label matches a web request, WAF adds the fully
// qualified label to the request. A fully qualified label is made up of the label
// namespace from the rule group or web ACL where the rule is defined and the label
// from the rule, separated by a colon: :
LabelNamespace *string
// Indicates whether this web ACL is managed by Firewall Manager. If true, then
// only Firewall Manager can delete the web ACL or any Firewall Manager rule groups
// in the web ACL.
ManagedByFirewallManager bool
// The last set of rules for WAF to process in the web ACL. This is defined in an
// Firewall Manager WAF policy and contains only rule group references. You can't
// alter these. Any rules and rule groups that you define for the web ACL are
// prioritized before these. In the Firewall Manager WAF policy, the Firewall
// Manager administrator can define a set of rule groups to run first in the web
// ACL and a set of rule groups to run last. Within each set, the administrator
// prioritizes the rule groups, to determine their relative processing order.
PostProcessFirewallManagerRuleGroups []FirewallManagerRuleGroup
// The first set of rules for WAF to process in the web ACL. This is defined in an
// Firewall Manager WAF policy and contains only rule group references. You can't
// alter these. Any rules and rule groups that you define for the web ACL are
// prioritized after these. In the Firewall Manager WAF policy, the Firewall
// Manager administrator can define a set of rule groups to run first in the web
// ACL and a set of rule groups to run last. Within each set, the administrator
// prioritizes the rule groups, to determine their relative processing order.
PreProcessFirewallManagerRuleGroups []FirewallManagerRuleGroup
// The Rule statements used to identify the web requests that you want to allow,
// block, or count. Each rule includes one top-level statement that WAF uses to
// identify matching web requests, and parameters that govern how WAF handles them.
Rules []Rule
// Specifies the domains that WAF should accept in a web request token. This
// enables the use of tokens across multiple protected websites. When WAF provides
// a token, it uses the domain of the Amazon Web Services resource that the web ACL
// is protecting. If you don't specify a list of token domains, WAF accepts tokens
// only for the domain of the protected resource. With a token domain list, WAF
// accepts the resource's host domain plus all domains in the token domain list,
// including their prefixed subdomains.
TokenDomains []string
noSmithyDocumentSerde
}
// High-level information about a WebACL , returned by operations like create and
// list. This provides information like the ID, that you can use to retrieve and
// manage a WebACL , and the ARN, that you provide to operations like
// AssociateWebACL .
type WebACLSummary struct {
// The Amazon Resource Name (ARN) of the entity.
ARN *string
// A description of the web ACL that helps with identification.
Description *string
// The unique identifier for the web ACL. This ID is returned in the responses to
// create and list commands. You provide it to operations like update and delete.
Id *string
// A token used for optimistic locking. WAF returns a token to your get and list
// requests, to mark the state of the entity at the time of the request. To make
// changes to the entity associated with the token, you provide the token to
// operations like update and delete . WAF uses the token to ensure that no changes
// have been made to the entity since you last retrieved it. If a change has been
// made, the update fails with a WAFOptimisticLockException . If this happens,
// perform another get , and use the new token returned by that operation.
LockToken *string
// The name of the web ACL. You cannot change the name of a web ACL after you
// create it.
Name *string
noSmithyDocumentSerde
}
// A rule statement that inspects for cross-site scripting (XSS) attacks. In XSS
// attacks, the attacker uses vulnerabilities in a benign website as a vehicle to
// inject malicious client-site scripts into other legitimate web browsers.
type XssMatchStatement struct {
// The part of the web request that you want WAF to inspect.
//
// This member is required.
FieldToMatch *FieldToMatch
// Text transformations eliminate some of the unusual formatting that attackers
// use in web requests in an effort to bypass detection. Text transformations are
// used in rule match statements, to transform the FieldToMatch request component
// before inspecting it, and they're used in rate-based rule statements, to
// transform request components before using them as custom aggregation keys. If
// you specify one or more transformations to apply, WAF performs all
// transformations on the specified content, starting from the lowest priority
// setting, and then uses the component contents.
//
// This member is required.
TextTransformations []TextTransformation
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 3,926 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wellarchitected
import (
"context"
cryptorand "crypto/rand"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyrand "github.com/aws/smithy-go/rand"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "WellArchitected"
const ServiceAPIVersion = "2020-03-31"
// Client provides the API client to make operations call for AWS Well-Architected
// Tool.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
resolveIdempotencyTokenProvider(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// Provides idempotency tokens values that will be automatically populated into
// idempotent API operations.
IdempotencyTokenProvider IdempotencyTokenProvider
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "wellarchitected", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func resolveIdempotencyTokenProvider(o *Options) {
if o.IdempotencyTokenProvider != nil {
return
}
o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader)
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
// IdempotencyTokenProvider interface for providing idempotency token
type IdempotencyTokenProvider interface {
GetIdempotencyToken() (string, error)
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 455 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wellarchitected
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io/ioutil"
"net/http"
"strings"
"testing"
)
func TestClient_resolveRetryOptions(t *testing.T) {
nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) {
return &http.Response{
StatusCode: 200,
Header: http.Header{},
Body: ioutil.NopCloser(strings.NewReader("")),
}, nil
})
cases := map[string]struct {
defaultsMode aws.DefaultsMode
retryer aws.Retryer
retryMaxAttempts int
opRetryMaxAttempts *int
retryMode aws.RetryMode
expectClientRetryMode aws.RetryMode
expectClientMaxAttempts int
expectOpMaxAttempts int
}{
"defaults": {
defaultsMode: aws.DefaultsModeStandard,
expectClientRetryMode: aws.RetryModeStandard,
expectClientMaxAttempts: 3,
expectOpMaxAttempts: 3,
},
"custom default retry": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(2),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 2,
},
"custom op no change max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(10),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op 0 max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(0),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
}
for name, c := range cases {
t.Run(name, func(t *testing.T) {
client := NewFromConfig(aws.Config{
DefaultsMode: c.defaultsMode,
Retryer: func() func() aws.Retryer {
if c.retryer == nil {
return nil
}
return func() aws.Retryer { return c.retryer }
}(),
HTTPClient: nopClient,
RetryMaxAttempts: c.retryMaxAttempts,
RetryMode: c.retryMode,
})
if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a {
t.Errorf("expect %v retry mode, got %v", e, a)
}
if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v max attempts, got %v", e, a)
}
_, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{},
[]func(*Options){
func(o *Options) {
if c.opRetryMaxAttempts == nil {
return
}
o.RetryMaxAttempts = *c.opRetryMaxAttempts
},
},
func(s *middleware.Stack, o Options) error {
s.Initialize.Clear()
s.Serialize.Clear()
s.Build.Clear()
s.Finalize.Clear()
s.Deserialize.Clear()
if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v op max attempts, got %v", e, a)
}
return nil
})
if err != nil {
t.Fatalf("expect no operation error, got %v", err)
}
})
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wellarchitected
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Associate a lens to a workload. Up to 10 lenses can be associated with a
// workload in a single API operation. A maximum of 20 lenses can be associated
// with a workload. Disclaimer By accessing and/or applying custom lenses created
// by another Amazon Web Services user or account, you acknowledge that custom
// lenses created by other users and shared with you are Third Party Content as
// defined in the Amazon Web Services Customer Agreement.
func (c *Client) AssociateLenses(ctx context.Context, params *AssociateLensesInput, optFns ...func(*Options)) (*AssociateLensesOutput, error) {
if params == nil {
params = &AssociateLensesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociateLenses", params, optFns, c.addOperationAssociateLensesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociateLensesOutput)
out.ResultMetadata = metadata
return out, nil
}
// Input to associate lens reviews.
type AssociateLensesInput struct {
// List of lens aliases to associate or disassociate with a workload. Up to 10
// lenses can be specified. Identify a lens using its LensSummary$LensAlias .
//
// This member is required.
LensAliases []string
// The ID assigned to the workload. This ID is unique within an Amazon Web
// Services Region.
//
// This member is required.
WorkloadId *string
noSmithyDocumentSerde
}
type AssociateLensesOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociateLensesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateLenses{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateLenses{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssociateLensesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateLenses(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAssociateLenses(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wellarchitected",
OperationName: "AssociateLenses",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wellarchitected
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Associate a profile with a workload.
func (c *Client) AssociateProfiles(ctx context.Context, params *AssociateProfilesInput, optFns ...func(*Options)) (*AssociateProfilesOutput, error) {
if params == nil {
params = &AssociateProfilesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociateProfiles", params, optFns, c.addOperationAssociateProfilesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociateProfilesOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssociateProfilesInput struct {
// The list of profile ARNs to associate with the workload.
//
// This member is required.
ProfileArns []string
// The ID assigned to the workload. This ID is unique within an Amazon Web
// Services Region.
//
// This member is required.
WorkloadId *string
noSmithyDocumentSerde
}
type AssociateProfilesOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociateProfilesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateProfiles{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateProfiles{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssociateProfilesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateProfiles(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAssociateProfiles(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wellarchitected",
OperationName: "AssociateProfiles",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wellarchitected
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Create a lens share. The owner of a lens can share it with other Amazon Web
// Services accounts, users, an organization, and organizational units (OUs) in the
// same Amazon Web Services Region. Lenses provided by Amazon Web Services (Amazon
// Web Services Official Content) cannot be shared. Shared access to a lens is not
// removed until the lens invitation is deleted. If you share a lens with an
// organization or OU, all accounts in the organization or OU are granted access to
// the lens. For more information, see Sharing a custom lens (https://docs.aws.amazon.com/wellarchitected/latest/userguide/lenses-sharing.html)
// in the Well-Architected Tool User Guide. Disclaimer By sharing your custom
// lenses with other Amazon Web Services accounts, you acknowledge that Amazon Web
// Services will make your custom lenses available to those other accounts. Those
// other accounts may continue to access and use your shared custom lenses even if
// you delete the custom lenses from your own Amazon Web Services account or
// terminate your Amazon Web Services account.
func (c *Client) CreateLensShare(ctx context.Context, params *CreateLensShareInput, optFns ...func(*Options)) (*CreateLensShareOutput, error) {
if params == nil {
params = &CreateLensShareInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateLensShare", params, optFns, c.addOperationCreateLensShareMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateLensShareOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateLensShareInput struct {
// A unique case-sensitive string used to ensure that this request is idempotent
// (executes only once). You should not reuse the same token for other requests. If
// you retry a request with the same client request token and the same parameters
// after the original request has completed successfully, the result of the
// original request is returned. This token is listed as required, however, if you
// do not specify it, the Amazon Web Services SDKs automatically generate one for
// you. If you are not using the Amazon Web Services SDK or the CLI, you must
// provide this token or the request will fail.
//
// This member is required.
ClientRequestToken *string
// The alias of the lens. For Amazon Web Services official lenses, this is either
// the lens alias, such as serverless , or the lens ARN, such as
// arn:aws:wellarchitected:us-east-1::lens/serverless . Note that some operations
// (such as ExportLens and CreateLensShare) are not permitted on Amazon Web
// Services official lenses. For custom lenses, this is the lens ARN, such as
// arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef
// . Each lens is identified by its LensSummary$LensAlias .
//
// This member is required.
LensAlias *string
// The Amazon Web Services account ID, IAM role, organization ID, or
// organizational unit (OU) ID with which the workload, lens, or profile is shared.
//
// This member is required.
SharedWith *string
noSmithyDocumentSerde
}
type CreateLensShareOutput struct {
// The ID associated with the share.
ShareId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateLensShareMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateLensShare{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateLensShare{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateLensShareMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateLensShareValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLensShare(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateLensShare struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateLensShare) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateLensShare) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateLensShareInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateLensShareInput ")
}
if input.ClientRequestToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientRequestToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateLensShareMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateLensShare{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateLensShare(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wellarchitected",
OperationName: "CreateLensShare",
}
}
| 197 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wellarchitected
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Create a new lens version. A lens can have up to 100 versions. Use this
// operation to publish a new lens version after you have imported a lens. The
// LensAlias is used to identify the lens to be published. The owner of a lens can
// share the lens with other Amazon Web Services accounts and users in the same
// Amazon Web Services Region. Only the owner of a lens can delete it.
func (c *Client) CreateLensVersion(ctx context.Context, params *CreateLensVersionInput, optFns ...func(*Options)) (*CreateLensVersionOutput, error) {
if params == nil {
params = &CreateLensVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateLensVersion", params, optFns, c.addOperationCreateLensVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateLensVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateLensVersionInput struct {
// A unique case-sensitive string used to ensure that this request is idempotent
// (executes only once). You should not reuse the same token for other requests. If
// you retry a request with the same client request token and the same parameters
// after the original request has completed successfully, the result of the
// original request is returned. This token is listed as required, however, if you
// do not specify it, the Amazon Web Services SDKs automatically generate one for
// you. If you are not using the Amazon Web Services SDK or the CLI, you must
// provide this token or the request will fail.
//
// This member is required.
ClientRequestToken *string
// The alias of the lens. For Amazon Web Services official lenses, this is either
// the lens alias, such as serverless , or the lens ARN, such as
// arn:aws:wellarchitected:us-east-1::lens/serverless . Note that some operations
// (such as ExportLens and CreateLensShare) are not permitted on Amazon Web
// Services official lenses. For custom lenses, this is the lens ARN, such as
// arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef
// . Each lens is identified by its LensSummary$LensAlias .
//
// This member is required.
LensAlias *string
// The version of the lens being created.
//
// This member is required.
LensVersion *string
// Set to true if this new major lens version.
IsMajorVersion bool
noSmithyDocumentSerde
}
type CreateLensVersionOutput struct {
// The ARN for the lens.
LensArn *string
// The version of the lens.
LensVersion *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateLensVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateLensVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateLensVersion{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateLensVersionMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateLensVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLensVersion(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateLensVersion struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateLensVersion) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateLensVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateLensVersionInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateLensVersionInput ")
}
if input.ClientRequestToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientRequestToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateLensVersionMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateLensVersion{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateLensVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wellarchitected",
OperationName: "CreateLensVersion",
}
}
| 194 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wellarchitected
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Create a milestone for an existing workload.
func (c *Client) CreateMilestone(ctx context.Context, params *CreateMilestoneInput, optFns ...func(*Options)) (*CreateMilestoneOutput, error) {
if params == nil {
params = &CreateMilestoneInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateMilestone", params, optFns, c.addOperationCreateMilestoneMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateMilestoneOutput)
out.ResultMetadata = metadata
return out, nil
}
// Input for milestone creation.
type CreateMilestoneInput struct {
// A unique case-sensitive string used to ensure that this request is idempotent
// (executes only once). You should not reuse the same token for other requests. If
// you retry a request with the same client request token and the same parameters
// after the original request has completed successfully, the result of the
// original request is returned. This token is listed as required, however, if you
// do not specify it, the Amazon Web Services SDKs automatically generate one for
// you. If you are not using the Amazon Web Services SDK or the CLI, you must
// provide this token or the request will fail.
//
// This member is required.
ClientRequestToken *string
// The name of the milestone in a workload. Milestone names must be unique within
// a workload.
//
// This member is required.
MilestoneName *string
// The ID assigned to the workload. This ID is unique within an Amazon Web
// Services Region.
//
// This member is required.
WorkloadId *string
noSmithyDocumentSerde
}
// Output of a create milestone call.
type CreateMilestoneOutput struct {
// The milestone number. A workload can have a maximum of 100 milestones.
MilestoneNumber int32
// The ID assigned to the workload. This ID is unique within an Amazon Web
// Services Region.
WorkloadId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateMilestoneMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateMilestone{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateMilestone{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateMilestoneMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateMilestoneValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateMilestone(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateMilestone struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateMilestone) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateMilestone) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateMilestoneInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateMilestoneInput ")
}
if input.ClientRequestToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientRequestToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateMilestoneMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateMilestone{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateMilestone(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wellarchitected",
OperationName: "CreateMilestone",
}
}
| 186 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wellarchitected
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wellarchitected/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Create a profile.
func (c *Client) CreateProfile(ctx context.Context, params *CreateProfileInput, optFns ...func(*Options)) (*CreateProfileOutput, error) {
if params == nil {
params = &CreateProfileInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateProfile", params, optFns, c.addOperationCreateProfileMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateProfileOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateProfileInput struct {
// A unique case-sensitive string used to ensure that this request is idempotent
// (executes only once). You should not reuse the same token for other requests. If
// you retry a request with the same client request token and the same parameters
// after the original request has completed successfully, the result of the
// original request is returned. This token is listed as required, however, if you
// do not specify it, the Amazon Web Services SDKs automatically generate one for
// you. If you are not using the Amazon Web Services SDK or the CLI, you must
// provide this token or the request will fail.
//
// This member is required.
ClientRequestToken *string
// The profile description.
//
// This member is required.
ProfileDescription *string
// Name of the profile.
//
// This member is required.
ProfileName *string
// The profile questions.
//
// This member is required.
ProfileQuestions []types.ProfileQuestionUpdate
// The tags assigned to the profile.
Tags map[string]string
noSmithyDocumentSerde
}
type CreateProfileOutput struct {
// The profile ARN.
ProfileArn *string
// Version of the profile.
ProfileVersion *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateProfileMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateProfile{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateProfile{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateProfileMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateProfileValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProfile(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateProfile struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateProfile) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateProfileInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateProfileInput ")
}
if input.ClientRequestToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientRequestToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateProfileMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateProfile{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateProfile(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wellarchitected",
OperationName: "CreateProfile",
}
}
| 190 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wellarchitected
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Create a profile share.
func (c *Client) CreateProfileShare(ctx context.Context, params *CreateProfileShareInput, optFns ...func(*Options)) (*CreateProfileShareOutput, error) {
if params == nil {
params = &CreateProfileShareInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateProfileShare", params, optFns, c.addOperationCreateProfileShareMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateProfileShareOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateProfileShareInput struct {
// A unique case-sensitive string used to ensure that this request is idempotent
// (executes only once). You should not reuse the same token for other requests. If
// you retry a request with the same client request token and the same parameters
// after the original request has completed successfully, the result of the
// original request is returned. This token is listed as required, however, if you
// do not specify it, the Amazon Web Services SDKs automatically generate one for
// you. If you are not using the Amazon Web Services SDK or the CLI, you must
// provide this token or the request will fail.
//
// This member is required.
ClientRequestToken *string
// The profile ARN.
//
// This member is required.
ProfileArn *string
// The Amazon Web Services account ID, IAM role, organization ID, or
// organizational unit (OU) ID with which the workload, lens, or profile is shared.
//
// This member is required.
SharedWith *string
noSmithyDocumentSerde
}
type CreateProfileShareOutput struct {
// The profile ARN.
ProfileArn *string
// The ID associated with the share.
ShareId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateProfileShareMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateProfileShare{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateProfileShare{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateProfileShareMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateProfileShareValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProfileShare(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateProfileShare struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateProfileShare) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateProfileShare) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateProfileShareInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateProfileShareInput ")
}
if input.ClientRequestToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientRequestToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateProfileShareMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateProfileShare{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateProfileShare(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wellarchitected",
OperationName: "CreateProfileShare",
}
}
| 182 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wellarchitected
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wellarchitected/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Create a new workload. The owner of a workload can share the workload with
// other Amazon Web Services accounts, users, an organization, and organizational
// units (OUs) in the same Amazon Web Services Region. Only the owner of a workload
// can delete it. For more information, see Defining a Workload (https://docs.aws.amazon.com/wellarchitected/latest/userguide/define-workload.html)
// in the Well-Architected Tool User Guide. Either AwsRegions , NonAwsRegions , or
// both must be specified when creating a workload. You also must specify
// ReviewOwner , even though the parameter is listed as not being required in the
// following section.
func (c *Client) CreateWorkload(ctx context.Context, params *CreateWorkloadInput, optFns ...func(*Options)) (*CreateWorkloadOutput, error) {
if params == nil {
params = &CreateWorkloadInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateWorkload", params, optFns, c.addOperationCreateWorkloadMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateWorkloadOutput)
out.ResultMetadata = metadata
return out, nil
}
// Input for workload creation.
type CreateWorkloadInput struct {
// A unique case-sensitive string used to ensure that this request is idempotent
// (executes only once). You should not reuse the same token for other requests. If
// you retry a request with the same client request token and the same parameters
// after the original request has completed successfully, the result of the
// original request is returned. This token is listed as required, however, if you
// do not specify it, the Amazon Web Services SDKs automatically generate one for
// you. If you are not using the Amazon Web Services SDK or the CLI, you must
// provide this token or the request will fail.
//
// This member is required.
ClientRequestToken *string
// The description for the workload.
//
// This member is required.
Description *string
// The environment for the workload.
//
// This member is required.
Environment types.WorkloadEnvironment
// The list of lenses associated with the workload. Each lens is identified by its
// LensSummary$LensAlias .
//
// This member is required.
Lenses []string
// The name of the workload. The name must be unique within an account within an
// Amazon Web Services Region. Spaces and capitalization are ignored when checking
// for uniqueness.
//
// This member is required.
WorkloadName *string
// The list of Amazon Web Services account IDs associated with the workload.
AccountIds []string
// List of AppRegistry application ARNs associated to the workload.
Applications []string
// The URL of the architectural design for the workload.
ArchitecturalDesign *string
// The list of Amazon Web Services Regions associated with the workload, for
// example, us-east-2 , or ca-central-1 .
AwsRegions []string
// Well-Architected discovery configuration settings associated to the workload.
DiscoveryConfig *types.WorkloadDiscoveryConfig
// The industry for the workload.
Industry *string
// The industry type for the workload. If specified, must be one of the following:
// - Agriculture
// - Automobile
// - Defense
// - Design and Engineering
// - Digital Advertising
// - Education
// - Environmental Protection
// - Financial Services
// - Gaming
// - General Public Services
// - Healthcare
// - Hospitality
// - InfoTech
// - Justice and Public Safety
// - Life Sciences
// - Manufacturing
// - Media & Entertainment
// - Mining & Resources
// - Oil & Gas
// - Power & Utilities
// - Professional Services
// - Real Estate & Construction
// - Retail & Wholesale
// - Social Protection
// - Telecommunications
// - Travel, Transportation & Logistics
// - Other
IndustryType *string
// The list of non-Amazon Web Services Regions associated with the workload.
NonAwsRegions []string
// The notes associated with the workload.
Notes *string
// The priorities of the pillars, which are used to order items in the improvement
// plan. Each pillar is represented by its PillarReviewSummary$PillarId .
PillarPriorities []string
// The list of profile ARNs associated with the workload.
ProfileArns []string
// The review owner of the workload. The name, email address, or identifier for
// the primary group or individual that owns the workload review process.
ReviewOwner *string
// The tags to be associated with the workload.
Tags map[string]string
noSmithyDocumentSerde
}
// Output of a create workload call.
type CreateWorkloadOutput struct {
// The ARN for the workload.
WorkloadArn *string
// The ID assigned to the workload. This ID is unique within an Amazon Web
// Services Region.
WorkloadId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateWorkloadMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateWorkload{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateWorkload{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateWorkloadMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateWorkloadValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWorkload(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateWorkload struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateWorkload) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateWorkload) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateWorkloadInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateWorkloadInput ")
}
if input.ClientRequestToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientRequestToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateWorkloadMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateWorkload{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateWorkload(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wellarchitected",
OperationName: "CreateWorkload",
}
}
| 274 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wellarchitected
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wellarchitected/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Create a workload share. The owner of a workload can share it with other Amazon
// Web Services accounts and users in the same Amazon Web Services Region. Shared
// access to a workload is not removed until the workload invitation is deleted. If
// you share a workload with an organization or OU, all accounts in the
// organization or OU are granted access to the workload. For more information, see
// Sharing a workload (https://docs.aws.amazon.com/wellarchitected/latest/userguide/workloads-sharing.html)
// in the Well-Architected Tool User Guide.
func (c *Client) CreateWorkloadShare(ctx context.Context, params *CreateWorkloadShareInput, optFns ...func(*Options)) (*CreateWorkloadShareOutput, error) {
if params == nil {
params = &CreateWorkloadShareInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateWorkloadShare", params, optFns, c.addOperationCreateWorkloadShareMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateWorkloadShareOutput)
out.ResultMetadata = metadata
return out, nil
}
// Input for Create Workload Share
type CreateWorkloadShareInput struct {
// A unique case-sensitive string used to ensure that this request is idempotent
// (executes only once). You should not reuse the same token for other requests. If
// you retry a request with the same client request token and the same parameters
// after the original request has completed successfully, the result of the
// original request is returned. This token is listed as required, however, if you
// do not specify it, the Amazon Web Services SDKs automatically generate one for
// you. If you are not using the Amazon Web Services SDK or the CLI, you must
// provide this token or the request will fail.
//
// This member is required.
ClientRequestToken *string
// Permission granted on a share request.
//
// This member is required.
PermissionType types.PermissionType
// The Amazon Web Services account ID, IAM role, organization ID, or
// organizational unit (OU) ID with which the workload, lens, or profile is shared.
//
// This member is required.
SharedWith *string
// The ID assigned to the workload. This ID is unique within an Amazon Web
// Services Region.
//
// This member is required.
WorkloadId *string
noSmithyDocumentSerde
}
// Input for Create Workload Share
type CreateWorkloadShareOutput struct {
// The ID associated with the share.
ShareId *string
// The ID assigned to the workload. This ID is unique within an Amazon Web
// Services Region.
WorkloadId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateWorkloadShareMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateWorkloadShare{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateWorkloadShare{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateWorkloadShareMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateWorkloadShareValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWorkloadShare(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateWorkloadShare struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateWorkloadShare) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateWorkloadShare) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateWorkloadShareInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateWorkloadShareInput ")
}
if input.ClientRequestToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientRequestToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateWorkloadShareMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateWorkloadShare{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateWorkloadShare(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wellarchitected",
OperationName: "CreateWorkloadShare",
}
}
| 198 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wellarchitected
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/wellarchitected/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Delete an existing lens. Only the owner of a lens can delete it. After the lens
// is deleted, Amazon Web Services accounts and users that you shared the lens with
// can continue to use it, but they will no longer be able to apply it to new
// workloads. Disclaimer By sharing your custom lenses with other Amazon Web
// Services accounts, you acknowledge that Amazon Web Services will make your
// custom lenses available to those other accounts. Those other accounts may
// continue to access and use your shared custom lenses even if you delete the
// custom lenses from your own Amazon Web Services account or terminate your Amazon
// Web Services account.
func (c *Client) DeleteLens(ctx context.Context, params *DeleteLensInput, optFns ...func(*Options)) (*DeleteLensOutput, error) {
if params == nil {
params = &DeleteLensInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteLens", params, optFns, c.addOperationDeleteLensMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteLensOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteLensInput struct {
// A unique case-sensitive string used to ensure that this request is idempotent
// (executes only once). You should not reuse the same token for other requests. If
// you retry a request with the same client request token and the same parameters
// after the original request has completed successfully, the result of the
// original request is returned. This token is listed as required, however, if you
// do not specify it, the Amazon Web Services SDKs automatically generate one for
// you. If you are not using the Amazon Web Services SDK or the CLI, you must
// provide this token or the request will fail.
//
// This member is required.
ClientRequestToken *string
// The alias of the lens. For Amazon Web Services official lenses, this is either
// the lens alias, such as serverless , or the lens ARN, such as
// arn:aws:wellarchitected:us-east-1::lens/serverless . Note that some operations
// (such as ExportLens and CreateLensShare) are not permitted on Amazon Web
// Services official lenses. For custom lenses, this is the lens ARN, such as
// arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef
// . Each lens is identified by its LensSummary$LensAlias .
//
// This member is required.
LensAlias *string
// The status of the lens to be deleted.
//
// This member is required.
LensStatus types.LensStatusType
noSmithyDocumentSerde
}
type DeleteLensOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteLensMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteLens{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteLens{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opDeleteLensMiddleware(stack, options); err != nil {
return err
}
if err = addOpDeleteLensValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLens(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpDeleteLens struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpDeleteLens) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpDeleteLens) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*DeleteLensInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteLensInput ")
}
if input.ClientRequestToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientRequestToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opDeleteLensMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteLens{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opDeleteLens(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wellarchitected",
OperationName: "DeleteLens",
}
}
| 189 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wellarchitected
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Delete a lens share. After the lens share is deleted, Amazon Web Services
// accounts, users, organizations, and organizational units (OUs) that you shared
// the lens with can continue to use it, but they will no longer be able to apply
// it to new workloads. Disclaimer By sharing your custom lenses with other Amazon
// Web Services accounts, you acknowledge that Amazon Web Services will make your
// custom lenses available to those other accounts. Those other accounts may
// continue to access and use your shared custom lenses even if you delete the
// custom lenses from your own Amazon Web Services account or terminate your Amazon
// Web Services account.
func (c *Client) DeleteLensShare(ctx context.Context, params *DeleteLensShareInput, optFns ...func(*Options)) (*DeleteLensShareOutput, error) {
if params == nil {
params = &DeleteLensShareInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteLensShare", params, optFns, c.addOperationDeleteLensShareMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteLensShareOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteLensShareInput struct {
// A unique case-sensitive string used to ensure that this request is idempotent
// (executes only once). You should not reuse the same token for other requests. If
// you retry a request with the same client request token and the same parameters
// after the original request has completed successfully, the result of the
// original request is returned. This token is listed as required, however, if you
// do not specify it, the Amazon Web Services SDKs automatically generate one for
// you. If you are not using the Amazon Web Services SDK or the CLI, you must
// provide this token or the request will fail.
//
// This member is required.
ClientRequestToken *string
// The alias of the lens. For Amazon Web Services official lenses, this is either
// the lens alias, such as serverless , or the lens ARN, such as
// arn:aws:wellarchitected:us-east-1::lens/serverless . Note that some operations
// (such as ExportLens and CreateLensShare) are not permitted on Amazon Web
// Services official lenses. For custom lenses, this is the lens ARN, such as
// arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef
// . Each lens is identified by its LensSummary$LensAlias .
//
// This member is required.
LensAlias *string
// The ID associated with the share.
//
// This member is required.
ShareId *string
noSmithyDocumentSerde
}
type DeleteLensShareOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteLensShareMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteLensShare{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteLensShare{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opDeleteLensShareMiddleware(stack, options); err != nil {
return err
}
if err = addOpDeleteLensShareValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLensShare(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpDeleteLensShare struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpDeleteLensShare) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpDeleteLensShare) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*DeleteLensShareInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteLensShareInput ")
}
if input.ClientRequestToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientRequestToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opDeleteLensShareMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteLensShare{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opDeleteLensShare(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wellarchitected",
OperationName: "DeleteLensShare",
}
}
| 188 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wellarchitected
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Delete a profile. Disclaimer By sharing your profile with other Amazon Web
// Services accounts, you acknowledge that Amazon Web Services will make your
// profile available to those other accounts. Those other accounts may continue to
// access and use your shared profile even if you delete the profile from your own
// Amazon Web Services account or terminate your Amazon Web Services account.
func (c *Client) DeleteProfile(ctx context.Context, params *DeleteProfileInput, optFns ...func(*Options)) (*DeleteProfileOutput, error) {
if params == nil {
params = &DeleteProfileInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteProfile", params, optFns, c.addOperationDeleteProfileMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteProfileOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteProfileInput struct {
// A unique case-sensitive string used to ensure that this request is idempotent
// (executes only once). You should not reuse the same token for other requests. If
// you retry a request with the same client request token and the same parameters
// after the original request has completed successfully, the result of the
// original request is returned. This token is listed as required, however, if you
// do not specify it, the Amazon Web Services SDKs automatically generate one for
// you. If you are not using the Amazon Web Services SDK or the CLI, you must
// provide this token or the request will fail.
//
// This member is required.
ClientRequestToken *string
// The profile ARN.
//
// This member is required.
ProfileArn *string
noSmithyDocumentSerde
}
type DeleteProfileOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteProfileMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteProfile{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteProfile{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opDeleteProfileMiddleware(stack, options); err != nil {
return err
}
if err = addOpDeleteProfileValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProfile(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpDeleteProfile struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpDeleteProfile) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpDeleteProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*DeleteProfileInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteProfileInput ")
}
if input.ClientRequestToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientRequestToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opDeleteProfileMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteProfile{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opDeleteProfile(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wellarchitected",
OperationName: "DeleteProfile",
}
}
| 173 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wellarchitected
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Delete a profile share.
func (c *Client) DeleteProfileShare(ctx context.Context, params *DeleteProfileShareInput, optFns ...func(*Options)) (*DeleteProfileShareOutput, error) {
if params == nil {
params = &DeleteProfileShareInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteProfileShare", params, optFns, c.addOperationDeleteProfileShareMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteProfileShareOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteProfileShareInput struct {
// A unique case-sensitive string used to ensure that this request is idempotent
// (executes only once). You should not reuse the same token for other requests. If
// you retry a request with the same client request token and the same parameters
// after the original request has completed successfully, the result of the
// original request is returned. This token is listed as required, however, if you
// do not specify it, the Amazon Web Services SDKs automatically generate one for
// you. If you are not using the Amazon Web Services SDK or the CLI, you must
// provide this token or the request will fail.
//
// This member is required.
ClientRequestToken *string
// The profile ARN.
//
// This member is required.
ProfileArn *string
// The ID associated with the share.
//
// This member is required.
ShareId *string
noSmithyDocumentSerde
}
type DeleteProfileShareOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteProfileShareMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteProfileShare{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteProfileShare{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opDeleteProfileShareMiddleware(stack, options); err != nil {
return err
}
if err = addOpDeleteProfileShareValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProfileShare(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpDeleteProfileShare struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpDeleteProfileShare) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpDeleteProfileShare) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*DeleteProfileShareInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteProfileShareInput ")
}
if input.ClientRequestToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientRequestToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opDeleteProfileShareMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteProfileShare{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opDeleteProfileShare(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wellarchitected",
OperationName: "DeleteProfileShare",
}
}
| 174 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wellarchitected
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Delete an existing workload.
func (c *Client) DeleteWorkload(ctx context.Context, params *DeleteWorkloadInput, optFns ...func(*Options)) (*DeleteWorkloadOutput, error) {
if params == nil {
params = &DeleteWorkloadInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteWorkload", params, optFns, c.addOperationDeleteWorkloadMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteWorkloadOutput)
out.ResultMetadata = metadata
return out, nil
}
// Input for workload deletion.
type DeleteWorkloadInput struct {
// A unique case-sensitive string used to ensure that this request is idempotent
// (executes only once). You should not reuse the same token for other requests. If
// you retry a request with the same client request token and the same parameters
// after the original request has completed successfully, the result of the
// original request is returned. This token is listed as required, however, if you
// do not specify it, the Amazon Web Services SDKs automatically generate one for
// you. If you are not using the Amazon Web Services SDK or the CLI, you must
// provide this token or the request will fail.
//
// This member is required.
ClientRequestToken *string
// The ID assigned to the workload. This ID is unique within an Amazon Web
// Services Region.
//
// This member is required.
WorkloadId *string
noSmithyDocumentSerde
}
type DeleteWorkloadOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteWorkloadMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteWorkload{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteWorkload{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opDeleteWorkloadMiddleware(stack, options); err != nil {
return err
}
if err = addOpDeleteWorkloadValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteWorkload(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpDeleteWorkload struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpDeleteWorkload) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpDeleteWorkload) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*DeleteWorkloadInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteWorkloadInput ")
}
if input.ClientRequestToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientRequestToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opDeleteWorkloadMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteWorkload{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opDeleteWorkload(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wellarchitected",
OperationName: "DeleteWorkload",
}
}
| 171 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package wellarchitected
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Delete a workload share.
func (c *Client) DeleteWorkloadShare(ctx context.Context, params *DeleteWorkloadShareInput, optFns ...func(*Options)) (*DeleteWorkloadShareOutput, error) {
if params == nil {
params = &DeleteWorkloadShareInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteWorkloadShare", params, optFns, c.addOperationDeleteWorkloadShareMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteWorkloadShareOutput)
out.ResultMetadata = metadata
return out, nil
}
// Input for Delete Workload Share
type DeleteWorkloadShareInput struct {
// A unique case-sensitive string used to ensure that this request is idempotent
// (executes only once). You should not reuse the same token for other requests. If
// you retry a request with the same client request token and the same parameters
// after the original request has completed successfully, the result of the
// original request is returned. This token is listed as required, however, if you
// do not specify it, the Amazon Web Services SDKs automatically generate one for
// you. If you are not using the Amazon Web Services SDK or the CLI, you must
// provide this token or the request will fail.
//
// This member is required.
ClientRequestToken *string
// The ID associated with the share.
//
// This member is required.
ShareId *string
// The ID assigned to the workload. This ID is unique within an Amazon Web
// Services Region.
//
// This member is required.
WorkloadId *string
noSmithyDocumentSerde
}
type DeleteWorkloadShareOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteWorkloadShareMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteWorkloadShare{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteWorkloadShare{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opDeleteWorkloadShareMiddleware(stack, options); err != nil {
return err
}
if err = addOpDeleteWorkloadShareValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteWorkloadShare(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpDeleteWorkloadShare struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpDeleteWorkloadShare) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpDeleteWorkloadShare) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*DeleteWorkloadShareInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteWorkloadShareInput ")
}
if input.ClientRequestToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientRequestToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opDeleteWorkloadShareMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteWorkloadShare{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opDeleteWorkloadShare(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "wellarchitected",
OperationName: "DeleteWorkloadShare",
}
}
| 176 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.