k8s-traefik-api 0.4.1

Bindings for the Kubernetes traefik API
Documentation
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium tlsstores.traefik.io -A -b --derive=Default --derive=PartialEq --smart-derive-elision
// kopium version: 0.21.2

#[allow(unused_imports)]
mod prelude {
    pub use kube::CustomResource;
    pub use typed_builder::TypedBuilder;
    pub use schemars::JsonSchema;
    pub use serde::{Serialize, Deserialize};
}
use self::prelude::*;

/// TLSStoreSpec defines the desired state of a TLSStore.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, TypedBuilder, Default, PartialEq, JsonSchema)]
#[kube(group = "traefik.io", version = "v1alpha1", kind = "TLSStore", plural = "tlsstores")]
#[kube(namespaced)]
#[kube(derive="Default")]
#[kube(derive="PartialEq")]
pub struct TLSStoreSpec {
    /// Certificates is a list of secret names, each secret holding a key/certificate pair to add to the store.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub certificates: Option<Vec<TLSStoreCertificates>>,
    /// DefaultCertificate defines the default certificate configuration.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "defaultCertificate")]
    #[builder(default, setter(strip_option))]
    pub default_certificate: Option<TLSStoreDefaultCertificate>,
    /// DefaultGeneratedCert defines the default generated certificate configuration.
    #[serde(default, skip_serializing_if = "Option::is_none", rename = "defaultGeneratedCert")]
    #[builder(default, setter(strip_option))]
    pub default_generated_cert: Option<TLSStoreDefaultGeneratedCert>,
}

/// Certificate holds a secret name for the TLSStore resource.
#[derive(Serialize, Deserialize, Clone, Debug, TypedBuilder, Default, PartialEq, JsonSchema)]
pub struct TLSStoreCertificates {
    /// SecretName is the name of the referenced Kubernetes Secret to specify the certificate details.
    #[serde(rename = "secretName")]
    pub secret_name: String,
}

/// DefaultCertificate defines the default certificate configuration.
#[derive(Serialize, Deserialize, Clone, Debug, TypedBuilder, Default, PartialEq, JsonSchema)]
pub struct TLSStoreDefaultCertificate {
    /// SecretName is the name of the referenced Kubernetes Secret to specify the certificate details.
    #[serde(rename = "secretName")]
    pub secret_name: String,
}

/// DefaultGeneratedCert defines the default generated certificate configuration.
#[derive(Serialize, Deserialize, Clone, Debug, TypedBuilder, Default, PartialEq, JsonSchema)]
pub struct TLSStoreDefaultGeneratedCert {
    /// Domain is the domain definition for the DefaultCertificate.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub domain: Option<TLSStoreDefaultGeneratedCertDomain>,
    /// Resolver is the name of the resolver that will be used to issue the DefaultCertificate.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub resolver: Option<String>,
}

/// Domain is the domain definition for the DefaultCertificate.
#[derive(Serialize, Deserialize, Clone, Debug, TypedBuilder, Default, PartialEq, JsonSchema)]
pub struct TLSStoreDefaultGeneratedCertDomain {
    /// Main defines the main domain name.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub main: Option<String>,
    /// SANs defines the subject alternative domain names.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    #[builder(default, setter(strip_option))]
    pub sans: Option<Vec<String>>,
}