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

package bedrockagentcore

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

// Stops a running batch evaluation. Sessions that have already been evaluated
// retain their results.
func (c *Client) StopBatchEvaluation(ctx context.Context, params *StopBatchEvaluationInput, optFns ...func(*Options)) (*StopBatchEvaluationOutput, error) {
	if params == nil {
		params = &StopBatchEvaluationInput{}
	}

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

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

type StopBatchEvaluationInput struct {

	// The unique identifier of the batch evaluation to stop.
	//
	// This member is required.
	BatchEvaluationId *string

	noSmithyDocumentSerde
}

type StopBatchEvaluationOutput struct {

	// The Amazon Resource Name (ARN) of the stopped batch evaluation.
	//
	// This member is required.
	BatchEvaluationArn *string

	// The unique identifier of the stopped batch evaluation.
	//
	// This member is required.
	BatchEvaluationId *string

	// The status of the batch evaluation after the stop request.
	//
	// This member is required.
	Status types.BatchEvaluationStatus

	// The description of the batch evaluation.
	Description *string

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

	noSmithyDocumentSerde
}

func (c *Client) addOperationStopBatchEvaluationMiddlewares(stack *middleware.Stack, options Options) (err error) {
	err = stack.Serialize.Add(&awsRestjson1_serializeOpStopBatchEvaluation{}, middleware.After)
	if err != nil {
		return err
	}
	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStopBatchEvaluation{}, 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); 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 = addOpStopBatchEvaluationValidationMiddleware(stack); err != nil {
		return err
	}
	if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "StopBatchEvaluation"), 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
}
