/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.6
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WorkerPing {
    #[serde(rename = "worker")]
    pub worker: String,
    #[serde(rename = "worker_instance")]
    pub worker_instance: String,
    #[serde(rename = "last_ping", skip_serializing_if = "Option::is_none")]
    pub last_ping: Option<f64>,
    #[serde(rename = "started_at")]
    pub started_at: String,
    #[serde(rename = "ip")]
    pub ip: String,
    #[serde(rename = "jobs_executed")]
    pub jobs_executed: i32,
    #[serde(rename = "custom_tags", skip_serializing_if = "Option::is_none")]
    pub custom_tags: Option<Vec<String>>,
    #[serde(rename = "worker_group")]
    pub worker_group: String,
    #[serde(rename = "wm_version")]
    pub wm_version: String,
    #[serde(rename = "last_job_id", skip_serializing_if = "Option::is_none")]
    pub last_job_id: Option<String>,
    #[serde(rename = "last_job_workspace_id", skip_serializing_if = "Option::is_none")]
    pub last_job_workspace_id: Option<String>,
    #[serde(rename = "occupancy_rate", skip_serializing_if = "Option::is_none")]
    pub occupancy_rate: Option<f64>,
    #[serde(rename = "occupancy_rate_15s", skip_serializing_if = "Option::is_none")]
    pub occupancy_rate_15s: Option<f64>,
    #[serde(rename = "occupancy_rate_5m", skip_serializing_if = "Option::is_none")]
    pub occupancy_rate_5m: Option<f64>,
    #[serde(rename = "occupancy_rate_30m", skip_serializing_if = "Option::is_none")]
    pub occupancy_rate_30m: Option<f64>,
    #[serde(rename = "memory", skip_serializing_if = "Option::is_none")]
    pub memory: Option<f64>,
    #[serde(rename = "vcpus", skip_serializing_if = "Option::is_none")]
    pub vcpus: Option<f64>,
    #[serde(rename = "memory_usage", skip_serializing_if = "Option::is_none")]
    pub memory_usage: Option<f64>,
    #[serde(rename = "wm_memory_usage", skip_serializing_if = "Option::is_none")]
    pub wm_memory_usage: Option<f64>,
    #[serde(rename = "job_isolation", skip_serializing_if = "Option::is_none")]
    pub job_isolation: Option<String>,
    #[serde(rename = "native_mode", skip_serializing_if = "Option::is_none")]
    pub native_mode: Option<bool>,
}

impl WorkerPing {
    pub fn new(worker: String, worker_instance: String, started_at: String, ip: String, jobs_executed: i32, worker_group: String, wm_version: String) -> WorkerPing {
        WorkerPing {
            worker,
            worker_instance,
            last_ping: None,
            started_at,
            ip,
            jobs_executed,
            custom_tags: None,
            worker_group,
            wm_version,
            last_job_id: None,
            last_job_workspace_id: None,
            occupancy_rate: None,
            occupancy_rate_15s: None,
            occupancy_rate_5m: None,
            occupancy_rate_30m: None,
            memory: None,
            vcpus: None,
            memory_usage: None,
            wm_memory_usage: None,
            job_isolation: None,
            native_mode: None,
        }
    }
}

