/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.2
 * 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 GetObjectStorageUsage200Response {
    #[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 = "current_prefix", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub current_prefix: Option<Option<String>>,
    #[serde(rename = "scanned_objects")]
    pub scanned_objects: i64,
    #[serde(rename = "folders")]
    pub folders: Vec<models::GetObjectStorageUsage200ResponseFoldersInner>,
    #[serde(rename = "error", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub error: Option<Option<String>>,
}

impl GetObjectStorageUsage200Response {
    pub fn new(running: bool, started_at: String, scanned_objects: i64, folders: Vec<models::GetObjectStorageUsage200ResponseFoldersInner>) -> GetObjectStorageUsage200Response {
        GetObjectStorageUsage200Response {
            running,
            started_at,
            finished_at: None,
            current_prefix: None,
            scanned_objects,
            folders,
            error: None,
        }
    }
}

