Resource
DearDiary.get_resource — Functionget_resource(id::Integer)::Optional{Resource}Get a Resource by id.
Arguments
id::Integer: The id of the resource to query.
Returns
A Resource object. If the record does not exist, return nothing.
DearDiary.get_resources — Functionget_resources(experiment_id::Integer)::Array{Resource, 1}Get all Resource for a given experiment.
Arguments
experiment_id::Integer: The id of the experiment to query.
Returns
An array of Resource objects.
DearDiary.create_resource — Functioncreate_resource(experiment_id::Integer, name::AbstractString, data::AbstractArray{UInt8,1})::Tuple{Optional{<:Int64},UpsertResult}Create a new Resource record.
Arguments
experiment_id::Integer: The id of the experiment to create the resource for.name::AbstractString: The name of the resource.data::AbstractArray{UInt8,1}: The binary data of the resource.
Returns
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.
DearDiary.update_resource — Functionupdate_resource(id::Integer, name::Optional{AbstractString}, description::Optional{AbstractString}, data::Optional{AbstractArray{UInt8,1}})::UpsertResultUpdate a Resource record.
Arguments
id::Integer: The id of the resource to update.name::Optional{AbstractString}: The new name for the resource.description::Optional{AbstractString}: The new description for the resource.data::Optional{AbstractArray{UInt8,1}}: The new binary data for the resource.
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.
DearDiary.delete_resource — Functiondelete_resource(id::Integer)::BoolDelete a Resource record.
Arguments
id::Integer: The id of the resource to delete.
Returns
true if the record was successfully deleted, false otherwise.