Skip to main content

orvanta_api/models/
new_data_migration.rs

1/*
2 * Orvanta API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 4.1.0
7 * Contact: contact@orvanta.cloud
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// NewDataMigration : The body of `create` / `update` for a saved data-migration definition (#1220). `source_resource_path` / `target_resource_path` name *resources*; credentials are never stored, and are resolved fresh through RLS on every run. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct NewDataMigration {
17    #[serde(rename = "path")]
18    pub path: String,
19    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
20    pub summary: Option<String>,
21    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
22    pub description: Option<String>,
23    #[serde(rename = "source_resource_path")]
24    pub source_resource_path: String,
25    #[serde(rename = "target_resource_path")]
26    pub target_resource_path: String,
27    #[serde(rename = "source_table")]
28    pub source_table: String,
29    #[serde(rename = "target_table")]
30    pub target_table: String,
31    #[serde(rename = "mapping", skip_serializing_if = "Option::is_none")]
32    pub mapping: Option<Vec<models::ColumnMapping>>,
33    #[serde(rename = "options", skip_serializing_if = "Option::is_none")]
34    pub options: Option<Box<models::DataMigrationOptions>>,
35    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
36    pub labels: Option<Vec<String>>,
37}
38
39impl NewDataMigration {
40    /// The body of `create` / `update` for a saved data-migration definition (#1220). `source_resource_path` / `target_resource_path` name *resources*; credentials are never stored, and are resolved fresh through RLS on every run. 
41    pub fn new(path: String, source_resource_path: String, target_resource_path: String, source_table: String, target_table: String) -> NewDataMigration {
42        NewDataMigration {
43            path,
44            summary: None,
45            description: None,
46            source_resource_path,
47            target_resource_path,
48            source_table,
49            target_table,
50            mapping: None,
51            options: None,
52            labels: None,
53        }
54    }
55}
56