1 // Code generated by protoc-gen-go. DO NOT EDIT.
2 // source: google/protobuf/field_mask.proto
4 package field_mask // import "google.golang.org/genproto/protobuf/field_mask"
6 import proto "github.com/golang/protobuf/proto"
10 // Reference imports to suppress errors if they are not otherwise used.
15 // This is a compile-time assertion to ensure that this generated file
16 // is compatible with the proto package it is being compiled against.
17 // A compilation error at this line likely means your copy of the
18 // proto package needs to be updated.
19 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
21 // `FieldMask` represents a set of symbolic field paths, for example:
26 // Here `f` represents a field in some root message, `a` and `b`
27 // fields in the message found in `f`, and `d` a field found in the
30 // Field masks are used to specify a subset of fields that should be
31 // returned by a get operation or modified by an update operation.
32 // Field masks also have a custom JSON encoding (see below).
34 // # Field Masks in Projections
36 // When used in the context of a projection, a response message or
37 // sub-message is filtered by the API to only contain those fields as
38 // specified in the mask. For example, if the mask in the previous
39 // example is applied to a response message as follows:
51 // The result will not contain specific values for fields x,y and z
52 // (their value will be set to the default, and omitted in proto text
63 // A repeated field is not allowed except at the last position of a
66 // If a FieldMask object is not present in a get operation, the
67 // operation applies to all fields (as if a FieldMask of all fields
68 // had been specified).
70 // Note that a field mask does not necessarily apply to the
71 // top-level response message. In case of a REST get operation, the
72 // field mask applies directly to the response, but in case of a REST
73 // list operation, the mask instead applies to each individual message
74 // in the returned resource list. In case of a REST custom method,
75 // other definitions may be used. Where the mask applies will be
76 // clearly documented together with its declaration in the API. In
77 // any case, the effect on the returned resource/resources is required
80 // # Field Masks in Update Operations
82 // A field mask in update operations specifies which fields of the
83 // targeted resource are going to be updated. The API is required
84 // to only change the values of the fields as specified in the mask
85 // and leave the others untouched. If a resource is passed in to
86 // describe the updated values, the API ignores the values of all
87 // fields not covered by the mask.
89 // If a repeated field is specified for an update operation, new values will
90 // be appended to the existing repeated field in the target resource. Note that
91 // a repeated field is only allowed in the last position of a `paths` string.
93 // If a sub-message is specified in the last position of the field mask for an
94 // update operation, then new value will be merged into the existing sub-message
95 // in the target resource.
97 // For example, given the target message:
107 // And an update message:
116 // then if the field mask is:
118 // paths: ["f.b", "f.c"]
120 // then the result will be:
130 // An implementation may provide options to override this default behavior for
131 // repeated and message fields.
133 // In order to reset a field's value to the default, the field must
134 // be in the mask and set to the default value in the provided resource.
135 // Hence, in order to reset all fields of a resource, provide a default
136 // instance of the resource and set all fields in the mask, or do
137 // not provide a mask as described below.
139 // If a field mask is not present on update, the operation applies to
140 // all fields (as if a field mask of all fields has been specified).
141 // Note that in the presence of schema evolution, this may mean that
142 // fields the client does not know and has therefore not filled into
143 // the request will be reset to their default. If this is unwanted
144 // behavior, a specific service may require a client to always specify
145 // a field mask, producing an error if not.
147 // As with get operations, the location of the resource which
148 // describes the updated values in the request message depends on the
149 // operation kind. In any case, the effect of the field mask is
150 // required to be honored by the API.
152 // ## Considerations for HTTP REST
154 // The HTTP kind of an update operation which uses a field mask must
155 // be set to PATCH instead of PUT in order to satisfy HTTP semantics
156 // (PUT must only be used for full updates).
158 // # JSON Encoding of Field Masks
160 // In JSON, a field mask is encoded as a single string where paths are
161 // separated by a comma. Fields name in each path are converted
162 // to/from lower-camel naming conventions.
164 // As an example, consider the following message declarations:
171 // string display_name = 1;
172 // string address = 2;
175 // In proto a field mask for `Profile` may look as such:
178 // paths: "user.display_name"
182 // In JSON, the same mask is represented as below:
185 // mask: "user.displayName,photo"
188 // # Field Masks and Oneof Fields
190 // Field masks treat fields in oneofs just as regular fields. Consider the
191 // following message:
193 // message SampleMessage {
194 // oneof test_oneof {
196 // SubMessage sub_message = 9;
200 // The field mask can be:
209 // paths: "sub_message"
212 // Note that oneof type names ("test_oneof" in this case) cannot be used in
215 // ## Field Mask Verification
217 // The implementation of any API method which has a FieldMask type field in the
218 // request should verify the included field paths, and return an
219 // `INVALID_ARGUMENT` error if any path is duplicated or unmappable.
220 type FieldMask struct {
221 // The set of field mask paths.
222 Paths []string `protobuf:"bytes,1,rep,name=paths,proto3" json:"paths,omitempty"`
223 XXX_NoUnkeyedLiteral struct{} `json:"-"`
224 XXX_unrecognized []byte `json:"-"`
225 XXX_sizecache int32 `json:"-"`
228 func (m *FieldMask) Reset() { *m = FieldMask{} }
229 func (m *FieldMask) String() string { return proto.CompactTextString(m) }
230 func (*FieldMask) ProtoMessage() {}
231 func (*FieldMask) Descriptor() ([]byte, []int) {
232 return fileDescriptor_field_mask_02a8b0c0831edcce, []int{0}
234 func (m *FieldMask) XXX_Unmarshal(b []byte) error {
235 return xxx_messageInfo_FieldMask.Unmarshal(m, b)
237 func (m *FieldMask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
238 return xxx_messageInfo_FieldMask.Marshal(b, m, deterministic)
240 func (dst *FieldMask) XXX_Merge(src proto.Message) {
241 xxx_messageInfo_FieldMask.Merge(dst, src)
243 func (m *FieldMask) XXX_Size() int {
244 return xxx_messageInfo_FieldMask.Size(m)
246 func (m *FieldMask) XXX_DiscardUnknown() {
247 xxx_messageInfo_FieldMask.DiscardUnknown(m)
250 var xxx_messageInfo_FieldMask proto.InternalMessageInfo
252 func (m *FieldMask) GetPaths() []string {
260 proto.RegisterType((*FieldMask)(nil), "google.protobuf.FieldMask")
264 proto.RegisterFile("google/protobuf/field_mask.proto", fileDescriptor_field_mask_02a8b0c0831edcce)
267 var fileDescriptor_field_mask_02a8b0c0831edcce = []byte{
268 // 175 bytes of a gzipped FileDescriptorProto
269 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xcf, 0xcf, 0x4f,
270 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcb, 0x4c, 0xcd,
271 0x49, 0x89, 0xcf, 0x4d, 0x2c, 0xce, 0xd6, 0x03, 0x8b, 0x09, 0xf1, 0x43, 0x54, 0xe8, 0xc1, 0x54,
272 0x28, 0x29, 0x72, 0x71, 0xba, 0x81, 0x14, 0xf9, 0x26, 0x16, 0x67, 0x0b, 0x89, 0x70, 0xb1, 0x16,
273 0x24, 0x96, 0x64, 0x14, 0x4b, 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x06, 0x41, 0x38, 0x4e, 0x3d, 0x8c,
274 0x5c, 0xc2, 0xc9, 0xf9, 0xb9, 0x7a, 0x68, 0x5a, 0x9d, 0xf8, 0xe0, 0x1a, 0x03, 0x40, 0x42, 0x01,
275 0x8c, 0x51, 0x96, 0x50, 0x25, 0xe9, 0xf9, 0x39, 0x89, 0x79, 0xe9, 0x7a, 0xf9, 0x45, 0xe9, 0xfa,
276 0xe9, 0xa9, 0x79, 0x60, 0x0d, 0xd8, 0xdc, 0x64, 0x8d, 0x60, 0xfe, 0x60, 0x64, 0x5c, 0xc4, 0xc4,
277 0xec, 0x1e, 0xe0, 0xb4, 0x8a, 0x49, 0xce, 0x1d, 0x62, 0x48, 0x00, 0x54, 0x83, 0x5e, 0x78, 0x6a,
278 0x4e, 0x8e, 0x77, 0x5e, 0x7e, 0x79, 0x5e, 0x48, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x24,
279 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfd, 0xda, 0xb7, 0xa8, 0xed, 0x00, 0x00, 0x00,