service/cloudfront/api_op_AssociateDistributionTenantWebACL.go (141 lines of code) (raw):

// Code generated by smithy-go-codegen DO NOT EDIT. package cloudfront import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Associates the WAF web ACL with a distribution tenant. func (c *Client) AssociateDistributionTenantWebACL(ctx context.Context, params *AssociateDistributionTenantWebACLInput, optFns ...func(*Options)) (*AssociateDistributionTenantWebACLOutput, error) { if params == nil { params = &AssociateDistributionTenantWebACLInput{} } result, metadata, err := c.invokeOperation(ctx, "AssociateDistributionTenantWebACL", params, optFns, c.addOperationAssociateDistributionTenantWebACLMiddlewares) if err != nil { return nil, err } out := result.(*AssociateDistributionTenantWebACLOutput) out.ResultMetadata = metadata return out, nil } type AssociateDistributionTenantWebACLInput struct { // The ID of the distribution tenant. // // This member is required. Id *string // The Amazon Resource Name (ARN) of the WAF web ACL to associate. // // This member is required. WebACLArn *string // The current ETag of the distribution tenant. This value is returned in the // response of the GetDistributionTenant API operation. IfMatch *string noSmithyDocumentSerde } type AssociateDistributionTenantWebACLOutput struct { // The current version of the distribution tenant. ETag *string // The ID of the distribution tenant. Id *string // The ARN of the WAF web ACL that you associated with the distribution tenant. WebACLArn *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAssociateDistributionTenantWebACLMiddlewares(stack *middleware.Stack, options Options) (err error) { if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { return err } err = stack.Serialize.Add(&awsRestxml_serializeOpAssociateDistributionTenantWebACL{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestxml_deserializeOpAssociateDistributionTenantWebACL{}, middleware.After) if err != nil { return err } if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateDistributionTenantWebACL"); err != nil { return fmt.Errorf("add protocol finalizers: %v", err) } if err = addlegacyEndpointContextSetter(stack, options); err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = addClientRequestID(stack); err != nil { return err } if err = addComputeContentLength(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = addComputePayloadSHA256(stack); err != nil { return err } if err = addRetry(stack, options); err != nil { return err } if err = addRawResponseToMetadata(stack); err != nil { return err } if err = addRecordResponseTiming(stack); err != nil { return err } if err = addSpanRetryLoop(stack, options); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { return err } if err = addTimeOffsetBuild(stack, c); err != nil { return err } if err = addUserAgentRetryMode(stack, options); err != nil { return err } if err = addCredentialSource(stack, options); err != nil { return err } if err = addOpAssociateDistributionTenantWebACLValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateDistributionTenantWebACL(options.Region), middleware.Before); err != nil { return err } if err = 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 } if err = addDisableHTTPSMiddleware(stack, options); err != nil { return err } if err = addSpanInitializeStart(stack); err != nil { return err } if err = addSpanInitializeEnd(stack); err != nil { return err } if err = addSpanBuildRequestStart(stack); err != nil { return err } if err = addSpanBuildRequestEnd(stack); err != nil { return err } return nil } func newServiceMetadataMiddleware_opAssociateDistributionTenantWebACL(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, OperationName: "AssociateDistributionTenantWebACL", } }