You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

928 lines
31 KiB

  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: google/datastore/v1/entity.proto
  3. package datastore // import "google.golang.org/genproto/googleapis/datastore/v1"
  4. import proto "github.com/golang/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. import _struct "github.com/golang/protobuf/ptypes/struct"
  8. import timestamp "github.com/golang/protobuf/ptypes/timestamp"
  9. import _ "google.golang.org/genproto/googleapis/api/annotations"
  10. import latlng "google.golang.org/genproto/googleapis/type/latlng"
  11. // Reference imports to suppress errors if they are not otherwise used.
  12. var _ = proto.Marshal
  13. var _ = fmt.Errorf
  14. var _ = math.Inf
  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
  20. // A partition ID identifies a grouping of entities. The grouping is always
  21. // by project and namespace, however the namespace ID may be empty.
  22. //
  23. // A partition ID contains several dimensions:
  24. // project ID and namespace ID.
  25. //
  26. // Partition dimensions:
  27. //
  28. // - May be `""`.
  29. // - Must be valid UTF-8 bytes.
  30. // - Must have values that match regex `[A-Za-z\d\.\-_]{1,100}`
  31. // If the value of any dimension matches regex `__.*__`, the partition is
  32. // reserved/read-only.
  33. // A reserved/read-only partition ID is forbidden in certain documented
  34. // contexts.
  35. //
  36. // Foreign partition IDs (in which the project ID does
  37. // not match the context project ID ) are discouraged.
  38. // Reads and writes of foreign partition IDs may fail if the project is not in
  39. // an active state.
  40. type PartitionId struct {
  41. // The ID of the project to which the entities belong.
  42. ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"`
  43. // If not empty, the ID of the namespace to which the entities belong.
  44. NamespaceId string `protobuf:"bytes,4,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"`
  45. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  46. XXX_unrecognized []byte `json:"-"`
  47. XXX_sizecache int32 `json:"-"`
  48. }
  49. func (m *PartitionId) Reset() { *m = PartitionId{} }
  50. func (m *PartitionId) String() string { return proto.CompactTextString(m) }
  51. func (*PartitionId) ProtoMessage() {}
  52. func (*PartitionId) Descriptor() ([]byte, []int) {
  53. return fileDescriptor_entity_096a297364b049a5, []int{0}
  54. }
  55. func (m *PartitionId) XXX_Unmarshal(b []byte) error {
  56. return xxx_messageInfo_PartitionId.Unmarshal(m, b)
  57. }
  58. func (m *PartitionId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  59. return xxx_messageInfo_PartitionId.Marshal(b, m, deterministic)
  60. }
  61. func (dst *PartitionId) XXX_Merge(src proto.Message) {
  62. xxx_messageInfo_PartitionId.Merge(dst, src)
  63. }
  64. func (m *PartitionId) XXX_Size() int {
  65. return xxx_messageInfo_PartitionId.Size(m)
  66. }
  67. func (m *PartitionId) XXX_DiscardUnknown() {
  68. xxx_messageInfo_PartitionId.DiscardUnknown(m)
  69. }
  70. var xxx_messageInfo_PartitionId proto.InternalMessageInfo
  71. func (m *PartitionId) GetProjectId() string {
  72. if m != nil {
  73. return m.ProjectId
  74. }
  75. return ""
  76. }
  77. func (m *PartitionId) GetNamespaceId() string {
  78. if m != nil {
  79. return m.NamespaceId
  80. }
  81. return ""
  82. }
  83. // A unique identifier for an entity.
  84. // If a key's partition ID or any of its path kinds or names are
  85. // reserved/read-only, the key is reserved/read-only.
  86. // A reserved/read-only key is forbidden in certain documented contexts.
  87. type Key struct {
  88. // Entities are partitioned into subsets, currently identified by a project
  89. // ID and namespace ID.
  90. // Queries are scoped to a single partition.
  91. PartitionId *PartitionId `protobuf:"bytes,1,opt,name=partition_id,json=partitionId,proto3" json:"partition_id,omitempty"`
  92. // The entity path.
  93. // An entity path consists of one or more elements composed of a kind and a
  94. // string or numerical identifier, which identify entities. The first
  95. // element identifies a _root entity_, the second element identifies
  96. // a _child_ of the root entity, the third element identifies a child of the
  97. // second entity, and so forth. The entities identified by all prefixes of
  98. // the path are called the element's _ancestors_.
  99. //
  100. // An entity path is always fully complete: *all* of the entity's ancestors
  101. // are required to be in the path along with the entity identifier itself.
  102. // The only exception is that in some documented cases, the identifier in the
  103. // last path element (for the entity) itself may be omitted. For example,
  104. // the last path element of the key of `Mutation.insert` may have no
  105. // identifier.
  106. //
  107. // A path can never be empty, and a path can have at most 100 elements.
  108. Path []*Key_PathElement `protobuf:"bytes,2,rep,name=path,proto3" json:"path,omitempty"`
  109. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  110. XXX_unrecognized []byte `json:"-"`
  111. XXX_sizecache int32 `json:"-"`
  112. }
  113. func (m *Key) Reset() { *m = Key{} }
  114. func (m *Key) String() string { return proto.CompactTextString(m) }
  115. func (*Key) ProtoMessage() {}
  116. func (*Key) Descriptor() ([]byte, []int) {
  117. return fileDescriptor_entity_096a297364b049a5, []int{1}
  118. }
  119. func (m *Key) XXX_Unmarshal(b []byte) error {
  120. return xxx_messageInfo_Key.Unmarshal(m, b)
  121. }
  122. func (m *Key) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  123. return xxx_messageInfo_Key.Marshal(b, m, deterministic)
  124. }
  125. func (dst *Key) XXX_Merge(src proto.Message) {
  126. xxx_messageInfo_Key.Merge(dst, src)
  127. }
  128. func (m *Key) XXX_Size() int {
  129. return xxx_messageInfo_Key.Size(m)
  130. }
  131. func (m *Key) XXX_DiscardUnknown() {
  132. xxx_messageInfo_Key.DiscardUnknown(m)
  133. }
  134. var xxx_messageInfo_Key proto.InternalMessageInfo
  135. func (m *Key) GetPartitionId() *PartitionId {
  136. if m != nil {
  137. return m.PartitionId
  138. }
  139. return nil
  140. }
  141. func (m *Key) GetPath() []*Key_PathElement {
  142. if m != nil {
  143. return m.Path
  144. }
  145. return nil
  146. }
  147. // A (kind, ID/name) pair used to construct a key path.
  148. //
  149. // If either name or ID is set, the element is complete.
  150. // If neither is set, the element is incomplete.
  151. type Key_PathElement struct {
  152. // The kind of the entity.
  153. // A kind matching regex `__.*__` is reserved/read-only.
  154. // A kind must not contain more than 1500 bytes when UTF-8 encoded.
  155. // Cannot be `""`.
  156. Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
  157. // The type of ID.
  158. //
  159. // Types that are valid to be assigned to IdType:
  160. // *Key_PathElement_Id
  161. // *Key_PathElement_Name
  162. IdType isKey_PathElement_IdType `protobuf_oneof:"id_type"`
  163. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  164. XXX_unrecognized []byte `json:"-"`
  165. XXX_sizecache int32 `json:"-"`
  166. }
  167. func (m *Key_PathElement) Reset() { *m = Key_PathElement{} }
  168. func (m *Key_PathElement) String() string { return proto.CompactTextString(m) }
  169. func (*Key_PathElement) ProtoMessage() {}
  170. func (*Key_PathElement) Descriptor() ([]byte, []int) {
  171. return fileDescriptor_entity_096a297364b049a5, []int{1, 0}
  172. }
  173. func (m *Key_PathElement) XXX_Unmarshal(b []byte) error {
  174. return xxx_messageInfo_Key_PathElement.Unmarshal(m, b)
  175. }
  176. func (m *Key_PathElement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  177. return xxx_messageInfo_Key_PathElement.Marshal(b, m, deterministic)
  178. }
  179. func (dst *Key_PathElement) XXX_Merge(src proto.Message) {
  180. xxx_messageInfo_Key_PathElement.Merge(dst, src)
  181. }
  182. func (m *Key_PathElement) XXX_Size() int {
  183. return xxx_messageInfo_Key_PathElement.Size(m)
  184. }
  185. func (m *Key_PathElement) XXX_DiscardUnknown() {
  186. xxx_messageInfo_Key_PathElement.DiscardUnknown(m)
  187. }
  188. var xxx_messageInfo_Key_PathElement proto.InternalMessageInfo
  189. func (m *Key_PathElement) GetKind() string {
  190. if m != nil {
  191. return m.Kind
  192. }
  193. return ""
  194. }
  195. type isKey_PathElement_IdType interface {
  196. isKey_PathElement_IdType()
  197. }
  198. type Key_PathElement_Id struct {
  199. Id int64 `protobuf:"varint,2,opt,name=id,proto3,oneof"`
  200. }
  201. type Key_PathElement_Name struct {
  202. Name string `protobuf:"bytes,3,opt,name=name,proto3,oneof"`
  203. }
  204. func (*Key_PathElement_Id) isKey_PathElement_IdType() {}
  205. func (*Key_PathElement_Name) isKey_PathElement_IdType() {}
  206. func (m *Key_PathElement) GetIdType() isKey_PathElement_IdType {
  207. if m != nil {
  208. return m.IdType
  209. }
  210. return nil
  211. }
  212. func (m *Key_PathElement) GetId() int64 {
  213. if x, ok := m.GetIdType().(*Key_PathElement_Id); ok {
  214. return x.Id
  215. }
  216. return 0
  217. }
  218. func (m *Key_PathElement) GetName() string {
  219. if x, ok := m.GetIdType().(*Key_PathElement_Name); ok {
  220. return x.Name
  221. }
  222. return ""
  223. }
  224. // XXX_OneofFuncs is for the internal use of the proto package.
  225. func (*Key_PathElement) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
  226. return _Key_PathElement_OneofMarshaler, _Key_PathElement_OneofUnmarshaler, _Key_PathElement_OneofSizer, []interface{}{
  227. (*Key_PathElement_Id)(nil),
  228. (*Key_PathElement_Name)(nil),
  229. }
  230. }
  231. func _Key_PathElement_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
  232. m := msg.(*Key_PathElement)
  233. // id_type
  234. switch x := m.IdType.(type) {
  235. case *Key_PathElement_Id:
  236. b.EncodeVarint(2<<3 | proto.WireVarint)
  237. b.EncodeVarint(uint64(x.Id))
  238. case *Key_PathElement_Name:
  239. b.EncodeVarint(3<<3 | proto.WireBytes)
  240. b.EncodeStringBytes(x.Name)
  241. case nil:
  242. default:
  243. return fmt.Errorf("Key_PathElement.IdType has unexpected type %T", x)
  244. }
  245. return nil
  246. }
  247. func _Key_PathElement_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
  248. m := msg.(*Key_PathElement)
  249. switch tag {
  250. case 2: // id_type.id
  251. if wire != proto.WireVarint {
  252. return true, proto.ErrInternalBadWireType
  253. }
  254. x, err := b.DecodeVarint()
  255. m.IdType = &Key_PathElement_Id{int64(x)}
  256. return true, err
  257. case 3: // id_type.name
  258. if wire != proto.WireBytes {
  259. return true, proto.ErrInternalBadWireType
  260. }
  261. x, err := b.DecodeStringBytes()
  262. m.IdType = &Key_PathElement_Name{x}
  263. return true, err
  264. default:
  265. return false, nil
  266. }
  267. }
  268. func _Key_PathElement_OneofSizer(msg proto.Message) (n int) {
  269. m := msg.(*Key_PathElement)
  270. // id_type
  271. switch x := m.IdType.(type) {
  272. case *Key_PathElement_Id:
  273. n += 1 // tag and wire
  274. n += proto.SizeVarint(uint64(x.Id))
  275. case *Key_PathElement_Name:
  276. n += 1 // tag and wire
  277. n += proto.SizeVarint(uint64(len(x.Name)))
  278. n += len(x.Name)
  279. case nil:
  280. default:
  281. panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
  282. }
  283. return n
  284. }
  285. // An array value.
  286. type ArrayValue struct {
  287. // Values in the array.
  288. // The order of this array may not be preserved if it contains a mix of
  289. // indexed and unindexed values.
  290. Values []*Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
  291. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  292. XXX_unrecognized []byte `json:"-"`
  293. XXX_sizecache int32 `json:"-"`
  294. }
  295. func (m *ArrayValue) Reset() { *m = ArrayValue{} }
  296. func (m *ArrayValue) String() string { return proto.CompactTextString(m) }
  297. func (*ArrayValue) ProtoMessage() {}
  298. func (*ArrayValue) Descriptor() ([]byte, []int) {
  299. return fileDescriptor_entity_096a297364b049a5, []int{2}
  300. }
  301. func (m *ArrayValue) XXX_Unmarshal(b []byte) error {
  302. return xxx_messageInfo_ArrayValue.Unmarshal(m, b)
  303. }
  304. func (m *ArrayValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  305. return xxx_messageInfo_ArrayValue.Marshal(b, m, deterministic)
  306. }
  307. func (dst *ArrayValue) XXX_Merge(src proto.Message) {
  308. xxx_messageInfo_ArrayValue.Merge(dst, src)
  309. }
  310. func (m *ArrayValue) XXX_Size() int {
  311. return xxx_messageInfo_ArrayValue.Size(m)
  312. }
  313. func (m *ArrayValue) XXX_DiscardUnknown() {
  314. xxx_messageInfo_ArrayValue.DiscardUnknown(m)
  315. }
  316. var xxx_messageInfo_ArrayValue proto.InternalMessageInfo
  317. func (m *ArrayValue) GetValues() []*Value {
  318. if m != nil {
  319. return m.Values
  320. }
  321. return nil
  322. }
  323. // A message that can hold any of the supported value types and associated
  324. // metadata.
  325. type Value struct {
  326. // Must have a value set.
  327. //
  328. // Types that are valid to be assigned to ValueType:
  329. // *Value_NullValue
  330. // *Value_BooleanValue
  331. // *Value_IntegerValue
  332. // *Value_DoubleValue
  333. // *Value_TimestampValue
  334. // *Value_KeyValue
  335. // *Value_StringValue
  336. // *Value_BlobValue
  337. // *Value_GeoPointValue
  338. // *Value_EntityValue
  339. // *Value_ArrayValue
  340. ValueType isValue_ValueType `protobuf_oneof:"value_type"`
  341. // The `meaning` field should only be populated for backwards compatibility.
  342. Meaning int32 `protobuf:"varint,14,opt,name=meaning,proto3" json:"meaning,omitempty"`
  343. // If the value should be excluded from all indexes including those defined
  344. // explicitly.
  345. ExcludeFromIndexes bool `protobuf:"varint,19,opt,name=exclude_from_indexes,json=excludeFromIndexes,proto3" json:"exclude_from_indexes,omitempty"`
  346. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  347. XXX_unrecognized []byte `json:"-"`
  348. XXX_sizecache int32 `json:"-"`
  349. }
  350. func (m *Value) Reset() { *m = Value{} }
  351. func (m *Value) String() string { return proto.CompactTextString(m) }
  352. func (*Value) ProtoMessage() {}
  353. func (*Value) Descriptor() ([]byte, []int) {
  354. return fileDescriptor_entity_096a297364b049a5, []int{3}
  355. }
  356. func (m *Value) XXX_Unmarshal(b []byte) error {
  357. return xxx_messageInfo_Value.Unmarshal(m, b)
  358. }
  359. func (m *Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  360. return xxx_messageInfo_Value.Marshal(b, m, deterministic)
  361. }
  362. func (dst *Value) XXX_Merge(src proto.Message) {
  363. xxx_messageInfo_Value.Merge(dst, src)
  364. }
  365. func (m *Value) XXX_Size() int {
  366. return xxx_messageInfo_Value.Size(m)
  367. }
  368. func (m *Value) XXX_DiscardUnknown() {
  369. xxx_messageInfo_Value.DiscardUnknown(m)
  370. }
  371. var xxx_messageInfo_Value proto.InternalMessageInfo
  372. type isValue_ValueType interface {
  373. isValue_ValueType()
  374. }
  375. type Value_NullValue struct {
  376. NullValue _struct.NullValue `protobuf:"varint,11,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"`
  377. }
  378. type Value_BooleanValue struct {
  379. BooleanValue bool `protobuf:"varint,1,opt,name=boolean_value,json=booleanValue,proto3,oneof"`
  380. }
  381. type Value_IntegerValue struct {
  382. IntegerValue int64 `protobuf:"varint,2,opt,name=integer_value,json=integerValue,proto3,oneof"`
  383. }
  384. type Value_DoubleValue struct {
  385. DoubleValue float64 `protobuf:"fixed64,3,opt,name=double_value,json=doubleValue,proto3,oneof"`
  386. }
  387. type Value_TimestampValue struct {
  388. TimestampValue *timestamp.Timestamp `protobuf:"bytes,10,opt,name=timestamp_value,json=timestampValue,proto3,oneof"`
  389. }
  390. type Value_KeyValue struct {
  391. KeyValue *Key `protobuf:"bytes,5,opt,name=key_value,json=keyValue,proto3,oneof"`
  392. }
  393. type Value_StringValue struct {
  394. StringValue string `protobuf:"bytes,17,opt,name=string_value,json=stringValue,proto3,oneof"`
  395. }
  396. type Value_BlobValue struct {
  397. BlobValue []byte `protobuf:"bytes,18,opt,name=blob_value,json=blobValue,proto3,oneof"`
  398. }
  399. type Value_GeoPointValue struct {
  400. GeoPointValue *latlng.LatLng `protobuf:"bytes,8,opt,name=geo_point_value,json=geoPointValue,proto3,oneof"`
  401. }
  402. type Value_EntityValue struct {
  403. EntityValue *Entity `protobuf:"bytes,6,opt,name=entity_value,json=entityValue,proto3,oneof"`
  404. }
  405. type Value_ArrayValue struct {
  406. ArrayValue *ArrayValue `protobuf:"bytes,9,opt,name=array_value,json=arrayValue,proto3,oneof"`
  407. }
  408. func (*Value_NullValue) isValue_ValueType() {}
  409. func (*Value_BooleanValue) isValue_ValueType() {}
  410. func (*Value_IntegerValue) isValue_ValueType() {}
  411. func (*Value_DoubleValue) isValue_ValueType() {}
  412. func (*Value_TimestampValue) isValue_ValueType() {}
  413. func (*Value_KeyValue) isValue_ValueType() {}
  414. func (*Value_StringValue) isValue_ValueType() {}
  415. func (*Value_BlobValue) isValue_ValueType() {}
  416. func (*Value_GeoPointValue) isValue_ValueType() {}
  417. func (*Value_EntityValue) isValue_ValueType() {}
  418. func (*Value_ArrayValue) isValue_ValueType() {}
  419. func (m *Value) GetValueType() isValue_ValueType {
  420. if m != nil {
  421. return m.ValueType
  422. }
  423. return nil
  424. }
  425. func (m *Value) GetNullValue() _struct.NullValue {
  426. if x, ok := m.GetValueType().(*Value_NullValue); ok {
  427. return x.NullValue
  428. }
  429. return _struct.NullValue_NULL_VALUE
  430. }
  431. func (m *Value) GetBooleanValue() bool {
  432. if x, ok := m.GetValueType().(*Value_BooleanValue); ok {
  433. return x.BooleanValue
  434. }
  435. return false
  436. }
  437. func (m *Value) GetIntegerValue() int64 {
  438. if x, ok := m.GetValueType().(*Value_IntegerValue); ok {
  439. return x.IntegerValue
  440. }
  441. return 0
  442. }
  443. func (m *Value) GetDoubleValue() float64 {
  444. if x, ok := m.GetValueType().(*Value_DoubleValue); ok {
  445. return x.DoubleValue
  446. }
  447. return 0
  448. }
  449. func (m *Value) GetTimestampValue() *timestamp.Timestamp {
  450. if x, ok := m.GetValueType().(*Value_TimestampValue); ok {
  451. return x.TimestampValue
  452. }
  453. return nil
  454. }
  455. func (m *Value) GetKeyValue() *Key {
  456. if x, ok := m.GetValueType().(*Value_KeyValue); ok {
  457. return x.KeyValue
  458. }
  459. return nil
  460. }
  461. func (m *Value) GetStringValue() string {
  462. if x, ok := m.GetValueType().(*Value_StringValue); ok {
  463. return x.StringValue
  464. }
  465. return ""
  466. }
  467. func (m *Value) GetBlobValue() []byte {
  468. if x, ok := m.GetValueType().(*Value_BlobValue); ok {
  469. return x.BlobValue
  470. }
  471. return nil
  472. }
  473. func (m *Value) GetGeoPointValue() *latlng.LatLng {
  474. if x, ok := m.GetValueType().(*Value_GeoPointValue); ok {
  475. return x.GeoPointValue
  476. }
  477. return nil
  478. }
  479. func (m *Value) GetEntityValue() *Entity {
  480. if x, ok := m.GetValueType().(*Value_EntityValue); ok {
  481. return x.EntityValue
  482. }
  483. return nil
  484. }
  485. func (m *Value) GetArrayValue() *ArrayValue {
  486. if x, ok := m.GetValueType().(*Value_ArrayValue); ok {
  487. return x.ArrayValue
  488. }
  489. return nil
  490. }
  491. func (m *Value) GetMeaning() int32 {
  492. if m != nil {
  493. return m.Meaning
  494. }
  495. return 0
  496. }
  497. func (m *Value) GetExcludeFromIndexes() bool {
  498. if m != nil {
  499. return m.ExcludeFromIndexes
  500. }
  501. return false
  502. }
  503. // XXX_OneofFuncs is for the internal use of the proto package.
  504. func (*Value) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
  505. return _Value_OneofMarshaler, _Value_OneofUnmarshaler, _Value_OneofSizer, []interface{}{
  506. (*Value_NullValue)(nil),
  507. (*Value_BooleanValue)(nil),
  508. (*Value_IntegerValue)(nil),
  509. (*Value_DoubleValue)(nil),
  510. (*Value_TimestampValue)(nil),
  511. (*Value_KeyValue)(nil),
  512. (*Value_StringValue)(nil),
  513. (*Value_BlobValue)(nil),
  514. (*Value_GeoPointValue)(nil),
  515. (*Value_EntityValue)(nil),
  516. (*Value_ArrayValue)(nil),
  517. }
  518. }
  519. func _Value_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
  520. m := msg.(*Value)
  521. // value_type
  522. switch x := m.ValueType.(type) {
  523. case *Value_NullValue:
  524. b.EncodeVarint(11<<3 | proto.WireVarint)
  525. b.EncodeVarint(uint64(x.NullValue))
  526. case *Value_BooleanValue:
  527. t := uint64(0)
  528. if x.BooleanValue {
  529. t = 1
  530. }
  531. b.EncodeVarint(1<<3 | proto.WireVarint)
  532. b.EncodeVarint(t)
  533. case *Value_IntegerValue:
  534. b.EncodeVarint(2<<3 | proto.WireVarint)
  535. b.EncodeVarint(uint64(x.IntegerValue))
  536. case *Value_DoubleValue:
  537. b.EncodeVarint(3<<3 | proto.WireFixed64)
  538. b.EncodeFixed64(math.Float64bits(x.DoubleValue))
  539. case *Value_TimestampValue:
  540. b.EncodeVarint(10<<3 | proto.WireBytes)
  541. if err := b.EncodeMessage(x.TimestampValue); err != nil {
  542. return err
  543. }
  544. case *Value_KeyValue:
  545. b.EncodeVarint(5<<3 | proto.WireBytes)
  546. if err := b.EncodeMessage(x.KeyValue); err != nil {
  547. return err
  548. }
  549. case *Value_StringValue:
  550. b.EncodeVarint(17<<3 | proto.WireBytes)
  551. b.EncodeStringBytes(x.StringValue)
  552. case *Value_BlobValue:
  553. b.EncodeVarint(18<<3 | proto.WireBytes)
  554. b.EncodeRawBytes(x.BlobValue)
  555. case *Value_GeoPointValue:
  556. b.EncodeVarint(8<<3 | proto.WireBytes)
  557. if err := b.EncodeMessage(x.GeoPointValue); err != nil {
  558. return err
  559. }
  560. case *Value_EntityValue:
  561. b.EncodeVarint(6<<3 | proto.WireBytes)
  562. if err := b.EncodeMessage(x.EntityValue); err != nil {
  563. return err
  564. }
  565. case *Value_ArrayValue:
  566. b.EncodeVarint(9<<3 | proto.WireBytes)
  567. if err := b.EncodeMessage(x.ArrayValue); err != nil {
  568. return err
  569. }
  570. case nil:
  571. default:
  572. return fmt.Errorf("Value.ValueType has unexpected type %T", x)
  573. }
  574. return nil
  575. }
  576. func _Value_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
  577. m := msg.(*Value)
  578. switch tag {
  579. case 11: // value_type.null_value
  580. if wire != proto.WireVarint {
  581. return true, proto.ErrInternalBadWireType
  582. }
  583. x, err := b.DecodeVarint()
  584. m.ValueType = &Value_NullValue{_struct.NullValue(x)}
  585. return true, err
  586. case 1: // value_type.boolean_value
  587. if wire != proto.WireVarint {
  588. return true, proto.ErrInternalBadWireType
  589. }
  590. x, err := b.DecodeVarint()
  591. m.ValueType = &Value_BooleanValue{x != 0}
  592. return true, err
  593. case 2: // value_type.integer_value
  594. if wire != proto.WireVarint {
  595. return true, proto.ErrInternalBadWireType
  596. }
  597. x, err := b.DecodeVarint()
  598. m.ValueType = &Value_IntegerValue{int64(x)}
  599. return true, err
  600. case 3: // value_type.double_value
  601. if wire != proto.WireFixed64 {
  602. return true, proto.ErrInternalBadWireType
  603. }
  604. x, err := b.DecodeFixed64()
  605. m.ValueType = &Value_DoubleValue{math.Float64frombits(x)}
  606. return true, err
  607. case 10: // value_type.timestamp_value
  608. if wire != proto.WireBytes {
  609. return true, proto.ErrInternalBadWireType
  610. }
  611. msg := new(timestamp.Timestamp)
  612. err := b.DecodeMessage(msg)
  613. m.ValueType = &Value_TimestampValue{msg}
  614. return true, err
  615. case 5: // value_type.key_value
  616. if wire != proto.WireBytes {
  617. return true, proto.ErrInternalBadWireType
  618. }
  619. msg := new(Key)
  620. err := b.DecodeMessage(msg)
  621. m.ValueType = &Value_KeyValue{msg}
  622. return true, err
  623. case 17: // value_type.string_value
  624. if wire != proto.WireBytes {
  625. return true, proto.ErrInternalBadWireType
  626. }
  627. x, err := b.DecodeStringBytes()
  628. m.ValueType = &Value_StringValue{x}
  629. return true, err
  630. case 18: // value_type.blob_value
  631. if wire != proto.WireBytes {
  632. return true, proto.ErrInternalBadWireType
  633. }
  634. x, err := b.DecodeRawBytes(true)
  635. m.ValueType = &Value_BlobValue{x}
  636. return true, err
  637. case 8: // value_type.geo_point_value
  638. if wire != proto.WireBytes {
  639. return true, proto.ErrInternalBadWireType
  640. }
  641. msg := new(latlng.LatLng)
  642. err := b.DecodeMessage(msg)
  643. m.ValueType = &Value_GeoPointValue{msg}
  644. return true, err
  645. case 6: // value_type.entity_value
  646. if wire != proto.WireBytes {
  647. return true, proto.ErrInternalBadWireType
  648. }
  649. msg := new(Entity)
  650. err := b.DecodeMessage(msg)
  651. m.ValueType = &Value_EntityValue{msg}
  652. return true, err
  653. case 9: // value_type.array_value
  654. if wire != proto.WireBytes {
  655. return true, proto.ErrInternalBadWireType
  656. }
  657. msg := new(ArrayValue)
  658. err := b.DecodeMessage(msg)
  659. m.ValueType = &Value_ArrayValue{msg}
  660. return true, err
  661. default:
  662. return false, nil
  663. }
  664. }
  665. func _Value_OneofSizer(msg proto.Message) (n int) {
  666. m := msg.(*Value)
  667. // value_type
  668. switch x := m.ValueType.(type) {
  669. case *Value_NullValue:
  670. n += 1 // tag and wire
  671. n += proto.SizeVarint(uint64(x.NullValue))
  672. case *Value_BooleanValue:
  673. n += 1 // tag and wire
  674. n += 1
  675. case *Value_IntegerValue:
  676. n += 1 // tag and wire
  677. n += proto.SizeVarint(uint64(x.IntegerValue))
  678. case *Value_DoubleValue:
  679. n += 1 // tag and wire
  680. n += 8
  681. case *Value_TimestampValue:
  682. s := proto.Size(x.TimestampValue)
  683. n += 1 // tag and wire
  684. n += proto.SizeVarint(uint64(s))
  685. n += s
  686. case *Value_KeyValue:
  687. s := proto.Size(x.KeyValue)
  688. n += 1 // tag and wire
  689. n += proto.SizeVarint(uint64(s))
  690. n += s
  691. case *Value_StringValue:
  692. n += 2 // tag and wire
  693. n += proto.SizeVarint(uint64(len(x.StringValue)))
  694. n += len(x.StringValue)
  695. case *Value_BlobValue:
  696. n += 2 // tag and wire
  697. n += proto.SizeVarint(uint64(len(x.BlobValue)))
  698. n += len(x.BlobValue)
  699. case *Value_GeoPointValue:
  700. s := proto.Size(x.GeoPointValue)
  701. n += 1 // tag and wire
  702. n += proto.SizeVarint(uint64(s))
  703. n += s
  704. case *Value_EntityValue:
  705. s := proto.Size(x.EntityValue)
  706. n += 1 // tag and wire
  707. n += proto.SizeVarint(uint64(s))
  708. n += s
  709. case *Value_ArrayValue:
  710. s := proto.Size(x.ArrayValue)
  711. n += 1 // tag and wire
  712. n += proto.SizeVarint(uint64(s))
  713. n += s
  714. case nil:
  715. default:
  716. panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
  717. }
  718. return n
  719. }
  720. // A Datastore data object.
  721. //
  722. // An entity is limited to 1 megabyte when stored. That _roughly_
  723. // corresponds to a limit of 1 megabyte for the serialized form of this
  724. // message.
  725. type Entity struct {
  726. // The entity's key.
  727. //
  728. // An entity must have a key, unless otherwise documented (for example,
  729. // an entity in `Value.entity_value` may have no key).
  730. // An entity's kind is its key path's last element's kind,
  731. // or null if it has no key.
  732. Key *Key `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
  733. // The entity's properties.
  734. // The map's keys are property names.
  735. // A property name matching regex `__.*__` is reserved.
  736. // A reserved property name is forbidden in certain documented contexts.
  737. // The name must not contain more than 500 characters.
  738. // The name cannot be `""`.
  739. Properties map[string]*Value `protobuf:"bytes,3,rep,name=properties,proto3" json:"properties,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
  740. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  741. XXX_unrecognized []byte `json:"-"`
  742. XXX_sizecache int32 `json:"-"`
  743. }
  744. func (m *Entity) Reset() { *m = Entity{} }
  745. func (m *Entity) String() string { return proto.CompactTextString(m) }
  746. func (*Entity) ProtoMessage() {}
  747. func (*Entity) Descriptor() ([]byte, []int) {
  748. return fileDescriptor_entity_096a297364b049a5, []int{4}
  749. }
  750. func (m *Entity) XXX_Unmarshal(b []byte) error {
  751. return xxx_messageInfo_Entity.Unmarshal(m, b)
  752. }
  753. func (m *Entity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  754. return xxx_messageInfo_Entity.Marshal(b, m, deterministic)
  755. }
  756. func (dst *Entity) XXX_Merge(src proto.Message) {
  757. xxx_messageInfo_Entity.Merge(dst, src)
  758. }
  759. func (m *Entity) XXX_Size() int {
  760. return xxx_messageInfo_Entity.Size(m)
  761. }
  762. func (m *Entity) XXX_DiscardUnknown() {
  763. xxx_messageInfo_Entity.DiscardUnknown(m)
  764. }
  765. var xxx_messageInfo_Entity proto.InternalMessageInfo
  766. func (m *Entity) GetKey() *Key {
  767. if m != nil {
  768. return m.Key
  769. }
  770. return nil
  771. }
  772. func (m *Entity) GetProperties() map[string]*Value {
  773. if m != nil {
  774. return m.Properties
  775. }
  776. return nil
  777. }
  778. func init() {
  779. proto.RegisterType((*PartitionId)(nil), "google.datastore.v1.PartitionId")
  780. proto.RegisterType((*Key)(nil), "google.datastore.v1.Key")
  781. proto.RegisterType((*Key_PathElement)(nil), "google.datastore.v1.Key.PathElement")
  782. proto.RegisterType((*ArrayValue)(nil), "google.datastore.v1.ArrayValue")
  783. proto.RegisterType((*Value)(nil), "google.datastore.v1.Value")
  784. proto.RegisterType((*Entity)(nil), "google.datastore.v1.Entity")
  785. proto.RegisterMapType((map[string]*Value)(nil), "google.datastore.v1.Entity.PropertiesEntry")
  786. }
  787. func init() {
  788. proto.RegisterFile("google/datastore/v1/entity.proto", fileDescriptor_entity_096a297364b049a5)
  789. }
  790. var fileDescriptor_entity_096a297364b049a5 = []byte{
  791. // 780 bytes of a gzipped FileDescriptorProto
  792. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x94, 0xff, 0x6e, 0xdc, 0x44,
  793. 0x10, 0xc7, 0xed, 0xbb, 0x5c, 0x1a, 0x8f, 0xdd, 0xa4, 0x6c, 0x2a, 0x61, 0x02, 0x28, 0x26, 0x80,
  794. 0x74, 0x02, 0xc9, 0x6e, 0xc2, 0x1f, 0x54, 0x14, 0xa4, 0x72, 0x25, 0xe0, 0x28, 0x15, 0x9c, 0x56,
  795. 0x55, 0x24, 0x50, 0xa4, 0xd3, 0xde, 0x79, 0xeb, 0x2e, 0x67, 0xef, 0x5a, 0xf6, 0x3a, 0xaa, 0xdf,
  796. 0x05, 0xf1, 0x00, 0x3c, 0x0a, 0x8f, 0x80, 0x78, 0x18, 0xb4, 0x3f, 0xec, 0x0b, 0xed, 0x35, 0xff,
  797. 0x79, 0x67, 0x3e, 0xdf, 0xd9, 0xef, 0xec, 0xce, 0x1a, 0xa2, 0x5c, 0x88, 0xbc, 0xa0, 0x49, 0x46,
  798. 0x24, 0x69, 0xa4, 0xa8, 0x69, 0x72, 0x73, 0x9a, 0x50, 0x2e, 0x99, 0xec, 0xe2, 0xaa, 0x16, 0x52,
  799. 0xa0, 0x43, 0x43, 0xc4, 0x03, 0x11, 0xdf, 0x9c, 0x1e, 0x7d, 0x64, 0x65, 0xa4, 0x62, 0x09, 0xe1,
  800. 0x5c, 0x48, 0x22, 0x99, 0xe0, 0x8d, 0x91, 0x0c, 0x59, 0xbd, 0x5a, 0xb6, 0x2f, 0x93, 0x46, 0xd6,
  801. 0xed, 0x4a, 0xda, 0xec, 0xf1, 0x9b, 0x59, 0xc9, 0x4a, 0xda, 0x48, 0x52, 0x56, 0x16, 0x08, 0x2d,
  802. 0x20, 0xbb, 0x8a, 0x26, 0x05, 0x91, 0x05, 0xcf, 0x4d, 0xe6, 0xe4, 0x17, 0xf0, 0xe7, 0xa4, 0x96,
  803. 0x4c, 0x6d, 0x76, 0x91, 0xa1, 0x8f, 0x01, 0xaa, 0x5a, 0xfc, 0x4e, 0x57, 0x72, 0xc1, 0xb2, 0x70,
  804. 0x14, 0xb9, 0x53, 0x0f, 0x7b, 0x36, 0x72, 0x91, 0xa1, 0x4f, 0x20, 0xe0, 0xa4, 0xa4, 0x4d, 0x45,
  805. 0x56, 0x54, 0x01, 0x3b, 0x1a, 0xf0, 0x87, 0xd8, 0x45, 0x76, 0xf2, 0x8f, 0x0b, 0xe3, 0x4b, 0xda,
  806. 0xa1, 0x67, 0x10, 0x54, 0x7d, 0x61, 0x85, 0xba, 0x91, 0x3b, 0xf5, 0xcf, 0xa2, 0x78, 0x4b, 0xef,
  807. 0xf1, 0x2d, 0x07, 0xd8, 0xaf, 0x6e, 0xd9, 0x79, 0x0c, 0x3b, 0x15, 0x91, 0xaf, 0xc2, 0x51, 0x34,
  808. 0x9e, 0xfa, 0x67, 0x9f, 0x6d, 0x15, 0x5f, 0xd2, 0x2e, 0x9e, 0x13, 0xf9, 0xea, 0xbc, 0xa0, 0x25,
  809. 0xe5, 0x12, 0x6b, 0xc5, 0xd1, 0x0b, 0xd5, 0xd7, 0x10, 0x44, 0x08, 0x76, 0xd6, 0x8c, 0x1b, 0x17,
  810. 0x1e, 0xd6, 0xdf, 0xe8, 0x01, 0x8c, 0x6c, 0x8f, 0xe3, 0xd4, 0xc1, 0x23, 0x96, 0xa1, 0x87, 0xb0,
  811. 0xa3, 0x5a, 0x09, 0xc7, 0x8a, 0x4a, 0x1d, 0xac, 0x57, 0x33, 0x0f, 0xee, 0xb1, 0x6c, 0xa1, 0x8e,
  812. 0xee, 0xe4, 0x29, 0xc0, 0xf7, 0x75, 0x4d, 0xba, 0x2b, 0x52, 0xb4, 0x14, 0x9d, 0xc1, 0xee, 0x8d,
  813. 0xfa, 0x68, 0x42, 0x57, 0xfb, 0x3b, 0xda, 0xea, 0x4f, 0xb3, 0xd8, 0x92, 0x27, 0x7f, 0x4c, 0x60,
  814. 0x62, 0xd4, 0x4f, 0x00, 0x78, 0x5b, 0x14, 0x0b, 0x9d, 0x08, 0xfd, 0xc8, 0x9d, 0xee, 0x6f, 0x2a,
  815. 0xf4, 0x37, 0x19, 0xff, 0xdc, 0x16, 0x85, 0xe6, 0x53, 0x07, 0x7b, 0xbc, 0x5f, 0xa0, 0xcf, 0xe1,
  816. 0xfe, 0x52, 0x88, 0x82, 0x12, 0x6e, 0xf5, 0xaa, 0xb1, 0xbd, 0xd4, 0xc1, 0x81, 0x0d, 0x0f, 0x18,
  817. 0xe3, 0x92, 0xe6, 0xb4, 0xb6, 0x58, 0xdf, 0x6d, 0x60, 0xc3, 0x06, 0xfb, 0x14, 0x82, 0x4c, 0xb4,
  818. 0xcb, 0x82, 0x5a, 0x4a, 0xf5, 0xef, 0xa6, 0x0e, 0xf6, 0x4d, 0xd4, 0x40, 0xe7, 0x70, 0x30, 0x8c,
  819. 0x95, 0xe5, 0x40, 0xdf, 0xe9, 0xdb, 0xa6, 0x5f, 0xf4, 0x5c, 0xea, 0xe0, 0xfd, 0x41, 0x64, 0xca,
  820. 0x7c, 0x0d, 0xde, 0x9a, 0x76, 0xb6, 0xc0, 0x44, 0x17, 0x08, 0xdf, 0x75, 0xaf, 0xa9, 0x83, 0xf7,
  821. 0xd6, 0xb4, 0x1b, 0x4c, 0x36, 0xb2, 0x66, 0x3c, 0xb7, 0xda, 0xf7, 0xec, 0x25, 0xf9, 0x26, 0x6a,
  822. 0xa0, 0x63, 0x80, 0x65, 0x21, 0x96, 0x16, 0x41, 0x91, 0x3b, 0x0d, 0xd4, 0xc1, 0xa9, 0x98, 0x01,
  823. 0xbe, 0x83, 0x83, 0x9c, 0x8a, 0x45, 0x25, 0x18, 0x97, 0x96, 0xda, 0xd3, 0x26, 0x0e, 0x7b, 0x13,
  824. 0xea, 0xa2, 0xe3, 0xe7, 0x44, 0x3e, 0xe7, 0x79, 0xea, 0xe0, 0xfb, 0x39, 0x15, 0x73, 0x05, 0x1b,
  825. 0xf9, 0x53, 0x08, 0xcc, 0x53, 0xb6, 0xda, 0x5d, 0xad, 0xfd, 0x70, 0x6b, 0x03, 0xe7, 0x1a, 0x54,
  826. 0x0e, 0x8d, 0xc4, 0x54, 0x98, 0x81, 0x4f, 0xd4, 0x08, 0xd9, 0x02, 0x9e, 0x2e, 0x70, 0xbc, 0xb5,
  827. 0xc0, 0x66, 0xd4, 0x52, 0x07, 0x03, 0xd9, 0x0c, 0x5e, 0x08, 0xf7, 0x4a, 0x4a, 0x38, 0xe3, 0x79,
  828. 0xb8, 0x1f, 0xb9, 0xd3, 0x09, 0xee, 0x97, 0xe8, 0x11, 0x3c, 0xa4, 0xaf, 0x57, 0x45, 0x9b, 0xd1,
  829. 0xc5, 0xcb, 0x5a, 0x94, 0x0b, 0xc6, 0x33, 0xfa, 0x9a, 0x36, 0xe1, 0xa1, 0x1a, 0x0f, 0x8c, 0x6c,
  830. 0xee, 0xc7, 0x5a, 0x94, 0x17, 0x26, 0x33, 0x0b, 0x00, 0xb4, 0x13, 0x33, 0xe0, 0xff, 0xba, 0xb0,
  831. 0x6b, 0x7c, 0xa3, 0x2f, 0x60, 0xbc, 0xa6, 0x9d, 0x7d, 0xb7, 0xef, 0xbc, 0x22, 0xac, 0x20, 0x74,
  832. 0xa9, 0x7f, 0x1b, 0x15, 0xad, 0x25, 0xa3, 0x4d, 0x38, 0xd6, 0xaf, 0xe1, 0xcb, 0x3b, 0x0e, 0x25,
  833. 0x9e, 0x0f, 0xf4, 0x39, 0x97, 0x75, 0x87, 0x6f, 0xc9, 0x8f, 0x7e, 0x85, 0x83, 0x37, 0xd2, 0xe8,
  834. 0xc1, 0xc6, 0x8b, 0x67, 0x76, 0x7c, 0x04, 0x93, 0xcd, 0x44, 0xdf, 0xfd, 0xf4, 0x0c, 0xf8, 0xcd,
  835. 0xe8, 0xb1, 0x3b, 0xfb, 0xd3, 0x85, 0xf7, 0x57, 0xa2, 0xdc, 0x06, 0xcf, 0x7c, 0x63, 0x6d, 0xae,
  836. 0x86, 0x78, 0xee, 0xfe, 0xf6, 0xad, 0x65, 0x72, 0x51, 0x10, 0x9e, 0xc7, 0xa2, 0xce, 0x93, 0x9c,
  837. 0x72, 0x3d, 0xe2, 0x89, 0x49, 0x91, 0x8a, 0x35, 0xff, 0xfb, 0xcb, 0x3f, 0x19, 0x16, 0x7f, 0x8d,
  838. 0x3e, 0xf8, 0xc9, 0xc8, 0x9f, 0x15, 0xa2, 0xcd, 0xe2, 0x1f, 0x86, 0x8d, 0xae, 0x4e, 0xff, 0xee,
  839. 0x73, 0xd7, 0x3a, 0x77, 0x3d, 0xe4, 0xae, 0xaf, 0x4e, 0x97, 0xbb, 0x7a, 0x83, 0xaf, 0xfe, 0x0b,
  840. 0x00, 0x00, 0xff, 0xff, 0xf3, 0xdd, 0x11, 0x96, 0x45, 0x06, 0x00, 0x00,
  841. }