wasmer_deploy_schema/schema/
network_gateway.rs

1use serde::{Deserialize, Serialize};
2
3use super::Merge;
4
5#[derive(Serialize, Deserialize, PartialEq, Eq, Clone, Debug, schemars::JsonSchema)]
6pub struct CapabilityNetworkGatewayV1 {
7    #[serde(skip_serializing_if = "Option::is_none")]
8    pub enforce_https: Option<bool>,
9
10    /// List of enabled domain names.
11    #[serde(skip_serializing_if = "Option::is_none")]
12    pub domains: Option<Vec<String>>,
13}
14
15impl Merge for CapabilityNetworkGatewayV1 {
16    fn merge_extend(self, other: &Self) -> Self {
17        Self {
18            enforce_https: self.enforce_https.merge_extend(&other.enforce_https),
19            domains: self.domains.merge_extend(&other.domains),
20        }
21    }
22}
23
24#[derive(Serialize, Deserialize, PartialEq, Eq, Clone, Debug, schemars::JsonSchema)]
25pub struct NetworkGatewayTlsV1 {
26    pub automatic_certificates: Option<NetworkGatewayTlsAutoCertsV1>,
27}
28
29#[derive(Serialize, Deserialize, PartialEq, Eq, Clone, Debug, schemars::JsonSchema)]
30pub struct NetworkGatewayTlsAutoCertsV1 {
31    /// Contact email to use for generated certificates.
32    pub contact_email: Option<String>,
33    /// Let's encrypt compatible certificate issuer API url.
34    pub issuer_api_url: Option<String>,
35}