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