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

package lexmodelsv2

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

// Removes a custom vocabulary from the specified locale in the specified bot.
func (c *Client) DeleteCustomVocabulary(ctx context.Context, params *DeleteCustomVocabularyInput, optFns ...func(*Options)) (*DeleteCustomVocabularyOutput, error) {
	if params == nil {
		params = &DeleteCustomVocabularyInput{}
	}

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

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

type DeleteCustomVocabularyInput struct {

	// The unique identifier of the bot to remove the custom vocabulary from.
	//
	// This member is required.
	BotId *string

	// The version of the bot to remove the custom vocabulary from.
	//
	// This member is required.
	BotVersion *string

	// The locale identifier for the locale that contains the custom vocabulary to
	// remove.
	//
	// This member is required.
	LocaleId *string

	noSmithyDocumentSerde
}

type DeleteCustomVocabularyOutput struct {

	// The identifier of the bot that the custom vocabulary was removed from.
	BotId *string

	// The version of the bot that the custom vocabulary was removed from.
	BotVersion *string

	// The status of removing the custom vocabulary.
	CustomVocabularyStatus types.CustomVocabularyStatus

	// The locale identifier for the locale that the custom vocabulary was removed
	// from.
	LocaleId *string

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

	noSmithyDocumentSerde
}

func (c *Client) addOperationDeleteCustomVocabularyMiddlewares(stack *middleware.Stack, options Options) (err error) {
	err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCustomVocabulary{}, middleware.After)
	if err != nil {
		return err
	}
	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCustomVocabulary{}, middleware.After)
	if err != nil {
		return err
	}
	if err = addSetLoggerMiddleware(stack, options); err != nil {
		return err
	}
	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
		return err
	}
	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
		return err
	}
	if err = addResolveEndpointMiddleware(stack, options); err != nil {
		return err
	}
	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
		return err
	}
	if err = addRetryMiddlewares(stack, options); err != nil {
		return err
	}
	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
		return err
	}
	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
		return err
	}
	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
		return err
	}
	if err = addClientUserAgent(stack); err != nil {
		return err
	}
	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = addOpDeleteCustomVocabularyValidationMiddleware(stack); err != nil {
		return err
	}
	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCustomVocabulary(options.Region), 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
	}
	return nil
}

func newServiceMetadataMiddleware_opDeleteCustomVocabulary(region string) *awsmiddleware.RegisterServiceMetadata {
	return &awsmiddleware.RegisterServiceMetadata{
		Region:        region,
		ServiceID:     ServiceID,
		SigningName:   "lex",
		OperationName: "DeleteCustomVocabulary",
	}
}
