# This file was generated by the Julia OpenAPI Code Generator
# Do not modify this file directly. Modify the OpenAPI specification instead.
struct JobsApi <: OpenAPI.APIClientImpl
client::OpenAPI.Clients.Client
end
"""
The default API base path for APIs in `JobsApi`.
This can be used to construct the `OpenAPI.Clients.Client` instance.
"""
basepath(::Type{ JobsApi }) = "http://localhost/torc-service/v1"
const _returntypes_complete_job_JobsApi = Dict{Regex,Type}(
Regex("^" * replace("200", "x"=>".") * "\$") => JobModel,
Regex("^" * replace("403", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("404", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("500", "x"=>".") * "\$") => ErrorResponse,
)
function _oacinternal_complete_job(_api::JobsApi, id::Int64, status::JobStatus, run_id::Int64, result_model::ResultModel; _mediaType=nothing)
_ctx = OpenAPI.Clients.Ctx(_api.client, "POST", _returntypes_complete_job_JobsApi, "/jobs/{id}/complete_job/{status}/{run_id}", [], result_model)
OpenAPI.Clients.set_param(_ctx.path, "id", id) # type Int64
OpenAPI.Clients.set_param(_ctx.path, "status", status) # type JobStatus
OpenAPI.Clients.set_param(_ctx.path, "run_id", run_id) # type Int64
OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ])
OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json", ] : [_mediaType])
return _ctx
end
@doc raw"""Params:
- id::Int64 (required)
- status::JobStatus (required)
- run_id::Int64 (required)
- result_model::ResultModel (required)
Return: JobModel, OpenAPI.Clients.ApiResponse
"""
function complete_job(_api::JobsApi, id::Int64, status::JobStatus, run_id::Int64, result_model::ResultModel; _mediaType=nothing)
_ctx = _oacinternal_complete_job(_api, id, status, run_id, result_model; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx)
end
function complete_job(_api::JobsApi, response_stream::Channel, id::Int64, status::JobStatus, run_id::Int64, result_model::ResultModel; _mediaType=nothing)
_ctx = _oacinternal_complete_job(_api, id, status, run_id, result_model; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx, response_stream)
end
const _returntypes_create_job_JobsApi = Dict{Regex,Type}(
Regex("^" * replace("200", "x"=>".") * "\$") => JobModel,
Regex("^" * replace("403", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("404", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("422", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("500", "x"=>".") * "\$") => ErrorResponse,
)
function _oacinternal_create_job(_api::JobsApi, job_model::JobModel; _mediaType=nothing)
_ctx = OpenAPI.Clients.Ctx(_api.client, "POST", _returntypes_create_job_JobsApi, "/jobs", [], job_model)
OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ])
OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json", ] : [_mediaType])
return _ctx
end
@doc raw"""Params:
- job_model::JobModel (required)
Return: JobModel, OpenAPI.Clients.ApiResponse
"""
function create_job(_api::JobsApi, job_model::JobModel; _mediaType=nothing)
_ctx = _oacinternal_create_job(_api, job_model; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx)
end
function create_job(_api::JobsApi, response_stream::Channel, job_model::JobModel; _mediaType=nothing)
_ctx = _oacinternal_create_job(_api, job_model; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx, response_stream)
end
const _returntypes_create_jobs_JobsApi = Dict{Regex,Type}(
Regex("^" * replace("200", "x"=>".") * "\$") => CreateJobsResponse,
)
function _oacinternal_create_jobs(_api::JobsApi, jobs_model::JobsModel; _mediaType=nothing)
_ctx = OpenAPI.Clients.Ctx(_api.client, "POST", _returntypes_create_jobs_JobsApi, "/bulk_jobs", [], jobs_model)
OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ])
OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json", ] : [_mediaType])
return _ctx
end
@doc raw"""Params:
- jobs_model::JobsModel (required)
Return: CreateJobsResponse, OpenAPI.Clients.ApiResponse
"""
function create_jobs(_api::JobsApi, jobs_model::JobsModel; _mediaType=nothing)
_ctx = _oacinternal_create_jobs(_api, jobs_model; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx)
end
function create_jobs(_api::JobsApi, response_stream::Channel, jobs_model::JobsModel; _mediaType=nothing)
_ctx = _oacinternal_create_jobs(_api, jobs_model; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx, response_stream)
end
const _returntypes_delete_job_JobsApi = Dict{Regex,Type}(
Regex("^" * replace("200", "x"=>".") * "\$") => JobModel,
Regex("^" * replace("403", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("404", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("500", "x"=>".") * "\$") => ErrorResponse,
)
function _oacinternal_delete_job(_api::JobsApi, id::Int64; _mediaType=nothing)
_ctx = OpenAPI.Clients.Ctx(_api.client, "DELETE", _returntypes_delete_job_JobsApi, "/jobs/{id}", [])
OpenAPI.Clients.set_param(_ctx.path, "id", id) # type Int64
OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ])
OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType])
return _ctx
end
@doc raw"""Params:
- id::Int64 (required)
Return: JobModel, OpenAPI.Clients.ApiResponse
"""
function delete_job(_api::JobsApi, id::Int64; _mediaType=nothing)
_ctx = _oacinternal_delete_job(_api, id; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx)
end
function delete_job(_api::JobsApi, response_stream::Channel, id::Int64; _mediaType=nothing)
_ctx = _oacinternal_delete_job(_api, id; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx, response_stream)
end
const _returntypes_delete_jobs_JobsApi = Dict{Regex,Type}(
Regex("^" * replace("200", "x"=>".") * "\$") => DeleteCountResponse,
Regex("^" * replace("403", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("404", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("500", "x"=>".") * "\$") => ErrorResponse,
)
function _oacinternal_delete_jobs(_api::JobsApi, workflow_id::Int64; _mediaType=nothing)
_ctx = OpenAPI.Clients.Ctx(_api.client, "DELETE", _returntypes_delete_jobs_JobsApi, "/jobs", [])
OpenAPI.Clients.set_param(_ctx.query, "workflow_id", workflow_id; style="form", is_explode=true) # type Int64
OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ])
OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType])
return _ctx
end
@doc raw"""Params:
- workflow_id::Int64 (required)
Return: DeleteCountResponse, OpenAPI.Clients.ApiResponse
"""
function delete_jobs(_api::JobsApi, workflow_id::Int64; _mediaType=nothing)
_ctx = _oacinternal_delete_jobs(_api, workflow_id; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx)
end
function delete_jobs(_api::JobsApi, response_stream::Channel, workflow_id::Int64; _mediaType=nothing)
_ctx = _oacinternal_delete_jobs(_api, workflow_id; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx, response_stream)
end
const _returntypes_get_job_JobsApi = Dict{Regex,Type}(
Regex("^" * replace("200", "x"=>".") * "\$") => JobModel,
Regex("^" * replace("403", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("404", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("500", "x"=>".") * "\$") => ErrorResponse,
)
function _oacinternal_get_job(_api::JobsApi, id::Int64; _mediaType=nothing)
_ctx = OpenAPI.Clients.Ctx(_api.client, "GET", _returntypes_get_job_JobsApi, "/jobs/{id}", [])
OpenAPI.Clients.set_param(_ctx.path, "id", id) # type Int64
OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ])
OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType])
return _ctx
end
@doc raw"""Params:
- id::Int64 (required)
Return: JobModel, OpenAPI.Clients.ApiResponse
"""
function get_job(_api::JobsApi, id::Int64; _mediaType=nothing)
_ctx = _oacinternal_get_job(_api, id; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx)
end
function get_job(_api::JobsApi, response_stream::Channel, id::Int64; _mediaType=nothing)
_ctx = _oacinternal_get_job(_api, id; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx, response_stream)
end
const _returntypes_list_jobs_JobsApi = Dict{Regex,Type}(
Regex("^" * replace("200", "x"=>".") * "\$") => ListJobsResponse,
Regex("^" * replace("403", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("404", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("500", "x"=>".") * "\$") => ErrorResponse,
)
function _oacinternal_list_jobs(_api::JobsApi, workflow_id::Int64; status=nothing, needs_file_id=nothing, upstream_job_id=nothing, offset=nothing, limit=nothing, sort_by=nothing, reverse_sort=nothing, include_relationships=nothing, active_compute_node_id=nothing, _mediaType=nothing)
_ctx = OpenAPI.Clients.Ctx(_api.client, "GET", _returntypes_list_jobs_JobsApi, "/jobs", [])
OpenAPI.Clients.set_param(_ctx.query, "workflow_id", workflow_id; style="form", is_explode=true) # type Int64
OpenAPI.Clients.set_param(_ctx.query, "status", status; style="form", is_explode=true) # type JobStatus
OpenAPI.Clients.set_param(_ctx.query, "needs_file_id", needs_file_id; style="form", is_explode=true) # type Int64
OpenAPI.Clients.set_param(_ctx.query, "upstream_job_id", upstream_job_id; style="form", is_explode=true) # type Int64
OpenAPI.Clients.set_param(_ctx.query, "offset", offset; style="form", is_explode=true) # type Int64
OpenAPI.Clients.set_param(_ctx.query, "limit", limit; style="form", is_explode=true) # type Int64
OpenAPI.Clients.set_param(_ctx.query, "sort_by", sort_by; style="form", is_explode=true) # type String
OpenAPI.Clients.set_param(_ctx.query, "reverse_sort", reverse_sort; style="form", is_explode=true) # type Bool
OpenAPI.Clients.set_param(_ctx.query, "include_relationships", include_relationships; style="form", is_explode=true) # type Bool
OpenAPI.Clients.set_param(_ctx.query, "active_compute_node_id", active_compute_node_id; style="form", is_explode=true) # type Int64
OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ])
OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType])
return _ctx
end
@doc raw"""Params:
- workflow_id::Int64 (required)
- status::JobStatus
- needs_file_id::Int64
- upstream_job_id::Int64
- offset::Int64
- limit::Int64
- sort_by::String
- reverse_sort::Bool
- include_relationships::Bool
- active_compute_node_id::Int64
Return: ListJobsResponse, OpenAPI.Clients.ApiResponse
"""
function list_jobs(_api::JobsApi, workflow_id::Int64; status=nothing, needs_file_id=nothing, upstream_job_id=nothing, offset=nothing, limit=nothing, sort_by=nothing, reverse_sort=nothing, include_relationships=nothing, active_compute_node_id=nothing, _mediaType=nothing)
_ctx = _oacinternal_list_jobs(_api, workflow_id; status=status, needs_file_id=needs_file_id, upstream_job_id=upstream_job_id, offset=offset, limit=limit, sort_by=sort_by, reverse_sort=reverse_sort, include_relationships=include_relationships, active_compute_node_id=active_compute_node_id, _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx)
end
function list_jobs(_api::JobsApi, response_stream::Channel, workflow_id::Int64; status=nothing, needs_file_id=nothing, upstream_job_id=nothing, offset=nothing, limit=nothing, sort_by=nothing, reverse_sort=nothing, include_relationships=nothing, active_compute_node_id=nothing, _mediaType=nothing)
_ctx = _oacinternal_list_jobs(_api, workflow_id; status=status, needs_file_id=needs_file_id, upstream_job_id=upstream_job_id, offset=offset, limit=limit, sort_by=sort_by, reverse_sort=reverse_sort, include_relationships=include_relationships, active_compute_node_id=active_compute_node_id, _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx, response_stream)
end
const _returntypes_manage_status_change_JobsApi = Dict{Regex,Type}(
Regex("^" * replace("200", "x"=>".") * "\$") => JobModel,
Regex("^" * replace("403", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("404", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("500", "x"=>".") * "\$") => ErrorResponse,
)
function _oacinternal_manage_status_change(_api::JobsApi, id::Int64, status::JobStatus, run_id::Int64; _mediaType=nothing)
_ctx = OpenAPI.Clients.Ctx(_api.client, "PUT", _returntypes_manage_status_change_JobsApi, "/jobs/{id}/manage_status_change/{status}/{run_id}", [])
OpenAPI.Clients.set_param(_ctx.path, "id", id) # type Int64
OpenAPI.Clients.set_param(_ctx.path, "status", status) # type JobStatus
OpenAPI.Clients.set_param(_ctx.path, "run_id", run_id) # type Int64
OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ])
OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType])
return _ctx
end
@doc raw"""Params:
- id::Int64 (required)
- status::JobStatus (required)
- run_id::Int64 (required)
Return: JobModel, OpenAPI.Clients.ApiResponse
"""
function manage_status_change(_api::JobsApi, id::Int64, status::JobStatus, run_id::Int64; _mediaType=nothing)
_ctx = _oacinternal_manage_status_change(_api, id, status, run_id; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx)
end
function manage_status_change(_api::JobsApi, response_stream::Channel, id::Int64, status::JobStatus, run_id::Int64; _mediaType=nothing)
_ctx = _oacinternal_manage_status_change(_api, id, status, run_id; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx, response_stream)
end
const _returntypes_retry_job_JobsApi = Dict{Regex,Type}(
Regex("^" * replace("200", "x"=>".") * "\$") => JobModel,
Regex("^" * replace("403", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("404", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("422", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("500", "x"=>".") * "\$") => ErrorResponse,
)
function _oacinternal_retry_job(_api::JobsApi, id::Int64, run_id::Int64, max_retries::Int64; _mediaType=nothing)
_ctx = OpenAPI.Clients.Ctx(_api.client, "POST", _returntypes_retry_job_JobsApi, "/jobs/{id}/retry/{run_id}", [])
OpenAPI.Clients.set_param(_ctx.path, "id", id) # type Int64
OpenAPI.Clients.set_param(_ctx.path, "run_id", run_id) # type Int64
OpenAPI.Clients.set_param(_ctx.query, "max_retries", max_retries; style="form", is_explode=true) # type Int64
OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ])
OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType])
return _ctx
end
@doc raw"""Params:
- id::Int64 (required)
- run_id::Int64 (required)
- max_retries::Int64 (required)
Return: JobModel, OpenAPI.Clients.ApiResponse
"""
function retry_job(_api::JobsApi, id::Int64, run_id::Int64, max_retries::Int64; _mediaType=nothing)
_ctx = _oacinternal_retry_job(_api, id, run_id, max_retries; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx)
end
function retry_job(_api::JobsApi, response_stream::Channel, id::Int64, run_id::Int64, max_retries::Int64; _mediaType=nothing)
_ctx = _oacinternal_retry_job(_api, id, run_id, max_retries; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx, response_stream)
end
const _returntypes_start_job_JobsApi = Dict{Regex,Type}(
Regex("^" * replace("200", "x"=>".") * "\$") => JobModel,
Regex("^" * replace("403", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("404", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("500", "x"=>".") * "\$") => ErrorResponse,
)
function _oacinternal_start_job(_api::JobsApi, id::Int64, run_id::Int64, compute_node_id::Int64; _mediaType=nothing)
_ctx = OpenAPI.Clients.Ctx(_api.client, "PUT", _returntypes_start_job_JobsApi, "/jobs/{id}/start_job/{run_id}/{compute_node_id}", [])
OpenAPI.Clients.set_param(_ctx.path, "id", id) # type Int64
OpenAPI.Clients.set_param(_ctx.path, "run_id", run_id) # type Int64
OpenAPI.Clients.set_param(_ctx.path, "compute_node_id", compute_node_id) # type Int64
OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ])
OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? [] : [_mediaType])
return _ctx
end
@doc raw"""Params:
- id::Int64 (required)
- run_id::Int64 (required)
- compute_node_id::Int64 (required)
Return: JobModel, OpenAPI.Clients.ApiResponse
"""
function start_job(_api::JobsApi, id::Int64, run_id::Int64, compute_node_id::Int64; _mediaType=nothing)
_ctx = _oacinternal_start_job(_api, id, run_id, compute_node_id; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx)
end
function start_job(_api::JobsApi, response_stream::Channel, id::Int64, run_id::Int64, compute_node_id::Int64; _mediaType=nothing)
_ctx = _oacinternal_start_job(_api, id, run_id, compute_node_id; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx, response_stream)
end
const _returntypes_update_job_JobsApi = Dict{Regex,Type}(
Regex("^" * replace("200", "x"=>".") * "\$") => JobModel,
Regex("^" * replace("403", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("404", "x"=>".") * "\$") => ErrorResponse,
Regex("^" * replace("500", "x"=>".") * "\$") => ErrorResponse,
)
function _oacinternal_update_job(_api::JobsApi, id::Int64, job_model::JobModel; _mediaType=nothing)
_ctx = OpenAPI.Clients.Ctx(_api.client, "PUT", _returntypes_update_job_JobsApi, "/jobs/{id}", [], job_model)
OpenAPI.Clients.set_param(_ctx.path, "id", id) # type Int64
OpenAPI.Clients.set_header_accept(_ctx, ["application/json", ])
OpenAPI.Clients.set_header_content_type(_ctx, (_mediaType === nothing) ? ["application/json", ] : [_mediaType])
return _ctx
end
@doc raw"""Params:
- id::Int64 (required)
- job_model::JobModel (required)
Return: JobModel, OpenAPI.Clients.ApiResponse
"""
function update_job(_api::JobsApi, id::Int64, job_model::JobModel; _mediaType=nothing)
_ctx = _oacinternal_update_job(_api, id, job_model; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx)
end
function update_job(_api::JobsApi, response_stream::Channel, id::Int64, job_model::JobModel; _mediaType=nothing)
_ctx = _oacinternal_update_job(_api, id, job_model; _mediaType=_mediaType)
return OpenAPI.Clients.exec(_ctx, response_stream)
end
export complete_job
export create_job
export create_jobs
export delete_job
export delete_jobs
export get_job
export list_jobs
export manage_status_change
export retry_job
export start_job
export update_job