GPBAny.pbobjc.h 5.2 KB

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