Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/google/protobuf/field_mask.proto is written in an unsupported language. File is not indexed.

0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2008 Google Inc.  All rights reserved.
0003 // https://developers.google.com/protocol-buffers/
0004 //
0005 // Redistribution and use in source and binary forms, with or without
0006 // modification, are permitted provided that the following conditions are
0007 // met:
0008 //
0009 //     * Redistributions of source code must retain the above copyright
0010 // notice, this list of conditions and the following disclaimer.
0011 //     * Redistributions in binary form must reproduce the above
0012 // copyright notice, this list of conditions and the following disclaimer
0013 // in the documentation and/or other materials provided with the
0014 // distribution.
0015 //     * Neither the name of Google Inc. nor the names of its
0016 // contributors may be used to endorse or promote products derived from
0017 // this software without specific prior written permission.
0018 //
0019 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0020 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0021 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0022 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0023 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0024 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0025 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0026 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0027 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0028 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0029 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0030 
0031 syntax = "proto3";
0032 
0033 package google.protobuf;
0034 
0035 option java_package = "com.google.protobuf";
0036 option java_outer_classname = "FieldMaskProto";
0037 option java_multiple_files = true;
0038 option objc_class_prefix = "GPB";
0039 option csharp_namespace = "Google.Protobuf.WellKnownTypes";
0040 option go_package = "google.golang.org/protobuf/types/known/fieldmaskpb";
0041 option cc_enable_arenas = true;
0042 
0043 // `FieldMask` represents a set of symbolic field paths, for example:
0044 //
0045 //     paths: "f.a"
0046 //     paths: "f.b.d"
0047 //
0048 // Here `f` represents a field in some root message, `a` and `b`
0049 // fields in the message found in `f`, and `d` a field found in the
0050 // message in `f.b`.
0051 //
0052 // Field masks are used to specify a subset of fields that should be
0053 // returned by a get operation or modified by an update operation.
0054 // Field masks also have a custom JSON encoding (see below).
0055 //
0056 // # Field Masks in Projections
0057 //
0058 // When used in the context of a projection, a response message or
0059 // sub-message is filtered by the API to only contain those fields as
0060 // specified in the mask. For example, if the mask in the previous
0061 // example is applied to a response message as follows:
0062 //
0063 //     f {
0064 //       a : 22
0065 //       b {
0066 //         d : 1
0067 //         x : 2
0068 //       }
0069 //       y : 13
0070 //     }
0071 //     z: 8
0072 //
0073 // The result will not contain specific values for fields x,y and z
0074 // (their value will be set to the default, and omitted in proto text
0075 // output):
0076 //
0077 //
0078 //     f {
0079 //       a : 22
0080 //       b {
0081 //         d : 1
0082 //       }
0083 //     }
0084 //
0085 // A repeated field is not allowed except at the last position of a
0086 // paths string.
0087 //
0088 // If a FieldMask object is not present in a get operation, the
0089 // operation applies to all fields (as if a FieldMask of all fields
0090 // had been specified).
0091 //
0092 // Note that a field mask does not necessarily apply to the
0093 // top-level response message. In case of a REST get operation, the
0094 // field mask applies directly to the response, but in case of a REST
0095 // list operation, the mask instead applies to each individual message
0096 // in the returned resource list. In case of a REST custom method,
0097 // other definitions may be used. Where the mask applies will be
0098 // clearly documented together with its declaration in the API.  In
0099 // any case, the effect on the returned resource/resources is required
0100 // behavior for APIs.
0101 //
0102 // # Field Masks in Update Operations
0103 //
0104 // A field mask in update operations specifies which fields of the
0105 // targeted resource are going to be updated. The API is required
0106 // to only change the values of the fields as specified in the mask
0107 // and leave the others untouched. If a resource is passed in to
0108 // describe the updated values, the API ignores the values of all
0109 // fields not covered by the mask.
0110 //
0111 // If a repeated field is specified for an update operation, new values will
0112 // be appended to the existing repeated field in the target resource. Note that
0113 // a repeated field is only allowed in the last position of a `paths` string.
0114 //
0115 // If a sub-message is specified in the last position of the field mask for an
0116 // update operation, then new value will be merged into the existing sub-message
0117 // in the target resource.
0118 //
0119 // For example, given the target message:
0120 //
0121 //     f {
0122 //       b {
0123 //         d: 1
0124 //         x: 2
0125 //       }
0126 //       c: [1]
0127 //     }
0128 //
0129 // And an update message:
0130 //
0131 //     f {
0132 //       b {
0133 //         d: 10
0134 //       }
0135 //       c: [2]
0136 //     }
0137 //
0138 // then if the field mask is:
0139 //
0140 //  paths: ["f.b", "f.c"]
0141 //
0142 // then the result will be:
0143 //
0144 //     f {
0145 //       b {
0146 //         d: 10
0147 //         x: 2
0148 //       }
0149 //       c: [1, 2]
0150 //     }
0151 //
0152 // An implementation may provide options to override this default behavior for
0153 // repeated and message fields.
0154 //
0155 // In order to reset a field's value to the default, the field must
0156 // be in the mask and set to the default value in the provided resource.
0157 // Hence, in order to reset all fields of a resource, provide a default
0158 // instance of the resource and set all fields in the mask, or do
0159 // not provide a mask as described below.
0160 //
0161 // If a field mask is not present on update, the operation applies to
0162 // all fields (as if a field mask of all fields has been specified).
0163 // Note that in the presence of schema evolution, this may mean that
0164 // fields the client does not know and has therefore not filled into
0165 // the request will be reset to their default. If this is unwanted
0166 // behavior, a specific service may require a client to always specify
0167 // a field mask, producing an error if not.
0168 //
0169 // As with get operations, the location of the resource which
0170 // describes the updated values in the request message depends on the
0171 // operation kind. In any case, the effect of the field mask is
0172 // required to be honored by the API.
0173 //
0174 // ## Considerations for HTTP REST
0175 //
0176 // The HTTP kind of an update operation which uses a field mask must
0177 // be set to PATCH instead of PUT in order to satisfy HTTP semantics
0178 // (PUT must only be used for full updates).
0179 //
0180 // # JSON Encoding of Field Masks
0181 //
0182 // In JSON, a field mask is encoded as a single string where paths are
0183 // separated by a comma. Fields name in each path are converted
0184 // to/from lower-camel naming conventions.
0185 //
0186 // As an example, consider the following message declarations:
0187 //
0188 //     message Profile {
0189 //       User user = 1;
0190 //       Photo photo = 2;
0191 //     }
0192 //     message User {
0193 //       string display_name = 1;
0194 //       string address = 2;
0195 //     }
0196 //
0197 // In proto a field mask for `Profile` may look as such:
0198 //
0199 //     mask {
0200 //       paths: "user.display_name"
0201 //       paths: "photo"
0202 //     }
0203 //
0204 // In JSON, the same mask is represented as below:
0205 //
0206 //     {
0207 //       mask: "user.displayName,photo"
0208 //     }
0209 //
0210 // # Field Masks and Oneof Fields
0211 //
0212 // Field masks treat fields in oneofs just as regular fields. Consider the
0213 // following message:
0214 //
0215 //     message SampleMessage {
0216 //       oneof test_oneof {
0217 //         string name = 4;
0218 //         SubMessage sub_message = 9;
0219 //       }
0220 //     }
0221 //
0222 // The field mask can be:
0223 //
0224 //     mask {
0225 //       paths: "name"
0226 //     }
0227 //
0228 // Or:
0229 //
0230 //     mask {
0231 //       paths: "sub_message"
0232 //     }
0233 //
0234 // Note that oneof type names ("test_oneof" in this case) cannot be used in
0235 // paths.
0236 //
0237 // ## Field Mask Verification
0238 //
0239 // The implementation of any API method which has a FieldMask type field in the
0240 // request should verify the included field paths, and return an
0241 // `INVALID_ARGUMENT` error if any path is unmappable.
0242 message FieldMask {
0243   // The set of field mask paths.
0244   repeated string paths = 1;
0245 }