clients

package
v0.0.43 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttributesLimit = 100
	RelationsLimit  = 50
)
View Source
const (
	DefinitionAttributeTypeID                = "00000000-0000-0000-0000-000000000202"
	MeasureIsCalculatedUsingDataElementRelID = "00000000-0000-0000-0000-000000007200"
	BusinessAssetRepresentsDataAssetRelID    = "00000000-0000-0000-0000-000000007038"
	ColumnIsPartOfTableRelID                 = "00000000-0000-0000-0000-000000007042"
	DataAttributeRepresentsColumnRelID       = "00000000-0000-0000-0000-000000007094"
	ColumnIsSourceForDataAttributeRelID      = "00000000-0000-0000-0000-120000000011"
)

Well-known Collibra UUIDs for relation and attribute types.

Variables

This section is empty.

Functions

func AddTagsToAsset added in v0.0.32

func AddTagsToAsset(ctx context.Context, client *http.Client, assetID string, tags []string) error

AddTagsToAsset appends one or more tags to an asset without replacing existing tags (incremental, matching the "prefer incremental" AC).

func AskDad

func AskDad(ctx context.Context, collibraHttpClient *http.Client, question string) (string, error)

func AskGlossary

func AskGlossary(ctx context.Context, collibraHttpClient *http.Client, question string) (string, error)

func CreateAddFromManifestRequest

func CreateAddFromManifestRequest(req PushDataContractManifestRequest) (*bytes.Buffer, string, error)

func CreateInitDataContractRequest added in v0.0.38

func CreateInitDataContractRequest(req InitDataContractRequest) (*bytes.Buffer, string, error)

func DeleteAttribute added in v0.0.32

func DeleteAttribute(ctx context.Context, client *http.Client, attributeID string) error

DeleteAttribute removes a single attribute instance via DELETE /rest/2.0/attributes/{id}.

func DeleteRelation added in v0.0.32

func DeleteRelation(ctx context.Context, client *http.Client, relationID string) error

DeleteRelation removes a relation via DELETE /rest/2.0/relations/{id}.

func DeleteResponsibility added in v0.0.37

func DeleteResponsibility(ctx context.Context, client *http.Client, responsibilityID string) error

DeleteResponsibility removes a responsibility instance by its ID via DELETE /rest/2.0/responsibilities/{id}.

func FetchDescription added in v0.0.26

func FetchDescription(ctx context.Context, client *http.Client, assetID string) string

FetchDescription retrieves the definition/description attribute for an asset.

func GetUserGroupName added in v0.0.28

func GetUserGroupName(ctx context.Context, collibraHttpClient *http.Client, groupID string) (string, error)

GetUserGroupName fetches the name for a user group by ID.

func GetUserName added in v0.0.28

func GetUserName(ctx context.Context, collibraHttpClient *http.Client, userID string) (string, error)

GetUserName fetches the display name for a user by ID.

func PullActiveDataContractManifest

func PullActiveDataContractManifest(ctx context.Context, collibraHttpClient *http.Client, dataContractID string) ([]byte, error)

func RemoveDataClassificationMatch

func RemoveDataClassificationMatch(ctx context.Context, httpClient *http.Client, classificationMatchID string) error

Types

type AddDataClassRequest

type AddDataClassRequest struct {
	Name                string   `json:"name"`
	Description         string   `json:"description,omitempty"`
	Status              string   `json:"status,omitempty"`
	ColumnNameFilters   []string `json:"columnNameFilters,omitempty"`
	ColumnTypeFilters   []string `json:"columnTypeFilters,omitempty"`
	AllowNullValues     *bool    `json:"allowNullValues,omitempty"`
	AllowEmptyValues    *bool    `json:"allowEmptyValues,omitempty"`
	ConfidenceThreshold *int     `json:"confidenceThreshold,omitempty"`
	Examples            []string `json:"examples,omitempty"`
}

type AddDataClassificationMatchRequest

type AddDataClassificationMatchRequest struct {
	AssetID          string `json:"assetId"`
	ClassificationID string `json:"classificationId"`
}

type Answer added in v0.0.43

type Answer struct {
	Type  string `json:"type"`
	Value any    `json:"value,omitempty"`
}

Answer is a typed answer. The concrete shape of Value depends on Type (TEXT/HTML/EXPRESSION → string, NUMBER → number, BOOLEAN → bool, DATE → "yyyy-MM-dd", ITEMS/ASSETS/USERORGROUPS/ATTACHMENTS → arrays). It is carried as-is so every answer type round-trips; the tool layer builds and validates the value per type.

type Assessment added in v0.0.43

type Assessment struct {
	ID                  string              `json:"id"`
	Name                string              `json:"name,omitempty"`
	Status              string              `json:"status,omitempty"` // DRAFT | SUBMITTED | OBSOLETE
	Template            *AssessmentTemplate `json:"template,omitempty"`
	Content             []QuestionAndAnswer `json:"content,omitempty"`
	Asset               *AssessmentRef      `json:"asset,omitempty"`
	AssessmentReview    *AssessmentRef      `json:"assessmentReview,omitempty"`
	Assignees           []Assignee          `json:"assignees,omitempty"`
	Owner               *AssessmentRef      `json:"owner,omitempty"`
	IsVisibleToEveryone *bool               `json:"isVisibleToEveryone,omitempty"`
	CreatedOn           string              `json:"createdOn,omitempty"`
	LastModifiedOn      string              `json:"lastModifiedOn,omitempty"`
	SubmittedOn         string              `json:"submittedOn,omitempty"`
}

Assessment is a conducted assessment. Only the fields chip reads or writes are modelled; unknown fields are ignored on decode.

func CreateAssessment added in v0.0.43

func CreateAssessment(ctx context.Context, client *http.Client, request CreateAssessmentRequest) (*Assessment, error)

CreateAssessment creates a new assessment from a template (POST) and returns the created assessment (including its questions in Content).

func GetAssessment added in v0.0.43

func GetAssessment(ctx context.Context, client *http.Client, id string) (*Assessment, error)

GetAssessment retrieves an assessment by its assessment ID.

func GetAssessmentByReview added in v0.0.43

func GetAssessmentByReview(ctx context.Context, client *http.Client, reviewAssetID string) (*Assessment, error)

GetAssessmentByReview retrieves an assessment by its Assessment Review asset UUID — the bridge from the catalog side to an assessment.

func UpdateAssessment added in v0.0.43

func UpdateAssessment(ctx context.Context, client *http.Client, id string, request UpdateAssessmentRequest) (*Assessment, error)

UpdateAssessment applies a partial update to an assessment (PATCH) and returns the updated assessment.

type AssessmentRef added in v0.0.43

type AssessmentRef struct {
	ID   string `json:"id"`
	Name string `json:"name,omitempty"`
}

AssessmentRef is the {id, name?} shape the API uses for assets, reviews, owners, users, and templates references.

type AssessmentTemplate added in v0.0.43

type AssessmentTemplate struct {
	ID        string         `json:"id"`
	Name      string         `json:"name,omitempty"`
	Version   VersionString  `json:"version,omitempty"`
	Status    string         `json:"status,omitempty"` // DRAFT | PUBLISHED | OBSOLETE
	AssetType *AssessmentRef `json:"assetType,omitempty"`
}

AssessmentTemplate is the (thin) template metadata. It does NOT expose the template's questions — those come from an assessment's Content.

type Asset

type Asset struct {
	ID                string             `json:"id"`
	DisplayName       string             `json:"displayName"`
	Type              *AssetType         `json:"type,omitempty"`
	Domain            *Domain            `json:"domain,omitempty"`
	Status            *Status            `json:"status,omitempty"`
	StringAttributes  []StringAttribute  `json:"stringAttributes,omitempty"`
	NumericAttributes []NumericAttribute `json:"numericAttributes,omitempty"`
	BooleanAttributes []BooleanAttribute `json:"booleanAttributes,omitempty"`
	DateAttributes    []DateAttribute    `json:"dateAttributes,omitempty"`
	OutgoingRelations []OutgoingRelation `json:"outgoingRelations,omitempty"`
	IncomingRelations []IncomingRelation `json:"incomingRelations,omitempty"`
}

func GetAssetSummary

func GetAssetSummary(
	ctx context.Context,
	collibraHttpClient *http.Client,
	uuid uuid.UUID,
	outgoingRelationsCursor string,
	incomingRelationsCursor string,
) ([]Asset, error)

func ParseAssetDetailsGraphQLResponse

func ParseAssetDetailsGraphQLResponse(jsonData []byte) ([]Asset, error)

type AssetQueryData

type AssetQueryData struct {
	Assets []Asset `json:"assets"`
}

type AssetType

type AssetType struct {
	Name string `json:"name"`
}

type AssetTypeDetails

type AssetTypeDetails struct {
	ID                 string `json:"id"`
	Name               string `json:"name"`
	Description        string `json:"description,omitempty"`
	PublicId           string `json:"publicId,omitempty"`
	DisplayNameEnabled bool   `json:"displayNameEnabled"`
	RatingEnabled      bool   `json:"ratingEnabled"`
	FinalType          bool   `json:"finalType"`
	System             bool   `json:"system"`
	Product            string `json:"product,omitempty"`
}

type AssetTypePagedResponse

type AssetTypePagedResponse struct {
	Total   int64              `json:"total"`
	Offset  int64              `json:"offset"`
	Limit   int64              `json:"limit"`
	Results []AssetTypeDetails `json:"results"`
}

AssetTypePagedResponse represents the response from the Collibra asset types API

func ListAssetTypes

func ListAssetTypes(ctx context.Context, collibraHttpClient *http.Client, limit int, offset int) (*AssetTypePagedResponse, error)

func ParseAssetTypesResponse

func ParseAssetTypesResponse(jsonData []byte) (*AssetTypePagedResponse, error)

type AssetTypesQueryParams

type AssetTypesQueryParams struct {
	ExcludeMeta bool `url:"excludeMeta,omitempty"`
	Limit       int  `url:"limit,omitempty"`
	Offset      int  `url:"offset,omitempty"`
}

type Assignee added in v0.0.43

type Assignee struct {
	ID   string `json:"id"`
	Type string `json:"type"` // USER | GROUP
}

Assignee is a user or group assigned to an assessment.

type AttributeResult added in v0.0.26

type AttributeResult struct {
	ID    string `json:"id"`
	Value string `json:"value"`
}

type AttributeType

type AttributeType struct {
	Name string `json:"name"`
}

type AttributesQueryParams added in v0.0.26

type AttributesQueryParams struct {
	AssetID         string `url:"assetId,omitempty"`
	AttributeTypeID string `url:"attributeTypeId,omitempty"`
}

type AttributesResponse added in v0.0.26

type AttributesResponse struct {
	Total   int               `json:"total"`
	Offset  int               `json:"offset"`
	Limit   int               `json:"limit"`
	Results []AttributeResult `json:"results"`
}

func GetAssetAttributes added in v0.0.26

func GetAssetAttributes(ctx context.Context, client *http.Client, assetID string, attrTypeID string) (*AttributesResponse, error)

GetAssetAttributes queries the Collibra attributes API for a specific asset and attribute type.

type BooleanAttribute

type BooleanAttribute struct {
	Value bool           `json:"booleanValue"`
	Type  *AttributeType `json:"type,omitempty"`
}

type ChatContext

type ChatContext struct {
	OriginUrl string `json:"originUrl"`
}

type Community added in v0.0.38

type Community struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Community is a minimal community reference {id, name}, enough to resolve a community name typed by a user back to the UUID that search filters expect.

func SearchCommunitiesByName added in v0.0.38

func SearchCommunitiesByName(ctx context.Context, client *http.Client, name string, limit int) ([]Community, error)

SearchCommunitiesByName queries /communities?name=… and returns the matches up to the given limit. Collibra performs a case-insensitive substring match server-side, so callers wanting an exact hit should still verify name equality on the result (see search_asset_keyword's resolver).

type ConnectedAsset added in v0.0.26

type ConnectedAsset struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	AssetType string `json:"assetType"`
}

func FindColumnsForDataAttribute added in v0.0.26

func FindColumnsForDataAttribute(ctx context.Context, client *http.Client, dataAttributeID string) ([]ConnectedAsset, error)

FindColumnsForDataAttribute finds assets connected via both data attribute relation types.

func FindConnectedAssets added in v0.0.26

func FindConnectedAssets(ctx context.Context, client *http.Client, assetID string, relationTypeID string) ([]ConnectedAsset, error)

FindConnectedAssets finds assets connected to assetID via relationTypeID, querying both directions.

type ContextSpecAssetType added in v0.0.40

type ContextSpecAssetType struct {
	PublicId string `json:"publicId"`
	Name     string `json:"name,omitempty"`
}

ContextSpecAssetType is the asset type associated with a Context Specification.

type ContextSpecification added in v0.0.40

type ContextSpecification struct {
	ID             string               `json:"id"`
	Name           string               `json:"name"`
	Description    string               `json:"description,omitempty"`
	AssetType      ContextSpecAssetType `json:"assetType"`
	MappingYaml    string               `json:"mappingYaml"`
	CreatedBy      string               `json:"createdBy"`
	CreatedOn      string               `json:"createdOn"`
	LastModifiedBy string               `json:"lastModifiedBy"`
	LastModifiedOn string               `json:"lastModifiedOn"`
}

ContextSpecification is the full Context Specification resource as returned by the Semantic Blueprint API.

func GetContextSpecification added in v0.0.40

func GetContextSpecification(
	ctx context.Context,
	collibraHttpClient *http.Client,
	contextSpecificationId string,
) (*ContextSpecification, error)

GetContextSpecification calls GET /rest/semanticBlueprint/v1/contextSpecifications/{id}.

type ContextSpecificationPagedResponse added in v0.0.40

type ContextSpecificationPagedResponse struct {
	Total   int                    `json:"total"`
	Results []ContextSpecification `json:"results"`
}

ContextSpecificationPagedResponse is the paged list returned by GET /rest/semanticBlueprint/v1/contextSpecifications.

func ListContextSpecifications added in v0.0.40

func ListContextSpecifications(
	ctx context.Context,
	collibraHttpClient *http.Client,
	assetId, assetTypePublicId string,
	offset, limit int,
) (*ContextSpecificationPagedResponse, error)

ListContextSpecifications calls GET /rest/semanticBlueprint/v1/contextSpecifications.

type CreateAssessmentRequest added in v0.0.43

type CreateAssessmentRequest struct {
	Template               AssessmentRef         `json:"template"`
	Name                   string                `json:"name,omitempty"`
	Asset                  *AssessmentRef        `json:"asset,omitempty"`
	Assignees              []Assignee            `json:"assignees,omitempty"`
	Content                []QuestionIDAndAnswer `json:"content,omitempty"`
	Owner                  *AssessmentRef        `json:"owner,omitempty"`
	Status                 *string               `json:"status,omitempty"`
	IsVisibleToEveryone    *bool                 `json:"isVisibleToEveryone,omitempty"`
	AssessmentReviewDomain *AssessmentRef        `json:"assessmentReviewDomain,omitempty"`
}

CreateAssessmentRequest is the POST body. Only Template is required; provide at least a Name or an Asset.

type CreateAssetDomainRef added in v0.0.29

type CreateAssetDomainRef struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

CreateAssetDomainRef is a reference to a domain in a create asset response.

type CreateAssetRequest added in v0.0.29

type CreateAssetRequest struct {
	Name                        string `json:"name"`
	TypeID                      string `json:"typeId"`
	DomainID                    string `json:"domainId"`
	DisplayName                 string `json:"displayName,omitempty"`
	StatusID                    string `json:"statusId,omitempty"`
	ExcludeFromAutoHyperlinking bool   `json:"excludeFromAutoHyperlinking,omitempty"`
}

CreateAssetRequest is the request body for POST /rest/2.0/assets.

type CreateAssetResponse added in v0.0.29

type CreateAssetResponse struct {
	ID             string                `json:"id"`
	Name           string                `json:"name"`
	DisplayName    string                `json:"displayName"`
	Type           CreateAssetTypeRef    `json:"type"`
	Domain         CreateAssetDomainRef  `json:"domain"`
	Status         *CreateAssetStatusRef `json:"status,omitempty"`
	CreatedBy      string                `json:"createdBy"`
	CreatedOn      int64                 `json:"createdOn"`
	LastModifiedBy string                `json:"lastModifiedBy"`
	LastModifiedOn int64                 `json:"lastModifiedOn"`
}

CreateAssetResponse is the response from POST /rest/2.0/assets.

func CreateAsset added in v0.0.29

func CreateAsset(ctx context.Context, client *http.Client, request CreateAssetRequest) (*CreateAssetResponse, error)

CreateAsset creates a new asset via POST /rest/2.0/assets.

type CreateAssetStatusRef added in v0.0.33

type CreateAssetStatusRef struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

CreateAssetStatusRef is a reference to a status in a create asset response.

type CreateAssetTypeRef added in v0.0.29

type CreateAssetTypeRef struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

CreateAssetTypeRef is a reference to an asset type in a create asset response.

type CreateAttributeAssetRef added in v0.0.29

type CreateAttributeAssetRef struct {
	ID string `json:"id"`
}

CreateAttributeAssetRef is a reference to an asset in an attribute response.

type CreateAttributeRequest added in v0.0.29

type CreateAttributeRequest struct {
	AssetID string `json:"assetId"`
	TypeID  string `json:"typeId"`
	Value   string `json:"value"`
}

CreateAttributeRequest is the request body for POST /rest/2.0/attributes.

type CreateAttributeResponse added in v0.0.29

type CreateAttributeResponse struct {
	ID    string                  `json:"id"`
	Type  CreateAttributeTypeRef  `json:"type"`
	Asset CreateAttributeAssetRef `json:"asset"`
	Value string                  `json:"value"`
}

CreateAttributeResponse is the response from POST /rest/2.0/attributes.

func CreateAttribute added in v0.0.29

func CreateAttribute(ctx context.Context, client *http.Client, request CreateAttributeRequest) (*CreateAttributeResponse, error)

CreateAttribute creates a new attribute on an asset via POST /rest/2.0/attributes.

func (*CreateAttributeResponse) UnmarshalJSON added in v0.0.38

func (r *CreateAttributeResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON tolerates `value` fields returned as JSON numbers, booleans, or null. Collibra emits the field typed by the attribute kind (NumericAttributeType → number, BooleanAttributeType → bool, etc.), so a strict string decode fails even though the write succeeded.

type CreateAttributeTypeRef added in v0.0.29

type CreateAttributeTypeRef struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

CreateAttributeTypeRef is a reference to an attribute type.

type DataClass

type DataClass struct {
	ID                  string            `json:"id"`
	Name                string            `json:"name"`
	Description         string            `json:"description"`
	Status              string            `json:"status"`
	ColumnNameFilters   []string          `json:"columnNameFilters"`
	ColumnTypeFilters   []string          `json:"columnTypeFilters"`
	AllowNullValues     bool              `json:"allowNullValues"`
	AllowEmptyValues    bool              `json:"allowEmptyValues"`
	ConfidenceThreshold int               `json:"confidenceThreshold"`
	Examples            []string          `json:"examples"`
	CreatedBy           string            `json:"createdBy"`
	CreatedOn           int64             `json:"createdOn"`
	LastModifiedBy      string            `json:"lastModifiedBy"`
	LastModifiedOn      int64             `json:"lastModifiedOn"`
	Rules               []json.RawMessage `json:"rules"`
}

func SearchDataClasses

func SearchDataClasses(ctx context.Context, collibraHttpClient *http.Client, params DataClassQueryParams) ([]DataClass, int, error)

type DataClassQueryParams

type DataClassQueryParams struct {
	ContainsRules    *bool    `url:"containsRules,omitempty"`
	CorrelationID    string   `url:"correlationId,omitempty"`
	DataClassGroupID string   `url:"dataClassGroupId,omitempty"`
	Description      string   `url:"description,omitempty"`
	Limit            *int     `url:"limit,omitempty"`
	Name             string   `url:"name,omitempty"`
	Offset           *int     `url:"offset,omitempty"`
	RuleType         []string `url:"ruleType,omitempty"`
	Status           []string `url:"status,omitempty"`
	View             string   `url:"view,omitempty"`
}

type DataClassesResponse

type DataClassesResponse struct {
	Total   int         `json:"total"`
	Results []DataClass `json:"results"`
}

type DataClassification

type DataClassification struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type DataClassificationMatch

type DataClassificationMatch struct {
	ID             string                 `json:"id"`
	CreatedBy      string                 `json:"createdBy"`
	CreatedOn      int64                  `json:"createdOn"`
	LastModifiedBy string                 `json:"lastModifiedBy"`
	LastModifiedOn int64                  `json:"lastModifiedOn"`
	System         bool                   `json:"system"`
	ResourceType   string                 `json:"resourceType"`
	Status         string                 `json:"status"`
	Confidence     float64                `json:"confidence"`
	Asset          NamedResourceReference `json:"asset"`
	Classification DataClassification     `json:"classification"`
}

func AddDataClassificationMatch

func AddDataClassificationMatch(ctx context.Context, httpClient *http.Client, request AddDataClassificationMatchRequest) (*DataClassificationMatch, error)

func SearchDataClassificationMatches

func SearchDataClassificationMatches(ctx context.Context, httpClient *http.Client, params DataClassificationMatchQueryParams) ([]DataClassificationMatch, int64, error)

type DataClassificationMatchQueryParams

type DataClassificationMatchQueryParams struct {
	Offset            *int     `url:"offset,omitempty"`
	Limit             *int     `url:"limit,omitempty"`
	CountLimit        *int     `url:"countLimit,omitempty"`
	AssetIDs          []string `url:"assetIds,omitempty"`
	Statuses          []string `url:"statuses,omitempty"`
	ClassificationIDs []string `url:"classificationIds,omitempty"`
	AssetTypeIDs      []string `url:"assetTypeIds,omitempty"`
}

type DataContract

type DataContract struct {
	ID         string `json:"id"`
	DomainID   string `json:"domainId"`
	ManifestID string `json:"manifestId"`
}

DataContract represents metadata attributes of a data contract

type DataContractListPaginated

type DataContractListPaginated struct {
	Items      []DataContract `json:"items"`
	Limit      int            `json:"limit"`
	NextCursor string         `json:"nextCursor,omitempty"`
	Total      int            `json:"total,omitempty"`
}

DataContractListPaginated represents the paginated response from the data contracts API

func ListDataContracts

func ListDataContracts(ctx context.Context, collibraHttpClient *http.Client, cursor string, limit int, manifestID string) (*DataContractListPaginated, error)

func ParseDataContractsResponse

func ParseDataContractsResponse(jsonData []byte) (*DataContractListPaginated, error)

type DataContractManifestVersion added in v0.0.38

type DataContractManifestVersion struct {
	Version        string `json:"version"`
	Active         bool   `json:"active"`
	Format         string `json:"format"`
	CreatedBy      string `json:"createdBy"`
	CreatedOn      int64  `json:"createdOn"`
	LastModifiedBy string `json:"lastModifiedBy"`
	LastModifiedOn int64  `json:"lastModifiedOn"`
}

DataContractManifestVersion represents metadata attributes of a data contract version

type DataContractsQueryParams

type DataContractsQueryParams struct {
	ManifestID   string `url:"manifestId,omitempty"`
	IncludeTotal bool   `url:"includeTotal,omitempty"`
	Cursor       string `url:"cursor,omitempty"`
	Limit        int    `url:"limit,omitempty"`
}

type DateAttribute

type DateAttribute struct {
	Value string         `json:"dateValue"`
	Type  *AttributeType `json:"type,omitempty"`
}

type Domain

type Domain struct {
	Name string `json:"name"`
}

type DomainType added in v0.0.38

type DomainType struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

DomainType is a minimal domain-type reference {id, name}. Domain types are a small, enumerable set, so callers list them all and match in memory rather than hitting a name-filtered search per value.

func ListDomainTypes added in v0.0.38

func ListDomainTypes(ctx context.Context, client *http.Client) ([]DomainType, error)

ListDomainTypes fetches every domain type defined in the instance. The set is small (tens of entries in OOTB Collibra), so a single large page suffices.

type EditAssetAddTagsRequest added in v0.0.32

type EditAssetAddTagsRequest struct {
	TagNames []string `json:"tagNames"`
}

EditAssetAddTagsRequest is the body for POST /rest/2.0/assets/{id}/tags. Collibra expects the field to be named "tagNames" — sending "tags" is silently ignored by the API and yields a "tagNames may not be null" 400.

type EditAssetAssignment added in v0.0.32

type EditAssetAssignment struct {
	AssetType      EditAssetTypeRef                   `json:"assetType"`
	DomainType     *EditAssetDomainTypeRef            `json:"domainType,omitempty"`
	AttributeTypes []EditAssetAssignmentAttributeType `json:"attributeTypes"`
	RelationTypes  []EditAssetAssignmentRelationType  `json:"relationTypes,omitempty"`
}

EditAssetAssignment lists which attribute and relation types are valid for an asset. This is the public shape the edit_asset tool consumes; it is built from Collibra's raw assignment response by GetEffectiveAssignmentForAsset.

func GetAssignmentForAssetType added in v0.0.32

func GetAssignmentForAssetType(ctx context.Context, client *http.Client, assetTypeID, domainTypeID string) (*EditAssetAssignment, error)

GetAssignmentForAssetType resolves the assignment for an (asset type, domain type) pair by walking the asset type's parent chain and merging each level, filtering by domain type. A subtype inherits relation roles from a parent's assignment (e.g. KPI under Business Asset), which the walk picks up. Used for RELATION types only; attributes come from GetEffectiveAssignmentForAsset.

func GetEffectiveAssignmentForAsset added in v0.0.38

func GetEffectiveAssignmentForAsset(ctx context.Context, client *http.Client, assetID string) (*EditAssetAssignment, error)

GetEffectiveAssignmentForAsset returns the assignment Collibra resolves for a specific asset via GET /assignments/asset/{assetId}, which handles type and domain inheritance server-side. Use it for ATTRIBUTES only: it is unreliable for relation types (it omits some inherited relations for certain asset types), so relations stay on GetAssignmentForAssetType.

The response is a single Assignment with the same characteristicTypes shape as /assignments/assetType, so we reuse mergeEditAssignments with an empty domainTypeID (the server already scoped it).

type EditAssetAssignmentAttributeType added in v0.0.32

type EditAssetAssignmentAttributeType struct {
	ID          string                          `json:"id"`
	Name        string                          `json:"name"`
	Kind        string                          `json:"kind,omitempty"`
	Required    bool                            `json:"required,omitempty"`
	Constraints *EditAssetAssignmentConstraints `json:"constraints,omitempty"`
}

EditAssetAssignmentAttributeType is an attribute type allowed by a scoped assignment, with its full name and (optional) constraints.

type EditAssetAssignmentConstraints added in v0.0.32

type EditAssetAssignmentConstraints struct {
	MinLength *int     `json:"minLength,omitempty"`
	MaxLength *int     `json:"maxLength,omitempty"`
	Min       *float64 `json:"min,omitempty"`
	Max       *float64 `json:"max,omitempty"`
}

EditAssetAssignmentConstraints captures attribute type constraints used to validate operation values before any writes.

type EditAssetAssignmentRelationType added in v0.0.32

type EditAssetAssignmentRelationType struct {
	ID         string            `json:"id"`
	Role       string            `json:"role"`
	CoRole     string            `json:"coRole,omitempty"`
	SourceType *EditAssetTypeRef `json:"sourceType,omitempty"`
	TargetType *EditAssetTypeRef `json:"targetType,omitempty"`
	Reversed   bool              `json:"reversed,omitempty"`
}

EditAssetAssignmentRelationType is a relation type allowed by a scoped assignment. Role is the forward name (source→target); CoRole is the inverse name (target→source). Reversed is true when the edited asset is the tail (target) of this relation — add_relation must then flip source and target when calling the API.

type EditAssetAttributeAssetRef added in v0.0.32

type EditAssetAttributeAssetRef struct {
	ID string `json:"id"`
}

EditAssetAttributeAssetRef is a reference to the owning asset.

type EditAssetAttributeInstance added in v0.0.32

type EditAssetAttributeInstance struct {
	ID    string                     `json:"id"`
	Type  EditAssetAttributeTypeRef  `json:"type"`
	Asset EditAssetAttributeAssetRef `json:"asset"`
	Value string                     `json:"value"`
}

EditAssetAttributeInstance is a single attribute value on an asset, returned by GET /rest/2.0/attributes?assetId=....

func BulkCreateAttributes added in v0.0.32

func BulkCreateAttributes(ctx context.Context, client *http.Client, items []CreateAttributeRequest) ([]EditAssetAttributeInstance, error)

BulkCreateAttributes creates multiple attribute instances in one round trip via POST /rest/2.0/attributes/bulk. Treated as all-or-nothing: if the whole batch fails, the caller marks every affected op as failed with the batch error. Partial-row failures from Collibra aren't parsed individually.

func BulkPatchAttributes added in v0.0.32

func BulkPatchAttributes(ctx context.Context, client *http.Client, items []EditAssetBulkPatchAttributeItem) ([]EditAssetAttributeInstance, error)

BulkPatchAttributes updates multiple attribute instances in one round trip via PATCH /rest/2.0/attributes/bulk. All-or-nothing, same rationale as BulkCreateAttributes.

func CreateAttributeOnAsset added in v0.0.32

func CreateAttributeOnAsset(ctx context.Context, client *http.Client, assetID, attrTypeID, value string) (*EditAssetAttributeInstance, error)

CreateAttributeOnAsset adds a single attribute instance via POST /rest/2.0/attributes. It mirrors CreateAttribute in create_asset_client.go but returns the richer EditAssetAttributeInstance shape for diff tracking.

func ListAttributesForAsset added in v0.0.32

func ListAttributesForAsset(ctx context.Context, client *http.Client, assetID string) ([]EditAssetAttributeInstance, error)

ListAttributesForAsset fetches all attribute instances on an asset. Pages are followed transparently so the caller gets the full list.

func PatchAttributeValue added in v0.0.32

func PatchAttributeValue(ctx context.Context, client *http.Client, attributeID, value string) (*EditAssetAttributeInstance, error)

PatchAttributeValue updates a single attribute instance's value via PATCH /rest/2.0/attributes/{id}.

func (*EditAssetAttributeInstance) UnmarshalJSON added in v0.0.32

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

UnmarshalJSON tolerates `value` fields returned as JSON numbers, booleans, or null. Collibra emits the field with whatever underlying type the attribute kind dictates (NumericAttributeType -> number, BooleanAttributeType -> bool, etc.), so a strict string decode fails when an asset has any non-string attribute. We stringify any scalar and treat null as the empty string; consumers only need a printable representation for diffs and error messages.

type EditAssetAttributeTypeRef added in v0.0.32

type EditAssetAttributeTypeRef struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

EditAssetAttributeTypeRef is a reference to an attribute type on an instance.

type EditAssetBulkPatchAttributeItem added in v0.0.32

type EditAssetBulkPatchAttributeItem struct {
	ID    string `json:"id"`
	Value string `json:"value"`
}

EditAssetBulkPatchAttributeItem is one row of PATCH /rest/2.0/attributes/bulk.

type EditAssetCore added in v0.0.32

type EditAssetCore struct {
	ID          string              `json:"id"`
	Name        string              `json:"name"`
	DisplayName string              `json:"displayName,omitempty"`
	Type        EditAssetTypeRef    `json:"type"`
	Domain      EditAssetDomainRef  `json:"domain"`
	Status      *EditAssetStatusRef `json:"status,omitempty"`
}

EditAssetCore is the slim view of an asset returned by GET /rest/2.0/assets/{id} that the edit_asset tool needs for validation and dispatch.

func GetAssetCore added in v0.0.32

func GetAssetCore(ctx context.Context, client *http.Client, assetID string) (*EditAssetCore, error)

GetAssetCore fetches the core asset shape needed by the edit_asset tool.

func PatchAsset added in v0.0.32

func PatchAsset(ctx context.Context, client *http.Client, assetID string, payload EditAssetPatchRequest) (*EditAssetCore, error)

PatchAsset updates the whitelisted core fields (name, displayName, statusId) on an asset via PATCH /rest/2.0/assets/{id}.

type EditAssetCreateRelationRequest added in v0.0.32

type EditAssetCreateRelationRequest struct {
	SourceID string `json:"sourceId"`
	TargetID string `json:"targetId"`
	TypeID   string `json:"typeId"`
}

EditAssetCreateRelationRequest is the body for POST /rest/2.0/relations.

type EditAssetCreateResponsibilityRequest added in v0.0.32

type EditAssetCreateResponsibilityRequest struct {
	RoleID       string `json:"roleId"`
	OwnerID      string `json:"ownerId"`
	ResourceID   string `json:"resourceId"`
	ResourceType string `json:"resourceType"`
}

EditAssetCreateResponsibilityRequest is the body for POST /rest/2.0/responsibilities. resourceType is required alongside resourceId; without it the API rejects the request with a 400 (addResourceMemberIncompleteParameters).

type EditAssetDomainDetails added in v0.0.32

type EditAssetDomainDetails struct {
	ID   string                  `json:"id"`
	Name string                  `json:"name"`
	Type *EditAssetDomainTypeRef `json:"type,omitempty"`
}

EditAssetDomainDetails exposes a domain's type, used to scope the relation assignment lookup.

func GetDomainDetails added in v0.0.32

func GetDomainDetails(ctx context.Context, client *http.Client, domainID string) (*EditAssetDomainDetails, error)

GetDomainDetails fetches a domain including its domain type reference, used to scope the relation assignment lookup.

type EditAssetDomainRef added in v0.0.32

type EditAssetDomainRef struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

EditAssetDomainRef is a reference to a domain on an asset.

type EditAssetDomainTypeRef added in v0.0.32

type EditAssetDomainTypeRef struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

EditAssetDomainTypeRef is a reference to a domain type.

type EditAssetPatchAttributeRequest added in v0.0.32

type EditAssetPatchAttributeRequest struct {
	Value string `json:"value"`
}

EditAssetPatchAttributeRequest is the body for PATCH /rest/2.0/attributes/{id}.

type EditAssetPatchRequest added in v0.0.32

type EditAssetPatchRequest struct {
	Name        *string `json:"name,omitempty"`
	DisplayName *string `json:"displayName,omitempty"`
	StatusID    *string `json:"statusId,omitempty"`
}

EditAssetPatchRequest is the body for PATCH /rest/2.0/assets/{id} — only the fields allowed by update_property (name, displayName, statusId).

type EditAssetRelation added in v0.0.32

type EditAssetRelation struct {
	ID     string                     `json:"id"`
	Type   EditAssetTypeRef           `json:"type"`
	Source EditAssetAttributeAssetRef `json:"source"`
	Target EditAssetAttributeAssetRef `json:"target"`
}

EditAssetRelation is a relation instance between two assets.

func BulkCreateRelations added in v0.0.32

func BulkCreateRelations(ctx context.Context, client *http.Client, items []EditAssetCreateRelationRequest) ([]EditAssetRelation, error)

BulkCreateRelations creates multiple relations in one round trip via POST /rest/2.0/relations/bulk.

func CreateRelation added in v0.0.32

func CreateRelation(ctx context.Context, client *http.Client, payload EditAssetCreateRelationRequest) (*EditAssetRelation, error)

CreateRelation posts a new relation via POST /rest/2.0/relations. The source asset is the head; target is the tail.

type EditAssetResponsibility added in v0.0.32

type EditAssetResponsibility struct {
	ID         string `json:"id"`
	RoleID     string `json:"roleId,omitempty"`
	OwnerID    string `json:"ownerId,omitempty"`
	ResourceID string `json:"resourceId,omitempty"`
}

EditAssetResponsibility is a responsibility instance linking a role, an owner (user or group), and an asset.

func CreateResponsibility added in v0.0.32

func CreateResponsibility(ctx context.Context, client *http.Client, payload EditAssetCreateResponsibilityRequest) (*EditAssetResponsibility, error)

CreateResponsibility assigns a role to an owner for an asset via POST /rest/2.0/responsibilities. This is incremental — it doesn't replace other responsibilities on the asset.

type EditAssetRole added in v0.0.32

type EditAssetRole struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

EditAssetRole is a resource role (e.g. Steward, Owner) that can be assigned to an asset via responsibilities.

func ListRoles added in v0.0.32

func ListRoles(ctx context.Context, client *http.Client) ([]EditAssetRole, error)

ListRoles returns all resource roles defined in Collibra. Callers use this to resolve a role name (e.g. "Steward") to its UUID before creating a responsibility. The full list is typically small and fits in a single page.

type EditAssetStatus added in v0.0.32

type EditAssetStatus struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

EditAssetStatus is a status (e.g. Candidate, Accepted, Obsolete) that can be assigned to an asset via update_property statusId.

func ListStatuses added in v0.0.32

func ListStatuses(ctx context.Context, client *http.Client) ([]EditAssetStatus, error)

ListStatuses returns all asset statuses defined in Collibra. Used to resolve a status name (e.g. "Candidate") to its UUID before patching an asset.

type EditAssetStatusRef added in v0.0.32

type EditAssetStatusRef struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

EditAssetStatusRef is a reference to the asset's status.

type EditAssetTypeRef added in v0.0.32

type EditAssetTypeRef struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

EditAssetTypeRef is a reference to an asset type.

type EditAssetUser added in v0.0.32

type EditAssetUser struct {
	ID           string `json:"id"`
	UserName     string `json:"userName,omitempty"`
	EmailAddress string `json:"emailAddress,omitempty"`
	FirstName    string `json:"firstName,omitempty"`
	LastName     string `json:"lastName,omitempty"`
}

EditAssetUser is a Collibra user, used to resolve a username or email to the user's UUID before assigning responsibilities.

func FindUserByEmail added in v0.0.32

func FindUserByEmail(ctx context.Context, client *http.Client, email string) (*EditAssetUser, error)

FindUserByEmail returns the user with the given email address, or nil if none exists. It uses the dedicated exact-match endpoint; the list endpoint has no email filter, so an unknown `emailAddress` query param is silently ignored and would return an arbitrary user.

func FindUserByUsername added in v0.0.32

func FindUserByUsername(ctx context.Context, client *http.Client, username string) (*EditAssetUser, error)

FindUserByUsername returns the user whose username exactly matches, or nil if none exists. The /rest/2.0/users `name` filter is a loose partial search over username, first name and last name, so we scan the results for an exact (case-insensitive) username match rather than trusting the first row — otherwise an unrelated user could be returned and bound.

type Error

type Error struct {
	Message string        `json:"message"`
	Path    []interface{} `json:"path,omitempty"`
}

type GenerateContextResult added in v0.0.40

type GenerateContextResult struct {
	Content  string
	Metadata *GeneratedContextMetadata
}

GenerateContextResult carries the output of a context generation call. When includeMetadata is false, only Content is populated (raw YAML). When includeMetadata is true, Content is inside Metadata.Content and the full Metadata struct is populated.

func GenerateContext added in v0.0.40

func GenerateContext(
	ctx context.Context,
	collibraHttpClient *http.Client,
	assetId, contextSpecificationId string,
	includeMetadata bool,
) (*GenerateContextResult, error)

GenerateContext calls POST /rest/contextEngine/v1/contexts/generate. When includeMetadata is false the raw YAML is returned in Result.Content. When includeMetadata is true the JSON envelope is returned in Result.Metadata.

type GeneratedContextMetadata added in v0.0.40

type GeneratedContextMetadata struct {
	AssetId                  string               `json:"assetId"`
	ContextSpecificationId   string               `json:"contextSpecificationId"`
	ContextSpecificationName string               `json:"contextSpecificationName"`
	AssetType                ContextSpecAssetType `json:"assetType"`
	Content                  string               `json:"content"`
	GeneratedOn              string               `json:"generatedOn"`
}

GeneratedContextMetadata is the JSON envelope returned when includeMetadata=true.

type GetLineageDirectionalOutput added in v0.0.27

type GetLineageDirectionalOutput struct {
	EntityId   string                   `json:"entityId"`
	Direction  LineageDirection         `json:"direction"`
	Relations  []LineageRelation        `json:"relations"`
	Pagination *LineagePagination       `json:"pagination,omitempty"`
	Warnings   []LineageResponseWarning `json:"warnings,omitempty"`
	Error      string                   `json:"error,omitempty"`
}

func GetLineageDownstream added in v0.0.27

func GetLineageDownstream(ctx context.Context, collibraHttpClient *http.Client, entityId string, entityType string, limit int, cursor string) (*GetLineageDirectionalOutput, error)

func GetLineageUpstream added in v0.0.27

func GetLineageUpstream(ctx context.Context, collibraHttpClient *http.Client, entityId string, entityType string, limit int, cursor string) (*GetLineageDirectionalOutput, error)

type GetLineageEntityOutput added in v0.0.27

type GetLineageEntityOutput struct {
	Entity *LineageEntity `json:"entity,omitempty"`
	Error  string         `json:"error,omitempty"`
	Found  bool           `json:"found"`
}

func GetLineageEntity added in v0.0.27

func GetLineageEntity(ctx context.Context, collibraHttpClient *http.Client, entityId string) (*GetLineageEntityOutput, error)

type GetLineageTransformationOutput added in v0.0.27

type GetLineageTransformationOutput struct {
	Transformation *LineageTransformation `json:"transformation,omitempty"`
	Error          string                 `json:"error,omitempty"`
	Found          bool                   `json:"found"`
}

func GetLineageTransformation added in v0.0.27

func GetLineageTransformation(ctx context.Context, collibraHttpClient *http.Client, transformationId string) (*GetLineageTransformationOutput, error)

type IncomingRelation

type IncomingRelation struct {
	Type   *RelationType `json:"type,omitempty"`
	Source *RelatedAsset `json:"source,omitempty"`
}

type InitDataContractRequest added in v0.0.38

type InitDataContractRequest struct {
	GovernedAssetID string
	Manifest        string
	ManifestID      string
	Version         string
	Name            string
	DomainID        string
}

InitDataContractRequest represents the request parameters for initializing a data contract

type InitDataContractResponse added in v0.0.38

type InitDataContractResponse struct {
	ID              string                      `json:"id"`
	Name            string                      `json:"name"`
	ManifestID      string                      `json:"manifestId"`
	DomainName      string                      `json:"domainName"`
	DomainID        string                      `json:"domainId"`
	ActiveVersion   string                      `json:"activeVersion"`
	ManifestVersion DataContractManifestVersion `json:"manifestVersion"`
}

InitDataContractResponse represents the metadata for the newly created data contract version

func InitDataContract added in v0.0.38

func InitDataContract(ctx context.Context, collibraHttpClient *http.Client, reqParams InitDataContractRequest) (*InitDataContractResponse, error)

func ParseInitDataContractResponse added in v0.0.38

func ParseInitDataContractResponse(jsonData []byte) (*InitDataContractResponse, error)

type LineageDirection added in v0.0.27

type LineageDirection string
const (
	LineageDirectionUpstream   LineageDirection = "upstream"
	LineageDirectionDownstream LineageDirection = "downstream"
)

type LineageEntity added in v0.0.27

type LineageEntity struct {
	Id        string   `json:"id"`
	Name      string   `json:"name"`
	Type      string   `json:"type"`
	SourceIds []string `json:"sourceIds,omitempty"`
	DgcId     string   `json:"dgcId,omitempty"`
	ParentId  string   `json:"parentId,omitempty"`
}

func (*LineageEntity) UnmarshalJSON added in v0.0.27

func (e *LineageEntity) UnmarshalJSON(data []byte) error

UnmarshalJSON handles both plain string values and JsonNullable-wrapped objects for the DgcId and ParentId fields. The server may serialize JsonNullable<T> as {"present": false, "undefined": true} when JsonNullableModule is not on the classpath.

type LineagePagination added in v0.0.27

type LineagePagination struct {
	NextCursor string `json:"nextCursor,omitempty"`
}

type LineageRelation added in v0.0.27

type LineageRelation struct {
	SourceEntityId    string   `json:"sourceEntityId"`
	TargetEntityId    string   `json:"targetEntityId"`
	TransformationIds []string `json:"transformationIds"`
}

type LineageResponseWarning added in v0.0.27

type LineageResponseWarning struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type LineageTransformation added in v0.0.27

type LineageTransformation struct {
	Id                  string `json:"id"`
	Name                string `json:"name"`
	Description         string `json:"description,omitempty"`
	TransformationLogic string `json:"transformationLogic,omitempty"`
}

type ListAssessmentsParams added in v0.0.43

type ListAssessmentsParams struct {
	Name             string `url:"name,omitempty"`
	Status           string `url:"status,omitempty"`
	TemplateID       string `url:"templateId,omitempty"`
	TemplateVersion  string `url:"templateVersion,omitempty"`
	AssetID          string `url:"assetId,omitempty"`
	LastModifiedFrom string `url:"lastModifiedFrom,omitempty"`
	LastModifiedTo   string `url:"lastModifiedTo,omitempty"`
	Limit            int    `url:"limit,omitempty"`
	Cursor           string `url:"cursor,omitempty"`
}

ListAssessmentsParams are the query filters for listing assessments. All are optional and combine.

type ListTemplatesParams added in v0.0.43

type ListTemplatesParams struct {
	Name              string `url:"name,omitempty"`
	Status            string `url:"status,omitempty"`
	AssetTypeID       string `url:"assetTypeId,omitempty"`
	LatestVersionOnly *bool  `url:"latestVersionOnly,omitempty"`
	Limit             int    `url:"limit,omitempty"`
	Cursor            string `url:"cursor,omitempty"`
}

ListTemplatesParams are the query filters for listing templates.

type NamedResourceReference

type NamedResourceReference struct {
	ID                    string `json:"id"`
	ResourceType          string `json:"resourceType"`
	ResourceDiscriminator string `json:"resourceDiscriminator,omitempty"`
	Name                  string `json:"name"`
}

type NumericAttribute

type NumericAttribute struct {
	Value float64        `json:"numericValue"`
	Type  *AttributeType `json:"type,omitempty"`
}

type OutgoingRelation

type OutgoingRelation struct {
	Type   *RelationType `json:"type,omitempty"`
	Target *RelatedAsset `json:"target,omitempty"`
}

type PagedAssessments added in v0.0.43

type PagedAssessments struct {
	NextCursor string       `json:"nextCursor,omitempty"`
	Results    []Assessment `json:"results"`
}

PagedAssessments is a cursor-paged list of assessments.

func ListAssessments added in v0.0.43

func ListAssessments(ctx context.Context, client *http.Client, params ListAssessmentsParams) (*PagedAssessments, error)

ListAssessments lists assessments matching the given filters. Used to resolve an assessment from the asset it was conducted on (AssetID filter).

type PagedResponseDataClassificationMatch

type PagedResponseDataClassificationMatch struct {
	Total   int64                     `json:"total"`
	Offset  int64                     `json:"offset"`
	Limit   int64                     `json:"limit"`
	Results []DataClassificationMatch `json:"results"`
}

type PagedTemplates added in v0.0.43

type PagedTemplates struct {
	NextCursor string               `json:"nextCursor,omitempty"`
	Results    []AssessmentTemplate `json:"results"`
}

PagedTemplates is a cursor-paged list of templates.

func ListTemplates added in v0.0.43

func ListTemplates(ctx context.Context, client *http.Client, params ListTemplatesParams) (*PagedTemplates, error)

ListTemplates lists assessment templates matching the given filters.

type PrepareCreateAllowedDomainType added in v0.0.33

type PrepareCreateAllowedDomainType struct {
	ID   string
	Name string
}

PrepareCreateAllowedDomainType is one domain type an asset type can be created in. The set is deduped across all of an asset type's assignments (an asset type may be allowed in multiple domain types).

func ListAllowedDomainTypesForAssetType added in v0.0.33

func ListAllowedDomainTypesForAssetType(ctx context.Context, client *http.Client, assetTypeID string) ([]PrepareCreateAllowedDomainType, error)

ListAllowedDomainTypesForAssetType returns the deduped list of domain type IDs the asset type can be created in. Honouring Collibra's all-or-nothing inheritance, we stop at the first chain level that defines any explicit domain type: that level's own assignment governs the allowed domain types, and a parent's are not merged in. Subtypes whose own assignments have only empty domainTypes (inherit-sentinel) fall through to the parent — e.g. Acronym → Business Term → Glossary, Business Asset Domain.

type PrepareCreateAssetResult added in v0.0.29

type PrepareCreateAssetResult struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

PrepareCreateAssetResult represents an existing asset found during duplicate check.

func SearchAssetsForDuplicate added in v0.0.29

func SearchAssetsForDuplicate(ctx context.Context, client *http.Client, name string, assetTypeID string, domainID string) ([]PrepareCreateAssetResult, error)

SearchAssetsForDuplicate searches for existing assets by name, type, and domain.

type PrepareCreateAssetSearchResponse added in v0.0.29

type PrepareCreateAssetSearchResponse struct {
	Results []PrepareCreateAssetResult `json:"results"`
	Total   int                        `json:"total"`
}

PrepareCreateAssetSearchResponse is the response from searching assets.

type PrepareCreateAssetStatus added in v0.0.29

type PrepareCreateAssetStatus string

PrepareCreateAssetStatus represents the status of asset creation readiness.

const (
	StatusReady              PrepareCreateAssetStatus = "ready"
	StatusIncomplete         PrepareCreateAssetStatus = "incomplete"
	StatusNeedsClarification PrepareCreateAssetStatus = "needs_clarification"
	StatusDuplicateFound     PrepareCreateAssetStatus = "duplicate_found"
)

type PrepareCreateAssetType added in v0.0.29

type PrepareCreateAssetType struct {
	ID       string                  `json:"id"`
	PublicID string                  `json:"publicId"`
	Name     string                  `json:"name"`
	Parent   *PrepareCreateAssetType `json:"parent,omitempty"`
}

PrepareCreateAssetType represents an asset type from the API. Parent is populated by /assetTypes/{id} for subtypes (e.g. Acronym → Business Term) and is the key for walking the inheritance chain when the subtype's own scoped-assignment record has empty domainTypes (which Collibra uses as the "inherit from parent" sentinel).

func GetAssetTypeByID added in v0.0.33

func GetAssetTypeByID(ctx context.Context, client *http.Client, id string) (*PrepareCreateAssetType, error)

GetAssetTypeByID resolves an asset type by its UUID. Used as the first resolution strategy in the consolidated create_asset, before falling back to publicId or name search.

func GetAssetTypeByPublicID added in v0.0.29

func GetAssetTypeByPublicID(ctx context.Context, client *http.Client, publicID string) (*PrepareCreateAssetType, error)

GetAssetTypeByPublicID resolves an asset type by its publicId.

func GetAvailableAssetTypesForDomain added in v0.0.29

func GetAvailableAssetTypesForDomain(ctx context.Context, client *http.Client, domainID string) ([]PrepareCreateAssetType, error)

GetAvailableAssetTypesForDomain returns the asset types allowed in a given domain.

func ListAssetTypesForPrepare added in v0.0.29

func ListAssetTypesForPrepare(ctx context.Context, client *http.Client, limit int) ([]PrepareCreateAssetType, int, error)

ListAssetTypesForPrepare lists asset types, limited to the given count.

func SearchAssetTypesByName added in v0.0.33

func SearchAssetTypesByName(ctx context.Context, client *http.Client, name string, limit int) ([]PrepareCreateAssetType, int, error)

SearchAssetTypesByName queries /assetTypes?name=… and returns the matches up to the given limit. Collibra performs a case-insensitive substring match server-side, so callers should still verify exact equality if they only want exact matches.

type PrepareCreateAssetTypeListResponse added in v0.0.29

type PrepareCreateAssetTypeListResponse struct {
	Results []PrepareCreateAssetType `json:"results"`
	Total   int                      `json:"total"`
}

PrepareCreateAssetTypeListResponse is the response from listing asset types.

type PrepareCreateAttributeType added in v0.0.29

type PrepareCreateAttributeType struct {
	ID              string                    `json:"id"`
	Name            string                    `json:"name"`
	Kind            string                    `json:"kind"`
	Required        bool                      `json:"required"`
	Constraints     *PrepareCreateConstraints `json:"constraints,omitempty"`
	AllowedValues   []string                  `json:"allowedValues,omitempty"`
	Direction       string                    `json:"direction,omitempty"`
	TargetAssetType *PrepareCreateAssetType   `json:"targetAssetType,omitempty"`
}

PrepareCreateAttributeType represents an attribute type with full schema.

func GetAttributeTypeByID added in v0.0.29

func GetAttributeTypeByID(ctx context.Context, client *http.Client, attrTypeID string) (*PrepareCreateAttributeType, error)

GetAttributeTypeByID gets the full attribute type schema by ID.

type PrepareCreateAttributeTypeFull added in v0.0.33

type PrepareCreateAttributeTypeFull struct {
	ID            string   `json:"id"`
	Name          string   `json:"name"`
	PublicID      string   `json:"publicId"`
	Kind          string   `json:"attributeTypeDiscriminator"`
	StringType    string   `json:"stringType,omitempty"`
	Description   string   `json:"description,omitempty"`
	AllowedValues []string `json:"allowedValues,omitempty"`
}

PrepareCreateAttributeTypeFull is the full /attributeTypes/{id} response — includes StringType ("RICH_TEXT", "PLAIN_TEXT", etc.) which write tools use to decide whether to convert Markdown to HTML before submission.

func GetAttributeTypeFull added in v0.0.33

func GetAttributeTypeFull(ctx context.Context, client *http.Client, id string) (*PrepareCreateAttributeTypeFull, error)

GetAttributeTypeFull fetches /attributeTypes/{id} and decodes the full shape including stringType — needed for create_asset / edit_asset to gate Markdown→HTML conversion on RICH_TEXT attributes.

type PrepareCreateComplexRelationLeg added in v0.0.43

type PrepareCreateComplexRelationLeg struct {
	Role                 string
	CoRole               string
	RelationTypePublicID string
	AssetTypeID          string
	AssetTypeName        string
	Min                  int
	Max                  *int
}

PrepareCreateComplexRelationLeg is one leg of a complex relation type.

type PrepareCreateComplexRelationTypeFull added in v0.0.43

type PrepareCreateComplexRelationTypeFull struct {
	ID       string
	PublicID string
	Legs     []PrepareCreateComplexRelationLeg
}

PrepareCreateComplexRelationTypeFull is the subset of the /complexRelationTypes/{id} response we need. Unlike a simple relation type, a complex relation type has two or more legs, each with its own role and asset type, so there is no single role/coRole.

func GetComplexRelationTypeFull added in v0.0.43

func GetComplexRelationTypeFull(ctx context.Context, client *http.Client, id string) (*PrepareCreateComplexRelationTypeFull, error)

GetComplexRelationTypeFull fetches a complex relation type's legs from /rest/2.0/complexRelationTypes/{id}. Complex relation type ids are not resolvable via /relationTypes/{id} (that endpoint 404s for them), so relation slots whose Kind is "ComplexRelationType" hydrate here instead.

type PrepareCreateConstraints added in v0.0.29

type PrepareCreateConstraints struct {
	MinLength *int     `json:"minLength,omitempty"`
	MaxLength *int     `json:"maxLength,omitempty"`
	Min       *float64 `json:"min,omitempty"`
	Max       *float64 `json:"max,omitempty"`
}

PrepareCreateConstraints represents attribute validation constraints.

type PrepareCreateDomain added in v0.0.29

type PrepareCreateDomain struct {
	ID   string                   `json:"id"`
	Name string                   `json:"name"`
	Type *PrepareCreateDomainType `json:"type,omitempty"`
}

PrepareCreateDomain represents a domain from the API. Type is populated by the list and detail endpoints, but not by older callers that only decoded {id, name}; tolerate a missing type field there.

func GetDomainByID added in v0.0.29

func GetDomainByID(ctx context.Context, client *http.Client, domainID string) (*PrepareCreateDomain, error)

GetDomainByID gets a specific domain by its ID.

func ListDomainsForPrepare added in v0.0.29

func ListDomainsForPrepare(ctx context.Context, client *http.Client, limit int) ([]PrepareCreateDomain, int, error)

ListDomainsForPrepare lists domains, limited to the given count.

func SearchDomainsByName added in v0.0.33

func SearchDomainsByName(ctx context.Context, client *http.Client, name string, limit int) ([]PrepareCreateDomain, int, error)

SearchDomainsByName queries /domains?name=… and returns the matches up to the given limit. The list endpoint already includes the domain Type in each result, so callers that need to look up a scoped assignment can keep working from the result without an extra GET /domains/{id}.

type PrepareCreateDomainListResponse added in v0.0.29

type PrepareCreateDomainListResponse struct {
	Results []PrepareCreateDomain `json:"results"`
	Total   int                   `json:"total"`
}

PrepareCreateDomainListResponse is the response from listing domains.

type PrepareCreateDomainType added in v0.0.33

type PrepareCreateDomainType struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

PrepareCreateDomainType is a reference to a Collibra domain type — the scoped-assignment lookup keys off this ID to find the effective assignment for an asset type in a given domain.

type PrepareCreateRelationTypeFull added in v0.0.43

type PrepareCreateRelationTypeFull struct {
	ID       string `json:"id"`
	PublicID string `json:"publicId"`
	Role     string `json:"role"`
	CoRole   string `json:"coRole"`
}

PrepareCreateRelationTypeFull is the subset of the /relationTypes/{id} response we need. role/coRole are the human-readable leg names; they only exist on the relation type resource, not on the assignment, so relation slots are hydrated with them separately.

func GetRelationTypeFull added in v0.0.43

func GetRelationTypeFull(ctx context.Context, client *http.Client, id string) (*PrepareCreateRelationTypeFull, error)

GetRelationTypeFull fetches a relation type's role and coRole from /rest/2.0/relationTypes/{id}. These leg names are not part of the assignment payload, so relation slots are hydrated with them per id.

type PrepareCreateScopedAssignment added in v0.0.33

type PrepareCreateScopedAssignment struct {
	AssignmentID string
	Attributes   []PrepareCreateScopedAttribute
	Relations    []PrepareCreateScopedRelation
}

PrepareCreateScopedAssignment is the effective assignment for a given (assetType, domainType) pair: the union of the assignment's attribute slots and the relation slots that apply to assets of this type when created in domains of this type.

func GetScopedAssignment added in v0.0.33

func GetScopedAssignment(ctx context.Context, client *http.Client, assetTypeID, domainTypeID string) (*PrepareCreateScopedAssignment, error)

GetScopedAssignment returns the effective scoped assignment for an (assetType, domainType) pair, walking the asset type's parent chain when needed. Collibra's data model lets a subtype omit domainTypes on its own assignment (signalling "inherit from parent") and contribute its own characteristics on top — see Acronym → Business Term in OOTB glossary. The result here is the union of all chain levels' applicable characteristics, where applicable means the assignment either explicitly lists the target domainTypeID or has empty domainTypes (the inherit-sentinel). At least one level in the chain must explicitly include the target domain type, otherwise we return "not allowed" — empty-domainTypes-everywhere is not the same as "creatable everywhere".

type PrepareCreateScopedAttribute added in v0.0.33

type PrepareCreateScopedAttribute struct {
	AttributeTypeID       string
	AttributeTypeName     string
	AttributeTypePublicID string
	Kind                  string
	Required              bool
	Min                   int
	// Max is nil when there is no upper bound (i.e. unbounded).
	Max *int
	// FromOwnAssignment is true when the slot comes from the asset type's
	// own assignment (chain level 0), false when it was inherited from a
	// parent level (a sentinel subtype whose own assignment has empty
	// domainTypes still inherits its parent's characteristics). Required-ness
	// is only enforced at create time for the type's own assignment —
	// parent-level Required flags are informational, matching Core API/UI.
	FromOwnAssignment bool
}

PrepareCreateScopedAttribute is one attribute slot in a scoped assignment: what attribute type it refers to, whether it's required, and how many instances are allowed. Kind comes from the assignment's resourceDiscriminator (e.g. "StringAttributeType") so it's never empty for valid responses.

type PrepareCreateScopedRelation added in v0.0.33

type PrepareCreateScopedRelation struct {
	RelationTypeID       string
	RelationTypePublicID string
	// Kind is the assignment discriminator, e.g. "RelationType" or
	// "ComplexRelationType". It selects which resource endpoint hydrates the
	// leg detail (role/coRole live on different resources for the two).
	Kind   string
	Role   string
	CoRole string
	// Direction is "TO_TARGET" or "TO_SOURCE" — describing which side of the
	// relation the asset being created sits on (TO_TARGET means it is the
	// source leg and the relation points out to the target).
	Direction string
	// TargetType is the asset type on the other side of the relation. It is
	// only populated when the assignment restricts the other leg to a
	// specific type (relationTypeRestriction); many assignments do not.
	TargetType *PrepareCreateAssetType
}

PrepareCreateScopedRelation is one relation slot in a scoped assignment.

type PrepareCreateStatus added in v0.0.33

type PrepareCreateStatus struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

PrepareCreateStatus is one Collibra status value (e.g. "Candidate").

func ListStatusesAll added in v0.0.33

func ListStatusesAll(ctx context.Context, client *http.Client) ([]PrepareCreateStatus, error)

ListStatusesAll fetches every status value defined in the instance. Status counts are small (~30) and fit comfortably in a single page; the limit guard is just defensive.

type PrepareCreateStatusListResponse added in v0.0.33

type PrepareCreateStatusListResponse struct {
	Results []PrepareCreateStatus `json:"results"`
	Total   int                   `json:"total"`
}

PrepareCreateStatusListResponse is the paged response for /statuses.

type PushDataContractManifestRequest

type PushDataContractManifestRequest struct {
	Manifest   string
	ManifestID string
	Version    string
	Force      bool
	Active     bool
}

PushDataContractManifestRequest represents the request parameters for pushing a data contract manifest

type PushDataContractManifestResponse

type PushDataContractManifestResponse struct {
	ID         string `json:"id"`
	DomainID   string `json:"domainId"`
	ManifestID string `json:"manifestId"`
}

PushDataContractManifestResponse represents the response from pushing a data contract manifest

func ParseAddFromManifestResponse

func ParseAddFromManifestResponse(jsonData []byte) (*PushDataContractManifestResponse, error)

func PushDataContractManifest

func PushDataContractManifest(ctx context.Context, collibraHttpClient *http.Client, reqParams PushDataContractManifestRequest) (*PushDataContractManifestResponse, error)

type QuestionAndAnswer added in v0.0.43

type QuestionAndAnswer struct {
	ID          string  `json:"id"`
	Name        string  `json:"name,omitempty"`
	Description string  `json:"description,omitempty"`
	Answer      *Answer `json:"answer,omitempty"`
	Comments    string  `json:"comments,omitempty"`
}

QuestionAndAnswer is one question plus its current answer, as returned by GET.

type QuestionIDAndAnswer added in v0.0.43

type QuestionIDAndAnswer struct {
	ID       string  `json:"id"`
	Answer   *Answer `json:"answer,omitempty"`
	Comments *string `json:"comments,omitempty"`
}

QuestionIDAndAnswer is the write shape: a question id and the answer to set.

type RelatedAsset

type RelatedAsset struct {
	ID          string     `json:"id"`
	DisplayName string     `json:"displayName"`
	Type        *AssetType `json:"type,omitempty"`
}

type Relation added in v0.0.26

type Relation struct {
	ID     string        `json:"id"`
	Source RelationAsset `json:"source"`
	Target RelationAsset `json:"target"`
}

type RelationAsset added in v0.0.26

type RelationAsset struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	TypeName string `json:"typeName"`
}

type RelationType

type RelationType struct {
	ID   string `json:"id"`
	Role string `json:"role,omitempty"`
}

type RelationsQueryParams added in v0.0.26

type RelationsQueryParams struct {
	SourceID       string `url:"sourceId,omitempty"`
	TargetID       string `url:"targetId,omitempty"`
	RelationTypeID string `url:"relationTypeId,omitempty"`
	Limit          int    `url:"limit"`
}

type RelationsResponse added in v0.0.26

type RelationsResponse struct {
	Total   int        `json:"total"`
	Offset  int        `json:"offset"`
	Limit   int        `json:"limit"`
	Results []Relation `json:"results"`
}

func GetRelations added in v0.0.26

func GetRelations(ctx context.Context, client *http.Client, params RelationsQueryParams) (*RelationsResponse, error)

GetRelations queries the Collibra relations API.

type Request

type Request struct {
	Query     string                 `json:"query"`
	Variables map[string]interface{} `json:"variables,omitempty"`
}

func CreateAssetDetailsGraphQLQuery

func CreateAssetDetailsGraphQLQuery(
	assetIds []string,
	outgoingRelationsCursor string,
	incomingRelationsCursor string,
) Request

type ResourceRef added in v0.0.28

type ResourceRef struct {
	ID                    string `json:"id"`
	ResourceDiscriminator string `json:"resourceDiscriminator"`
}

ResourceRef represents a reference to a resource (user, group, community, etc.) in the API.

type ResourceRole added in v0.0.28

type ResourceRole struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

ResourceRole represents the role in a responsibility (e.g., Owner, Steward).

type Response

type Response struct {
	Data   *AssetQueryData `json:"data,omitempty"`
	Errors []Error         `json:"errors,omitempty"`
}

type Responsibility added in v0.0.28

type Responsibility struct {
	ID           string        `json:"id"`
	Role         *ResourceRole `json:"role,omitempty"`
	Owner        *ResourceRef  `json:"owner,omitempty"`
	BaseResource *ResourceRef  `json:"baseResource,omitempty"`
	System       bool          `json:"system"`
}

Responsibility represents a single responsibility assignment for an asset.

func GetResponsibilities added in v0.0.28

func GetResponsibilities(ctx context.Context, collibraHttpClient *http.Client, assetID string) ([]Responsibility, error)

GetResponsibilities fetches all responsibilities for the given asset ID, including inherited ones.

type ResponsibilityPagedResponse added in v0.0.28

type ResponsibilityPagedResponse struct {
	Total   int64            `json:"total"`
	Offset  int64            `json:"offset"`
	Limit   int64            `json:"limit"`
	Results []Responsibility `json:"results"`
}

ResponsibilityPagedResponse represents the paginated response from the responsibilities API.

type ResponsibilityQueryParams added in v0.0.28

type ResponsibilityQueryParams struct {
	ResourceIDs      string `url:"resourceIds,omitempty"`
	IncludeInherited bool   `url:"includeInherited,omitempty"`
	Limit            int    `url:"limit,omitempty"`
	Offset           int    `url:"offset,omitempty"`
}

ResponsibilityQueryParams defines the query parameters for the responsibilities API.

type SearchAggregation

type SearchAggregation struct {
	Field  string                   `json:"field"`
	Values []SearchAggregationValue `json:"values"`
}

type SearchAggregationValue

type SearchAggregationValue struct {
}

type SearchField

type SearchField struct {
	ResourceType string   `json:"resourceType"`
	Fields       []string `json:"fields,omitempty"`
}

type SearchFilter

type SearchFilter struct {
	Field  string   `json:"field"`
	Values []string `json:"values"`
}

type SearchHighlight

type SearchHighlight struct {
}

type SearchLineageEntitiesOutput added in v0.0.27

type SearchLineageEntitiesOutput struct {
	Results    []LineageEntity          `json:"results"`
	Pagination *LineagePagination       `json:"pagination,omitempty"`
	Warnings   []LineageResponseWarning `json:"warnings,omitempty"`
}

func SearchLineageEntities added in v0.0.27

func SearchLineageEntities(ctx context.Context, collibraHttpClient *http.Client, nameContains string, entityType string, dgcId string, limit int, cursor string) (*SearchLineageEntitiesOutput, error)

type SearchLineageTransformationsOutput added in v0.0.27

type SearchLineageTransformationsOutput struct {
	Results    []TransformationSummary  `json:"results"`
	Pagination *LineagePagination       `json:"pagination,omitempty"`
	Warnings   []LineageResponseWarning `json:"warnings,omitempty"`
}

func SearchLineageTransformations added in v0.0.27

func SearchLineageTransformations(ctx context.Context, collibraHttpClient *http.Client, nameContains string, limit int, cursor string) (*SearchLineageTransformationsOutput, error)

type SearchRequest

type SearchRequest struct {
	Keywords       string         `json:"keywords"`
	SearchInFields []SearchField  `json:"searchInFields,omitempty"`
	Filters        []SearchFilter `json:"filters,omitempty"`
	Limit          int            `json:"limit"`
	Offset         int            `json:"offset"`
}

SearchRequest represents the request payload for the Collibra search API

func CreateSearchRequest

func CreateSearchRequest(question string, resourceTypes []string, filters []SearchFilter, limit int, offset int) SearchRequest

type SearchResource

type SearchResource struct {
	ResourceType   string `json:"resourceType"`
	ID             string `json:"id"`
	CreatedBy      string `json:"createdBy"`
	CreatedOn      int64  `json:"createdOn"`
	LastModifiedOn int64  `json:"lastModifiedOn"`
	Name           string `json:"name"`
}

type SearchResponse

type SearchResponse struct {
	Total        int                 `json:"total"`
	Results      []SearchResult      `json:"results"`
	Aggregations []SearchAggregation `json:"aggregations"`
}

SearchResponse represents the response from the Collibra search API

func ParseSearchResponse

func ParseSearchResponse(jsonData []byte) (*SearchResponse, error)

func SearchKeyword

func SearchKeyword(ctx context.Context, collibraHttpClient *http.Client, question string, resourceTypes []string, filters []SearchFilter, limit int, offset int) (*SearchResponse, error)

type SearchResult

type SearchResult struct {
	Resource   SearchResource    `json:"resource"`
	Highlights []SearchHighlight `json:"highlights"`
}

type Status

type Status struct {
	Name string `json:"name"`
}

type StringAttribute

type StringAttribute struct {
	Value string         `json:"stringValue"`
	Type  *AttributeType `json:"type,omitempty"`
}

type ToolContent

type ToolContent struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

type ToolMessage

type ToolMessage struct {
	MessagerRole string      `json:"messagerRole"`
	Content      ToolContent `json:"content"`
	Context      ChatContext `json:"context"`
}

type ToolRequest

type ToolRequest struct {
	Message ToolMessage   `json:"message"`
	History []ToolMessage `json:"history"`
}

type ToolResponse

type ToolResponse struct {
	Content []ToolContent `json:"content"`
}

type TransformationSummary added in v0.0.27

type TransformationSummary struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
}

type UpdateAssessmentRequest added in v0.0.43

type UpdateAssessmentRequest struct {
	Name                   *string               `json:"name,omitempty"`
	Status                 *string               `json:"status,omitempty"`
	Owner                  *AssessmentRef        `json:"owner,omitempty"`
	Assignees              []Assignee            `json:"assignees,omitempty"`
	Content                []QuestionIDAndAnswer `json:"content,omitempty"`
	IsVisibleToEveryone    *bool                 `json:"isVisibleToEveryone,omitempty"`
	AssessmentReviewDomain *AssessmentRef        `json:"assessmentReviewDomain,omitempty"`
}

UpdateAssessmentRequest is the PATCH body. All fields optional (partial update); nil/omitted fields are left unchanged.

type UserGroupResponse added in v0.0.28

type UserGroupResponse struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

UserGroupResponse represents the response from the /rest/2.0/userGroups/{groupId} endpoint.

type UserResponse added in v0.0.28

type UserResponse struct {
	ID        string `json:"id"`
	UserName  string `json:"userName"`
	FirstName string `json:"firstName,omitempty"`
	LastName  string `json:"lastName,omitempty"`
}

UserResponse represents the response from the /rest/2.0/users/{userId} endpoint.

type VersionString added in v0.0.43

type VersionString string

VersionString holds a template version, which the API sends as a JSON number (e.g. 8) but occasionally as a string. It is a string type so the generated output schema ("string") matches the marshaled value; UnmarshalJSON accepts either form. Using json.Number here caused a schema/wire mismatch — the schema said "string" (json.Number's underlying kind) while it marshaled as a bare number, failing output validation.

func (*VersionString) UnmarshalJSON added in v0.0.43

func (v *VersionString) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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