src

Go monorepo.
git clone git://code.dwrz.net/src
Log | Files | Refs

api_op_ListTagsForResource.go (4578B)


      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 one health check or hosted zone. For information about using
     15 // 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) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {
     18 	if params == nil {
     19 		params = &ListTagsForResourceInput{}
     20 	}
     21 
     22 	result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares)
     23 	if err != nil {
     24 		return nil, err
     25 	}
     26 
     27 	out := result.(*ListTagsForResourceOutput)
     28 	out.ResultMetadata = metadata
     29 	return out, nil
     30 }
     31 
     32 // A complex type containing information about a request for a list of the tags
     33 // that are associated with an individual resource.
     34 type ListTagsForResourceInput struct {
     35 
     36 	// The ID of the resource for which you want to retrieve tags.
     37 	//
     38 	// This member is required.
     39 	ResourceId *string
     40 
     41 	// The type of the resource.
     42 	//   - The resource type for health checks is healthcheck .
     43 	//   - The resource type for hosted zones is hostedzone .
     44 	//
     45 	// This member is required.
     46 	ResourceType types.TagResourceType
     47 
     48 	noSmithyDocumentSerde
     49 }
     50 
     51 // A complex type that contains information about the health checks or hosted
     52 // zones for which you want to list tags.
     53 type ListTagsForResourceOutput struct {
     54 
     55 	// A ResourceTagSet containing tags associated with the specified resource.
     56 	//
     57 	// This member is required.
     58 	ResourceTagSet *types.ResourceTagSet
     59 
     60 	// Metadata pertaining to the operation's result.
     61 	ResultMetadata middleware.Metadata
     62 
     63 	noSmithyDocumentSerde
     64 }
     65 
     66 func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
     67 	if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
     68 		return err
     69 	}
     70 	err = stack.Serialize.Add(&awsRestxml_serializeOpListTagsForResource{}, middleware.After)
     71 	if err != nil {
     72 		return err
     73 	}
     74 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpListTagsForResource{}, middleware.After)
     75 	if err != nil {
     76 		return err
     77 	}
     78 	if err := addProtocolFinalizerMiddlewares(stack, options, "ListTagsForResource"); err != nil {
     79 		return fmt.Errorf("add protocol finalizers: %v", err)
     80 	}
     81 
     82 	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
     83 		return err
     84 	}
     85 	if err = addSetLoggerMiddleware(stack, options); err != nil {
     86 		return err
     87 	}
     88 	if err = addClientRequestID(stack); err != nil {
     89 		return err
     90 	}
     91 	if err = addComputeContentLength(stack); err != nil {
     92 		return err
     93 	}
     94 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
     95 		return err
     96 	}
     97 	if err = addComputePayloadSHA256(stack); err != nil {
     98 		return err
     99 	}
    100 	if err = addRetry(stack, options); err != nil {
    101 		return err
    102 	}
    103 	if err = addRawResponseToMetadata(stack); err != nil {
    104 		return err
    105 	}
    106 	if err = addRecordResponseTiming(stack); err != nil {
    107 		return err
    108 	}
    109 	if err = addClientUserAgent(stack, options); err != nil {
    110 		return err
    111 	}
    112 	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
    113 		return err
    114 	}
    115 	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
    116 		return err
    117 	}
    118 	if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
    119 		return err
    120 	}
    121 	if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {
    122 		return err
    123 	}
    124 	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil {
    125 		return err
    126 	}
    127 	if err = addRecursionDetection(stack); err != nil {
    128 		return err
    129 	}
    130 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    131 		return err
    132 	}
    133 	if err = addResponseErrorMiddleware(stack); err != nil {
    134 		return err
    135 	}
    136 	if err = addRequestResponseLogging(stack, options); err != nil {
    137 		return err
    138 	}
    139 	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
    140 		return err
    141 	}
    142 	return nil
    143 }
    144 
    145 func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
    146 	return &awsmiddleware.RegisterServiceMetadata{
    147 		Region:        region,
    148 		ServiceID:     ServiceID,
    149 		OperationName: "ListTagsForResource",
    150 	}
    151 }