api_op_ListTagsForResources.go (4257B)
1 // Code generated by smithy-go-codegen DO NOT EDIT. 2 3 package route53 4 5 import ( 6 "context" 7 awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" 8 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" 9 "github.com/aws/aws-sdk-go-v2/service/route53/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12 ) 13 14 // Lists tags for up to 10 health checks or hosted zones. For information about 15 // using tags for cost allocation, see Using Cost Allocation Tags 16 // (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) 17 // in the Billing and Cost Management User Guide. 18 func (c *Client) ListTagsForResources(ctx context.Context, params *ListTagsForResourcesInput, optFns ...func(*Options)) (*ListTagsForResourcesOutput, error) { 19 if params == nil { 20 params = &ListTagsForResourcesInput{} 21 } 22 23 result, metadata, err := c.invokeOperation(ctx, "ListTagsForResources", params, optFns, c.addOperationListTagsForResourcesMiddlewares) 24 if err != nil { 25 return nil, err 26 } 27 28 out := result.(*ListTagsForResourcesOutput) 29 out.ResultMetadata = metadata 30 return out, nil 31 } 32 33 // A complex type that contains information about the health checks or hosted zones 34 // for which you want to list tags. 35 type ListTagsForResourcesInput struct { 36 37 // A complex type that contains the ResourceId element for each resource for which 38 // you want to get a list of tags. 39 // 40 // This member is required. 41 ResourceIds []string 42 43 // The type of the resources. 44 // 45 // * The resource type for health checks is 46 // healthcheck. 47 // 48 // * The resource type for hosted zones is hostedzone. 49 // 50 // This member is required. 51 ResourceType types.TagResourceType 52 53 noSmithyDocumentSerde 54 } 55 56 // A complex type containing tags for the specified resources. 57 type ListTagsForResourcesOutput struct { 58 59 // A list of ResourceTagSets containing tags associated with the specified 60 // resources. 61 // 62 // This member is required. 63 ResourceTagSets []types.ResourceTagSet 64 65 // Metadata pertaining to the operation's result. 66 ResultMetadata middleware.Metadata 67 68 noSmithyDocumentSerde 69 } 70 71 func (c *Client) addOperationListTagsForResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { 72 err = stack.Serialize.Add(&awsRestxml_serializeOpListTagsForResources{}, middleware.After) 73 if err != nil { 74 return err 75 } 76 err = stack.Deserialize.Add(&awsRestxml_deserializeOpListTagsForResources{}, middleware.After) 77 if err != nil { 78 return err 79 } 80 if err = addSetLoggerMiddleware(stack, options); err != nil { 81 return err 82 } 83 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 84 return err 85 } 86 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 87 return err 88 } 89 if err = addResolveEndpointMiddleware(stack, options); err != nil { 90 return err 91 } 92 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 93 return err 94 } 95 if err = addRetryMiddlewares(stack, options); err != nil { 96 return err 97 } 98 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 99 return err 100 } 101 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 102 return err 103 } 104 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 105 return err 106 } 107 if err = addClientUserAgent(stack); err != nil { 108 return err 109 } 110 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 111 return err 112 } 113 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 114 return err 115 } 116 if err = addOpListTagsForResourcesValidationMiddleware(stack); err != nil { 117 return err 118 } 119 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResources(options.Region), middleware.Before); err != nil { 120 return err 121 } 122 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 123 return err 124 } 125 if err = addResponseErrorMiddleware(stack); err != nil { 126 return err 127 } 128 if err = addRequestResponseLogging(stack, options); err != nil { 129 return err 130 } 131 return nil 132 } 133 134 func newServiceMetadataMiddleware_opListTagsForResources(region string) *awsmiddleware.RegisterServiceMetadata { 135 return &awsmiddleware.RegisterServiceMetadata{ 136 Region: region, 137 ServiceID: ServiceID, 138 SigningName: "route53", 139 OperationName: "ListTagsForResources", 140 } 141 }