code.dwrz.net

Go monorepo.
Log | Files | Refs

api_op_ChangeCidrCollection.go (5213B)


      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 // Creates, changes, or deletes CIDR blocks within a collection. Contains
     15 // authoritative IP information mapping blocks to one or multiple locations. A
     16 // change request can update multiple locations in a collection at a time, which is
     17 // helpful if you want to move one or more CIDR blocks from one location to another
     18 // in one transaction, without downtime. Limits The max number of CIDR blocks
     19 // included in the request is 1000. As a result, big updates require multiple API
     20 // calls. PUT and DELETE_IF_EXISTS Use ChangeCidrCollection to perform the
     21 // following actions:
     22 //
     23 // * PUT: Create a CIDR block within the specified
     24 // collection.
     25 //
     26 // * DELETE_IF_EXISTS: Delete an existing CIDR block from the
     27 // collection.
     28 func (c *Client) ChangeCidrCollection(ctx context.Context, params *ChangeCidrCollectionInput, optFns ...func(*Options)) (*ChangeCidrCollectionOutput, error) {
     29 	if params == nil {
     30 		params = &ChangeCidrCollectionInput{}
     31 	}
     32 
     33 	result, metadata, err := c.invokeOperation(ctx, "ChangeCidrCollection", params, optFns, c.addOperationChangeCidrCollectionMiddlewares)
     34 	if err != nil {
     35 		return nil, err
     36 	}
     37 
     38 	out := result.(*ChangeCidrCollectionOutput)
     39 	out.ResultMetadata = metadata
     40 	return out, nil
     41 }
     42 
     43 type ChangeCidrCollectionInput struct {
     44 
     45 	// Information about changes to a CIDR collection.
     46 	//
     47 	// This member is required.
     48 	Changes []types.CidrCollectionChange
     49 
     50 	// The UUID of the CIDR collection to update.
     51 	//
     52 	// This member is required.
     53 	Id *string
     54 
     55 	// A sequential counter that Amazon Route 53 sets to 1 when you create a collection
     56 	// and increments it by 1 each time you update the collection. We recommend that
     57 	// you use ListCidrCollection to get the current value of CollectionVersion for the
     58 	// collection that you want to update, and then include that value with the change
     59 	// request. This prevents Route 53 from overwriting an intervening update:
     60 	//
     61 	// * If
     62 	// the value in the request matches the value of CollectionVersion in the
     63 	// collection, Route 53 updates the collection.
     64 	//
     65 	// * If the value of
     66 	// CollectionVersion in the collection is greater than the value in the request,
     67 	// the collection was changed after you got the version number. Route 53 does not
     68 	// update the collection, and it returns a CidrCollectionVersionMismatch error.
     69 	CollectionVersion *int64
     70 
     71 	noSmithyDocumentSerde
     72 }
     73 
     74 type ChangeCidrCollectionOutput struct {
     75 
     76 	// The ID that is returned by ChangeCidrCollection. You can use it as input to
     77 	// GetChange to see if a CIDR collection change has propagated or not.
     78 	//
     79 	// This member is required.
     80 	Id *string
     81 
     82 	// Metadata pertaining to the operation's result.
     83 	ResultMetadata middleware.Metadata
     84 
     85 	noSmithyDocumentSerde
     86 }
     87 
     88 func (c *Client) addOperationChangeCidrCollectionMiddlewares(stack *middleware.Stack, options Options) (err error) {
     89 	err = stack.Serialize.Add(&awsRestxml_serializeOpChangeCidrCollection{}, middleware.After)
     90 	if err != nil {
     91 		return err
     92 	}
     93 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpChangeCidrCollection{}, middleware.After)
     94 	if err != nil {
     95 		return err
     96 	}
     97 	if err = addSetLoggerMiddleware(stack, options); err != nil {
     98 		return err
     99 	}
    100 	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
    101 		return err
    102 	}
    103 	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
    104 		return err
    105 	}
    106 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
    107 		return err
    108 	}
    109 	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
    110 		return err
    111 	}
    112 	if err = addRetryMiddlewares(stack, options); err != nil {
    113 		return err
    114 	}
    115 	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
    116 		return err
    117 	}
    118 	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
    119 		return err
    120 	}
    121 	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
    122 		return err
    123 	}
    124 	if err = addClientUserAgent(stack); err != nil {
    125 		return err
    126 	}
    127 	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
    128 		return err
    129 	}
    130 	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
    131 		return err
    132 	}
    133 	if err = addOpChangeCidrCollectionValidationMiddleware(stack); err != nil {
    134 		return err
    135 	}
    136 	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opChangeCidrCollection(options.Region), middleware.Before); err != nil {
    137 		return err
    138 	}
    139 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    140 		return err
    141 	}
    142 	if err = addResponseErrorMiddleware(stack); err != nil {
    143 		return err
    144 	}
    145 	if err = addRequestResponseLogging(stack, options); err != nil {
    146 		return err
    147 	}
    148 	return nil
    149 }
    150 
    151 func newServiceMetadataMiddleware_opChangeCidrCollection(region string) *awsmiddleware.RegisterServiceMetadata {
    152 	return &awsmiddleware.RegisterServiceMetadata{
    153 		Region:        region,
    154 		ServiceID:     ServiceID,
    155 		SigningName:   "route53",
    156 		OperationName: "ChangeCidrCollection",
    157 	}
    158 }