api_op_ChangeCidrCollection.go (4186B)
1 // Code generated by smithy-go-codegen DO NOT EDIT. 2 3 package route53 4 5 import ( 6 "context" 7 8 "github.com/aws/aws-sdk-go-v2/service/route53/types" 9 "github.com/aws/smithy-go/middleware" 10 ) 11 12 // Creates, changes, or deletes CIDR blocks within a collection. Contains 13 // authoritative IP information mapping blocks to one or multiple locations. 14 // 15 // A change request can update multiple locations in a collection at a time, which 16 // is helpful if you want to move one or more CIDR blocks from one location to 17 // another in one transaction, without downtime. 18 // 19 // # Limits 20 // 21 // The max number of CIDR blocks included in the request is 1000. As a result, big 22 // updates require multiple API calls. 23 // 24 // PUT and DELETE_IF_EXISTS 25 // 26 // Use ChangeCidrCollection to perform the following actions: 27 // 28 // - PUT : Create a CIDR block within the specified collection. 29 // 30 // - DELETE_IF_EXISTS : Delete an existing CIDR block from the collection. 31 func (c *Client) ChangeCidrCollection(ctx context.Context, params *ChangeCidrCollectionInput, optFns ...func(*Options)) (*ChangeCidrCollectionOutput, error) { 32 if params == nil { 33 params = &ChangeCidrCollectionInput{} 34 } 35 36 result, metadata, err := c.invokeOperation(ctx, "ChangeCidrCollection", params, optFns, c.addOperationChangeCidrCollectionMiddlewares) 37 if err != nil { 38 return nil, err 39 } 40 41 out := result.(*ChangeCidrCollectionOutput) 42 out.ResultMetadata = metadata 43 return out, nil 44 } 45 46 type ChangeCidrCollectionInput struct { 47 48 // Information about changes to a CIDR collection. 49 // 50 // This member is required. 51 Changes []types.CidrCollectionChange 52 53 // The UUID of the CIDR collection to update. 54 // 55 // This member is required. 56 Id *string 57 58 // A sequential counter that Amazon Route 53 sets to 1 when you create a 59 // collection and increments it by 1 each time you update the collection. 60 // 61 // We recommend that you use ListCidrCollection to get the current value of 62 // CollectionVersion for the collection that you want to update, and then include 63 // that value with the change request. This prevents Route 53 from overwriting an 64 // intervening update: 65 // 66 // - If the value in the request matches the value of CollectionVersion in the 67 // collection, Route 53 updates the collection. 68 // 69 // - If the value of CollectionVersion in the collection is greater than the 70 // value in the request, the collection was changed after you got the version 71 // number. Route 53 does not update the collection, and it returns a 72 // CidrCollectionVersionMismatch error. 73 CollectionVersion *int64 74 75 noSmithyDocumentSerde 76 } 77 78 type ChangeCidrCollectionOutput struct { 79 80 // The ID that is returned by ChangeCidrCollection . You can use it as input to 81 // GetChange to see if a CIDR collection change has propagated or not. 82 // 83 // This member is required. 84 Id *string 85 86 // Metadata pertaining to the operation's result. 87 ResultMetadata middleware.Metadata 88 89 noSmithyDocumentSerde 90 } 91 92 func (c *Client) addOperationChangeCidrCollectionMiddlewares(stack *middleware.Stack, options Options) (err error) { 93 err = stack.Serialize.Add(&awsRestxml_serializeOpChangeCidrCollection{}, middleware.After) 94 if err != nil { 95 return err 96 } 97 err = stack.Deserialize.Add(&awsRestxml_deserializeOpChangeCidrCollection{}, middleware.After) 98 if err != nil { 99 return err 100 } 101 102 if err = addComputeContentLength(stack); err != nil { 103 return err 104 } 105 if err = addResolveEndpointMiddleware(stack, options); err != nil { 106 return err 107 } 108 if err = addComputePayloadSHA256(stack); err != nil { 109 return err 110 } 111 if err = addRecordResponseTiming(stack, options); err != nil { 112 return err 113 } 114 if err = addCredentialSource(stack, options); err != nil { 115 return err 116 } 117 if err = addOpChangeCidrCollectionValidationMiddleware(stack); 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 = addRequestResponseLogging(stack, options); err != nil { 127 return err 128 } 129 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 130 return err 131 } 132 if err = addInterceptors(stack, options); err != nil { 133 return err 134 } 135 return nil 136 }