k8s_pb/apimachinery/pkg/runtime/mod.rs
1// This file is @generated by prost-build.
2/// RawExtension is used to hold extensions in external versions.
3///
4/// To use this, make a field which has RawExtension as its type in your external, versioned
5/// struct, and Object in your internal struct. You also need to register your
6/// various plugin types.
7///
8/// // Internal package:
9///
10/// type MyAPIObject struct {
11/// runtime.TypeMeta `json:",inline"`
12/// MyPlugin runtime.Object `json:"myPlugin"`
13/// }
14///
15/// type PluginA struct {
16/// AOption string `json:"aOption"`
17/// }
18///
19/// // External package:
20///
21/// type MyAPIObject struct {
22/// runtime.TypeMeta `json:",inline"`
23/// MyPlugin runtime.RawExtension `json:"myPlugin"`
24/// }
25///
26/// type PluginA struct {
27/// AOption string `json:"aOption"`
28/// }
29///
30/// // On the wire, the JSON will look something like this:
31///
32/// {
33/// "kind":"MyAPIObject",
34/// "apiVersion":"v1",
35/// "myPlugin": {
36/// "kind":"PluginA",
37/// "aOption":"foo",
38/// },
39/// }
40///
41/// So what happens? Decode first uses json or yaml to unmarshal the serialized data into
42/// your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked.
43/// The next step is to copy (using pkg/conversion) into the internal struct. The runtime
44/// package's DefaultScheme has conversion functions installed which will unpack the
45/// JSON stored in RawExtension, turning it into the correct object type, and storing it
46/// in the Object. (TODO: In the case where the object is of an unknown type, a
47/// runtime.Unknown object will be created and stored.)
48///
49/// +k8s:deepcopy-gen=true
50/// +protobuf=true
51/// +k8s:openapi-gen=true
52#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
53pub struct RawExtension {
54 /// Raw is the underlying serialization of this object.
55 ///
56 /// TODO: Determine how to detect ContentType and ContentEncoding of 'Raw' data.
57 #[prost(bytes = "vec", optional, tag = "1")]
58 pub raw: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
59}
60/// TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type,
61/// like this:
62///
63/// type MyAwesomeAPIObject struct {
64/// runtime.TypeMeta `json:",inline"`
65/// ... // other fields
66/// }
67///
68/// func (obj *MyAwesomeAPIObject) SetGroupVersionKind(gvk *metav1.GroupVersionKind) { metav1.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() *GroupVersionKind
69///
70/// TypeMeta is provided here for convenience. You may use it directly from this package or define
71/// your own with the same fields.
72///
73/// +k8s:deepcopy-gen=false
74/// +protobuf=true
75/// +k8s:openapi-gen=true
76#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
77pub struct TypeMeta {
78 /// +optional
79 #[prost(string, optional, tag = "1")]
80 pub api_version: ::core::option::Option<::prost::alloc::string::String>,
81 /// +optional
82 #[prost(string, optional, tag = "2")]
83 pub kind: ::core::option::Option<::prost::alloc::string::String>,
84}
85/// Unknown allows api objects with unknown types to be passed-through. This can be used
86/// to deal with the API objects from a plug-in. Unknown objects still have functioning
87/// TypeMeta features-- kind, version, etc.
88/// TODO: Make this object have easy access to field based accessors and settors for
89/// metadata and field mutatation.
90///
91/// +k8s:deepcopy-gen=true
92/// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
93/// +protobuf=true
94/// +k8s:openapi-gen=true
95#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
96pub struct Unknown {
97 #[prost(message, optional, tag = "1")]
98 pub type_meta: ::core::option::Option<TypeMeta>,
99 /// Raw will hold the complete serialized object which couldn't be matched
100 /// with a registered type. Most likely, nothing should be done with this
101 /// except for passing it through the system.
102 #[prost(bytes = "vec", optional, tag = "2")]
103 pub raw: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
104 /// ContentEncoding is encoding used to encode 'Raw' data.
105 /// Unspecified means no encoding.
106 #[prost(string, optional, tag = "3")]
107 pub content_encoding: ::core::option::Option<::prost::alloc::string::String>,
108 /// ContentType is serialization method used to serialize 'Raw'.
109 /// Unspecified means ContentTypeJSON.
110 #[prost(string, optional, tag = "4")]
111 pub content_type: ::core::option::Option<::prost::alloc::string::String>,
112}