You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

277 lines
7.8 KiB

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