• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: google/protobuf/any.proto
3 
4 // This CPP symbol can be defined to use imports that match up to the framework
5 // imports needed when using CocoaPods.
6 #if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
7  #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
8 #endif
9 
10 #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
11  #import <Protobuf/GPBDescriptor.h>
12  #import <Protobuf/GPBMessage.h>
13  #import <Protobuf/GPBRootObject.h>
14 #else
15  #import "GPBDescriptor.h"
16  #import "GPBMessage.h"
17  #import "GPBRootObject.h"
18 #endif
19 
20 #if GOOGLE_PROTOBUF_OBJC_VERSION < 30004
21 #error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.
22 #endif
23 #if 30004 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION
24 #error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources.
25 #endif
26 
27 // @@protoc_insertion_point(imports)
28 
29 #pragma clang diagnostic push
30 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
31 
32 CF_EXTERN_C_BEGIN
33 
34 NS_ASSUME_NONNULL_BEGIN
35 
36 #pragma mark - GPBAnyRoot
37 
38 /**
39  * Exposes the extension registry for this file.
40  *
41  * The base class provides:
42  * @code
43  *   + (GPBExtensionRegistry *)extensionRegistry;
44  * @endcode
45  * which is a @c GPBExtensionRegistry that includes all the extensions defined by
46  * this file and all files that it depends on.
47  **/
48 GPB_FINAL @interface GPBAnyRoot : GPBRootObject
49 @end
50 
51 #pragma mark - GPBAny
52 
53 typedef GPB_ENUM(GPBAny_FieldNumber) {
54   GPBAny_FieldNumber_TypeURL = 1,
55   GPBAny_FieldNumber_Value = 2,
56 };
57 
58 /**
59  * `Any` contains an arbitrary serialized protocol buffer message along with a
60  * URL that describes the type of the serialized message.
61  *
62  * Protobuf library provides support to pack/unpack Any values in the form
63  * of utility functions or additional generated methods of the Any type.
64  *
65  * Example 1: Pack and unpack a message in C++.
66  *
67  *     Foo foo = ...;
68  *     Any any;
69  *     any.PackFrom(foo);
70  *     ...
71  *     if (any.UnpackTo(&foo)) {
72  *       ...
73  *     }
74  *
75  * Example 2: Pack and unpack a message in Java.
76  *
77  *     Foo foo = ...;
78  *     Any any = Any.pack(foo);
79  *     ...
80  *     if (any.is(Foo.class)) {
81  *       foo = any.unpack(Foo.class);
82  *     }
83  *
84  *  Example 3: Pack and unpack a message in Python.
85  *
86  *     foo = Foo(...)
87  *     any = Any()
88  *     any.Pack(foo)
89  *     ...
90  *     if any.Is(Foo.DESCRIPTOR):
91  *       any.Unpack(foo)
92  *       ...
93  *
94  *  Example 4: Pack and unpack a message in Go
95  *
96  *      foo := &pb.Foo{...}
97  *      any, err := anypb.New(foo)
98  *      if err != nil {
99  *        ...
100  *      }
101  *      ...
102  *      foo := &pb.Foo{}
103  *      if err := any.UnmarshalTo(foo); err != nil {
104  *        ...
105  *      }
106  *
107  * The pack methods provided by protobuf library will by default use
108  * 'type.googleapis.com/full.type.name' as the type URL and the unpack
109  * methods only use the fully qualified type name after the last '/'
110  * in the type URL, for example "foo.bar.com/x/y.z" will yield type
111  * name "y.z".
112  *
113  *
114  * JSON
115  * ====
116  * The JSON representation of an `Any` value uses the regular
117  * representation of the deserialized, embedded message, with an
118  * additional field `\@type` which contains the type URL. Example:
119  *
120  *     package google.profile;
121  *     message Person {
122  *       string first_name = 1;
123  *       string last_name = 2;
124  *     }
125  *
126  *     {
127  *       "\@type": "type.googleapis.com/google.profile.Person",
128  *       "firstName": <string>,
129  *       "lastName": <string>
130  *     }
131  *
132  * If the embedded message type is well-known and has a custom JSON
133  * representation, that representation will be embedded adding a field
134  * `value` which holds the custom JSON in addition to the `\@type`
135  * field. Example (for message [google.protobuf.Duration][]):
136  *
137  *     {
138  *       "\@type": "type.googleapis.com/google.protobuf.Duration",
139  *       "value": "1.212s"
140  *     }
141  **/
142 GPB_FINAL @interface GPBAny : GPBMessage
143 
144 /**
145  * A URL/resource name that uniquely identifies the type of the serialized
146  * protocol buffer message. This string must contain at least
147  * one "/" character. The last segment of the URL's path must represent
148  * the fully qualified name of the type (as in
149  * `path/google.protobuf.Duration`). The name should be in a canonical form
150  * (e.g., leading "." is not accepted).
151  *
152  * In practice, teams usually precompile into the binary all types that they
153  * expect it to use in the context of Any. However, for URLs which use the
154  * scheme `http`, `https`, or no scheme, one can optionally set up a type
155  * server that maps type URLs to message definitions as follows:
156  *
157  * * If no scheme is provided, `https` is assumed.
158  * * An HTTP GET on the URL must yield a [google.protobuf.Type][]
159  *   value in binary format, or produce an error.
160  * * Applications are allowed to cache lookup results based on the
161  *   URL, or have them precompiled into a binary to avoid any
162  *   lookup. Therefore, binary compatibility needs to be preserved
163  *   on changes to types. (Use versioned type names to manage
164  *   breaking changes.)
165  *
166  * Note: this functionality is not currently available in the official
167  * protobuf release, and it is not used for type URLs beginning with
168  * type.googleapis.com.
169  *
170  * Schemes other than `http`, `https` (or the empty scheme) might be
171  * used with implementation specific semantics.
172  **/
173 @property(nonatomic, readwrite, copy, null_resettable) NSString *typeURL;
174 
175 /** Must be a valid serialized protocol buffer of the above specified type. */
176 @property(nonatomic, readwrite, copy, null_resettable) NSData *value;
177 
178 @end
179 
180 NS_ASSUME_NONNULL_END
181 
182 CF_EXTERN_C_END
183 
184 #pragma clang diagnostic pop
185 
186 // @@protoc_insertion_point(global_scope)
187