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

// Get the properties associated with a Amazon Bedrock custom model that you have
// created. For more information, see [Custom models]in the [Amazon Bedrock User Guide].
//
// [Custom models]: https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html
// [Amazon Bedrock User Guide]: https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html
func (c *Client) GetCustomModel(ctx context.Context, params *GetCustomModelInput, optFns ...func(*Options)) (*GetCustomModelOutput, error) {
	if params == nil {
		params = &GetCustomModelInput{}
	}

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

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

type GetCustomModelInput struct {

	// Name or Amazon Resource Name (ARN) of the custom model.
	//
	// This member is required.
	ModelIdentifier *string

	noSmithyDocumentSerde
}

type GetCustomModelOutput struct {

	// Creation time of the model.
	//
	// This member is required.
	CreationTime *time.Time

	// Amazon Resource Name (ARN) associated with this model.
	//
	// This member is required.
	ModelArn *string

	// Model name associated with this model.
	//
	// This member is required.
	ModelName *string

	// Amazon Resource Name (ARN) of the base model.
	BaseModelArn *string

	// The customization configuration for the custom model.
	CustomizationConfig types.CustomizationConfig

	// The type of model customization.
	CustomizationType types.CustomizationType

	// A failure message for any issues that occurred when creating the custom model.
	// This is included for only a failed CreateCustomModel operation.
	FailureMessage *string

	// Hyperparameter values associated with this model. For details on the format for
	// different models, see [Custom model hyperparameters].
	//
	// [Custom model hyperparameters]: https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models-hp.html
	HyperParameters map[string]string

	// Job Amazon Resource Name (ARN) associated with this model. For models that you
	// create with the [CreateCustomModel]API operation, this is NULL .
	//
	// [CreateCustomModel]: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateCustomModel.html
	JobArn *string

	// Job name associated with this model.
	JobName *string

	// The custom model is encrypted at rest using this key.
	ModelKmsKeyArn *string

	// The current status of the custom model. Possible values include:
	//
	//   - Creating - The model is being created and validated.
	//
	//   - Active - The model has been successfully created and is ready for use.
	//
	//   - Failed - The model creation process failed. Check the failureMessage field
	//   for details.
	ModelStatus types.ModelStatus

	// Output data configuration associated with this custom model.
	OutputDataConfig *types.OutputDataConfig

	// Contains information about the training dataset.
	TrainingDataConfig *types.TrainingDataConfig

	// Contains training metrics from the job creation.
	TrainingMetrics *types.TrainingMetrics

	// Contains information about the validation dataset.
	ValidationDataConfig *types.ValidationDataConfig

	// The validation metrics from the job creation.
	ValidationMetrics []types.ValidatorMetric

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

	noSmithyDocumentSerde
}

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