Skip to main content

greentic_setup/engine/
types.rs

1//! Core types for the setup engine.
2//!
3//! Contains request/config types used across the engine.
4
5use 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};
15
16/// Loaded answers from a JSON/YAML file.
17#[derive(Clone, Debug, Default)]
18pub struct LoadedAnswers {
19    pub platform_setup: PlatformSetupAnswers,
20    pub setup_answers: JsonMap<String, Value>,
21}
22
23/// The request object that drives plan building.
24#[derive(Clone, Debug, Default)]
25pub struct SetupRequest {
26    pub bundle: PathBuf,
27    pub bundle_name: Option<String>,
28    pub pack_refs: Vec<String>,
29    pub tenants: Vec<TenantSelection>,
30    pub default_assignments: Vec<PackDefaultSelection>,
31    pub providers: Vec<String>,
32    pub update_ops: BTreeSet<UpdateOp>,
33    pub remove_targets: BTreeSet<RemoveTarget>,
34    pub packs_remove: Vec<PackRemoveSelection>,
35    pub providers_remove: Vec<String>,
36    pub tenants_remove: Vec<TenantSelection>,
37    pub access_changes: Vec<AccessChangeSelection>,
38    pub static_routes: StaticRoutesPolicy,
39    pub deployment_targets: Vec<crate::deployment_targets::DeploymentTargetRecord>,
40    pub setup_answers: serde_json::Map<String, serde_json::Value>,
41    /// Filter by provider domain (messaging, events, secrets, oauth).
42    pub domain_filter: Option<String>,
43    /// Number of parallel setup operations.
44    pub parallel: usize,
45    /// Backup existing config before setup.
46    pub backup: bool,
47    /// Skip secrets initialization.
48    pub skip_secrets_init: bool,
49    /// Continue on error (best effort).
50    pub best_effort: bool,
51}
52
53/// Configuration for the setup engine.
54pub struct SetupConfig {
55    pub tenant: String,
56    pub team: Option<String>,
57    pub env: String,
58    pub offline: bool,
59    pub verbose: bool,
60}