GPBFieldMask.pbobjc.h 7.6 KB

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