/*
 * Streams API
 *
 * Manage Tapis Streams API.
 *
 * The version of the OpenAPI document: 1
 * Contact: cicsupport@tacc.utexas.edu
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct NewArchiveSettings {
    /// ID of Project to archive
    #[serde(rename = "project_id", skip_serializing_if = "Option::is_none")]
    pub project_id: Option<String>,
    /// ID os System ID to send archive too.
    #[serde(rename = "system_id", skip_serializing_if = "Option::is_none")]
    pub system_id: Option<String>,
    /// The directory path to write archive to on selected System.
    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
    /// The archive file format - zip is currently supported
    #[serde(rename = "archive_format", skip_serializing_if = "Option::is_none")]
    pub archive_format: Option<ArchiveFormat>,
    /// The data measurement format - csv or JSON is currently supported
    #[serde(rename = "data_format", skip_serializing_if = "Option::is_none")]
    pub data_format: Option<DataFormat>,
    /// How often should this archive occur - currently supports one-time_now
    #[serde(rename = "frequency", skip_serializing_if = "Option::is_none")]
    pub frequency: Option<Frequency>,
    /// The range of data to archive_type - all or custom supported
    #[serde(rename = "range", skip_serializing_if = "Option::is_none")]
    pub range: Option<Range>,
    /// A ISO8601 formatted datetime string for the starting time for archival data- only for custom range
    #[serde(rename = "start_date", skip_serializing_if = "Option::is_none")]
    pub start_date: Option<String>,
    /// A ISO8601 formatted datetime string for the end time for archival data - only for custom range
    #[serde(rename = "end_date", skip_serializing_if = "Option::is_none")]
    pub end_date: Option<String>,
}

impl NewArchiveSettings {
    pub fn new() -> NewArchiveSettings {
        NewArchiveSettings {
            project_id: None,
            system_id: None,
            path: None,
            archive_format: None,
            data_format: None,
            frequency: None,
            range: None,
            start_date: None,
            end_date: None,
        }
    }
}
/// The archive file format - zip is currently supported
#[derive(
    Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
)]
pub enum ArchiveFormat {
    #[serde(rename = "zip")]
    #[default]
    Zip,
}

/// The data measurement format - csv or JSON is currently supported
#[derive(
    Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
)]
pub enum DataFormat {
    #[serde(rename = "csv")]
    #[default]
    Csv,
    #[serde(rename = "json")]
    Json,
}

/// How often should this archive occur - currently supports one-time_now
#[derive(
    Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
)]
pub enum Frequency {
    #[serde(rename = "one-time")]
    #[default]
    OneTime,
}

/// The range of data to archive_type - all or custom supported
#[derive(
    Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
)]
pub enum Range {
    #[serde(rename = "custom")]
    #[default]
    Custom,
    #[serde(rename = "all")]
    All,
}
