• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Code generated by protoc-gen-go. DO NOT EDIT.
2// source: google/protobuf/any.proto
3
4package any
5
6import (
7	fmt "fmt"
8	proto "github.com/golang/protobuf/proto"
9	math "math"
10)
11
12// Reference imports to suppress errors if they are not otherwise used.
13var _ = proto.Marshal
14var _ = fmt.Errorf
15var _ = math.Inf
16
17// This is a compile-time assertion to ensure that this generated file
18// is compatible with the proto package it is being compiled against.
19// A compilation error at this line likely means your copy of the
20// proto package needs to be updated.
21const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
22
23// `Any` contains an arbitrary serialized protocol buffer message along with a
24// URL that describes the type of the serialized message.
25//
26// Protobuf library provides support to pack/unpack Any values in the form
27// of utility functions or additional generated methods of the Any type.
28//
29// Example 1: Pack and unpack a message in C++.
30//
31//     Foo foo = ...;
32//     Any any;
33//     any.PackFrom(foo);
34//     ...
35//     if (any.UnpackTo(&foo)) {
36//       ...
37//     }
38//
39// Example 2: Pack and unpack a message in Java.
40//
41//     Foo foo = ...;
42//     Any any = Any.pack(foo);
43//     ...
44//     if (any.is(Foo.class)) {
45//       foo = any.unpack(Foo.class);
46//     }
47//
48//  Example 3: Pack and unpack a message in Python.
49//
50//     foo = Foo(...)
51//     any = Any()
52//     any.Pack(foo)
53//     ...
54//     if any.Is(Foo.DESCRIPTOR):
55//       any.Unpack(foo)
56//       ...
57//
58//  Example 4: Pack and unpack a message in Go
59//
60//      foo := &pb.Foo{...}
61//      any, err := ptypes.MarshalAny(foo)
62//      ...
63//      foo := &pb.Foo{}
64//      if err := ptypes.UnmarshalAny(any, foo); err != nil {
65//        ...
66//      }
67//
68// The pack methods provided by protobuf library will by default use
69// 'type.googleapis.com/full.type.name' as the type URL and the unpack
70// methods only use the fully qualified type name after the last '/'
71// in the type URL, for example "foo.bar.com/x/y.z" will yield type
72// name "y.z".
73//
74//
75// JSON
76// ====
77// The JSON representation of an `Any` value uses the regular
78// representation of the deserialized, embedded message, with an
79// additional field `@type` which contains the type URL. Example:
80//
81//     package google.profile;
82//     message Person {
83//       string first_name = 1;
84//       string last_name = 2;
85//     }
86//
87//     {
88//       "@type": "type.googleapis.com/google.profile.Person",
89//       "firstName": <string>,
90//       "lastName": <string>
91//     }
92//
93// If the embedded message type is well-known and has a custom JSON
94// representation, that representation will be embedded adding a field
95// `value` which holds the custom JSON in addition to the `@type`
96// field. Example (for message [google.protobuf.Duration][]):
97//
98//     {
99//       "@type": "type.googleapis.com/google.protobuf.Duration",
100//       "value": "1.212s"
101//     }
102//
103type Any struct {
104	// A URL/resource name that uniquely identifies the type of the serialized
105	// protocol buffer message. This string must contain at least
106	// one "/" character. The last segment of the URL's path must represent
107	// the fully qualified name of the type (as in
108	// `path/google.protobuf.Duration`). The name should be in a canonical form
109	// (e.g., leading "." is not accepted).
110	//
111	// In practice, teams usually precompile into the binary all types that they
112	// expect it to use in the context of Any. However, for URLs which use the
113	// scheme `http`, `https`, or no scheme, one can optionally set up a type
114	// server that maps type URLs to message definitions as follows:
115	//
116	// * If no scheme is provided, `https` is assumed.
117	// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
118	//   value in binary format, or produce an error.
119	// * Applications are allowed to cache lookup results based on the
120	//   URL, or have them precompiled into a binary to avoid any
121	//   lookup. Therefore, binary compatibility needs to be preserved
122	//   on changes to types. (Use versioned type names to manage
123	//   breaking changes.)
124	//
125	// Note: this functionality is not currently available in the official
126	// protobuf release, and it is not used for type URLs beginning with
127	// type.googleapis.com.
128	//
129	// Schemes other than `http`, `https` (or the empty scheme) might be
130	// used with implementation specific semantics.
131	//
132	TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
133	// Must be a valid serialized protocol buffer of the above specified type.
134	Value                []byte   `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
135	XXX_NoUnkeyedLiteral struct{} `json:"-"`
136	XXX_unrecognized     []byte   `json:"-"`
137	XXX_sizecache        int32    `json:"-"`
138}
139
140func (m *Any) Reset()         { *m = Any{} }
141func (m *Any) String() string { return proto.CompactTextString(m) }
142func (*Any) ProtoMessage()    {}
143func (*Any) Descriptor() ([]byte, []int) {
144	return fileDescriptor_b53526c13ae22eb4, []int{0}
145}
146
147func (*Any) XXX_WellKnownType() string { return "Any" }
148
149func (m *Any) XXX_Unmarshal(b []byte) error {
150	return xxx_messageInfo_Any.Unmarshal(m, b)
151}
152func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
153	return xxx_messageInfo_Any.Marshal(b, m, deterministic)
154}
155func (m *Any) XXX_Merge(src proto.Message) {
156	xxx_messageInfo_Any.Merge(m, src)
157}
158func (m *Any) XXX_Size() int {
159	return xxx_messageInfo_Any.Size(m)
160}
161func (m *Any) XXX_DiscardUnknown() {
162	xxx_messageInfo_Any.DiscardUnknown(m)
163}
164
165var xxx_messageInfo_Any proto.InternalMessageInfo
166
167func (m *Any) GetTypeUrl() string {
168	if m != nil {
169		return m.TypeUrl
170	}
171	return ""
172}
173
174func (m *Any) GetValue() []byte {
175	if m != nil {
176		return m.Value
177	}
178	return nil
179}
180
181func init() {
182	proto.RegisterType((*Any)(nil), "google.protobuf.Any")
183}
184
185func init() {
186	proto.RegisterFile("google/protobuf/any.proto", fileDescriptor_b53526c13ae22eb4)
187}
188
189var fileDescriptor_b53526c13ae22eb4 = []byte{
190	// 185 bytes of a gzipped FileDescriptorProto
191	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xcf, 0xcf, 0x4f,
192	0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcc, 0xab, 0xd4,
193	0x03, 0x73, 0x84, 0xf8, 0x21, 0x52, 0x7a, 0x30, 0x29, 0x25, 0x33, 0x2e, 0x66, 0xc7, 0xbc, 0x4a,
194	0x21, 0x49, 0x2e, 0x8e, 0x92, 0xca, 0x82, 0xd4, 0xf8, 0xd2, 0xa2, 0x1c, 0x09, 0x46, 0x05, 0x46,
195	0x0d, 0xce, 0x20, 0x76, 0x10, 0x3f, 0xb4, 0x28, 0x47, 0x48, 0x84, 0x8b, 0xb5, 0x2c, 0x31, 0xa7,
196	0x34, 0x55, 0x82, 0x49, 0x81, 0x51, 0x83, 0x27, 0x08, 0xc2, 0x71, 0xca, 0xe7, 0x12, 0x4e, 0xce,
197	0xcf, 0xd5, 0x43, 0x33, 0xce, 0x89, 0xc3, 0x31, 0xaf, 0x32, 0x00, 0xc4, 0x09, 0x60, 0x8c, 0x52,
198	0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0xcf, 0x49, 0xcc,
199	0x4b, 0x47, 0xb8, 0xa8, 0x00, 0x64, 0x7a, 0x31, 0xc8, 0x61, 0x8b, 0x98, 0x98, 0xdd, 0x03, 0x9c,
200	0x56, 0x31, 0xc9, 0xb9, 0x43, 0x8c, 0x0a, 0x80, 0x2a, 0xd1, 0x0b, 0x4f, 0xcd, 0xc9, 0xf1, 0xce,
201	0xcb, 0x2f, 0xcf, 0x0b, 0x01, 0x29, 0x4d, 0x62, 0x03, 0xeb, 0x35, 0x06, 0x04, 0x00, 0x00, 0xff,
202	0xff, 0x13, 0xf8, 0xe8, 0x42, 0xdd, 0x00, 0x00, 0x00,
203}
204