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 < 30002 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 30002 < 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 @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 := ptypes.MarshalAny(foo) 98 * ... 99 * foo := &pb.Foo{} 100 * if err := ptypes.UnmarshalAny(any, foo); err != nil { 101 * ... 102 * } 103 * 104 * The pack methods provided by protobuf library will by default use 105 * 'type.googleapis.com/full.type.name' as the type URL and the unpack 106 * methods only use the fully qualified type name after the last '/' 107 * in the type URL, for example "foo.bar.com/x/y.z" will yield type 108 * name "y.z". 109 * 110 * 111 * JSON 112 * ==== 113 * The JSON representation of an `Any` value uses the regular 114 * representation of the deserialized, embedded message, with an 115 * additional field `\@type` which contains the type URL. Example: 116 * 117 * package google.profile; 118 * message Person { 119 * string first_name = 1; 120 * string last_name = 2; 121 * } 122 * 123 * { 124 * "\@type": "type.googleapis.com/google.profile.Person", 125 * "firstName": <string>, 126 * "lastName": <string> 127 * } 128 * 129 * If the embedded message type is well-known and has a custom JSON 130 * representation, that representation will be embedded adding a field 131 * `value` which holds the custom JSON in addition to the `\@type` 132 * field. Example (for message [google.protobuf.Duration][]): 133 * 134 * { 135 * "\@type": "type.googleapis.com/google.protobuf.Duration", 136 * "value": "1.212s" 137 * } 138 **/ 139 @interface GPBAny : GPBMessage 140 141 /** 142 * A URL/resource name that uniquely identifies the type of the serialized 143 * protocol buffer message. This string must contain at least 144 * one "/" character. The last segment of the URL's path must represent 145 * the fully qualified name of the type (as in 146 * `path/google.protobuf.Duration`). The name should be in a canonical form 147 * (e.g., leading "." is not accepted). 148 * 149 * In practice, teams usually precompile into the binary all types that they 150 * expect it to use in the context of Any. However, for URLs which use the 151 * scheme `http`, `https`, or no scheme, one can optionally set up a type 152 * server that maps type URLs to message definitions as follows: 153 * 154 * * If no scheme is provided, `https` is assumed. 155 * * An HTTP GET on the URL must yield a [google.protobuf.Type][] 156 * value in binary format, or produce an error. 157 * * Applications are allowed to cache lookup results based on the 158 * URL, or have them precompiled into a binary to avoid any 159 * lookup. Therefore, binary compatibility needs to be preserved 160 * on changes to types. (Use versioned type names to manage 161 * breaking changes.) 162 * 163 * Note: this functionality is not currently available in the official 164 * protobuf release, and it is not used for type URLs beginning with 165 * type.googleapis.com. 166 * 167 * Schemes other than `http`, `https` (or the empty scheme) might be 168 * used with implementation specific semantics. 169 **/ 170 @property(nonatomic, readwrite, copy, null_resettable) NSString *typeURL; 171 172 /** Must be a valid serialized protocol buffer of the above specified type. */ 173 @property(nonatomic, readwrite, copy, null_resettable) NSData *value; 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