1ffe3c632Sopenharmony_ci<?php
2ffe3c632Sopenharmony_ci# Generated by the protocol buffer compiler.  DO NOT EDIT!
3ffe3c632Sopenharmony_ci# source: google/protobuf/field_mask.proto
4ffe3c632Sopenharmony_ci
5ffe3c632Sopenharmony_cinamespace Google\Protobuf;
6ffe3c632Sopenharmony_ci
7ffe3c632Sopenharmony_ciuse Google\Protobuf\Internal\GPBType;
8ffe3c632Sopenharmony_ciuse Google\Protobuf\Internal\RepeatedField;
9ffe3c632Sopenharmony_ciuse Google\Protobuf\Internal\GPBUtil;
10ffe3c632Sopenharmony_ci
11ffe3c632Sopenharmony_ci/**
12ffe3c632Sopenharmony_ci * `FieldMask` represents a set of symbolic field paths, for example:
13ffe3c632Sopenharmony_ci *     paths: "f.a"
14ffe3c632Sopenharmony_ci *     paths: "f.b.d"
15ffe3c632Sopenharmony_ci * Here `f` represents a field in some root message, `a` and `b`
16ffe3c632Sopenharmony_ci * fields in the message found in `f`, and `d` a field found in the
17ffe3c632Sopenharmony_ci * message in `f.b`.
18ffe3c632Sopenharmony_ci * Field masks are used to specify a subset of fields that should be
19ffe3c632Sopenharmony_ci * returned by a get operation or modified by an update operation.
20ffe3c632Sopenharmony_ci * Field masks also have a custom JSON encoding (see below).
21ffe3c632Sopenharmony_ci * # Field Masks in Projections
22ffe3c632Sopenharmony_ci * When used in the context of a projection, a response message or
23ffe3c632Sopenharmony_ci * sub-message is filtered by the API to only contain those fields as
24ffe3c632Sopenharmony_ci * specified in the mask. For example, if the mask in the previous
25ffe3c632Sopenharmony_ci * example is applied to a response message as follows:
26ffe3c632Sopenharmony_ci *     f {
27ffe3c632Sopenharmony_ci *       a : 22
28ffe3c632Sopenharmony_ci *       b {
29ffe3c632Sopenharmony_ci *         d : 1
30ffe3c632Sopenharmony_ci *         x : 2
31ffe3c632Sopenharmony_ci *       }
32ffe3c632Sopenharmony_ci *       y : 13
33ffe3c632Sopenharmony_ci *     }
34ffe3c632Sopenharmony_ci *     z: 8
35ffe3c632Sopenharmony_ci * The result will not contain specific values for fields x,y and z
36ffe3c632Sopenharmony_ci * (their value will be set to the default, and omitted in proto text
37ffe3c632Sopenharmony_ci * output):
38ffe3c632Sopenharmony_ci *     f {
39ffe3c632Sopenharmony_ci *       a : 22
40ffe3c632Sopenharmony_ci *       b {
41ffe3c632Sopenharmony_ci *         d : 1
42ffe3c632Sopenharmony_ci *       }
43ffe3c632Sopenharmony_ci *     }
44ffe3c632Sopenharmony_ci * A repeated field is not allowed except at the last position of a
45ffe3c632Sopenharmony_ci * paths string.
46ffe3c632Sopenharmony_ci * If a FieldMask object is not present in a get operation, the
47ffe3c632Sopenharmony_ci * operation applies to all fields (as if a FieldMask of all fields
48ffe3c632Sopenharmony_ci * had been specified).
49ffe3c632Sopenharmony_ci * Note that a field mask does not necessarily apply to the
50ffe3c632Sopenharmony_ci * top-level response message. In case of a REST get operation, the
51ffe3c632Sopenharmony_ci * field mask applies directly to the response, but in case of a REST
52ffe3c632Sopenharmony_ci * list operation, the mask instead applies to each individual message
53ffe3c632Sopenharmony_ci * in the returned resource list. In case of a REST custom method,
54ffe3c632Sopenharmony_ci * other definitions may be used. Where the mask applies will be
55ffe3c632Sopenharmony_ci * clearly documented together with its declaration in the API.  In
56ffe3c632Sopenharmony_ci * any case, the effect on the returned resource/resources is required
57ffe3c632Sopenharmony_ci * behavior for APIs.
58ffe3c632Sopenharmony_ci * # Field Masks in Update Operations
59ffe3c632Sopenharmony_ci * A field mask in update operations specifies which fields of the
60ffe3c632Sopenharmony_ci * targeted resource are going to be updated. The API is required
61ffe3c632Sopenharmony_ci * to only change the values of the fields as specified in the mask
62ffe3c632Sopenharmony_ci * and leave the others untouched. If a resource is passed in to
63ffe3c632Sopenharmony_ci * describe the updated values, the API ignores the values of all
64ffe3c632Sopenharmony_ci * fields not covered by the mask.
65ffe3c632Sopenharmony_ci * If a repeated field is specified for an update operation, the existing
66ffe3c632Sopenharmony_ci * repeated values in the target resource will be overwritten by the new values.
67ffe3c632Sopenharmony_ci * Note that a repeated field is only allowed in the last position of a `paths`
68ffe3c632Sopenharmony_ci * string.
69ffe3c632Sopenharmony_ci * If a sub-message is specified in the last position of the field mask for an
70ffe3c632Sopenharmony_ci * update operation, then the existing sub-message in the target resource is
71ffe3c632Sopenharmony_ci * overwritten. Given the target message:
72ffe3c632Sopenharmony_ci *     f {
73ffe3c632Sopenharmony_ci *       b {
74ffe3c632Sopenharmony_ci *         d : 1
75ffe3c632Sopenharmony_ci *         x : 2
76ffe3c632Sopenharmony_ci *       }
77ffe3c632Sopenharmony_ci *       c : 1
78ffe3c632Sopenharmony_ci *     }
79ffe3c632Sopenharmony_ci * And an update message:
80ffe3c632Sopenharmony_ci *     f {
81ffe3c632Sopenharmony_ci *       b {
82ffe3c632Sopenharmony_ci *         d : 10
83ffe3c632Sopenharmony_ci *       }
84ffe3c632Sopenharmony_ci *     }
85ffe3c632Sopenharmony_ci * then if the field mask is:
86ffe3c632Sopenharmony_ci *  paths: "f.b"
87ffe3c632Sopenharmony_ci * then the result will be:
88ffe3c632Sopenharmony_ci *     f {
89ffe3c632Sopenharmony_ci *       b {
90ffe3c632Sopenharmony_ci *         d : 10
91ffe3c632Sopenharmony_ci *       }
92ffe3c632Sopenharmony_ci *       c : 1
93ffe3c632Sopenharmony_ci *     }
94ffe3c632Sopenharmony_ci * However, if the update mask was:
95ffe3c632Sopenharmony_ci *  paths: "f.b.d"
96ffe3c632Sopenharmony_ci * then the result would be:
97ffe3c632Sopenharmony_ci *     f {
98ffe3c632Sopenharmony_ci *       b {
99ffe3c632Sopenharmony_ci *         d : 10
100ffe3c632Sopenharmony_ci *         x : 2
101ffe3c632Sopenharmony_ci *       }
102ffe3c632Sopenharmony_ci *       c : 1
103ffe3c632Sopenharmony_ci *     }
104ffe3c632Sopenharmony_ci * In order to reset a field's value to the default, the field must
105ffe3c632Sopenharmony_ci * be in the mask and set to the default value in the provided resource.
106ffe3c632Sopenharmony_ci * Hence, in order to reset all fields of a resource, provide a default
107ffe3c632Sopenharmony_ci * instance of the resource and set all fields in the mask, or do
108ffe3c632Sopenharmony_ci * not provide a mask as described below.
109ffe3c632Sopenharmony_ci * If a field mask is not present on update, the operation applies to
110ffe3c632Sopenharmony_ci * all fields (as if a field mask of all fields has been specified).
111ffe3c632Sopenharmony_ci * Note that in the presence of schema evolution, this may mean that
112ffe3c632Sopenharmony_ci * fields the client does not know and has therefore not filled into
113ffe3c632Sopenharmony_ci * the request will be reset to their default. If this is unwanted
114ffe3c632Sopenharmony_ci * behavior, a specific service may require a client to always specify
115ffe3c632Sopenharmony_ci * a field mask, producing an error if not.
116ffe3c632Sopenharmony_ci * As with get operations, the location of the resource which
117ffe3c632Sopenharmony_ci * describes the updated values in the request message depends on the
118ffe3c632Sopenharmony_ci * operation kind. In any case, the effect of the field mask is
119ffe3c632Sopenharmony_ci * required to be honored by the API.
120ffe3c632Sopenharmony_ci * ## Considerations for HTTP REST
121ffe3c632Sopenharmony_ci * The HTTP kind of an update operation which uses a field mask must
122ffe3c632Sopenharmony_ci * be set to PATCH instead of PUT in order to satisfy HTTP semantics
123ffe3c632Sopenharmony_ci * (PUT must only be used for full updates).
124ffe3c632Sopenharmony_ci * # JSON Encoding of Field Masks
125ffe3c632Sopenharmony_ci * In JSON, a field mask is encoded as a single string where paths are
126ffe3c632Sopenharmony_ci * separated by a comma. Fields name in each path are converted
127ffe3c632Sopenharmony_ci * to/from lower-camel naming conventions.
128ffe3c632Sopenharmony_ci * As an example, consider the following message declarations:
129ffe3c632Sopenharmony_ci *     message Profile {
130ffe3c632Sopenharmony_ci *       User user = 1;
131ffe3c632Sopenharmony_ci *       Photo photo = 2;
132ffe3c632Sopenharmony_ci *     }
133ffe3c632Sopenharmony_ci *     message User {
134ffe3c632Sopenharmony_ci *       string display_name = 1;
135ffe3c632Sopenharmony_ci *       string address = 2;
136ffe3c632Sopenharmony_ci *     }
137ffe3c632Sopenharmony_ci * In proto a field mask for `Profile` may look as such:
138ffe3c632Sopenharmony_ci *     mask {
139ffe3c632Sopenharmony_ci *       paths: "user.display_name"
140ffe3c632Sopenharmony_ci *       paths: "photo"
141ffe3c632Sopenharmony_ci *     }
142ffe3c632Sopenharmony_ci * In JSON, the same mask is represented as below:
143ffe3c632Sopenharmony_ci *     {
144ffe3c632Sopenharmony_ci *       mask: "user.displayName,photo"
145ffe3c632Sopenharmony_ci *     }
146ffe3c632Sopenharmony_ci * # Field Masks and Oneof Fields
147ffe3c632Sopenharmony_ci * Field masks treat fields in oneofs just as regular fields. Consider the
148ffe3c632Sopenharmony_ci * following message:
149ffe3c632Sopenharmony_ci *     message SampleMessage {
150ffe3c632Sopenharmony_ci *       oneof test_oneof {
151ffe3c632Sopenharmony_ci *         string name = 4;
152ffe3c632Sopenharmony_ci *         SubMessage sub_message = 9;
153ffe3c632Sopenharmony_ci *       }
154ffe3c632Sopenharmony_ci *     }
155ffe3c632Sopenharmony_ci * The field mask can be:
156ffe3c632Sopenharmony_ci *     mask {
157ffe3c632Sopenharmony_ci *       paths: "name"
158ffe3c632Sopenharmony_ci *     }
159ffe3c632Sopenharmony_ci * Or:
160ffe3c632Sopenharmony_ci *     mask {
161ffe3c632Sopenharmony_ci *       paths: "sub_message"
162ffe3c632Sopenharmony_ci *     }
163ffe3c632Sopenharmony_ci * Note that oneof type names ("test_oneof" in this case) cannot be used in
164ffe3c632Sopenharmony_ci * paths.
165ffe3c632Sopenharmony_ci * ## Field Mask Verification
166ffe3c632Sopenharmony_ci * The implementation of any API method which has a FieldMask type field in the
167ffe3c632Sopenharmony_ci * request should verify the included field paths, and return an
168ffe3c632Sopenharmony_ci * `INVALID_ARGUMENT` error if any path is duplicated or unmappable.
169ffe3c632Sopenharmony_ci *
170ffe3c632Sopenharmony_ci * Generated from protobuf message <code>google.protobuf.FieldMask</code>
171ffe3c632Sopenharmony_ci */
172ffe3c632Sopenharmony_ciclass FieldMask extends \Google\Protobuf\Internal\Message
173ffe3c632Sopenharmony_ci{
174ffe3c632Sopenharmony_ci    /**
175ffe3c632Sopenharmony_ci     * The set of field mask paths.
176ffe3c632Sopenharmony_ci     *
177ffe3c632Sopenharmony_ci     * Generated from protobuf field <code>repeated string paths = 1;</code>
178ffe3c632Sopenharmony_ci     */
179ffe3c632Sopenharmony_ci    private $paths;
180ffe3c632Sopenharmony_ci
181ffe3c632Sopenharmony_ci    /**
182ffe3c632Sopenharmony_ci     * Constructor.
183ffe3c632Sopenharmony_ci     *
184ffe3c632Sopenharmony_ci     * @param array $data {
185ffe3c632Sopenharmony_ci     *     Optional. Data for populating the Message object.
186ffe3c632Sopenharmony_ci     *
187ffe3c632Sopenharmony_ci     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $paths
188ffe3c632Sopenharmony_ci     *           The set of field mask paths.
189ffe3c632Sopenharmony_ci     * }
190ffe3c632Sopenharmony_ci     */
191ffe3c632Sopenharmony_ci    public function __construct($data = NULL) {
192ffe3c632Sopenharmony_ci        \GPBMetadata\Google\Protobuf\FieldMask::initOnce();
193ffe3c632Sopenharmony_ci        parent::__construct($data);
194ffe3c632Sopenharmony_ci    }
195ffe3c632Sopenharmony_ci
196ffe3c632Sopenharmony_ci    /**
197ffe3c632Sopenharmony_ci     * The set of field mask paths.
198ffe3c632Sopenharmony_ci     *
199ffe3c632Sopenharmony_ci     * Generated from protobuf field <code>repeated string paths = 1;</code>
200ffe3c632Sopenharmony_ci     * @return \Google\Protobuf\Internal\RepeatedField
201ffe3c632Sopenharmony_ci     */
202ffe3c632Sopenharmony_ci    public function getPaths()
203ffe3c632Sopenharmony_ci    {
204ffe3c632Sopenharmony_ci        return $this->paths;
205ffe3c632Sopenharmony_ci    }
206ffe3c632Sopenharmony_ci
207ffe3c632Sopenharmony_ci    /**
208ffe3c632Sopenharmony_ci     * The set of field mask paths.
209ffe3c632Sopenharmony_ci     *
210ffe3c632Sopenharmony_ci     * Generated from protobuf field <code>repeated string paths = 1;</code>
211ffe3c632Sopenharmony_ci     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
212ffe3c632Sopenharmony_ci     * @return $this
213ffe3c632Sopenharmony_ci     */
214ffe3c632Sopenharmony_ci    public function setPaths($var)
215ffe3c632Sopenharmony_ci    {
216ffe3c632Sopenharmony_ci        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
217ffe3c632Sopenharmony_ci        $this->paths = $arr;
218ffe3c632Sopenharmony_ci
219ffe3c632Sopenharmony_ci        return $this;
220ffe3c632Sopenharmony_ci    }
221ffe3c632Sopenharmony_ci
222ffe3c632Sopenharmony_ci}
223ffe3c632Sopenharmony_ci
224