api_op_DeleteTrafficPolicyInstance.go (4235B)
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 traffic policy instance and all of the resource record sets that 14 // Amazon Route 53 created when you created the instance. In the Route 53 console, 15 // traffic policy instances are known as policy records. 16 func (c *Client) DeleteTrafficPolicyInstance(ctx context.Context, params *DeleteTrafficPolicyInstanceInput, optFns ...func(*Options)) (*DeleteTrafficPolicyInstanceOutput, error) { 17 if params == nil { 18 params = &DeleteTrafficPolicyInstanceInput{} 19 } 20 21 result, metadata, err := c.invokeOperation(ctx, "DeleteTrafficPolicyInstance", params, optFns, c.addOperationDeleteTrafficPolicyInstanceMiddlewares) 22 if err != nil { 23 return nil, err 24 } 25 26 out := result.(*DeleteTrafficPolicyInstanceOutput) 27 out.ResultMetadata = metadata 28 return out, nil 29 } 30 31 // A request to delete a specified traffic policy instance. 32 type DeleteTrafficPolicyInstanceInput struct { 33 34 // The ID of the traffic policy instance that you want to delete. When you delete 35 // a traffic policy instance, Amazon Route 53 also deletes all of the resource 36 // record sets that were created when you created the traffic policy instance. 37 // 38 // This member is required. 39 Id *string 40 41 noSmithyDocumentSerde 42 } 43 44 // An empty element. 45 type DeleteTrafficPolicyInstanceOutput struct { 46 // Metadata pertaining to the operation's result. 47 ResultMetadata middleware.Metadata 48 49 noSmithyDocumentSerde 50 } 51 52 func (c *Client) addOperationDeleteTrafficPolicyInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { 53 if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { 54 return err 55 } 56 err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteTrafficPolicyInstance{}, middleware.After) 57 if err != nil { 58 return err 59 } 60 err = stack.Deserialize.Add(&awsRestxml_deserializeOpDeleteTrafficPolicyInstance{}, middleware.After) 61 if err != nil { 62 return err 63 } 64 if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTrafficPolicyInstance"); err != nil { 65 return fmt.Errorf("add protocol finalizers: %v", err) 66 } 67 68 if err = addlegacyEndpointContextSetter(stack, options); err != nil { 69 return err 70 } 71 if err = addSetLoggerMiddleware(stack, options); err != nil { 72 return err 73 } 74 if err = addClientRequestID(stack); err != nil { 75 return err 76 } 77 if err = addComputeContentLength(stack); err != nil { 78 return err 79 } 80 if err = addResolveEndpointMiddleware(stack, options); err != nil { 81 return err 82 } 83 if err = addComputePayloadSHA256(stack); err != nil { 84 return err 85 } 86 if err = addRetry(stack, options); err != nil { 87 return err 88 } 89 if err = addRawResponseToMetadata(stack); err != nil { 90 return err 91 } 92 if err = addRecordResponseTiming(stack); err != nil { 93 return err 94 } 95 if err = addClientUserAgent(stack, options); err != nil { 96 return err 97 } 98 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 99 return err 100 } 101 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 102 return err 103 } 104 if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { 105 return err 106 } 107 if err = addOpDeleteTrafficPolicyInstanceValidationMiddleware(stack); err != nil { 108 return err 109 } 110 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTrafficPolicyInstance(options.Region), middleware.Before); err != nil { 111 return err 112 } 113 if err = addRecursionDetection(stack); err != nil { 114 return err 115 } 116 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 117 return err 118 } 119 if err = addResponseErrorMiddleware(stack); err != nil { 120 return err 121 } 122 if err = addRequestResponseLogging(stack, options); err != nil { 123 return err 124 } 125 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 126 return err 127 } 128 return nil 129 } 130 131 func newServiceMetadataMiddleware_opDeleteTrafficPolicyInstance(region string) *awsmiddleware.RegisterServiceMetadata { 132 return &awsmiddleware.RegisterServiceMetadata{ 133 Region: region, 134 ServiceID: ServiceID, 135 OperationName: "DeleteTrafficPolicyInstance", 136 } 137 }