api_op_GetHealthCheck.go (4175B)
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 // Gets information about a specified health check. 15 func (c *Client) GetHealthCheck(ctx context.Context, params *GetHealthCheckInput, optFns ...func(*Options)) (*GetHealthCheckOutput, error) { 16 if params == nil { 17 params = &GetHealthCheckInput{} 18 } 19 20 result, metadata, err := c.invokeOperation(ctx, "GetHealthCheck", params, optFns, c.addOperationGetHealthCheckMiddlewares) 21 if err != nil { 22 return nil, err 23 } 24 25 out := result.(*GetHealthCheckOutput) 26 out.ResultMetadata = metadata 27 return out, nil 28 } 29 30 // A request to get information about a specified health check. 31 type GetHealthCheckInput struct { 32 33 // The identifier that Amazon Route 53 assigned to the health check when you 34 // created it. When you add or update a resource record set, you use this value to 35 // specify which health check to use. The value can be up to 64 characters long. 36 // 37 // This member is required. 38 HealthCheckId *string 39 40 noSmithyDocumentSerde 41 } 42 43 // A complex type that contains the response to a GetHealthCheck request. 44 type GetHealthCheckOutput struct { 45 46 // A complex type that contains information about one health check that is 47 // associated with the current Amazon Web Services account. 48 // 49 // This member is required. 50 HealthCheck *types.HealthCheck 51 52 // Metadata pertaining to the operation's result. 53 ResultMetadata middleware.Metadata 54 55 noSmithyDocumentSerde 56 } 57 58 func (c *Client) addOperationGetHealthCheckMiddlewares(stack *middleware.Stack, options Options) (err error) { 59 if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { 60 return err 61 } 62 err = stack.Serialize.Add(&awsRestxml_serializeOpGetHealthCheck{}, middleware.After) 63 if err != nil { 64 return err 65 } 66 err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetHealthCheck{}, middleware.After) 67 if err != nil { 68 return err 69 } 70 if err := addProtocolFinalizerMiddlewares(stack, options, "GetHealthCheck"); err != nil { 71 return fmt.Errorf("add protocol finalizers: %v", err) 72 } 73 74 if err = addlegacyEndpointContextSetter(stack, options); err != nil { 75 return err 76 } 77 if err = addSetLoggerMiddleware(stack, options); err != nil { 78 return err 79 } 80 if err = addClientRequestID(stack); err != nil { 81 return err 82 } 83 if err = addComputeContentLength(stack); err != nil { 84 return err 85 } 86 if err = addResolveEndpointMiddleware(stack, options); err != nil { 87 return err 88 } 89 if err = addComputePayloadSHA256(stack); err != nil { 90 return err 91 } 92 if err = addRetry(stack, options); err != nil { 93 return err 94 } 95 if err = addRawResponseToMetadata(stack); err != nil { 96 return err 97 } 98 if err = addRecordResponseTiming(stack); err != nil { 99 return err 100 } 101 if err = addClientUserAgent(stack, options); err != nil { 102 return err 103 } 104 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 105 return err 106 } 107 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 108 return err 109 } 110 if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { 111 return err 112 } 113 if err = addOpGetHealthCheckValidationMiddleware(stack); err != nil { 114 return err 115 } 116 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetHealthCheck(options.Region), middleware.Before); err != nil { 117 return err 118 } 119 if err = addRecursionDetection(stack); err != nil { 120 return err 121 } 122 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 123 return err 124 } 125 if err = addResponseErrorMiddleware(stack); err != nil { 126 return err 127 } 128 if err = addRequestResponseLogging(stack, options); err != nil { 129 return err 130 } 131 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 132 return err 133 } 134 return nil 135 } 136 137 func newServiceMetadataMiddleware_opGetHealthCheck(region string) *awsmiddleware.RegisterServiceMetadata { 138 return &awsmiddleware.RegisterServiceMetadata{ 139 Region: region, 140 ServiceID: ServiceID, 141 OperationName: "GetHealthCheck", 142 } 143 }