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

package bedrockagentcorecontrol

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

// Retrieves information about a specific registry record.
func (c *Client) GetRegistryRecord(ctx context.Context, params *GetRegistryRecordInput, optFns ...func(*Options)) (*GetRegistryRecordOutput, error) {
	if params == nil {
		params = &GetRegistryRecordInput{}
	}

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

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

type GetRegistryRecordInput struct {

	// The identifier of the registry record to retrieve. You can specify either the
	// Amazon Resource Name (ARN) or the ID of the record.
	//
	// This member is required.
	RecordId *string

	// The identifier of the registry containing the record. You can specify either
	// the Amazon Resource Name (ARN) or the ID of the registry.
	//
	// This member is required.
	RegistryId *string

	noSmithyDocumentSerde
}

type GetRegistryRecordOutput struct {

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

	// The descriptor type of the registry record. Possible values are MCP , A2A ,
	// CUSTOM , and AGENT_SKILLS .
	//
	// This member is required.
	DescriptorType types.DescriptorType

	// The descriptor-type-specific configuration containing the resource schema and
	// metadata. For details, see the Descriptors data type.
	//
	// This member is required.
	Descriptors *types.Descriptors

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

	// The Amazon Resource Name (ARN) of the registry record.
	//
	// This member is required.
	RecordArn *string

	// The unique identifier of the registry record.
	//
	// This member is required.
	RecordId *string

	// The Amazon Resource Name (ARN) of the registry that contains the record.
	//
	// This member is required.
	RegistryArn *string

	// The current status of the registry record. Possible values include CREATING ,
	// DRAFT , APPROVED , PENDING_APPROVAL , REJECTED , DEPRECATED , UPDATING ,
	// CREATE_FAILED , and UPDATE_FAILED . A record transitions from CREATING to DRAFT
	// , then to PENDING_APPROVAL (via SubmitRegistryRecordForApproval ), and finally
	// to APPROVED upon approval.
	//
	// This member is required.
	Status types.RegistryRecordStatus

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

	// The description of the registry record.
	Description *string

	// The version of the registry record.
	RecordVersion *string

	// The reason for the current status, typically set when the status is a failure
	// state.
	StatusReason *string

	// The configuration for synchronizing registry record metadata from an external
	// source.
	SynchronizationConfiguration *types.SynchronizationConfiguration

	// The type of synchronization used for this record.
	SynchronizationType types.SynchronizationType

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

	noSmithyDocumentSerde
}

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