Any.pbobjc.h 4.8 KB

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