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

// Gets information about an advanced prompt optimization job.
func (c *Client) GetAdvancedPromptOptimizationJob(ctx context.Context, params *GetAdvancedPromptOptimizationJobInput, optFns ...func(*Options)) (*GetAdvancedPromptOptimizationJobOutput, error) {
	if params == nil {
		params = &GetAdvancedPromptOptimizationJobInput{}
	}

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

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

// Get Advanced Prompt Optimization Job Request
type GetAdvancedPromptOptimizationJobInput struct {

	// The ARN or ID of the advanced prompt optimization job.
	//
	// This member is required.
	JobIdentifier *string

	noSmithyDocumentSerde
}

// Get Advanced Prompt Optimization Job Response
type GetAdvancedPromptOptimizationJobOutput struct {

	// The time at which the advanced prompt optimization job was created.
	//
	// This member is required.
	CreationTime *time.Time

	// The input data configuration for the optimization job.
	//
	// This member is required.
	InputConfig *types.AdvancedPromptOptimizationInputConfig

	// The Amazon Resource Name (ARN) of the advanced prompt optimization job.
	//
	// This member is required.
	JobArn *string

	// The name of the advanced prompt optimization job.
	//
	// This member is required.
	JobName *string

	// The status of the advanced prompt optimization job.
	//
	// This member is required.
	JobStatus types.AdvancedPromptOptimizationJobStatus

	// The model configurations used in the optimization job.
	//
	// This member is required.
	ModelConfigurations []types.ModelConfiguration

	// The output data configuration for the optimization job.
	//
	// This member is required.
	OutputConfig *types.AdvancedPromptOptimizationOutputConfig

	// The Amazon Resource Name (ARN) of the KMS key used to encrypt the output data.
	EncryptionKeyArn *string

	// If the job failed, a message describing the reason for the failure.
	FailureMessage *string

	// The description of the advanced prompt optimization job.
	JobDescription *string

	// The time at which the advanced prompt optimization job was last modified.
	LastModifiedTime *time.Time

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

	noSmithyDocumentSerde
}

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