Parameter
DearDiary.get_parameter — Function
get_parameter(id::Integer)::Optional{Parameter}Get a Parameter by id.
Arguments
id::Integer: The id of the parameter to query.
Returns
A Parameter object. If the record does not exist, return nothing.
get_parameter(client::Client, id::Integer)::Optional{Parameter}Fetch a Parameter via GET /parameter/{id}. Returns nothing when the server replies 404 and raises ClientError for other failures.
DearDiary.get_parameters — Function
get_parameters(iteration_id::Integer)::Array{Parameter, 1}Get all Parameter for a given iteration.
Arguments
iteration_id::Integer: The id of the iteration to query.
Returns
An array of Parameter objects.
get_parameters(iteration_id::Integer, page::Pagination)::PaginatedResponse{Parameter}Get a page of Parameter records for an iteration, with total count populated.
Arguments
iteration_id::Integer: The id of the iteration to query.page::Pagination: The page bounds (limit + offset).
Returns
A PaginatedResponse of Parameter.
get_parameters(client::Client, iteration_id::Integer)::Array{Parameter,1}Convenience wrapper around the paged form: returns the first page (default limit) of Parameter records under iteration_id and discards the pagination envelope.
get_parameters(client::Client, iteration_id::Integer, page::Pagination)::PaginatedResponse{Parameter}Fetch a page of Parameter records under iteration_id via GET /parameter/iteration/{iteration_id}?limit=…&offset=….
DearDiary.create_parameter — Function
create_parameter(iteration_id::Integer, key::AbstractString, value::AbstractString)::NamedTuple{id::Optional{<:Int64},status::DataType}Create a Parameter.
Arguments
iteration_id::Integer: The id of the iteration to create the parameter for.key::AbstractString: The key of the parameter.value::AbstractString: The value of the parameter.
Returns
- The created parameter ID. If an error occurs,
nothingis returned. - An
UpsertResult.Createdif the record was successfully created,Duplicateif the record already exists,Unprocessableif the record violates a constraint, andErrorif an error occurred while creating the record.
create_parameter(iteration_id::Integer, key::AbstractString, value::Real)::NamedTuple{id::Optional{<:Int64},status::DataType}Create a Parameter.
Arguments
iteration_id::Integer: The id of the iteration to create the parameter for.key::AbstractString: The key of the parameter.value::Real: The value of the parameter.
Returns
- The created parameter ID. If an error occurs,
nothingis returned. - An
UpsertResult.Createdif the record was successfully created,Duplicateif the record already exists,Unprocessableif the record violates a constraint, andErrorif an error occurred while creating the record.
create_parameter(client::Client, iteration_id::Integer, key::AbstractString, value::AbstractString)::Int64Append a Parameter (string-valued) to iteration_id via POST /parameter/iteration/{iteration_id}. The parent iteration must not be terminated; the server rejects writes to ended iterations. Returns the new parameter id.
create_parameter(client::Client, iteration_id::Integer, key::AbstractString, value::Real)::Int64Real-typed overload of create_parameter; stringifies value before sending so numeric hyperparameters round-trip through the underlying TEXT column unchanged.
DearDiary.update_parameter — Function
update_parameter(id::Integer, key::Optional{AbstractString}, value::Optional{AbstractString})::Type{<:UpsertResult}Update a Parameter record.
Arguments
id::Integer: The id of the parameter to update.key::Optional{AbstractString}: The new key for the parameter.value::Optional{AbstractString}: The new value for the parameter.
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.
update_parameter(id::Integer, key::Optional{AbstractString}, value::Real)::Type{<:UpsertResult}Update a Parameter record.
Arguments
id::Integer: The id of the parameter to update.key::Optional{AbstractString}: The new key for the parameter.value::Real: The new value for the parameter.
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.
update_parameter(client::Client, id::Integer; key=nothing, value=nothing)::NothingPatch a Parameter via PATCH /parameter/{id}. Any keyword left as nothing is left untouched. Fails when the parent iteration has already been ended.
update_parameter(client::Client, id::Integer, value::Real; key=nothing)::NothingReal-typed overload of update_parameter; stringifies value before sending.
DearDiary.delete_parameter — Function
delete_parameter(id::Integer)::BoolDelete a Parameter record.
Arguments
id::Integer: The id of the parameter to delete.
Returns
true if the record was successfully deleted, false otherwise.
delete_parameter(client::Client, id::Integer)::NothingDelete a Parameter via DELETE /parameter/{id}. Requires DeletePermission on the iteration's project.