// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package organizations import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" ) type ListTagsForResourceInput struct { _ struct{} `type:"structure"` // The parameter for receiving additional results if you receive a NextToken // response in a previous request. A NextToken response indicates that more // output is available. Set this parameter to the value of the previous call's // NextToken response to indicate where the output should continue from. NextToken *string `type:"string"` // The ID of the resource that you want to retrieve tags for. // // ResourceId is a required field ResourceId *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.ResourceId == nil { invalidParams.Add(aws.NewErrParamRequired("ResourceId")) } if invalidParams.Len() > 0 { return invalidParams } return nil } type ListTagsForResourceOutput struct { _ struct{} `type:"structure"` // If present, indicates that more output is available than is included in the // current response. Use this value in the NextToken request parameter in a // subsequent call to the operation to get the next part of the output. You // should repeat this until the NextToken response element comes back as null. NextToken *string `type:"string"` // The tags that are assigned to the resource. Tags []Tag `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 Organizations. // // Lists tags for the specified resource. // // Currently, you can list tags on an account in AWS Organizations. // // This operation can be called only from the organization's master account // or by a member account that is a delegated administrator for an AWS service. // // // 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/organizations-2016-11-28/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: "", 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 := organizations.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 }