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