src

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

api_op_GetHealthCheckLastFailureReason.go (4717B)


      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 the reason that a specified health check failed most recently.
     15 func (c *Client) GetHealthCheckLastFailureReason(ctx context.Context, params *GetHealthCheckLastFailureReasonInput, optFns ...func(*Options)) (*GetHealthCheckLastFailureReasonOutput, error) {
     16 	if params == nil {
     17 		params = &GetHealthCheckLastFailureReasonInput{}
     18 	}
     19 
     20 	result, metadata, err := c.invokeOperation(ctx, "GetHealthCheckLastFailureReason", params, optFns, c.addOperationGetHealthCheckLastFailureReasonMiddlewares)
     21 	if err != nil {
     22 		return nil, err
     23 	}
     24 
     25 	out := result.(*GetHealthCheckLastFailureReasonOutput)
     26 	out.ResultMetadata = metadata
     27 	return out, nil
     28 }
     29 
     30 // A request for the reason that a health check failed most recently.
     31 type GetHealthCheckLastFailureReasonInput struct {
     32 
     33 	// The ID for the health check for which you want the last failure reason. When
     34 	// you created the health check, CreateHealthCheck returned the ID in the
     35 	// response, in the HealthCheckId element. If you want to get the last failure
     36 	// reason for a calculated health check, you must use the Amazon Route 53 console
     37 	// or the CloudWatch console. You can't use GetHealthCheckLastFailureReason for a
     38 	// calculated health check.
     39 	//
     40 	// This member is required.
     41 	HealthCheckId *string
     42 
     43 	noSmithyDocumentSerde
     44 }
     45 
     46 // A complex type that contains the response to a GetHealthCheckLastFailureReason
     47 // request.
     48 type GetHealthCheckLastFailureReasonOutput struct {
     49 
     50 	// A list that contains one Observation element for each Amazon Route 53 health
     51 	// checker that is reporting a last failure reason.
     52 	//
     53 	// This member is required.
     54 	HealthCheckObservations []types.HealthCheckObservation
     55 
     56 	// Metadata pertaining to the operation's result.
     57 	ResultMetadata middleware.Metadata
     58 
     59 	noSmithyDocumentSerde
     60 }
     61 
     62 func (c *Client) addOperationGetHealthCheckLastFailureReasonMiddlewares(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_serializeOpGetHealthCheckLastFailureReason{}, middleware.After)
     67 	if err != nil {
     68 		return err
     69 	}
     70 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetHealthCheckLastFailureReason{}, middleware.After)
     71 	if err != nil {
     72 		return err
     73 	}
     74 	if err := addProtocolFinalizerMiddlewares(stack, options, "GetHealthCheckLastFailureReason"); 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 = addOpGetHealthCheckLastFailureReasonValidationMiddleware(stack); err != nil {
    118 		return err
    119 	}
    120 	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetHealthCheckLastFailureReason(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_opGetHealthCheckLastFailureReason(region string) *awsmiddleware.RegisterServiceMetadata {
    142 	return &awsmiddleware.RegisterServiceMetadata{
    143 		Region:        region,
    144 		ServiceID:     ServiceID,
    145 		OperationName: "GetHealthCheckLastFailureReason",
    146 	}
    147 }