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

package acm

import (
	"context"
	"github.com/aws/smithy-go/middleware"
	"github.com/aws/smithy-go/ptr"
)

// Deletes a domain validation. After deletion, the ACME endpoint can no longer
// issue certificates for the associated domain.
func (c *Client) DeleteAcmeDomainValidation(ctx context.Context, params *DeleteAcmeDomainValidationInput, optFns ...func(*Options)) (*DeleteAcmeDomainValidationOutput, error) {
	if params == nil {
		params = &DeleteAcmeDomainValidationInput{}
	}

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

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

type DeleteAcmeDomainValidationInput struct {

	// The Amazon Resource Name (ARN) of the ACME domain validation to delete.
	//
	// This member is required.
	AcmeDomainValidationArn *string

	noSmithyDocumentSerde
}

func (in *DeleteAcmeDomainValidationInput) bindEndpointParams(p *EndpointParameters) {

	p.ServiceType = ptr.String("ACM-ACME")
}

type DeleteAcmeDomainValidationOutput struct {
	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata

	noSmithyDocumentSerde
}

func (c *Client) addOperationDeleteAcmeDomainValidationMiddlewares(stack *middleware.Stack, options Options) (err error) {
	err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAcmeDomainValidation{}, middleware.After)
	if err != nil {
		return err
	}
	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteAcmeDomainValidation{}, middleware.After)
	if 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 = addCredentialSource(stack, options); err != nil {
		return err
	}
	if err = addOpDeleteAcmeDomainValidationValidationMiddleware(stack); 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
}
