src

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

api_op_GetTrafficPolicyInstance.go (4541B)


      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 // Gets information about a specified traffic policy instance. Use
     15 // GetTrafficPolicyInstance with the id of new traffic policy instance to confirm
     16 // that the CreateTrafficPolicyInstance or an UpdateTrafficPolicyInstance request
     17 // completed successfully. For more information, see the State response element.
     18 // In the Route 53 console, traffic policy instances are known as policy records.
     19 func (c *Client) GetTrafficPolicyInstance(ctx context.Context, params *GetTrafficPolicyInstanceInput, optFns ...func(*Options)) (*GetTrafficPolicyInstanceOutput, error) {
     20 	if params == nil {
     21 		params = &GetTrafficPolicyInstanceInput{}
     22 	}
     23 
     24 	result, metadata, err := c.invokeOperation(ctx, "GetTrafficPolicyInstance", params, optFns, c.addOperationGetTrafficPolicyInstanceMiddlewares)
     25 	if err != nil {
     26 		return nil, err
     27 	}
     28 
     29 	out := result.(*GetTrafficPolicyInstanceOutput)
     30 	out.ResultMetadata = metadata
     31 	return out, nil
     32 }
     33 
     34 // Gets information about a specified traffic policy instance.
     35 type GetTrafficPolicyInstanceInput struct {
     36 
     37 	// The ID of the traffic policy instance that you want to get information about.
     38 	//
     39 	// This member is required.
     40 	Id *string
     41 
     42 	noSmithyDocumentSerde
     43 }
     44 
     45 // A complex type that contains information about the resource record sets that
     46 // Amazon Route 53 created based on a specified traffic policy.
     47 type GetTrafficPolicyInstanceOutput struct {
     48 
     49 	// A complex type that contains settings for the traffic policy instance.
     50 	//
     51 	// This member is required.
     52 	TrafficPolicyInstance *types.TrafficPolicyInstance
     53 
     54 	// Metadata pertaining to the operation's result.
     55 	ResultMetadata middleware.Metadata
     56 
     57 	noSmithyDocumentSerde
     58 }
     59 
     60 func (c *Client) addOperationGetTrafficPolicyInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) {
     61 	if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
     62 		return err
     63 	}
     64 	err = stack.Serialize.Add(&awsRestxml_serializeOpGetTrafficPolicyInstance{}, middleware.After)
     65 	if err != nil {
     66 		return err
     67 	}
     68 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetTrafficPolicyInstance{}, middleware.After)
     69 	if err != nil {
     70 		return err
     71 	}
     72 	if err := addProtocolFinalizerMiddlewares(stack, options, "GetTrafficPolicyInstance"); err != nil {
     73 		return fmt.Errorf("add protocol finalizers: %v", err)
     74 	}
     75 
     76 	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
     77 		return err
     78 	}
     79 	if err = addSetLoggerMiddleware(stack, options); err != nil {
     80 		return err
     81 	}
     82 	if err = addClientRequestID(stack); err != nil {
     83 		return err
     84 	}
     85 	if err = addComputeContentLength(stack); err != nil {
     86 		return err
     87 	}
     88 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
     89 		return err
     90 	}
     91 	if err = addComputePayloadSHA256(stack); err != nil {
     92 		return err
     93 	}
     94 	if err = addRetry(stack, options); err != nil {
     95 		return err
     96 	}
     97 	if err = addRawResponseToMetadata(stack); err != nil {
     98 		return err
     99 	}
    100 	if err = addRecordResponseTiming(stack); err != nil {
    101 		return err
    102 	}
    103 	if err = addClientUserAgent(stack, options); err != nil {
    104 		return err
    105 	}
    106 	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
    107 		return err
    108 	}
    109 	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
    110 		return err
    111 	}
    112 	if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
    113 		return err
    114 	}
    115 	if err = addOpGetTrafficPolicyInstanceValidationMiddleware(stack); err != nil {
    116 		return err
    117 	}
    118 	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTrafficPolicyInstance(options.Region), middleware.Before); err != nil {
    119 		return err
    120 	}
    121 	if err = addRecursionDetection(stack); err != nil {
    122 		return err
    123 	}
    124 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    125 		return err
    126 	}
    127 	if err = addResponseErrorMiddleware(stack); err != nil {
    128 		return err
    129 	}
    130 	if err = addRequestResponseLogging(stack, options); err != nil {
    131 		return err
    132 	}
    133 	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
    134 		return err
    135 	}
    136 	return nil
    137 }
    138 
    139 func newServiceMetadataMiddleware_opGetTrafficPolicyInstance(region string) *awsmiddleware.RegisterServiceMetadata {
    140 	return &awsmiddleware.RegisterServiceMetadata{
    141 		Region:        region,
    142 		ServiceID:     ServiceID,
    143 		OperationName: "GetTrafficPolicyInstance",
    144 	}
    145 }