models

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package models provides the data models used by the Apicurio Registry client.

The models package contains Go structs that represent the data structures used by the Apicurio Registry client. These structs are used to serialize and deserialize data when interacting with the Apicurio Registry API.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownArtifactType = fmt.Errorf("unknown artifact type")
)

Functions

func CustomValidationFunctions

func CustomValidationFunctions(validate *validator.Validate) error

CustomValidationFunctions registers custom validation functions with the validator.

Types

type APIError

type APIError struct {
	Detail   string `json:"detail"`   // A human-readable explanation specific to the problem
	Type     string `json:"type"`     // A URI reference identifying the problem type
	Title    string `json:"title"`    // A short, human-readable summary of the problem type
	Status   int    `json:"status"`   // The HTTP status code
	Instance string `json:"instance"` // A URI reference identifying the specific occurrence
	Name     string `json:"name"`     // The name of the error (e.g., server exception class name)
}

APIError represents the structure of an error response from the API.

func (*APIError) Error

func (e *APIError) Error() string

Error satisfies the error interface and formats the APIError as a string.

type ArtifactComment

type ArtifactComment struct {
	CommentID string `json:"commentId"` // Unique identifier for the comment.
	Value     string `json:"value"`     // The content of the comment.
	Owner     string `json:"owner"`     // The user who created the comment.
	CreatedOn string `json:"createdOn"` // The timestamp when the comment was created.
}

ArtifactComment represents a comment on a specific artifact version. It's used in the response of GetArtifactVersionComments

type ArtifactContent

type ArtifactContent struct {
	Content      string       `json:"content"`
	ArtifactType ArtifactType `json:"artifactType"`
}

ArtifactContent represents the content of an artifact + the type of the artifact.

type ArtifactDetail

type ArtifactDetail struct {
	GroupID     string            `json:"groupId"`
	ArtifactID  string            `json:"artifactId"`
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Version     string            `json:"version"`
	CreatedOn   string            `json:"createdOn"`
	ModifiedOn  string            `json:"modifiedOn"`
	ContentID   int64             `json:"contentId"`
	Labels      map[string]string `json:"labels"`
}

ArtifactDetail represents the detailed information about an artifact.

type ArtifactMetadata

type ArtifactMetadata struct {
	BaseMetadata
	ModifiedBy string `json:"modifiedBy"`
	ModifiedOn string `json:"modifiedOn"`
}

ArtifactMetadata represents metadata for an artifact.

type ArtifactReference

type ArtifactReference struct {
	GroupID    string `json:"groupId"`
	ArtifactID string `json:"artifactId"`
	Version    string `json:"version"`
	Name       string `json:"name"`
}

ArtifactReference represents a reference to an artifact.

type ArtifactReferenceParams

type ArtifactReferenceParams struct {
	HandleReferencesType HandleReferencesType `validate:"omitempty,oneof=PRESERVE DEREFERENCE REWRITE"`
}

ArtifactReferenceParams represents the query parameters for artifact references.

func (*ArtifactReferenceParams) ToQuery

func (p *ArtifactReferenceParams) ToQuery() url.Values

ToQuery converts the ArtifactReferenceParams into URL query parameters.

func (*ArtifactReferenceParams) Validate

func (p *ArtifactReferenceParams) Validate() error

Validate validates the ArtifactReferenceParams struct.

type ArtifactSortBy

type ArtifactSortBy string
const (
	ArtifactSortByName       ArtifactSortBy = "name"
	ArtifactSortByType       ArtifactSortBy = "artifactType"
	ArtifactSortByCreatedOn  ArtifactSortBy = "createdOn"
	ArtifactSortByModifiedOn ArtifactSortBy = "modifiedOn"
	ArtifactSortByGroupID    ArtifactSortBy = "groupId"
	ArtifactSortByArtifactID ArtifactSortBy = "artifactId"
)

type ArtifactType

type ArtifactType string

ArtifactType represents the type of artifact.

const (
	Avro     ArtifactType = "AVRO"     // Avro artifact type
	Protobuf ArtifactType = "PROTOBUF" // Protobuf artifact type
	Json     ArtifactType = "JSON"     // JSON artifact type
	KConnect ArtifactType = "KCONNECT" // Kafka Connect artifact type
	OpenAPI  ArtifactType = "OPENAPI"  // OpenAPI artifact type
	AsyncAPI ArtifactType = "ASYNCAPI" // AsyncAPI artifact type
	GraphQL  ArtifactType = "GRAPHQL"  // GraphQL artifact type
	WSDL     ArtifactType = "WSDL"     // WSDL artifact type
	XSD      ArtifactType = "XSD"      // XSD artifact type
	XML      ArtifactType = "XML"      // XSD artifact type
)

func ParseArtifactType

func ParseArtifactType(artifactType string) (ArtifactType, error)

ParseArtifactType parses a string and returns the corresponding ArtifactType.

func (ArtifactType) MarshalJSON

func (a ArtifactType) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*ArtifactType) UnmarshalJSON

func (a *ArtifactType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type ArtifactTypeResponse

type ArtifactTypeResponse struct {
	Name ArtifactType `json:"name"`
}

ArtifactTypeResponse represents the response from the get artifact type API.

type ArtifactVersion

type ArtifactVersion struct {
	Version      string       `json:"version" validate:"required"`                                                  // A single version of the artifact
	Owner        string       `json:"owner" validate:"required"`                                                    // Owner of the artifact version
	CreatedOn    string       `json:"createdOn" validate:"required"`                                                // Creation timestamp
	ArtifactType ArtifactType `json:"artifactType" validate:"required"`                                             // Type of the artifact
	GlobalID     int64        `json:"globalId" validate:"required"`                                                 // Global identifier for the artifact version
	State        State        `json:"state,omitempty" validate:"omitempty,oneof=ENABLED DISABLED DEPRECATED DRAFT"` // State of the artifact version
	ContentID    int64        `json:"contentId" validate:"required"`                                                // Content ID of the artifact version
	ArtifactID   string       `json:"artifactId" validate:"required,max=512"`                                       // Artifact ID
	GroupID      string       `json:"groupId,omitempty" validate:"omitempty,max=512"`                               // Artifact group ID
	ModifiedBy   string       `json:"modifiedBy,omitempty"`                                                         // User who last modified the artifact version
	ModifiedOn   string       `json:"modifiedOn,omitempty"`                                                         // Last modification timestamp
}

ArtifactVersion represents a single version of an artifact. it has the minimum information required to identify an artifact version. while ArtifactVersionDetailed has more information

type ArtifactVersionDetailed

type ArtifactVersionDetailed struct {
	ArtifactVersion                   // Embedding ArtifactVersion
	Name            string            `json:"name,omitempty"`        // Name of the artifact version
	Description     string            `json:"description,omitempty"` // Description of the artifact version
	Labels          map[string]string `json:"labels,omitempty"`      // User-defined name-value pairs
}

ArtifactVersionDetailed represents a single version of an artifact with additional information.

type ArtifactVersionListResponse

type ArtifactVersionListResponse struct {
	Count    int               `json:"count"`
	Versions []ArtifactVersion `json:"versions"`
}

ArtifactVersionListResponse represents the response of GetArtifactVersions.

type ArtifactVersionMetadata

type ArtifactVersionMetadata struct {
	BaseMetadata
	Version   string `json:"version"`
	GlobalID  int64  `json:"globalId"`
	ContentID int64  `json:"contentId"`
}

ArtifactVersionMetadata represents metadata for a single artifact version.

type ArtifactVersionReferencesParams

type ArtifactVersionReferencesParams struct {
	RefType RefType `validate:"omitempty,oneof=INBOUND OUTBOUND"` // "INBOUND" or "OUTBOUND"
}

ArtifactVersionReferencesParams represents the query parameters for GetArtifactVersionReferences.

func (*ArtifactVersionReferencesParams) ToQuery

ToQuery converts the ArtifactVersionReferencesParams struct to URL query parameters.

func (*ArtifactVersionReferencesParams) Validate

func (p *ArtifactVersionReferencesParams) Validate() error

Validate validates the ListArtifactsInGroupParams struct.

type AuthConfig

type AuthConfig struct {
	Type        string      `json:"type"`
	RbacEnabled bool        `json:"rbacEnabled"`
	ObacEnabled bool        `json:"obacEnabled"`
	Options     AuthOptions `json:"options"`
}

AuthConfig represents the authentication-related configuration settings.

type AuthOptions

type AuthOptions struct {
	Url         string `json:"url"`
	RedirectUri string `json:"redirectUri"`
	ClientId    string `json:"clientId"`
}

AuthOptions represents the options for authentication configuration.

type BaseMetadata

type BaseMetadata struct {
	GroupID      string            `json:"groupId"`
	ArtifactID   string            `json:"artifactId"`
	Name         string            `json:"name"`
	Description  string            `json:"description"`
	ArtifactType string            `json:"artifactType"`
	Owner        string            `json:"owner"`
	CreatedOn    string            `json:"createdOn"`
	Labels       map[string]string `json:"labels"`
}

BaseMetadata contains common fields shared by both artifact and artifact version metadata.

type BranchInfo

type BranchInfo struct {
	GroupId       string `json:"groupId"`
	ArtifactId    string `json:"artifactId"`
	BranchId      string `json:"branchId"`
	Description   string `json:"description"`
	SystemDefined bool   `json:"systemDefined"`
	CreatedOn     string `json:"createdOn"`
	Owner         string `json:"owner"`
	ModifiedOn    string `json:"modifiedOn"`
	ModifiedBy    string `json:"modifiedBy"`
}

type BranchesInfoResponse

type BranchesInfoResponse struct {
	Branches []BranchInfo `json:"branches"`
	Count    int          `json:"count"`
}

BranchesInfoResponse represents the response from the get branch API.

type CreateArtifactParams

type CreateArtifactParams struct {
	IfExists  IfExistsType `validate:"oneof=FAIL CREATE_VERSION FIND_OR_CREATE_VERSION"` // IfExists behavior @See IfExistsType
	Canonical bool         // Indicates whether to canonicalize the artifact content.
	DryRun    bool         // If true, no changes are made, only checks are performed.
}

CreateArtifactParams represents the parameters for creating an artifact.

func (*CreateArtifactParams) ToQuery

func (p *CreateArtifactParams) ToQuery() url.Values

ToQuery converts the parameters into a query string.

func (*CreateArtifactParams) Validate

func (p *CreateArtifactParams) Validate() error

Validate validates the CreateArtifactParams struct.

type CreateArtifactRequest

type CreateArtifactRequest struct {
	ArtifactID   string               `json:"artifactId,omitempty" validate:"required,artifactid"`
	ArtifactType ArtifactType         `json:"artifactType" validate:"omitempty,artifacttype"`
	Name         string               `json:"name,omitempty"`
	Description  string               `json:"description,omitempty"`
	Labels       map[string]string    `json:"labels,omitempty"`
	FirstVersion CreateVersionRequest `json:"firstVersion,omitempty"`
}

CreateArtifactRequest represents the request to create an artifact.

func (*CreateArtifactRequest) Validate

func (r *CreateArtifactRequest) Validate() error

type CreateArtifactResponse

type CreateArtifactResponse struct {
	Artifact ArtifactDetail `json:"artifact"`
}

CreateArtifactResponse represents the response from the create artifact API.

type CreateBranchRequest

type CreateBranchRequest struct {
	BranchID    string `json:"branchId" validate:"required,branchid"`
	Description string `json:"description,omitempty"`
}

func (*CreateBranchRequest) Validate

func (r *CreateBranchRequest) Validate() error

type CreateContentRequest

type CreateContentRequest struct {
	Content     string              `json:"content" validate:"required"`
	References  []ArtifactReference `json:"references,omitempty"`
	ContentType string              `json:"contentType" validate:"required"`
}

CreateContentRequest represents the content of an artifact.

func (*CreateContentRequest) Validate

func (r *CreateContentRequest) Validate() error

type CreateGroupRequest

type CreateGroupRequest struct {
	GroupID     string            `json:"groupId"`
	Description string            `json:"description"`
	Labels      map[string]string `json:"labels"`
}

type CreateUpdateRuleRequest

type CreateUpdateRuleRequest struct {
	RuleType Rule      `json:"ruleType"`
	Config   RuleLevel `json:"config"`
}

type CreateVersionRequest

type CreateVersionRequest struct {
	Version     string               `json:"version"`
	Content     CreateContentRequest `json:"content" validate:"required"`
	Name        string               `json:"name,omitempty"`
	Description string               `json:"description,omitempty"`
	Labels      map[string]string    `json:"labels,omitempty"`
	Branches    []string             `json:"branches,omitempty"`
	IsDraft     bool                 `json:"isDraft"`
}

CreateVersionRequest represents the request to create a version for an artifact.

func (*CreateVersionRequest) Validate

func (r *CreateVersionRequest) Validate() error

type FeatureFlags

type FeatureFlags struct {
	ReadOnly        bool `json:"readOnly"`
	Breadcrumbs     bool `json:"breadcrumbs"`
	RoleManagement  bool `json:"roleManagement"`
	Settings        bool `json:"settings"`
	DeleteGroup     bool `json:"deleteGroup"`
	DeleteArtifact  bool `json:"deleteArtifact"`
	DeleteVersion   bool `json:"deleteVersion"`
	DraftMutability bool `json:"draftMutability"`
}

FeatureFlags represents the available feature flags in the system.

type GetArtifactByGlobalIDParams

type GetArtifactByGlobalIDParams struct {
	HandleReferencesType HandleReferencesType `validate:"omitempty,oneof=PRESERVE DEREFERENCE REWRITE"`
	ReturnArtifactType   bool                 `validate:"omitempty"`
}

func (*GetArtifactByGlobalIDParams) ToQuery

func (p *GetArtifactByGlobalIDParams) ToQuery() url.Values

func (*GetArtifactByGlobalIDParams) Validate

func (p *GetArtifactByGlobalIDParams) Validate() error

type GroupInfo

type GroupInfo struct {
	GroupId     string            `json:"groupId"`
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Owner       string            `json:"owner"`
	CreatedOn   string            `json:"createdOn"`
	ModifiedBy  string            `json:"modifiedBy"`
	ModifiedOn  string            `json:"modifiedOn"`
	Labels      map[string]string `json:"labels"`
}

type GroupInfoResponse

type GroupInfoResponse struct {
	Groups []GroupInfo `json:"groups"`
	Count  int         `json:"count"`
}

GroupInfoResponse represents the response from the get group API.

type GroupOrderBy

type GroupOrderBy string
const (
	GroupOrderByName       GroupOrderBy = "name"
	GroupOrderByGroupId    GroupOrderBy = "groupId"
	GroupOrderByCreatedOn  GroupOrderBy = "createdOn"
	GroupOrderByModifiedOn GroupOrderBy = "modifiedOn"
)

type HandleReferencesType

type HandleReferencesType string

HandleReferencesType represents the type of handling references.

const (
	HandleReferencesTypePreserve    HandleReferencesType = "PRESERVE"
	HandleReferencesTypeDereference HandleReferencesType = "DEREFERENCE"
	HandleReferencesTypeRewrite     HandleReferencesType = "REWRITE"
)

type IfExistsType

type IfExistsType string

IfExistsType represents the IfExists types for creating an artifact.

const (
	IfExistsFail                IfExistsType = "FAIL"                   // (default) - server rejects the content with a 409 error
	IfExistsCreate              IfExistsType = "CREATE_VERSION"         // server creates a new version of the existing artifact and returns it
	IfExistsFindOrCreateVersion IfExistsType = "FIND_OR_CREATE_VERSION" // server returns an existing version that matches the provided content if such a version exists, otherwise a new version is created
)

type ListArtifactReferencesByGlobalIDParams

type ListArtifactReferencesByGlobalIDParams struct {
	RefType RefType `validate:"omitempty,oneof=INBOUND OUTBOUND"`
}

ListArtifactReferencesByGlobalIDParams represents the optional parameters for listing references by global ID.

func (*ListArtifactReferencesByGlobalIDParams) ToQuery

ToQuery converts the params struct to URL query parameters.

func (*ListArtifactReferencesByGlobalIDParams) Validate

Validate validates the ListArtifactReferencesByGlobalIDParams struct.

type ListArtifactsInGroupParams

type ListArtifactsInGroupParams struct {
	Offset  int            `validate:"omitempty,gte=0"`                // Number of artifacts to skip
	Limit   int            `validate:"omitempty,gte=0"`                // Number of artifacts to return
	Order   Order          `validate:"omitempty,oneof=asc desc"`       // Sort order (asc, desc)
	OrderBy ArtifactSortBy `validate:"omitempty,oneof=name createdOn"` // Field to sort by
}

ListArtifactsInGroupParams represents the query parameters for listing artifacts in a group.

func (*ListArtifactsInGroupParams) ToQuery

func (p *ListArtifactsInGroupParams) ToQuery() url.Values

ToQuery converts the ListArtifactsInGroupParams struct to query parameters.

func (*ListArtifactsInGroupParams) Validate

func (p *ListArtifactsInGroupParams) Validate() error

Validate validates the ListArtifactsInGroupParams struct.

type ListArtifactsResponse

type ListArtifactsResponse struct {
	Artifacts []SearchedArtifact `json:"artifacts"`
	Count     int                `json:"count"`
}

ListArtifactsResponse represents the response from the list artifacts API.

type ListArtifactsVersionsParams

type ListArtifactsVersionsParams struct {
	Limit   int           `validate:"omitempty,gte=0"`                        // Number of artifacts to return (default: 20)
	Offset  int           `validate:"omitempty,gte=0"`                        // Number of artifacts to skip (default: 0)
	Order   Order         `validate:"omitempty,oneof=asc desc"`               // Enum: "asc", "desc"
	OrderBy VersionSortBy `validate:"omitempty,oneof=name version createdOn"` // Enum: only: name version createdOn
}

ListArtifactsVersionsParams represents the query parameters for listing artifacts in a group.

func (*ListArtifactsVersionsParams) ToQuery

func (p *ListArtifactsVersionsParams) ToQuery() url.Values

ToQuery converts the ListArtifactsInGroupParams struct to query parameters.

func (*ListArtifactsVersionsParams) Validate

func (p *ListArtifactsVersionsParams) Validate() error

type ListBranchesParams

type ListBranchesParams struct {
	Offset int `validate:"omitempty,gte=0"` // Number of branches to skip
	Limit  int `validate:"omitempty,gte=0"` // Number of branches to return
}

func (*ListBranchesParams) ToQuery

func (p *ListBranchesParams) ToQuery() url.Values

func (*ListBranchesParams) Validate

func (p *ListBranchesParams) Validate() error

type ListGroupsParams

type ListGroupsParams struct {
	Limit   int          `validate:"omitempty,gte=0"` // Number of artifacts to return (default: 20)
	Offset  int          `validate:"omitempty,gte=0"` // Number of artifacts to skip (default: 0)
	Order   Order        `validate:"omitempty,oneof=asc desc"`
	OrderBy GroupOrderBy `validate:"omitempty,oneof=name createdOn"`
}

ListGroupsParams represents the query parameters for listing groups.

func (*ListGroupsParams) ToQuery

func (p *ListGroupsParams) ToQuery() url.Values

ToQuery converts the ListGroupsParams struct to query parameters.

func (*ListGroupsParams) Validate

func (p *ListGroupsParams) Validate() error

type Order

type Order string

Order represents the order of the results.

const (
	OrderAsc  Order = "asc"
	OrderDesc Order = "desc"
)

type OrderBy

type OrderBy string

OrderBy represents the field to sort by.

const (
	OrderByGroupId    OrderBy = "groupId"
	OrderByArtifactId OrderBy = "artifactId"
	OrderByVersion    OrderBy = "version"
	OrderByName       OrderBy = "name"
	OrderByCreatedOn  OrderBy = "createdOn"
	OrderByModifiedOn OrderBy = "modifiedOn"
	OrderByGlobalId   OrderBy = "globalId"
)

type RefType

type RefType string

RefType represents the type of reference.

const (
	OutBound RefType = "OUTBOUND"
	InBound  RefType = "INBOUND"
)

type Rule

type Rule string
const (
	RuleValidity      Rule = "VALIDITY"
	RuleCompatibility Rule = "COMPATIBILITY"
	RuleIntegrity     Rule = "INTEGRITY"
)

type RuleLevel

type RuleLevel string

RuleLevel represents the level of different rules for VALIDITY, COMPATIBILITY, and INTEGRITY.

const (
	IntegrityLevelNone          RuleLevel = "NONE"
	IntegrityLevelRefsExist     RuleLevel = "REFS_EXIST"
	IntegrityLevelAllRefsMapped RuleLevel = "ALL_REFS_MAPPED"
	IntegrityLevelNoDuplicates  RuleLevel = "NO_DUPLICATES"
	IntegrityLevelFull          RuleLevel = "FULL"

	CompatibilityLevelBackward           RuleLevel = "BACKWARD"
	CompatibilityLevelBackwardTransitive RuleLevel = "BACKWARD_TRANSITIVE"
	CompatibilityLevelForward            RuleLevel = "FORWARD"
	CompatibilityLevelForwardTransitive  RuleLevel = "FORWARD_TRANSITIVE"
	CompatibilityLevelFull               RuleLevel = "FULL"
	CompatibilityLevelFullTransitive     RuleLevel = "FULL_TRANSITIVE"
	CompatibilityLevelNone               RuleLevel = "NONE"

	ValidityLevelNone       RuleLevel = "NONE"
	ValidityLevelSyntaxOnly RuleLevel = "SYNTAX_ONLY"
	ValidityLevelFull       RuleLevel = "FULL"
)

type RuleResponse

type RuleResponse struct {
	RuleType Rule      `json:"ruleType"`
	Config   RuleLevel `json:"config"`
}

type SearchArtifactsAPIResponse

type SearchArtifactsAPIResponse struct {
	Artifacts []SearchedArtifact `json:"artifacts"`
	Count     int                `json:"count"`
}

SearchArtifactsAPIResponse represents the response from the search artifacts API.

type SearchArtifactsByContentParams

type SearchArtifactsByContentParams struct {
	Canonical    bool           // Canonicalize the content
	ArtifactType string         `validate:"omitempty,artifacttype"`         // Artifact type (e.g., AVRO, JSON)
	GroupID      string         `validate:"omitempty,groupid"`              // Filter by group ID
	Offset       int            `validate:"omitempty,gte=0"`                // Number of artifacts to skip
	Limit        int            `validate:"omitempty,gte=0"`                // Number of artifacts to return
	Order        Order          `validate:"omitempty,oneof=asc desc"`       // Sort order (asc, desc)
	OrderBy      ArtifactSortBy `validate:"omitempty,oneof=name createdOn"` // Field to sort by
}

SearchArtifactsByContentParams represents the query parameters for the search by content API.

func (*SearchArtifactsByContentParams) ToQuery

ToQuery converts the SearchArtifactsByContentParams struct to query parameters.

func (*SearchArtifactsByContentParams) Validate

func (p *SearchArtifactsByContentParams) Validate() error

Validate validates the SearchArtifactsByContentParams struct.

type SearchArtifactsParams

type SearchArtifactsParams struct {
	Name         string         // Filter by artifact name
	Offset       int            `validate:"omitempty,gte=0"`                // Default: 0
	Limit        int            `validate:"omitempty,gte=0"`                // Default: 20
	Order        Order          `validate:"omitempty,oneof=asc desc"`       // Default: "asc", Enum: "asc", "desc"
	OrderBy      ArtifactSortBy `validate:"omitempty,oneof=name createdOn"` // Field to sort by, e.g., "name", "createdOn"
	Labels       []string       // Filter by one or more name/value labels
	Description  string         // Filter by description
	GroupID      string         `validate:"omitempty,groupid"` // Filter by artifact group
	GlobalID     int64          // Filter by globalId
	ContentID    int64          // Filter by contentId
	ArtifactID   string         `validate:"omitempty,artifactid"`   // Filter by artifactId
	ArtifactType ArtifactType   `validate:"omitempty,artifacttype"` // Filter by artifact type (e.g., AVRO, JSON)
}

SearchArtifactsParams represents the optional parameters for searching artifacts.

func (*SearchArtifactsParams) ToQuery

func (p *SearchArtifactsParams) ToQuery() url.Values

ToQuery converts the SearchArtifactsParams struct to URL query parameters.

func (*SearchArtifactsParams) Validate

func (p *SearchArtifactsParams) Validate() error

Validate validates the SearchArtifactsParams struct.

type SearchGroupsParams

type SearchGroupsParams struct {
	Offset      int               `validate:"omitempty,gte=0"`
	Limit       int               `validate:"omitempty,gte=0"`
	Order       Order             `validate:"omitempty,oneof=asc desc"`
	OrderBy     GroupOrderBy      `validate:"omitempty,oneof=name createdOn"`
	Labels      map[string]string `validate:"omitempty"`
	Description string            `validate:"omitempty"`
	GroupID     string            `validate:"omitempty,groupid"`
}

SearchGroupsParams represents the query parameters for searching groups.

func (*SearchGroupsParams) ToQuery

func (p *SearchGroupsParams) ToQuery() url.Values

ToQuery converts the SearchGroupsParams struct to URL query parameters.

func (*SearchGroupsParams) Validate

func (p *SearchGroupsParams) Validate() error

Validate validates the SearchGroupsParams struct.

type SearchVersionByContentParams

type SearchVersionByContentParams struct {
	Canonical    *bool
	ArtifactType ArtifactType `validate:"omitempty,artifacttype"`
	Offset       int          `validate:"omitempty,gte=0"`
	Limit        int          `validate:"omitempty,gte=0"`
	Order        Order        `validate:"omitempty,oneof=asc desc"`
	OrderBy      OrderBy      `validate:"omitempty,oneof=name createdOn"`
	GroupID      string       `validate:"omitempty,groupid"`
	ArtifactID   string       `validate:"omitempty,artifactid"`
}

SearchVersionByContentParams defines the query parameters for searching artifact versions by content.

func (*SearchVersionByContentParams) ToQuery

ToQuery converts the SearchVersionByContentParams into URL query parameters.

func (*SearchVersionByContentParams) Validate

func (p *SearchVersionByContentParams) Validate() error

Validate validates the SearchVersionByContentParams struct.

type SearchVersionParams

type SearchVersionParams struct {
	Version      string  `validate:"omitempty,version"`
	Offset       int     `validate:"omitempty,gte=0"`
	Limit        int     `validate:"omitempty,gte=0"`
	Order        Order   `validate:"omitempty,oneof=asc desc"`
	OrderBy      OrderBy `validate:"omitempty,oneof=name createdOn"`
	Labels       map[string]string
	Description  string
	GroupID      string `validate:"omitempty,groupid"`
	GlobalID     int64
	ContentID    int64
	ArtifactID   string `validate:"omitempty,artifactid"`
	Name         string
	State        State
	ArtifactType ArtifactType `validate:"omitempty,artifacttype"`
}

SearchVersionParams represents the query parameters for searching artifact versions.

func (*SearchVersionParams) ToQuery

func (p *SearchVersionParams) ToQuery() url.Values

ToQuery converts the SearchVersionParams into URL query parameters.

func (*SearchVersionParams) Validate

func (p *SearchVersionParams) Validate() error

Validate validates the SearchVersionParams struct.

type SearchedArtifact

type SearchedArtifact struct {
	GroupId      string       `json:"groupId"`
	ArtifactId   string       `json:"artifactId"`
	Name         string       `json:"name"`
	Description  string       `json:"description"`
	ArtifactType ArtifactType `json:"artifactType"`
	Owner        string       `json:"owner"`
	CreatedOn    string       `json:"createdOn"`
	ModifiedBy   string       `json:"modifiedBy"`
	ModifiedOn   string       `json:"modifiedOn"`
}

SearchedArtifact represents the search result of an artifact.

type State

type State string

State represents the state of an artifact.

const (
	StateEnabled    State = "ENABLED"
	StateDisabled   State = "DISABLED"
	StateDeprecated State = "DEPRECATED"
	StateDraft      State = "DRAFT"
)

type StateRequest

type StateRequest struct {
	State State `json:"state"`
}

type StateResponse

type StateResponse struct {
	State State `json:"state"`
}

type SystemInfoResponse

type SystemInfoResponse struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Version     string `json:"version"`
	BuiltOn     string `json:"builtOn"`
}

type SystemResourceLimitInfoResponse

type SystemResourceLimitInfoResponse struct {
	MaxTotalSchemasCount              int `json:"maxTotalSchemasCount"`
	MaxSchemaSizeBytes                int `json:"maxSchemaSizeBytes"`
	MaxArtifactsCount                 int `json:"maxArtifactsCount"`
	MaxVersionsPerArtifactCount       int `json:"maxVersionsPerArtifactCount"`
	MaxArtifactPropertiesCount        int `json:"maxArtifactPropertiesCount"`
	MaxPropertyKeySizeBytes           int `json:"maxPropertyKeySizeBytes"`
	MaxPropertyValueSizeBytes         int `json:"maxPropertyValueSizeBytes"`
	MaxArtifactLabelsCount            int `json:"maxArtifactLabelsCount"`
	MaxLabelSizeBytes                 int `json:"maxLabelSizeBytes"`
	MaxArtifactNameLengthChars        int `json:"maxArtifactNameLengthChars"`
	MaxArtifactDescriptionLengthChars int `json:"maxArtifactDescriptionLengthChars"`
	MaxRequestsPerSecondCount         int `json:"maxRequestsPerSecondCount"`
}

type SystemUIConfigResponse

type SystemUIConfigResponse struct {
	Ui       UIConfig     `json:"ui"`
	Auth     AuthConfig   `json:"auth"`
	Features FeatureFlags `json:"features"`
}

SystemUIConfigResponse represents the overall UI configuration response.

type UIConfig

type UIConfig struct {
	ContextPath   string `json:"contextPath"`
	NavPrefixPath string `json:"navPrefixPath"`
	OaiDocsUrl    string `json:"oaiDocsUrl"`
}

type UpdateArtifactMetadataRequest

type UpdateArtifactMetadataRequest struct {
	Name        string            `json:"name,omitempty"`        // Editable name
	Description string            `json:"description,omitempty"` // Editable description
	Labels      map[string]string `json:"labels,omitempty"`      // Editable labels
	Owner       string            `json:"owner,omitempty"`       // Editable owner
}

UpdateArtifactMetadataRequest represents the metadata update request.

type UpdateBranchMetaDataRequest

type UpdateBranchMetaDataRequest struct {
	Description string `json:"description,omitempty"`
}

type UpdateGroupRequest

type UpdateGroupRequest struct {
	Description string            `json:"description"`
	Labels      map[string]string `json:"labels"`
}

type UserInfo

type UserInfo struct {
	Username    string `json:"username"`
	DisplayName string `json:"displayName"`
	Admin       bool   `json:"admin"`
	Developer   bool   `json:"developer"`
	Viewer      bool   `json:"viewer"`
}

type VersionSortBy

type VersionSortBy string
const (
	VersionSortByVersion    VersionSortBy = "version"
	VersionSortByGlobalID   VersionSortBy = "globalId"
	VersionSortByCreatedOn  VersionSortBy = "createdOn"
	VersionSortByModifiedOn VersionSortBy = "modifiedOn"
	VersionSortByArtifactID VersionSortBy = "artifactId"
	VersionSortByGroupID    VersionSortBy = "groupId"
	VersionSortByName       VersionSortBy = "name"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL