1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// WARNING: generated by kopium - manual changes will be overwritten
use kube::CustomResource;
use schemars::JsonSchema;
use serde::{Serialize, Deserialize};

/// Spec defines the desired state of ReferenceGrant.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema)]
#[kube(group = "gateway.networking.k8s.io", version = "v1beta1", kind = "ReferenceGrant", plural = "referencegrants")]
#[kube(namespaced)]
pub struct ReferenceGrantSpec {
    /// From describes the trusted namespaces and kinds that can reference the resources described in "To". Each entry in this list must be considered to be an additional place that references can be valid from, or to put this another way, entries must be combined using OR. 
    ///  Support: Core
    pub from: Vec<ReferenceGrantFrom>,
    /// To describes the resources that may be referenced by the resources described in "From". Each entry in this list must be considered to be an additional place that references can be valid to, or to put this another way, entries must be combined using OR. 
    ///  Support: Core
    pub to: Vec<ReferenceGrantTo>,
}

/// ReferenceGrantFrom describes trusted namespaces and kinds.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub struct ReferenceGrantFrom {
    /// Group is the group of the referent. When empty, the Kubernetes core API group is inferred. 
    ///  Support: Core
    pub group: String,
    /// Kind is the kind of the referent. Although implementations may support additional resources, the following types are part of the "Core" support level for this field. 
    ///  When used to permit a SecretObjectReference: 
    ///  * Gateway 
    ///  When used to permit a BackendObjectReference: 
    ///  * GRPCRoute * HTTPRoute * TCPRoute * TLSRoute * UDPRoute
    pub kind: String,
    /// Namespace is the namespace of the referent. 
    ///  Support: Core
    pub namespace: String,
}

/// ReferenceGrantTo describes what Kinds are allowed as targets of the references.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
pub struct ReferenceGrantTo {
    /// Group is the group of the referent. When empty, the Kubernetes core API group is inferred. 
    ///  Support: Core
    pub group: String,
    /// Kind is the kind of the referent. Although implementations may support additional resources, the following types are part of the "Core" support level for this field: 
    ///  * Secret when used to permit a SecretObjectReference * Service when used to permit a BackendObjectReference
    pub kind: String,
    /// Name is the name of the referent. When unspecified, this policy refers to all resources of the specified Group and Kind in the local namespace.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}