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

// Revokes an external account binding, preventing new ACME accounts from being
// registered using this binding. Existing ACME accounts that were previously
// registered using the binding are not affected and must be revoked separately.
func (c *Client) RevokeAcmeExternalAccountBinding(ctx context.Context, params *RevokeAcmeExternalAccountBindingInput, optFns ...func(*Options)) (*RevokeAcmeExternalAccountBindingOutput, error) {
	if params == nil {
		params = &RevokeAcmeExternalAccountBindingInput{}
	}

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

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

type RevokeAcmeExternalAccountBindingInput struct {

	// The Amazon Resource Name (ARN) of the ACME external account binding to revoke.
	//
	// This member is required.
	AcmeExternalAccountBindingArn *string

	noSmithyDocumentSerde
}

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

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

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

	noSmithyDocumentSerde
}

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