orvanta-api 6.5.0

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 6.5.0
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// DryRunReport : Read-only preview of a migration. Alongside the mapping validation it carries both connectors' declared `Capabilities` verbatim, so a caller can render what a connector *cannot* do -- \"this target is read-only\", \"this run is not resumable\" -- rather than inferring it from which warnings happen to appear in `mapping`. A dry run holds the target through a read-only handle precisely so it cannot write, so `target_capabilities.writable` is the only way it can report a read-only target.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DryRunReport {
    /// Row count of the source table (may be a planner estimate depending on the connector).
    #[serde(rename = "source_row_count")]
    pub source_row_count: i64,
    #[serde(rename = "mapping")]
    pub mapping: Box<models::MappingReport>,
    /// Up to 5 source rows, remapped to target column names, showing exactly what a real run would insert. Empty if the mapping has errors (nothing would be inserted).
    #[serde(rename = "sample_rows")]
    pub sample_rows: Vec<std::collections::HashMap<String, serde_json::Value>>,
    #[serde(rename = "source_capabilities")]
    pub source_capabilities: Box<models::Capabilities>,
    #[serde(rename = "target_capabilities")]
    pub target_capabilities: Box<models::Capabilities>,
}

impl DryRunReport {
    /// Read-only preview of a migration. Alongside the mapping validation it carries both connectors' declared `Capabilities` verbatim, so a caller can render what a connector *cannot* do -- \"this target is read-only\", \"this run is not resumable\" -- rather than inferring it from which warnings happen to appear in `mapping`. A dry run holds the target through a read-only handle precisely so it cannot write, so `target_capabilities.writable` is the only way it can report a read-only target.
    pub fn new(source_row_count: i64, mapping: models::MappingReport, sample_rows: Vec<std::collections::HashMap<String, serde_json::Value>>, source_capabilities: models::Capabilities, target_capabilities: models::Capabilities) -> DryRunReport {
        DryRunReport {
            source_row_count,
            mapping: Box::new(mapping),
            sample_rows,
            source_capabilities: Box::new(source_capabilities),
            target_capabilities: Box::new(target_capabilities),
        }
    }
}