Experiment

DearDiary.get_experimentFunction
get_experiment(id::Integer)::Optional{Experiment}

Get a Experiment by id.

Arguments

  • id::Integer: The id of the experiment to query.

Returns

A Experiment object. If the record does not exist, return nothing.

source
get_experiment(client::Client, id::Integer)::Optional{Experiment}

Fetch an Experiment via GET /experiment/{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_experimentsFunction
get_experiments(project_id::Integer)::Array{Experiment, 1}

Get all Experiment for a given project.

Arguments

  • project_id::Integer: The id of the project to query.

Returns

An array of Experiment objects.

source
get_experiments(project_id::Integer, page::Pagination)::PaginatedResponse{Experiment}

Get a page of Experiment 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 Experiment.

source
get_experiments(client::Client, project_id::Integer)::Array{Experiment,1}

Convenience wrapper around the paged form: returns the first page (default limit) of Experiment records under project_id and discards the pagination envelope.

source
get_experiments(client::Client, project_id::Integer, page::Pagination)::PaginatedResponse{Experiment}

Fetch a page of Experiment records under project_id via GET /experiment/project/{project_id}?limit=…&offset=…. Requires ReadPermission on the project.

source
DearDiary.create_experimentFunction
create_experiment(project_id::Integer, status_id::Integer, name::AbstractString)::NamedTuple{id::Optional{<:Int64},status::DataType}

Create a Experiment.

Arguments

  • project_id::Integer: The id of the project to create the experiment for.
  • status_id::Integer: The status of the experiment.
  • name::AbstractString: The name of the experiment.

Returns

  • The created experiment ID. If an error occurs, nothing is returned.
  • An UpsertResult. Created if the record was successfully created, Duplicate if the record already exists, Unprocessable if the record violates a constraint, and Error if an error occurred while creating the record.
source
create_experiment(project_id::Integer, status::ExperimentStatus, name::AbstractString)::NamedTuple{id::Optional{<:Int64},status::DataType}

Create a Experiment.

Arguments

  • project_id::Integer: The id of the project to create the experiment for.
  • status::ExperimentStatus: The status of the experiment.
  • name::AbstractString: The name of the experiment.

Returns

  • The created experiment ID. If an error occurs, nothing is returned.
  • An UpsertResult. Created if the record was successfully created, Duplicate if the record already exists, Unprocessable if the record violates a constraint, and Error if an error occurred while creating the record.
source
create_experiment(client::Client, project_id::Integer, status_id::Integer, name::AbstractString)::Int64

Create an Experiment under project_id via POST /experiment/project/{project_id}. status_id must equal Integer(IN_PROGRESS) — the server rejects experiments that are created already terminated. Requires CreatePermission on the project. Returns the new experiment id.

source
create_experiment(client::Client, project_id::Integer, status::ExperimentStatus, name::AbstractString)::Int64

ExperimentStatus-typed overload of create_experiment. The server only accepts IN_PROGRESS; the other variants exist for symmetry with the local API.

source
DearDiary.update_experimentFunction
update_experiment(id::Integer, status_id::Optional{Integer}, name::Optional{AbstractString}, description::Optional{AbstractString}, end_date::Optional{DateTime})::Type{<:UpsertResult}

Update a Experiment record.

Arguments

  • id::Integer: The id of the experiment to update.
  • status_id::Optional{Integer}: The new status of the experiment.
  • name::Optional{AbstractString}: The new name of the experiment.
  • description::Optional{AbstractString}: The new description of the experiment.
  • end_date::Optional{DateTime}: The new end date of the experiment.

Returns

An UpsertResult. Updated if the record was successfully updated (or no changes were made), Duplicate if the record already exists, Unprocessable if the record violates a constraint, and Error if an error occurred while creating the record.

source
update_experiment(id::Integer, status::ExperimentStatus, name::Optional{AbstractString}, description::Optional{AbstractString}, end_date::Optional{DateTime})::Type{<:UpsertResult}

Update a Experiment record.

Arguments

  • id::Integer: The id of the experiment to update.
  • status::ExperimentStatus: The new status of the experiment.
  • name::Optional{AbstractString}: The new name of the experiment.
  • description::Optional{AbstractString}: The new description of the experiment.
  • end_date::Optional{DateTime}: The new end date of the experiment.

Returns

An UpsertResult. Updated if the record was successfully updated (or no changes were made), Duplicate if the record already exists, Unprocessable if the record violates a constraint, and Error if an error occurred while creating the record.

source
update_experiment(client::Client, id::Integer; status_id=nothing, name=nothing, description=nothing, end_date=nothing)::Nothing

Patch an Experiment via PATCH /experiment/{id}. Any keyword left as nothing is left untouched server-side. Reopening (status_id == Integer(IN_PROGRESS) on a row that previously had an end_date) clears end_date automatically. Requires UpdatePermission on the owning project.

source
update_experiment(client::Client, id::Integer, status::ExperimentStatus; name=nothing, description=nothing, end_date=nothing)::Nothing

ExperimentStatus-typed overload of update_experiment.

source