k8s_openapi/v1_32/apiextensions_apiserver/pkg/apis/apiextensions/v1/
custom_resource_subresource_status.rs

1// Generated from definition io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceSubresourceStatus
2
3/// CustomResourceSubresourceStatus defines how to serve the status subresource for CustomResources. Status is represented by the `.status` JSON path inside of a CustomResource. When set, * exposes a /status subresource for the custom resource * PUT requests to the /status subresource take a custom resource object, and ignore changes to anything except the status stanza * PUT/POST/PATCH requests to the custom resource ignore changes to the status stanza
4#[derive(Clone, Debug, Default, PartialEq)]
5pub struct CustomResourceSubresourceStatus(pub crate::serde_json::Value);
6
7impl crate::DeepMerge for CustomResourceSubresourceStatus {
8    fn merge_from(&mut self, other: Self) {
9        crate::DeepMerge::merge_from(&mut self.0, other.0);
10    }
11}
12
13impl<'de> crate::serde::Deserialize<'de> for CustomResourceSubresourceStatus {
14    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: crate::serde::Deserializer<'de> {
15        struct Visitor;
16
17        impl<'de> crate::serde::de::Visitor<'de> for Visitor {
18            type Value = CustomResourceSubresourceStatus;
19
20            fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21                f.write_str("CustomResourceSubresourceStatus")
22            }
23
24            fn visit_newtype_struct<D>(self, deserializer: D) -> Result<Self::Value, D::Error> where D: crate::serde::Deserializer<'de> {
25                Ok(CustomResourceSubresourceStatus(crate::serde::Deserialize::deserialize(deserializer)?))
26            }
27        }
28
29        deserializer.deserialize_newtype_struct("CustomResourceSubresourceStatus", Visitor)
30    }
31}
32
33impl crate::serde::Serialize for CustomResourceSubresourceStatus {
34    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: crate::serde::Serializer {
35        serializer.serialize_newtype_struct("CustomResourceSubresourceStatus", &self.0)
36    }
37}
38
39#[cfg(feature = "schemars")]
40impl crate::schemars::JsonSchema for CustomResourceSubresourceStatus {
41    fn schema_name() -> String {
42        "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceSubresourceStatus".to_owned()
43    }
44
45    fn json_schema(__gen: &mut crate::schemars::gen::SchemaGenerator) -> crate::schemars::schema::Schema {
46        crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject {
47            metadata: Some(Box::new(crate::schemars::schema::Metadata {
48                description: Some("CustomResourceSubresourceStatus defines how to serve the status subresource for CustomResources. Status is represented by the `.status` JSON path inside of a CustomResource. When set, * exposes a /status subresource for the custom resource * PUT requests to the /status subresource take a custom resource object, and ignore changes to anything except the status stanza * PUT/POST/PATCH requests to the custom resource ignore changes to the status stanza".to_owned()),
49                ..Default::default()
50            })),
51            instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))),
52            ..Default::default()
53        })
54    }
55}