api_op_DeleteHealthCheck.go (4691B)
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 health check. Amazon Route 53 does not prevent you from deleting a 14 // health check even if the health check is associated with one or more resource 15 // record sets. If you delete a health check and you don't update the associated 16 // resource record sets, the future status of the health check can't be predicted 17 // and may change. This will affect the routing of DNS queries for your DNS 18 // failover configuration. For more information, see Replacing and Deleting Health 19 // Checks (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/health-checks-creating-deleting.html#health-checks-deleting.html) 20 // in the Amazon Route 53 Developer Guide. If you're using Cloud Map and you 21 // configured Cloud Map to create a Route 53 health check when you register an 22 // instance, you can't use the Route 53 DeleteHealthCheck command to delete the 23 // health check. The health check is deleted automatically when you deregister the 24 // instance; there can be a delay of several hours before the health check is 25 // deleted from Route 53. 26 func (c *Client) DeleteHealthCheck(ctx context.Context, params *DeleteHealthCheckInput, optFns ...func(*Options)) (*DeleteHealthCheckOutput, error) { 27 if params == nil { 28 params = &DeleteHealthCheckInput{} 29 } 30 31 result, metadata, err := c.invokeOperation(ctx, "DeleteHealthCheck", params, optFns, c.addOperationDeleteHealthCheckMiddlewares) 32 if err != nil { 33 return nil, err 34 } 35 36 out := result.(*DeleteHealthCheckOutput) 37 out.ResultMetadata = metadata 38 return out, nil 39 } 40 41 // This action deletes a health check. 42 type DeleteHealthCheckInput struct { 43 44 // The ID of the health check that you want to delete. 45 // 46 // This member is required. 47 HealthCheckId *string 48 49 noSmithyDocumentSerde 50 } 51 52 // An empty element. 53 type DeleteHealthCheckOutput struct { 54 // Metadata pertaining to the operation's result. 55 ResultMetadata middleware.Metadata 56 57 noSmithyDocumentSerde 58 } 59 60 func (c *Client) addOperationDeleteHealthCheckMiddlewares(stack *middleware.Stack, options Options) (err error) { 61 if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { 62 return err 63 } 64 err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteHealthCheck{}, middleware.After) 65 if err != nil { 66 return err 67 } 68 err = stack.Deserialize.Add(&awsRestxml_deserializeOpDeleteHealthCheck{}, middleware.After) 69 if err != nil { 70 return err 71 } 72 if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteHealthCheck"); err != nil { 73 return fmt.Errorf("add protocol finalizers: %v", err) 74 } 75 76 if err = addlegacyEndpointContextSetter(stack, options); err != nil { 77 return err 78 } 79 if err = addSetLoggerMiddleware(stack, options); err != nil { 80 return err 81 } 82 if err = addClientRequestID(stack); err != nil { 83 return err 84 } 85 if err = addComputeContentLength(stack); err != nil { 86 return err 87 } 88 if err = addResolveEndpointMiddleware(stack, options); err != nil { 89 return err 90 } 91 if err = addComputePayloadSHA256(stack); err != nil { 92 return err 93 } 94 if err = addRetry(stack, options); err != nil { 95 return err 96 } 97 if err = addRawResponseToMetadata(stack); err != nil { 98 return err 99 } 100 if err = addRecordResponseTiming(stack); err != nil { 101 return err 102 } 103 if err = addClientUserAgent(stack, options); err != nil { 104 return err 105 } 106 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 107 return err 108 } 109 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 110 return err 111 } 112 if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { 113 return err 114 } 115 if err = addOpDeleteHealthCheckValidationMiddleware(stack); err != nil { 116 return err 117 } 118 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteHealthCheck(options.Region), middleware.Before); err != nil { 119 return err 120 } 121 if err = addRecursionDetection(stack); err != nil { 122 return err 123 } 124 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 125 return err 126 } 127 if err = addResponseErrorMiddleware(stack); err != nil { 128 return err 129 } 130 if err = addRequestResponseLogging(stack, options); err != nil { 131 return err 132 } 133 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 134 return err 135 } 136 return nil 137 } 138 139 func newServiceMetadataMiddleware_opDeleteHealthCheck(region string) *awsmiddleware.RegisterServiceMetadata { 140 return &awsmiddleware.RegisterServiceMetadata{ 141 Region: region, 142 ServiceID: ServiceID, 143 OperationName: "DeleteHealthCheck", 144 } 145 }