GPBFieldMask.pbobjc.h 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/field_mask.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/GPBDescriptor.h>
  10. #import <Protobuf/GPBMessage.h>
  11. #import <Protobuf/GPBRootObject.h>
  12. #else
  13. #import "GPBDescriptor.h"
  14. #import "GPBMessage.h"
  15. #import "GPBRootObject.h"
  16. #endif
  17. #if GOOGLE_PROTOBUF_OBJC_VERSION < 30004
  18. #error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.
  19. #endif
  20. #if 30004 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION
  21. #error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources.
  22. #endif
  23. // @@protoc_insertion_point(imports)
  24. #pragma clang diagnostic push
  25. #pragma clang diagnostic ignored "-Wdeprecated-declarations"
  26. CF_EXTERN_C_BEGIN
  27. NS_ASSUME_NONNULL_BEGIN
  28. #pragma mark - GPBFieldMaskRoot
  29. /**
  30. * Exposes the extension registry for this file.
  31. *
  32. * The base class provides:
  33. * @code
  34. * + (GPBExtensionRegistry *)extensionRegistry;
  35. * @endcode
  36. * which is a @c GPBExtensionRegistry that includes all the extensions defined by
  37. * this file and all files that it depends on.
  38. **/
  39. GPB_FINAL @interface GPBFieldMaskRoot : GPBRootObject
  40. @end
  41. #pragma mark - GPBFieldMask
  42. typedef GPB_ENUM(GPBFieldMask_FieldNumber) {
  43. GPBFieldMask_FieldNumber_PathsArray = 1,
  44. };
  45. /**
  46. * `FieldMask` represents a set of symbolic field paths, for example:
  47. *
  48. * paths: "f.a"
  49. * paths: "f.b.d"
  50. *
  51. * Here `f` represents a field in some root message, `a` and `b`
  52. * fields in the message found in `f`, and `d` a field found in the
  53. * message in `f.b`.
  54. *
  55. * Field masks are used to specify a subset of fields that should be
  56. * returned by a get operation or modified by an update operation.
  57. * Field masks also have a custom JSON encoding (see below).
  58. *
  59. * # Field Masks in Projections
  60. *
  61. * When used in the context of a projection, a response message or
  62. * sub-message is filtered by the API to only contain those fields as
  63. * specified in the mask. For example, if the mask in the previous
  64. * example is applied to a response message as follows:
  65. *
  66. * f {
  67. * a : 22
  68. * b {
  69. * d : 1
  70. * x : 2
  71. * }
  72. * y : 13
  73. * }
  74. * z: 8
  75. *
  76. * The result will not contain specific values for fields x,y and z
  77. * (their value will be set to the default, and omitted in proto text
  78. * output):
  79. *
  80. *
  81. * f {
  82. * a : 22
  83. * b {
  84. * d : 1
  85. * }
  86. * }
  87. *
  88. * A repeated field is not allowed except at the last position of a
  89. * paths string.
  90. *
  91. * If a FieldMask object is not present in a get operation, the
  92. * operation applies to all fields (as if a FieldMask of all fields
  93. * had been specified).
  94. *
  95. * Note that a field mask does not necessarily apply to the
  96. * top-level response message. In case of a REST get operation, the
  97. * field mask applies directly to the response, but in case of a REST
  98. * list operation, the mask instead applies to each individual message
  99. * in the returned resource list. In case of a REST custom method,
  100. * other definitions may be used. Where the mask applies will be
  101. * clearly documented together with its declaration in the API. In
  102. * any case, the effect on the returned resource/resources is required
  103. * behavior for APIs.
  104. *
  105. * # Field Masks in Update Operations
  106. *
  107. * A field mask in update operations specifies which fields of the
  108. * targeted resource are going to be updated. The API is required
  109. * to only change the values of the fields as specified in the mask
  110. * and leave the others untouched. If a resource is passed in to
  111. * describe the updated values, the API ignores the values of all
  112. * fields not covered by the mask.
  113. *
  114. * If a repeated field is specified for an update operation, new values will
  115. * be appended to the existing repeated field in the target resource. Note that
  116. * a repeated field is only allowed in the last position of a `paths` string.
  117. *
  118. * If a sub-message is specified in the last position of the field mask for an
  119. * update operation, then new value will be merged into the existing sub-message
  120. * in the target resource.
  121. *
  122. * For example, given the target message:
  123. *
  124. * f {
  125. * b {
  126. * d: 1
  127. * x: 2
  128. * }
  129. * c: [1]
  130. * }
  131. *
  132. * And an update message:
  133. *
  134. * f {
  135. * b {
  136. * d: 10
  137. * }
  138. * c: [2]
  139. * }
  140. *
  141. * then if the field mask is:
  142. *
  143. * paths: ["f.b", "f.c"]
  144. *
  145. * then the result will be:
  146. *
  147. * f {
  148. * b {
  149. * d: 10
  150. * x: 2
  151. * }
  152. * c: [1, 2]
  153. * }
  154. *
  155. * An implementation may provide options to override this default behavior for
  156. * repeated and message fields.
  157. *
  158. * In order to reset a field's value to the default, the field must
  159. * be in the mask and set to the default value in the provided resource.
  160. * Hence, in order to reset all fields of a resource, provide a default
  161. * instance of the resource and set all fields in the mask, or do
  162. * not provide a mask as described below.
  163. *
  164. * If a field mask is not present on update, the operation applies to
  165. * all fields (as if a field mask of all fields has been specified).
  166. * Note that in the presence of schema evolution, this may mean that
  167. * fields the client does not know and has therefore not filled into
  168. * the request will be reset to their default. If this is unwanted
  169. * behavior, a specific service may require a client to always specify
  170. * a field mask, producing an error if not.
  171. *
  172. * As with get operations, the location of the resource which
  173. * describes the updated values in the request message depends on the
  174. * operation kind. In any case, the effect of the field mask is
  175. * required to be honored by the API.
  176. *
  177. * ## Considerations for HTTP REST
  178. *
  179. * The HTTP kind of an update operation which uses a field mask must
  180. * be set to PATCH instead of PUT in order to satisfy HTTP semantics
  181. * (PUT must only be used for full updates).
  182. *
  183. * # JSON Encoding of Field Masks
  184. *
  185. * In JSON, a field mask is encoded as a single string where paths are
  186. * separated by a comma. Fields name in each path are converted
  187. * to/from lower-camel naming conventions.
  188. *
  189. * As an example, consider the following message declarations:
  190. *
  191. * message Profile {
  192. * User user = 1;
  193. * Photo photo = 2;
  194. * }
  195. * message User {
  196. * string display_name = 1;
  197. * string address = 2;
  198. * }
  199. *
  200. * In proto a field mask for `Profile` may look as such:
  201. *
  202. * mask {
  203. * paths: "user.display_name"
  204. * paths: "photo"
  205. * }
  206. *
  207. * In JSON, the same mask is represented as below:
  208. *
  209. * {
  210. * mask: "user.displayName,photo"
  211. * }
  212. *
  213. * # Field Masks and Oneof Fields
  214. *
  215. * Field masks treat fields in oneofs just as regular fields. Consider the
  216. * following message:
  217. *
  218. * message SampleMessage {
  219. * oneof test_oneof {
  220. * string name = 4;
  221. * SubMessage sub_message = 9;
  222. * }
  223. * }
  224. *
  225. * The field mask can be:
  226. *
  227. * mask {
  228. * paths: "name"
  229. * }
  230. *
  231. * Or:
  232. *
  233. * mask {
  234. * paths: "sub_message"
  235. * }
  236. *
  237. * Note that oneof type names ("test_oneof" in this case) cannot be used in
  238. * paths.
  239. *
  240. * ## Field Mask Verification
  241. *
  242. * The implementation of any API method which has a FieldMask type field in the
  243. * request should verify the included field paths, and return an
  244. * `INVALID_ARGUMENT` error if any path is unmappable.
  245. **/
  246. GPB_FINAL @interface GPBFieldMask : GPBMessage
  247. /** The set of field mask paths. */
  248. @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<NSString*> *pathsArray;
  249. /** The number of items in @c pathsArray without causing the array to be created. */
  250. @property(nonatomic, readonly) NSUInteger pathsArray_Count;
  251. @end
  252. NS_ASSUME_NONNULL_END
  253. CF_EXTERN_C_END
  254. #pragma clang diagnostic pop
  255. // @@protoc_insertion_point(global_scope)