api_op_GetSetupHistory.go raw

   1  // Code generated by smithy-go-codegen DO NOT EDIT.
   2  
   3  package lightsail
   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/lightsail/types"
  10  	"github.com/aws/smithy-go/middleware"
  11  	smithyhttp "github.com/aws/smithy-go/transport/http"
  12  )
  13  
  14  // Returns detailed information for five of the most recent SetupInstanceHttps
  15  // requests that were ran on the target instance.
  16  func (c *Client) GetSetupHistory(ctx context.Context, params *GetSetupHistoryInput, optFns ...func(*Options)) (*GetSetupHistoryOutput, error) {
  17  	if params == nil {
  18  		params = &GetSetupHistoryInput{}
  19  	}
  20  
  21  	result, metadata, err := c.invokeOperation(ctx, "GetSetupHistory", params, optFns, c.addOperationGetSetupHistoryMiddlewares)
  22  	if err != nil {
  23  		return nil, err
  24  	}
  25  
  26  	out := result.(*GetSetupHistoryOutput)
  27  	out.ResultMetadata = metadata
  28  	return out, nil
  29  }
  30  
  31  type GetSetupHistoryInput struct {
  32  
  33  	// The name of the resource for which you are requesting information.
  34  	//
  35  	// This member is required.
  36  	ResourceName *string
  37  
  38  	// The token to advance to the next page of results from your request.
  39  	//
  40  	// To get a page token, perform an initial GetSetupHistory request. If your
  41  	// results are paginated, the response will return a next page token that you can
  42  	// specify as the page token in a subsequent request.
  43  	PageToken *string
  44  
  45  	noSmithyDocumentSerde
  46  }
  47  
  48  type GetSetupHistoryOutput struct {
  49  
  50  	// The token to advance to the next page of results from your request.
  51  	//
  52  	// A next page token is not returned if there are no more results to display.
  53  	//
  54  	// To get the next page of results, perform another GetSetupHistory request and
  55  	// specify the next page token using the pageToken parameter.
  56  	NextPageToken *string
  57  
  58  	// The historical information that's returned.
  59  	SetupHistory []types.SetupHistory
  60  
  61  	// Metadata pertaining to the operation's result.
  62  	ResultMetadata middleware.Metadata
  63  
  64  	noSmithyDocumentSerde
  65  }
  66  
  67  func (c *Client) addOperationGetSetupHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) {
  68  	if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
  69  		return err
  70  	}
  71  	err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetSetupHistory{}, middleware.After)
  72  	if err != nil {
  73  		return err
  74  	}
  75  	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetSetupHistory{}, middleware.After)
  76  	if err != nil {
  77  		return err
  78  	}
  79  	if err := addProtocolFinalizerMiddlewares(stack, options, "GetSetupHistory"); err != nil {
  80  		return fmt.Errorf("add protocol finalizers: %v", err)
  81  	}
  82  
  83  	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
  84  		return err
  85  	}
  86  	if err = addSetLoggerMiddleware(stack, options); err != nil {
  87  		return err
  88  	}
  89  	if err = addClientRequestID(stack); err != nil {
  90  		return err
  91  	}
  92  	if err = addComputeContentLength(stack); err != nil {
  93  		return err
  94  	}
  95  	if err = addResolveEndpointMiddleware(stack, options); err != nil {
  96  		return err
  97  	}
  98  	if err = addComputePayloadSHA256(stack); err != nil {
  99  		return err
 100  	}
 101  	if err = addRetry(stack, options); err != nil {
 102  		return err
 103  	}
 104  	if err = addRawResponseToMetadata(stack); err != nil {
 105  		return err
 106  	}
 107  	if err = addRecordResponseTiming(stack); err != nil {
 108  		return err
 109  	}
 110  	if err = addSpanRetryLoop(stack, options); err != nil {
 111  		return err
 112  	}
 113  	if err = addClientUserAgent(stack, options); err != nil {
 114  		return err
 115  	}
 116  	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
 117  		return err
 118  	}
 119  	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
 120  		return err
 121  	}
 122  	if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
 123  		return err
 124  	}
 125  	if err = addTimeOffsetBuild(stack, c); err != nil {
 126  		return err
 127  	}
 128  	if err = addUserAgentRetryMode(stack, options); err != nil {
 129  		return err
 130  	}
 131  	if err = addCredentialSource(stack, options); err != nil {
 132  		return err
 133  	}
 134  	if err = addOpGetSetupHistoryValidationMiddleware(stack); err != nil {
 135  		return err
 136  	}
 137  	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSetupHistory(options.Region), middleware.Before); err != nil {
 138  		return err
 139  	}
 140  	if err = addRecursionDetection(stack); err != nil {
 141  		return err
 142  	}
 143  	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
 144  		return err
 145  	}
 146  	if err = addResponseErrorMiddleware(stack); err != nil {
 147  		return err
 148  	}
 149  	if err = addRequestResponseLogging(stack, options); err != nil {
 150  		return err
 151  	}
 152  	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
 153  		return err
 154  	}
 155  	if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
 156  		return err
 157  	}
 158  	if err = addInterceptAttempt(stack, options); err != nil {
 159  		return err
 160  	}
 161  	if err = addInterceptors(stack, options); err != nil {
 162  		return err
 163  	}
 164  	return nil
 165  }
 166  
 167  func newServiceMetadataMiddleware_opGetSetupHistory(region string) *awsmiddleware.RegisterServiceMetadata {
 168  	return &awsmiddleware.RegisterServiceMetadata{
 169  		Region:        region,
 170  		ServiceID:     ServiceID,
 171  		OperationName: "GetSetupHistory",
 172  	}
 173  }
 174