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

// Retrieves detailed information about a recommendation, including its
// configuration, status, and results.
func (c *Client) GetRecommendation(ctx context.Context, params *GetRecommendationInput, optFns ...func(*Options)) (*GetRecommendationOutput, error) {
	if params == nil {
		params = &GetRecommendationInput{}
	}

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

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

type GetRecommendationInput struct {

	// The unique identifier of the recommendation to retrieve.
	//
	// This member is required.
	RecommendationId *string

	noSmithyDocumentSerde
}

type GetRecommendationOutput struct {

	// The timestamp when the recommendation was created.
	//
	// This member is required.
	CreatedAt *time.Time

	// The name of the recommendation.
	//
	// This member is required.
	Name *string

	// The Amazon Resource Name (ARN) of the recommendation.
	//
	// This member is required.
	RecommendationArn *string

	// The configuration for the recommendation.
	//
	// This member is required.
	RecommendationConfig types.RecommendationConfig

	// The unique identifier of the recommendation.
	//
	// This member is required.
	RecommendationId *string

	// The current status of the recommendation.
	//
	// This member is required.
	Status types.RecommendationStatus

	// The type of recommendation.
	//
	// This member is required.
	Type types.RecommendationType

	// The timestamp when the recommendation was last updated.
	//
	// This member is required.
	UpdatedAt *time.Time

	// The description of the recommendation.
	Description *string

	// The ARN of the KMS key used to encrypt recommendation data.
	KmsKeyArn *string

	// The result of the recommendation, containing the optimized system prompt or
	// tool descriptions. Only present when the recommendation status is COMPLETED .
	RecommendationResult types.RecommendationResult

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

	noSmithyDocumentSerde
}

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