// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package datasync import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" ) // ListTagsForResourceRequest type ListTagsForResourceInput struct { _ struct{} `type:"structure"` // The maximum number of locations to return. MaxResults *int64 `type:"integer"` // An opaque string that indicates the position at which to begin the next list // of locations. NextToken *string `type:"string"` // The Amazon Resource Name (ARN) of the resource whose tags to list. // // ResourceArn is a required field ResourceArn *string `type:"string" required:"true"` } // String returns the string representation func (s ListTagsForResourceInput) String() string { return awsutil.Prettify(s) } // Validate inspects the fields of the type to determine if they are valid. func (s *ListTagsForResourceInput) Validate() error { invalidParams := aws.ErrInvalidParams{Context: "ListTagsForResourceInput"} if s.ResourceArn == nil { invalidParams.Add(aws.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } return nil } // ListTagsForResourceResponse type ListTagsForResourceOutput struct { _ struct{} `type:"structure"` // An opaque string that indicates the position at which to begin returning // the next list of resource tags. NextToken *string `type:"string"` // Array of resource tags. Tags []TagListEntry `type:"list"` } // String returns the string representation func (s ListTagsForResourceOutput) String() string { return awsutil.Prettify(s) } const opListTagsForResource = "ListTagsForResource" // ListTagsForResourceRequest returns a request value for making API operation for // AWS DataSync. // // Returns all the tags associated with a specified resources. // // // Example sending a request using ListTagsForResourceRequest. // req := client.ListTagsForResourceRequest(params) // resp, err := req.Send(context.TODO()) // if err == nil { // fmt.Println(resp) // } // // Please also see https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/ListTagsForResource func (c *Client) ListTagsForResourceRequest(input *ListTagsForResourceInput) ListTagsForResourceRequest { op := &aws.Operation{ Name: opListTagsForResource, HTTPMethod: "POST", HTTPPath: "/", Paginator: &aws.Paginator{ InputTokens: []string{"NextToken"}, OutputTokens: []string{"NextToken"}, LimitToken: "MaxResults", TruncationToken: "", }, } if input == nil { input = &ListTagsForResourceInput{} } req := c.newRequest(op, input, &ListTagsForResourceOutput{}) return ListTagsForResourceRequest{Request: req, Input: input, Copy: c.ListTagsForResourceRequest} } // ListTagsForResourceRequest is the request type for the // ListTagsForResource API operation. type ListTagsForResourceRequest struct { *aws.Request Input *ListTagsForResourceInput Copy func(*ListTagsForResourceInput) ListTagsForResourceRequest } // Send marshals and sends the ListTagsForResource API request. func (r ListTagsForResourceRequest) Send(ctx context.Context) (*ListTagsForResourceResponse, error) { r.Request.SetContext(ctx) err := r.Request.Send() if err != nil { return nil, err } resp := &ListTagsForResourceResponse{ ListTagsForResourceOutput: r.Request.Data.(*ListTagsForResourceOutput), response: &aws.Response{Request: r.Request}, } return resp, nil } // NewListTagsForResourceRequestPaginator returns a paginator for ListTagsForResource. // Use Next method to get the next page, and CurrentPage to get the current // response page from the paginator. Next will return false, if there are // no more pages, or an error was encountered. // // Note: This operation can generate multiple requests to a service. // // // Example iterating over pages. // req := client.ListTagsForResourceRequest(input) // p := datasync.NewListTagsForResourceRequestPaginator(req) // // for p.Next(context.TODO()) { // page := p.CurrentPage() // } // // if err := p.Err(); err != nil { // return err // } // func NewListTagsForResourcePaginator(req ListTagsForResourceRequest) ListTagsForResourcePaginator { return ListTagsForResourcePaginator{ Pager: aws.Pager{ NewRequest: func(ctx context.Context) (*aws.Request, error) { var inCpy *ListTagsForResourceInput if req.Input != nil { tmp := *req.Input inCpy = &tmp } newReq := req.Copy(inCpy) newReq.SetContext(ctx) return newReq.Request, nil }, }, } } // ListTagsForResourcePaginator is used to paginate the request. This can be done by // calling Next and CurrentPage. type ListTagsForResourcePaginator struct { aws.Pager } func (p *ListTagsForResourcePaginator) CurrentPage() *ListTagsForResourceOutput { return p.Pager.CurrentPage().(*ListTagsForResourceOutput) } // ListTagsForResourceResponse is the response type for the // ListTagsForResource API operation. type ListTagsForResourceResponse struct { *ListTagsForResourceOutput response *aws.Response } // SDKResponseMetdata returns the response metadata for the // ListTagsForResource request. func (r *ListTagsForResourceResponse) SDKResponseMetdata() *aws.Response { return r.response }