/*
 * rivet-api-public
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 2.3.0-rc.11
 * Contact: developer@rivet.gg
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Runner {
    #[serde(rename = "create_ts")]
    pub create_ts: i64,
    #[serde(rename = "datacenter")]
    pub datacenter: String,
    #[serde(rename = "drain_ts", skip_serializing_if = "Option::is_none")]
    pub drain_ts: Option<i64>,
    #[serde(rename = "key")]
    pub key: String,
    #[serde(rename = "last_connected_ts", skip_serializing_if = "Option::is_none")]
    pub last_connected_ts: Option<i64>,
    #[serde(rename = "last_ping_ts")]
    pub last_ping_ts: i64,
    #[serde(rename = "last_rtt")]
    pub last_rtt: i32,
    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<serde_json::Value>,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "namespace_id")]
    pub namespace_id: String,
    #[serde(rename = "remaining_slots")]
    pub remaining_slots: i32,
    #[serde(rename = "runner_id")]
    pub runner_id: String,
    #[serde(rename = "stop_ts", skip_serializing_if = "Option::is_none")]
    pub stop_ts: Option<i64>,
    #[serde(rename = "total_slots")]
    pub total_slots: i32,
    #[serde(rename = "version")]
    pub version: i32,
}

impl Runner {
    pub fn new(create_ts: i64, datacenter: String, key: String, last_ping_ts: i64, last_rtt: i32, name: String, namespace_id: String, remaining_slots: i32, runner_id: String, total_slots: i32, version: i32) -> Runner {
        Runner {
            create_ts,
            datacenter,
            drain_ts: None,
            key,
            last_connected_ts: None,
            last_ping_ts,
            last_rtt,
            metadata: None,
            name,
            namespace_id,
            remaining_slots,
            runner_id,
            stop_ts: None,
            total_slots,
            version,
        }
    }
}

