Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 | // source: google/protobuf/any.proto |
| 3 | |
| 4 | #import "GPBProtocolBuffers.h" |
| 5 | |
Thomas Van Lenten | 79a23c4 | 2016-03-17 10:04:21 -0400 | [diff] [blame] | 6 | #if GOOGLE_PROTOBUF_OBJC_GEN_VERSION != 30001 |
Thomas Van Lenten | 536059e | 2015-12-02 14:43:05 -0500 | [diff] [blame] | 7 | #error This file was generated by a different version of protoc which is incompatible with your Protocol Buffer library sources. |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 8 | #endif |
| 9 | |
| 10 | // @@protoc_insertion_point(imports) |
| 11 | |
Thomas Van Lenten | e664aa6 | 2016-04-19 13:13:04 -0400 | [diff] [blame] | 12 | #pragma clang diagnostic push |
| 13 | #pragma clang diagnostic ignored "-Wdeprecated-declarations" |
| 14 | |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 15 | CF_EXTERN_C_BEGIN |
| 16 | |
Thomas Van Lenten | 8c88957 | 2015-06-16 16:45:14 -0400 | [diff] [blame] | 17 | NS_ASSUME_NONNULL_BEGIN |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 18 | |
| 19 | #pragma mark - GPBAnyRoot |
| 20 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 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. |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 29 | @interface GPBAnyRoot : GPBRootObject |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 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 | |
Thomas Van Lenten | e664aa6 | 2016-04-19 13:13:04 -0400 | [diff] [blame] | 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". |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 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 | /// } |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 98 | @interface GPBAny : GPBMessage |
| 99 | |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 100 | /// A URL/resource name whose content describes the type of the |
Thomas Van Lenten | e664aa6 | 2016-04-19 13:13:04 -0400 | [diff] [blame] | 101 | /// serialized protocol buffer message. |
Thomas Van Lenten | 36650a0 | 2016-03-07 12:07:03 -0500 | [diff] [blame] | 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 | /// * An HTTP GET on the URL must yield a [google.protobuf.Type][] |
| 110 | /// value in binary format, or produce an error. |
| 111 | /// * Applications are allowed to cache lookup results based on the |
| 112 | /// URL, or have them precompiled into a binary to avoid any |
| 113 | /// lookup. Therefore, binary compatibility needs to be preserved |
| 114 | /// on changes to types. (Use versioned type names to manage |
| 115 | /// breaking changes.) |
| 116 | /// |
| 117 | /// Schemas other than `http`, `https` (or the empty schema) might be |
| 118 | /// used with implementation specific semantics. |
Thomas Van Lenten | 8c88957 | 2015-06-16 16:45:14 -0400 | [diff] [blame] | 119 | @property(nonatomic, readwrite, copy, null_resettable) NSString *typeURL; |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 120 | |
Thomas Van Lenten | e664aa6 | 2016-04-19 13:13:04 -0400 | [diff] [blame] | 121 | /// Must be a valid serialized protocol buffer of the above specified type. |
Thomas Van Lenten | 8c88957 | 2015-06-16 16:45:14 -0400 | [diff] [blame] | 122 | @property(nonatomic, readwrite, copy, null_resettable) NSData *value; |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 123 | |
| 124 | @end |
| 125 | |
Thomas Van Lenten | 8c88957 | 2015-06-16 16:45:14 -0400 | [diff] [blame] | 126 | NS_ASSUME_NONNULL_END |
| 127 | |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 128 | CF_EXTERN_C_END |
| 129 | |
Thomas Van Lenten | e664aa6 | 2016-04-19 13:13:04 -0400 | [diff] [blame] | 130 | #pragma clang diagnostic pop |
| 131 | |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 132 | // @@protoc_insertion_point(global_scope) |