// 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 the associations for one or more application status checks. For more
// information, see [Application status checks]. To avoid timeouts and retrieve complete results, use the
// pagination parameters.
//
// The order of the elements in the response, including those within nested
// structures, might vary.
//
// [Application status checks]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-application-status-checks.html
func (c *Client) DescribeApplicationStatusCheckAssociations(ctx context.Context, params *DescribeApplicationStatusCheckAssociationsInput, optFns ...func(*Options)) (*DescribeApplicationStatusCheckAssociationsOutput, error) {
	if params == nil {
		params = &DescribeApplicationStatusCheckAssociationsInput{}
	}

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

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

type DescribeApplicationStatusCheckAssociationsInput struct {

	// The IDs of the application status checks for which to describe associations.
	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 to use to limit the results.
	//
	//   - association-type – The type of association. Valid values: tag and
	//   instance-id .
	Filters []types.Filter

	// 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 DescribeApplicationStatusCheckAssociationsOutput struct {

	// The associations for the specified application status checks.
	Associations []types.ApplicationStatusCheckAssociationObject

	// 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

	// The tags associated with the application status checks.
	Tags []types.Tag

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

	noSmithyDocumentSerde
}

func (c *Client) addOperationDescribeApplicationStatusCheckAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
	err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeApplicationStatusCheckAssociations{}, middleware.After)
	if err != nil {
		return err
	}
	err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeApplicationStatusCheckAssociations{}, 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
}
