blob: 2ff3839159a0d555d8a2ea032955ec081f48de01 [file] [log] [blame]
Matthias Andreas Benkard832a54e2019-01-29 09:27:38 +01001/*
2Copyright The Kubernetes Authors.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17
18// This file was autogenerated by go-to-protobuf. Do not edit it manually!
19
20syntax = 'proto2';
21
22package k8s.io.apimachinery.pkg.runtime;
23
24import "k8s.io/apimachinery/pkg/util/intstr/generated.proto";
25
26// Package-wide variables from generator "generated".
27option go_package = "runtime";
28
29// RawExtension is used to hold extensions in external versions.
30//
31// To use this, make a field which has RawExtension as its type in your external, versioned
32// struct, and Object in your internal struct. You also need to register your
33// various plugin types.
34//
35// // Internal package:
36// type MyAPIObject struct {
37// runtime.TypeMeta `json:",inline"`
38// MyPlugin runtime.Object `json:"myPlugin"`
39// }
40// type PluginA struct {
41// AOption string `json:"aOption"`
42// }
43//
44// // External package:
45// type MyAPIObject struct {
46// runtime.TypeMeta `json:",inline"`
47// MyPlugin runtime.RawExtension `json:"myPlugin"`
48// }
49// type PluginA struct {
50// AOption string `json:"aOption"`
51// }
52//
53// // On the wire, the JSON will look something like this:
54// {
55// "kind":"MyAPIObject",
56// "apiVersion":"v1",
57// "myPlugin": {
58// "kind":"PluginA",
59// "aOption":"foo",
60// },
61// }
62//
63// So what happens? Decode first uses json or yaml to unmarshal the serialized data into
64// your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked.
65// The next step is to copy (using pkg/conversion) into the internal struct. The runtime
66// package's DefaultScheme has conversion functions installed which will unpack the
67// JSON stored in RawExtension, turning it into the correct object type, and storing it
68// in the Object. (TODO: In the case where the object is of an unknown type, a
69// runtime.Unknown object will be created and stored.)
70//
71// +k8s:deepcopy-gen=true
72// +protobuf=true
73// +k8s:openapi-gen=true
74message RawExtension {
75 // Raw is the underlying serialization of this object.
76 //
77 // TODO: Determine how to detect ContentType and ContentEncoding of 'Raw' data.
78 optional bytes raw = 1;
79}
80
81// TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type,
82// like this:
83// type MyAwesomeAPIObject struct {
84// runtime.TypeMeta `json:",inline"`
85// ... // other fields
86// }
87// func (obj *MyAwesomeAPIObject) SetGroupVersionKind(gvk *metav1.GroupVersionKind) { metav1.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() *GroupVersionKind
88//
89// TypeMeta is provided here for convenience. You may use it directly from this package or define
90// your own with the same fields.
91//
92// +k8s:deepcopy-gen=false
93// +protobuf=true
94// +k8s:openapi-gen=true
95message TypeMeta {
96 // +optional
97 optional string apiVersion = 1;
98
99 // +optional
100 optional string kind = 2;
101}
102
103// Unknown allows api objects with unknown types to be passed-through. This can be used
104// to deal with the API objects from a plug-in. Unknown objects still have functioning
105// TypeMeta features-- kind, version, etc.
106// TODO: Make this object have easy access to field based accessors and settors for
107// metadata and field mutatation.
108//
109// +k8s:deepcopy-gen=true
110// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
111// +protobuf=true
112// +k8s:openapi-gen=true
113message Unknown {
114 optional TypeMeta typeMeta = 1;
115
116 // Raw will hold the complete serialized object which couldn't be matched
117 // with a registered type. Most likely, nothing should be done with this
118 // except for passing it through the system.
119 optional bytes raw = 2;
120
121 // ContentEncoding is encoding used to encode 'Raw' data.
122 // Unspecified means no encoding.
123 optional string contentEncoding = 3;
124
125 // ContentType is serialization method used to serialize 'Raw'.
126 // Unspecified means ContentTypeJSON.
127 optional string contentType = 4;
128}
129