/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.6
 * 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 ImportPgDatabaseRequest {
    /// Source database: 'datatable://name' or '$res:path'
    #[serde(rename = "source")]
    pub source: String,
    /// Target database: 'datatable://name' or '$res:path'
    #[serde(rename = "target")]
    pub target: String,
    /// Override the target database name
    #[serde(rename = "target_dbname_override", skip_serializing_if = "Option::is_none")]
    pub target_dbname_override: Option<String>,
    #[serde(rename = "fork_behavior")]
    pub fork_behavior: ForkBehavior,
}

impl ImportPgDatabaseRequest {
    pub fn new(source: String, target: String, fork_behavior: ForkBehavior) -> ImportPgDatabaseRequest {
        ImportPgDatabaseRequest {
            source,
            target,
            target_dbname_override: None,
            fork_behavior,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ForkBehavior {
    #[serde(rename = "schema_only")]
    SchemaOnly,
    #[serde(rename = "schema_and_data")]
    SchemaAndData,
    #[serde(rename = "keep_original")]
    KeepOriginal,
}

impl Default for ForkBehavior {
    fn default() -> ForkBehavior {
        Self::SchemaOnly
    }
}

