Matteo Scandolo | a6a3aee | 2019-11-26 13:30:14 -0700 | [diff] [blame] | 1 | // Code generated by protoc-gen-go. DO NOT EDIT. |
| 2 | // source: google/protobuf/field_mask.proto |
| 3 | |
| 4 | package field_mask |
| 5 | |
| 6 | import ( |
| 7 | fmt "fmt" |
| 8 | math "math" |
| 9 | |
| 10 | proto "github.com/golang/protobuf/proto" |
| 11 | ) |
| 12 | |
| 13 | // Reference imports to suppress errors if they are not otherwise used. |
| 14 | var _ = proto.Marshal |
| 15 | var _ = fmt.Errorf |
| 16 | var _ = math.Inf |
| 17 | |
| 18 | // This is a compile-time assertion to ensure that this generated file |
| 19 | // is compatible with the proto package it is being compiled against. |
| 20 | // A compilation error at this line likely means your copy of the |
| 21 | // proto package needs to be updated. |
| 22 | const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package |
| 23 | |
| 24 | // `FieldMask` represents a set of symbolic field paths, for example: |
| 25 | // |
| 26 | // paths: "f.a" |
| 27 | // paths: "f.b.d" |
| 28 | // |
| 29 | // Here `f` represents a field in some root message, `a` and `b` |
| 30 | // fields in the message found in `f`, and `d` a field found in the |
| 31 | // message in `f.b`. |
| 32 | // |
| 33 | // Field masks are used to specify a subset of fields that should be |
| 34 | // returned by a get operation or modified by an update operation. |
| 35 | // Field masks also have a custom JSON encoding (see below). |
| 36 | // |
| 37 | // # Field Masks in Projections |
| 38 | // |
| 39 | // When used in the context of a projection, a response message or |
| 40 | // sub-message is filtered by the API to only contain those fields as |
| 41 | // specified in the mask. For example, if the mask in the previous |
| 42 | // example is applied to a response message as follows: |
| 43 | // |
| 44 | // f { |
| 45 | // a : 22 |
| 46 | // b { |
| 47 | // d : 1 |
| 48 | // x : 2 |
| 49 | // } |
| 50 | // y : 13 |
| 51 | // } |
| 52 | // z: 8 |
| 53 | // |
| 54 | // The result will not contain specific values for fields x,y and z |
| 55 | // (their value will be set to the default, and omitted in proto text |
| 56 | // output): |
| 57 | // |
| 58 | // |
| 59 | // f { |
| 60 | // a : 22 |
| 61 | // b { |
| 62 | // d : 1 |
| 63 | // } |
| 64 | // } |
| 65 | // |
| 66 | // A repeated field is not allowed except at the last position of a |
| 67 | // paths string. |
| 68 | // |
| 69 | // If a FieldMask object is not present in a get operation, the |
| 70 | // operation applies to all fields (as if a FieldMask of all fields |
| 71 | // had been specified). |
| 72 | // |
| 73 | // Note that a field mask does not necessarily apply to the |
| 74 | // top-level response message. In case of a REST get operation, the |
| 75 | // field mask applies directly to the response, but in case of a REST |
| 76 | // list operation, the mask instead applies to each individual message |
| 77 | // in the returned resource list. In case of a REST custom method, |
| 78 | // other definitions may be used. Where the mask applies will be |
| 79 | // clearly documented together with its declaration in the API. In |
| 80 | // any case, the effect on the returned resource/resources is required |
| 81 | // behavior for APIs. |
| 82 | // |
| 83 | // # Field Masks in Update Operations |
| 84 | // |
| 85 | // A field mask in update operations specifies which fields of the |
| 86 | // targeted resource are going to be updated. The API is required |
| 87 | // to only change the values of the fields as specified in the mask |
| 88 | // and leave the others untouched. If a resource is passed in to |
| 89 | // describe the updated values, the API ignores the values of all |
| 90 | // fields not covered by the mask. |
| 91 | // |
| 92 | // If a repeated field is specified for an update operation, new values will |
| 93 | // be appended to the existing repeated field in the target resource. Note that |
| 94 | // a repeated field is only allowed in the last position of a `paths` string. |
| 95 | // |
| 96 | // If a sub-message is specified in the last position of the field mask for an |
| 97 | // update operation, then new value will be merged into the existing sub-message |
| 98 | // in the target resource. |
| 99 | // |
| 100 | // For example, given the target message: |
| 101 | // |
| 102 | // f { |
| 103 | // b { |
| 104 | // d: 1 |
| 105 | // x: 2 |
| 106 | // } |
| 107 | // c: [1] |
| 108 | // } |
| 109 | // |
| 110 | // And an update message: |
| 111 | // |
| 112 | // f { |
| 113 | // b { |
| 114 | // d: 10 |
| 115 | // } |
| 116 | // c: [2] |
| 117 | // } |
| 118 | // |
| 119 | // then if the field mask is: |
| 120 | // |
| 121 | // paths: ["f.b", "f.c"] |
| 122 | // |
| 123 | // then the result will be: |
| 124 | // |
| 125 | // f { |
| 126 | // b { |
| 127 | // d: 10 |
| 128 | // x: 2 |
| 129 | // } |
| 130 | // c: [1, 2] |
| 131 | // } |
| 132 | // |
| 133 | // An implementation may provide options to override this default behavior for |
| 134 | // repeated and message fields. |
| 135 | // |
| 136 | // In order to reset a field's value to the default, the field must |
| 137 | // be in the mask and set to the default value in the provided resource. |
| 138 | // Hence, in order to reset all fields of a resource, provide a default |
| 139 | // instance of the resource and set all fields in the mask, or do |
| 140 | // not provide a mask as described below. |
| 141 | // |
| 142 | // If a field mask is not present on update, the operation applies to |
| 143 | // all fields (as if a field mask of all fields has been specified). |
| 144 | // Note that in the presence of schema evolution, this may mean that |
| 145 | // fields the client does not know and has therefore not filled into |
| 146 | // the request will be reset to their default. If this is unwanted |
| 147 | // behavior, a specific service may require a client to always specify |
| 148 | // a field mask, producing an error if not. |
| 149 | // |
| 150 | // As with get operations, the location of the resource which |
| 151 | // describes the updated values in the request message depends on the |
| 152 | // operation kind. In any case, the effect of the field mask is |
| 153 | // required to be honored by the API. |
| 154 | // |
| 155 | // ## Considerations for HTTP REST |
| 156 | // |
| 157 | // The HTTP kind of an update operation which uses a field mask must |
| 158 | // be set to PATCH instead of PUT in order to satisfy HTTP semantics |
| 159 | // (PUT must only be used for full updates). |
| 160 | // |
| 161 | // # JSON Encoding of Field Masks |
| 162 | // |
| 163 | // In JSON, a field mask is encoded as a single string where paths are |
| 164 | // separated by a comma. Fields name in each path are converted |
| 165 | // to/from lower-camel naming conventions. |
| 166 | // |
| 167 | // As an example, consider the following message declarations: |
| 168 | // |
| 169 | // message Profile { |
| 170 | // User user = 1; |
| 171 | // Photo photo = 2; |
| 172 | // } |
| 173 | // message User { |
| 174 | // string display_name = 1; |
| 175 | // string address = 2; |
| 176 | // } |
| 177 | // |
| 178 | // In proto a field mask for `Profile` may look as such: |
| 179 | // |
| 180 | // mask { |
| 181 | // paths: "user.display_name" |
| 182 | // paths: "photo" |
| 183 | // } |
| 184 | // |
| 185 | // In JSON, the same mask is represented as below: |
| 186 | // |
| 187 | // { |
| 188 | // mask: "user.displayName,photo" |
| 189 | // } |
| 190 | // |
| 191 | // # Field Masks and Oneof Fields |
| 192 | // |
| 193 | // Field masks treat fields in oneofs just as regular fields. Consider the |
| 194 | // following message: |
| 195 | // |
| 196 | // message SampleMessage { |
| 197 | // oneof test_oneof { |
| 198 | // string name = 4; |
| 199 | // SubMessage sub_message = 9; |
| 200 | // } |
| 201 | // } |
| 202 | // |
| 203 | // The field mask can be: |
| 204 | // |
| 205 | // mask { |
| 206 | // paths: "name" |
| 207 | // } |
| 208 | // |
| 209 | // Or: |
| 210 | // |
| 211 | // mask { |
| 212 | // paths: "sub_message" |
| 213 | // } |
| 214 | // |
| 215 | // Note that oneof type names ("test_oneof" in this case) cannot be used in |
| 216 | // paths. |
| 217 | // |
| 218 | // ## Field Mask Verification |
| 219 | // |
| 220 | // The implementation of any API method which has a FieldMask type field in the |
| 221 | // request should verify the included field paths, and return an |
| 222 | // `INVALID_ARGUMENT` error if any path is duplicated or unmappable. |
| 223 | type FieldMask struct { |
| 224 | // The set of field mask paths. |
| 225 | Paths []string `protobuf:"bytes,1,rep,name=paths,proto3" json:"paths,omitempty"` |
| 226 | XXX_NoUnkeyedLiteral struct{} `json:"-"` |
| 227 | XXX_unrecognized []byte `json:"-"` |
| 228 | XXX_sizecache int32 `json:"-"` |
| 229 | } |
| 230 | |
| 231 | func (m *FieldMask) Reset() { *m = FieldMask{} } |
| 232 | func (m *FieldMask) String() string { return proto.CompactTextString(m) } |
| 233 | func (*FieldMask) ProtoMessage() {} |
| 234 | func (*FieldMask) Descriptor() ([]byte, []int) { |
| 235 | return fileDescriptor_5158202634f0da48, []int{0} |
| 236 | } |
| 237 | |
| 238 | func (m *FieldMask) XXX_Unmarshal(b []byte) error { |
| 239 | return xxx_messageInfo_FieldMask.Unmarshal(m, b) |
| 240 | } |
| 241 | func (m *FieldMask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { |
| 242 | return xxx_messageInfo_FieldMask.Marshal(b, m, deterministic) |
| 243 | } |
| 244 | func (m *FieldMask) XXX_Merge(src proto.Message) { |
| 245 | xxx_messageInfo_FieldMask.Merge(m, src) |
| 246 | } |
| 247 | func (m *FieldMask) XXX_Size() int { |
| 248 | return xxx_messageInfo_FieldMask.Size(m) |
| 249 | } |
| 250 | func (m *FieldMask) XXX_DiscardUnknown() { |
| 251 | xxx_messageInfo_FieldMask.DiscardUnknown(m) |
| 252 | } |
| 253 | |
| 254 | var xxx_messageInfo_FieldMask proto.InternalMessageInfo |
| 255 | |
| 256 | func (m *FieldMask) GetPaths() []string { |
| 257 | if m != nil { |
| 258 | return m.Paths |
| 259 | } |
| 260 | return nil |
| 261 | } |
| 262 | |
| 263 | func init() { |
| 264 | proto.RegisterType((*FieldMask)(nil), "google.protobuf.FieldMask") |
| 265 | } |
| 266 | |
| 267 | func init() { proto.RegisterFile("google/protobuf/field_mask.proto", fileDescriptor_5158202634f0da48) } |
| 268 | |
| 269 | var fileDescriptor_5158202634f0da48 = []byte{ |
| 270 | // 175 bytes of a gzipped FileDescriptorProto |
| 271 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xcf, 0xcf, 0x4f, |
| 272 | 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcb, 0x4c, 0xcd, |
| 273 | 0x49, 0x89, 0xcf, 0x4d, 0x2c, 0xce, 0xd6, 0x03, 0x8b, 0x09, 0xf1, 0x43, 0x54, 0xe8, 0xc1, 0x54, |
| 274 | 0x28, 0x29, 0x72, 0x71, 0xba, 0x81, 0x14, 0xf9, 0x26, 0x16, 0x67, 0x0b, 0x89, 0x70, 0xb1, 0x16, |
| 275 | 0x24, 0x96, 0x64, 0x14, 0x4b, 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x06, 0x41, 0x38, 0x4e, 0x3d, 0x8c, |
| 276 | 0x5c, 0xc2, 0xc9, 0xf9, 0xb9, 0x7a, 0x68, 0x5a, 0x9d, 0xf8, 0xe0, 0x1a, 0x03, 0x40, 0x42, 0x01, |
| 277 | 0x8c, 0x51, 0x96, 0x50, 0x25, 0xe9, 0xf9, 0x39, 0x89, 0x79, 0xe9, 0x7a, 0xf9, 0x45, 0xe9, 0xfa, |
| 278 | 0xe9, 0xa9, 0x79, 0x60, 0x0d, 0xd8, 0xdc, 0x64, 0x8d, 0x60, 0xfe, 0x60, 0x64, 0x5c, 0xc4, 0xc4, |
| 279 | 0xec, 0x1e, 0xe0, 0xb4, 0x8a, 0x49, 0xce, 0x1d, 0x62, 0x48, 0x00, 0x54, 0x83, 0x5e, 0x78, 0x6a, |
| 280 | 0x4e, 0x8e, 0x77, 0x5e, 0x7e, 0x79, 0x5e, 0x48, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x24, |
| 281 | 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xfd, 0xda, 0xb7, 0xa8, 0xed, 0x00, 0x00, 0x00, |
| 282 | } |