api_op_CreateCidrCollection.go (4288B)
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 // Creates a CIDR collection in the current Amazon Web Services account. 15 func (c *Client) CreateCidrCollection(ctx context.Context, params *CreateCidrCollectionInput, optFns ...func(*Options)) (*CreateCidrCollectionOutput, error) { 16 if params == nil { 17 params = &CreateCidrCollectionInput{} 18 } 19 20 result, metadata, err := c.invokeOperation(ctx, "CreateCidrCollection", params, optFns, c.addOperationCreateCidrCollectionMiddlewares) 21 if err != nil { 22 return nil, err 23 } 24 25 out := result.(*CreateCidrCollectionOutput) 26 out.ResultMetadata = metadata 27 return out, nil 28 } 29 30 type CreateCidrCollectionInput struct { 31 32 // A client-specific token that allows requests to be securely retried so that the 33 // intended outcome will only occur once, retries receive a similar response, and 34 // there are no additional edge cases to handle. 35 // 36 // This member is required. 37 CallerReference *string 38 39 // A unique identifier for the account that can be used to reference the 40 // collection from other API calls. 41 // 42 // This member is required. 43 Name *string 44 45 noSmithyDocumentSerde 46 } 47 48 type CreateCidrCollectionOutput struct { 49 50 // A complex type that contains information about the CIDR collection. 51 Collection *types.CidrCollection 52 53 // A unique URL that represents the location for the CIDR collection. 54 Location *string 55 56 // Metadata pertaining to the operation's result. 57 ResultMetadata middleware.Metadata 58 59 noSmithyDocumentSerde 60 } 61 62 func (c *Client) addOperationCreateCidrCollectionMiddlewares(stack *middleware.Stack, options Options) (err error) { 63 if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { 64 return err 65 } 66 err = stack.Serialize.Add(&awsRestxml_serializeOpCreateCidrCollection{}, middleware.After) 67 if err != nil { 68 return err 69 } 70 err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateCidrCollection{}, middleware.After) 71 if err != nil { 72 return err 73 } 74 if err := addProtocolFinalizerMiddlewares(stack, options, "CreateCidrCollection"); err != nil { 75 return fmt.Errorf("add protocol finalizers: %v", err) 76 } 77 78 if err = addlegacyEndpointContextSetter(stack, options); err != nil { 79 return err 80 } 81 if err = addSetLoggerMiddleware(stack, options); err != nil { 82 return err 83 } 84 if err = addClientRequestID(stack); err != nil { 85 return err 86 } 87 if err = addComputeContentLength(stack); err != nil { 88 return err 89 } 90 if err = addResolveEndpointMiddleware(stack, options); err != nil { 91 return err 92 } 93 if err = addComputePayloadSHA256(stack); err != nil { 94 return err 95 } 96 if err = addRetry(stack, options); err != nil { 97 return err 98 } 99 if err = addRawResponseToMetadata(stack); err != nil { 100 return err 101 } 102 if err = addRecordResponseTiming(stack); err != nil { 103 return err 104 } 105 if err = addClientUserAgent(stack, options); 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { 115 return err 116 } 117 if err = addOpCreateCidrCollectionValidationMiddleware(stack); err != nil { 118 return err 119 } 120 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCidrCollection(options.Region), middleware.Before); err != nil { 121 return err 122 } 123 if err = addRecursionDetection(stack); err != nil { 124 return err 125 } 126 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 127 return err 128 } 129 if err = addResponseErrorMiddleware(stack); err != nil { 130 return err 131 } 132 if err = addRequestResponseLogging(stack, options); err != nil { 133 return err 134 } 135 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 136 return err 137 } 138 return nil 139 } 140 141 func newServiceMetadataMiddleware_opCreateCidrCollection(region string) *awsmiddleware.RegisterServiceMetadata { 142 return &awsmiddleware.RegisterServiceMetadata{ 143 Region: region, 144 ServiceID: ServiceID, 145 OperationName: "CreateCidrCollection", 146 } 147 }