blob: 5f9498e4e44e9db7a41731c97abb44edd048ed3b [file] [log] [blame]
Andrea Campanella3614a922021-02-25 12:40:42 +01001// Protocol Buffers - Google's data interchange format
2// Copyright 2008 Google Inc. All rights reserved.
3// https://developers.google.com/protocol-buffers/
4//
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions are
7// met:
8//
9// * Redistributions of source code must retain the above copyright
10// notice, this list of conditions and the following disclaimer.
11// * Redistributions in binary form must reproduce the above
12// copyright notice, this list of conditions and the following disclaimer
13// in the documentation and/or other materials provided with the
14// distribution.
15// * Neither the name of Google Inc. nor the names of its
16// contributors may be used to endorse or promote products derived from
17// this software without specific prior written permission.
18//
19// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31// Code generated by protoc-gen-go. DO NOT EDIT.
32// source: google/protobuf/any.proto
33
34package anypb
35
36import (
37 protoreflect "google.golang.org/protobuf/reflect/protoreflect"
38 protoimpl "google.golang.org/protobuf/runtime/protoimpl"
39 reflect "reflect"
40 sync "sync"
41)
42
43// `Any` contains an arbitrary serialized protocol buffer message along with a
44// URL that describes the type of the serialized message.
45//
46// Protobuf library provides support to pack/unpack Any values in the form
47// of utility functions or additional generated methods of the Any type.
48//
49// Example 1: Pack and unpack a message in C++.
50//
51// Foo foo = ...;
52// Any any;
53// any.PackFrom(foo);
54// ...
55// if (any.UnpackTo(&foo)) {
56// ...
57// }
58//
59// Example 2: Pack and unpack a message in Java.
60//
61// Foo foo = ...;
62// Any any = Any.pack(foo);
63// ...
64// if (any.is(Foo.class)) {
65// foo = any.unpack(Foo.class);
66// }
67//
68// Example 3: Pack and unpack a message in Python.
69//
70// foo = Foo(...)
71// any = Any()
72// any.Pack(foo)
73// ...
74// if any.Is(Foo.DESCRIPTOR):
75// any.Unpack(foo)
76// ...
77//
78// Example 4: Pack and unpack a message in Go
79//
80// foo := &pb.Foo{...}
81// any, err := ptypes.MarshalAny(foo)
82// ...
83// foo := &pb.Foo{}
84// if err := ptypes.UnmarshalAny(any, foo); err != nil {
85// ...
86// }
87//
88// The pack methods provided by protobuf library will by default use
89// 'type.googleapis.com/full.type.name' as the type URL and the unpack
90// methods only use the fully qualified type name after the last '/'
91// in the type URL, for example "foo.bar.com/x/y.z" will yield type
92// name "y.z".
93//
94//
95// JSON
96// ====
97// The JSON representation of an `Any` value uses the regular
98// representation of the deserialized, embedded message, with an
99// additional field `@type` which contains the type URL. Example:
100//
101// package google.profile;
102// message Person {
103// string first_name = 1;
104// string last_name = 2;
105// }
106//
107// {
108// "@type": "type.googleapis.com/google.profile.Person",
109// "firstName": <string>,
110// "lastName": <string>
111// }
112//
113// If the embedded message type is well-known and has a custom JSON
114// representation, that representation will be embedded adding a field
115// `value` which holds the custom JSON in addition to the `@type`
116// field. Example (for message [google.protobuf.Duration][]):
117//
118// {
119// "@type": "type.googleapis.com/google.protobuf.Duration",
120// "value": "1.212s"
121// }
122//
123type Any struct {
124 state protoimpl.MessageState
125 sizeCache protoimpl.SizeCache
126 unknownFields protoimpl.UnknownFields
127
128 // A URL/resource name that uniquely identifies the type of the serialized
129 // protocol buffer message. This string must contain at least
130 // one "/" character. The last segment of the URL's path must represent
131 // the fully qualified name of the type (as in
132 // `path/google.protobuf.Duration`). The name should be in a canonical form
133 // (e.g., leading "." is not accepted).
134 //
135 // In practice, teams usually precompile into the binary all types that they
136 // expect it to use in the context of Any. However, for URLs which use the
137 // scheme `http`, `https`, or no scheme, one can optionally set up a type
138 // server that maps type URLs to message definitions as follows:
139 //
140 // * If no scheme is provided, `https` is assumed.
141 // * An HTTP GET on the URL must yield a [google.protobuf.Type][]
142 // value in binary format, or produce an error.
143 // * Applications are allowed to cache lookup results based on the
144 // URL, or have them precompiled into a binary to avoid any
145 // lookup. Therefore, binary compatibility needs to be preserved
146 // on changes to types. (Use versioned type names to manage
147 // breaking changes.)
148 //
149 // Note: this functionality is not currently available in the official
150 // protobuf release, and it is not used for type URLs beginning with
151 // type.googleapis.com.
152 //
153 // Schemes other than `http`, `https` (or the empty scheme) might be
154 // used with implementation specific semantics.
155 //
156 TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
157 // Must be a valid serialized protocol buffer of the above specified type.
158 Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
159}
160
161func (x *Any) Reset() {
162 *x = Any{}
163 if protoimpl.UnsafeEnabled {
164 mi := &file_google_protobuf_any_proto_msgTypes[0]
165 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
166 ms.StoreMessageInfo(mi)
167 }
168}
169
170func (x *Any) String() string {
171 return protoimpl.X.MessageStringOf(x)
172}
173
174func (*Any) ProtoMessage() {}
175
176func (x *Any) ProtoReflect() protoreflect.Message {
177 mi := &file_google_protobuf_any_proto_msgTypes[0]
178 if protoimpl.UnsafeEnabled && x != nil {
179 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
180 if ms.LoadMessageInfo() == nil {
181 ms.StoreMessageInfo(mi)
182 }
183 return ms
184 }
185 return mi.MessageOf(x)
186}
187
188// Deprecated: Use Any.ProtoReflect.Descriptor instead.
189func (*Any) Descriptor() ([]byte, []int) {
190 return file_google_protobuf_any_proto_rawDescGZIP(), []int{0}
191}
192
193func (x *Any) GetTypeUrl() string {
194 if x != nil {
195 return x.TypeUrl
196 }
197 return ""
198}
199
200func (x *Any) GetValue() []byte {
201 if x != nil {
202 return x.Value
203 }
204 return nil
205}
206
207var File_google_protobuf_any_proto protoreflect.FileDescriptor
208
209var file_google_protobuf_any_proto_rawDesc = []byte{
210 0x0a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
211 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x67, 0x6f, 0x6f,
212 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0x36, 0x0a, 0x03,
213 0x41, 0x6e, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18,
214 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x79, 0x70, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x14,
215 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76,
216 0x61, 0x6c, 0x75, 0x65, 0x42, 0x6f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
217 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x08, 0x41, 0x6e, 0x79,
218 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
219 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
220 0x62, 0x75, 0x66, 0x2f, 0x70, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x61, 0x6e, 0x79, 0xa2, 0x02,
221 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72,
222 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e,
223 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
224}
225
226var (
227 file_google_protobuf_any_proto_rawDescOnce sync.Once
228 file_google_protobuf_any_proto_rawDescData = file_google_protobuf_any_proto_rawDesc
229)
230
231func file_google_protobuf_any_proto_rawDescGZIP() []byte {
232 file_google_protobuf_any_proto_rawDescOnce.Do(func() {
233 file_google_protobuf_any_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_protobuf_any_proto_rawDescData)
234 })
235 return file_google_protobuf_any_proto_rawDescData
236}
237
238var file_google_protobuf_any_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
239var file_google_protobuf_any_proto_goTypes = []interface{}{
240 (*Any)(nil), // 0: google.protobuf.Any
241}
242var file_google_protobuf_any_proto_depIdxs = []int32{
243 0, // [0:0] is the sub-list for method output_type
244 0, // [0:0] is the sub-list for method input_type
245 0, // [0:0] is the sub-list for extension type_name
246 0, // [0:0] is the sub-list for extension extendee
247 0, // [0:0] is the sub-list for field type_name
248}
249
250func init() { file_google_protobuf_any_proto_init() }
251func file_google_protobuf_any_proto_init() {
252 if File_google_protobuf_any_proto != nil {
253 return
254 }
255 if !protoimpl.UnsafeEnabled {
256 file_google_protobuf_any_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
257 switch v := v.(*Any); i {
258 case 0:
259 return &v.state
260 case 1:
261 return &v.sizeCache
262 case 2:
263 return &v.unknownFields
264 default:
265 return nil
266 }
267 }
268 }
269 type x struct{}
270 out := protoimpl.TypeBuilder{
271 File: protoimpl.DescBuilder{
272 GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
273 RawDescriptor: file_google_protobuf_any_proto_rawDesc,
274 NumEnums: 0,
275 NumMessages: 1,
276 NumExtensions: 0,
277 NumServices: 0,
278 },
279 GoTypes: file_google_protobuf_any_proto_goTypes,
280 DependencyIndexes: file_google_protobuf_any_proto_depIdxs,
281 MessageInfos: file_google_protobuf_any_proto_msgTypes,
282 }.Build()
283 File_google_protobuf_any_proto = out.File
284 file_google_protobuf_any_proto_rawDesc = nil
285 file_google_protobuf_any_proto_goTypes = nil
286 file_google_protobuf_any_proto_depIdxs = nil
287}