greentic_setup/engine/
types.rs1use std::collections::BTreeSet;
6use std::path::PathBuf;
7
8use serde_json::{Map as JsonMap, Value};
9
10use crate::plan::{
11 AccessChangeSelection, PackDefaultSelection, PackRemoveSelection, RemoveTarget,
12 TenantSelection, UpdateOp,
13};
14use crate::platform_setup::{PlatformSetupAnswers, StaticRoutesPolicy, TelemetryAnswers};
15
16fn default_true() -> bool {
17 true
18}
19
20#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
25#[serde(deny_unknown_fields)]
26pub struct ProviderEntry {
27 pub kind: String,
29 #[serde(default)]
31 pub display_name: Option<String>,
32 #[serde(default = "default_true")]
36 pub link_bundle: bool,
37 #[serde(default)]
39 pub answers: JsonMap<String, Value>,
40 #[serde(default)]
42 pub provider_id: Option<String>,
43}
44
45#[derive(Clone, Debug, Default)]
47pub struct LoadedAnswers {
48 pub tenant: Option<String>,
49 pub team: Option<String>,
50 pub env: Option<String>,
51 pub platform_setup: PlatformSetupAnswers,
52 pub setup_answers: JsonMap<String, Value>,
53 pub providers: Vec<ProviderEntry>,
55}
56
57#[derive(Clone, Debug, Default)]
59pub struct SetupRequest {
60 pub bundle: PathBuf,
61 pub bundle_name: Option<String>,
62 pub pack_refs: Vec<String>,
63 pub tenants: Vec<TenantSelection>,
64 pub default_assignments: Vec<PackDefaultSelection>,
65 pub providers: Vec<String>,
66 pub update_ops: BTreeSet<UpdateOp>,
67 pub remove_targets: BTreeSet<RemoveTarget>,
68 pub packs_remove: Vec<PackRemoveSelection>,
69 pub providers_remove: Vec<String>,
70 pub tenants_remove: Vec<TenantSelection>,
71 pub access_changes: Vec<AccessChangeSelection>,
72 pub static_routes: StaticRoutesPolicy,
73 pub deployment_targets: Vec<crate::deployment_targets::DeploymentTargetRecord>,
74 pub tunnel: Option<crate::platform_setup::TunnelAnswers>,
75 pub telemetry: Option<TelemetryAnswers>,
76 pub setup_answers: serde_json::Map<String, serde_json::Value>,
77 pub domain_filter: Option<String>,
79 pub parallel: usize,
81 pub backup: bool,
83 pub skip_secrets_init: bool,
85 pub best_effort: bool,
87}
88
89pub struct SetupConfig {
91 pub tenant: String,
92 pub team: Option<String>,
93 pub env: String,
94 pub offline: bool,
95 pub verbose: bool,
96}