/*
 * Tapis Workflows API
 *
 * Create and manage pipelines
 *
 * The version of the OpenAPI document: 1.6.0
 * 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 S3Archive {
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "type")]
    pub r#type: models::EnumArchiveType,
    #[serde(rename = "group")]
    pub group: uuid::Uuid,
    #[serde(rename = "tenant_id")]
    pub tenant_id: String,
    #[serde(rename = "owner")]
    pub owner: String,
    #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")]
    pub uuid: Option<uuid::Uuid>,
    #[serde(rename = "archive_dir")]
    pub archive_dir: String,
    #[serde(rename = "endpoint")]
    pub endpoint: String,
    #[serde(rename = "bucket")]
    pub bucket: String,
    #[serde(rename = "region")]
    pub region: String,
}

impl S3Archive {
    pub fn new(
        id: String,
        r#type: models::EnumArchiveType,
        group: uuid::Uuid,
        tenant_id: String,
        owner: String,
        archive_dir: String,
        endpoint: String,
        bucket: String,
        region: String,
    ) -> S3Archive {
        S3Archive {
            id,
            r#type,
            group,
            tenant_id,
            owner,
            uuid: None,
            archive_dir,
            endpoint,
            bucket,
            region,
        }
    }
}
