ProjectRef
Opaque project handle returned by SDKClient.project() — carries only the project ID.
ProjectRef is a frozen dataclass that carries exactly one piece of information: a project's string ID. It is deliberately minimal.
from optixlog import ProjectRefWhy ProjectRef exposes only id
You might expect a project handle to expose methods like .ingest(...) or .teams.list(...). It does not, by design.
The ingest and management capabilities are provided by separate view classes (Pipeline and Management) that you construct from an SDKClient. This separation means:
- You can pass a
ProjectRefaround your codebase without accidentally pulling in a network-capable object. - The generated
OptixClient(fromoptixlog generate) can wrap the pipeline capability with per-project type safety without modifyingProjectRefitself. ProjectRefis safe to store, serialize, or compare — it is a pure value.
To get a capability view, pass the ref to Pipeline.project_from() or Management.project_from():
from optixlog import SDKClient
from optixlog.pipeline import Pipeline
from optixlog.management import Management
client = SDKClient(base_url="https://optixlog.leidos.com", api_key="sk-opt-...")
ref = client.project("proj_grating_7f3a")
# Pipeline view
pipeline_project = Pipeline(client).project_from(ref)
# Management view
mgmt_project = Management(client).project_from(ref)ProjectRef fields
Signature
@dataclass(frozen=True)
class ProjectRef:
id: strFields
Prop
Type
Because ProjectRef is frozen=True, all fields are read-only after construction. Equality and hashing are value-based (two ProjectRef objects with the same id are equal).
Example
from optixlog import ProjectRef
ref = ProjectRef(id="proj_grating_7f3a")
print(ref.id) # proj_grating_7f3a
print(ref) # ProjectRef(id='proj_grating_7f3a')
# Equality is value-based
assert ProjectRef(id="proj_grating_7f3a") == ProjectRef(id="proj_grating_7f3a")