Skip to main content

vfa_tui/models/
provider.rs

1use serde::{Deserialize, Serialize};
2
3/// Cloud and platform providers represented in the catalog.
4///
5/// Uses kebab-case serialization to match the JSON catalog format.
6/// The design specifies 19 core variants; additional variants are included
7/// to support the full catalog which has grown beyond the original spec.
8#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
9#[serde(rename_all = "kebab-case")]
10pub enum Provider {
11    // Core 19 variants from design spec
12    Aws,
13    Azure,
14    Oracle,
15    Oci,
16    Gcp,
17    Alibaba,
18    Huawei,
19    Ovhcloud,
20    Ionos,
21    Scaleway,
22    Hetzner,
23    Contabo,
24    Kubernetes,
25    Terraform,
26    MultiCloud,
27    Generic,
28    Frontend,
29    Dotnet,
30    Java,
31    Kotlin,
32    Hr,
33    Legal,
34    Salesforce,
35    // Extended variants for full catalog support
36    Accounting,
37    Finance,
38    Netsuite,
39    Sap,
40    Argocd,
41    Backstage,
42    CertManager,
43    Cilium,
44    Claude,
45    Databricks,
46    Falco,
47    Fluxcd,
48    Istio,
49    Kyverno,
50    Marketing,
51    Microsoft,
52    Nvidia,
53    Opentelemetry,
54    Prometheus,
55    Sigstore,
56    Snowflake,
57    Velero,
58    Php,
59    Python,
60    Typescript,
61}
62
63impl std::fmt::Display for Provider {
64    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
65        let s = serde_json::to_value(self)
66            .ok()
67            .and_then(|v| v.as_str().map(|s| s.to_string()))
68            .unwrap_or_else(|| format!("{:?}", self).to_lowercase());
69        write!(f, "{}", s)
70    }
71}