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

package outposts

import (
	"context"
	"github.com/aws/aws-sdk-go-v2/service/outposts/types"
	"github.com/aws/smithy-go/middleware"
	smithyhttp "github.com/aws/smithy-go/transport/http"
)

// Creates a quote for an Outpost. A quote provides pricing and configuration
// options based on the requested capacity. You can optionally associate the quote
// with an existing Outpost or create a standalone quote by specifying only the
// country code and requested capacities.
func (c *Client) CreateQuote(ctx context.Context, params *CreateQuoteInput, optFns ...func(*Options)) (*CreateQuoteOutput, error) {
	if params == nil {
		params = &CreateQuoteInput{}
	}

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

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

type CreateQuoteInput struct {

	// The country code for the Outpost site location.
	//
	// This member is required.
	CountryCode *string

	// The capacity requirements for the quote. Each entry specifies a capacity type
	// (such as Amazon EC2), the unit, and the quantity. For Amazon EC2, the quantity
	// is the number of additional instances to add to the Outpost. For Amazon EBS and
	// Amazon S3, the quantity is the total desired end-state capacity of the Outpost.
	//
	// This member is required.
	RequestedCapacities []types.QuoteCapacity

	// A description for the quote.
	Description *string

	// The ID or ARN of the Outpost to associate with the quote. If not specified, the
	// quote is created without an Outpost association.
	OutpostIdentifier *string

	// The physical constraints for the quote, such as maximum number of racks,
	// maximum power draw per rack, or maximum weight per rack.
	RequestedConstraints []types.QuoteConstraint

	// The payment options to include in the quote pricing. If not specified, all
	// available payment options are returned.
	RequestedPaymentOptions []types.PaymentOption

	// The payment terms to include in the quote pricing. If not specified, all
	// available payment terms are returned.
	RequestedPaymentTerms []types.PaymentTerm

	noSmithyDocumentSerde
}

type CreateQuoteOutput struct {

	// Information about the quote.
	Quote *types.Quote

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

	noSmithyDocumentSerde
}

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

	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
		return err
	}
	if err = addComputeContentLength(stack); 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 = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = addCredentialSource(stack, options); err != nil {
		return err
	}
	if err = addOpCreateQuoteValidationMiddleware(stack); err != nil {
		return err
	}
	if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "CreateQuote"), middleware.Before); 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
}
