src

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

api_op_DeleteVPCAssociationAuthorization.go (5417B)


      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. 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 	if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
     71 		return err
     72 	}
     73 	err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteVPCAssociationAuthorization{}, middleware.After)
     74 	if err != nil {
     75 		return err
     76 	}
     77 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpDeleteVPCAssociationAuthorization{}, middleware.After)
     78 	if err != nil {
     79 		return err
     80 	}
     81 	if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteVPCAssociationAuthorization"); err != nil {
     82 		return fmt.Errorf("add protocol finalizers: %v", err)
     83 	}
     84 
     85 	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
     86 		return err
     87 	}
     88 	if err = addSetLoggerMiddleware(stack, options); err != nil {
     89 		return err
     90 	}
     91 	if err = addClientRequestID(stack); err != nil {
     92 		return err
     93 	}
     94 	if err = addComputeContentLength(stack); err != nil {
     95 		return err
     96 	}
     97 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
     98 		return err
     99 	}
    100 	if err = addComputePayloadSHA256(stack); err != nil {
    101 		return err
    102 	}
    103 	if err = addRetry(stack, options); err != nil {
    104 		return err
    105 	}
    106 	if err = addRawResponseToMetadata(stack); err != nil {
    107 		return err
    108 	}
    109 	if err = addRecordResponseTiming(stack); err != nil {
    110 		return err
    111 	}
    112 	if err = addClientUserAgent(stack, options); err != nil {
    113 		return err
    114 	}
    115 	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
    116 		return err
    117 	}
    118 	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
    119 		return err
    120 	}
    121 	if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
    122 		return err
    123 	}
    124 	if err = addOpDeleteVPCAssociationAuthorizationValidationMiddleware(stack); err != nil {
    125 		return err
    126 	}
    127 	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVPCAssociationAuthorization(options.Region), middleware.Before); err != nil {
    128 		return err
    129 	}
    130 	if err = addRecursionDetection(stack); err != nil {
    131 		return err
    132 	}
    133 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    134 		return err
    135 	}
    136 	if err = addResponseErrorMiddleware(stack); err != nil {
    137 		return err
    138 	}
    139 	if err = addSanitizeURLMiddleware(stack); err != nil {
    140 		return err
    141 	}
    142 	if err = addRequestResponseLogging(stack, options); err != nil {
    143 		return err
    144 	}
    145 	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
    146 		return err
    147 	}
    148 	return nil
    149 }
    150 
    151 func newServiceMetadataMiddleware_opDeleteVPCAssociationAuthorization(region string) *awsmiddleware.RegisterServiceMetadata {
    152 	return &awsmiddleware.RegisterServiceMetadata{
    153 		Region:        region,
    154 		ServiceID:     ServiceID,
    155 		OperationName: "DeleteVPCAssociationAuthorization",
    156 	}
    157 }