// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package waf import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" ) type GetChangeTokenInput struct { _ struct{} `type:"structure"` } // String returns the string representation func (s GetChangeTokenInput) String() string { return awsutil.Prettify(s) } type GetChangeTokenOutput struct { _ struct{} `type:"structure"` // The ChangeToken that you used in the request. Use this value in a GetChangeTokenStatus // request to get the current status of the request. ChangeToken *string `min:"1" type:"string"` } // String returns the string representation func (s GetChangeTokenOutput) String() string { return awsutil.Prettify(s) } const opGetChangeToken = "GetChangeToken" // GetChangeTokenRequest returns a request value for making API operation for // AWS WAF. // // // 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. // // When you want to create, update, or delete AWS WAF objects, get a change // token and include the change token in the create, update, or delete request. // Change tokens ensure that your application doesn't submit conflicting requests // to AWS WAF. // // Each create, update, or delete request must use a unique change token. If // your application submits a GetChangeToken request and then submits a second // GetChangeToken request before submitting a create, update, or delete request, // the second GetChangeToken request returns the same value as the first GetChangeToken // request. // // When you use a change token in a create, update, or delete request, the status // of the change token changes to PENDING, which indicates that AWS WAF is propagating // the change to all AWS WAF servers. Use GetChangeTokenStatus to determine // the status of your change token. // // // Example sending a request using GetChangeTokenRequest. // req := client.GetChangeTokenRequest(params) // resp, err := req.Send(context.TODO()) // if err == nil { // fmt.Println(resp) // } // // Please also see https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetChangeToken func (c *Client) GetChangeTokenRequest(input *GetChangeTokenInput) GetChangeTokenRequest { op := &aws.Operation{ Name: opGetChangeToken, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { input = &GetChangeTokenInput{} } req := c.newRequest(op, input, &GetChangeTokenOutput{}) return GetChangeTokenRequest{Request: req, Input: input, Copy: c.GetChangeTokenRequest} } // GetChangeTokenRequest is the request type for the // GetChangeToken API operation. type GetChangeTokenRequest struct { *aws.Request Input *GetChangeTokenInput Copy func(*GetChangeTokenInput) GetChangeTokenRequest } // Send marshals and sends the GetChangeToken API request. func (r GetChangeTokenRequest) Send(ctx context.Context) (*GetChangeTokenResponse, error) { r.Request.SetContext(ctx) err := r.Request.Send() if err != nil { return nil, err } resp := &GetChangeTokenResponse{ GetChangeTokenOutput: r.Request.Data.(*GetChangeTokenOutput), response: &aws.Response{Request: r.Request}, } return resp, nil } // GetChangeTokenResponse is the response type for the // GetChangeToken API operation. type GetChangeTokenResponse struct { *GetChangeTokenOutput response *aws.Response } // SDKResponseMetdata returns the response metadata for the // GetChangeToken request. func (r *GetChangeTokenResponse) SDKResponseMetdata() *aws.Response { return r.response }