api_op_UpdateHostedZoneComment.go raw
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 hosted zone.
15 func (c *Client) UpdateHostedZoneComment(ctx context.Context, params *UpdateHostedZoneCommentInput, optFns ...func(*Options)) (*UpdateHostedZoneCommentOutput, error) {
16 if params == nil {
17 params = &UpdateHostedZoneCommentInput{}
18 }
19
20 result, metadata, err := c.invokeOperation(ctx, "UpdateHostedZoneComment", params, optFns, c.addOperationUpdateHostedZoneCommentMiddlewares)
21 if err != nil {
22 return nil, err
23 }
24
25 out := result.(*UpdateHostedZoneCommentOutput)
26 out.ResultMetadata = metadata
27 return out, nil
28 }
29
30 // A request to update the comment for a hosted zone.
31 type UpdateHostedZoneCommentInput struct {
32
33 // The ID for the hosted zone that you want to update the comment for.
34 //
35 // This member is required.
36 Id *string
37
38 // The new comment for the hosted zone. If you don't specify a value for Comment ,
39 // Amazon Route 53 deletes the existing value of the Comment element, if any.
40 Comment *string
41
42 noSmithyDocumentSerde
43 }
44
45 // A complex type that contains the response to the UpdateHostedZoneComment
46 // request.
47 type UpdateHostedZoneCommentOutput struct {
48
49 // A complex type that contains the response to the UpdateHostedZoneComment
50 // request.
51 //
52 // This member is required.
53 HostedZone *types.HostedZone
54
55 // Metadata pertaining to the operation's result.
56 ResultMetadata middleware.Metadata
57
58 noSmithyDocumentSerde
59 }
60
61 func (c *Client) addOperationUpdateHostedZoneCommentMiddlewares(stack *middleware.Stack, options Options) (err error) {
62 if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
63 return err
64 }
65 err = stack.Serialize.Add(&awsRestxml_serializeOpUpdateHostedZoneComment{}, middleware.After)
66 if err != nil {
67 return err
68 }
69 err = stack.Deserialize.Add(&awsRestxml_deserializeOpUpdateHostedZoneComment{}, middleware.After)
70 if err != nil {
71 return err
72 }
73 if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateHostedZoneComment"); err != nil {
74 return fmt.Errorf("add protocol finalizers: %v", err)
75 }
76
77 if err = addlegacyEndpointContextSetter(stack, options); err != nil {
78 return err
79 }
80 if err = addSetLoggerMiddleware(stack, options); err != nil {
81 return err
82 }
83 if err = addClientRequestID(stack); err != nil {
84 return err
85 }
86 if err = addComputeContentLength(stack); err != nil {
87 return err
88 }
89 if err = addResolveEndpointMiddleware(stack, options); err != nil {
90 return err
91 }
92 if err = addComputePayloadSHA256(stack); err != nil {
93 return err
94 }
95 if err = addRetry(stack, options); err != nil {
96 return err
97 }
98 if err = addRawResponseToMetadata(stack); err != nil {
99 return err
100 }
101 if err = addRecordResponseTiming(stack); err != nil {
102 return err
103 }
104 if err = addSpanRetryLoop(stack, options); err != nil {
105 return err
106 }
107 if err = addClientUserAgent(stack, options); 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
117 return err
118 }
119 if err = addTimeOffsetBuild(stack, c); err != nil {
120 return err
121 }
122 if err = addUserAgentRetryMode(stack, options); err != nil {
123 return err
124 }
125 if err = addCredentialSource(stack, options); err != nil {
126 return err
127 }
128 if err = addOpUpdateHostedZoneCommentValidationMiddleware(stack); err != nil {
129 return err
130 }
131 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateHostedZoneComment(options.Region), middleware.Before); err != nil {
132 return err
133 }
134 if err = addRecursionDetection(stack); err != nil {
135 return err
136 }
137 if err = addRequestIDRetrieverMiddleware(stack); err != nil {
138 return err
139 }
140 if err = addResponseErrorMiddleware(stack); err != nil {
141 return err
142 }
143 if err = addSanitizeURLMiddleware(stack); err != nil {
144 return err
145 }
146 if err = addRequestResponseLogging(stack, options); err != nil {
147 return err
148 }
149 if err = addDisableHTTPSMiddleware(stack, options); err != nil {
150 return err
151 }
152 if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
153 return err
154 }
155 if err = addInterceptAttempt(stack, options); err != nil {
156 return err
157 }
158 if err = addInterceptors(stack, options); err != nil {
159 return err
160 }
161 return nil
162 }
163
164 func newServiceMetadataMiddleware_opUpdateHostedZoneComment(region string) *awsmiddleware.RegisterServiceMetadata {
165 return &awsmiddleware.RegisterServiceMetadata{
166 Region: region,
167 ServiceID: ServiceID,
168 OperationName: "UpdateHostedZoneComment",
169 }
170 }
171