api_op_DeleteVPCAssociationAuthorization.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 // Removes authorization to submit an AssociateVPCWithHostedZone request to
15 // associate a specified VPC with a hosted zone that was created by a different
16 // account. You must use the account that created the hosted zone to submit a
17 // DeleteVPCAssociationAuthorization request.
18 //
19 // Sending this request only prevents the Amazon Web Services account that created
20 // the VPC from associating the VPC with the Amazon Route 53 hosted zone in the
21 // future. If the VPC is already associated with the hosted zone,
22 // DeleteVPCAssociationAuthorization won't disassociate the VPC from the hosted
23 // zone. If you want to delete an existing association, use
24 // DisassociateVPCFromHostedZone .
25 func (c *Client) DeleteVPCAssociationAuthorization(ctx context.Context, params *DeleteVPCAssociationAuthorizationInput, optFns ...func(*Options)) (*DeleteVPCAssociationAuthorizationOutput, error) {
26 if params == nil {
27 params = &DeleteVPCAssociationAuthorizationInput{}
28 }
29
30 result, metadata, err := c.invokeOperation(ctx, "DeleteVPCAssociationAuthorization", params, optFns, c.addOperationDeleteVPCAssociationAuthorizationMiddlewares)
31 if err != nil {
32 return nil, err
33 }
34
35 out := result.(*DeleteVPCAssociationAuthorizationOutput)
36 out.ResultMetadata = metadata
37 return out, nil
38 }
39
40 // A complex type that contains information about the request to remove
41 // authorization to associate a VPC that was created by one Amazon Web Services
42 // account with a hosted zone that was created with a different Amazon Web Services
43 // account.
44 type DeleteVPCAssociationAuthorizationInput struct {
45
46 // When removing authorization to associate a VPC that was created by one Amazon
47 // Web Services account with a hosted zone that was created with a different Amazon
48 // Web Services account, the ID of the hosted zone.
49 //
50 // This member is required.
51 HostedZoneId *string
52
53 // When removing authorization to associate a VPC that was created by one Amazon
54 // Web Services account with a hosted zone that was created with a different Amazon
55 // Web Services account, a complex type that includes the ID and region of the VPC.
56 //
57 // This member is required.
58 VPC *types.VPC
59
60 noSmithyDocumentSerde
61 }
62
63 // Empty response for the request.
64 type DeleteVPCAssociationAuthorizationOutput struct {
65 // Metadata pertaining to the operation's result.
66 ResultMetadata middleware.Metadata
67
68 noSmithyDocumentSerde
69 }
70
71 func (c *Client) addOperationDeleteVPCAssociationAuthorizationMiddlewares(stack *middleware.Stack, options Options) (err error) {
72 if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
73 return err
74 }
75 err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteVPCAssociationAuthorization{}, middleware.After)
76 if err != nil {
77 return err
78 }
79 err = stack.Deserialize.Add(&awsRestxml_deserializeOpDeleteVPCAssociationAuthorization{}, middleware.After)
80 if err != nil {
81 return err
82 }
83 if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteVPCAssociationAuthorization"); err != nil {
84 return fmt.Errorf("add protocol finalizers: %v", err)
85 }
86
87 if err = addlegacyEndpointContextSetter(stack, options); err != nil {
88 return err
89 }
90 if err = addSetLoggerMiddleware(stack, options); err != nil {
91 return err
92 }
93 if err = addClientRequestID(stack); err != nil {
94 return err
95 }
96 if err = addComputeContentLength(stack); err != nil {
97 return err
98 }
99 if err = addResolveEndpointMiddleware(stack, options); err != nil {
100 return err
101 }
102 if err = addComputePayloadSHA256(stack); err != nil {
103 return err
104 }
105 if err = addRetry(stack, options); err != nil {
106 return err
107 }
108 if err = addRawResponseToMetadata(stack); err != nil {
109 return err
110 }
111 if err = addRecordResponseTiming(stack); err != nil {
112 return err
113 }
114 if err = addSpanRetryLoop(stack, options); err != nil {
115 return err
116 }
117 if err = addClientUserAgent(stack, options); err != nil {
118 return err
119 }
120 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
121 return err
122 }
123 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
124 return err
125 }
126 if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
127 return err
128 }
129 if err = addTimeOffsetBuild(stack, c); err != nil {
130 return err
131 }
132 if err = addUserAgentRetryMode(stack, options); err != nil {
133 return err
134 }
135 if err = addCredentialSource(stack, options); err != nil {
136 return err
137 }
138 if err = addOpDeleteVPCAssociationAuthorizationValidationMiddleware(stack); err != nil {
139 return err
140 }
141 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVPCAssociationAuthorization(options.Region), middleware.Before); err != nil {
142 return err
143 }
144 if err = addRecursionDetection(stack); err != nil {
145 return err
146 }
147 if err = addRequestIDRetrieverMiddleware(stack); err != nil {
148 return err
149 }
150 if err = addResponseErrorMiddleware(stack); err != nil {
151 return err
152 }
153 if err = addSanitizeURLMiddleware(stack); err != nil {
154 return err
155 }
156 if err = addRequestResponseLogging(stack, options); err != nil {
157 return err
158 }
159 if err = addDisableHTTPSMiddleware(stack, options); err != nil {
160 return err
161 }
162 if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
163 return err
164 }
165 if err = addInterceptAttempt(stack, options); err != nil {
166 return err
167 }
168 if err = addInterceptors(stack, options); err != nil {
169 return err
170 }
171 return nil
172 }
173
174 func newServiceMetadataMiddleware_opDeleteVPCAssociationAuthorization(region string) *awsmiddleware.RegisterServiceMetadata {
175 return &awsmiddleware.RegisterServiceMetadata{
176 Region: region,
177 ServiceID: ServiceID,
178 OperationName: "DeleteVPCAssociationAuthorization",
179 }
180 }
181