k8s_openapi/v1_34/apimachinery/pkg/apis/meta/v1/
patch.rs1#[derive(Clone, Debug, PartialEq)]
5pub enum Patch {
6 Json(std::vec::Vec<crate::serde_json::Value>),
7 Merge(crate::serde_json::Value),
8 StrategicMerge(crate::serde_json::Value),
9}
10
11impl crate::serde::Serialize for Patch {
12 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: crate::serde::Serializer {
13 match self {
14 Patch::Json(patch) => serializer.serialize_newtype_struct("Patch", patch),
15 Patch::Merge(patch) |
16 Patch::StrategicMerge(patch) => serializer.serialize_newtype_struct("Patch", patch),
17 }
18 }
19}
20
21#[cfg(feature = "schemars")]
22impl crate::schemars::JsonSchema for Patch {
23 fn schema_name() -> std::borrow::Cow<'static, str> {
24 "io.k8s.apimachinery.pkg.apis.meta.v1.Patch".into()
25 }
26
27 fn json_schema(__gen: &mut crate::schemars::SchemaGenerator) -> crate::schemars::Schema {
28 crate::schemars::json_schema!({
29 "description": "Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.",
30 "type": "object",
31 })
32 }
33}