// Code generated by smithy-go-codegen DO NOT EDIT.

package ec2

import (
	"context"
	"github.com/aws/aws-sdk-go-v2/service/ec2/types"
	"github.com/aws/smithy-go/middleware"
)

// Describes application status checks, including configuration details such as
// protocol, port, path, thresholds, and associations. Results are paginated. Use
// the NextToken parameter to retrieve additional results. The following rules
// apply:
//
//   - If you do not specify any application status check IDs, all checks in your
//     account are returned.
//
//   - Use DescribeApplicationStatus to see the actual health status of instances.
func (c *Client) DescribeApplicationStatusChecks(ctx context.Context, params *DescribeApplicationStatusChecksInput, optFns ...func(*Options)) (*DescribeApplicationStatusChecksOutput, error) {
	if params == nil {
		params = &DescribeApplicationStatusChecksInput{}
	}

	result, metadata, err := c.invokeOperation(ctx, "DescribeApplicationStatusChecks", params, optFns, c.addOperationDescribeApplicationStatusChecksMiddlewares)
	if err != nil {
		return nil, err
	}

	out := result.(*DescribeApplicationStatusChecksOutput)
	out.ResultMetadata = metadata
	return out, nil
}

type DescribeApplicationStatusChecksInput struct {

	// The IDs of the application status checks to describe.
	ApplicationStatusCheckIds []string

	// Checks whether you have the required permissions for the operation, without
	// actually making the request, and provides an error response. If you have the
	// required permissions, the error response is DryRunOperation . Otherwise, it is
	// UnauthorizedOperation .
	DryRun *bool

	// The filters.
	//
	//   - aggregation – The aggregation setting. Valid values: included and excluded .
	Filters []types.Filter

	// Specifies whether to include recently deleted application status checks that
	// remain available during the deletion grace period. If you omit this parameter or
	// set it to false , the response includes only active checks.
	IncludeAll *bool

	// The maximum number of items to return for this request. To get the next page of
	// items, make another request with the token returned in the output. For more
	// information, see [Pagination].
	//
	// [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination
	MaxResults *int32

	// The token returned from a previous paginated request. Pagination continues from
	// the end of the items returned by the previous request.
	NextToken *string

	noSmithyDocumentSerde
}

type DescribeApplicationStatusChecksOutput struct {

	// Information about the application status checks.
	ApplicationStatusChecks []types.ApplicationStatusCheckResponseObject

	// The token to include in another request to get the next page of items. This
	// value is null when there are no more items to return.
	NextToken *string

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata

	noSmithyDocumentSerde
}

func (c *Client) addOperationDescribeApplicationStatusChecksMiddlewares(stack *middleware.Stack, options Options) (err error) {
	err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeApplicationStatusChecks{}, middleware.After)
	if err != nil {
		return err
	}
	err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeApplicationStatusChecks{}, middleware.After)
	if err != nil {
		return err
	}

	if err = addResolveEndpointMiddleware(stack, options); err != nil {
		return err
	}
	if err = addComputePayloadSHA256(stack); err != nil {
		return err
	}
	if err = addRecordResponseTiming(stack, options); err != nil {
		return err
	}
	if err = addCredentialSource(stack, options); err != nil {
		return err
	}
	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
		return err
	}
	if err = addResponseErrorMiddleware(stack); err != nil {
		return err
	}
	if err = addRequestResponseLogging(stack, options); err != nil {
		return err
	}
	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
		return err
	}
	if err = addInterceptors(stack, options); err != nil {
		return err
	}
	return nil
}
