api_op_DeleteVPCAssociationAuthorization.go (5043B)
1 // Code generated by smithy-go-codegen DO NOT EDIT. 2 3 package route53 4 5 import ( 6 "context" 7 awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" 8 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" 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. Sending this request only prevents 18 // the Amazon Web Services account that created the VPC from associating the VPC 19 // with the Amazon Route 53 hosted zone in the future. If the VPC is already 20 // associated with the hosted zone, DeleteVPCAssociationAuthorization won't 21 // disassociate the VPC from the hosted zone. If you want to delete an existing 22 // association, use DisassociateVPCFromHostedZone. 23 func (c *Client) DeleteVPCAssociationAuthorization(ctx context.Context, params *DeleteVPCAssociationAuthorizationInput, optFns ...func(*Options)) (*DeleteVPCAssociationAuthorizationOutput, error) { 24 if params == nil { 25 params = &DeleteVPCAssociationAuthorizationInput{} 26 } 27 28 result, metadata, err := c.invokeOperation(ctx, "DeleteVPCAssociationAuthorization", params, optFns, c.addOperationDeleteVPCAssociationAuthorizationMiddlewares) 29 if err != nil { 30 return nil, err 31 } 32 33 out := result.(*DeleteVPCAssociationAuthorizationOutput) 34 out.ResultMetadata = metadata 35 return out, nil 36 } 37 38 // A complex type that contains information about the request to remove 39 // authorization to associate a VPC that was created by one Amazon Web Services 40 // account with a hosted zone that was created with a different Amazon Web Services 41 // account. 42 type DeleteVPCAssociationAuthorizationInput struct { 43 44 // When removing authorization to associate a VPC that was created by one Amazon 45 // Web Services account with a hosted zone that was created with a different Amazon 46 // Web Services account, the ID of the hosted zone. 47 // 48 // This member is required. 49 HostedZoneId *string 50 51 // When removing authorization to associate a VPC that was created by one Amazon 52 // Web Services account with a hosted zone that was created with a different Amazon 53 // Web Services account, a complex type that includes the ID and region of the VPC. 54 // 55 // This member is required. 56 VPC *types.VPC 57 58 noSmithyDocumentSerde 59 } 60 61 // Empty response for the request. 62 type DeleteVPCAssociationAuthorizationOutput struct { 63 // Metadata pertaining to the operation's result. 64 ResultMetadata middleware.Metadata 65 66 noSmithyDocumentSerde 67 } 68 69 func (c *Client) addOperationDeleteVPCAssociationAuthorizationMiddlewares(stack *middleware.Stack, options Options) (err error) { 70 err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteVPCAssociationAuthorization{}, middleware.After) 71 if err != nil { 72 return err 73 } 74 err = stack.Deserialize.Add(&awsRestxml_deserializeOpDeleteVPCAssociationAuthorization{}, middleware.After) 75 if err != nil { 76 return err 77 } 78 if err = addSetLoggerMiddleware(stack, options); err != nil { 79 return err 80 } 81 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 82 return err 83 } 84 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 85 return err 86 } 87 if err = addResolveEndpointMiddleware(stack, options); err != nil { 88 return err 89 } 90 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 91 return err 92 } 93 if err = addRetryMiddlewares(stack, options); err != nil { 94 return err 95 } 96 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 97 return err 98 } 99 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 100 return err 101 } 102 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 103 return err 104 } 105 if err = addClientUserAgent(stack); err != nil { 106 return err 107 } 108 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 109 return err 110 } 111 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 112 return err 113 } 114 if err = addOpDeleteVPCAssociationAuthorizationValidationMiddleware(stack); err != nil { 115 return err 116 } 117 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVPCAssociationAuthorization(options.Region), middleware.Before); err != nil { 118 return err 119 } 120 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 121 return err 122 } 123 if err = addResponseErrorMiddleware(stack); err != nil { 124 return err 125 } 126 if err = addSanitizeURLMiddleware(stack); err != nil { 127 return err 128 } 129 if err = addRequestResponseLogging(stack, options); err != nil { 130 return err 131 } 132 return nil 133 } 134 135 func newServiceMetadataMiddleware_opDeleteVPCAssociationAuthorization(region string) *awsmiddleware.RegisterServiceMetadata { 136 return &awsmiddleware.RegisterServiceMetadata{ 137 Region: region, 138 ServiceID: ServiceID, 139 SigningName: "route53", 140 OperationName: "DeleteVPCAssociationAuthorization", 141 } 142 }