Documentation
¶
Index ¶
- Constants
- Variables
- func IsDuplicateCollectionIDError(err error) bool
- func IsDuplicateConceptIDError(err error) bool
- func IsDuplicateMappingError(err error) bool
- func IsDuplicateMnemonicError(err error) bool
- func IsDuplicateSourceIDError(err error) bool
- func NewDefaultHTTPClient() *http.Client
- func NewDefaultTransport() *http.Transport
- func ResourceNotFoundErr(err error) bool
- func ValidateStruct(input any) error
- type APIError
- type APIErrorResponse
- type Checksums
- type Client
- func (c *Client) CollectionExists(ctx context.Context, headers *Headers) (bool, error)
- func (c *Client) CreateCollection(ctx context.Context, collection *CollectionInput, headers *Headers) (*Collection, error)
- func (c *Client) CreateCollectionReference(ctx context.Context, collectionRef *CollectionReference, headers *Headers) (*CollectionReferenceAsyncResponse, error)
- func (c *Client) CreateCollectionVersion(ctx context.Context, input *CollectionVersionInput, headers *Headers) (*CollectionVersion, error)
- func (c *Client) CreateConcept(ctx context.Context, concept *Concept, headers *Headers) (*Concept, error)
- func (c *Client) CreateMappings(ctx context.Context, mappings *Mapping, headers *Headers) (*Mapping, error)
- func (c *Client) CreateOrganization(ctx context.Context, organization SimpleOrganizationInput) (*OrganizationOutput, error)
- func (c *Client) CreateSource(ctx context.Context, source *Source) (*Source, error)
- func (c *Client) CreateSourceVersion(ctx context.Context, headers *Headers, input *SourceVersionInput) (*SourceVersion, error)
- func (c *Client) DeleteOrganization(ctx context.Context, organizationID string) error
- func (c *Client) DeleteOrganizationSource(ctx context.Context, headers *Headers) error
- func (c *Client) DownloadVersionExport(ctx context.Context, headers *Headers) (io.ReadCloser, error)
- func (c *Client) FetchConcept(ctx context.Context, headers *Headers) (*Concept, error)
- func (c *Client) FetchConceptMappings(ctx context.Context, searchParams map[string]string, headers *Headers) ([]Mapping, error)
- func (c *Client) FetchMappings(ctx context.Context, searchParams map[string]string, headers *Headers) ([]Mapping, error)
- func (c *Client) GetAllCodeSystems(ctx context.Context, headers Headers) (*model.Bundle, error)
- func (c *Client) GetCodeSystem(ctx context.Context, headers Headers) (*model.CodeSystem, error)
- func (c *Client) GetCodeSystemVersion(ctx context.Context, cannonicalURL string, headers *Headers) (*model.Bundle, error)
- func (c *Client) GetCollection(ctx context.Context, headers *Headers) (*Collection, error)
- func (c *Client) GetOrganization(ctx context.Context, organizationID string) (*OrganizationOutput, error)
- func (c *Client) GetOrganizationSource(ctx context.Context, headers *Headers) (*Source, error)
- func (c *Client) GetValueSetVersion(ctx context.Context, canonicalURL string, headers *Headers) (*model.Bundle, error)
- func (c *Client) ListCollectionConcepts(ctx context.Context, headers *Headers, params url.Values) ([]*Concept, error)
- func (c *Client) ListConcepts(ctx context.Context, headers *Headers, params url.Values) ([]Concept, error)
- func (c *Client) ListSimpleConcepts(ctx context.Context, headers *Headers, params url.Values) ([]SimpleConcept, error)
- func (c *Client) ListSourceVersions(ctx context.Context, headers *Headers) ([]SourceVersion, error)
- func (c *Client) OrganizationExists(ctx context.Context, organizationID string) (bool, error)
- func (c *Client) ReleaseCollectionVersion(ctx context.Context, headers *Headers, input *ReleaseVersion) (*CollectionVersion, error)
- func (c *Client) RetireCollection(ctx context.Context, headers *Headers) error
- func (c *Client) RetireCollectionVersion(ctx context.Context, headers *Headers) error
- func (c *Client) RetireSourceVersion(ctx context.Context, headers *Headers) error
- func (c *Client) SearchCollectionConcepts(ctx context.Context, headers *Headers, params CollectionConceptSearchParams) ([]Concept, error)
- func (c *Client) SourceExists(ctx context.Context, headers *Headers) (bool, error)
- func (c *Client) UpdateCollection(ctx context.Context, input *CollectionInput, headers *Headers) (*Collection, error)
- func (c *Client) UpdateConcept(ctx context.Context, concept *Concept, headers *Headers) (*Concept, error)
- func (c *Client) UpdateMappings(ctx context.Context, mappings *Mapping, headers *Headers) (*Mapping, error)
- func (c *Client) UpdateOrganization(ctx context.Context, organization SimpleOrganizationInput) (*OrganizationOutput, error)
- func (c *Client) UpdateOrganizationSource(ctx context.Context, headers *Headers) (*Source, error)
- type ClientOption
- type Collection
- type CollectionConceptSearchParams
- type CollectionInput
- type CollectionReference
- type CollectionReferenceAsyncResponse
- type CollectionVersion
- type CollectionVersionInput
- type Concept
- type CreateSourceVersion
- type Descriptions
- type EditSourceVersion
- type Expression
- type Extras
- type Headers
- type Mapping
- type Names
- type OrganizationOutput
- type ReleaseVersion
- type RequestParameters
- type ResourceOperationTypeEnum
- type RetryPolicy
- type SearchHighlight
- type SearchMeta
- type SimpleConcept
- type SimpleOrganizationInput
- type Source
- type SourceVersion
- type SourceVersionInput
Constants ¶
const DefaultHTTPTimeout = 10 * time.Second
DefaultHTTPTimeout caps the wall-clock time of any single OCL request. It is intentionally tight because this SDK is typically used inside services serving live user traffic; failing fast under upstream stress is preferable to holding connections open for long periods.
Variables ¶
var ErrInvalidIdentifierInput = errors.New(
"invalid input identifiers: required IDs missing for operation",
)
Functions ¶
func IsDuplicateCollectionIDError ¶ added in v1.1.1
IsDuplicateCollectionIDError checks if an error is due to a duplicate Collection ID within a source.
func IsDuplicateConceptIDError ¶ added in v1.0.7
IsDuplicateConceptIDError checks if an error is due to a duplicate Concept ID within a source.
func IsDuplicateMappingError ¶ added in v1.14.0
IsDuplicateMappingError checks if an error is due to a duplicate Source ID within an organization.
func IsDuplicateMnemonicError ¶ added in v1.5.1
func IsDuplicateSourceIDError ¶ added in v1.11.0
IsDuplicateSourceIDError checks if an error is due to a duplicate Source ID within an organization.
func NewDefaultHTTPClient ¶ added in v1.34.0
NewDefaultHTTPClient returns an *http.Client built on NewDefaultTransport with DefaultHTTPTimeout. Use this as a starting point if you want to customize the client before passing it to WithHTTPClient.
func NewDefaultTransport ¶ added in v1.34.0
NewDefaultTransport returns an http.Transport tuned for server-side use of this SDK. The defaults that http.DefaultTransport ships with target CLI-style usage (MaxIdleConnsPerHost = 2), which causes connection-pool starvation in services that proxy high calls to OCL. Callers who need to customize the transport (e.g. wrap it with an OTel RoundTripper) can call this and mutate the returned value before passing it to WithHTTPClient.
func ResourceNotFoundErr ¶ added in v1.23.0
func ValidateStruct ¶ added in v1.5.0
Types ¶
type APIError ¶ added in v1.0.7
type APIError struct {
StatusCode int
RawBody string
Mnemonic string `json:"mnemonic"`
APIError APIErrorResponse
}
APIError represents a structured API error response.
type APIErrorResponse ¶ added in v1.0.7
type APIErrorResponse struct {
All []string `json:"__all__"`
}
APIErrorResponse represents the structure that an error message will be returned with.
type Client ¶
func NewClient ¶
func NewClient(baseURL string, token string, options ...ClientOption) (*Client, error)
NewClient creates a new ocl api client. The returned client uses a server-tuned HTTP transport by default (see NewDefaultTransport); use WithHTTPClient to override.
func NewClientFromEnvVars ¶
NewClientFromEnvVars creates a new client where the needed fields are retrieved from the environment variables.
func (*Client) CollectionExists ¶ added in v1.28.0
CollectionExists checks whether a collection exists in OCL and returns a boolean.
func (*Client) CreateCollection ¶ added in v1.1.0
func (c *Client) CreateCollection( ctx context.Context, collection *CollectionInput, headers *Headers, ) (*Collection, error)
func (*Client) CreateCollectionReference ¶ added in v1.2.0
func (c *Client) CreateCollectionReference( ctx context.Context, collectionRef *CollectionReference, headers *Headers, ) (*CollectionReferenceAsyncResponse, error)
func (*Client) CreateCollectionVersion ¶ added in v1.2.0
func (c *Client) CreateCollectionVersion( ctx context.Context, input *CollectionVersionInput, headers *Headers, ) (*CollectionVersion, error)
CreateCollectionVersion makes a POST request to /orgs/:org/collections/:collection/versions/:version/ to create a new collection version in OCL.
func (*Client) CreateConcept ¶
func (*Client) CreateMappings ¶ added in v1.7.0
func (*Client) CreateOrganization ¶ added in v1.5.0
func (c *Client) CreateOrganization( ctx context.Context, organization SimpleOrganizationInput, ) (*OrganizationOutput, error)
CreateOrganization is used to create an organization.
func (*Client) CreateSource ¶ added in v1.4.0
func (*Client) CreateSourceVersion ¶ added in v1.11.0
func (c *Client) CreateSourceVersion( ctx context.Context, headers *Headers, input *SourceVersionInput, ) (*SourceVersion, error)
CreateSourceVersion makes a POST request to /orgs/:org/sources/:source/versions/ to create a new source version in OCL
Parameters:
- Headers: this contains organization and source IDs.
- SourceVersionInput: this is the payload containing the fields to create source version in OCL.
Returns:
- SourceVersion if the operation succeeds.
- error if the operation fails.
func (*Client) DeleteOrganization ¶ added in v1.8.0
func (*Client) DeleteOrganizationSource ¶ added in v1.9.0
func (*Client) DownloadVersionExport ¶ added in v1.18.0
func (*Client) FetchConcept ¶ added in v1.17.0
func (*Client) FetchConceptMappings ¶ added in v1.33.0
func (*Client) FetchMappings ¶ added in v1.31.0
func (*Client) GetAllCodeSystems ¶ added in v1.24.0
GetAllCodeSystems retrieves all CodeSystems from an OCL organization.
Returns a FHIR Bundle containing the latest version of each CodeSystem. OCL API endpoint pattern: /orgs/{org}/CodeSystem.
func (*Client) GetCodeSystem ¶ added in v1.24.0
GetCodeSystem retrieves a single CodeSystem resource from the OCL FHIR service.
This method fetches a complete CodeSystem including all concepts, properties, and metadata from Open Concept Lab (OCL)
OCL API endpoint pattern: /orgs/{org}/CodeSystem/{source}.
func (*Client) GetCodeSystemVersion ¶ added in v1.24.0
func (c *Client) GetCodeSystemVersion( ctx context.Context, cannonicalURL string, headers *Headers, ) (*model.Bundle, error)
GetCodeSystemVersion retrieves a specific version of a CodeSystem from OCL.
Uses the canonical URL and version ID to fetch an exact CodeSystem version, which is useful for ensuring consistent terminology across deployments. OCL API endpoint pattern: /fhir/CodeSystem/{query_params}/*.
func (*Client) GetCollection ¶ added in v1.22.0
func (*Client) GetOrganization ¶ added in v1.7.2
func (*Client) GetOrganizationSource ¶ added in v1.22.0
func (*Client) GetValueSetVersion ¶ added in v1.26.0
func (c *Client) GetValueSetVersion( ctx context.Context, canonicalURL string, headers *Headers, ) (*model.Bundle, error)
GetValueSetVersion retrieves a specific version of a ValueSet from OCL. Uses the canonical URL and version ID to fetch an exact ValueSet version, OCL API endpoint pattern: /fhir/ValueSet/{query_params}/*.
func (*Client) ListCollectionConcepts ¶ added in v1.30.0
func (c *Client) ListCollectionConcepts( ctx context.Context, headers *Headers, params url.Values, ) ([]*Concept, error)
ListCollectionConcepts lists all concepts referenced in a collection. API: GET /orgs/:org/collections/:collection/[:version/]concepts/.
func (*Client) ListConcepts ¶ added in v1.17.0
func (*Client) ListSimpleConcepts ¶ added in v1.29.0
func (c *Client) ListSimpleConcepts(ctx context.Context, headers *Headers, params url.Values) ([]SimpleConcept, error)
ListSimpleConcepts searches for concepts and returns a simplified list with only ID and DisplayName.
func (*Client) ListSourceVersions ¶ added in v1.19.0
ListSourceVersions makes a GET request to /orgs/:org/sources/:source/:versions/ to list all versions of a source in OCL
Parameters:
- Headers: Contains organization, source and version IDs.
Returns:
- SourceVersion and a nil error if the operation succeeds.
- error if the operation fails.
func (*Client) OrganizationExists ¶ added in v1.27.0
OrganizationExists checks whether an organization exists in OCL and returns a boolean.
func (*Client) ReleaseCollectionVersion ¶ added in v1.11.0
func (c *Client) ReleaseCollectionVersion( ctx context.Context, headers *Headers, input *ReleaseVersion, ) (*CollectionVersion, error)
ReleaseCollectionVersion makes a POST request to /orgs/:org/collections/:collection/versions/:version/ to make a collection version release on OCL
Parameters:
- Headers: Contains organization, collection and version IDs.
- ReleaseVersion: this is the payload containing the fields to release the collection version in OCL.
Returns:
- CollectionVersion if the operation succeeds.
- error if the operation fails.
func (*Client) RetireCollection ¶ added in v1.10.0
func (*Client) RetireCollectionVersion ¶ added in v1.11.0
RetireCollectionVersion makes a DELETE request to /orgs/:org/collections/:collection/versions/:version/ to retire a collection version in OCL
Parameters:
- Headers: Contains organization, collection, and version IDs.
Returns:
- error if the operation fails
- no error if operation succeeds
func (*Client) RetireSourceVersion ¶ added in v1.11.0
RetireSourceVersion makes a DELETE request to /orgs/:org/sources/:source/:version/ to deactivate a source version on OCL
Parameters:
- Headers: Contains organization, source and version IDs.
Returns:
- nil if the operation succeeds.
- error if the operation fails.
func (*Client) SearchCollectionConcepts ¶ added in v1.32.0
func (c *Client) SearchCollectionConcepts( ctx context.Context, headers *Headers, params CollectionConceptSearchParams, ) ([]Concept, error)
SearchCollectionConcepts searches for concepts within an OCL collection expansion. This calls the endpoint: GET /orgs/:org/collections/:collection/HEAD/expansions/autoexpand-HEAD/concepts/.
func (*Client) SourceExists ¶ added in v1.28.0
SourceExists checks whether a source exists in OCL and returns a boolean.
func (*Client) UpdateCollection ¶ added in v1.10.0
func (c *Client) UpdateCollection(ctx context.Context, input *CollectionInput, headers *Headers) (*Collection, error)
func (*Client) UpdateConcept ¶ added in v1.3.0
func (*Client) UpdateMappings ¶ added in v1.14.0
func (*Client) UpdateOrganization ¶ added in v1.6.0
func (c *Client) UpdateOrganization( ctx context.Context, organization SimpleOrganizationInput, ) (*OrganizationOutput, error)
type ClientOption ¶
type ClientOption func(c *Client)
ClientOption allows customization of the client.
func WithHTTPClient ¶ added in v1.34.0
func WithHTTPClient(httpClient *http.Client) ClientOption
WithHTTPClient replaces the default HTTP client. Use this when you need to inject a custom transport (e.g. for tracing, mTLS, or testing). If you only need to tweak the default transport, prefer:
t := ocl.NewDefaultTransport()
t.MaxIdleConnsPerHost = 128
c, _ := ocl.NewClient(url, token, ocl.WithHTTPClient(&http.Client{
Transport: t,
Timeout: 10 * time.Second,
}))
A nil client is ignored so callers don't accidentally disable the SDK by passing through an unset value.
func WithRetry ¶ added in v1.35.0
func WithRetry(policy RetryPolicy) ClientOption
WithRetry installs a transport-level retry policy on the client. Retries wrap the existing transport, so they compose with WithHTTPClient and any tracing RoundTripper. Only idempotent methods (GET/HEAD/PUT/DELETE/OPTIONS by default) with replayable bodies are retried, on transient transport errors and the configured RetryableStatuses (default 408/429/5xx). Backoff honours the request context, so a caller's deadline still bounds the total time spent across attempts. The zero RetryPolicy is filled with sensible defaults (3 attempts, 100ms→5s jittered exponential backoff).
func WithTimeout ¶
func WithTimeout(t time.Duration) ClientOption
WithTimeout sets the total per-request wall-clock timeout enforced by the underlying http.Client. Callers using context-based deadlines should still keep this set as a defense-in-depth ceiling.
type Collection ¶ added in v1.1.0
type Collection struct {
Type string `json:"type,omitempty"`
UUID string `json:"uuid,omitempty"`
ID string `json:"id,omitempty"`
ExternalID string `json:"external_id,omitempty"`
ShortCode string `json:"short_code,omitempty"`
Name string `json:"name,omitempty"`
FullName string `json:"full_name,omitempty"`
CollectionType string `json:"collection_type,omitempty"`
PublicAccess string `json:"public_access,omitempty"`
SupportedLocales []string `json:"supported_locales,omitempty"`
Website string `json:"website,omitempty"`
Description string `json:"description,omitempty"`
PreferredSource string `json:"preferred_source,omitempty"`
Extras Extras `json:"extras,omitzero"`
Owner string `json:"owner,omitempty"`
OwnerType string `json:"owner_type,omitempty"`
OwnerURL string `json:"owner_url,omitempty"`
URL string `json:"url,omitempty"`
VersionsURL string `json:"versions_url,omitempty"`
ConceptsURL string `json:"concepts_url,omitempty"`
MappingsURL string `json:"mappings_url,omitempty"`
Versions int `json:"versions,omitempty"`
CreatedOn time.Time `json:"created_on,omitzero"`
CreatedBy string `json:"created_by,omitempty"`
UpdatedOn time.Time `json:"updated_on,omitzero"`
UpdatedBy string `json:"updated_by,omitempty"`
Released bool `json:"released,omitempty"`
CanonicalURL string `json:"canonical_url,omitempty"`
}
type CollectionConceptSearchParams ¶ added in v1.32.0
CollectionConceptSearchParams contains parameters for searching concepts in a collection expansion.
type CollectionInput ¶ added in v1.16.0
type CollectionInput struct {
ID string `json:"id,omitempty"`
ShortCode string `json:"short_code,omitempty"`
ExternalID string `json:"external_id,omitempty"`
Name string `json:"name,omitempty"`
FullName string `json:"full_name,omitempty"`
CollectionType string `json:"collection_type,omitempty"`
PublicAccess string `json:"public_access,omitempty"`
PreferredSource string `json:"preferred_source,omitempty"`
SupportedLocales []string `json:"supported_locales,omitempty"`
Website string `json:"website,omitempty"`
Description string `json:"description,omitempty"`
Extras Extras `json:"extras,omitzero"`
CanonicalURL string `json:"canonical_url,omitempty"`
}
type CollectionReference ¶ added in v1.2.0
type CollectionReference struct {
Data Expression `json:"data"`
}
type CollectionReferenceAsyncResponse ¶ added in v1.12.0
type CollectionVersion ¶ added in v1.2.0
type CollectionVersion struct {
Type string `json:"type,omitempty"`
ID string `json:"id,omitempty"`
ExternalID string `json:"external_id,omitempty"`
Released bool `json:"released,omitempty"`
Description string `json:"description,omitempty"`
URL string `json:"url,omitempty"`
CollectionURL string `json:"collection_url,omitempty"`
PreviousVersionURL string `json:"previous_version_url,omitempty"`
RootVersionURL string `json:"root_version_url,omitempty"`
Extras Extras `json:"extras"`
CreatedOn time.Time `json:"created_on,omitzero"`
CreatedBy string `json:"created_by,omitempty"`
UpdatedOn time.Time `json:"updated_on,omitzero"`
UpdatedBy string `json:"updated_by,omitempty"`
Collection Collection `json:"collection,omitzero"`
ExpansionURL string `json:"expansion_url,omitempty"`
AutoExpand bool `json:"autoexpand,omitempty"`
Owner string `json:"owner,omitempty"`
}
type CollectionVersionInput ¶ added in v1.11.0
type Concept ¶
type Concept struct {
UUID string `json:"uuid,omitempty"`
Extras map[string]any `json:"extras,omitempty"`
Mappings []Mapping `json:"mappings,omitempty"`
Checksums map[string]any `json:"checksums,omitempty"`
ID string `json:"id,omitempty"`
ExternalID string `json:"external_id,omitempty"`
ConceptClass string `json:"concept_class,omitempty"`
Datatype string `json:"datatype,omitempty"`
URL string `json:"url,omitempty"`
Retired bool `json:"retired,omitempty"`
Source string `json:"source,omitempty"`
Owner string `json:"owner,omitempty"`
OwnerType string `json:"owner_type,omitempty"`
OwnerURL string `json:"owner_url,omitempty"`
DisplayName string `json:"display_name,omitempty"`
DisplayLocale string `json:"display_locale,omitempty"`
Locale *string `json:"locale,omitempty"`
Names []Names `json:"names,omitempty"`
Descriptions []Descriptions `json:"descriptions,omitempty"`
CreatedOn time.Time `json:"created_on,omitzero"`
UpdatedOn time.Time `json:"updated_on,omitzero"`
VersionsURL string `json:"versions_url,omitempty"`
Version string `json:"version,omitempty"`
ParentID string `json:"parent_id,omitempty"`
Type string `json:"type,omitempty"`
UpdateComment string `json:"update_comment,omitempty"`
VersionURL string `json:"version_url,omitempty"`
UpdatedBy string `json:"updated_by,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
PublicCanView bool `json:"public_can_view,omitempty"`
VersionedObjectID int `json:"versioned_object_id,omitempty"`
LatestSourceVersion string `json:"latest_source_version,omitempty"`
VersionCreatedBy string `json:"version_created_by,omitempty"`
VersionCreatedOn time.Time `json:"version_created_on,omitzero"`
VersionUpdatedBy string `json:"version_updated_by,omitempty"`
VersionUpdatedOn time.Time `json:"version_updated_on,omitzero"`
IsLatestVersion bool `json:"is_latest_version,omitempty"`
SearchMeta *SearchMeta `json:"search_meta,omitempty"`
Property []any `json:"property,omitempty"`
}
type CreateSourceVersion ¶ added in v1.11.0
type CreateSourceVersion struct {
VersionID string `json:"id"`
SourceVersion SourceVersion
}
type Descriptions ¶
type Descriptions struct {
UUID string `json:"uuid,omitempty"`
Description string `json:"description,omitempty"`
ExternalID string `json:"external_id,omitempty"`
Type string `json:"type,omitempty"`
Locale string `json:"locale,omitempty"`
DescriptionType string `json:"description_type,omitempty"`
Checksum string `json:"checksum,omitempty"`
}
type EditSourceVersion ¶ added in v1.11.0
type EditSourceVersion struct {
SourceVersion
}
type Expression ¶ added in v1.12.0
type Expression struct {
Expression []string `json:"expressions,omitempty"`
}
type Headers ¶ added in v1.0.1
type Headers struct {
Organisation string `json:"organisation,omitempty"`
Source string `json:"source,omitempty"`
Collection string `json:"collection,omitempty"`
ConceptID string `json:"concept,omitempty"`
VersionID string `json:"version_id,omitempty"`
MappingID string `json:"mapping,omitempty"`
}
Headers represents the custom headers sent to the client. In OCL, concepts are namespaced with Organisations and sources e.g You can have WHO as an org, and many sources within that org e.g ICD-10, ICD-11.
The idea is that the client should send the source, org, collection, concept as headers so that the library will correctly create the API URL.
type Mapping ¶ added in v1.13.1
type Mapping struct {
Extras Extras `json:"extras,omitzero"`
Checksums Checksums `json:"checksums,omitzero"`
ExternalID any `json:"external_id,omitempty"`
Retired bool `json:"retired,omitempty"`
MapType string `json:"map_type,omitempty"`
Source string `json:"source,omitempty"`
Owner string `json:"owner,omitempty"`
OwnerType string `json:"owner_type,omitempty"`
FromConceptCode string `json:"from_concept_code,omitempty"`
FromConceptName any `json:"from_concept_name,omitempty"`
FromConceptURL string `json:"from_concept_url,omitempty"`
ToConceptCode string `json:"to_concept_code,omitempty"`
ToConceptName any `json:"to_concept_name,omitempty"`
ToConceptURL string `json:"to_concept_url,omitempty"`
FromSourceOwner string `json:"from_source_owner,omitempty"`
FromSourceOwnerType string `json:"from_source_owner_type,omitempty"`
FromSourceURL string `json:"from_source_url,omitempty"`
FromSourceName string `json:"from_source_name,omitempty"`
ToSourceOwner string `json:"to_source_owner,omitempty"`
ToSourceOwnerType string `json:"to_source_owner_type,omitempty"`
ToSourceURL string `json:"to_source_url,omitempty"`
ToSourceName string `json:"to_source_name,omitempty"`
URL string `json:"url,omitempty"`
Version string `json:"version,omitempty"`
ID string `json:"id,omitempty"`
VersionedObjectID int `json:"versioned_object_id,omitempty"`
VersionedObjectURL string `json:"versioned_object_url,omitempty"`
IsLatestVersion bool `json:"is_latest_version,omitempty"`
UpdateComment any `json:"update_comment,omitempty"`
VersionURL string `json:"version_url,omitempty"`
UUID string `json:"uuid,omitempty"`
VersionCreatedOn time.Time `json:"version_created_on,omitzero"`
FromSourceVersion any `json:"from_source_version,omitempty"`
ToSourceVersion any `json:"to_source_version,omitempty"`
FromConceptNameResolved string `json:"from_concept_name_resolved,omitempty"`
ToConceptNameResolved string `json:"to_concept_name_resolved,omitempty"`
Type string `json:"type,omitempty"`
SortWeight any `json:"sort_weight,omitempty"`
VersionUpdatedOn time.Time `json:"version_updated_on,omitzero"`
VersionUpdatedBy string `json:"version_updated_by,omitempty"`
LatestSourceVersion any `json:"latest_source_version,omitempty"`
CreatedOn time.Time `json:"created_on,omitzero"`
UpdatedOn time.Time `json:"updated_on,omitzero"`
CreatedBy string `json:"created_by,omitempty"`
UpdatedBy string `json:"updated_by,omitempty"`
PublicCanView bool `json:"public_can_view,omitempty"`
}
func (*Mapping) ConstructFromConceptURL ¶ added in v1.20.2
func (*Mapping) ConstructToConceptURL ¶ added in v1.20.2
type Names ¶
type Names struct {
UUID string `json:"uuid,omitempty"`
Name string `json:"name,omitempty"`
ExternalID string `json:"external_id,omitempty"`
Type string `json:"type,omitempty"`
Locale string `json:"locale,omitempty"`
NameType string `json:"name_type,omitempty"`
Checksum string `json:"checksum,omitempty"`
}
type OrganizationOutput ¶ added in v1.5.0
type OrganizationOutput struct {
Type string `json:"type,omitempty"`
UUID string `json:"uuid,omitempty"`
ID string `json:"id,omitempty"`
PublicAccess string `json:"public_access,omitempty"`
Name string `json:"name,omitempty"`
Company string `json:"company,omitempty"`
Website string `json:"website,omitempty"`
Location string `json:"location,omitempty"`
Members int `json:"members,omitempty"`
CreatedOn time.Time `json:"created_on,omitzero"`
UpdatedOn time.Time `json:"updated_on,omitzero"`
URL string `json:"url,omitempty"`
Extras any `json:"extras,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
UpdatedBy string `json:"updated_by,omitempty"`
SourcesURL string `json:"sources_url,omitempty"`
PublicSources int `json:"public_sources,omitempty"`
CollectionsURL string `json:"collections_url,omitempty"`
PublicCollections int `json:"public_collections,omitempty"`
LogoURL any `json:"logo_url,omitempty"`
Description any `json:"description,omitempty"`
Text any `json:"text,omitempty"`
}
type ReleaseVersion ¶ added in v1.11.0
type RequestParameters ¶ added in v1.11.0
type RequestParameters struct {
OrganisationID *string
SourceID *string
CollectionID *string
VersionID *string
}
RequestParameters is a single struct to hold all possible input.
type ResourceOperationTypeEnum ¶ added in v1.11.0
type ResourceOperationTypeEnum string
const ( CreateCollectionOperation ResourceOperationTypeEnum = "CREATE_COLLECTION" DeleteCollectionOperation ResourceOperationTypeEnum = "DELETE_COLLECTION" UpdateCollectionOperation ResourceOperationTypeEnum = "UPDATE_COLLECTION" CreateCollectionVersionOperation ResourceOperationTypeEnum = "CREATE_COLLECTION_VERSION" ReleaseCollectionVersionOperation ResourceOperationTypeEnum = "RELEASE_COLLECTION_VERSION" RetireCollectionVersionOperation ResourceOperationTypeEnum = "RETIRE_COLLECTION_VERSION" DeleteSourceOrgOperation ResourceOperationTypeEnum = "DELETE_SOURCE" UpdateSourceOrgOperation ResourceOperationTypeEnum = "UPDATE_SOURCE" CreateSourceVersionOperation ResourceOperationTypeEnum = "CREATE_SOURCE_VERSION" ReleaseSourceVersionOperation ResourceOperationTypeEnum = "RELEASE_SOURCE_VERSION" RetireSourceVersionOperation ResourceOperationTypeEnum = "RETIRE_SOURCE_VERSION" )
type RetryPolicy ¶ added in v1.35.0
type RetryPolicy struct {
// MaxAttempts is the total number of attempts including the first call.
// A value of 1 means no retry. Zero/negative is treated as 3.
MaxAttempts int
// InitialBackoff is the wait before the first retry. Defaults to 100ms.
InitialBackoff time.Duration
// MaxBackoff caps the wait between any two attempts. Defaults to 5s.
MaxBackoff time.Duration
// BackoffMultiplier controls exponential growth. Defaults to 2.0.
BackoffMultiplier float64
// Jitter, in [0,1), randomises each computed backoff to spread retries.
// 0.2 means actual wait is in [0.8*backoff, 1.2*backoff]. Defaults to 0.2.
Jitter float64
// RetryableStatuses are HTTP status codes that trigger a retry.
// Defaults to 408, 429, 500, 502, 503, 504.
RetryableStatuses []int
// RetryableMethods are HTTP methods that may be retried.
// Defaults to GET, HEAD, PUT, DELETE, OPTIONS.
// POST and PATCH are excluded because OCL create/update are not idempotent.
RetryableMethods []string
// RespectRetryAfter, when true, makes the policy wait for the duration
// advertised by a Retry-After response header (overrides backoff for
// that attempt) before retrying. Defaults to true.
RespectRetryAfter bool
}
RetryPolicy controls how the client retries failed requests. See WithRetry.
Retries are applied at the transport layer, below makeRequest, so a retryable upstream response (e.g. a transient 503) is replayed transparently and only the final response surfaces to callers.
type SearchHighlight ¶ added in v1.29.0
type SearchHighlight struct {
Name []string `json:"name,omitempty"`
Description []string `json:"description,omitempty"`
Synonyms []string `json:"synonyms,omitempty"`
}
SearchHighlight contains highlighted search matches.
type SearchMeta ¶ added in v1.29.0
type SearchMeta struct {
SearchScore float64 `json:"search_score,omitempty"`
SearchConfidence string `json:"search_confidence,omitempty"`
SearchHighlight *SearchHighlight `json:"search_highlight,omitempty"`
}
SearchMeta contains search relevance information returned when searching concepts.
type SimpleConcept ¶ added in v1.29.0
SimpleConcept is a minimal representation of a concept with only ID and DisplayName.
type SimpleOrganizationInput ¶ added in v1.5.0
type SimpleOrganizationInput struct {
ID string `json:"id" validate:"required"`
PublicAccess string `json:"public_access" validate:"required"`
Name string `json:"name" validate:"required"`
Company string `json:"company" validate:"required"`
Website string `json:"website" validate:"required"`
Location string `json:"location,omitempty"`
Extras any `json:"extras,omitempty"`
Description string `json:"description,omitempty"`
Text string `json:"text,omitempty"`
}
SimpleOrganizationInput is a simple model used to create an Organization in advantage.
type Source ¶ added in v1.4.0
type Source struct {
Type string `json:"type,omitempty"`
UUID string `json:"uuid,omitempty"`
ID string `json:"id,omitempty"`
ShortCode string `json:"short_code,omitempty"`
Name string `json:"name,omitempty"`
FullName string `json:"full_name,omitempty"`
Description string `json:"description,omitempty"`
SourceType string `json:"source_type,omitempty"`
CustomValidationSchema string `json:"custom_validation_schema,omitempty"`
PublicAccess string `json:"public_access,omitempty"`
DefaultLocale string `json:"default_locale,omitempty"`
SupportedLocales []string `json:"supported_locales,omitempty"`
Website string `json:"website,omitempty"`
URL string `json:"url,omitempty"`
Owner string `json:"owner,omitempty"`
OwnerType string `json:"owner_type,omitempty"`
OwnerURL string `json:"owner_url,omitempty"`
CreatedOn time.Time `json:"created_on,omitzero"`
UpdatedOn time.Time `json:"updated_on,omitzero"`
CreatedBy string `json:"created_by,omitempty"`
UpdatedBy string `json:"updated_by,omitempty"`
Extras Extras `json:"extras,omitzero"`
ExternalID any `json:"external_id,omitempty"`
VersionsURL string `json:"versions_url,omitempty"`
Version string `json:"version,omitempty"`
ConceptsURL string `json:"concepts_url,omitempty"`
MappingsURL string `json:"mappings_url,omitempty"`
CanonicalURL string `json:"canonical_url,omitempty"`
Publisher any `json:"publisher,omitempty"`
Purpose any `json:"purpose,omitempty"`
Copyright any `json:"copyright,omitempty"`
ContentType any `json:"content_type,omitempty"`
RevisionDate any `json:"revision_date,omitempty"`
LogoURL any `json:"logo_url,omitempty"`
Text any `json:"text,omitempty"`
ClientConfigs []any `json:"client_configs,omitempty"`
Experimental any `json:"experimental,omitempty"`
CaseSensitive any `json:"case_sensitive,omitempty"`
CollectionReference any `json:"collection_reference,omitempty"`
HierarchyMeaning any `json:"hierarchy_meaning,omitempty"`
Compositional any `json:"compositional,omitempty"`
VersionNeeded any `json:"version_needed,omitempty"`
HierarchyRootURL any `json:"hierarchy_root_url,omitempty"`
Meta any `json:"meta,omitempty"`
}
type SourceVersion ¶ added in v1.11.0
type SourceVersion struct {
ID string `json:"id,omitempty"`
ExternalID string `json:"external_id,omitempty"`
Released bool `json:"released,omitempty"`
Description string `json:"description,omitempty"`
URL string `json:"url,omitempty"`
SourceURL string `json:"source_url,omitempty"`
ParentVersionURL string `json:"parent_version,omitempty"`
PreviousVersionURL string `json:"previous_version_url,omitempty"`
RootVersionURL string `json:"root_version_url,omitempty"`
Extras Extras `json:"extras"`
CreatedOn time.Time `json:"created_on,omitzero"`
CreatedBy string `json:"created_by,omitempty"`
UpdatedOn time.Time `json:"updated_on,omitzero"`
UpdatedBy string `json:"updated_by,omitempty"`
Source Source `json:"source"`
VersionsURL string `json:"versions_url,omitempty"`
ConceptsURL string `json:"concepts_url,omitempty"`
MappingsURL string `json:"mappings_url,omitempty"`
CanonicalURL string `json:"canonical_url,omitempty"`
}