orvanta_api/models/data_migration_options.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/// DataMigrationOptions : Everything about how a run behaves that is not the mapping itself. Stored in `data_migration.options` as JSONB, so an unknown key is dropped on rewrite rather than corrupting the row -- every field is optional and defaulted.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct DataMigrationOptions {
17 /// Rows per batch. Omitted means the engine default.
18 #[serde(rename = "batch_size", skip_serializing_if = "Option::is_none")]
19 pub batch_size: Option<i64>,
20 #[serde(rename = "conflict_mode", skip_serializing_if = "Option::is_none")]
21 pub conflict_mode: Option<ConflictMode>,
22}
23
24impl DataMigrationOptions {
25 /// Everything about how a run behaves that is not the mapping itself. Stored in `data_migration.options` as JSONB, so an unknown key is dropped on rewrite rather than corrupting the row -- every field is optional and defaulted.
26 pub fn new() -> DataMigrationOptions {
27 DataMigrationOptions {
28 batch_size: None,
29 conflict_mode: None,
30 }
31 }
32}
33///
34#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
35pub enum ConflictMode {
36 #[serde(rename = "error")]
37 Error,
38 #[serde(rename = "skip")]
39 Skip,
40}
41
42impl Default for ConflictMode {
43 fn default() -> ConflictMode {
44 Self::Error
45 }
46}
47