/*
 * 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 ReqS3Archive {
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "type")]
    pub r#type: models::EnumArchiveType,
    #[serde(rename = "archive_dir", skip_serializing_if = "Option::is_none")]
    pub archive_dir: Option<String>,
    #[serde(rename = "endpoint")]
    pub endpoint: String,
    #[serde(rename = "bucket")]
    pub bucket: String,
    #[serde(rename = "region")]
    pub region: String,
    #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")]
    pub credentials: Option<Box<models::ReqS3Cred>>,
    #[serde(rename = "identity_uuid", skip_serializing_if = "Option::is_none")]
    pub identity_uuid: Option<uuid::Uuid>,
}

impl ReqS3Archive {
    pub fn new(
        id: String,
        r#type: models::EnumArchiveType,
        endpoint: String,
        bucket: String,
        region: String,
    ) -> ReqS3Archive {
        ReqS3Archive {
            id,
            r#type,
            archive_dir: None,
            endpoint,
            bucket,
            region,
            credentials: None,
            identity_uuid: None,
        }
    }
}
