field_mask.pb.go 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: google/protobuf/field_mask.proto
  3. package field_mask // import "google.golang.org/genproto/protobuf/field_mask"
  4. import proto "github.com/golang/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. // Reference imports to suppress errors if they are not otherwise used.
  8. var _ = proto.Marshal
  9. var _ = fmt.Errorf
  10. var _ = math.Inf
  11. // This is a compile-time assertion to ensure that this generated file
  12. // is compatible with the proto package it is being compiled against.
  13. // A compilation error at this line likely means your copy of the
  14. // proto package needs to be updated.
  15. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  16. // `FieldMask` represents a set of symbolic field paths, for example:
  17. //
  18. // paths: "f.a"
  19. // paths: "f.b.d"
  20. //
  21. // Here `f` represents a field in some root message, `a` and `b`
  22. // fields in the message found in `f`, and `d` a field found in the
  23. // message in `f.b`.
  24. //
  25. // Field masks are used to specify a subset of fields that should be
  26. // returned by a get operation or modified by an update operation.
  27. // Field masks also have a custom JSON encoding (see below).
  28. //
  29. // # Field Masks in Projections
  30. //
  31. // When used in the context of a projection, a response message or
  32. // sub-message is filtered by the API to only contain those fields as
  33. // specified in the mask. For example, if the mask in the previous
  34. // example is applied to a response message as follows:
  35. //
  36. // f {
  37. // a : 22
  38. // b {
  39. // d : 1
  40. // x : 2
  41. // }
  42. // y : 13
  43. // }
  44. // z: 8
  45. //
  46. // The result will not contain specific values for fields x,y and z
  47. // (their value will be set to the default, and omitted in proto text
  48. // output):
  49. //
  50. //
  51. // f {
  52. // a : 22
  53. // b {
  54. // d : 1
  55. // }
  56. // }
  57. //
  58. // A repeated field is not allowed except at the last position of a
  59. // paths string.
  60. //
  61. // If a FieldMask object is not present in a get operation, the
  62. // operation applies to all fields (as if a FieldMask of all fields
  63. // had been specified).
  64. //
  65. // Note that a field mask does not necessarily apply to the
  66. // top-level response message. In case of a REST get operation, the
  67. // field mask applies directly to the response, but in case of a REST
  68. // list operation, the mask instead applies to each individual message
  69. // in the returned resource list. In case of a REST custom method,
  70. // other definitions may be used. Where the mask applies will be
  71. // clearly documented together with its declaration in the API. In
  72. // any case, the effect on the returned resource/resources is required
  73. // behavior for APIs.
  74. //
  75. // # Field Masks in Update Operations
  76. //
  77. // A field mask in update operations specifies which fields of the
  78. // targeted resource are going to be updated. The API is required
  79. // to only change the values of the fields as specified in the mask
  80. // and leave the others untouched. If a resource is passed in to
  81. // describe the updated values, the API ignores the values of all
  82. // fields not covered by the mask.
  83. //
  84. // If a repeated field is specified for an update operation, the existing
  85. // repeated values in the target resource will be overwritten by the new values.
  86. // Note that a repeated field is only allowed in the last position of a `paths`
  87. // string.
  88. //
  89. // If a sub-message is specified in the last position of the field mask for an
  90. // update operation, then the existing sub-message in the target resource is
  91. // overwritten. Given the target message:
  92. //
  93. // f {
  94. // b {
  95. // d : 1
  96. // x : 2
  97. // }
  98. // c : 1
  99. // }
  100. //
  101. // And an update message:
  102. //
  103. // f {
  104. // b {
  105. // d : 10
  106. // }
  107. // }
  108. //
  109. // then if the field mask is:
  110. //
  111. // paths: "f.b"
  112. //
  113. // then the result will be:
  114. //
  115. // f {
  116. // b {
  117. // d : 10
  118. // }
  119. // c : 1
  120. // }
  121. //
  122. // However, if the update mask was:
  123. //
  124. // paths: "f.b.d"
  125. //
  126. // then the result would be:
  127. //
  128. // f {
  129. // b {
  130. // d : 10
  131. // x : 2
  132. // }
  133. // c : 1
  134. // }
  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. func (m *FieldMask) Reset() { *m = FieldMask{} }
  231. func (m *FieldMask) String() string { return proto.CompactTextString(m) }
  232. func (*FieldMask) ProtoMessage() {}
  233. func (*FieldMask) Descriptor() ([]byte, []int) {
  234. return fileDescriptor_field_mask_56ec45e1ddac5c77, []int{0}
  235. }
  236. func (m *FieldMask) XXX_Unmarshal(b []byte) error {
  237. return xxx_messageInfo_FieldMask.Unmarshal(m, b)
  238. }
  239. func (m *FieldMask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  240. return xxx_messageInfo_FieldMask.Marshal(b, m, deterministic)
  241. }
  242. func (dst *FieldMask) XXX_Merge(src proto.Message) {
  243. xxx_messageInfo_FieldMask.Merge(dst, src)
  244. }
  245. func (m *FieldMask) XXX_Size() int {
  246. return xxx_messageInfo_FieldMask.Size(m)
  247. }
  248. func (m *FieldMask) XXX_DiscardUnknown() {
  249. xxx_messageInfo_FieldMask.DiscardUnknown(m)
  250. }
  251. var xxx_messageInfo_FieldMask proto.InternalMessageInfo
  252. func (m *FieldMask) GetPaths() []string {
  253. if m != nil {
  254. return m.Paths
  255. }
  256. return nil
  257. }
  258. func init() {
  259. proto.RegisterType((*FieldMask)(nil), "google.protobuf.FieldMask")
  260. }
  261. func init() {
  262. proto.RegisterFile("google/protobuf/field_mask.proto", fileDescriptor_field_mask_56ec45e1ddac5c77)
  263. }
  264. var fileDescriptor_field_mask_56ec45e1ddac5c77 = []byte{
  265. // 171 bytes of a gzipped FileDescriptorProto
  266. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xcf, 0xcf, 0x4f,
  267. 0xcf, 0x49, 0xd5, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x4f, 0xcb, 0x4c, 0xcd,
  268. 0x49, 0x89, 0xcf, 0x4d, 0x2c, 0xce, 0xd6, 0x03, 0x8b, 0x09, 0xf1, 0x43, 0x54, 0xe8, 0xc1, 0x54,
  269. 0x28, 0x29, 0x72, 0x71, 0xba, 0x81, 0x14, 0xf9, 0x26, 0x16, 0x67, 0x0b, 0x89, 0x70, 0xb1, 0x16,
  270. 0x24, 0x96, 0x64, 0x14, 0x4b, 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x06, 0x41, 0x38, 0x4e, 0x9d, 0x8c,
  271. 0x5c, 0xc2, 0xc9, 0xf9, 0xb9, 0x7a, 0x68, 0x5a, 0x9d, 0xf8, 0xe0, 0x1a, 0x03, 0x40, 0x42, 0x01,
  272. 0x8c, 0x51, 0x96, 0x50, 0x25, 0xe9, 0xf9, 0x39, 0x89, 0x79, 0xe9, 0x7a, 0xf9, 0x45, 0xe9, 0xfa,
  273. 0xe9, 0xa9, 0x79, 0x60, 0x0d, 0xd8, 0xdc, 0x64, 0x8d, 0x60, 0x2e, 0x62, 0x62, 0x76, 0x0f, 0x70,
  274. 0x5a, 0xc5, 0x24, 0xe7, 0x0e, 0x31, 0x21, 0x00, 0xaa, 0x5a, 0x2f, 0x3c, 0x35, 0x27, 0xc7, 0x3b,
  275. 0x2f, 0xbf, 0x3c, 0x2f, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x6c, 0x8c, 0x31, 0x20, 0x00,
  276. 0x00, 0xff, 0xff, 0x5a, 0xdb, 0x3a, 0xc0, 0xea, 0x00, 0x00, 0x00,
  277. }