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