xref: /aosp_15_r20/external/protobuf/objectivec/GPBFieldMask.pbobjc.h (revision 1b3f573f81763fcece89efc2b6a5209149e44ab8)
1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: google/protobuf/field_mask.proto
3 
4 #import "GPBDescriptor.h"
5 #import "GPBMessage.h"
6 #import "GPBRootObject.h"
7 
8 #if GOOGLE_PROTOBUF_OBJC_VERSION < 30004
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 30004 < 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 
15 // @@protoc_insertion_point(imports)
16 
17 #pragma clang diagnostic push
18 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
19 
20 CF_EXTERN_C_BEGIN
21 
22 NS_ASSUME_NONNULL_BEGIN
23 
24 #pragma mark - GPBFieldMaskRoot
25 
26 /**
27  * Exposes the extension registry for this file.
28  *
29  * The base class provides:
30  * @code
31  *   + (GPBExtensionRegistry *)extensionRegistry;
32  * @endcode
33  * which is a @c GPBExtensionRegistry that includes all the extensions defined by
34  * this file and all files that it depends on.
35  **/
36 GPB_FINAL @interface GPBFieldMaskRoot : GPBRootObject
37 @end
38 
39 #pragma mark - GPBFieldMask
40 
41 typedef GPB_ENUM(GPBFieldMask_FieldNumber) {
42   GPBFieldMask_FieldNumber_PathsArray = 1,
43 };
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 
248 /** The set of field mask paths. */
249 @property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<NSString*> *pathsArray;
250 /** The number of items in @c pathsArray without causing the array to be created. */
251 @property(nonatomic, readonly) NSUInteger pathsArray_Count;
252 
253 @end
254 
255 NS_ASSUME_NONNULL_END
256 
257 CF_EXTERN_C_END
258 
259 #pragma clang diagnostic pop
260 
261 // @@protoc_insertion_point(global_scope)
262