• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: google/protobuf/any.proto
3 
4 #import "GPBProtocolBuffers.h"
5 
6 #if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001
7 #error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources.
8 #endif
9 
10 // @@protoc_insertion_point(imports)
11 
12 #pragma clang diagnostic push
13 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
14 
15 CF_EXTERN_C_BEGIN
16 
17 NS_ASSUME_NONNULL_BEGIN
18 
19 #pragma mark - GPBAnyRoot
20 
21 /// Exposes the extension registry for this file.
22 ///
23 /// The base class provides:
24 /// @code
25 ///   + (GPBExtensionRegistry *)extensionRegistry;
26 /// @endcode
27 /// which is a @c GPBExtensionRegistry that includes all the extensions defined by
28 /// this file and all files that it depends on.
29 @interface GPBAnyRoot : GPBRootObject
30 @end
31 
32 #pragma mark - GPBAny
33 
34 typedef GPB_ENUM(GPBAny_FieldNumber) {
35   GPBAny_FieldNumber_TypeURL = 1,
36   GPBAny_FieldNumber_Value = 2,
37 };
38 
39 /// `Any` contains an arbitrary serialized protocol buffer message along with a
40 /// URL that describes the type of the serialized message.
41 ///
42 /// Protobuf library provides support to pack/unpack Any values in the form
43 /// of utility functions or additional generated methods of the Any type.
44 ///
45 /// Example 1: Pack and unpack a message in C++.
46 ///
47 ///     Foo foo = ...;
48 ///     Any any;
49 ///     any.PackFrom(foo);
50 ///     ...
51 ///     if (any.UnpackTo(&foo)) {
52 ///       ...
53 ///     }
54 ///
55 /// Example 2: Pack and unpack a message in Java.
56 ///
57 ///     Foo foo = ...;
58 ///     Any any = Any.pack(foo);
59 ///     ...
60 ///     if (any.is(Foo.class)) {
61 ///       foo = any.unpack(Foo.class);
62 ///     }
63 ///
64 /// The pack methods provided by protobuf library will by default use
65 /// 'type.googleapis.com/full.type.name' as the type URL and the unpack
66 /// methods only use the fully qualified type name after the last '/'
67 /// in the type URL, for example "foo.bar.com/x/y.z" will yield type
68 /// name "y.z".
69 ///
70 ///
71 /// JSON
72 /// ====
73 /// The JSON representation of an `Any` value uses the regular
74 /// representation of the deserialized, embedded message, with an
75 /// additional field `\@type` which contains the type URL. Example:
76 ///
77 ///     package google.profile;
78 ///     message Person {
79 ///       string first_name = 1;
80 ///       string last_name = 2;
81 ///     }
82 ///
83 ///     {
84 ///       "\@type": "type.googleapis.com/google.profile.Person",
85 ///       "firstName": <string>,
86 ///       "lastName": <string>
87 ///     }
88 ///
89 /// If the embedded message type is well-known and has a custom JSON
90 /// representation, that representation will be embedded adding a field
91 /// `value` which holds the custom JSON in addition to the `\@type`
92 /// field. Example (for message [google.protobuf.Duration][]):
93 ///
94 ///     {
95 ///       "\@type": "type.googleapis.com/google.protobuf.Duration",
96 ///       "value": "1.212s"
97 ///     }
98 @interface GPBAny : GPBMessage
99 
100 /// A URL/resource name whose content describes the type of the
101 /// serialized protocol buffer message.
102 ///
103 /// For URLs which use the schema `http`, `https`, or no schema, the
104 /// following restrictions and interpretations apply:
105 ///
106 /// * If no schema is provided, `https` is assumed.
107 /// * The last segment of the URL's path must represent the fully
108 ///   qualified name of the type (as in `path/google.protobuf.Duration`).
109 ///   The name should be in a canonical form (e.g., leading "." is
110 ///   not accepted).
111 /// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
112 ///   value in binary format, or produce an error.
113 /// * Applications are allowed to cache lookup results based on the
114 ///   URL, or have them precompiled into a binary to avoid any
115 ///   lookup. Therefore, binary compatibility needs to be preserved
116 ///   on changes to types. (Use versioned type names to manage
117 ///   breaking changes.)
118 ///
119 /// Schemas other than `http`, `https` (or the empty schema) might be
120 /// used with implementation specific semantics.
121 @property(nonatomic, readwrite, copy, null_resettable) NSString *typeURL;
122 
123 /// Must be a valid serialized protocol buffer of the above specified type.
124 @property(nonatomic, readwrite, copy, null_resettable) NSData *value;
125 
126 @end
127 
128 NS_ASSUME_NONNULL_END
129 
130 CF_EXTERN_C_END
131 
132 #pragma clang diagnostic pop
133 
134 // @@protoc_insertion_point(global_scope)
135