/
firestore.pb.go
3749 lines (3374 loc) · 134 KB
/
firestore.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/firestore/v1beta1/firestore.proto
package firestore
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
empty "github.com/golang/protobuf/ptypes/empty"
timestamp "github.com/golang/protobuf/ptypes/timestamp"
_ "google.golang.org/genproto/googleapis/api/annotations"
status "google.golang.org/genproto/googleapis/rpc/status"
grpc "google.golang.org/grpc"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
// The type of change.
type TargetChange_TargetChangeType int32
const (
// No change has occurred. Used only to send an updated `resume_token`.
TargetChange_NO_CHANGE TargetChange_TargetChangeType = 0
// The targets have been added.
TargetChange_ADD TargetChange_TargetChangeType = 1
// The targets have been removed.
TargetChange_REMOVE TargetChange_TargetChangeType = 2
// The targets reflect all changes committed before the targets were added
// to the stream.
//
// This will be sent after or with a `read_time` that is greater than or
// equal to the time at which the targets were added.
//
// Listeners can wait for this change if read-after-write semantics
// are desired.
TargetChange_CURRENT TargetChange_TargetChangeType = 3
// The targets have been reset, and a new initial state for the targets
// will be returned in subsequent changes.
//
// After the initial state is complete, `CURRENT` will be returned even
// if the target was previously indicated to be `CURRENT`.
TargetChange_RESET TargetChange_TargetChangeType = 4
)
var TargetChange_TargetChangeType_name = map[int32]string{
0: "NO_CHANGE",
1: "ADD",
2: "REMOVE",
3: "CURRENT",
4: "RESET",
}
var TargetChange_TargetChangeType_value = map[string]int32{
"NO_CHANGE": 0,
"ADD": 1,
"REMOVE": 2,
"CURRENT": 3,
"RESET": 4,
}
func (x TargetChange_TargetChangeType) String() string {
return proto.EnumName(TargetChange_TargetChangeType_name, int32(x))
}
func (TargetChange_TargetChangeType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_9bc8b30a28454f4b, []int{20, 0}
}
// The request for [Firestore.GetDocument][google.firestore.v1beta1.Firestore.GetDocument].
type GetDocumentRequest struct {
// The resource name of the Document to get. In the format:
// `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// The fields to return. If not set, returns all fields.
//
// If the document has a field that is not present in this mask, that field
// will not be returned in the response.
Mask *DocumentMask `protobuf:"bytes,2,opt,name=mask,proto3" json:"mask,omitempty"`
// The consistency mode for this transaction.
// If not set, defaults to strong consistency.
//
// Types that are valid to be assigned to ConsistencySelector:
// *GetDocumentRequest_Transaction
// *GetDocumentRequest_ReadTime
ConsistencySelector isGetDocumentRequest_ConsistencySelector `protobuf_oneof:"consistency_selector"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetDocumentRequest) Reset() { *m = GetDocumentRequest{} }
func (m *GetDocumentRequest) String() string { return proto.CompactTextString(m) }
func (*GetDocumentRequest) ProtoMessage() {}
func (*GetDocumentRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_9bc8b30a28454f4b, []int{0}
}
func (m *GetDocumentRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetDocumentRequest.Unmarshal(m, b)
}
func (m *GetDocumentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetDocumentRequest.Marshal(b, m, deterministic)
}
func (m *GetDocumentRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetDocumentRequest.Merge(m, src)
}
func (m *GetDocumentRequest) XXX_Size() int {
return xxx_messageInfo_GetDocumentRequest.Size(m)
}
func (m *GetDocumentRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetDocumentRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetDocumentRequest proto.InternalMessageInfo
func (m *GetDocumentRequest) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *GetDocumentRequest) GetMask() *DocumentMask {
if m != nil {
return m.Mask
}
return nil
}
type isGetDocumentRequest_ConsistencySelector interface {
isGetDocumentRequest_ConsistencySelector()
}
type GetDocumentRequest_Transaction struct {
Transaction []byte `protobuf:"bytes,3,opt,name=transaction,proto3,oneof"`
}
type GetDocumentRequest_ReadTime struct {
ReadTime *timestamp.Timestamp `protobuf:"bytes,5,opt,name=read_time,json=readTime,proto3,oneof"`
}
func (*GetDocumentRequest_Transaction) isGetDocumentRequest_ConsistencySelector() {}
func (*GetDocumentRequest_ReadTime) isGetDocumentRequest_ConsistencySelector() {}
func (m *GetDocumentRequest) GetConsistencySelector() isGetDocumentRequest_ConsistencySelector {
if m != nil {
return m.ConsistencySelector
}
return nil
}
func (m *GetDocumentRequest) GetTransaction() []byte {
if x, ok := m.GetConsistencySelector().(*GetDocumentRequest_Transaction); ok {
return x.Transaction
}
return nil
}
func (m *GetDocumentRequest) GetReadTime() *timestamp.Timestamp {
if x, ok := m.GetConsistencySelector().(*GetDocumentRequest_ReadTime); ok {
return x.ReadTime
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*GetDocumentRequest) 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{}) {
return _GetDocumentRequest_OneofMarshaler, _GetDocumentRequest_OneofUnmarshaler, _GetDocumentRequest_OneofSizer, []interface{}{
(*GetDocumentRequest_Transaction)(nil),
(*GetDocumentRequest_ReadTime)(nil),
}
}
func _GetDocumentRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*GetDocumentRequest)
// consistency_selector
switch x := m.ConsistencySelector.(type) {
case *GetDocumentRequest_Transaction:
b.EncodeVarint(3<<3 | proto.WireBytes)
b.EncodeRawBytes(x.Transaction)
case *GetDocumentRequest_ReadTime:
b.EncodeVarint(5<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.ReadTime); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("GetDocumentRequest.ConsistencySelector has unexpected type %T", x)
}
return nil
}
func _GetDocumentRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*GetDocumentRequest)
switch tag {
case 3: // consistency_selector.transaction
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeRawBytes(true)
m.ConsistencySelector = &GetDocumentRequest_Transaction{x}
return true, err
case 5: // consistency_selector.read_time
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(timestamp.Timestamp)
err := b.DecodeMessage(msg)
m.ConsistencySelector = &GetDocumentRequest_ReadTime{msg}
return true, err
default:
return false, nil
}
}
func _GetDocumentRequest_OneofSizer(msg proto.Message) (n int) {
m := msg.(*GetDocumentRequest)
// consistency_selector
switch x := m.ConsistencySelector.(type) {
case *GetDocumentRequest_Transaction:
n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.Transaction)))
n += len(x.Transaction)
case *GetDocumentRequest_ReadTime:
s := proto.Size(x.ReadTime)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// The request for [Firestore.ListDocuments][google.firestore.v1beta1.Firestore.ListDocuments].
type ListDocumentsRequest struct {
// The parent resource name. In the format:
// `projects/{project_id}/databases/{database_id}/documents` or
// `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
// For example:
// `projects/my-project/databases/my-database/documents` or
// `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// The collection ID, relative to `parent`, to list. For example: `chatrooms`
// or `messages`.
CollectionId string `protobuf:"bytes,2,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"`
// The maximum number of documents to return.
PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// The `next_page_token` value returned from a previous List request, if any.
PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
// The order to sort results by. For example: `priority desc, name`.
OrderBy string `protobuf:"bytes,6,opt,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"`
// The fields to return. If not set, returns all fields.
//
// If a document has a field that is not present in this mask, that field
// will not be returned in the response.
Mask *DocumentMask `protobuf:"bytes,7,opt,name=mask,proto3" json:"mask,omitempty"`
// The consistency mode for this transaction.
// If not set, defaults to strong consistency.
//
// Types that are valid to be assigned to ConsistencySelector:
// *ListDocumentsRequest_Transaction
// *ListDocumentsRequest_ReadTime
ConsistencySelector isListDocumentsRequest_ConsistencySelector `protobuf_oneof:"consistency_selector"`
// If the list should show missing documents. A missing document is a
// document that does not exist but has sub-documents. These documents will
// be returned with a key but will not have fields, [Document.create_time][google.firestore.v1beta1.Document.create_time],
// or [Document.update_time][google.firestore.v1beta1.Document.update_time] set.
//
// Requests with `show_missing` may not specify `where` or
// `order_by`.
ShowMissing bool `protobuf:"varint,12,opt,name=show_missing,json=showMissing,proto3" json:"show_missing,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ListDocumentsRequest) Reset() { *m = ListDocumentsRequest{} }
func (m *ListDocumentsRequest) String() string { return proto.CompactTextString(m) }
func (*ListDocumentsRequest) ProtoMessage() {}
func (*ListDocumentsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_9bc8b30a28454f4b, []int{1}
}
func (m *ListDocumentsRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ListDocumentsRequest.Unmarshal(m, b)
}
func (m *ListDocumentsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ListDocumentsRequest.Marshal(b, m, deterministic)
}
func (m *ListDocumentsRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListDocumentsRequest.Merge(m, src)
}
func (m *ListDocumentsRequest) XXX_Size() int {
return xxx_messageInfo_ListDocumentsRequest.Size(m)
}
func (m *ListDocumentsRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ListDocumentsRequest.DiscardUnknown(m)
}
var xxx_messageInfo_ListDocumentsRequest proto.InternalMessageInfo
func (m *ListDocumentsRequest) GetParent() string {
if m != nil {
return m.Parent
}
return ""
}
func (m *ListDocumentsRequest) GetCollectionId() string {
if m != nil {
return m.CollectionId
}
return ""
}
func (m *ListDocumentsRequest) GetPageSize() int32 {
if m != nil {
return m.PageSize
}
return 0
}
func (m *ListDocumentsRequest) GetPageToken() string {
if m != nil {
return m.PageToken
}
return ""
}
func (m *ListDocumentsRequest) GetOrderBy() string {
if m != nil {
return m.OrderBy
}
return ""
}
func (m *ListDocumentsRequest) GetMask() *DocumentMask {
if m != nil {
return m.Mask
}
return nil
}
type isListDocumentsRequest_ConsistencySelector interface {
isListDocumentsRequest_ConsistencySelector()
}
type ListDocumentsRequest_Transaction struct {
Transaction []byte `protobuf:"bytes,8,opt,name=transaction,proto3,oneof"`
}
type ListDocumentsRequest_ReadTime struct {
ReadTime *timestamp.Timestamp `protobuf:"bytes,10,opt,name=read_time,json=readTime,proto3,oneof"`
}
func (*ListDocumentsRequest_Transaction) isListDocumentsRequest_ConsistencySelector() {}
func (*ListDocumentsRequest_ReadTime) isListDocumentsRequest_ConsistencySelector() {}
func (m *ListDocumentsRequest) GetConsistencySelector() isListDocumentsRequest_ConsistencySelector {
if m != nil {
return m.ConsistencySelector
}
return nil
}
func (m *ListDocumentsRequest) GetTransaction() []byte {
if x, ok := m.GetConsistencySelector().(*ListDocumentsRequest_Transaction); ok {
return x.Transaction
}
return nil
}
func (m *ListDocumentsRequest) GetReadTime() *timestamp.Timestamp {
if x, ok := m.GetConsistencySelector().(*ListDocumentsRequest_ReadTime); ok {
return x.ReadTime
}
return nil
}
func (m *ListDocumentsRequest) GetShowMissing() bool {
if m != nil {
return m.ShowMissing
}
return false
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*ListDocumentsRequest) 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{}) {
return _ListDocumentsRequest_OneofMarshaler, _ListDocumentsRequest_OneofUnmarshaler, _ListDocumentsRequest_OneofSizer, []interface{}{
(*ListDocumentsRequest_Transaction)(nil),
(*ListDocumentsRequest_ReadTime)(nil),
}
}
func _ListDocumentsRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*ListDocumentsRequest)
// consistency_selector
switch x := m.ConsistencySelector.(type) {
case *ListDocumentsRequest_Transaction:
b.EncodeVarint(8<<3 | proto.WireBytes)
b.EncodeRawBytes(x.Transaction)
case *ListDocumentsRequest_ReadTime:
b.EncodeVarint(10<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.ReadTime); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("ListDocumentsRequest.ConsistencySelector has unexpected type %T", x)
}
return nil
}
func _ListDocumentsRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*ListDocumentsRequest)
switch tag {
case 8: // consistency_selector.transaction
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeRawBytes(true)
m.ConsistencySelector = &ListDocumentsRequest_Transaction{x}
return true, err
case 10: // consistency_selector.read_time
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(timestamp.Timestamp)
err := b.DecodeMessage(msg)
m.ConsistencySelector = &ListDocumentsRequest_ReadTime{msg}
return true, err
default:
return false, nil
}
}
func _ListDocumentsRequest_OneofSizer(msg proto.Message) (n int) {
m := msg.(*ListDocumentsRequest)
// consistency_selector
switch x := m.ConsistencySelector.(type) {
case *ListDocumentsRequest_Transaction:
n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.Transaction)))
n += len(x.Transaction)
case *ListDocumentsRequest_ReadTime:
s := proto.Size(x.ReadTime)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// The response for [Firestore.ListDocuments][google.firestore.v1beta1.Firestore.ListDocuments].
type ListDocumentsResponse struct {
// The Documents found.
Documents []*Document `protobuf:"bytes,1,rep,name=documents,proto3" json:"documents,omitempty"`
// The next page token.
NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ListDocumentsResponse) Reset() { *m = ListDocumentsResponse{} }
func (m *ListDocumentsResponse) String() string { return proto.CompactTextString(m) }
func (*ListDocumentsResponse) ProtoMessage() {}
func (*ListDocumentsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_9bc8b30a28454f4b, []int{2}
}
func (m *ListDocumentsResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ListDocumentsResponse.Unmarshal(m, b)
}
func (m *ListDocumentsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ListDocumentsResponse.Marshal(b, m, deterministic)
}
func (m *ListDocumentsResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListDocumentsResponse.Merge(m, src)
}
func (m *ListDocumentsResponse) XXX_Size() int {
return xxx_messageInfo_ListDocumentsResponse.Size(m)
}
func (m *ListDocumentsResponse) XXX_DiscardUnknown() {
xxx_messageInfo_ListDocumentsResponse.DiscardUnknown(m)
}
var xxx_messageInfo_ListDocumentsResponse proto.InternalMessageInfo
func (m *ListDocumentsResponse) GetDocuments() []*Document {
if m != nil {
return m.Documents
}
return nil
}
func (m *ListDocumentsResponse) GetNextPageToken() string {
if m != nil {
return m.NextPageToken
}
return ""
}
// The request for [Firestore.CreateDocument][google.firestore.v1beta1.Firestore.CreateDocument].
type CreateDocumentRequest struct {
// The parent resource. For example:
// `projects/{project_id}/databases/{database_id}/documents` or
// `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`
Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
// The collection ID, relative to `parent`, to list. For example: `chatrooms`.
CollectionId string `protobuf:"bytes,2,opt,name=collection_id,json=collectionId,proto3" json:"collection_id,omitempty"`
// The client-assigned document ID to use for this document.
//
// Optional. If not specified, an ID will be assigned by the service.
DocumentId string `protobuf:"bytes,3,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"`
// The document to create. `name` must not be set.
Document *Document `protobuf:"bytes,4,opt,name=document,proto3" json:"document,omitempty"`
// The fields to return. If not set, returns all fields.
//
// If the document has a field that is not present in this mask, that field
// will not be returned in the response.
Mask *DocumentMask `protobuf:"bytes,5,opt,name=mask,proto3" json:"mask,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateDocumentRequest) Reset() { *m = CreateDocumentRequest{} }
func (m *CreateDocumentRequest) String() string { return proto.CompactTextString(m) }
func (*CreateDocumentRequest) ProtoMessage() {}
func (*CreateDocumentRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_9bc8b30a28454f4b, []int{3}
}
func (m *CreateDocumentRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateDocumentRequest.Unmarshal(m, b)
}
func (m *CreateDocumentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateDocumentRequest.Marshal(b, m, deterministic)
}
func (m *CreateDocumentRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateDocumentRequest.Merge(m, src)
}
func (m *CreateDocumentRequest) XXX_Size() int {
return xxx_messageInfo_CreateDocumentRequest.Size(m)
}
func (m *CreateDocumentRequest) XXX_DiscardUnknown() {
xxx_messageInfo_CreateDocumentRequest.DiscardUnknown(m)
}
var xxx_messageInfo_CreateDocumentRequest proto.InternalMessageInfo
func (m *CreateDocumentRequest) GetParent() string {
if m != nil {
return m.Parent
}
return ""
}
func (m *CreateDocumentRequest) GetCollectionId() string {
if m != nil {
return m.CollectionId
}
return ""
}
func (m *CreateDocumentRequest) GetDocumentId() string {
if m != nil {
return m.DocumentId
}
return ""
}
func (m *CreateDocumentRequest) GetDocument() *Document {
if m != nil {
return m.Document
}
return nil
}
func (m *CreateDocumentRequest) GetMask() *DocumentMask {
if m != nil {
return m.Mask
}
return nil
}
// The request for [Firestore.UpdateDocument][google.firestore.v1beta1.Firestore.UpdateDocument].
type UpdateDocumentRequest struct {
// The updated document.
// Creates the document if it does not already exist.
Document *Document `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"`
// The fields to update.
// None of the field paths in the mask may contain a reserved name.
//
// If the document exists on the server and has fields not referenced in the
// mask, they are left unchanged.
// Fields referenced in the mask, but not present in the input document, are
// deleted from the document on the server.
UpdateMask *DocumentMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
// The fields to return. If not set, returns all fields.
//
// If the document has a field that is not present in this mask, that field
// will not be returned in the response.
Mask *DocumentMask `protobuf:"bytes,3,opt,name=mask,proto3" json:"mask,omitempty"`
// An optional precondition on the document.
// The request will fail if this is set and not met by the target document.
CurrentDocument *Precondition `protobuf:"bytes,4,opt,name=current_document,json=currentDocument,proto3" json:"current_document,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *UpdateDocumentRequest) Reset() { *m = UpdateDocumentRequest{} }
func (m *UpdateDocumentRequest) String() string { return proto.CompactTextString(m) }
func (*UpdateDocumentRequest) ProtoMessage() {}
func (*UpdateDocumentRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_9bc8b30a28454f4b, []int{4}
}
func (m *UpdateDocumentRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_UpdateDocumentRequest.Unmarshal(m, b)
}
func (m *UpdateDocumentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_UpdateDocumentRequest.Marshal(b, m, deterministic)
}
func (m *UpdateDocumentRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_UpdateDocumentRequest.Merge(m, src)
}
func (m *UpdateDocumentRequest) XXX_Size() int {
return xxx_messageInfo_UpdateDocumentRequest.Size(m)
}
func (m *UpdateDocumentRequest) XXX_DiscardUnknown() {
xxx_messageInfo_UpdateDocumentRequest.DiscardUnknown(m)
}
var xxx_messageInfo_UpdateDocumentRequest proto.InternalMessageInfo
func (m *UpdateDocumentRequest) GetDocument() *Document {
if m != nil {
return m.Document
}
return nil
}
func (m *UpdateDocumentRequest) GetUpdateMask() *DocumentMask {
if m != nil {
return m.UpdateMask
}
return nil
}
func (m *UpdateDocumentRequest) GetMask() *DocumentMask {
if m != nil {
return m.Mask
}
return nil
}
func (m *UpdateDocumentRequest) GetCurrentDocument() *Precondition {
if m != nil {
return m.CurrentDocument
}
return nil
}
// The request for [Firestore.DeleteDocument][google.firestore.v1beta1.Firestore.DeleteDocument].
type DeleteDocumentRequest struct {
// The resource name of the Document to delete. In the format:
// `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// An optional precondition on the document.
// The request will fail if this is set and not met by the target document.
CurrentDocument *Precondition `protobuf:"bytes,2,opt,name=current_document,json=currentDocument,proto3" json:"current_document,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DeleteDocumentRequest) Reset() { *m = DeleteDocumentRequest{} }
func (m *DeleteDocumentRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteDocumentRequest) ProtoMessage() {}
func (*DeleteDocumentRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_9bc8b30a28454f4b, []int{5}
}
func (m *DeleteDocumentRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeleteDocumentRequest.Unmarshal(m, b)
}
func (m *DeleteDocumentRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DeleteDocumentRequest.Marshal(b, m, deterministic)
}
func (m *DeleteDocumentRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_DeleteDocumentRequest.Merge(m, src)
}
func (m *DeleteDocumentRequest) XXX_Size() int {
return xxx_messageInfo_DeleteDocumentRequest.Size(m)
}
func (m *DeleteDocumentRequest) XXX_DiscardUnknown() {
xxx_messageInfo_DeleteDocumentRequest.DiscardUnknown(m)
}
var xxx_messageInfo_DeleteDocumentRequest proto.InternalMessageInfo
func (m *DeleteDocumentRequest) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *DeleteDocumentRequest) GetCurrentDocument() *Precondition {
if m != nil {
return m.CurrentDocument
}
return nil
}
// The request for [Firestore.BatchGetDocuments][google.firestore.v1beta1.Firestore.BatchGetDocuments].
type BatchGetDocumentsRequest struct {
// The database name. In the format:
// `projects/{project_id}/databases/{database_id}`.
Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"`
// The names of the documents to retrieve. In the format:
// `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
// The request will fail if any of the document is not a child resource of the
// given `database`. Duplicate names will be elided.
Documents []string `protobuf:"bytes,2,rep,name=documents,proto3" json:"documents,omitempty"`
// The fields to return. If not set, returns all fields.
//
// If a document has a field that is not present in this mask, that field will
// not be returned in the response.
Mask *DocumentMask `protobuf:"bytes,3,opt,name=mask,proto3" json:"mask,omitempty"`
// The consistency mode for this transaction.
// If not set, defaults to strong consistency.
//
// Types that are valid to be assigned to ConsistencySelector:
// *BatchGetDocumentsRequest_Transaction
// *BatchGetDocumentsRequest_NewTransaction
// *BatchGetDocumentsRequest_ReadTime
ConsistencySelector isBatchGetDocumentsRequest_ConsistencySelector `protobuf_oneof:"consistency_selector"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BatchGetDocumentsRequest) Reset() { *m = BatchGetDocumentsRequest{} }
func (m *BatchGetDocumentsRequest) String() string { return proto.CompactTextString(m) }
func (*BatchGetDocumentsRequest) ProtoMessage() {}
func (*BatchGetDocumentsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_9bc8b30a28454f4b, []int{6}
}
func (m *BatchGetDocumentsRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BatchGetDocumentsRequest.Unmarshal(m, b)
}
func (m *BatchGetDocumentsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BatchGetDocumentsRequest.Marshal(b, m, deterministic)
}
func (m *BatchGetDocumentsRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_BatchGetDocumentsRequest.Merge(m, src)
}
func (m *BatchGetDocumentsRequest) XXX_Size() int {
return xxx_messageInfo_BatchGetDocumentsRequest.Size(m)
}
func (m *BatchGetDocumentsRequest) XXX_DiscardUnknown() {
xxx_messageInfo_BatchGetDocumentsRequest.DiscardUnknown(m)
}
var xxx_messageInfo_BatchGetDocumentsRequest proto.InternalMessageInfo
func (m *BatchGetDocumentsRequest) GetDatabase() string {
if m != nil {
return m.Database
}
return ""
}
func (m *BatchGetDocumentsRequest) GetDocuments() []string {
if m != nil {
return m.Documents
}
return nil
}
func (m *BatchGetDocumentsRequest) GetMask() *DocumentMask {
if m != nil {
return m.Mask
}
return nil
}
type isBatchGetDocumentsRequest_ConsistencySelector interface {
isBatchGetDocumentsRequest_ConsistencySelector()
}
type BatchGetDocumentsRequest_Transaction struct {
Transaction []byte `protobuf:"bytes,4,opt,name=transaction,proto3,oneof"`
}
type BatchGetDocumentsRequest_NewTransaction struct {
NewTransaction *TransactionOptions `protobuf:"bytes,5,opt,name=new_transaction,json=newTransaction,proto3,oneof"`
}
type BatchGetDocumentsRequest_ReadTime struct {
ReadTime *timestamp.Timestamp `protobuf:"bytes,7,opt,name=read_time,json=readTime,proto3,oneof"`
}
func (*BatchGetDocumentsRequest_Transaction) isBatchGetDocumentsRequest_ConsistencySelector() {}
func (*BatchGetDocumentsRequest_NewTransaction) isBatchGetDocumentsRequest_ConsistencySelector() {}
func (*BatchGetDocumentsRequest_ReadTime) isBatchGetDocumentsRequest_ConsistencySelector() {}
func (m *BatchGetDocumentsRequest) GetConsistencySelector() isBatchGetDocumentsRequest_ConsistencySelector {
if m != nil {
return m.ConsistencySelector
}
return nil
}
func (m *BatchGetDocumentsRequest) GetTransaction() []byte {
if x, ok := m.GetConsistencySelector().(*BatchGetDocumentsRequest_Transaction); ok {
return x.Transaction
}
return nil
}
func (m *BatchGetDocumentsRequest) GetNewTransaction() *TransactionOptions {
if x, ok := m.GetConsistencySelector().(*BatchGetDocumentsRequest_NewTransaction); ok {
return x.NewTransaction
}
return nil
}
func (m *BatchGetDocumentsRequest) GetReadTime() *timestamp.Timestamp {
if x, ok := m.GetConsistencySelector().(*BatchGetDocumentsRequest_ReadTime); ok {
return x.ReadTime
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*BatchGetDocumentsRequest) 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{}) {
return _BatchGetDocumentsRequest_OneofMarshaler, _BatchGetDocumentsRequest_OneofUnmarshaler, _BatchGetDocumentsRequest_OneofSizer, []interface{}{
(*BatchGetDocumentsRequest_Transaction)(nil),
(*BatchGetDocumentsRequest_NewTransaction)(nil),
(*BatchGetDocumentsRequest_ReadTime)(nil),
}
}
func _BatchGetDocumentsRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*BatchGetDocumentsRequest)
// consistency_selector
switch x := m.ConsistencySelector.(type) {
case *BatchGetDocumentsRequest_Transaction:
b.EncodeVarint(4<<3 | proto.WireBytes)
b.EncodeRawBytes(x.Transaction)
case *BatchGetDocumentsRequest_NewTransaction:
b.EncodeVarint(5<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.NewTransaction); err != nil {
return err
}
case *BatchGetDocumentsRequest_ReadTime:
b.EncodeVarint(7<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.ReadTime); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("BatchGetDocumentsRequest.ConsistencySelector has unexpected type %T", x)
}
return nil
}
func _BatchGetDocumentsRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*BatchGetDocumentsRequest)
switch tag {
case 4: // consistency_selector.transaction
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeRawBytes(true)
m.ConsistencySelector = &BatchGetDocumentsRequest_Transaction{x}
return true, err
case 5: // consistency_selector.new_transaction
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(TransactionOptions)
err := b.DecodeMessage(msg)
m.ConsistencySelector = &BatchGetDocumentsRequest_NewTransaction{msg}
return true, err
case 7: // consistency_selector.read_time
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(timestamp.Timestamp)
err := b.DecodeMessage(msg)
m.ConsistencySelector = &BatchGetDocumentsRequest_ReadTime{msg}
return true, err
default:
return false, nil
}
}
func _BatchGetDocumentsRequest_OneofSizer(msg proto.Message) (n int) {
m := msg.(*BatchGetDocumentsRequest)
// consistency_selector
switch x := m.ConsistencySelector.(type) {
case *BatchGetDocumentsRequest_Transaction:
n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.Transaction)))
n += len(x.Transaction)
case *BatchGetDocumentsRequest_NewTransaction:
s := proto.Size(x.NewTransaction)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *BatchGetDocumentsRequest_ReadTime:
s := proto.Size(x.ReadTime)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// The streamed response for [Firestore.BatchGetDocuments][google.firestore.v1beta1.Firestore.BatchGetDocuments].
type BatchGetDocumentsResponse struct {
// A single result.
// This can be empty if the server is just returning a transaction.
//
// Types that are valid to be assigned to Result:
// *BatchGetDocumentsResponse_Found
// *BatchGetDocumentsResponse_Missing
Result isBatchGetDocumentsResponse_Result `protobuf_oneof:"result"`
// The transaction that was started as part of this request.
// Will only be set in the first response, and only if
// [BatchGetDocumentsRequest.new_transaction][google.firestore.v1beta1.BatchGetDocumentsRequest.new_transaction] was set in the request.
Transaction []byte `protobuf:"bytes,3,opt,name=transaction,proto3" json:"transaction,omitempty"`
// The time at which the document was read.
// This may be monotically increasing, in this case the previous documents in
// the result stream are guaranteed not to have changed between their
// read_time and this one.
ReadTime *timestamp.Timestamp `protobuf:"bytes,4,opt,name=read_time,json=readTime,proto3" json:"read_time,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BatchGetDocumentsResponse) Reset() { *m = BatchGetDocumentsResponse{} }
func (m *BatchGetDocumentsResponse) String() string { return proto.CompactTextString(m) }
func (*BatchGetDocumentsResponse) ProtoMessage() {}
func (*BatchGetDocumentsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_9bc8b30a28454f4b, []int{7}
}
func (m *BatchGetDocumentsResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BatchGetDocumentsResponse.Unmarshal(m, b)
}
func (m *BatchGetDocumentsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BatchGetDocumentsResponse.Marshal(b, m, deterministic)
}
func (m *BatchGetDocumentsResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_BatchGetDocumentsResponse.Merge(m, src)
}
func (m *BatchGetDocumentsResponse) XXX_Size() int {
return xxx_messageInfo_BatchGetDocumentsResponse.Size(m)
}
func (m *BatchGetDocumentsResponse) XXX_DiscardUnknown() {
xxx_messageInfo_BatchGetDocumentsResponse.DiscardUnknown(m)
}
var xxx_messageInfo_BatchGetDocumentsResponse proto.InternalMessageInfo
type isBatchGetDocumentsResponse_Result interface {
isBatchGetDocumentsResponse_Result()
}