// 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 export in Amazon SageMaker Unified Studio.
func (c *Client) GetNotebookExport(ctx context.Context, params *GetNotebookExportInput, optFns ...func(*Options)) (*GetNotebookExportOutput, error) {
	if params == nil {
		params = &GetNotebookExportInput{}
	}

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

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

type GetNotebookExportInput struct {

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

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

	noSmithyDocumentSerde
}

type GetNotebookExportOutput struct {

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

	// The file format of the notebook export.
	//
	// This member is required.
	FileFormat types.FileFormat

	// The identifier of the notebook export.
	//
	// 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.
	//
	// This member is required.
	OwningProjectId *string

	// The status of the notebook export.
	//
	// This member is required.
	Status types.NotebookExportStatus

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

	// The timestamp of when the notebook export was started.
	CreatedAt *time.Time

	// The identifier of the user who started the notebook export.
	CreatedBy *string

	// The error details if the notebook export failed.
	Error *types.NotebookExportError

	// The output location of the exported notebook in Amazon Simple Storage Service.
	OutputLocation types.OutputLocation

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

	noSmithyDocumentSerde
}

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