api_op_UpdateTrafficPolicyComment.go (4478B)
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 // Updates the comment for a specified traffic policy version. 15 func (c *Client) UpdateTrafficPolicyComment(ctx context.Context, params *UpdateTrafficPolicyCommentInput, optFns ...func(*Options)) (*UpdateTrafficPolicyCommentOutput, error) { 16 if params == nil { 17 params = &UpdateTrafficPolicyCommentInput{} 18 } 19 20 result, metadata, err := c.invokeOperation(ctx, "UpdateTrafficPolicyComment", params, optFns, c.addOperationUpdateTrafficPolicyCommentMiddlewares) 21 if err != nil { 22 return nil, err 23 } 24 25 out := result.(*UpdateTrafficPolicyCommentOutput) 26 out.ResultMetadata = metadata 27 return out, nil 28 } 29 30 // A complex type that contains information about the traffic policy that you want 31 // to update the comment for. 32 type UpdateTrafficPolicyCommentInput struct { 33 34 // The new comment for the specified traffic policy and version. 35 // 36 // This member is required. 37 Comment *string 38 39 // The value of Id for the traffic policy that you want to update the comment for. 40 // 41 // This member is required. 42 Id *string 43 44 // The value of Version for the traffic policy that you want to update the comment 45 // for. 46 // 47 // This member is required. 48 Version *int32 49 50 noSmithyDocumentSerde 51 } 52 53 // A complex type that contains the response information for the traffic policy. 54 type UpdateTrafficPolicyCommentOutput struct { 55 56 // A complex type that contains settings for the specified traffic policy. 57 // 58 // This member is required. 59 TrafficPolicy *types.TrafficPolicy 60 61 // Metadata pertaining to the operation's result. 62 ResultMetadata middleware.Metadata 63 64 noSmithyDocumentSerde 65 } 66 67 func (c *Client) addOperationUpdateTrafficPolicyCommentMiddlewares(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_serializeOpUpdateTrafficPolicyComment{}, middleware.After) 72 if err != nil { 73 return err 74 } 75 err = stack.Deserialize.Add(&awsRestxml_deserializeOpUpdateTrafficPolicyComment{}, middleware.After) 76 if err != nil { 77 return err 78 } 79 if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateTrafficPolicyComment"); 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 = addOpUpdateTrafficPolicyCommentValidationMiddleware(stack); err != nil { 123 return err 124 } 125 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateTrafficPolicyComment(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_opUpdateTrafficPolicyComment(region string) *awsmiddleware.RegisterServiceMetadata { 147 return &awsmiddleware.RegisterServiceMetadata{ 148 Region: region, 149 ServiceID: ServiceID, 150 OperationName: "UpdateTrafficPolicyComment", 151 } 152 }