Model

DearDiary.get_modelFunction
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.

source
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.

source
DearDiary.get_modelsFunction
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.

source
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.

source
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.

source
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.

source
DearDiary.create_modelFunction
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 nothing on failure.
  • An UpsertResult.
source
create_model(client::Client, project_id::Integer, name::AbstractString; description=nothing)::Int64

Register a Model under project_id via POST /model/project/{project_id}. Requires CreatePermission on the project. Returns the new model id.

source
DearDiary.update_modelFunction
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.

source
update_model(client::Client, id::Integer; name=nothing, description=nothing)::Nothing

Patch a Model via PATCH /model/{id}. Any keyword left as nothing is left untouched server-side. Requires UpdatePermission on the owning project.

source
DearDiary.delete_modelFunction
delete_model(id::Integer)::Bool

Delete 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.

source
delete_model(client::Client, id::Integer)::Nothing

Delete a Model (and cascade its ModelVersions) via DELETE /model/{id}. The underlying Resource artifacts are not removed. Requires DeletePermission on the owning project.

source