cluster_api_rs/api/
capi_clusterclass.rs

1// WARNING: generated by kopium - manual changes will be overwritten
2// kopium command: kopium --smart-derive-elision -D Default -D PartialEq -A -d -f -
3// kopium version: 0.21.2
4
5#[allow(unused_imports)]
6mod prelude {
7    pub use k8s_openapi::api::core::v1::ObjectReference;
8    pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
9    pub use k8s_openapi::apimachinery::pkg::util::intstr::IntOrString;
10    pub use kube::CustomResource;
11    pub use schemars::JsonSchema;
12    pub use serde::{Deserialize, Serialize};
13    pub use std::collections::BTreeMap;
14}
15use self::prelude::*;
16
17/// spec is the desired state of ClusterClass.
18#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
19#[kube(
20    group = "cluster.x-k8s.io",
21    version = "v1beta1",
22    kind = "ClusterClass",
23    plural = "clusterclasses"
24)]
25#[kube(namespaced)]
26#[kube(status = "ClusterClassStatus")]
27#[kube(derive = "Default")]
28#[kube(derive = "PartialEq")]
29pub struct ClusterClassSpec {
30    /// availabilityGates specifies additional conditions to include when evaluating Cluster Available condition.
31    ///
32    /// NOTE: this field is considered only for computing v1beta2 conditions.
33    /// NOTE: If a Cluster is using this ClusterClass, and this Cluster defines a custom list of availabilityGates,
34    /// such list overrides availabilityGates defined in this field.
35    #[serde(
36        default,
37        skip_serializing_if = "Option::is_none",
38        rename = "availabilityGates"
39    )]
40    pub availability_gates: Option<Vec<ClusterClassAvailabilityGates>>,
41    /// controlPlane is a reference to a local struct that holds the details
42    /// for provisioning the Control Plane for the Cluster.
43    #[serde(
44        default,
45        skip_serializing_if = "Option::is_none",
46        rename = "controlPlane"
47    )]
48    pub control_plane: Option<ClusterClassControlPlane>,
49    /// infrastructure is a reference to a provider-specific template that holds
50    /// the details for provisioning infrastructure specific cluster
51    /// for the underlying provider.
52    /// The underlying provider is responsible for the implementation
53    /// of the template to an infrastructure cluster.
54    #[serde(default, skip_serializing_if = "Option::is_none")]
55    pub infrastructure: Option<ClusterClassInfrastructure>,
56    /// infrastructureNamingStrategy allows changing the naming pattern used when creating the infrastructure object.
57    #[serde(
58        default,
59        skip_serializing_if = "Option::is_none",
60        rename = "infrastructureNamingStrategy"
61    )]
62    pub infrastructure_naming_strategy: Option<ClusterClassInfrastructureNamingStrategy>,
63    /// patches defines the patches which are applied to customize
64    /// referenced templates of a ClusterClass.
65    /// Note: Patches will be applied in the order of the array.
66    #[serde(default, skip_serializing_if = "Option::is_none")]
67    pub patches: Option<Vec<ClusterClassPatches>>,
68    /// variables defines the variables which can be configured
69    /// in the Cluster topology and are then used in patches.
70    #[serde(default, skip_serializing_if = "Option::is_none")]
71    pub variables: Option<Vec<ClusterClassVariables>>,
72    /// workers describes the worker nodes for the cluster.
73    /// It is a collection of node types which can be used to create
74    /// the worker nodes of the cluster.
75    #[serde(default, skip_serializing_if = "Option::is_none")]
76    pub workers: Option<ClusterClassWorkers>,
77}
78
79/// ClusterAvailabilityGate contains the type of a Cluster condition to be used as availability gate.
80#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
81pub struct ClusterClassAvailabilityGates {
82    /// conditionType refers to a condition with matching type in the Cluster's condition list.
83    /// If the conditions doesn't exist, it will be treated as unknown.
84    /// Note: Both Cluster API conditions or conditions added by 3rd party controllers can be used as availability gates.
85    #[serde(rename = "conditionType")]
86    pub condition_type: String,
87    /// polarity of the conditionType specified in this availabilityGate.
88    /// Valid values are Positive, Negative and omitted.
89    /// When omitted, the default behaviour will be Positive.
90    /// A positive polarity means that the condition should report a true status under normal conditions.
91    /// A negative polarity means that the condition should report a false status under normal conditions.
92    #[serde(default, skip_serializing_if = "Option::is_none")]
93    pub polarity: Option<ClusterClassAvailabilityGatesPolarity>,
94}
95
96/// ClusterAvailabilityGate contains the type of a Cluster condition to be used as availability gate.
97#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
98pub enum ClusterClassAvailabilityGatesPolarity {
99    Positive,
100    Negative,
101}
102
103/// controlPlane is a reference to a local struct that holds the details
104/// for provisioning the Control Plane for the Cluster.
105#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
106pub struct ClusterClassControlPlane {
107    /// machineHealthCheck defines a MachineHealthCheck for this ControlPlaneClass.
108    /// This field is supported if and only if the ControlPlane provider template
109    /// referenced above is Machine based and supports setting replicas.
110    #[serde(
111        default,
112        skip_serializing_if = "Option::is_none",
113        rename = "machineHealthCheck"
114    )]
115    pub machine_health_check: Option<ClusterClassControlPlaneMachineHealthCheck>,
116    /// machineInfrastructure defines the metadata and infrastructure information
117    /// for control plane machines.
118    ///
119    /// This field is supported if and only if the control plane provider template
120    /// referenced above is Machine based and supports setting replicas.
121    #[serde(
122        default,
123        skip_serializing_if = "Option::is_none",
124        rename = "machineInfrastructure"
125    )]
126    pub machine_infrastructure: Option<ClusterClassControlPlaneMachineInfrastructure>,
127    /// metadata is the metadata applied to the ControlPlane and the Machines of the ControlPlane
128    /// if the ControlPlaneTemplate referenced is machine based. If not, it is applied only to the
129    /// ControlPlane.
130    /// At runtime this metadata is merged with the corresponding metadata from the topology.
131    ///
132    /// This field is supported if and only if the control plane provider template
133    /// referenced is Machine based.
134    #[serde(default, skip_serializing_if = "Option::is_none")]
135    pub metadata: Option<ClusterClassControlPlaneMetadata>,
136    /// namingStrategy allows changing the naming pattern used when creating the control plane provider object.
137    #[serde(
138        default,
139        skip_serializing_if = "Option::is_none",
140        rename = "namingStrategy"
141    )]
142    pub naming_strategy: Option<ClusterClassControlPlaneNamingStrategy>,
143    /// nodeDeletionTimeout defines how long the controller will attempt to delete the Node that the Machine
144    /// hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely.
145    /// Defaults to 10 seconds.
146    /// NOTE: This value can be overridden while defining a Cluster.Topology.
147    #[serde(
148        default,
149        skip_serializing_if = "Option::is_none",
150        rename = "nodeDeletionTimeout"
151    )]
152    pub node_deletion_timeout: Option<String>,
153    /// nodeDrainTimeout is the total amount of time that the controller will spend on draining a node.
154    /// The default value is 0, meaning that the node can be drained without any time limitations.
155    /// NOTE: NodeDrainTimeout is different from `kubectl drain --timeout`
156    /// NOTE: This value can be overridden while defining a Cluster.Topology.
157    #[serde(
158        default,
159        skip_serializing_if = "Option::is_none",
160        rename = "nodeDrainTimeout"
161    )]
162    pub node_drain_timeout: Option<String>,
163    /// nodeVolumeDetachTimeout is the total amount of time that the controller will spend on waiting for all volumes
164    /// to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations.
165    /// NOTE: This value can be overridden while defining a Cluster.Topology.
166    #[serde(
167        default,
168        skip_serializing_if = "Option::is_none",
169        rename = "nodeVolumeDetachTimeout"
170    )]
171    pub node_volume_detach_timeout: Option<String>,
172    /// readinessGates specifies additional conditions to include when evaluating Machine Ready condition.
173    ///
174    /// This field can be used e.g. to instruct the machine controller to include in the computation for Machine's ready
175    /// computation a condition, managed by an external controllers, reporting the status of special software/hardware installed on the Machine.
176    ///
177    /// NOTE: This field is considered only for computing v1beta2 conditions.
178    /// NOTE: If a Cluster defines a custom list of readinessGates for the control plane,
179    /// such list overrides readinessGates defined in this field.
180    /// NOTE: Specific control plane provider implementations might automatically extend the list of readinessGates;
181    /// e.g. the kubeadm control provider adds ReadinessGates for the APIServerPodHealthy, SchedulerPodHealthy conditions, etc.
182    #[serde(
183        default,
184        skip_serializing_if = "Option::is_none",
185        rename = "readinessGates"
186    )]
187    pub readiness_gates: Option<Vec<ClusterClassControlPlaneReadinessGates>>,
188    /// ref is a required reference to a custom resource
189    /// offered by a provider.
190    #[serde(rename = "ref")]
191    pub r#ref: ObjectReference,
192}
193
194/// machineHealthCheck defines a MachineHealthCheck for this ControlPlaneClass.
195/// This field is supported if and only if the ControlPlane provider template
196/// referenced above is Machine based and supports setting replicas.
197#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
198pub struct ClusterClassControlPlaneMachineHealthCheck {
199    /// maxUnhealthy specifies the maximum number of unhealthy machines allowed.
200    /// Any further remediation is only allowed if at most "maxUnhealthy" machines selected by
201    /// "selector" are not healthy.
202    #[serde(
203        default,
204        skip_serializing_if = "Option::is_none",
205        rename = "maxUnhealthy"
206    )]
207    pub max_unhealthy: Option<IntOrString>,
208    /// nodeStartupTimeout allows to set the maximum time for MachineHealthCheck
209    /// to consider a Machine unhealthy if a corresponding Node isn't associated
210    /// through a `Spec.ProviderID` field.
211    ///
212    /// The duration set in this field is compared to the greatest of:
213    /// - Cluster's infrastructure ready condition timestamp (if and when available)
214    /// - Control Plane's initialized condition timestamp (if and when available)
215    /// - Machine's infrastructure ready condition timestamp (if and when available)
216    /// - Machine's metadata creation timestamp
217    ///
218    /// Defaults to 10 minutes.
219    /// If you wish to disable this feature, set the value explicitly to 0.
220    #[serde(
221        default,
222        skip_serializing_if = "Option::is_none",
223        rename = "nodeStartupTimeout"
224    )]
225    pub node_startup_timeout: Option<String>,
226    /// remediationTemplate is a reference to a remediation template
227    /// provided by an infrastructure provider.
228    ///
229    /// This field is completely optional, when filled, the MachineHealthCheck controller
230    /// creates a new object from the template referenced and hands off remediation of the machine to
231    /// a controller that lives outside of Cluster API.
232    #[serde(
233        default,
234        skip_serializing_if = "Option::is_none",
235        rename = "remediationTemplate"
236    )]
237    pub remediation_template: Option<ObjectReference>,
238    /// unhealthyConditions contains a list of the conditions that determine
239    /// whether a node is considered unhealthy. The conditions are combined in a
240    /// logical OR, i.e. if any of the conditions is met, the node is unhealthy.
241    #[serde(
242        default,
243        skip_serializing_if = "Option::is_none",
244        rename = "unhealthyConditions"
245    )]
246    pub unhealthy_conditions:
247        Option<Vec<ClusterClassControlPlaneMachineHealthCheckUnhealthyConditions>>,
248    /// unhealthyRange specifies the range of unhealthy machines allowed.
249    /// Any further remediation is only allowed if the number of machines selected by "selector" as not healthy
250    /// is within the range of "unhealthyRange". Takes precedence over maxUnhealthy.
251    /// Eg. "[3-5]" - This means that remediation will be allowed only when:
252    /// (a) there are at least 3 unhealthy machines (and)
253    /// (b) there are at most 5 unhealthy machines
254    #[serde(
255        default,
256        skip_serializing_if = "Option::is_none",
257        rename = "unhealthyRange"
258    )]
259    pub unhealthy_range: Option<String>,
260}
261
262/// remediationTemplate is a reference to a remediation template
263/// provided by an infrastructure provider.
264///
265/// This field is completely optional, when filled, the MachineHealthCheck controller
266/// creates a new object from the template referenced and hands off remediation of the machine to
267/// a controller that lives outside of Cluster API.
268#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
269pub struct ClusterClassControlPlaneMachineHealthCheckRemediationTemplate {
270    /// API version of the referent.
271    #[serde(
272        default,
273        skip_serializing_if = "Option::is_none",
274        rename = "apiVersion"
275    )]
276    pub api_version: Option<String>,
277    /// If referring to a piece of an object instead of an entire object, this string
278    /// should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
279    /// For example, if the object reference is to a container within a pod, this would take on a value like:
280    /// "spec.containers{name}" (where "name" refers to the name of the container that triggered
281    /// the event) or if no container name is specified "spec.containers[2]" (container with
282    /// index 2 in this pod). This syntax is chosen only to have some well-defined way of
283    /// referencing a part of an object.
284    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldPath")]
285    pub field_path: Option<String>,
286    /// Kind of the referent.
287    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
288    #[serde(default, skip_serializing_if = "Option::is_none")]
289    pub kind: Option<String>,
290    /// Name of the referent.
291    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
292    #[serde(default, skip_serializing_if = "Option::is_none")]
293    pub name: Option<String>,
294    /// Namespace of the referent.
295    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
296    #[serde(default, skip_serializing_if = "Option::is_none")]
297    pub namespace: Option<String>,
298    /// Specific resourceVersion to which this reference is made, if any.
299    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
300    #[serde(
301        default,
302        skip_serializing_if = "Option::is_none",
303        rename = "resourceVersion"
304    )]
305    pub resource_version: Option<String>,
306    /// UID of the referent.
307    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
308    #[serde(default, skip_serializing_if = "Option::is_none")]
309    pub uid: Option<String>,
310}
311
312/// UnhealthyCondition represents a Node condition type and value with a timeout
313/// specified as a duration.  When the named condition has been in the given
314/// status for at least the timeout value, a node is considered unhealthy.
315#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
316pub struct ClusterClassControlPlaneMachineHealthCheckUnhealthyConditions {
317    /// status of the condition, one of True, False, Unknown.
318    pub status: String,
319    /// timeout is the duration that a node must be in a given status for,
320    /// after which the node is considered unhealthy.
321    /// For example, with a value of "1h", the node must match the status
322    /// for at least 1 hour before being considered unhealthy.
323    pub timeout: String,
324    /// type of Node condition
325    #[serde(rename = "type")]
326    pub r#type: String,
327}
328
329/// machineInfrastructure defines the metadata and infrastructure information
330/// for control plane machines.
331///
332/// This field is supported if and only if the control plane provider template
333/// referenced above is Machine based and supports setting replicas.
334#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
335pub struct ClusterClassControlPlaneMachineInfrastructure {
336    /// ref is a required reference to a custom resource
337    /// offered by a provider.
338    #[serde(rename = "ref")]
339    pub r#ref: ObjectReference,
340}
341
342/// ref is a required reference to a custom resource
343/// offered by a provider.
344#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
345pub struct ClusterClassControlPlaneMachineInfrastructureRef {
346    /// API version of the referent.
347    #[serde(
348        default,
349        skip_serializing_if = "Option::is_none",
350        rename = "apiVersion"
351    )]
352    pub api_version: Option<String>,
353    /// If referring to a piece of an object instead of an entire object, this string
354    /// should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
355    /// For example, if the object reference is to a container within a pod, this would take on a value like:
356    /// "spec.containers{name}" (where "name" refers to the name of the container that triggered
357    /// the event) or if no container name is specified "spec.containers[2]" (container with
358    /// index 2 in this pod). This syntax is chosen only to have some well-defined way of
359    /// referencing a part of an object.
360    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldPath")]
361    pub field_path: Option<String>,
362    /// Kind of the referent.
363    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
364    #[serde(default, skip_serializing_if = "Option::is_none")]
365    pub kind: Option<String>,
366    /// Name of the referent.
367    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
368    #[serde(default, skip_serializing_if = "Option::is_none")]
369    pub name: Option<String>,
370    /// Namespace of the referent.
371    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
372    #[serde(default, skip_serializing_if = "Option::is_none")]
373    pub namespace: Option<String>,
374    /// Specific resourceVersion to which this reference is made, if any.
375    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
376    #[serde(
377        default,
378        skip_serializing_if = "Option::is_none",
379        rename = "resourceVersion"
380    )]
381    pub resource_version: Option<String>,
382    /// UID of the referent.
383    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
384    #[serde(default, skip_serializing_if = "Option::is_none")]
385    pub uid: Option<String>,
386}
387
388/// metadata is the metadata applied to the ControlPlane and the Machines of the ControlPlane
389/// if the ControlPlaneTemplate referenced is machine based. If not, it is applied only to the
390/// ControlPlane.
391/// At runtime this metadata is merged with the corresponding metadata from the topology.
392///
393/// This field is supported if and only if the control plane provider template
394/// referenced is Machine based.
395#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
396pub struct ClusterClassControlPlaneMetadata {
397    /// annotations is an unstructured key value map stored with a resource that may be
398    /// set by external tools to store and retrieve arbitrary metadata. They are not
399    /// queryable and should be preserved when modifying objects.
400    /// More info: http://kubernetes.io/docs/user-guide/annotations
401    #[serde(default, skip_serializing_if = "Option::is_none")]
402    pub annotations: Option<BTreeMap<String, String>>,
403    /// labels is a map of string keys and values that can be used to organize and categorize
404    /// (scope and select) objects. May match selectors of replication controllers
405    /// and services.
406    /// More info: http://kubernetes.io/docs/user-guide/labels
407    #[serde(default, skip_serializing_if = "Option::is_none")]
408    pub labels: Option<BTreeMap<String, String>>,
409}
410
411/// namingStrategy allows changing the naming pattern used when creating the control plane provider object.
412#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
413pub struct ClusterClassControlPlaneNamingStrategy {
414    /// template defines the template to use for generating the name of the ControlPlane object.
415    /// If not defined, it will fallback to `{{ .cluster.name }}-{{ .random }}`.
416    /// If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will
417    /// get concatenated with a random suffix of length 5.
418    /// The templating mechanism provides the following arguments:
419    /// * `.cluster.name`: The name of the cluster object.
420    /// * `.random`: A random alphanumeric string, without vowels, of length 5.
421    #[serde(default, skip_serializing_if = "Option::is_none")]
422    pub template: Option<String>,
423}
424
425/// MachineReadinessGate contains the type of a Machine condition to be used as a readiness gate.
426#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
427pub struct ClusterClassControlPlaneReadinessGates {
428    /// conditionType refers to a condition with matching type in the Machine's condition list.
429    /// If the conditions doesn't exist, it will be treated as unknown.
430    /// Note: Both Cluster API conditions or conditions added by 3rd party controllers can be used as readiness gates.
431    #[serde(rename = "conditionType")]
432    pub condition_type: String,
433    /// polarity of the conditionType specified in this readinessGate.
434    /// Valid values are Positive, Negative and omitted.
435    /// When omitted, the default behaviour will be Positive.
436    /// A positive polarity means that the condition should report a true status under normal conditions.
437    /// A negative polarity means that the condition should report a false status under normal conditions.
438    #[serde(default, skip_serializing_if = "Option::is_none")]
439    pub polarity: Option<ClusterClassControlPlaneReadinessGatesPolarity>,
440}
441
442/// MachineReadinessGate contains the type of a Machine condition to be used as a readiness gate.
443#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
444pub enum ClusterClassControlPlaneReadinessGatesPolarity {
445    Positive,
446    Negative,
447}
448
449/// ref is a required reference to a custom resource
450/// offered by a provider.
451#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
452pub struct ClusterClassControlPlaneRef {
453    /// API version of the referent.
454    #[serde(
455        default,
456        skip_serializing_if = "Option::is_none",
457        rename = "apiVersion"
458    )]
459    pub api_version: Option<String>,
460    /// If referring to a piece of an object instead of an entire object, this string
461    /// should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
462    /// For example, if the object reference is to a container within a pod, this would take on a value like:
463    /// "spec.containers{name}" (where "name" refers to the name of the container that triggered
464    /// the event) or if no container name is specified "spec.containers[2]" (container with
465    /// index 2 in this pod). This syntax is chosen only to have some well-defined way of
466    /// referencing a part of an object.
467    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldPath")]
468    pub field_path: Option<String>,
469    /// Kind of the referent.
470    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
471    #[serde(default, skip_serializing_if = "Option::is_none")]
472    pub kind: Option<String>,
473    /// Name of the referent.
474    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
475    #[serde(default, skip_serializing_if = "Option::is_none")]
476    pub name: Option<String>,
477    /// Namespace of the referent.
478    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
479    #[serde(default, skip_serializing_if = "Option::is_none")]
480    pub namespace: Option<String>,
481    /// Specific resourceVersion to which this reference is made, if any.
482    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
483    #[serde(
484        default,
485        skip_serializing_if = "Option::is_none",
486        rename = "resourceVersion"
487    )]
488    pub resource_version: Option<String>,
489    /// UID of the referent.
490    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
491    #[serde(default, skip_serializing_if = "Option::is_none")]
492    pub uid: Option<String>,
493}
494
495/// infrastructure is a reference to a provider-specific template that holds
496/// the details for provisioning infrastructure specific cluster
497/// for the underlying provider.
498/// The underlying provider is responsible for the implementation
499/// of the template to an infrastructure cluster.
500#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
501pub struct ClusterClassInfrastructure {
502    /// ref is a required reference to a custom resource
503    /// offered by a provider.
504    #[serde(rename = "ref")]
505    pub r#ref: ObjectReference,
506}
507
508/// ref is a required reference to a custom resource
509/// offered by a provider.
510#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
511pub struct ClusterClassInfrastructureRef {
512    /// API version of the referent.
513    #[serde(
514        default,
515        skip_serializing_if = "Option::is_none",
516        rename = "apiVersion"
517    )]
518    pub api_version: Option<String>,
519    /// If referring to a piece of an object instead of an entire object, this string
520    /// should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
521    /// For example, if the object reference is to a container within a pod, this would take on a value like:
522    /// "spec.containers{name}" (where "name" refers to the name of the container that triggered
523    /// the event) or if no container name is specified "spec.containers[2]" (container with
524    /// index 2 in this pod). This syntax is chosen only to have some well-defined way of
525    /// referencing a part of an object.
526    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldPath")]
527    pub field_path: Option<String>,
528    /// Kind of the referent.
529    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
530    #[serde(default, skip_serializing_if = "Option::is_none")]
531    pub kind: Option<String>,
532    /// Name of the referent.
533    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
534    #[serde(default, skip_serializing_if = "Option::is_none")]
535    pub name: Option<String>,
536    /// Namespace of the referent.
537    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
538    #[serde(default, skip_serializing_if = "Option::is_none")]
539    pub namespace: Option<String>,
540    /// Specific resourceVersion to which this reference is made, if any.
541    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
542    #[serde(
543        default,
544        skip_serializing_if = "Option::is_none",
545        rename = "resourceVersion"
546    )]
547    pub resource_version: Option<String>,
548    /// UID of the referent.
549    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
550    #[serde(default, skip_serializing_if = "Option::is_none")]
551    pub uid: Option<String>,
552}
553
554/// infrastructureNamingStrategy allows changing the naming pattern used when creating the infrastructure object.
555#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
556pub struct ClusterClassInfrastructureNamingStrategy {
557    /// template defines the template to use for generating the name of the Infrastructure object.
558    /// If not defined, it will fallback to `{{ .cluster.name }}-{{ .random }}`.
559    /// If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will
560    /// get concatenated with a random suffix of length 5.
561    /// The templating mechanism provides the following arguments:
562    /// * `.cluster.name`: The name of the cluster object.
563    /// * `.random`: A random alphanumeric string, without vowels, of length 5.
564    #[serde(default, skip_serializing_if = "Option::is_none")]
565    pub template: Option<String>,
566}
567
568/// ClusterClassPatch defines a patch which is applied to customize the referenced templates.
569#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
570pub struct ClusterClassPatches {
571    /// definitions define inline patches.
572    /// Note: Patches will be applied in the order of the array.
573    /// Note: Exactly one of Definitions or External must be set.
574    #[serde(default, skip_serializing_if = "Option::is_none")]
575    pub definitions: Option<Vec<ClusterClassPatchesDefinitions>>,
576    /// description is a human-readable description of this patch.
577    #[serde(default, skip_serializing_if = "Option::is_none")]
578    pub description: Option<String>,
579    /// enabledIf is a Go template to be used to calculate if a patch should be enabled.
580    /// It can reference variables defined in .spec.variables and builtin variables.
581    /// The patch will be enabled if the template evaluates to `true`, otherwise it will
582    /// be disabled.
583    /// If EnabledIf is not set, the patch will be enabled per default.
584    #[serde(default, skip_serializing_if = "Option::is_none", rename = "enabledIf")]
585    pub enabled_if: Option<String>,
586    /// external defines an external patch.
587    /// Note: Exactly one of Definitions or External must be set.
588    #[serde(default, skip_serializing_if = "Option::is_none")]
589    pub external: Option<ClusterClassPatchesExternal>,
590    /// name of the patch.
591    pub name: String,
592}
593
594/// PatchDefinition defines a patch which is applied to customize the referenced templates.
595#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
596pub struct ClusterClassPatchesDefinitions {
597    /// jsonPatches defines the patches which should be applied on the templates
598    /// matching the selector.
599    /// Note: Patches will be applied in the order of the array.
600    #[serde(rename = "jsonPatches")]
601    pub json_patches: Vec<ClusterClassPatchesDefinitionsJsonPatches>,
602    /// selector defines on which templates the patch should be applied.
603    pub selector: ClusterClassPatchesDefinitionsSelector,
604}
605
606/// JSONPatch defines a JSON patch.
607#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
608pub struct ClusterClassPatchesDefinitionsJsonPatches {
609    /// op defines the operation of the patch.
610    /// Note: Only `add`, `replace` and `remove` are supported.
611    pub op: ClusterClassPatchesDefinitionsJsonPatchesOp,
612    /// path defines the path of the patch.
613    /// Note: Only the spec of a template can be patched, thus the path has to start with /spec/.
614    /// Note: For now the only allowed array modifications are `append` and `prepend`, i.e.:
615    /// * for op: `add`: only index 0 (prepend) and - (append) are allowed
616    /// * for op: `replace` or `remove`: no indexes are allowed
617    pub path: String,
618    /// value defines the value of the patch.
619    /// Note: Either Value or ValueFrom is required for add and replace
620    /// operations. Only one of them is allowed to be set at the same time.
621    /// Note: We have to use apiextensionsv1.JSON instead of our JSON type,
622    /// because controller-tools has a hard-coded schema for apiextensionsv1.JSON
623    /// which cannot be produced by another type (unset type field).
624    /// Ref: https://github.com/kubernetes-sigs/controller-tools/blob/d0e03a142d0ecdd5491593e941ee1d6b5d91dba6/pkg/crd/known_types.go#L106-L111
625    #[serde(default, skip_serializing_if = "Option::is_none")]
626    pub value: Option<serde_json::Value>,
627    /// valueFrom defines the value of the patch.
628    /// Note: Either Value or ValueFrom is required for add and replace
629    /// operations. Only one of them is allowed to be set at the same time.
630    #[serde(default, skip_serializing_if = "Option::is_none", rename = "valueFrom")]
631    pub value_from: Option<ClusterClassPatchesDefinitionsJsonPatchesValueFrom>,
632}
633
634/// JSONPatch defines a JSON patch.
635#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
636pub enum ClusterClassPatchesDefinitionsJsonPatchesOp {
637    #[serde(rename = "add")]
638    Add,
639    #[serde(rename = "replace")]
640    Replace,
641    #[serde(rename = "remove")]
642    Remove,
643}
644
645/// valueFrom defines the value of the patch.
646/// Note: Either Value or ValueFrom is required for add and replace
647/// operations. Only one of them is allowed to be set at the same time.
648#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
649pub struct ClusterClassPatchesDefinitionsJsonPatchesValueFrom {
650    /// template is the Go template to be used to calculate the value.
651    /// A template can reference variables defined in .spec.variables and builtin variables.
652    /// Note: The template must evaluate to a valid YAML or JSON value.
653    #[serde(default, skip_serializing_if = "Option::is_none")]
654    pub template: Option<String>,
655    /// variable is the variable to be used as value.
656    /// Variable can be one of the variables defined in .spec.variables or a builtin variable.
657    #[serde(default, skip_serializing_if = "Option::is_none")]
658    pub variable: Option<String>,
659}
660
661/// selector defines on which templates the patch should be applied.
662#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
663pub struct ClusterClassPatchesDefinitionsSelector {
664    /// apiVersion filters templates by apiVersion.
665    #[serde(rename = "apiVersion")]
666    pub api_version: String,
667    /// kind filters templates by kind.
668    pub kind: String,
669    /// matchResources selects templates based on where they are referenced.
670    #[serde(rename = "matchResources")]
671    pub match_resources: ClusterClassPatchesDefinitionsSelectorMatchResources,
672}
673
674/// matchResources selects templates based on where they are referenced.
675#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
676pub struct ClusterClassPatchesDefinitionsSelectorMatchResources {
677    /// controlPlane selects templates referenced in .spec.ControlPlane.
678    /// Note: this will match the controlPlane and also the controlPlane
679    /// machineInfrastructure (depending on the kind and apiVersion).
680    #[serde(
681        default,
682        skip_serializing_if = "Option::is_none",
683        rename = "controlPlane"
684    )]
685    pub control_plane: Option<bool>,
686    /// infrastructureCluster selects templates referenced in .spec.infrastructure.
687    #[serde(
688        default,
689        skip_serializing_if = "Option::is_none",
690        rename = "infrastructureCluster"
691    )]
692    pub infrastructure_cluster: Option<bool>,
693    /// machineDeploymentClass selects templates referenced in specific MachineDeploymentClasses in
694    /// .spec.workers.machineDeployments.
695    #[serde(
696        default,
697        skip_serializing_if = "Option::is_none",
698        rename = "machineDeploymentClass"
699    )]
700    pub machine_deployment_class:
701        Option<ClusterClassPatchesDefinitionsSelectorMatchResourcesMachineDeploymentClass>,
702    /// machinePoolClass selects templates referenced in specific MachinePoolClasses in
703    /// .spec.workers.machinePools.
704    #[serde(
705        default,
706        skip_serializing_if = "Option::is_none",
707        rename = "machinePoolClass"
708    )]
709    pub machine_pool_class:
710        Option<ClusterClassPatchesDefinitionsSelectorMatchResourcesMachinePoolClass>,
711}
712
713/// machineDeploymentClass selects templates referenced in specific MachineDeploymentClasses in
714/// .spec.workers.machineDeployments.
715#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
716pub struct ClusterClassPatchesDefinitionsSelectorMatchResourcesMachineDeploymentClass {
717    /// names selects templates by class names.
718    #[serde(default, skip_serializing_if = "Option::is_none")]
719    pub names: Option<Vec<String>>,
720}
721
722/// machinePoolClass selects templates referenced in specific MachinePoolClasses in
723/// .spec.workers.machinePools.
724#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
725pub struct ClusterClassPatchesDefinitionsSelectorMatchResourcesMachinePoolClass {
726    /// names selects templates by class names.
727    #[serde(default, skip_serializing_if = "Option::is_none")]
728    pub names: Option<Vec<String>>,
729}
730
731/// external defines an external patch.
732/// Note: Exactly one of Definitions or External must be set.
733#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
734pub struct ClusterClassPatchesExternal {
735    /// discoverVariablesExtension references an extension which is called to discover variables.
736    #[serde(
737        default,
738        skip_serializing_if = "Option::is_none",
739        rename = "discoverVariablesExtension"
740    )]
741    pub discover_variables_extension: Option<String>,
742    /// generateExtension references an extension which is called to generate patches.
743    #[serde(
744        default,
745        skip_serializing_if = "Option::is_none",
746        rename = "generateExtension"
747    )]
748    pub generate_extension: Option<String>,
749    /// settings defines key value pairs to be passed to the extensions.
750    /// Values defined here take precedence over the values defined in the
751    /// corresponding ExtensionConfig.
752    #[serde(default, skip_serializing_if = "Option::is_none")]
753    pub settings: Option<BTreeMap<String, String>>,
754    /// validateExtension references an extension which is called to validate the topology.
755    #[serde(
756        default,
757        skip_serializing_if = "Option::is_none",
758        rename = "validateExtension"
759    )]
760    pub validate_extension: Option<String>,
761}
762
763/// ClusterClassVariable defines a variable which can
764/// be configured in the Cluster topology and used in patches.
765#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
766pub struct ClusterClassVariables {
767    /// metadata is the metadata of a variable.
768    /// It can be used to add additional data for higher level tools to
769    /// a ClusterClassVariable.
770    ///
771    /// Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please use XMetadata in JSONSchemaProps instead.
772    #[serde(default, skip_serializing_if = "Option::is_none")]
773    pub metadata: Option<ClusterClassVariablesMetadata>,
774    /// name of the variable.
775    pub name: String,
776    /// required specifies if the variable is required.
777    /// Note: this applies to the variable as a whole and thus the
778    /// top-level object defined in the schema. If nested fields are
779    /// required, this will be specified inside the schema.
780    pub required: bool,
781    /// schema defines the schema of the variable.
782    pub schema: ClusterClassVariablesSchema,
783}
784
785/// metadata is the metadata of a variable.
786/// It can be used to add additional data for higher level tools to
787/// a ClusterClassVariable.
788///
789/// Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please use XMetadata in JSONSchemaProps instead.
790#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
791pub struct ClusterClassVariablesMetadata {
792    /// annotations is an unstructured key value map that can be used to store and
793    /// retrieve arbitrary metadata.
794    /// They are not queryable.
795    #[serde(default, skip_serializing_if = "Option::is_none")]
796    pub annotations: Option<BTreeMap<String, String>>,
797    /// labels is a map of string keys and values that can be used to organize and categorize
798    /// (scope and select) variables.
799    #[serde(default, skip_serializing_if = "Option::is_none")]
800    pub labels: Option<BTreeMap<String, String>>,
801}
802
803/// schema defines the schema of the variable.
804#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
805pub struct ClusterClassVariablesSchema {
806    /// openAPIV3Schema defines the schema of a variable via OpenAPI v3
807    /// schema. The schema is a subset of the schema used in
808    /// Kubernetes CRDs.
809    #[serde(rename = "openAPIV3Schema")]
810    pub open_apiv3_schema: ClusterClassVariablesSchemaOpenApiv3Schema,
811}
812
813/// openAPIV3Schema defines the schema of a variable via OpenAPI v3
814/// schema. The schema is a subset of the schema used in
815/// Kubernetes CRDs.
816#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
817pub struct ClusterClassVariablesSchemaOpenApiv3Schema {
818    /// additionalProperties specifies the schema of values in a map (keys are always strings).
819    /// NOTE: Can only be set if type is object.
820    /// NOTE: AdditionalProperties is mutually exclusive with Properties.
821    /// NOTE: This field uses PreserveUnknownFields and Schemaless,
822    /// because recursive validation is not possible.
823    #[serde(
824        default,
825        skip_serializing_if = "Option::is_none",
826        rename = "additionalProperties"
827    )]
828    pub additional_properties: Option<serde_json::Value>,
829    /// allOf specifies that the variable must validate against all of the subschemas in the array.
830    /// NOTE: This field uses PreserveUnknownFields and Schemaless,
831    /// because recursive validation is not possible.
832    #[serde(default, skip_serializing_if = "Option::is_none", rename = "allOf")]
833    pub all_of: Option<serde_json::Value>,
834    /// anyOf specifies that the variable must validate against one or more of the subschemas in the array.
835    /// NOTE: This field uses PreserveUnknownFields and Schemaless,
836    /// because recursive validation is not possible.
837    #[serde(default, skip_serializing_if = "Option::is_none", rename = "anyOf")]
838    pub any_of: Option<serde_json::Value>,
839    /// default is the default value of the variable.
840    /// NOTE: Can be set for all types.
841    #[serde(default, skip_serializing_if = "Option::is_none")]
842    pub default: Option<serde_json::Value>,
843    /// description is a human-readable description of this variable.
844    #[serde(default, skip_serializing_if = "Option::is_none")]
845    pub description: Option<String>,
846    /// enum is the list of valid values of the variable.
847    /// NOTE: Can be set for all types.
848    #[serde(default, skip_serializing_if = "Option::is_none", rename = "enum")]
849    pub r#enum: Option<Vec<serde_json::Value>>,
850    /// example is an example for this variable.
851    #[serde(default, skip_serializing_if = "Option::is_none")]
852    pub example: Option<serde_json::Value>,
853    /// exclusiveMaximum specifies if the Maximum is exclusive.
854    /// NOTE: Can only be set if type is integer or number.
855    #[serde(
856        default,
857        skip_serializing_if = "Option::is_none",
858        rename = "exclusiveMaximum"
859    )]
860    pub exclusive_maximum: Option<bool>,
861    /// exclusiveMinimum specifies if the Minimum is exclusive.
862    /// NOTE: Can only be set if type is integer or number.
863    #[serde(
864        default,
865        skip_serializing_if = "Option::is_none",
866        rename = "exclusiveMinimum"
867    )]
868    pub exclusive_minimum: Option<bool>,
869    /// format is an OpenAPI v3 format string. Unknown formats are ignored.
870    /// For a list of supported formats please see: (of the k8s.io/apiextensions-apiserver version we're currently using)
871    /// https://github.com/kubernetes/apiextensions-apiserver/blob/master/pkg/apiserver/validation/formats.go
872    /// NOTE: Can only be set if type is string.
873    #[serde(default, skip_serializing_if = "Option::is_none")]
874    pub format: Option<String>,
875    /// items specifies fields of an array.
876    /// NOTE: Can only be set if type is array.
877    /// NOTE: This field uses PreserveUnknownFields and Schemaless,
878    /// because recursive validation is not possible.
879    #[serde(default, skip_serializing_if = "Option::is_none")]
880    pub items: Option<serde_json::Value>,
881    /// maxItems is the max length of an array variable.
882    /// NOTE: Can only be set if type is array.
883    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxItems")]
884    pub max_items: Option<i64>,
885    /// maxLength is the max length of a string variable.
886    /// NOTE: Can only be set if type is string.
887    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxLength")]
888    pub max_length: Option<i64>,
889    /// maxProperties is the maximum amount of entries in a map or properties in an object.
890    /// NOTE: Can only be set if type is object.
891    #[serde(
892        default,
893        skip_serializing_if = "Option::is_none",
894        rename = "maxProperties"
895    )]
896    pub max_properties: Option<i64>,
897    /// maximum is the maximum of an integer or number variable.
898    /// If ExclusiveMaximum is false, the variable is valid if it is lower than, or equal to, the value of Maximum.
899    /// If ExclusiveMaximum is true, the variable is valid if it is strictly lower than the value of Maximum.
900    /// NOTE: Can only be set if type is integer or number.
901    #[serde(default, skip_serializing_if = "Option::is_none")]
902    pub maximum: Option<i64>,
903    /// minItems is the min length of an array variable.
904    /// NOTE: Can only be set if type is array.
905    #[serde(default, skip_serializing_if = "Option::is_none", rename = "minItems")]
906    pub min_items: Option<i64>,
907    /// minLength is the min length of a string variable.
908    /// NOTE: Can only be set if type is string.
909    #[serde(default, skip_serializing_if = "Option::is_none", rename = "minLength")]
910    pub min_length: Option<i64>,
911    /// minProperties is the minimum amount of entries in a map or properties in an object.
912    /// NOTE: Can only be set if type is object.
913    #[serde(
914        default,
915        skip_serializing_if = "Option::is_none",
916        rename = "minProperties"
917    )]
918    pub min_properties: Option<i64>,
919    /// minimum is the minimum of an integer or number variable.
920    /// If ExclusiveMinimum is false, the variable is valid if it is greater than, or equal to, the value of Minimum.
921    /// If ExclusiveMinimum is true, the variable is valid if it is strictly greater than the value of Minimum.
922    /// NOTE: Can only be set if type is integer or number.
923    #[serde(default, skip_serializing_if = "Option::is_none")]
924    pub minimum: Option<i64>,
925    /// not specifies that the variable must not validate against the subschema.
926    /// NOTE: This field uses PreserveUnknownFields and Schemaless,
927    /// because recursive validation is not possible.
928    #[serde(default, skip_serializing_if = "Option::is_none")]
929    pub not: Option<serde_json::Value>,
930    /// oneOf specifies that the variable must validate against exactly one of the subschemas in the array.
931    /// NOTE: This field uses PreserveUnknownFields and Schemaless,
932    /// because recursive validation is not possible.
933    #[serde(default, skip_serializing_if = "Option::is_none", rename = "oneOf")]
934    pub one_of: Option<serde_json::Value>,
935    /// pattern is the regex which a string variable must match.
936    /// NOTE: Can only be set if type is string.
937    #[serde(default, skip_serializing_if = "Option::is_none")]
938    pub pattern: Option<String>,
939    /// properties specifies fields of an object.
940    /// NOTE: Can only be set if type is object.
941    /// NOTE: Properties is mutually exclusive with AdditionalProperties.
942    /// NOTE: This field uses PreserveUnknownFields and Schemaless,
943    /// because recursive validation is not possible.
944    #[serde(default, skip_serializing_if = "Option::is_none")]
945    pub properties: Option<serde_json::Value>,
946    /// required specifies which fields of an object are required.
947    /// NOTE: Can only be set if type is object.
948    #[serde(default, skip_serializing_if = "Option::is_none")]
949    pub required: Option<Vec<String>>,
950    /// type is the type of the variable.
951    /// Valid values are: object, array, string, integer, number or boolean.
952    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
953    pub r#type: Option<ClusterClassVariablesSchemaOpenApiv3SchemaType>,
954    /// uniqueItems specifies if items in an array must be unique.
955    /// NOTE: Can only be set if type is array.
956    #[serde(
957        default,
958        skip_serializing_if = "Option::is_none",
959        rename = "uniqueItems"
960    )]
961    pub unique_items: Option<bool>,
962    /// x-kubernetes-int-or-string specifies that this value is
963    /// either an integer or a string. If this is true, an empty
964    /// type is allowed and type as child of anyOf is permitted
965    /// if following one of the following patterns:
966    ///
967    /// 1) anyOf:
968    ///    - type: integer
969    ///    - type: string
970    /// 2) allOf:
971    ///    - anyOf:
972    ///      - type: integer
973    ///      - type: string
974    ///    - ... zero or more
975    #[serde(
976        default,
977        skip_serializing_if = "Option::is_none",
978        rename = "x-kubernetes-int-or-string"
979    )]
980    pub x_kubernetes_int_or_string: Option<bool>,
981    /// x-kubernetes-preserve-unknown-fields allows setting fields in a variable object
982    /// which are not defined in the variable schema. This affects fields recursively,
983    /// except if nested properties or additionalProperties are specified in the schema.
984    #[serde(
985        default,
986        skip_serializing_if = "Option::is_none",
987        rename = "x-kubernetes-preserve-unknown-fields"
988    )]
989    pub x_kubernetes_preserve_unknown_fields: Option<bool>,
990    /// x-kubernetes-validations describes a list of validation rules written in the CEL expression language.
991    #[serde(
992        default,
993        skip_serializing_if = "Option::is_none",
994        rename = "x-kubernetes-validations"
995    )]
996    pub x_kubernetes_validations:
997        Option<Vec<ClusterClassVariablesSchemaOpenApiv3SchemaXKubernetesValidations>>,
998    /// x-metadata is the metadata of a variable or a nested field within a variable.
999    /// It can be used to add additional data for higher level tools.
1000    #[serde(
1001        default,
1002        skip_serializing_if = "Option::is_none",
1003        rename = "x-metadata"
1004    )]
1005    pub x_metadata: Option<ClusterClassVariablesSchemaOpenApiv3SchemaXMetadata>,
1006}
1007
1008/// openAPIV3Schema defines the schema of a variable via OpenAPI v3
1009/// schema. The schema is a subset of the schema used in
1010/// Kubernetes CRDs.
1011#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
1012pub enum ClusterClassVariablesSchemaOpenApiv3SchemaType {
1013    #[serde(rename = "object")]
1014    Object,
1015    #[serde(rename = "array")]
1016    Array,
1017    #[serde(rename = "string")]
1018    String,
1019    #[serde(rename = "integer")]
1020    Integer,
1021    #[serde(rename = "number")]
1022    Number,
1023    #[serde(rename = "boolean")]
1024    Boolean,
1025}
1026
1027/// ValidationRule describes a validation rule written in the CEL expression language.
1028#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1029pub struct ClusterClassVariablesSchemaOpenApiv3SchemaXKubernetesValidations {
1030    /// fieldPath represents the field path returned when the validation fails.
1031    /// It must be a relative JSON path (i.e. with array notation) scoped to the location of this x-kubernetes-validations extension in the schema and refer to an existing field.
1032    /// e.g. when validation checks if a specific attribute `foo` under a map `testMap`, the fieldPath could be set to `.testMap.foo`
1033    /// If the validation checks two lists must have unique attributes, the fieldPath could be set to either of the list: e.g. `.testList`
1034    /// It does not support list numeric index.
1035    /// It supports child operation to refer to an existing field currently. Refer to [JSONPath support in Kubernetes](https://kubernetes.io/docs/reference/kubectl/jsonpath/) for more info.
1036    /// Numeric index of array is not supported.
1037    /// For field name which contains special characters, use `['specialName']` to refer the field name.
1038    /// e.g. for attribute `foo.34$` appears in a list `testList`, the fieldPath could be set to `.testList['foo.34$']`
1039    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldPath")]
1040    pub field_path: Option<String>,
1041    /// message represents the message displayed when validation fails. The message is required if the Rule contains
1042    /// line breaks. The message must not contain line breaks.
1043    /// If unset, the message is "failed rule: {Rule}".
1044    /// e.g. "must be a URL with the host matching spec.host"
1045    #[serde(default, skip_serializing_if = "Option::is_none")]
1046    pub message: Option<String>,
1047    /// messageExpression declares a CEL expression that evaluates to the validation failure message that is returned when this rule fails.
1048    /// Since messageExpression is used as a failure message, it must evaluate to a string.
1049    /// If both message and messageExpression are present on a rule, then messageExpression will be used if validation
1050    /// fails. If messageExpression results in a runtime error, the validation failure message is produced
1051    /// as if the messageExpression field were unset. If messageExpression evaluates to an empty string, a string with only spaces, or a string
1052    /// that contains line breaks, then the validation failure message will also be produced as if the messageExpression field were unset.
1053    /// messageExpression has access to all the same variables as the rule; the only difference is the return type.
1054    /// Example:
1055    /// "x must be less than max ("+string(self.max)+")"
1056    #[serde(
1057        default,
1058        skip_serializing_if = "Option::is_none",
1059        rename = "messageExpression"
1060    )]
1061    pub message_expression: Option<String>,
1062    /// reason provides a machine-readable validation failure reason that is returned to the caller when a request fails this validation rule.
1063    /// The currently supported reasons are: "FieldValueInvalid", "FieldValueForbidden", "FieldValueRequired", "FieldValueDuplicate".
1064    /// If not set, default to use "FieldValueInvalid".
1065    /// All future added reasons must be accepted by clients when reading this value and unknown reasons should be treated as FieldValueInvalid.
1066    #[serde(default, skip_serializing_if = "Option::is_none")]
1067    pub reason: Option<ClusterClassVariablesSchemaOpenApiv3SchemaXKubernetesValidationsReason>,
1068    /// rule represents the expression which will be evaluated by CEL.
1069    /// ref: https://github.com/google/cel-spec
1070    /// The Rule is scoped to the location of the x-kubernetes-validations extension in the schema.
1071    /// The `self` variable in the CEL expression is bound to the scoped value.
1072    /// If the Rule is scoped to an object with properties, the accessible properties of the object are field selectable
1073    /// via `self.field` and field presence can be checked via `has(self.field)`.
1074    /// If the Rule is scoped to an object with additionalProperties (i.e. a map) the value of the map
1075    /// are accessible via `self[mapKey]`, map containment can be checked via `mapKey in self` and all entries of the map
1076    /// are accessible via CEL macros and functions such as `self.all(...)`.
1077    /// If the Rule is scoped to an array, the elements of the array are accessible via `self[i]` and also by macros and
1078    /// functions.
1079    /// If the Rule is scoped to a scalar, `self` is bound to the scalar value.
1080    /// Examples:
1081    /// - Rule scoped to a map of objects: {"rule": "self.components['Widget'].priority < 10"}
1082    /// - Rule scoped to a list of integers: {"rule": "self.values.all(value, value >= 0 && value < 100)"}
1083    /// - Rule scoped to a string value: {"rule": "self.startsWith('kube')"}
1084    ///
1085    /// Unknown data preserved in custom resources via x-kubernetes-preserve-unknown-fields is not accessible in CEL
1086    /// expressions. This includes:
1087    /// - Unknown field values that are preserved by object schemas with x-kubernetes-preserve-unknown-fields.
1088    /// - Object properties where the property schema is of an "unknown type". An "unknown type" is recursively defined as:
1089    ///   - A schema with no type and x-kubernetes-preserve-unknown-fields set to true
1090    ///   - An array where the items schema is of an "unknown type"
1091    ///   - An object where the additionalProperties schema is of an "unknown type"
1092    ///
1093    /// Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible.
1094    /// Accessible property names are escaped according to the following rules when accessed in the expression:
1095    /// - '__' escapes to '__underscores__'
1096    /// - '.' escapes to '__dot__'
1097    /// - '-' escapes to '__dash__'
1098    /// - '/' escapes to '__slash__'
1099    /// - Property names that exactly match a CEL RESERVED keyword escape to '__{keyword}__'. The keywords are:
1100    /// 	  "true", "false", "null", "in", "as", "break", "const", "continue", "else", "for", "function", "if",
1101    /// 	  "import", "let", "loop", "package", "namespace", "return".
1102    /// Examples:
1103    ///   - Rule accessing a property named "namespace": {"rule": "self.__namespace__ > 0"}
1104    ///   - Rule accessing a property named "x-prop": {"rule": "self.x__dash__prop > 0"}
1105    ///   - Rule accessing a property named "redact__d": {"rule": "self.redact__underscores__d > 0"}
1106    ///
1107    /// If `rule` makes use of the `oldSelf` variable it is implicitly a
1108    /// `transition rule`.
1109    ///
1110    /// By default, the `oldSelf` variable is the same type as `self`.
1111    ///
1112    /// Transition rules by default are applied only on UPDATE requests and are
1113    /// skipped if an old value could not be found.
1114    pub rule: String,
1115}
1116
1117/// ValidationRule describes a validation rule written in the CEL expression language.
1118#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
1119pub enum ClusterClassVariablesSchemaOpenApiv3SchemaXKubernetesValidationsReason {
1120    FieldValueInvalid,
1121    FieldValueForbidden,
1122    FieldValueRequired,
1123    FieldValueDuplicate,
1124}
1125
1126/// x-metadata is the metadata of a variable or a nested field within a variable.
1127/// It can be used to add additional data for higher level tools.
1128#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1129pub struct ClusterClassVariablesSchemaOpenApiv3SchemaXMetadata {
1130    /// annotations is an unstructured key value map that can be used to store and
1131    /// retrieve arbitrary metadata.
1132    /// They are not queryable.
1133    #[serde(default, skip_serializing_if = "Option::is_none")]
1134    pub annotations: Option<BTreeMap<String, String>>,
1135    /// labels is a map of string keys and values that can be used to organize and categorize
1136    /// (scope and select) variables.
1137    #[serde(default, skip_serializing_if = "Option::is_none")]
1138    pub labels: Option<BTreeMap<String, String>>,
1139}
1140
1141/// workers describes the worker nodes for the cluster.
1142/// It is a collection of node types which can be used to create
1143/// the worker nodes of the cluster.
1144#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1145pub struct ClusterClassWorkers {
1146    /// machineDeployments is a list of machine deployment classes that can be used to create
1147    /// a set of worker nodes.
1148    #[serde(
1149        default,
1150        skip_serializing_if = "Option::is_none",
1151        rename = "machineDeployments"
1152    )]
1153    pub machine_deployments: Option<Vec<ClusterClassWorkersMachineDeployments>>,
1154    /// machinePools is a list of machine pool classes that can be used to create
1155    /// a set of worker nodes.
1156    #[serde(
1157        default,
1158        skip_serializing_if = "Option::is_none",
1159        rename = "machinePools"
1160    )]
1161    pub machine_pools: Option<Vec<ClusterClassWorkersMachinePools>>,
1162}
1163
1164/// MachineDeploymentClass serves as a template to define a set of worker nodes of the cluster
1165/// provisioned using the `ClusterClass`.
1166#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1167pub struct ClusterClassWorkersMachineDeployments {
1168    /// class denotes a type of worker node present in the cluster,
1169    /// this name MUST be unique within a ClusterClass and can be referenced
1170    /// in the Cluster to create a managed MachineDeployment.
1171    pub class: String,
1172    /// failureDomain is the failure domain the machines will be created in.
1173    /// Must match a key in the FailureDomains map stored on the cluster object.
1174    /// NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.
1175    #[serde(
1176        default,
1177        skip_serializing_if = "Option::is_none",
1178        rename = "failureDomain"
1179    )]
1180    pub failure_domain: Option<String>,
1181    /// machineHealthCheck defines a MachineHealthCheck for this MachineDeploymentClass.
1182    #[serde(
1183        default,
1184        skip_serializing_if = "Option::is_none",
1185        rename = "machineHealthCheck"
1186    )]
1187    pub machine_health_check: Option<ClusterClassWorkersMachineDeploymentsMachineHealthCheck>,
1188    /// minReadySeconds is the minimum number of seconds for which a newly created machine should
1189    /// be ready.
1190    /// Defaults to 0 (machine will be considered available as soon as it
1191    /// is ready)
1192    /// NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.
1193    #[serde(
1194        default,
1195        skip_serializing_if = "Option::is_none",
1196        rename = "minReadySeconds"
1197    )]
1198    pub min_ready_seconds: Option<i32>,
1199    /// namingStrategy allows changing the naming pattern used when creating the MachineDeployment.
1200    #[serde(
1201        default,
1202        skip_serializing_if = "Option::is_none",
1203        rename = "namingStrategy"
1204    )]
1205    pub naming_strategy: Option<ClusterClassWorkersMachineDeploymentsNamingStrategy>,
1206    /// nodeDeletionTimeout defines how long the controller will attempt to delete the Node that the Machine
1207    /// hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely.
1208    /// Defaults to 10 seconds.
1209    /// NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.
1210    #[serde(
1211        default,
1212        skip_serializing_if = "Option::is_none",
1213        rename = "nodeDeletionTimeout"
1214    )]
1215    pub node_deletion_timeout: Option<String>,
1216    /// nodeDrainTimeout is the total amount of time that the controller will spend on draining a node.
1217    /// The default value is 0, meaning that the node can be drained without any time limitations.
1218    /// NOTE: NodeDrainTimeout is different from `kubectl drain --timeout`
1219    /// NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.
1220    #[serde(
1221        default,
1222        skip_serializing_if = "Option::is_none",
1223        rename = "nodeDrainTimeout"
1224    )]
1225    pub node_drain_timeout: Option<String>,
1226    /// nodeVolumeDetachTimeout is the total amount of time that the controller will spend on waiting for all volumes
1227    /// to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations.
1228    /// NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.
1229    #[serde(
1230        default,
1231        skip_serializing_if = "Option::is_none",
1232        rename = "nodeVolumeDetachTimeout"
1233    )]
1234    pub node_volume_detach_timeout: Option<String>,
1235    /// readinessGates specifies additional conditions to include when evaluating Machine Ready condition.
1236    ///
1237    /// This field can be used e.g. to instruct the machine controller to include in the computation for Machine's ready
1238    /// computation a condition, managed by an external controllers, reporting the status of special software/hardware installed on the Machine.
1239    ///
1240    /// NOTE: This field is considered only for computing v1beta2 conditions.
1241    /// NOTE: If a Cluster defines a custom list of readinessGates for a MachineDeployment using this MachineDeploymentClass,
1242    /// such list overrides readinessGates defined in this field.
1243    #[serde(
1244        default,
1245        skip_serializing_if = "Option::is_none",
1246        rename = "readinessGates"
1247    )]
1248    pub readiness_gates: Option<Vec<ClusterClassWorkersMachineDeploymentsReadinessGates>>,
1249    /// strategy is the deployment strategy to use to replace existing machines with
1250    /// new ones.
1251    /// NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.
1252    #[serde(default, skip_serializing_if = "Option::is_none")]
1253    pub strategy: Option<ClusterClassWorkersMachineDeploymentsStrategy>,
1254    /// template is a local struct containing a collection of templates for creation of
1255    /// MachineDeployment objects representing a set of worker nodes.
1256    pub template: ClusterClassWorkersMachineDeploymentsTemplate,
1257}
1258
1259/// machineHealthCheck defines a MachineHealthCheck for this MachineDeploymentClass.
1260#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1261pub struct ClusterClassWorkersMachineDeploymentsMachineHealthCheck {
1262    /// maxUnhealthy specifies the maximum number of unhealthy machines allowed.
1263    /// Any further remediation is only allowed if at most "maxUnhealthy" machines selected by
1264    /// "selector" are not healthy.
1265    #[serde(
1266        default,
1267        skip_serializing_if = "Option::is_none",
1268        rename = "maxUnhealthy"
1269    )]
1270    pub max_unhealthy: Option<IntOrString>,
1271    /// nodeStartupTimeout allows to set the maximum time for MachineHealthCheck
1272    /// to consider a Machine unhealthy if a corresponding Node isn't associated
1273    /// through a `Spec.ProviderID` field.
1274    ///
1275    /// The duration set in this field is compared to the greatest of:
1276    /// - Cluster's infrastructure ready condition timestamp (if and when available)
1277    /// - Control Plane's initialized condition timestamp (if and when available)
1278    /// - Machine's infrastructure ready condition timestamp (if and when available)
1279    /// - Machine's metadata creation timestamp
1280    ///
1281    /// Defaults to 10 minutes.
1282    /// If you wish to disable this feature, set the value explicitly to 0.
1283    #[serde(
1284        default,
1285        skip_serializing_if = "Option::is_none",
1286        rename = "nodeStartupTimeout"
1287    )]
1288    pub node_startup_timeout: Option<String>,
1289    /// remediationTemplate is a reference to a remediation template
1290    /// provided by an infrastructure provider.
1291    ///
1292    /// This field is completely optional, when filled, the MachineHealthCheck controller
1293    /// creates a new object from the template referenced and hands off remediation of the machine to
1294    /// a controller that lives outside of Cluster API.
1295    #[serde(
1296        default,
1297        skip_serializing_if = "Option::is_none",
1298        rename = "remediationTemplate"
1299    )]
1300    pub remediation_template: Option<ObjectReference>,
1301    /// unhealthyConditions contains a list of the conditions that determine
1302    /// whether a node is considered unhealthy. The conditions are combined in a
1303    /// logical OR, i.e. if any of the conditions is met, the node is unhealthy.
1304    #[serde(
1305        default,
1306        skip_serializing_if = "Option::is_none",
1307        rename = "unhealthyConditions"
1308    )]
1309    pub unhealthy_conditions:
1310        Option<Vec<ClusterClassWorkersMachineDeploymentsMachineHealthCheckUnhealthyConditions>>,
1311    /// unhealthyRange specifies the range of unhealthy machines allowed.
1312    /// Any further remediation is only allowed if the number of machines selected by "selector" as not healthy
1313    /// is within the range of "unhealthyRange". Takes precedence over maxUnhealthy.
1314    /// Eg. "[3-5]" - This means that remediation will be allowed only when:
1315    /// (a) there are at least 3 unhealthy machines (and)
1316    /// (b) there are at most 5 unhealthy machines
1317    #[serde(
1318        default,
1319        skip_serializing_if = "Option::is_none",
1320        rename = "unhealthyRange"
1321    )]
1322    pub unhealthy_range: Option<String>,
1323}
1324
1325/// remediationTemplate is a reference to a remediation template
1326/// provided by an infrastructure provider.
1327///
1328/// This field is completely optional, when filled, the MachineHealthCheck controller
1329/// creates a new object from the template referenced and hands off remediation of the machine to
1330/// a controller that lives outside of Cluster API.
1331#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1332pub struct ClusterClassWorkersMachineDeploymentsMachineHealthCheckRemediationTemplate {
1333    /// API version of the referent.
1334    #[serde(
1335        default,
1336        skip_serializing_if = "Option::is_none",
1337        rename = "apiVersion"
1338    )]
1339    pub api_version: Option<String>,
1340    /// If referring to a piece of an object instead of an entire object, this string
1341    /// should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
1342    /// For example, if the object reference is to a container within a pod, this would take on a value like:
1343    /// "spec.containers{name}" (where "name" refers to the name of the container that triggered
1344    /// the event) or if no container name is specified "spec.containers[2]" (container with
1345    /// index 2 in this pod). This syntax is chosen only to have some well-defined way of
1346    /// referencing a part of an object.
1347    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldPath")]
1348    pub field_path: Option<String>,
1349    /// Kind of the referent.
1350    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
1351    #[serde(default, skip_serializing_if = "Option::is_none")]
1352    pub kind: Option<String>,
1353    /// Name of the referent.
1354    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
1355    #[serde(default, skip_serializing_if = "Option::is_none")]
1356    pub name: Option<String>,
1357    /// Namespace of the referent.
1358    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
1359    #[serde(default, skip_serializing_if = "Option::is_none")]
1360    pub namespace: Option<String>,
1361    /// Specific resourceVersion to which this reference is made, if any.
1362    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
1363    #[serde(
1364        default,
1365        skip_serializing_if = "Option::is_none",
1366        rename = "resourceVersion"
1367    )]
1368    pub resource_version: Option<String>,
1369    /// UID of the referent.
1370    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
1371    #[serde(default, skip_serializing_if = "Option::is_none")]
1372    pub uid: Option<String>,
1373}
1374
1375/// UnhealthyCondition represents a Node condition type and value with a timeout
1376/// specified as a duration.  When the named condition has been in the given
1377/// status for at least the timeout value, a node is considered unhealthy.
1378#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1379pub struct ClusterClassWorkersMachineDeploymentsMachineHealthCheckUnhealthyConditions {
1380    /// status of the condition, one of True, False, Unknown.
1381    pub status: String,
1382    /// timeout is the duration that a node must be in a given status for,
1383    /// after which the node is considered unhealthy.
1384    /// For example, with a value of "1h", the node must match the status
1385    /// for at least 1 hour before being considered unhealthy.
1386    pub timeout: String,
1387    /// type of Node condition
1388    #[serde(rename = "type")]
1389    pub r#type: String,
1390}
1391
1392/// namingStrategy allows changing the naming pattern used when creating the MachineDeployment.
1393#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1394pub struct ClusterClassWorkersMachineDeploymentsNamingStrategy {
1395    /// template defines the template to use for generating the name of the MachineDeployment object.
1396    /// If not defined, it will fallback to `{{ .cluster.name }}-{{ .machineDeployment.topologyName }}-{{ .random }}`.
1397    /// If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will
1398    /// get concatenated with a random suffix of length 5.
1399    /// The templating mechanism provides the following arguments:
1400    /// * `.cluster.name`: The name of the cluster object.
1401    /// * `.random`: A random alphanumeric string, without vowels, of length 5.
1402    /// * `.machineDeployment.topologyName`: The name of the MachineDeployment topology (Cluster.spec.topology.workers.machineDeployments[].name).
1403    #[serde(default, skip_serializing_if = "Option::is_none")]
1404    pub template: Option<String>,
1405}
1406
1407/// MachineReadinessGate contains the type of a Machine condition to be used as a readiness gate.
1408#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1409pub struct ClusterClassWorkersMachineDeploymentsReadinessGates {
1410    /// conditionType refers to a condition with matching type in the Machine's condition list.
1411    /// If the conditions doesn't exist, it will be treated as unknown.
1412    /// Note: Both Cluster API conditions or conditions added by 3rd party controllers can be used as readiness gates.
1413    #[serde(rename = "conditionType")]
1414    pub condition_type: String,
1415    /// polarity of the conditionType specified in this readinessGate.
1416    /// Valid values are Positive, Negative and omitted.
1417    /// When omitted, the default behaviour will be Positive.
1418    /// A positive polarity means that the condition should report a true status under normal conditions.
1419    /// A negative polarity means that the condition should report a false status under normal conditions.
1420    #[serde(default, skip_serializing_if = "Option::is_none")]
1421    pub polarity: Option<ClusterClassWorkersMachineDeploymentsReadinessGatesPolarity>,
1422}
1423
1424/// MachineReadinessGate contains the type of a Machine condition to be used as a readiness gate.
1425#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
1426pub enum ClusterClassWorkersMachineDeploymentsReadinessGatesPolarity {
1427    Positive,
1428    Negative,
1429}
1430
1431/// strategy is the deployment strategy to use to replace existing machines with
1432/// new ones.
1433/// NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.
1434#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1435pub struct ClusterClassWorkersMachineDeploymentsStrategy {
1436    /// remediation controls the strategy of remediating unhealthy machines
1437    /// and how remediating operations should occur during the lifecycle of the dependant MachineSets.
1438    #[serde(default, skip_serializing_if = "Option::is_none")]
1439    pub remediation: Option<ClusterClassWorkersMachineDeploymentsStrategyRemediation>,
1440    /// rollingUpdate is the rolling update config params. Present only if
1441    /// MachineDeploymentStrategyType = RollingUpdate.
1442    #[serde(
1443        default,
1444        skip_serializing_if = "Option::is_none",
1445        rename = "rollingUpdate"
1446    )]
1447    pub rolling_update: Option<ClusterClassWorkersMachineDeploymentsStrategyRollingUpdate>,
1448    /// type of deployment. Allowed values are RollingUpdate and OnDelete.
1449    /// The default is RollingUpdate.
1450    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
1451    pub r#type: Option<ClusterClassWorkersMachineDeploymentsStrategyType>,
1452}
1453
1454/// remediation controls the strategy of remediating unhealthy machines
1455/// and how remediating operations should occur during the lifecycle of the dependant MachineSets.
1456#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1457pub struct ClusterClassWorkersMachineDeploymentsStrategyRemediation {
1458    /// maxInFlight determines how many in flight remediations should happen at the same time.
1459    ///
1460    /// Remediation only happens on the MachineSet with the most current revision, while
1461    /// older MachineSets (usually present during rollout operations) aren't allowed to remediate.
1462    ///
1463    /// Note: In general (independent of remediations), unhealthy machines are always
1464    /// prioritized during scale down operations over healthy ones.
1465    ///
1466    /// MaxInFlight can be set to a fixed number or a percentage.
1467    /// Example: when this is set to 20%, the MachineSet controller deletes at most 20% of
1468    /// the desired replicas.
1469    ///
1470    /// If not set, remediation is limited to all machines (bounded by replicas)
1471    /// under the active MachineSet's management.
1472    #[serde(
1473        default,
1474        skip_serializing_if = "Option::is_none",
1475        rename = "maxInFlight"
1476    )]
1477    pub max_in_flight: Option<IntOrString>,
1478}
1479
1480/// rollingUpdate is the rolling update config params. Present only if
1481/// MachineDeploymentStrategyType = RollingUpdate.
1482#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1483pub struct ClusterClassWorkersMachineDeploymentsStrategyRollingUpdate {
1484    /// deletePolicy defines the policy used by the MachineDeployment to identify nodes to delete when downscaling.
1485    /// Valid values are "Random, "Newest", "Oldest"
1486    /// When no value is supplied, the default DeletePolicy of MachineSet is used
1487    #[serde(
1488        default,
1489        skip_serializing_if = "Option::is_none",
1490        rename = "deletePolicy"
1491    )]
1492    pub delete_policy:
1493        Option<ClusterClassWorkersMachineDeploymentsStrategyRollingUpdateDeletePolicy>,
1494    /// maxSurge is the maximum number of machines that can be scheduled above the
1495    /// desired number of machines.
1496    /// Value can be an absolute number (ex: 5) or a percentage of
1497    /// desired machines (ex: 10%).
1498    /// This can not be 0 if MaxUnavailable is 0.
1499    /// Absolute number is calculated from percentage by rounding up.
1500    /// Defaults to 1.
1501    /// Example: when this is set to 30%, the new MachineSet can be scaled
1502    /// up immediately when the rolling update starts, such that the total
1503    /// number of old and new machines do not exceed 130% of desired
1504    /// machines. Once old machines have been killed, new MachineSet can
1505    /// be scaled up further, ensuring that total number of machines running
1506    /// at any time during the update is at most 130% of desired machines.
1507    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxSurge")]
1508    pub max_surge: Option<IntOrString>,
1509    /// maxUnavailable is the maximum number of machines that can be unavailable during the update.
1510    /// Value can be an absolute number (ex: 5) or a percentage of desired
1511    /// machines (ex: 10%).
1512    /// Absolute number is calculated from percentage by rounding down.
1513    /// This can not be 0 if MaxSurge is 0.
1514    /// Defaults to 0.
1515    /// Example: when this is set to 30%, the old MachineSet can be scaled
1516    /// down to 70% of desired machines immediately when the rolling update
1517    /// starts. Once new machines are ready, old MachineSet can be scaled
1518    /// down further, followed by scaling up the new MachineSet, ensuring
1519    /// that the total number of machines available at all times
1520    /// during the update is at least 70% of desired machines.
1521    #[serde(
1522        default,
1523        skip_serializing_if = "Option::is_none",
1524        rename = "maxUnavailable"
1525    )]
1526    pub max_unavailable: Option<IntOrString>,
1527}
1528
1529/// rollingUpdate is the rolling update config params. Present only if
1530/// MachineDeploymentStrategyType = RollingUpdate.
1531#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
1532pub enum ClusterClassWorkersMachineDeploymentsStrategyRollingUpdateDeletePolicy {
1533    Random,
1534    Newest,
1535    Oldest,
1536}
1537
1538/// strategy is the deployment strategy to use to replace existing machines with
1539/// new ones.
1540/// NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.
1541#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
1542pub enum ClusterClassWorkersMachineDeploymentsStrategyType {
1543    RollingUpdate,
1544    OnDelete,
1545}
1546
1547/// template is a local struct containing a collection of templates for creation of
1548/// MachineDeployment objects representing a set of worker nodes.
1549#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1550pub struct ClusterClassWorkersMachineDeploymentsTemplate {
1551    /// bootstrap contains the bootstrap template reference to be used
1552    /// for the creation of worker Machines.
1553    pub bootstrap: ClusterClassWorkersMachineDeploymentsTemplateBootstrap,
1554    /// infrastructure contains the infrastructure template reference to be used
1555    /// for the creation of worker Machines.
1556    pub infrastructure: ClusterClassWorkersMachineDeploymentsTemplateInfrastructure,
1557    /// metadata is the metadata applied to the MachineDeployment and the machines of the MachineDeployment.
1558    /// At runtime this metadata is merged with the corresponding metadata from the topology.
1559    #[serde(default, skip_serializing_if = "Option::is_none")]
1560    pub metadata: Option<ClusterClassWorkersMachineDeploymentsTemplateMetadata>,
1561}
1562
1563/// bootstrap contains the bootstrap template reference to be used
1564/// for the creation of worker Machines.
1565#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1566pub struct ClusterClassWorkersMachineDeploymentsTemplateBootstrap {
1567    /// ref is a required reference to a custom resource
1568    /// offered by a provider.
1569    #[serde(rename = "ref")]
1570    pub r#ref: ObjectReference,
1571}
1572
1573/// ref is a required reference to a custom resource
1574/// offered by a provider.
1575#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1576pub struct ClusterClassWorkersMachineDeploymentsTemplateBootstrapRef {
1577    /// API version of the referent.
1578    #[serde(
1579        default,
1580        skip_serializing_if = "Option::is_none",
1581        rename = "apiVersion"
1582    )]
1583    pub api_version: Option<String>,
1584    /// If referring to a piece of an object instead of an entire object, this string
1585    /// should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
1586    /// For example, if the object reference is to a container within a pod, this would take on a value like:
1587    /// "spec.containers{name}" (where "name" refers to the name of the container that triggered
1588    /// the event) or if no container name is specified "spec.containers[2]" (container with
1589    /// index 2 in this pod). This syntax is chosen only to have some well-defined way of
1590    /// referencing a part of an object.
1591    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldPath")]
1592    pub field_path: Option<String>,
1593    /// Kind of the referent.
1594    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
1595    #[serde(default, skip_serializing_if = "Option::is_none")]
1596    pub kind: Option<String>,
1597    /// Name of the referent.
1598    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
1599    #[serde(default, skip_serializing_if = "Option::is_none")]
1600    pub name: Option<String>,
1601    /// Namespace of the referent.
1602    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
1603    #[serde(default, skip_serializing_if = "Option::is_none")]
1604    pub namespace: Option<String>,
1605    /// Specific resourceVersion to which this reference is made, if any.
1606    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
1607    #[serde(
1608        default,
1609        skip_serializing_if = "Option::is_none",
1610        rename = "resourceVersion"
1611    )]
1612    pub resource_version: Option<String>,
1613    /// UID of the referent.
1614    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
1615    #[serde(default, skip_serializing_if = "Option::is_none")]
1616    pub uid: Option<String>,
1617}
1618
1619/// infrastructure contains the infrastructure template reference to be used
1620/// for the creation of worker Machines.
1621#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1622pub struct ClusterClassWorkersMachineDeploymentsTemplateInfrastructure {
1623    /// ref is a required reference to a custom resource
1624    /// offered by a provider.
1625    #[serde(rename = "ref")]
1626    pub r#ref: ObjectReference,
1627}
1628
1629/// ref is a required reference to a custom resource
1630/// offered by a provider.
1631#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1632pub struct ClusterClassWorkersMachineDeploymentsTemplateInfrastructureRef {
1633    /// API version of the referent.
1634    #[serde(
1635        default,
1636        skip_serializing_if = "Option::is_none",
1637        rename = "apiVersion"
1638    )]
1639    pub api_version: Option<String>,
1640    /// If referring to a piece of an object instead of an entire object, this string
1641    /// should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
1642    /// For example, if the object reference is to a container within a pod, this would take on a value like:
1643    /// "spec.containers{name}" (where "name" refers to the name of the container that triggered
1644    /// the event) or if no container name is specified "spec.containers[2]" (container with
1645    /// index 2 in this pod). This syntax is chosen only to have some well-defined way of
1646    /// referencing a part of an object.
1647    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldPath")]
1648    pub field_path: Option<String>,
1649    /// Kind of the referent.
1650    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
1651    #[serde(default, skip_serializing_if = "Option::is_none")]
1652    pub kind: Option<String>,
1653    /// Name of the referent.
1654    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
1655    #[serde(default, skip_serializing_if = "Option::is_none")]
1656    pub name: Option<String>,
1657    /// Namespace of the referent.
1658    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
1659    #[serde(default, skip_serializing_if = "Option::is_none")]
1660    pub namespace: Option<String>,
1661    /// Specific resourceVersion to which this reference is made, if any.
1662    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
1663    #[serde(
1664        default,
1665        skip_serializing_if = "Option::is_none",
1666        rename = "resourceVersion"
1667    )]
1668    pub resource_version: Option<String>,
1669    /// UID of the referent.
1670    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
1671    #[serde(default, skip_serializing_if = "Option::is_none")]
1672    pub uid: Option<String>,
1673}
1674
1675/// metadata is the metadata applied to the MachineDeployment and the machines of the MachineDeployment.
1676/// At runtime this metadata is merged with the corresponding metadata from the topology.
1677#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1678pub struct ClusterClassWorkersMachineDeploymentsTemplateMetadata {
1679    /// annotations is an unstructured key value map stored with a resource that may be
1680    /// set by external tools to store and retrieve arbitrary metadata. They are not
1681    /// queryable and should be preserved when modifying objects.
1682    /// More info: http://kubernetes.io/docs/user-guide/annotations
1683    #[serde(default, skip_serializing_if = "Option::is_none")]
1684    pub annotations: Option<BTreeMap<String, String>>,
1685    /// labels is a map of string keys and values that can be used to organize and categorize
1686    /// (scope and select) objects. May match selectors of replication controllers
1687    /// and services.
1688    /// More info: http://kubernetes.io/docs/user-guide/labels
1689    #[serde(default, skip_serializing_if = "Option::is_none")]
1690    pub labels: Option<BTreeMap<String, String>>,
1691}
1692
1693/// MachinePoolClass serves as a template to define a pool of worker nodes of the cluster
1694/// provisioned using `ClusterClass`.
1695#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1696pub struct ClusterClassWorkersMachinePools {
1697    /// class denotes a type of machine pool present in the cluster,
1698    /// this name MUST be unique within a ClusterClass and can be referenced
1699    /// in the Cluster to create a managed MachinePool.
1700    pub class: String,
1701    /// failureDomains is the list of failure domains the MachinePool should be attached to.
1702    /// Must match a key in the FailureDomains map stored on the cluster object.
1703    /// NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass.
1704    #[serde(
1705        default,
1706        skip_serializing_if = "Option::is_none",
1707        rename = "failureDomains"
1708    )]
1709    pub failure_domains: Option<Vec<String>>,
1710    /// minReadySeconds is the minimum number of seconds for which a newly created machine pool should
1711    /// be ready.
1712    /// Defaults to 0 (machine will be considered available as soon as it
1713    /// is ready)
1714    /// NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass.
1715    #[serde(
1716        default,
1717        skip_serializing_if = "Option::is_none",
1718        rename = "minReadySeconds"
1719    )]
1720    pub min_ready_seconds: Option<i32>,
1721    /// namingStrategy allows changing the naming pattern used when creating the MachinePool.
1722    #[serde(
1723        default,
1724        skip_serializing_if = "Option::is_none",
1725        rename = "namingStrategy"
1726    )]
1727    pub naming_strategy: Option<ClusterClassWorkersMachinePoolsNamingStrategy>,
1728    /// nodeDeletionTimeout defines how long the controller will attempt to delete the Node that the Machine
1729    /// hosts after the Machine Pool is marked for deletion. A duration of 0 will retry deletion indefinitely.
1730    /// Defaults to 10 seconds.
1731    /// NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass.
1732    #[serde(
1733        default,
1734        skip_serializing_if = "Option::is_none",
1735        rename = "nodeDeletionTimeout"
1736    )]
1737    pub node_deletion_timeout: Option<String>,
1738    /// nodeDrainTimeout is the total amount of time that the controller will spend on draining a node.
1739    /// The default value is 0, meaning that the node can be drained without any time limitations.
1740    /// NOTE: NodeDrainTimeout is different from `kubectl drain --timeout`
1741    /// NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass.
1742    #[serde(
1743        default,
1744        skip_serializing_if = "Option::is_none",
1745        rename = "nodeDrainTimeout"
1746    )]
1747    pub node_drain_timeout: Option<String>,
1748    /// nodeVolumeDetachTimeout is the total amount of time that the controller will spend on waiting for all volumes
1749    /// to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations.
1750    /// NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass.
1751    #[serde(
1752        default,
1753        skip_serializing_if = "Option::is_none",
1754        rename = "nodeVolumeDetachTimeout"
1755    )]
1756    pub node_volume_detach_timeout: Option<String>,
1757    /// template is a local struct containing a collection of templates for creation of
1758    /// MachinePools objects representing a pool of worker nodes.
1759    pub template: ClusterClassWorkersMachinePoolsTemplate,
1760}
1761
1762/// namingStrategy allows changing the naming pattern used when creating the MachinePool.
1763#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1764pub struct ClusterClassWorkersMachinePoolsNamingStrategy {
1765    /// template defines the template to use for generating the name of the MachinePool object.
1766    /// If not defined, it will fallback to `{{ .cluster.name }}-{{ .machinePool.topologyName }}-{{ .random }}`.
1767    /// If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will
1768    /// get concatenated with a random suffix of length 5.
1769    /// The templating mechanism provides the following arguments:
1770    /// * `.cluster.name`: The name of the cluster object.
1771    /// * `.random`: A random alphanumeric string, without vowels, of length 5.
1772    /// * `.machinePool.topologyName`: The name of the MachinePool topology (Cluster.spec.topology.workers.machinePools[].name).
1773    #[serde(default, skip_serializing_if = "Option::is_none")]
1774    pub template: Option<String>,
1775}
1776
1777/// template is a local struct containing a collection of templates for creation of
1778/// MachinePools objects representing a pool of worker nodes.
1779#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1780pub struct ClusterClassWorkersMachinePoolsTemplate {
1781    /// bootstrap contains the bootstrap template reference to be used
1782    /// for the creation of the Machines in the MachinePool.
1783    pub bootstrap: ClusterClassWorkersMachinePoolsTemplateBootstrap,
1784    /// infrastructure contains the infrastructure template reference to be used
1785    /// for the creation of the MachinePool.
1786    pub infrastructure: ClusterClassWorkersMachinePoolsTemplateInfrastructure,
1787    /// metadata is the metadata applied to the MachinePool.
1788    /// At runtime this metadata is merged with the corresponding metadata from the topology.
1789    #[serde(default, skip_serializing_if = "Option::is_none")]
1790    pub metadata: Option<ClusterClassWorkersMachinePoolsTemplateMetadata>,
1791}
1792
1793/// bootstrap contains the bootstrap template reference to be used
1794/// for the creation of the Machines in the MachinePool.
1795#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1796pub struct ClusterClassWorkersMachinePoolsTemplateBootstrap {
1797    /// ref is a required reference to a custom resource
1798    /// offered by a provider.
1799    #[serde(rename = "ref")]
1800    pub r#ref: ObjectReference,
1801}
1802
1803/// ref is a required reference to a custom resource
1804/// offered by a provider.
1805#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1806pub struct ClusterClassWorkersMachinePoolsTemplateBootstrapRef {
1807    /// API version of the referent.
1808    #[serde(
1809        default,
1810        skip_serializing_if = "Option::is_none",
1811        rename = "apiVersion"
1812    )]
1813    pub api_version: Option<String>,
1814    /// If referring to a piece of an object instead of an entire object, this string
1815    /// should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
1816    /// For example, if the object reference is to a container within a pod, this would take on a value like:
1817    /// "spec.containers{name}" (where "name" refers to the name of the container that triggered
1818    /// the event) or if no container name is specified "spec.containers[2]" (container with
1819    /// index 2 in this pod). This syntax is chosen only to have some well-defined way of
1820    /// referencing a part of an object.
1821    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldPath")]
1822    pub field_path: Option<String>,
1823    /// Kind of the referent.
1824    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
1825    #[serde(default, skip_serializing_if = "Option::is_none")]
1826    pub kind: Option<String>,
1827    /// Name of the referent.
1828    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
1829    #[serde(default, skip_serializing_if = "Option::is_none")]
1830    pub name: Option<String>,
1831    /// Namespace of the referent.
1832    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
1833    #[serde(default, skip_serializing_if = "Option::is_none")]
1834    pub namespace: Option<String>,
1835    /// Specific resourceVersion to which this reference is made, if any.
1836    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
1837    #[serde(
1838        default,
1839        skip_serializing_if = "Option::is_none",
1840        rename = "resourceVersion"
1841    )]
1842    pub resource_version: Option<String>,
1843    /// UID of the referent.
1844    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
1845    #[serde(default, skip_serializing_if = "Option::is_none")]
1846    pub uid: Option<String>,
1847}
1848
1849/// infrastructure contains the infrastructure template reference to be used
1850/// for the creation of the MachinePool.
1851#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1852pub struct ClusterClassWorkersMachinePoolsTemplateInfrastructure {
1853    /// ref is a required reference to a custom resource
1854    /// offered by a provider.
1855    #[serde(rename = "ref")]
1856    pub r#ref: ObjectReference,
1857}
1858
1859/// ref is a required reference to a custom resource
1860/// offered by a provider.
1861#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1862pub struct ClusterClassWorkersMachinePoolsTemplateInfrastructureRef {
1863    /// API version of the referent.
1864    #[serde(
1865        default,
1866        skip_serializing_if = "Option::is_none",
1867        rename = "apiVersion"
1868    )]
1869    pub api_version: Option<String>,
1870    /// If referring to a piece of an object instead of an entire object, this string
1871    /// should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2].
1872    /// For example, if the object reference is to a container within a pod, this would take on a value like:
1873    /// "spec.containers{name}" (where "name" refers to the name of the container that triggered
1874    /// the event) or if no container name is specified "spec.containers[2]" (container with
1875    /// index 2 in this pod). This syntax is chosen only to have some well-defined way of
1876    /// referencing a part of an object.
1877    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldPath")]
1878    pub field_path: Option<String>,
1879    /// Kind of the referent.
1880    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
1881    #[serde(default, skip_serializing_if = "Option::is_none")]
1882    pub kind: Option<String>,
1883    /// Name of the referent.
1884    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
1885    #[serde(default, skip_serializing_if = "Option::is_none")]
1886    pub name: Option<String>,
1887    /// Namespace of the referent.
1888    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
1889    #[serde(default, skip_serializing_if = "Option::is_none")]
1890    pub namespace: Option<String>,
1891    /// Specific resourceVersion to which this reference is made, if any.
1892    /// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
1893    #[serde(
1894        default,
1895        skip_serializing_if = "Option::is_none",
1896        rename = "resourceVersion"
1897    )]
1898    pub resource_version: Option<String>,
1899    /// UID of the referent.
1900    /// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
1901    #[serde(default, skip_serializing_if = "Option::is_none")]
1902    pub uid: Option<String>,
1903}
1904
1905/// metadata is the metadata applied to the MachinePool.
1906/// At runtime this metadata is merged with the corresponding metadata from the topology.
1907#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1908pub struct ClusterClassWorkersMachinePoolsTemplateMetadata {
1909    /// annotations is an unstructured key value map stored with a resource that may be
1910    /// set by external tools to store and retrieve arbitrary metadata. They are not
1911    /// queryable and should be preserved when modifying objects.
1912    /// More info: http://kubernetes.io/docs/user-guide/annotations
1913    #[serde(default, skip_serializing_if = "Option::is_none")]
1914    pub annotations: Option<BTreeMap<String, String>>,
1915    /// labels is a map of string keys and values that can be used to organize and categorize
1916    /// (scope and select) objects. May match selectors of replication controllers
1917    /// and services.
1918    /// More info: http://kubernetes.io/docs/user-guide/labels
1919    #[serde(default, skip_serializing_if = "Option::is_none")]
1920    pub labels: Option<BTreeMap<String, String>>,
1921}
1922
1923/// status is the observed state of ClusterClass.
1924#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1925pub struct ClusterClassStatus {
1926    /// conditions defines current observed state of the ClusterClass.
1927    #[serde(default, skip_serializing_if = "Option::is_none")]
1928    pub conditions: Option<Vec<Condition>>,
1929    /// observedGeneration is the latest generation observed by the controller.
1930    #[serde(
1931        default,
1932        skip_serializing_if = "Option::is_none",
1933        rename = "observedGeneration"
1934    )]
1935    pub observed_generation: Option<i64>,
1936    /// v1beta2 groups all the fields that will be added or modified in ClusterClass's status with the V1Beta2 version.
1937    #[serde(default, skip_serializing_if = "Option::is_none")]
1938    pub v1beta2: Option<ClusterClassStatusV1beta2>,
1939    /// variables is a list of ClusterClassStatusVariable that are defined for the ClusterClass.
1940    #[serde(default, skip_serializing_if = "Option::is_none")]
1941    pub variables: Option<Vec<ClusterClassStatusVariables>>,
1942}
1943
1944/// v1beta2 groups all the fields that will be added or modified in ClusterClass's status with the V1Beta2 version.
1945#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1946pub struct ClusterClassStatusV1beta2 {
1947    /// conditions represents the observations of a ClusterClass's current state.
1948    /// Known condition types are VariablesReady, RefVersionsUpToDate, Paused.
1949    #[serde(default, skip_serializing_if = "Option::is_none")]
1950    pub conditions: Option<Vec<Condition>>,
1951}
1952
1953/// ClusterClassStatusVariable defines a variable which appears in the status of a ClusterClass.
1954#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1955pub struct ClusterClassStatusVariables {
1956    /// definitions is a list of definitions for a variable.
1957    pub definitions: Vec<ClusterClassStatusVariablesDefinitions>,
1958    /// definitionsConflict specifies whether or not there are conflicting definitions for a single variable name.
1959    #[serde(
1960        default,
1961        skip_serializing_if = "Option::is_none",
1962        rename = "definitionsConflict"
1963    )]
1964    pub definitions_conflict: Option<bool>,
1965    /// name is the name of the variable.
1966    pub name: String,
1967}
1968
1969/// ClusterClassStatusVariableDefinition defines a variable which appears in the status of a ClusterClass.
1970#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1971pub struct ClusterClassStatusVariablesDefinitions {
1972    /// from specifies the origin of the variable definition.
1973    /// This will be `inline` for variables defined in the ClusterClass or the name of a patch defined in the ClusterClass
1974    /// for variables discovered from a DiscoverVariables runtime extensions.
1975    pub from: String,
1976    /// metadata is the metadata of a variable.
1977    /// It can be used to add additional data for higher level tools to
1978    /// a ClusterClassVariable.
1979    ///
1980    /// Deprecated: This field is deprecated and is going to be removed in the next apiVersion.
1981    #[serde(default, skip_serializing_if = "Option::is_none")]
1982    pub metadata: Option<ClusterClassStatusVariablesDefinitionsMetadata>,
1983    /// required specifies if the variable is required.
1984    /// Note: this applies to the variable as a whole and thus the
1985    /// top-level object defined in the schema. If nested fields are
1986    /// required, this will be specified inside the schema.
1987    pub required: bool,
1988    /// schema defines the schema of the variable.
1989    pub schema: ClusterClassStatusVariablesDefinitionsSchema,
1990}
1991
1992/// metadata is the metadata of a variable.
1993/// It can be used to add additional data for higher level tools to
1994/// a ClusterClassVariable.
1995///
1996/// Deprecated: This field is deprecated and is going to be removed in the next apiVersion.
1997#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
1998pub struct ClusterClassStatusVariablesDefinitionsMetadata {
1999    /// annotations is an unstructured key value map that can be used to store and
2000    /// retrieve arbitrary metadata.
2001    /// They are not queryable.
2002    #[serde(default, skip_serializing_if = "Option::is_none")]
2003    pub annotations: Option<BTreeMap<String, String>>,
2004    /// labels is a map of string keys and values that can be used to organize and categorize
2005    /// (scope and select) variables.
2006    #[serde(default, skip_serializing_if = "Option::is_none")]
2007    pub labels: Option<BTreeMap<String, String>>,
2008}
2009
2010/// schema defines the schema of the variable.
2011#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
2012pub struct ClusterClassStatusVariablesDefinitionsSchema {
2013    /// openAPIV3Schema defines the schema of a variable via OpenAPI v3
2014    /// schema. The schema is a subset of the schema used in
2015    /// Kubernetes CRDs.
2016    #[serde(rename = "openAPIV3Schema")]
2017    pub open_apiv3_schema: ClusterClassStatusVariablesDefinitionsSchemaOpenApiv3Schema,
2018}
2019
2020/// openAPIV3Schema defines the schema of a variable via OpenAPI v3
2021/// schema. The schema is a subset of the schema used in
2022/// Kubernetes CRDs.
2023#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
2024pub struct ClusterClassStatusVariablesDefinitionsSchemaOpenApiv3Schema {
2025    /// additionalProperties specifies the schema of values in a map (keys are always strings).
2026    /// NOTE: Can only be set if type is object.
2027    /// NOTE: AdditionalProperties is mutually exclusive with Properties.
2028    /// NOTE: This field uses PreserveUnknownFields and Schemaless,
2029    /// because recursive validation is not possible.
2030    #[serde(
2031        default,
2032        skip_serializing_if = "Option::is_none",
2033        rename = "additionalProperties"
2034    )]
2035    pub additional_properties: Option<serde_json::Value>,
2036    /// allOf specifies that the variable must validate against all of the subschemas in the array.
2037    /// NOTE: This field uses PreserveUnknownFields and Schemaless,
2038    /// because recursive validation is not possible.
2039    #[serde(default, skip_serializing_if = "Option::is_none", rename = "allOf")]
2040    pub all_of: Option<serde_json::Value>,
2041    /// anyOf specifies that the variable must validate against one or more of the subschemas in the array.
2042    /// NOTE: This field uses PreserveUnknownFields and Schemaless,
2043    /// because recursive validation is not possible.
2044    #[serde(default, skip_serializing_if = "Option::is_none", rename = "anyOf")]
2045    pub any_of: Option<serde_json::Value>,
2046    /// default is the default value of the variable.
2047    /// NOTE: Can be set for all types.
2048    #[serde(default, skip_serializing_if = "Option::is_none")]
2049    pub default: Option<serde_json::Value>,
2050    /// description is a human-readable description of this variable.
2051    #[serde(default, skip_serializing_if = "Option::is_none")]
2052    pub description: Option<String>,
2053    /// enum is the list of valid values of the variable.
2054    /// NOTE: Can be set for all types.
2055    #[serde(default, skip_serializing_if = "Option::is_none", rename = "enum")]
2056    pub r#enum: Option<Vec<serde_json::Value>>,
2057    /// example is an example for this variable.
2058    #[serde(default, skip_serializing_if = "Option::is_none")]
2059    pub example: Option<serde_json::Value>,
2060    /// exclusiveMaximum specifies if the Maximum is exclusive.
2061    /// NOTE: Can only be set if type is integer or number.
2062    #[serde(
2063        default,
2064        skip_serializing_if = "Option::is_none",
2065        rename = "exclusiveMaximum"
2066    )]
2067    pub exclusive_maximum: Option<bool>,
2068    /// exclusiveMinimum specifies if the Minimum is exclusive.
2069    /// NOTE: Can only be set if type is integer or number.
2070    #[serde(
2071        default,
2072        skip_serializing_if = "Option::is_none",
2073        rename = "exclusiveMinimum"
2074    )]
2075    pub exclusive_minimum: Option<bool>,
2076    /// format is an OpenAPI v3 format string. Unknown formats are ignored.
2077    /// For a list of supported formats please see: (of the k8s.io/apiextensions-apiserver version we're currently using)
2078    /// https://github.com/kubernetes/apiextensions-apiserver/blob/master/pkg/apiserver/validation/formats.go
2079    /// NOTE: Can only be set if type is string.
2080    #[serde(default, skip_serializing_if = "Option::is_none")]
2081    pub format: Option<String>,
2082    /// items specifies fields of an array.
2083    /// NOTE: Can only be set if type is array.
2084    /// NOTE: This field uses PreserveUnknownFields and Schemaless,
2085    /// because recursive validation is not possible.
2086    #[serde(default, skip_serializing_if = "Option::is_none")]
2087    pub items: Option<serde_json::Value>,
2088    /// maxItems is the max length of an array variable.
2089    /// NOTE: Can only be set if type is array.
2090    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxItems")]
2091    pub max_items: Option<i64>,
2092    /// maxLength is the max length of a string variable.
2093    /// NOTE: Can only be set if type is string.
2094    #[serde(default, skip_serializing_if = "Option::is_none", rename = "maxLength")]
2095    pub max_length: Option<i64>,
2096    /// maxProperties is the maximum amount of entries in a map or properties in an object.
2097    /// NOTE: Can only be set if type is object.
2098    #[serde(
2099        default,
2100        skip_serializing_if = "Option::is_none",
2101        rename = "maxProperties"
2102    )]
2103    pub max_properties: Option<i64>,
2104    /// maximum is the maximum of an integer or number variable.
2105    /// If ExclusiveMaximum is false, the variable is valid if it is lower than, or equal to, the value of Maximum.
2106    /// If ExclusiveMaximum is true, the variable is valid if it is strictly lower than the value of Maximum.
2107    /// NOTE: Can only be set if type is integer or number.
2108    #[serde(default, skip_serializing_if = "Option::is_none")]
2109    pub maximum: Option<i64>,
2110    /// minItems is the min length of an array variable.
2111    /// NOTE: Can only be set if type is array.
2112    #[serde(default, skip_serializing_if = "Option::is_none", rename = "minItems")]
2113    pub min_items: Option<i64>,
2114    /// minLength is the min length of a string variable.
2115    /// NOTE: Can only be set if type is string.
2116    #[serde(default, skip_serializing_if = "Option::is_none", rename = "minLength")]
2117    pub min_length: Option<i64>,
2118    /// minProperties is the minimum amount of entries in a map or properties in an object.
2119    /// NOTE: Can only be set if type is object.
2120    #[serde(
2121        default,
2122        skip_serializing_if = "Option::is_none",
2123        rename = "minProperties"
2124    )]
2125    pub min_properties: Option<i64>,
2126    /// minimum is the minimum of an integer or number variable.
2127    /// If ExclusiveMinimum is false, the variable is valid if it is greater than, or equal to, the value of Minimum.
2128    /// If ExclusiveMinimum is true, the variable is valid if it is strictly greater than the value of Minimum.
2129    /// NOTE: Can only be set if type is integer or number.
2130    #[serde(default, skip_serializing_if = "Option::is_none")]
2131    pub minimum: Option<i64>,
2132    /// not specifies that the variable must not validate against the subschema.
2133    /// NOTE: This field uses PreserveUnknownFields and Schemaless,
2134    /// because recursive validation is not possible.
2135    #[serde(default, skip_serializing_if = "Option::is_none")]
2136    pub not: Option<serde_json::Value>,
2137    /// oneOf specifies that the variable must validate against exactly one of the subschemas in the array.
2138    /// NOTE: This field uses PreserveUnknownFields and Schemaless,
2139    /// because recursive validation is not possible.
2140    #[serde(default, skip_serializing_if = "Option::is_none", rename = "oneOf")]
2141    pub one_of: Option<serde_json::Value>,
2142    /// pattern is the regex which a string variable must match.
2143    /// NOTE: Can only be set if type is string.
2144    #[serde(default, skip_serializing_if = "Option::is_none")]
2145    pub pattern: Option<String>,
2146    /// properties specifies fields of an object.
2147    /// NOTE: Can only be set if type is object.
2148    /// NOTE: Properties is mutually exclusive with AdditionalProperties.
2149    /// NOTE: This field uses PreserveUnknownFields and Schemaless,
2150    /// because recursive validation is not possible.
2151    #[serde(default, skip_serializing_if = "Option::is_none")]
2152    pub properties: Option<serde_json::Value>,
2153    /// required specifies which fields of an object are required.
2154    /// NOTE: Can only be set if type is object.
2155    #[serde(default, skip_serializing_if = "Option::is_none")]
2156    pub required: Option<Vec<String>>,
2157    /// type is the type of the variable.
2158    /// Valid values are: object, array, string, integer, number or boolean.
2159    #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
2160    pub r#type: Option<ClusterClassStatusVariablesDefinitionsSchemaOpenApiv3SchemaType>,
2161    /// uniqueItems specifies if items in an array must be unique.
2162    /// NOTE: Can only be set if type is array.
2163    #[serde(
2164        default,
2165        skip_serializing_if = "Option::is_none",
2166        rename = "uniqueItems"
2167    )]
2168    pub unique_items: Option<bool>,
2169    /// x-kubernetes-int-or-string specifies that this value is
2170    /// either an integer or a string. If this is true, an empty
2171    /// type is allowed and type as child of anyOf is permitted
2172    /// if following one of the following patterns:
2173    ///
2174    /// 1) anyOf:
2175    ///    - type: integer
2176    ///    - type: string
2177    /// 2) allOf:
2178    ///    - anyOf:
2179    ///      - type: integer
2180    ///      - type: string
2181    ///    - ... zero or more
2182    #[serde(
2183        default,
2184        skip_serializing_if = "Option::is_none",
2185        rename = "x-kubernetes-int-or-string"
2186    )]
2187    pub x_kubernetes_int_or_string: Option<bool>,
2188    /// x-kubernetes-preserve-unknown-fields allows setting fields in a variable object
2189    /// which are not defined in the variable schema. This affects fields recursively,
2190    /// except if nested properties or additionalProperties are specified in the schema.
2191    #[serde(
2192        default,
2193        skip_serializing_if = "Option::is_none",
2194        rename = "x-kubernetes-preserve-unknown-fields"
2195    )]
2196    pub x_kubernetes_preserve_unknown_fields: Option<bool>,
2197    /// x-kubernetes-validations describes a list of validation rules written in the CEL expression language.
2198    #[serde(
2199        default,
2200        skip_serializing_if = "Option::is_none",
2201        rename = "x-kubernetes-validations"
2202    )]
2203    pub x_kubernetes_validations: Option<
2204        Vec<ClusterClassStatusVariablesDefinitionsSchemaOpenApiv3SchemaXKubernetesValidations>,
2205    >,
2206    /// x-metadata is the metadata of a variable or a nested field within a variable.
2207    /// It can be used to add additional data for higher level tools.
2208    #[serde(
2209        default,
2210        skip_serializing_if = "Option::is_none",
2211        rename = "x-metadata"
2212    )]
2213    pub x_metadata: Option<ClusterClassStatusVariablesDefinitionsSchemaOpenApiv3SchemaXMetadata>,
2214}
2215
2216/// openAPIV3Schema defines the schema of a variable via OpenAPI v3
2217/// schema. The schema is a subset of the schema used in
2218/// Kubernetes CRDs.
2219#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2220pub enum ClusterClassStatusVariablesDefinitionsSchemaOpenApiv3SchemaType {
2221    #[serde(rename = "object")]
2222    Object,
2223    #[serde(rename = "array")]
2224    Array,
2225    #[serde(rename = "string")]
2226    String,
2227    #[serde(rename = "integer")]
2228    Integer,
2229    #[serde(rename = "number")]
2230    Number,
2231    #[serde(rename = "boolean")]
2232    Boolean,
2233}
2234
2235/// ValidationRule describes a validation rule written in the CEL expression language.
2236#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
2237pub struct ClusterClassStatusVariablesDefinitionsSchemaOpenApiv3SchemaXKubernetesValidations {
2238    /// fieldPath represents the field path returned when the validation fails.
2239    /// It must be a relative JSON path (i.e. with array notation) scoped to the location of this x-kubernetes-validations extension in the schema and refer to an existing field.
2240    /// e.g. when validation checks if a specific attribute `foo` under a map `testMap`, the fieldPath could be set to `.testMap.foo`
2241    /// If the validation checks two lists must have unique attributes, the fieldPath could be set to either of the list: e.g. `.testList`
2242    /// It does not support list numeric index.
2243    /// It supports child operation to refer to an existing field currently. Refer to [JSONPath support in Kubernetes](https://kubernetes.io/docs/reference/kubectl/jsonpath/) for more info.
2244    /// Numeric index of array is not supported.
2245    /// For field name which contains special characters, use `['specialName']` to refer the field name.
2246    /// e.g. for attribute `foo.34$` appears in a list `testList`, the fieldPath could be set to `.testList['foo.34$']`
2247    #[serde(default, skip_serializing_if = "Option::is_none", rename = "fieldPath")]
2248    pub field_path: Option<String>,
2249    /// message represents the message displayed when validation fails. The message is required if the Rule contains
2250    /// line breaks. The message must not contain line breaks.
2251    /// If unset, the message is "failed rule: {Rule}".
2252    /// e.g. "must be a URL with the host matching spec.host"
2253    #[serde(default, skip_serializing_if = "Option::is_none")]
2254    pub message: Option<String>,
2255    /// messageExpression declares a CEL expression that evaluates to the validation failure message that is returned when this rule fails.
2256    /// Since messageExpression is used as a failure message, it must evaluate to a string.
2257    /// If both message and messageExpression are present on a rule, then messageExpression will be used if validation
2258    /// fails. If messageExpression results in a runtime error, the validation failure message is produced
2259    /// as if the messageExpression field were unset. If messageExpression evaluates to an empty string, a string with only spaces, or a string
2260    /// that contains line breaks, then the validation failure message will also be produced as if the messageExpression field were unset.
2261    /// messageExpression has access to all the same variables as the rule; the only difference is the return type.
2262    /// Example:
2263    /// "x must be less than max ("+string(self.max)+")"
2264    #[serde(
2265        default,
2266        skip_serializing_if = "Option::is_none",
2267        rename = "messageExpression"
2268    )]
2269    pub message_expression: Option<String>,
2270    /// reason provides a machine-readable validation failure reason that is returned to the caller when a request fails this validation rule.
2271    /// The currently supported reasons are: "FieldValueInvalid", "FieldValueForbidden", "FieldValueRequired", "FieldValueDuplicate".
2272    /// If not set, default to use "FieldValueInvalid".
2273    /// All future added reasons must be accepted by clients when reading this value and unknown reasons should be treated as FieldValueInvalid.
2274    #[serde(default, skip_serializing_if = "Option::is_none")]
2275    pub reason: Option<
2276        ClusterClassStatusVariablesDefinitionsSchemaOpenApiv3SchemaXKubernetesValidationsReason,
2277    >,
2278    /// rule represents the expression which will be evaluated by CEL.
2279    /// ref: https://github.com/google/cel-spec
2280    /// The Rule is scoped to the location of the x-kubernetes-validations extension in the schema.
2281    /// The `self` variable in the CEL expression is bound to the scoped value.
2282    /// If the Rule is scoped to an object with properties, the accessible properties of the object are field selectable
2283    /// via `self.field` and field presence can be checked via `has(self.field)`.
2284    /// If the Rule is scoped to an object with additionalProperties (i.e. a map) the value of the map
2285    /// are accessible via `self[mapKey]`, map containment can be checked via `mapKey in self` and all entries of the map
2286    /// are accessible via CEL macros and functions such as `self.all(...)`.
2287    /// If the Rule is scoped to an array, the elements of the array are accessible via `self[i]` and also by macros and
2288    /// functions.
2289    /// If the Rule is scoped to a scalar, `self` is bound to the scalar value.
2290    /// Examples:
2291    /// - Rule scoped to a map of objects: {"rule": "self.components['Widget'].priority < 10"}
2292    /// - Rule scoped to a list of integers: {"rule": "self.values.all(value, value >= 0 && value < 100)"}
2293    /// - Rule scoped to a string value: {"rule": "self.startsWith('kube')"}
2294    ///
2295    /// Unknown data preserved in custom resources via x-kubernetes-preserve-unknown-fields is not accessible in CEL
2296    /// expressions. This includes:
2297    /// - Unknown field values that are preserved by object schemas with x-kubernetes-preserve-unknown-fields.
2298    /// - Object properties where the property schema is of an "unknown type". An "unknown type" is recursively defined as:
2299    ///   - A schema with no type and x-kubernetes-preserve-unknown-fields set to true
2300    ///   - An array where the items schema is of an "unknown type"
2301    ///   - An object where the additionalProperties schema is of an "unknown type"
2302    ///
2303    /// Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible.
2304    /// Accessible property names are escaped according to the following rules when accessed in the expression:
2305    /// - '__' escapes to '__underscores__'
2306    /// - '.' escapes to '__dot__'
2307    /// - '-' escapes to '__dash__'
2308    /// - '/' escapes to '__slash__'
2309    /// - Property names that exactly match a CEL RESERVED keyword escape to '__{keyword}__'. The keywords are:
2310    /// 	  "true", "false", "null", "in", "as", "break", "const", "continue", "else", "for", "function", "if",
2311    /// 	  "import", "let", "loop", "package", "namespace", "return".
2312    /// Examples:
2313    ///   - Rule accessing a property named "namespace": {"rule": "self.__namespace__ > 0"}
2314    ///   - Rule accessing a property named "x-prop": {"rule": "self.x__dash__prop > 0"}
2315    ///   - Rule accessing a property named "redact__d": {"rule": "self.redact__underscores__d > 0"}
2316    ///
2317    /// If `rule` makes use of the `oldSelf` variable it is implicitly a
2318    /// `transition rule`.
2319    ///
2320    /// By default, the `oldSelf` variable is the same type as `self`.
2321    ///
2322    /// Transition rules by default are applied only on UPDATE requests and are
2323    /// skipped if an old value could not be found.
2324    pub rule: String,
2325}
2326
2327/// ValidationRule describes a validation rule written in the CEL expression language.
2328#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2329pub enum ClusterClassStatusVariablesDefinitionsSchemaOpenApiv3SchemaXKubernetesValidationsReason {
2330    FieldValueInvalid,
2331    FieldValueForbidden,
2332    FieldValueRequired,
2333    FieldValueDuplicate,
2334}
2335
2336/// x-metadata is the metadata of a variable or a nested field within a variable.
2337/// It can be used to add additional data for higher level tools.
2338#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
2339pub struct ClusterClassStatusVariablesDefinitionsSchemaOpenApiv3SchemaXMetadata {
2340    /// annotations is an unstructured key value map that can be used to store and
2341    /// retrieve arbitrary metadata.
2342    /// They are not queryable.
2343    #[serde(default, skip_serializing_if = "Option::is_none")]
2344    pub annotations: Option<BTreeMap<String, String>>,
2345    /// labels is a map of string keys and values that can be used to organize and categorize
2346    /// (scope and select) variables.
2347    #[serde(default, skip_serializing_if = "Option::is_none")]
2348    pub labels: Option<BTreeMap<String, String>>,
2349}