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

package datazone

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

// Gets the details of a [notebook run] in Amazon SageMaker Unified Studio.
//
// [notebook run]: https://docs.aws.amazon.com/sagemaker-unified-studio/latest/userguide/notebooks.html
func (c *Client) GetNotebookRun(ctx context.Context, params *GetNotebookRunInput, optFns ...func(*Options)) (*GetNotebookRunOutput, error) {
	if params == nil {
		params = &GetNotebookRunInput{}
	}

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

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

type GetNotebookRunInput struct {

	// The identifier of the Amazon SageMaker Unified Studio domain in which the
	// notebook run exists.
	//
	// This member is required.
	DomainIdentifier *string

	// The identifier of the notebook run.
	//
	// This member is required.
	Identifier *string

	noSmithyDocumentSerde
}

type GetNotebookRunOutput struct {

	// The identifier of the Amazon SageMaker Unified Studio domain.
	//
	// This member is required.
	DomainId *string

	// The identifier of the notebook run.
	//
	// This member is required.
	Id *string

	// The identifier of the notebook.
	//
	// This member is required.
	NotebookId *string

	// The identifier of the project that owns the notebook run.
	//
	// This member is required.
	OwningProjectId *string

	// The status of the notebook run.
	//
	// This member is required.
	Status types.NotebookRunStatus

	// The ordered list of cells in the notebook run.
	CellOrder []types.CellInformation

	// The timestamp of when the notebook run completed.
	CompletedAt *time.Time

	// The compute configuration of the notebook run.
	ComputeConfiguration *types.ComputeConfig

	// The timestamp of when the notebook run was created.
	CreatedAt *time.Time

	// The identifier of the user who created the notebook run.
	CreatedBy *string

	// The environment configuration of the notebook run, including image version and
	// package settings.
	EnvironmentConfiguration *types.EnvironmentConfig

	// The error details if the notebook run failed.
	Error *types.NotebookRunError

	// The metadata of the notebook run.
	Metadata map[string]string

	// The network configuration of the notebook run.
	NetworkConfiguration *types.NetworkConfig

	// The sensitive parameters of the notebook run.
	Parameters map[string]string

	// The identifier of the schedule associated with the notebook run.
	ScheduleId *string

	// The timestamp of when the notebook run started executing.
	StartedAt *time.Time

	// The storage configuration of the notebook run, including the Amazon Simple
	// Storage Service path and KMS key ARN.
	StorageConfiguration *types.StorageConfig

	// The timeout configuration of the notebook run.
	TimeoutConfiguration *types.TimeoutConfig

	// The source that triggered the notebook run.
	TriggerSource *types.TriggerSource

	// The timestamp of when the notebook run was last updated.
	UpdatedAt *time.Time

	// The identifier of the user who last updated the notebook run.
	UpdatedBy *string

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

	noSmithyDocumentSerde
}

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