GPBFieldMask.pbobjc.h 7.6 KB

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