/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.2.0
 * 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 GetLogCleanupStatus200Response {
    #[serde(rename = "running")]
    pub running: bool,
    #[serde(rename = "started_at")]
    pub started_at: String,
    #[serde(rename = "finished_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub finished_at: Option<Option<String>>,
    #[serde(rename = "phase")]
    pub phase: String,
    #[serde(rename = "total_service")]
    pub total_service: i64,
    #[serde(rename = "processed_service")]
    pub processed_service: i64,
    #[serde(rename = "total_jobs")]
    pub total_jobs: i64,
    #[serde(rename = "processed_jobs")]
    pub processed_jobs: i64,
    #[serde(rename = "s3_deleted")]
    pub s3_deleted: i64,
    #[serde(rename = "orphans_scanned")]
    pub orphans_scanned: i64,
    #[serde(rename = "orphans_deleted")]
    pub orphans_deleted: i64,
    #[serde(rename = "errors")]
    pub errors: i64,
    #[serde(rename = "last_error", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub last_error: Option<Option<String>>,
}

impl GetLogCleanupStatus200Response {
    pub fn new(running: bool, started_at: String, phase: String, total_service: i64, processed_service: i64, total_jobs: i64, processed_jobs: i64, s3_deleted: i64, orphans_scanned: i64, orphans_deleted: i64, errors: i64) -> GetLogCleanupStatus200Response {
        GetLogCleanupStatus200Response {
            running,
            started_at,
            finished_at: None,
            phase,
            total_service,
            processed_service,
            total_jobs,
            processed_jobs,
            s3_deleted,
            orphans_scanned,
            orphans_deleted,
            errors,
            last_error: None,
        }
    }
}

