src

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

api_op_DeleteCidrCollection.go (3747B)


      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/smithy-go/middleware"
     10 	smithyhttp "github.com/aws/smithy-go/transport/http"
     11 )
     12 
     13 // Deletes a CIDR collection in the current Amazon Web Services account. The
     14 // collection must be empty before it can be deleted.
     15 func (c *Client) DeleteCidrCollection(ctx context.Context, params *DeleteCidrCollectionInput, optFns ...func(*Options)) (*DeleteCidrCollectionOutput, error) {
     16 	if params == nil {
     17 		params = &DeleteCidrCollectionInput{}
     18 	}
     19 
     20 	result, metadata, err := c.invokeOperation(ctx, "DeleteCidrCollection", params, optFns, c.addOperationDeleteCidrCollectionMiddlewares)
     21 	if err != nil {
     22 		return nil, err
     23 	}
     24 
     25 	out := result.(*DeleteCidrCollectionOutput)
     26 	out.ResultMetadata = metadata
     27 	return out, nil
     28 }
     29 
     30 type DeleteCidrCollectionInput struct {
     31 
     32 	// The UUID of the collection to delete.
     33 	//
     34 	// This member is required.
     35 	Id *string
     36 
     37 	noSmithyDocumentSerde
     38 }
     39 
     40 type DeleteCidrCollectionOutput struct {
     41 	// Metadata pertaining to the operation's result.
     42 	ResultMetadata middleware.Metadata
     43 
     44 	noSmithyDocumentSerde
     45 }
     46 
     47 func (c *Client) addOperationDeleteCidrCollectionMiddlewares(stack *middleware.Stack, options Options) (err error) {
     48 	if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
     49 		return err
     50 	}
     51 	err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteCidrCollection{}, middleware.After)
     52 	if err != nil {
     53 		return err
     54 	}
     55 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpDeleteCidrCollection{}, middleware.After)
     56 	if err != nil {
     57 		return err
     58 	}
     59 	if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteCidrCollection"); err != nil {
     60 		return fmt.Errorf("add protocol finalizers: %v", err)
     61 	}
     62 
     63 	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
     64 		return err
     65 	}
     66 	if err = addSetLoggerMiddleware(stack, options); err != nil {
     67 		return err
     68 	}
     69 	if err = addClientRequestID(stack); err != nil {
     70 		return err
     71 	}
     72 	if err = addComputeContentLength(stack); err != nil {
     73 		return err
     74 	}
     75 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
     76 		return err
     77 	}
     78 	if err = addComputePayloadSHA256(stack); err != nil {
     79 		return err
     80 	}
     81 	if err = addRetry(stack, options); err != nil {
     82 		return err
     83 	}
     84 	if err = addRawResponseToMetadata(stack); err != nil {
     85 		return err
     86 	}
     87 	if err = addRecordResponseTiming(stack); err != nil {
     88 		return err
     89 	}
     90 	if err = addClientUserAgent(stack, options); err != nil {
     91 		return err
     92 	}
     93 	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
     94 		return err
     95 	}
     96 	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
     97 		return err
     98 	}
     99 	if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
    100 		return err
    101 	}
    102 	if err = addOpDeleteCidrCollectionValidationMiddleware(stack); err != nil {
    103 		return err
    104 	}
    105 	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCidrCollection(options.Region), middleware.Before); err != nil {
    106 		return err
    107 	}
    108 	if err = addRecursionDetection(stack); err != nil {
    109 		return err
    110 	}
    111 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    112 		return err
    113 	}
    114 	if err = addResponseErrorMiddleware(stack); err != nil {
    115 		return err
    116 	}
    117 	if err = addRequestResponseLogging(stack, options); err != nil {
    118 		return err
    119 	}
    120 	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
    121 		return err
    122 	}
    123 	return nil
    124 }
    125 
    126 func newServiceMetadataMiddleware_opDeleteCidrCollection(region string) *awsmiddleware.RegisterServiceMetadata {
    127 	return &awsmiddleware.RegisterServiceMetadata{
    128 		Region:        region,
    129 		ServiceID:     ServiceID,
    130 		OperationName: "DeleteCidrCollection",
    131 	}
    132 }