Skip to main content

orvanta_api/models/
dry_run_report.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: 6.5.0
7 * Contact: contact@orvanta.cloud
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// 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.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct DryRunReport {
17    /// Row count of the source table (may be a planner estimate depending on the connector).
18    #[serde(rename = "source_row_count")]
19    pub source_row_count: i64,
20    #[serde(rename = "mapping")]
21    pub mapping: Box<models::MappingReport>,
22    /// 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).
23    #[serde(rename = "sample_rows")]
24    pub sample_rows: Vec<std::collections::HashMap<String, serde_json::Value>>,
25    #[serde(rename = "source_capabilities")]
26    pub source_capabilities: Box<models::Capabilities>,
27    #[serde(rename = "target_capabilities")]
28    pub target_capabilities: Box<models::Capabilities>,
29}
30
31impl DryRunReport {
32    /// 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.
33    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 {
34        DryRunReport {
35            source_row_count,
36            mapping: Box::new(mapping),
37            sample_rows,
38            source_capabilities: Box::new(source_capabilities),
39            target_capabilities: Box::new(target_capabilities),
40        }
41    }
42}
43