#![allow(dead_code)]
use super::{ContentType, Error, configuration};
use crate::client::apis::ResponseContent;
use crate::models;
use reqwest;
use serde::{Deserialize, Serialize, de::Error as _};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateComputeNodeError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateEventError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateFileError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateJobError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateJobsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateLocalSchedulerError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateFailureHandlerError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetFailureHandlerError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListFailureHandlersError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateRoCrateEntityError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetRoCrateEntityError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListRoCrateEntitiesError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateRoCrateEntityError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteRoCrateEntityError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteRoCrateEntitiesError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteFailureHandlerError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RetryJobError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateResourceRequirementsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateResultError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[allow(clippy::enum_variant_names)]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateSlurmStatsError {
DefaultResponse(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateScheduledComputeNodeError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateSlurmSchedulerError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateUserDataError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateWorkflowError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CancelWorkflowError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CompleteJobError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteComputeNodesError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteEventsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteFilesError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteJobsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteLocalSchedulersError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteResourceRequirementsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteResultsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteScheduledComputeNodesError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteSlurmSchedulersError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteAllUserDataError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetComputeNodeError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetDotGraphError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetEventError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetFileError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetJobError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetLocalSchedulerError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetReadyJobRequirementsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetResourceRequirementsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetResultError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetScheduledComputeNodeError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetSlurmSchedulerError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetUserDataError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetVersionError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetWorkflowError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetWorkflowStatusError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum InitializeJobsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IsWorkflowCompleteError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IsWorkflowUninitializedError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListComputeNodesError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListEventsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListFilesError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListJobIdsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListJobsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListJobDependenciesError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListJobFileRelationshipsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListJobUserDataRelationshipsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListLocalSchedulersError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListMissingUserDataError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListRequiredExistingFilesError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListResourceRequirementsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListResultsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListScheduledComputeNodesError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListSlurmSchedulersError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListSlurmStatsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListUserDataError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListWorkflowsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ManageStatusChangeError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateComputeNodeError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateEventError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateFileError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateJobError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateLocalSchedulerError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateResourceRequirementsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateResultError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateScheduledComputeNodeError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateSlurmSchedulerError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateUserDataError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateWorkflowError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateWorkflowStatusError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PingError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ReloadAuthError {
Status403(models::ErrorResponse),
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PrepareJobsForSchedulingError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ClaimJobsBasedOnResourcesError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ClaimNextJobsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProcessChangedJobInputsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteComputeNodeError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteEventError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteFileError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteJobError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteLocalSchedulerError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteAllResourceRequirementsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteResultError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteScheduledComputeNodeError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteSlurmSchedulerError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteUserDataError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteWorkflowError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ResetJobStatusError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ResetWorkflowStatusError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum StartJobError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateAccessGroupError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetAccessGroupError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListAccessGroupsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteAccessGroupError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AddUserToGroupError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RemoveUserFromGroupError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListGroupMembersError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListUserGroupsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AddWorkflowToGroupError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RemoveWorkflowFromGroupError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListWorkflowGroupsError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CheckWorkflowAccessError {
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
pub fn create_compute_node(
configuration: &configuration::Configuration,
body: models::ComputeNodeModel,
) -> Result<models::ComputeNodeModel, Error<CreateComputeNodeError>> {
let p_body = body;
let uri_str = format!("{}/compute_nodes", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ComputeNodeModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ComputeNodeModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CreateComputeNodeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn create_event(
configuration: &configuration::Configuration,
body: models::EventModel,
) -> Result<models::EventModel, Error<CreateEventError>> {
let p_body = body;
let uri_str = format!("{}/events", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::EventModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::EventModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CreateEventError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn create_file(
configuration: &configuration::Configuration,
body: models::FileModel,
) -> Result<models::FileModel, Error<CreateFileError>> {
let p_body = body;
let uri_str = format!("{}/files", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::FileModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::FileModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CreateFileError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn create_job(
configuration: &configuration::Configuration,
body: models::JobModel,
) -> Result<models::JobModel, Error<CreateJobError>> {
let p_body = body;
let uri_str = format!("{}/jobs", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::JobModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::JobModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CreateJobError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn create_jobs(
configuration: &configuration::Configuration,
body: models::JobsModel,
) -> Result<models::CreateJobsResponse, Error<CreateJobsError>> {
let p_body = body;
let uri_str = format!("{}/bulk_jobs", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::CreateJobsResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::CreateJobsResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CreateJobsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn create_local_scheduler(
configuration: &configuration::Configuration,
body: models::LocalSchedulerModel,
) -> Result<models::LocalSchedulerModel, Error<CreateLocalSchedulerError>> {
let p_body = body;
let uri_str = format!("{}/local_schedulers", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::LocalSchedulerModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::LocalSchedulerModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CreateLocalSchedulerError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn create_resource_requirements(
configuration: &configuration::Configuration,
body: models::ResourceRequirementsModel,
) -> Result<models::ResourceRequirementsModel, Error<CreateResourceRequirementsError>> {
let p_body = body;
let uri_str = format!("{}/resource_requirements", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ResourceRequirementsModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ResourceRequirementsModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CreateResourceRequirementsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn create_result(
configuration: &configuration::Configuration,
body: models::ResultModel,
) -> Result<models::ResultModel, Error<CreateResultError>> {
let p_body = body;
let uri_str = format!("{}/results", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ResultModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ResultModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CreateResultError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn create_slurm_stats(
configuration: &configuration::Configuration,
body: models::SlurmStatsModel,
) -> Result<models::SlurmStatsModel, Error<CreateSlurmStatsError>> {
let p_body = body;
let uri_str = format!("{}/slurm_stats", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::SlurmStatsModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{}` content type response that cannot be converted to `models::SlurmStatsModel`",
unknown_type
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CreateSlurmStatsError> = match content_type {
ContentType::Json => serde_json::from_str(&content)
.ok()
.map(CreateSlurmStatsError::DefaultResponse),
_ => None,
};
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_slurm_stats(
configuration: &configuration::Configuration,
workflow_id: i64,
job_id: Option<i64>,
run_id: Option<i64>,
attempt_id: Option<i64>,
offset: Option<i64>,
limit: Option<i64>,
) -> Result<models::ListSlurmStatsResponse, Error<ListSlurmStatsError>> {
let uri_str = format!("{}/slurm_stats", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &workflow_id.to_string())]);
if let Some(j_id) = job_id {
req_builder = req_builder.query(&[("job_id", &j_id.to_string())]);
}
if let Some(r_id) = run_id {
req_builder = req_builder.query(&[("run_id", &r_id.to_string())]);
}
if let Some(a_id) = attempt_id {
req_builder = req_builder.query(&[("attempt_id", &a_id.to_string())]);
}
if let Some(off) = offset {
req_builder = req_builder.query(&[("offset", &off.to_string())]);
}
if let Some(lim) = limit {
req_builder = req_builder.query(&[("limit", &lim.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListSlurmStatsResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{}` content type response that cannot be converted to `models::ListSlurmStatsResponse`",
unknown_type
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListSlurmStatsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn create_scheduled_compute_node(
configuration: &configuration::Configuration,
body: models::ScheduledComputeNodesModel,
) -> Result<models::ScheduledComputeNodesModel, Error<CreateScheduledComputeNodeError>> {
let p_body = body;
let uri_str = format!("{}/scheduled_compute_nodes", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ScheduledComputeNodesModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ScheduledComputeNodesModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CreateScheduledComputeNodeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn create_slurm_scheduler(
configuration: &configuration::Configuration,
body: models::SlurmSchedulerModel,
) -> Result<models::SlurmSchedulerModel, Error<CreateSlurmSchedulerError>> {
let p_body = body;
let uri_str = format!("{}/slurm_schedulers", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::SlurmSchedulerModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::SlurmSchedulerModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CreateSlurmSchedulerError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn create_user_data(
configuration: &configuration::Configuration,
body: models::UserDataModel,
consumer_job_id: Option<i64>,
producer_job_id: Option<i64>,
) -> Result<models::UserDataModel, Error<CreateUserDataError>> {
let p_body = body;
let p_consumer_job_id = consumer_job_id;
let p_producer_job_id = producer_job_id;
let uri_str = format!("{}/user_data", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref param_value) = p_consumer_job_id {
req_builder = req_builder.query(&[("consumer_job_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_producer_job_id {
req_builder = req_builder.query(&[("producer_job_id", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::UserDataModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::UserDataModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CreateUserDataError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn create_workflow(
configuration: &configuration::Configuration,
body: models::WorkflowModel,
) -> Result<models::WorkflowModel, Error<CreateWorkflowError>> {
let p_body = body;
let uri_str = format!("{}/workflows", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::WorkflowModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::WorkflowModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CreateWorkflowError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn cancel_workflow(
configuration: &configuration::Configuration,
id: i64,
body: Option<serde_json::Value>,
) -> Result<serde_json::Value, Error<CancelWorkflowError>> {
let p_id = id;
let p_body = body;
let uri_str = format!(
"{}/workflows/{id}/cancel",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CancelWorkflowError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn complete_job(
configuration: &configuration::Configuration,
id: i64,
status: models::JobStatus,
run_id: i64,
body: models::ResultModel,
) -> Result<models::JobModel, Error<CompleteJobError>> {
let p_id = id;
let p_status = status;
let p_run_id = run_id;
let p_body = body;
let uri_str = format!(
"{}/jobs/{id}/complete_job/{status}/{run_id}",
configuration.base_path,
id = p_id,
status = p_status,
run_id = p_run_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::JobModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::JobModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CompleteJobError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_compute_nodes(
configuration: &configuration::Configuration,
workflow_id: i64,
body: Option<serde_json::Value>,
) -> Result<serde_json::Value, Error<DeleteComputeNodesError>> {
let p_workflow_id = workflow_id;
let p_body = body;
let uri_str = format!("{}/compute_nodes", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteComputeNodesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_events(
configuration: &configuration::Configuration,
workflow_id: i64,
body: Option<serde_json::Value>,
) -> Result<serde_json::Value, Error<DeleteEventsError>> {
let p_workflow_id = workflow_id;
let p_body = body;
let uri_str = format!("{}/events", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteEventsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_files(
configuration: &configuration::Configuration,
workflow_id: i64,
body: Option<serde_json::Value>,
) -> Result<serde_json::Value, Error<DeleteFilesError>> {
let p_workflow_id = workflow_id;
let p_body = body;
let uri_str = format!("{}/files", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteFilesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_jobs(
configuration: &configuration::Configuration,
workflow_id: i64,
body: Option<serde_json::Value>,
) -> Result<serde_json::Value, Error<DeleteJobsError>> {
let p_workflow_id = workflow_id;
let p_body = body;
let uri_str = format!("{}/jobs", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteJobsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_local_schedulers(
configuration: &configuration::Configuration,
workflow_id: i64,
body: Option<serde_json::Value>,
) -> Result<serde_json::Value, Error<DeleteLocalSchedulersError>> {
let p_workflow_id = workflow_id;
let p_body = body;
let uri_str = format!("{}/local_schedulers", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteLocalSchedulersError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_all_resource_requirements(
configuration: &configuration::Configuration,
workflow_id: i64,
body: Option<serde_json::Value>,
) -> Result<serde_json::Value, Error<DeleteAllResourceRequirementsError>> {
let p_workflow_id = workflow_id;
let p_body = body;
let uri_str = format!("{}/resource_requirements", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteAllResourceRequirementsError> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_results(
configuration: &configuration::Configuration,
workflow_id: i64,
body: Option<serde_json::Value>,
) -> Result<serde_json::Value, Error<DeleteResultsError>> {
let p_workflow_id = workflow_id;
let p_body = body;
let uri_str = format!("{}/results", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteResultsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_scheduled_compute_nodes(
configuration: &configuration::Configuration,
workflow_id: i64,
body: Option<serde_json::Value>,
) -> Result<serde_json::Value, Error<DeleteScheduledComputeNodesError>> {
let p_workflow_id = workflow_id;
let p_body = body;
let uri_str = format!("{}/scheduled_compute_nodes", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteScheduledComputeNodesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_slurm_schedulers(
configuration: &configuration::Configuration,
workflow_id: i64,
body: Option<serde_json::Value>,
) -> Result<serde_json::Value, Error<DeleteSlurmSchedulersError>> {
let p_workflow_id = workflow_id;
let p_body = body;
let uri_str = format!("{}/slurm_schedulers", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteSlurmSchedulersError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_all_user_data(
configuration: &configuration::Configuration,
workflow_id: i64,
body: Option<serde_json::Value>,
) -> Result<serde_json::Value, Error<DeleteAllUserDataError>> {
let p_workflow_id = workflow_id;
let p_body = body;
let uri_str = format!("{}/user_data", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteAllUserDataError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_compute_node(
configuration: &configuration::Configuration,
id: i64,
) -> Result<models::ComputeNodeModel, Error<GetComputeNodeError>> {
let p_id = id;
let uri_str = format!("{}/compute_nodes/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ComputeNodeModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ComputeNodeModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetComputeNodeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_dot_graph(
configuration: &configuration::Configuration,
id: i64,
name: &str,
) -> Result<models::GetDotGraphResponse, Error<GetDotGraphError>> {
let p_id = id;
let p_name = name;
let uri_str = format!(
"{}/workflows/{id}/dot_graph/{name}",
configuration.base_path,
id = p_id,
name = super::urlencode(p_name)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::GetDotGraphResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::GetDotGraphResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetDotGraphError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_event(
configuration: &configuration::Configuration,
id: i64,
) -> Result<models::EventModel, Error<GetEventError>> {
let p_id = id;
let uri_str = format!("{}/events/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::EventModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::EventModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetEventError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_file(
configuration: &configuration::Configuration,
id: i64,
) -> Result<models::FileModel, Error<GetFileError>> {
let p_id = id;
let uri_str = format!("{}/files/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::FileModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::FileModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetFileError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_job(
configuration: &configuration::Configuration,
id: i64,
) -> Result<models::JobModel, Error<GetJobError>> {
let p_id = id;
let uri_str = format!("{}/jobs/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::JobModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::JobModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetJobError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_local_scheduler(
configuration: &configuration::Configuration,
id: i64,
) -> Result<models::LocalSchedulerModel, Error<GetLocalSchedulerError>> {
let p_id = id;
let uri_str = format!(
"{}/local_schedulers/{id}",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::LocalSchedulerModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::LocalSchedulerModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetLocalSchedulerError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_ready_job_requirements(
configuration: &configuration::Configuration,
id: i64,
scheduler_config_id: Option<i64>,
) -> Result<models::GetReadyJobRequirementsResponse, Error<GetReadyJobRequirementsError>> {
let p_id = id;
let p_scheduler_config_id = scheduler_config_id;
let uri_str = format!(
"{}/workflows/{id}/ready_job_requirements",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_scheduler_config_id {
req_builder = req_builder.query(&[("scheduler_config_id", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::GetReadyJobRequirementsResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::GetReadyJobRequirementsResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetReadyJobRequirementsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_resource_requirements(
configuration: &configuration::Configuration,
id: i64,
) -> Result<models::ResourceRequirementsModel, Error<GetResourceRequirementsError>> {
let p_id = id;
let uri_str = format!(
"{}/resource_requirements/{id}",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ResourceRequirementsModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ResourceRequirementsModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetResourceRequirementsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_result(
configuration: &configuration::Configuration,
id: i64,
) -> Result<models::ResultModel, Error<GetResultError>> {
let p_id = id;
let uri_str = format!("{}/results/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ResultModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ResultModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetResultError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_scheduled_compute_node(
configuration: &configuration::Configuration,
id: i64,
) -> Result<models::ScheduledComputeNodesModel, Error<GetScheduledComputeNodeError>> {
let p_id = id;
let uri_str = format!(
"{}/scheduled_compute_nodes/{id}",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ScheduledComputeNodesModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ScheduledComputeNodesModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetScheduledComputeNodeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_slurm_scheduler(
configuration: &configuration::Configuration,
id: i64,
) -> Result<models::SlurmSchedulerModel, Error<GetSlurmSchedulerError>> {
let p_id = id;
let uri_str = format!(
"{}/slurm_schedulers/{id}",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::SlurmSchedulerModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::SlurmSchedulerModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetSlurmSchedulerError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_user_data(
configuration: &configuration::Configuration,
id: i64,
) -> Result<models::UserDataModel, Error<GetUserDataError>> {
let p_id = id;
let uri_str = format!("{}/user_data/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::UserDataModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::UserDataModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetUserDataError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_version(
configuration: &configuration::Configuration,
) -> Result<serde_json::Value, Error<GetVersionError>> {
let uri_str = format!("{}/version", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetVersionError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_workflow(
configuration: &configuration::Configuration,
id: i64,
) -> Result<models::WorkflowModel, Error<GetWorkflowError>> {
let p_id = id;
let uri_str = format!("{}/workflows/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::WorkflowModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::WorkflowModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetWorkflowError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_workflow_status(
configuration: &configuration::Configuration,
id: i64,
) -> Result<models::WorkflowStatusModel, Error<GetWorkflowStatusError>> {
let p_id = id;
let uri_str = format!(
"{}/workflows/{id}/status",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::WorkflowStatusModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::WorkflowStatusModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetWorkflowStatusError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn initialize_jobs(
configuration: &configuration::Configuration,
id: i64,
only_uninitialized: Option<bool>,
clear_ephemeral_user_data: Option<bool>,
body: Option<serde_json::Value>,
) -> Result<serde_json::Value, Error<InitializeJobsError>> {
let p_id = id;
let p_only_uninitialized = only_uninitialized;
let p_clear_ephemeral_user_data = clear_ephemeral_user_data;
let p_body = body;
let uri_str = format!(
"{}/workflows/{id}/initialize_jobs",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref param_value) = p_only_uninitialized {
req_builder = req_builder.query(&[("only_uninitialized", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_clear_ephemeral_user_data {
req_builder = req_builder.query(&[("clear_ephemeral_user_data", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<InitializeJobsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn is_workflow_complete(
configuration: &configuration::Configuration,
id: i64,
) -> Result<models::IsCompleteResponse, Error<IsWorkflowCompleteError>> {
let p_id = id;
let uri_str = format!(
"{}/workflows/{id}/is_complete",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::IsCompleteResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::IsCompleteResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<IsWorkflowCompleteError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn is_workflow_uninitialized(
configuration: &configuration::Configuration,
id: i64,
) -> Result<serde_json::Value, Error<IsWorkflowUninitializedError>> {
let p_id = id;
let uri_str = format!(
"{}/workflows/{id}/is_uninitialized",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<IsWorkflowUninitializedError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_compute_nodes(
configuration: &configuration::Configuration,
workflow_id: i64,
offset: Option<i64>,
limit: Option<i64>,
sort_by: Option<&str>,
reverse_sort: Option<bool>,
hostname: Option<&str>,
is_active: Option<bool>,
scheduled_compute_node_id: Option<i64>,
) -> Result<models::ListComputeNodesResponse, Error<ListComputeNodesError>> {
let p_workflow_id = workflow_id;
let p_skip = offset;
let p_limit = limit;
let p_sort_by = sort_by;
let p_reverse_sort = reverse_sort;
let p_hostname = hostname;
let p_is_active = is_active;
let p_scheduled_compute_node_id = scheduled_compute_node_id;
let uri_str = format!("{}/compute_nodes", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref param_value) = p_skip {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_sort_by {
req_builder = req_builder.query(&[("sort_by", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_reverse_sort {
req_builder = req_builder.query(&[("reverse_sort", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_hostname {
req_builder = req_builder.query(&[("hostname", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_is_active {
req_builder = req_builder.query(&[("is_active", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_scheduled_compute_node_id {
req_builder = req_builder.query(&[("scheduled_compute_node_id", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListComputeNodesResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListComputeNodesResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListComputeNodesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_events(
configuration: &configuration::Configuration,
workflow_id: i64,
offset: Option<i64>,
limit: Option<i64>,
sort_by: Option<&str>,
reverse_sort: Option<bool>,
category: Option<&str>,
after_timestamp: Option<i64>,
) -> Result<models::ListEventsResponse, Error<ListEventsError>> {
let p_workflow_id = workflow_id;
let p_skip = offset;
let p_limit = limit;
let p_sort_by = sort_by;
let p_reverse_sort = reverse_sort;
let p_category = category;
let p_after_timestamp = after_timestamp;
let uri_str = format!("{}/events", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref param_value) = p_skip {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_sort_by {
req_builder = req_builder.query(&[("sort_by", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_reverse_sort {
req_builder = req_builder.query(&[("reverse_sort", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_category {
req_builder = req_builder.query(&[("category", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_after_timestamp {
req_builder = req_builder.query(&[("after_timestamp", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListEventsResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListEventsResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListEventsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_files(
configuration: &configuration::Configuration,
workflow_id: i64,
produced_by_job_id: Option<i64>,
offset: Option<i64>,
limit: Option<i64>,
sort_by: Option<&str>,
reverse_sort: Option<bool>,
name: Option<&str>,
path: Option<&str>,
is_output: Option<bool>,
) -> Result<models::ListFilesResponse, Error<ListFilesError>> {
let p_workflow_id = workflow_id;
let p_produced_by_job_id = produced_by_job_id;
let p_skip = offset;
let p_limit = limit;
let p_sort_by = sort_by;
let p_reverse_sort = reverse_sort;
let p_name = name;
let p_path = path;
let p_is_output = is_output;
let uri_str = format!("{}/files", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref param_value) = p_produced_by_job_id {
req_builder = req_builder.query(&[("produced_by_job_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_skip {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_sort_by {
req_builder = req_builder.query(&[("sort_by", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_reverse_sort {
req_builder = req_builder.query(&[("reverse_sort", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_path {
req_builder = req_builder.query(&[("path", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_is_output {
req_builder = req_builder.query(&[("is_output", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListFilesResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListFilesResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListFilesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_job_ids(
configuration: &configuration::Configuration,
id: i64,
) -> Result<serde_json::Value, Error<ListJobIdsError>> {
let p_id = id;
let uri_str = format!(
"{}/workflows/{id}/job_ids",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListJobIdsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_jobs(
configuration: &configuration::Configuration,
workflow_id: i64,
status: Option<models::JobStatus>,
needs_file_id: Option<i64>,
upstream_job_id: Option<i64>,
offset: Option<i64>,
limit: Option<i64>,
sort_by: Option<&str>,
reverse_sort: Option<bool>,
include_relationships: Option<bool>,
active_compute_node_id: Option<i64>,
) -> Result<models::ListJobsResponse, Error<ListJobsError>> {
let p_workflow_id = workflow_id;
let p_status = status;
let p_needs_file_id = needs_file_id;
let p_upstream_job_id = upstream_job_id;
let p_skip = offset;
let p_limit = limit;
let p_sort_by = sort_by;
let p_reverse_sort = reverse_sort;
let p_include_relationships = include_relationships;
let p_active_compute_node_id = active_compute_node_id;
let uri_str = format!("{}/jobs", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref param_value) = p_status {
req_builder = req_builder.query(&[("status", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_needs_file_id {
req_builder = req_builder.query(&[("needs_file_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_upstream_job_id {
req_builder = req_builder.query(&[("upstream_job_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_skip {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_sort_by {
req_builder = req_builder.query(&[("sort_by", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_reverse_sort {
req_builder = req_builder.query(&[("reverse_sort", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_include_relationships {
req_builder = req_builder.query(&[("include_relationships", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_active_compute_node_id {
req_builder = req_builder.query(&[("active_compute_node_id", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListJobsResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListJobsResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListJobsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_job_dependencies(
configuration: &configuration::Configuration,
workflow_id: i64,
offset: Option<i64>,
limit: Option<i64>,
) -> Result<models::ListJobDependenciesResponse, Error<ListJobDependenciesError>> {
let p_workflow_id = workflow_id;
let p_offset = offset;
let p_limit = limit;
let uri_str = format!(
"{}/workflows/{}/job_dependencies",
configuration.base_path, p_workflow_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_offset {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListJobDependenciesResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListJobDependenciesResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListJobDependenciesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_job_file_relationships(
configuration: &configuration::Configuration,
workflow_id: i64,
offset: Option<i64>,
limit: Option<i64>,
) -> Result<models::ListJobFileRelationshipsResponse, Error<ListJobFileRelationshipsError>> {
let p_workflow_id = workflow_id;
let p_offset = offset;
let p_limit = limit;
let uri_str = format!(
"{}/workflows/{}/job_file_relationships",
configuration.base_path, p_workflow_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_offset {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListJobFileRelationshipsResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListJobFileRelationshipsResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListJobFileRelationshipsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_job_user_data_relationships(
configuration: &configuration::Configuration,
workflow_id: i64,
offset: Option<i64>,
limit: Option<i64>,
) -> Result<models::ListJobUserDataRelationshipsResponse, Error<ListJobUserDataRelationshipsError>>
{
let p_workflow_id = workflow_id;
let p_offset = offset;
let p_limit = limit;
let uri_str = format!(
"{}/workflows/{}/job_user_data_relationships",
configuration.base_path, p_workflow_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_offset {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListJobUserDataRelationshipsResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListJobUserDataRelationshipsResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListJobUserDataRelationshipsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_local_schedulers(
configuration: &configuration::Configuration,
workflow_id: i64,
offset: Option<i64>,
limit: Option<i64>,
sort_by: Option<&str>,
reverse_sort: Option<bool>,
memory: Option<&str>,
num_cpus: Option<i64>,
) -> Result<models::ListLocalSchedulersResponse, Error<ListLocalSchedulersError>> {
let p_workflow_id = workflow_id;
let p_skip = offset;
let p_limit = limit;
let p_sort_by = sort_by;
let p_reverse_sort = reverse_sort;
let p_memory = memory;
let p_num_cpus = num_cpus;
let uri_str = format!("{}/local_schedulers", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref param_value) = p_skip {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_sort_by {
req_builder = req_builder.query(&[("sort_by", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_reverse_sort {
req_builder = req_builder.query(&[("reverse_sort", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_memory {
req_builder = req_builder.query(&[("memory", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_num_cpus {
req_builder = req_builder.query(&[("num_cpus", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListLocalSchedulersResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListLocalSchedulersResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListLocalSchedulersError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_missing_user_data(
configuration: &configuration::Configuration,
id: i64,
) -> Result<models::ListMissingUserDataResponse, Error<ListMissingUserDataError>> {
let p_id = id;
let uri_str = format!(
"{}/workflows/{id}/missing_user_data",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListMissingUserDataResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListMissingUserDataResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListMissingUserDataError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_required_existing_files(
configuration: &configuration::Configuration,
id: i64,
) -> Result<models::ListRequiredExistingFilesResponse, Error<ListRequiredExistingFilesError>> {
let p_id = id;
let uri_str = format!(
"{}/workflows/{id}/required_existing_files",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListRequiredExistingFilesResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListRequiredExistingFilesResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListRequiredExistingFilesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_resource_requirements(
configuration: &configuration::Configuration,
workflow_id: i64,
job_id: Option<i64>,
offset: Option<i64>,
limit: Option<i64>,
sort_by: Option<&str>,
reverse_sort: Option<bool>,
name: Option<&str>,
memory: Option<&str>,
num_cpus: Option<i64>,
num_gpus: Option<i64>,
num_nodes: Option<i64>,
runtime: Option<&str>,
) -> Result<models::ListResourceRequirementsResponse, Error<ListResourceRequirementsError>> {
let p_workflow_id = workflow_id;
let p_job_id = job_id;
let p_skip = offset;
let p_limit = limit;
let p_sort_by = sort_by;
let p_reverse_sort = reverse_sort;
let p_name = name;
let p_memory = memory;
let p_num_cpus = num_cpus;
let p_num_gpus = num_gpus;
let p_num_nodes = num_nodes;
let p_runtime = runtime;
let uri_str = format!("{}/resource_requirements", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref param_value) = p_job_id {
req_builder = req_builder.query(&[("job_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_skip {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_sort_by {
req_builder = req_builder.query(&[("sort_by", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_reverse_sort {
req_builder = req_builder.query(&[("reverse_sort", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_memory {
req_builder = req_builder.query(&[("memory", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_num_cpus {
req_builder = req_builder.query(&[("num_cpus", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_num_gpus {
req_builder = req_builder.query(&[("num_gpus", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_num_nodes {
req_builder = req_builder.query(&[("num_nodes", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_runtime {
req_builder = req_builder.query(&[("runtime", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListResourceRequirementsResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListResourceRequirementsResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListResourceRequirementsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_results(
configuration: &configuration::Configuration,
workflow_id: i64,
job_id: Option<i64>,
run_id: Option<i64>,
offset: Option<i64>,
limit: Option<i64>,
sort_by: Option<&str>,
reverse_sort: Option<bool>,
return_code: Option<i64>,
status: Option<models::JobStatus>,
all_runs: Option<bool>,
compute_node_id: Option<i64>,
) -> Result<models::ListResultsResponse, Error<ListResultsError>> {
let p_workflow_id = workflow_id;
let p_job_id = job_id;
let p_skip = offset;
let p_limit = limit;
let p_sort_by = sort_by;
let p_reverse_sort = reverse_sort;
let p_run_id = run_id;
let p_return_code = return_code;
let p_status = status;
let p_all_runs = all_runs;
let p_compute_node_id = compute_node_id;
let uri_str = format!("{}/results", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref param_value) = p_job_id {
req_builder = req_builder.query(&[("job_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_skip {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_sort_by {
req_builder = req_builder.query(&[("sort_by", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_reverse_sort {
req_builder = req_builder.query(&[("reverse_sort", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_run_id {
req_builder = req_builder.query(&[("run_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_return_code {
req_builder = req_builder.query(&[("return_code", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_status {
req_builder = req_builder.query(&[("status", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_all_runs {
req_builder = req_builder.query(&[("all_runs", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_compute_node_id {
req_builder = req_builder.query(&[("compute_node_id", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListResultsResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListResultsResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListResultsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_scheduled_compute_nodes(
configuration: &configuration::Configuration,
workflow_id: i64,
offset: Option<i64>,
limit: Option<i64>,
sort_by: Option<&str>,
reverse_sort: Option<bool>,
scheduler_id: Option<&str>,
scheduler_config_id: Option<&str>,
status: Option<&str>,
) -> Result<models::ListScheduledComputeNodesResponse, Error<ListScheduledComputeNodesError>> {
let p_workflow_id = workflow_id;
let p_skip = offset;
let p_limit = limit;
let p_sort_by = sort_by;
let p_reverse_sort = reverse_sort;
let p_scheduler_id = scheduler_id;
let p_scheduler_config_id = scheduler_config_id;
let p_status = status;
let uri_str = format!("{}/scheduled_compute_nodes", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref param_value) = p_skip {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_sort_by {
req_builder = req_builder.query(&[("sort_by", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_reverse_sort {
req_builder = req_builder.query(&[("reverse_sort", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_scheduler_id {
req_builder = req_builder.query(&[("scheduler_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_scheduler_config_id {
req_builder = req_builder.query(&[("scheduler_config_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_status {
req_builder = req_builder.query(&[("status", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListScheduledComputeNodesResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListScheduledComputeNodesResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListScheduledComputeNodesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_slurm_schedulers(
configuration: &configuration::Configuration,
workflow_id: i64,
offset: Option<i64>,
limit: Option<i64>,
sort_by: Option<&str>,
reverse_sort: Option<bool>,
name: Option<&str>,
account: Option<&str>,
gres: Option<&str>,
mem: Option<&str>,
nodes: Option<i64>,
partition: Option<&str>,
qos: Option<&str>,
tmp: Option<&str>,
walltime: Option<&str>,
) -> Result<models::ListSlurmSchedulersResponse, Error<ListSlurmSchedulersError>> {
let p_workflow_id = workflow_id;
let p_skip = offset;
let p_limit = limit;
let p_sort_by = sort_by;
let p_reverse_sort = reverse_sort;
let p_name = name;
let p_account = account;
let p_gres = gres;
let p_mem = mem;
let p_nodes = nodes;
let p_partition = partition;
let p_qos = qos;
let p_tmp = tmp;
let p_walltime = walltime;
let uri_str = format!("{}/slurm_schedulers", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref param_value) = p_skip {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_sort_by {
req_builder = req_builder.query(&[("sort_by", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_reverse_sort {
req_builder = req_builder.query(&[("reverse_sort", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_account {
req_builder = req_builder.query(&[("account", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_gres {
req_builder = req_builder.query(&[("gres", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_mem {
req_builder = req_builder.query(&[("mem", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_nodes {
req_builder = req_builder.query(&[("nodes", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_partition {
req_builder = req_builder.query(&[("partition", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_qos {
req_builder = req_builder.query(&[("qos", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_tmp {
req_builder = req_builder.query(&[("tmp", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_walltime {
req_builder = req_builder.query(&[("walltime", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListSlurmSchedulersResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListSlurmSchedulersResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListSlurmSchedulersError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_user_data(
configuration: &configuration::Configuration,
workflow_id: i64,
consumer_job_id: Option<i64>,
producer_job_id: Option<i64>,
offset: Option<i64>,
limit: Option<i64>,
sort_by: Option<&str>,
reverse_sort: Option<bool>,
name: Option<&str>,
is_ephemeral: Option<bool>,
) -> Result<models::ListUserDataResponse, Error<ListUserDataError>> {
let p_workflow_id = workflow_id;
let p_consumer_job_id = consumer_job_id;
let p_producer_job_id = producer_job_id;
let p_skip = offset;
let p_limit = limit;
let p_sort_by = sort_by;
let p_reverse_sort = reverse_sort;
let p_name = name;
let p_is_ephemeral = is_ephemeral;
let uri_str = format!("{}/user_data", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("workflow_id", &p_workflow_id.to_string())]);
if let Some(ref param_value) = p_consumer_job_id {
req_builder = req_builder.query(&[("consumer_job_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_producer_job_id {
req_builder = req_builder.query(&[("producer_job_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_skip {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_sort_by {
req_builder = req_builder.query(&[("sort_by", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_reverse_sort {
req_builder = req_builder.query(&[("reverse_sort", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_is_ephemeral {
req_builder = req_builder.query(&[("is_ephemeral", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListUserDataResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListUserDataResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListUserDataError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_workflows(
configuration: &configuration::Configuration,
offset: Option<i64>,
sort_by: Option<&str>,
reverse_sort: Option<bool>,
limit: Option<i64>,
name: Option<&str>,
user: Option<&str>,
description: Option<&str>,
is_archived: Option<bool>,
) -> Result<models::ListWorkflowsResponse, Error<ListWorkflowsError>> {
let p_skip = offset;
let p_sort_by = sort_by;
let p_reverse_sort = reverse_sort;
let p_limit = limit;
let p_name = name;
let p_user = user;
let p_description = description;
let p_is_archived = is_archived;
let uri_str = format!("{}/workflows", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_skip {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_sort_by {
req_builder = req_builder.query(&[("sort_by", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_reverse_sort {
req_builder = req_builder.query(&[("reverse_sort", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_user {
req_builder = req_builder.query(&[("user", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_description {
req_builder = req_builder.query(&[("description", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_is_archived {
req_builder = req_builder.query(&[("is_archived", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListWorkflowsResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListWorkflowsResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListWorkflowsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn manage_status_change(
configuration: &configuration::Configuration,
id: i64,
status: models::JobStatus,
run_id: i64,
body: Option<serde_json::Value>,
) -> Result<models::JobModel, Error<ManageStatusChangeError>> {
let p_id = id;
let p_status = status;
let p_run_id = run_id;
let p_body = body;
let uri_str = format!(
"{}/jobs/{id}/manage_status_change/{status}/{run_id}",
configuration.base_path,
id = p_id,
status = p_status,
run_id = p_run_id
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::JobModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::JobModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ManageStatusChangeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn update_compute_node(
configuration: &configuration::Configuration,
id: i64,
body: models::ComputeNodeModel,
) -> Result<models::ComputeNodeModel, Error<UpdateComputeNodeError>> {
let p_id = id;
let p_body = body;
let uri_str = format!("{}/compute_nodes/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ComputeNodeModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ComputeNodeModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<UpdateComputeNodeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn update_event(
configuration: &configuration::Configuration,
id: i64,
body: serde_json::Value,
) -> Result<models::EventModel, Error<UpdateEventError>> {
let p_id = id;
let p_body = body;
let uri_str = format!("{}/events/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::EventModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::EventModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<UpdateEventError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn update_file(
configuration: &configuration::Configuration,
id: i64,
body: models::FileModel,
) -> Result<models::FileModel, Error<UpdateFileError>> {
let p_id = id;
let p_body = body;
let uri_str = format!("{}/files/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::FileModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::FileModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<UpdateFileError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn update_job(
configuration: &configuration::Configuration,
id: i64,
body: models::JobModel,
) -> Result<models::JobModel, Error<UpdateJobError>> {
let p_id = id;
let p_body = body;
let uri_str = format!("{}/jobs/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::JobModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::JobModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<UpdateJobError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn update_local_scheduler(
configuration: &configuration::Configuration,
id: i64,
body: models::LocalSchedulerModel,
) -> Result<models::LocalSchedulerModel, Error<UpdateLocalSchedulerError>> {
let p_id = id;
let p_body = body;
let uri_str = format!(
"{}/local_schedulers/{id}",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::LocalSchedulerModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::LocalSchedulerModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<UpdateLocalSchedulerError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn update_resource_requirements(
configuration: &configuration::Configuration,
id: i64,
body: models::ResourceRequirementsModel,
) -> Result<models::ResourceRequirementsModel, Error<UpdateResourceRequirementsError>> {
let p_id = id;
let p_body = body;
let uri_str = format!(
"{}/resource_requirements/{id}",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ResourceRequirementsModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ResourceRequirementsModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<UpdateResourceRequirementsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn update_result(
configuration: &configuration::Configuration,
id: i64,
body: models::ResultModel,
) -> Result<models::ResultModel, Error<UpdateResultError>> {
let p_id = id;
let p_body = body;
let uri_str = format!("{}/results/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ResultModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ResultModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<UpdateResultError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn update_scheduled_compute_node(
configuration: &configuration::Configuration,
id: i64,
body: models::ScheduledComputeNodesModel,
) -> Result<models::ScheduledComputeNodesModel, Error<UpdateScheduledComputeNodeError>> {
let p_id = id;
let p_body = body;
let uri_str = format!(
"{}/scheduled_compute_nodes/{id}",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ScheduledComputeNodesModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ScheduledComputeNodesModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<UpdateScheduledComputeNodeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn update_slurm_scheduler(
configuration: &configuration::Configuration,
id: i64,
body: models::SlurmSchedulerModel,
) -> Result<models::SlurmSchedulerModel, Error<UpdateSlurmSchedulerError>> {
let p_id = id;
let p_body = body;
let uri_str = format!(
"{}/slurm_schedulers/{id}",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::SlurmSchedulerModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::SlurmSchedulerModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<UpdateSlurmSchedulerError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn update_user_data(
configuration: &configuration::Configuration,
id: i64,
body: models::UserDataModel,
) -> Result<models::UserDataModel, Error<UpdateUserDataError>> {
let p_id = id;
let p_body = body;
let uri_str = format!("{}/user_data/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::UserDataModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::UserDataModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<UpdateUserDataError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn update_workflow(
configuration: &configuration::Configuration,
id: i64,
body: models::WorkflowModel,
) -> Result<models::WorkflowModel, Error<UpdateWorkflowError>> {
let p_id = id;
let p_body = body;
let uri_str = format!("{}/workflows/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::WorkflowModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::WorkflowModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<UpdateWorkflowError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn update_workflow_status(
configuration: &configuration::Configuration,
id: i64,
body: models::WorkflowStatusModel,
) -> Result<models::WorkflowStatusModel, Error<UpdateWorkflowStatusError>> {
let p_id = id;
let p_body = body;
let uri_str = format!(
"{}/workflows/{id}/status",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::WorkflowStatusModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::WorkflowStatusModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<UpdateWorkflowStatusError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn ping(
configuration: &configuration::Configuration,
) -> Result<serde_json::Value, Error<PingError>> {
let uri_str = format!("{}/ping", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<PingError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn reload_auth(
configuration: &configuration::Configuration,
) -> Result<serde_json::Value, Error<ReloadAuthError>> {
let uri_str = format!("{}/admin/reload-auth", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ReloadAuthError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn claim_jobs_based_on_resources(
configuration: &configuration::Configuration,
id: i64,
body: &models::ComputeNodesResources,
limit: i64,
sort_method: Option<models::ClaimJobsSortMethod>,
strict_scheduler_match: Option<bool>,
) -> Result<models::ClaimJobsBasedOnResources, Error<ClaimJobsBasedOnResourcesError>> {
let p_id = id;
let p_limit = limit;
let p_body = body;
let p_sort_method = sort_method;
let p_strict_scheduler_match = strict_scheduler_match;
let uri_str = format!(
"{}/workflows/{id}/claim_jobs_based_on_resources/{limit}",
configuration.base_path,
id = p_id,
limit = p_limit
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref param_value) = p_sort_method {
req_builder = req_builder.query(&[("sort_method", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_strict_scheduler_match {
req_builder = req_builder.query(&[("strict_scheduler_match", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ClaimJobsBasedOnResources`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ClaimJobsBasedOnResources`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ClaimJobsBasedOnResourcesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn claim_next_jobs(
configuration: &configuration::Configuration,
id: i64,
limit: Option<i64>,
body: Option<serde_json::Value>,
) -> Result<models::ClaimNextJobsResponse, Error<ClaimNextJobsError>> {
let p_id = id;
let p_limit = limit;
let p_body = body;
let uri_str = format!(
"{}/workflows/{id}/claim_next_jobs",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref param_value) = p_limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ClaimNextJobsResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ClaimNextJobsResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ClaimNextJobsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn process_changed_job_inputs(
configuration: &configuration::Configuration,
id: i64,
dry_run: Option<bool>,
body: Option<serde_json::Value>,
) -> Result<models::ProcessChangedJobInputsResponse, Error<ProcessChangedJobInputsError>> {
let p_id = id;
let p_dry_run = dry_run;
let p_body = body;
let uri_str = format!(
"{}/workflows/{id}/process_changed_job_inputs",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref param_value) = p_dry_run {
req_builder = req_builder.query(&[("dry_run", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ProcessChangedJobInputsResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ProcessChangedJobInputsResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ProcessChangedJobInputsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_compute_node(
configuration: &configuration::Configuration,
id: i64,
body: Option<serde_json::Value>,
) -> Result<models::ComputeNodeModel, Error<DeleteComputeNodeError>> {
let p_id = id;
let p_body = body;
let uri_str = format!("{}/compute_nodes/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ComputeNodeModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ComputeNodeModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteComputeNodeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_event(
configuration: &configuration::Configuration,
id: i64,
body: Option<serde_json::Value>,
) -> Result<models::EventModel, Error<DeleteEventError>> {
let p_id = id;
let p_body = body;
let uri_str = format!("{}/events/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::EventModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::EventModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteEventError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_file(
configuration: &configuration::Configuration,
id: i64,
body: Option<serde_json::Value>,
) -> Result<models::FileModel, Error<DeleteFileError>> {
let p_id = id;
let p_body = body;
let uri_str = format!("{}/files/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::FileModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::FileModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteFileError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_job(
configuration: &configuration::Configuration,
id: i64,
body: Option<serde_json::Value>,
) -> Result<models::JobModel, Error<DeleteJobError>> {
let p_id = id;
let p_body = body;
let uri_str = format!("{}/jobs/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::JobModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::JobModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteJobError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_local_scheduler(
configuration: &configuration::Configuration,
id: i64,
body: Option<serde_json::Value>,
) -> Result<models::LocalSchedulerModel, Error<DeleteLocalSchedulerError>> {
let p_id = id;
let p_body = body;
let uri_str = format!(
"{}/local_schedulers/{id}",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::LocalSchedulerModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::LocalSchedulerModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteLocalSchedulerError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_resource_requirements(
configuration: &configuration::Configuration,
id: i64,
body: Option<serde_json::Value>,
) -> Result<models::ResourceRequirementsModel, Error<DeleteResourceRequirementsError>> {
let p_id = id;
let p_body = body;
let uri_str = format!(
"{}/resource_requirements/{id}",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ResourceRequirementsModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ResourceRequirementsModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteResourceRequirementsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_result(
configuration: &configuration::Configuration,
id: i64,
body: Option<serde_json::Value>,
) -> Result<models::ResultModel, Error<DeleteResultError>> {
let p_id = id;
let p_body = body;
let uri_str = format!("{}/results/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ResultModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ResultModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteResultError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_scheduled_compute_node(
configuration: &configuration::Configuration,
id: i64,
body: Option<serde_json::Value>,
) -> Result<models::ScheduledComputeNodesModel, Error<DeleteScheduledComputeNodeError>> {
let p_id = id;
let p_body = body;
let uri_str = format!(
"{}/scheduled_compute_nodes/{id}",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ScheduledComputeNodesModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ScheduledComputeNodesModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteScheduledComputeNodeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_slurm_scheduler(
configuration: &configuration::Configuration,
id: i64,
body: Option<serde_json::Value>,
) -> Result<models::SlurmSchedulerModel, Error<DeleteSlurmSchedulerError>> {
let p_id = id;
let p_body = body;
let uri_str = format!(
"{}/slurm_schedulers/{id}",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::SlurmSchedulerModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::SlurmSchedulerModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteSlurmSchedulerError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_user_data(
configuration: &configuration::Configuration,
id: i64,
body: Option<serde_json::Value>,
) -> Result<models::UserDataModel, Error<DeleteUserDataError>> {
let p_id = id;
let p_body = body;
let uri_str = format!("{}/user_data/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::UserDataModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::UserDataModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteUserDataError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_workflow(
configuration: &configuration::Configuration,
id: i64,
body: Option<serde_json::Value>,
) -> Result<models::WorkflowModel, Error<DeleteWorkflowError>> {
let p_id = id;
let p_body = body;
let uri_str = format!("{}/workflows/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::WorkflowModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::WorkflowModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteWorkflowError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn reset_job_status(
configuration: &configuration::Configuration,
id: i64,
failed_only: Option<bool>,
body: Option<serde_json::Value>,
) -> Result<serde_json::Value, Error<ResetJobStatusError>> {
let p_id = id;
let p_failed_only = failed_only;
let p_body = body;
let uri_str = format!(
"{}/workflows/{id}/reset_job_status",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref param_value) = p_failed_only {
req_builder = req_builder.query(&[("failed_only", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ResetJobStatusError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn reset_workflow_status(
configuration: &configuration::Configuration,
id: i64,
force: Option<bool>,
body: Option<serde_json::Value>,
) -> Result<serde_json::Value, Error<ResetWorkflowStatusError>> {
let p_id = id;
let p_force = force;
let p_body = body;
let uri_str = format!(
"{}/workflows/{id}/reset_status",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref param_value) = p_force {
req_builder = req_builder.query(&[("force", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ResetWorkflowStatusError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn start_job(
configuration: &configuration::Configuration,
id: i64,
run_id: i64,
compute_node_id: i64,
body: Option<serde_json::Value>,
) -> Result<models::JobModel, Error<StartJobError>> {
let p_id = id;
let p_run_id = run_id;
let p_compute_node_id = compute_node_id;
let p_body = body;
let uri_str = format!(
"{}/jobs/{id}/start_job/{run_id}/{compute_node_id}",
configuration.base_path,
id = p_id,
run_id = p_run_id,
compute_node_id = p_compute_node_id
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::JobModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::JobModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<StartJobError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateWorkflowActionError {
Status404(models::ErrorResponse),
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetWorkflowActionsError {
Status404(models::ErrorResponse),
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetPendingActionsError {
Status404(models::ErrorResponse),
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ClaimActionError {
Status404(models::ErrorResponse),
Status409(models::ErrorResponse),
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
pub fn create_workflow_action(
configuration: &configuration::Configuration,
workflow_id: i64,
body: serde_json::Value,
) -> Result<crate::models::WorkflowActionModel, Error<CreateWorkflowActionError>> {
let p_workflow_id = workflow_id;
let p_body = body;
let uri_str = format!(
"{}/workflows/{workflow_id}/actions",
configuration.base_path,
workflow_id = p_workflow_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `WorkflowActionModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `WorkflowActionModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CreateWorkflowActionError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_workflow_actions(
configuration: &configuration::Configuration,
workflow_id: i64,
) -> Result<Vec<crate::models::WorkflowActionModel>, Error<GetWorkflowActionsError>> {
let p_workflow_id = workflow_id;
let uri_str = format!(
"{}/workflows/{workflow_id}/actions",
configuration.base_path,
workflow_id = p_workflow_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `Vec<WorkflowActionModel>`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `Vec<WorkflowActionModel>`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetWorkflowActionsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_pending_actions(
configuration: &configuration::Configuration,
workflow_id: i64,
trigger_types: Option<Vec<String>>,
) -> Result<Vec<crate::models::WorkflowActionModel>, Error<GetPendingActionsError>> {
let p_workflow_id = workflow_id;
let mut uri_str = format!(
"{}/workflows/{workflow_id}/actions/pending",
configuration.base_path,
workflow_id = p_workflow_id
);
if let Some(ref types) = trigger_types
&& !types.is_empty()
{
let query_string = types
.iter()
.map(|t| {
let encoded = t
.replace(" ", "%20")
.replace("&", "%26")
.replace("=", "%3D");
format!("trigger_type={}", encoded)
})
.collect::<Vec<_>>()
.join("&");
uri_str.push('?');
uri_str.push_str(&query_string);
}
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `Vec<WorkflowActionModel>`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `Vec<WorkflowActionModel>`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetPendingActionsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn claim_action(
configuration: &configuration::Configuration,
workflow_id: i64,
action_id: i64,
body: serde_json::Value,
) -> Result<serde_json::Value, Error<ClaimActionError>> {
let p_workflow_id = workflow_id;
let p_action_id = action_id;
let p_body = body;
let uri_str = format!(
"{}/workflows/{workflow_id}/actions/{action_id}/claim",
configuration.base_path,
workflow_id = p_workflow_id,
action_id = p_action_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ClaimActionError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateRemoteWorkersError {
Status404(models::ErrorResponse),
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListRemoteWorkersError {
Status404(models::ErrorResponse),
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteRemoteWorkerError {
Status404(models::ErrorResponse),
Status500(models::ErrorResponse),
UnknownValue(serde_json::Value),
}
pub fn create_remote_workers(
configuration: &configuration::Configuration,
workflow_id: i64,
workers: Vec<String>,
) -> Result<Vec<models::RemoteWorkerModel>, Error<CreateRemoteWorkersError>> {
let p_workflow_id = workflow_id;
let p_workers = workers;
let uri_str = format!(
"{}/workflows/{workflow_id}/remote_workers",
configuration.base_path,
workflow_id = p_workflow_id,
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_workers);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `Vec<RemoteWorkerModel>`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `Vec<RemoteWorkerModel>`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CreateRemoteWorkersError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_remote_workers(
configuration: &configuration::Configuration,
workflow_id: i64,
) -> Result<Vec<models::RemoteWorkerModel>, Error<ListRemoteWorkersError>> {
let p_workflow_id = workflow_id;
let uri_str = format!(
"{}/workflows/{workflow_id}/remote_workers",
configuration.base_path,
workflow_id = p_workflow_id,
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `Vec<RemoteWorkerModel>`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `Vec<RemoteWorkerModel>`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListRemoteWorkersError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_remote_worker(
configuration: &configuration::Configuration,
workflow_id: i64,
worker: &str,
) -> Result<models::RemoteWorkerModel, Error<DeleteRemoteWorkerError>> {
let p_workflow_id = workflow_id;
let p_worker =
percent_encoding::utf8_percent_encode(worker, percent_encoding::NON_ALPHANUMERIC)
.to_string();
let uri_str = format!(
"{}/workflows/{workflow_id}/remote_workers/{worker}",
configuration.base_path,
workflow_id = p_workflow_id,
worker = p_worker,
);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `RemoteWorkerModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `RemoteWorkerModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteRemoteWorkerError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn create_access_group(
configuration: &configuration::Configuration,
body: models::AccessGroupModel,
) -> Result<models::AccessGroupModel, Error<CreateAccessGroupError>> {
let p_body = body;
let uri_str = format!("{}/access_groups", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::AccessGroupModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::AccessGroupModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CreateAccessGroupError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_access_group(
configuration: &configuration::Configuration,
id: i64,
) -> Result<models::AccessGroupModel, Error<GetAccessGroupError>> {
let p_id = id;
let uri_str = format!("{}/access_groups/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::AccessGroupModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::AccessGroupModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetAccessGroupError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_access_groups(
configuration: &configuration::Configuration,
offset: Option<i64>,
limit: Option<i64>,
) -> Result<models::ListAccessGroupsResponse, Error<ListAccessGroupsError>> {
let uri_str = format!("{}/access_groups", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref s) = offset {
req_builder = req_builder.query(&[("offset", s.to_string())]);
}
if let Some(ref s) = limit {
req_builder = req_builder.query(&[("limit", s.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListAccessGroupsResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListAccessGroupsResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListAccessGroupsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_access_group(
configuration: &configuration::Configuration,
id: i64,
) -> Result<models::AccessGroupModel, Error<DeleteAccessGroupError>> {
let p_id = id;
let uri_str = format!("{}/access_groups/{id}", configuration.base_path, id = p_id);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::AccessGroupModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::AccessGroupModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteAccessGroupError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn add_user_to_group(
configuration: &configuration::Configuration,
id: i64,
body: models::UserGroupMembershipModel,
) -> Result<models::UserGroupMembershipModel, Error<AddUserToGroupError>> {
let p_id = id;
let p_body = body;
let uri_str = format!(
"{}/access_groups/{id}/members",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&p_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::UserGroupMembershipModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::UserGroupMembershipModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<AddUserToGroupError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn remove_user_from_group(
configuration: &configuration::Configuration,
id: i64,
user_name: &str,
) -> Result<models::UserGroupMembershipModel, Error<RemoveUserFromGroupError>> {
let p_id = id;
let p_user_name =
percent_encoding::utf8_percent_encode(user_name, percent_encoding::NON_ALPHANUMERIC)
.to_string();
let uri_str = format!(
"{}/access_groups/{id}/members/{user_name}",
configuration.base_path,
id = p_id,
user_name = p_user_name,
);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::UserGroupMembershipModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::UserGroupMembershipModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<RemoveUserFromGroupError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_group_members(
configuration: &configuration::Configuration,
id: i64,
offset: Option<i64>,
limit: Option<i64>,
) -> Result<models::ListUserGroupMembershipsResponse, Error<ListGroupMembersError>> {
let p_id = id;
let uri_str = format!(
"{}/access_groups/{id}/members",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref s) = offset {
req_builder = req_builder.query(&[("offset", s.to_string())]);
}
if let Some(ref s) = limit {
req_builder = req_builder.query(&[("limit", s.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListUserGroupMembershipsResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListUserGroupMembershipsResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListGroupMembersError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_user_groups(
configuration: &configuration::Configuration,
user_name: &str,
offset: Option<i64>,
limit: Option<i64>,
) -> Result<models::ListAccessGroupsResponse, Error<ListUserGroupsError>> {
let p_user_name =
percent_encoding::utf8_percent_encode(user_name, percent_encoding::NON_ALPHANUMERIC)
.to_string();
let uri_str = format!(
"{}/users/{user_name}/groups",
configuration.base_path,
user_name = p_user_name
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref s) = offset {
req_builder = req_builder.query(&[("offset", s.to_string())]);
}
if let Some(ref s) = limit {
req_builder = req_builder.query(&[("limit", s.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListUserGroupMembershipsResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListUserGroupMembershipsResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListUserGroupsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn add_workflow_to_group(
configuration: &configuration::Configuration,
id: i64,
group_id: i64,
) -> Result<models::WorkflowAccessGroupModel, Error<AddWorkflowToGroupError>> {
let p_id = id;
let p_group_id = group_id;
let uri_str = format!(
"{}/workflows/{id}/access_groups/{group_id}",
configuration.base_path,
id = p_id,
group_id = p_group_id,
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::WorkflowAccessGroupModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::WorkflowAccessGroupModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<AddWorkflowToGroupError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn remove_workflow_from_group(
configuration: &configuration::Configuration,
id: i64,
group_id: i64,
) -> Result<models::WorkflowAccessGroupModel, Error<RemoveWorkflowFromGroupError>> {
let p_id = id;
let p_group_id = group_id;
let uri_str = format!(
"{}/workflows/{id}/access_groups/{group_id}",
configuration.base_path,
id = p_id,
group_id = p_group_id,
);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::WorkflowAccessGroupModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::WorkflowAccessGroupModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<RemoveWorkflowFromGroupError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_workflow_groups(
configuration: &configuration::Configuration,
id: i64,
offset: Option<i64>,
limit: Option<i64>,
) -> Result<models::ListAccessGroupsResponse, Error<ListWorkflowGroupsError>> {
let p_id = id;
let uri_str = format!(
"{}/workflows/{id}/access_groups",
configuration.base_path,
id = p_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref s) = offset {
req_builder = req_builder.query(&[("offset", s.to_string())]);
}
if let Some(ref s) = limit {
req_builder = req_builder.query(&[("limit", s.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListAccessGroupsResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListAccessGroupsResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListWorkflowGroupsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn check_workflow_access(
configuration: &configuration::Configuration,
workflow_id: i64,
user_name: &str,
) -> Result<models::AccessCheckResponse, Error<CheckWorkflowAccessError>> {
let p_workflow_id = workflow_id;
let p_user_name =
percent_encoding::utf8_percent_encode(user_name, percent_encoding::NON_ALPHANUMERIC)
.to_string();
let uri_str = format!(
"{}/access_check/{workflow_id}/{user_name}",
configuration.base_path,
workflow_id = p_workflow_id,
user_name = p_user_name,
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::AccessCheckResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::AccessCheckResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CheckWorkflowAccessError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn create_failure_handler(
configuration: &configuration::Configuration,
body: models::FailureHandlerModel,
) -> Result<models::FailureHandlerModel, Error<CreateFailureHandlerError>> {
let uri_str = format!("{}/failure_handlers", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::FailureHandlerModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::FailureHandlerModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CreateFailureHandlerError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_failure_handler(
configuration: &configuration::Configuration,
id: i64,
) -> Result<models::FailureHandlerModel, Error<GetFailureHandlerError>> {
let uri_str = format!("{}/failure_handlers/{id}", configuration.base_path, id = id);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::FailureHandlerModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::FailureHandlerModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetFailureHandlerError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_failure_handlers(
configuration: &configuration::Configuration,
workflow_id: i64,
offset: Option<i64>,
limit: Option<i64>,
) -> Result<models::ListFailureHandlersResponse, Error<ListFailureHandlersError>> {
let uri_str = format!(
"{}/workflows/{workflow_id}/failure_handlers",
configuration.base_path,
workflow_id = workflow_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = offset {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListFailureHandlersResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListFailureHandlersResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListFailureHandlersError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn create_ro_crate_entity(
configuration: &configuration::Configuration,
body: models::RoCrateEntityModel,
) -> Result<models::RoCrateEntityModel, Error<CreateRoCrateEntityError>> {
let uri_str = format!("{}/ro_crate_entities", configuration.base_path);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::RoCrateEntityModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::RoCrateEntityModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<CreateRoCrateEntityError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn get_ro_crate_entity(
configuration: &configuration::Configuration,
id: i64,
) -> Result<models::RoCrateEntityModel, Error<GetRoCrateEntityError>> {
let uri_str = format!(
"{}/ro_crate_entities/{id}",
configuration.base_path,
id = id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::RoCrateEntityModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::RoCrateEntityModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<GetRoCrateEntityError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn list_ro_crate_entities(
configuration: &configuration::Configuration,
workflow_id: i64,
offset: Option<i64>,
limit: Option<i64>,
) -> Result<models::ListRoCrateEntitiesResponse, Error<ListRoCrateEntitiesError>> {
let uri_str = format!(
"{}/workflows/{workflow_id}/ro_crate_entities",
configuration.base_path,
workflow_id = workflow_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = offset {
req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
}
if let Some(ref param_value) = limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ListRoCrateEntitiesResponse`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ListRoCrateEntitiesResponse`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<ListRoCrateEntitiesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn update_ro_crate_entity(
configuration: &configuration::Configuration,
id: i64,
body: models::RoCrateEntityModel,
) -> Result<models::RoCrateEntityModel, Error<UpdateRoCrateEntityError>> {
let uri_str = format!(
"{}/ro_crate_entities/{id}",
configuration.base_path,
id = id
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
req_builder = req_builder.json(&body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::RoCrateEntityModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::RoCrateEntityModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<UpdateRoCrateEntityError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_ro_crate_entity(
configuration: &configuration::Configuration,
id: i64,
) -> Result<serde_json::Value, Error<DeleteRoCrateEntityError>> {
let uri_str = format!(
"{}/ro_crate_entities/{id}",
configuration.base_path,
id = id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteRoCrateEntityError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn delete_ro_crate_entities(
configuration: &configuration::Configuration,
workflow_id: i64,
) -> Result<serde_json::Value, Error<DeleteRoCrateEntitiesError>> {
let uri_str = format!(
"{}/workflows/{workflow_id}/ro_crate_entities",
configuration.base_path,
workflow_id = workflow_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `serde_json::Value`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<DeleteRoCrateEntitiesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub fn retry_job(
configuration: &configuration::Configuration,
id: i64,
run_id: i64,
max_retries: i32,
) -> Result<models::JobModel, Error<RetryJobError>> {
let uri_str = format!(
"{}/jobs/{id}/retry/{run_id}",
configuration.base_path,
id = id,
run_id = run_id
);
let mut req_builder = configuration
.client
.request(reqwest::Method::POST, &uri_str)
.query(&[("max_retries", max_retries)]);
if let Some(ref auth) = configuration.basic_auth {
req_builder = req_builder.basic_auth(&auth.0, auth.1.as_ref());
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
let req = req_builder.build()?;
let resp = configuration.client.execute(req)?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text()?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::JobModel`",
))),
ContentType::Unsupported(unknown_type) => {
Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::JobModel`"
))))
}
}
} else {
let content = resp.text()?;
let entity: Option<RetryJobError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}