GPBFieldMask.pbobjc.h 7.6 KB

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