Model
DearDiary.get_model — Function
get_model(id::Integer)::Optional{Model}Get a Model by id.
Arguments
id::Integer: The id of the model to query.
Returns
A Model object. If the record does not exist, return nothing.
get_model(client::Client, id::Integer)::Optional{Model}Fetch a Model via GET /model/{id}. Returns nothing when the server replies 404 (record missing or viewer lacks ReadPermission on the owning project) and raises ClientError for other failures.
DearDiary.get_models — Function
get_models(project_id::Integer)::Array{Model, 1}Get all Model records registered under a given project.
Arguments
project_id::Integer: The id of the project to query.
Returns
An array of Model objects.
get_models(project_id::Integer, page::Pagination)::PaginatedResponse{Model}Get a page of Model records for a project, with total count populated.
Arguments
project_id::Integer: The id of the project to query.page::Pagination: The page bounds (limit + offset).
Returns
A PaginatedResponse of Model.
get_models(client::Client, project_id::Integer)::Array{Model,1}Convenience wrapper around the paged form: returns the first page (default limit) of Model records under project_id and discards the pagination envelope.
get_models(client::Client, project_id::Integer, page::Pagination)::PaginatedResponse{Model}Fetch a page of Model records under project_id via GET /model/project/{project_id}?limit=…&offset=…. Requires ReadPermission on the project.
DearDiary.create_model — Function
create_model(project_id::Integer, name::AbstractString)::NamedTuple{id::Optional{<:Int64},status::DataType}Register a new Model under project_id.
The name must be unique within the project; a collision returns Duplicate instead of Created. Registration against a non-existent project returns Unprocessable.
Arguments
project_id::Integer: The id of the project that owns the model.name::AbstractString: The registry name of the model.
Returns
- The created model id, or
nothingon failure. - An
UpsertResult.
create_model(client::Client, project_id::Integer, name::AbstractString; description=nothing)::Int64Register a Model under project_id via POST /model/project/{project_id}. Requires CreatePermission on the project. Returns the new model id.
DearDiary.update_model — Function
update_model(id::Integer, name::Optional{AbstractString}, description::Optional{AbstractString})::Type{<:UpsertResult}Update a Model's mutable fields. Any keyword left as nothing is left untouched.
Arguments
id::Integer: The id of the model to update.name::Optional{AbstractString}: The new registry name.description::Optional{AbstractString}: The new description.
Returns
An UpsertResult.
update_model(client::Client, id::Integer; name=nothing, description=nothing)::NothingPatch a Model via PATCH /model/{id}. Any keyword left as nothing is left untouched server-side. Requires UpdatePermission on the owning project.
DearDiary.delete_model — Function
delete_model(id::Integer)::BoolDelete a Model and cascade every ModelVersion under it. The underlying Resource artifacts referenced by those versions are not removed — model deletion does not own the artifact bytes, only the registry rows.
Arguments
id::Integer: The id of the model to delete.
Returns
true on success, false otherwise.
delete_model(client::Client, id::Integer)::NothingDelete a Model (and cascade its ModelVersions) via DELETE /model/{id}. The underlying Resource artifacts are not removed. Requires DeletePermission on the owning project.