hanzo-client 8.5.156

Generated client for the Hanzo API — every service, one crate.
Documentation
/*
 * Hanzo Cloud API
 *
 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GpuJob {
    /// Attempt is which try this is, counting from 1. Above 1 means the job was retried after a failed or abandoned run.
    #[serde(rename = "attempt", skip_serializing_if = "Option::is_none")]
    pub attempt: Option<i32>,
    /// CloseTime is when the job reached a terminal state, RFC 3339. Empty means it is still live — queued, running or stalled.
    #[serde(rename = "closeTime", skip_serializing_if = "Option::is_none")]
    pub close_time: Option<String>,
    /// FailureCause is the engine's reason the job failed. Empty unless it did.
    #[serde(rename = "failureCause", skip_serializing_if = "Option::is_none")]
    pub failure_cause: Option<String>,
    /// GPU is the node this job is aimed AT — the lane \"gpu:<node>\" it was submitted on. Empty means the shared any-GPU lane: it was not aimed anywhere and the first free worker takes it.
    #[serde(rename = "gpu", skip_serializing_if = "Option::is_none")]
    pub gpu: Option<String>,
    /// ID is the job's id, and the id the cancel route takes. The dispatcher sets it equal to the render's prompt id, so it is the same value the studio knows the job by.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Label is the cheap human name for the render — the output filename prefix lifted out of the submitted graph. Empty when the graph carried none. The graph itself is never in this list; the tasks describe endpoint serves it.
    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
    pub label: Option<String>,
    /// LastHeartbeat is the claiming worker's most recent beat on this job, RFC 3339 — the evidence a long render is still alive rather than wedged.
    #[serde(rename = "lastHeartbeat", skip_serializing_if = "Option::is_none")]
    pub last_heartbeat: Option<String>,
    /// LeaseExpiry is when the worker's claim lapses, RFC 3339. Past it with the job still STARTED, the claimant is presumed dead and Status reads \"stalled\".
    #[serde(rename = "leaseExpiry", skip_serializing_if = "Option::is_none")]
    pub lease_expiry: Option<String>,
    /// RunID identifies this execution of the job. It equals ID for a job the dispatcher submitted, which is why a cancel that omits it still works.
    #[serde(rename = "runId", skip_serializing_if = "Option::is_none")]
    pub run_id: Option<String>,
    /// StartTime is when a worker began executing the job, RFC 3339. Empty while it is still queued.
    #[serde(rename = "startTime", skip_serializing_if = "Option::is_none")]
    pub start_time: Option<String>,
    /// Status is the job's lifecycle state: queued, running, completed, failed or canceled — plus \"stalled\", which is this surface's own reading of a job that is STARTED whose worker died: its lease has elapsed and no reaper has taken it back yet. Without it such a job reads \"running\" forever. An engine state this surface does not recognize passes through lower-cased rather than being coerced into one of these.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// Type is the work being done (\"studio.render\") — what the claiming worker has to be able to execute.
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,
    /// Worker is the node that actually CLAIMED the job, which is not always the one it was aimed at: a shared-lane job has no GPU but does have a Worker once picked up. Empty while the job is still waiting.
    #[serde(rename = "worker", skip_serializing_if = "Option::is_none")]
    pub worker: Option<String>,
}

impl GpuJob {
    pub fn new() -> GpuJob {
        GpuJob {
            attempt: None,
            close_time: None,
            failure_cause: None,
            gpu: None,
            id: None,
            label: None,
            last_heartbeat: None,
            lease_expiry: None,
            run_id: None,
            start_time: None,
            status: None,
            r#type: None,
            worker: None,
        }
    }
}