// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package route53 import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" "github.com/aws/aws-sdk-go-v2/private/protocol" ) // A complex type containing information about a request for a list of the tags // that are associated with an individual resource. type ListTagsForResourceInput struct { _ struct{} `type:"structure"` // The ID of the resource for which you want to retrieve tags. // // ResourceId is a required field ResourceId *string `location:"uri" locationName:"ResourceId" type:"string" required:"true"` // The type of the resource. // // * The resource type for health checks is healthcheck. // // * The resource type for hosted zones is hostedzone. // // ResourceType is a required field ResourceType TagResourceType `location:"uri" locationName:"ResourceType" type:"string" required:"true" enum:"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 len(s.ResourceType) == 0 { invalidParams.Add(aws.NewErrParamRequired("ResourceType")) } if invalidParams.Len() > 0 { return invalidParams } return nil } // MarshalFields encodes the AWS API shape using the passed in protocol encoder. func (s ListTagsForResourceInput) MarshalFields(e protocol.FieldEncoder) error { if s.ResourceId != nil { v := *s.ResourceId metadata := protocol.Metadata{} e.SetValue(protocol.PathTarget, "ResourceId", protocol.StringValue(v), metadata) } if len(s.ResourceType) > 0 { v := s.ResourceType metadata := protocol.Metadata{} e.SetValue(protocol.PathTarget, "ResourceType", v, metadata) } return nil } // A complex type that contains information about the health checks or hosted // zones for which you want to list tags. type ListTagsForResourceOutput struct { _ struct{} `type:"structure"` // A ResourceTagSet containing tags associated with the specified resource. // // ResourceTagSet is a required field ResourceTagSet *ResourceTagSet `type:"structure" required:"true"` } // String returns the string representation func (s ListTagsForResourceOutput) String() string { return awsutil.Prettify(s) } // MarshalFields encodes the AWS API shape using the passed in protocol encoder. func (s ListTagsForResourceOutput) MarshalFields(e protocol.FieldEncoder) error { if s.ResourceTagSet != nil { v := s.ResourceTagSet metadata := protocol.Metadata{} e.SetFields(protocol.BodyTarget, "ResourceTagSet", v, metadata) } return nil } const opListTagsForResource = "ListTagsForResource" // ListTagsForResourceRequest returns a request value for making API operation for // Amazon Route 53. // // Lists tags for one health check or hosted zone. // // For information about using tags for cost allocation, see Using Cost Allocation // Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) // in the AWS Billing and Cost Management User Guide. // // // 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/route53-2013-04-01/ListTagsForResource func (c *Client) ListTagsForResourceRequest(input *ListTagsForResourceInput) ListTagsForResourceRequest { op := &aws.Operation{ Name: opListTagsForResource, HTTPMethod: "GET", HTTPPath: "/2013-04-01/tags/{ResourceType}/{ResourceId}", } 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 } // 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 }