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

package bedrock

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

// Deletes one or more advanced prompt optimization jobs.
func (c *Client) BatchDeleteAdvancedPromptOptimizationJob(ctx context.Context, params *BatchDeleteAdvancedPromptOptimizationJobInput, optFns ...func(*Options)) (*BatchDeleteAdvancedPromptOptimizationJobOutput, error) {
	if params == nil {
		params = &BatchDeleteAdvancedPromptOptimizationJobInput{}
	}

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

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

// Batch Delete Advanced Prompt Optimization Jobs Request
type BatchDeleteAdvancedPromptOptimizationJobInput struct {

	// A list of advanced prompt optimization job identifiers (ARNs or IDs) to delete.
	//
	// This member is required.
	JobIdentifiers []string

	noSmithyDocumentSerde
}

// Batch Delete Advanced Prompt Optimization Jobs Response
type BatchDeleteAdvancedPromptOptimizationJobOutput struct {

	// A list of successfully deleted advanced prompt optimization jobs.
	//
	// This member is required.
	AdvancedPromptOptimizationJobs []types.BatchDeleteAdvancedPromptOptimizationJobItem

	// A list of errors encountered during batch deletion.
	//
	// This member is required.
	Errors []types.BatchDeleteAdvancedPromptOptimizationJobError

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

	noSmithyDocumentSerde
}

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