-
Notifications
You must be signed in to change notification settings - Fork 358
/
Write.cs
2021 lines (1848 loc) · 79.4 KB
/
Write.cs
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
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/firestore/v1/write.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Google.Cloud.Firestore.V1 {
/// <summary>Holder for reflection information generated from google/firestore/v1/write.proto</summary>
public static partial class WriteReflection {
#region Descriptor
/// <summary>File descriptor for google/firestore/v1/write.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static WriteReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Ch9nb29nbGUvZmlyZXN0b3JlL3YxL3dyaXRlLnByb3RvEhNnb29nbGUuZmly",
"ZXN0b3JlLnYxGhxnb29nbGUvYXBpL2Fubm90YXRpb25zLnByb3RvGiBnb29n",
"bGUvZmlyZXN0b3JlL3YxL2NvbW1vbi5wcm90bxoiZ29vZ2xlL2ZpcmVzdG9y",
"ZS92MS9kb2N1bWVudC5wcm90bxofZ29vZ2xlL3Byb3RvYnVmL3RpbWVzdGFt",
"cC5wcm90byKJAgoFV3JpdGUSLwoGdXBkYXRlGAEgASgLMh0uZ29vZ2xlLmZp",
"cmVzdG9yZS52MS5Eb2N1bWVudEgAEhAKBmRlbGV0ZRgCIAEoCUgAEjsKCXRy",
"YW5zZm9ybRgGIAEoCzImLmdvb2dsZS5maXJlc3RvcmUudjEuRG9jdW1lbnRU",
"cmFuc2Zvcm1IABI2Cgt1cGRhdGVfbWFzaxgDIAEoCzIhLmdvb2dsZS5maXJl",
"c3RvcmUudjEuRG9jdW1lbnRNYXNrEjsKEGN1cnJlbnRfZG9jdW1lbnQYBCAB",
"KAsyIS5nb29nbGUuZmlyZXN0b3JlLnYxLlByZWNvbmRpdGlvbkILCglvcGVy",
"YXRpb24i5QQKEURvY3VtZW50VHJhbnNmb3JtEhAKCGRvY3VtZW50GAEgASgJ",
"Ek8KEGZpZWxkX3RyYW5zZm9ybXMYAiADKAsyNS5nb29nbGUuZmlyZXN0b3Jl",
"LnYxLkRvY3VtZW50VHJhbnNmb3JtLkZpZWxkVHJhbnNmb3JtGuwDCg5GaWVs",
"ZFRyYW5zZm9ybRISCgpmaWVsZF9wYXRoGAEgASgJEmAKE3NldF90b19zZXJ2",
"ZXJfdmFsdWUYAiABKA4yQS5nb29nbGUuZmlyZXN0b3JlLnYxLkRvY3VtZW50",
"VHJhbnNmb3JtLkZpZWxkVHJhbnNmb3JtLlNlcnZlclZhbHVlSAASLwoJaW5j",
"cmVtZW50GAMgASgLMhouZ29vZ2xlLmZpcmVzdG9yZS52MS5WYWx1ZUgAEi0K",
"B21heGltdW0YBCABKAsyGi5nb29nbGUuZmlyZXN0b3JlLnYxLlZhbHVlSAAS",
"LQoHbWluaW11bRgFIAEoCzIaLmdvb2dsZS5maXJlc3RvcmUudjEuVmFsdWVI",
"ABJCChdhcHBlbmRfbWlzc2luZ19lbGVtZW50cxgGIAEoCzIfLmdvb2dsZS5m",
"aXJlc3RvcmUudjEuQXJyYXlWYWx1ZUgAEkAKFXJlbW92ZV9hbGxfZnJvbV9h",
"cnJheRgHIAEoCzIfLmdvb2dsZS5maXJlc3RvcmUudjEuQXJyYXlWYWx1ZUgA",
"Ij0KC1NlcnZlclZhbHVlEhwKGFNFUlZFUl9WQUxVRV9VTlNQRUNJRklFRBAA",
"EhAKDFJFUVVFU1RfVElNRRABQhAKDnRyYW5zZm9ybV90eXBlInUKC1dyaXRl",
"UmVzdWx0Ei8KC3VwZGF0ZV90aW1lGAEgASgLMhouZ29vZ2xlLnByb3RvYnVm",
"LlRpbWVzdGFtcBI1ChF0cmFuc2Zvcm1fcmVzdWx0cxgCIAMoCzIaLmdvb2ds",
"ZS5maXJlc3RvcmUudjEuVmFsdWUicQoORG9jdW1lbnRDaGFuZ2USLwoIZG9j",
"dW1lbnQYASABKAsyHS5nb29nbGUuZmlyZXN0b3JlLnYxLkRvY3VtZW50EhIK",
"CnRhcmdldF9pZHMYBSADKAUSGgoScmVtb3ZlZF90YXJnZXRfaWRzGAYgAygF",
"Im0KDkRvY3VtZW50RGVsZXRlEhAKCGRvY3VtZW50GAEgASgJEhoKEnJlbW92",
"ZWRfdGFyZ2V0X2lkcxgGIAMoBRItCglyZWFkX3RpbWUYBCABKAsyGi5nb29n",
"bGUucHJvdG9idWYuVGltZXN0YW1wIm0KDkRvY3VtZW50UmVtb3ZlEhAKCGRv",
"Y3VtZW50GAEgASgJEhoKEnJlbW92ZWRfdGFyZ2V0X2lkcxgCIAMoBRItCgly",
"ZWFkX3RpbWUYBCABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wIjMK",
"D0V4aXN0ZW5jZUZpbHRlchIRCgl0YXJnZXRfaWQYASABKAUSDQoFY291bnQY",
"AiABKAVCpAEKF2NvbS5nb29nbGUuZmlyZXN0b3JlLnYxQgpXcml0ZVByb3Rv",
"UAFaPGdvb2dsZS5nb2xhbmcub3JnL2dlbnByb3RvL2dvb2dsZWFwaXMvZmly",
"ZXN0b3JlL3YxO2ZpcmVzdG9yZaICBEdDRlOqAhlHb29nbGUuQ2xvdWQuRmly",
"ZXN0b3JlLlYxygIZR29vZ2xlXENsb3VkXEZpcmVzdG9yZVxWMWIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Api.AnnotationsReflection.Descriptor, global::Google.Cloud.Firestore.V1.CommonReflection.Descriptor, global::Google.Cloud.Firestore.V1.DocumentReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.TimestampReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.Write), global::Google.Cloud.Firestore.V1.Write.Parser, new[]{ "Update", "Delete", "Transform", "UpdateMask", "CurrentDocument" }, new[]{ "Operation" }, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.DocumentTransform), global::Google.Cloud.Firestore.V1.DocumentTransform.Parser, new[]{ "Document", "FieldTransforms" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.DocumentTransform.Types.FieldTransform), global::Google.Cloud.Firestore.V1.DocumentTransform.Types.FieldTransform.Parser, new[]{ "FieldPath", "SetToServerValue", "Increment", "Maximum", "Minimum", "AppendMissingElements", "RemoveAllFromArray" }, new[]{ "TransformType" }, new[]{ typeof(global::Google.Cloud.Firestore.V1.DocumentTransform.Types.FieldTransform.Types.ServerValue) }, null)}),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.WriteResult), global::Google.Cloud.Firestore.V1.WriteResult.Parser, new[]{ "UpdateTime", "TransformResults" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.DocumentChange), global::Google.Cloud.Firestore.V1.DocumentChange.Parser, new[]{ "Document", "TargetIds", "RemovedTargetIds" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.DocumentDelete), global::Google.Cloud.Firestore.V1.DocumentDelete.Parser, new[]{ "Document", "RemovedTargetIds", "ReadTime" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.DocumentRemove), global::Google.Cloud.Firestore.V1.DocumentRemove.Parser, new[]{ "Document", "RemovedTargetIds", "ReadTime" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Google.Cloud.Firestore.V1.ExistenceFilter), global::Google.Cloud.Firestore.V1.ExistenceFilter.Parser, new[]{ "TargetId", "Count" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// A write on a document.
/// </summary>
public sealed partial class Write : pb::IMessage<Write> {
private static readonly pb::MessageParser<Write> _parser = new pb::MessageParser<Write>(() => new Write());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<Write> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Google.Cloud.Firestore.V1.WriteReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Write() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Write(Write other) : this() {
updateMask_ = other.updateMask_ != null ? other.updateMask_.Clone() : null;
currentDocument_ = other.currentDocument_ != null ? other.currentDocument_.Clone() : null;
switch (other.OperationCase) {
case OperationOneofCase.Update:
Update = other.Update.Clone();
break;
case OperationOneofCase.Delete:
Delete = other.Delete;
break;
case OperationOneofCase.Transform:
Transform = other.Transform.Clone();
break;
}
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public Write Clone() {
return new Write(this);
}
/// <summary>Field number for the "update" field.</summary>
public const int UpdateFieldNumber = 1;
/// <summary>
/// A document to write.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Cloud.Firestore.V1.Document Update {
get { return operationCase_ == OperationOneofCase.Update ? (global::Google.Cloud.Firestore.V1.Document) operation_ : null; }
set {
operation_ = value;
operationCase_ = value == null ? OperationOneofCase.None : OperationOneofCase.Update;
}
}
/// <summary>Field number for the "delete" field.</summary>
public const int DeleteFieldNumber = 2;
/// <summary>
/// A document name to delete. In the format:
/// `projects/{project_id}/databases/{database_id}/documents/{document_path}`.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Delete {
get { return operationCase_ == OperationOneofCase.Delete ? (string) operation_ : ""; }
set {
operation_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
operationCase_ = OperationOneofCase.Delete;
}
}
/// <summary>Field number for the "transform" field.</summary>
public const int TransformFieldNumber = 6;
/// <summary>
/// Applies a transformation to a document.
/// At most one `transform` per document is allowed in a given request.
/// An `update` cannot follow a `transform` on the same document in a given
/// request.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Cloud.Firestore.V1.DocumentTransform Transform {
get { return operationCase_ == OperationOneofCase.Transform ? (global::Google.Cloud.Firestore.V1.DocumentTransform) operation_ : null; }
set {
operation_ = value;
operationCase_ = value == null ? OperationOneofCase.None : OperationOneofCase.Transform;
}
}
/// <summary>Field number for the "update_mask" field.</summary>
public const int UpdateMaskFieldNumber = 3;
private global::Google.Cloud.Firestore.V1.DocumentMask updateMask_;
/// <summary>
/// The fields to update in this write.
///
/// This field can be set only when the operation is `update`.
/// If the mask is not set for an `update` and the document exists, any
/// existing data will be overwritten.
/// If the mask is set and the document on the server has fields not covered by
/// 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.
/// The field paths in this mask must not contain a reserved field name.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Cloud.Firestore.V1.DocumentMask UpdateMask {
get { return updateMask_; }
set {
updateMask_ = value;
}
}
/// <summary>Field number for the "current_document" field.</summary>
public const int CurrentDocumentFieldNumber = 4;
private global::Google.Cloud.Firestore.V1.Precondition currentDocument_;
/// <summary>
/// An optional precondition on the document.
///
/// The write will fail if this is set and not met by the target document.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Cloud.Firestore.V1.Precondition CurrentDocument {
get { return currentDocument_; }
set {
currentDocument_ = value;
}
}
private object operation_;
/// <summary>Enum of possible cases for the "operation" oneof.</summary>
public enum OperationOneofCase {
None = 0,
Update = 1,
Delete = 2,
Transform = 6,
}
private OperationOneofCase operationCase_ = OperationOneofCase.None;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public OperationOneofCase OperationCase {
get { return operationCase_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void ClearOperation() {
operationCase_ = OperationOneofCase.None;
operation_ = null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as Write);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(Write other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (!object.Equals(Update, other.Update)) return false;
if (Delete != other.Delete) return false;
if (!object.Equals(Transform, other.Transform)) return false;
if (!object.Equals(UpdateMask, other.UpdateMask)) return false;
if (!object.Equals(CurrentDocument, other.CurrentDocument)) return false;
if (OperationCase != other.OperationCase) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (operationCase_ == OperationOneofCase.Update) hash ^= Update.GetHashCode();
if (operationCase_ == OperationOneofCase.Delete) hash ^= Delete.GetHashCode();
if (operationCase_ == OperationOneofCase.Transform) hash ^= Transform.GetHashCode();
if (updateMask_ != null) hash ^= UpdateMask.GetHashCode();
if (currentDocument_ != null) hash ^= CurrentDocument.GetHashCode();
hash ^= (int) operationCase_;
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (operationCase_ == OperationOneofCase.Update) {
output.WriteRawTag(10);
output.WriteMessage(Update);
}
if (operationCase_ == OperationOneofCase.Delete) {
output.WriteRawTag(18);
output.WriteString(Delete);
}
if (updateMask_ != null) {
output.WriteRawTag(26);
output.WriteMessage(UpdateMask);
}
if (currentDocument_ != null) {
output.WriteRawTag(34);
output.WriteMessage(CurrentDocument);
}
if (operationCase_ == OperationOneofCase.Transform) {
output.WriteRawTag(50);
output.WriteMessage(Transform);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (operationCase_ == OperationOneofCase.Update) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Update);
}
if (operationCase_ == OperationOneofCase.Delete) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Delete);
}
if (operationCase_ == OperationOneofCase.Transform) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Transform);
}
if (updateMask_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(UpdateMask);
}
if (currentDocument_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(CurrentDocument);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(Write other) {
if (other == null) {
return;
}
if (other.updateMask_ != null) {
if (updateMask_ == null) {
updateMask_ = new global::Google.Cloud.Firestore.V1.DocumentMask();
}
UpdateMask.MergeFrom(other.UpdateMask);
}
if (other.currentDocument_ != null) {
if (currentDocument_ == null) {
currentDocument_ = new global::Google.Cloud.Firestore.V1.Precondition();
}
CurrentDocument.MergeFrom(other.CurrentDocument);
}
switch (other.OperationCase) {
case OperationOneofCase.Update:
if (Update == null) {
Update = new global::Google.Cloud.Firestore.V1.Document();
}
Update.MergeFrom(other.Update);
break;
case OperationOneofCase.Delete:
Delete = other.Delete;
break;
case OperationOneofCase.Transform:
if (Transform == null) {
Transform = new global::Google.Cloud.Firestore.V1.DocumentTransform();
}
Transform.MergeFrom(other.Transform);
break;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
global::Google.Cloud.Firestore.V1.Document subBuilder = new global::Google.Cloud.Firestore.V1.Document();
if (operationCase_ == OperationOneofCase.Update) {
subBuilder.MergeFrom(Update);
}
input.ReadMessage(subBuilder);
Update = subBuilder;
break;
}
case 18: {
Delete = input.ReadString();
break;
}
case 26: {
if (updateMask_ == null) {
updateMask_ = new global::Google.Cloud.Firestore.V1.DocumentMask();
}
input.ReadMessage(updateMask_);
break;
}
case 34: {
if (currentDocument_ == null) {
currentDocument_ = new global::Google.Cloud.Firestore.V1.Precondition();
}
input.ReadMessage(currentDocument_);
break;
}
case 50: {
global::Google.Cloud.Firestore.V1.DocumentTransform subBuilder = new global::Google.Cloud.Firestore.V1.DocumentTransform();
if (operationCase_ == OperationOneofCase.Transform) {
subBuilder.MergeFrom(Transform);
}
input.ReadMessage(subBuilder);
Transform = subBuilder;
break;
}
}
}
}
}
/// <summary>
/// A transformation of a document.
/// </summary>
public sealed partial class DocumentTransform : pb::IMessage<DocumentTransform> {
private static readonly pb::MessageParser<DocumentTransform> _parser = new pb::MessageParser<DocumentTransform>(() => new DocumentTransform());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DocumentTransform> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Google.Cloud.Firestore.V1.WriteReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DocumentTransform() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DocumentTransform(DocumentTransform other) : this() {
document_ = other.document_;
fieldTransforms_ = other.fieldTransforms_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DocumentTransform Clone() {
return new DocumentTransform(this);
}
/// <summary>Field number for the "document" field.</summary>
public const int DocumentFieldNumber = 1;
private string document_ = "";
/// <summary>
/// The name of the document to transform.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Document {
get { return document_; }
set {
document_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "field_transforms" field.</summary>
public const int FieldTransformsFieldNumber = 2;
private static readonly pb::FieldCodec<global::Google.Cloud.Firestore.V1.DocumentTransform.Types.FieldTransform> _repeated_fieldTransforms_codec
= pb::FieldCodec.ForMessage(18, global::Google.Cloud.Firestore.V1.DocumentTransform.Types.FieldTransform.Parser);
private readonly pbc::RepeatedField<global::Google.Cloud.Firestore.V1.DocumentTransform.Types.FieldTransform> fieldTransforms_ = new pbc::RepeatedField<global::Google.Cloud.Firestore.V1.DocumentTransform.Types.FieldTransform>();
/// <summary>
/// The list of transformations to apply to the fields of the document, in
/// order.
/// This must not be empty.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Google.Cloud.Firestore.V1.DocumentTransform.Types.FieldTransform> FieldTransforms {
get { return fieldTransforms_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as DocumentTransform);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(DocumentTransform other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Document != other.Document) return false;
if(!fieldTransforms_.Equals(other.fieldTransforms_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Document.Length != 0) hash ^= Document.GetHashCode();
hash ^= fieldTransforms_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Document.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Document);
}
fieldTransforms_.WriteTo(output, _repeated_fieldTransforms_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Document.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Document);
}
size += fieldTransforms_.CalculateSize(_repeated_fieldTransforms_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(DocumentTransform other) {
if (other == null) {
return;
}
if (other.Document.Length != 0) {
Document = other.Document;
}
fieldTransforms_.Add(other.fieldTransforms_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
Document = input.ReadString();
break;
}
case 18: {
fieldTransforms_.AddEntriesFrom(input, _repeated_fieldTransforms_codec);
break;
}
}
}
}
#region Nested types
/// <summary>Container for nested types declared in the DocumentTransform message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
/// <summary>
/// A transformation of a field of the document.
/// </summary>
public sealed partial class FieldTransform : pb::IMessage<FieldTransform> {
private static readonly pb::MessageParser<FieldTransform> _parser = new pb::MessageParser<FieldTransform>(() => new FieldTransform());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<FieldTransform> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Google.Cloud.Firestore.V1.DocumentTransform.Descriptor.NestedTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FieldTransform() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FieldTransform(FieldTransform other) : this() {
fieldPath_ = other.fieldPath_;
switch (other.TransformTypeCase) {
case TransformTypeOneofCase.SetToServerValue:
SetToServerValue = other.SetToServerValue;
break;
case TransformTypeOneofCase.Increment:
Increment = other.Increment.Clone();
break;
case TransformTypeOneofCase.Maximum:
Maximum = other.Maximum.Clone();
break;
case TransformTypeOneofCase.Minimum:
Minimum = other.Minimum.Clone();
break;
case TransformTypeOneofCase.AppendMissingElements:
AppendMissingElements = other.AppendMissingElements.Clone();
break;
case TransformTypeOneofCase.RemoveAllFromArray:
RemoveAllFromArray = other.RemoveAllFromArray.Clone();
break;
}
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public FieldTransform Clone() {
return new FieldTransform(this);
}
/// <summary>Field number for the "field_path" field.</summary>
public const int FieldPathFieldNumber = 1;
private string fieldPath_ = "";
/// <summary>
/// The path of the field. See
/// [Document.fields][google.firestore.v1.Document.fields] for the field path
/// syntax reference.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string FieldPath {
get { return fieldPath_; }
set {
fieldPath_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "set_to_server_value" field.</summary>
public const int SetToServerValueFieldNumber = 2;
/// <summary>
/// Sets the field to the given server value.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Cloud.Firestore.V1.DocumentTransform.Types.FieldTransform.Types.ServerValue SetToServerValue {
get { return transformTypeCase_ == TransformTypeOneofCase.SetToServerValue ? (global::Google.Cloud.Firestore.V1.DocumentTransform.Types.FieldTransform.Types.ServerValue) transformType_ : 0; }
set {
transformType_ = value;
transformTypeCase_ = TransformTypeOneofCase.SetToServerValue;
}
}
/// <summary>Field number for the "increment" field.</summary>
public const int IncrementFieldNumber = 3;
/// <summary>
/// Adds the given value to the field's current value.
///
/// This must be an integer or a double value.
/// If the field is not an integer or double, or if the field does not yet
/// exist, the transformation will set the field to the given value.
/// If either of the given value or the current field value are doubles,
/// both values will be interpreted as doubles. Double arithmetic and
/// representation of double values follow IEEE 754 semantics.
/// If there is positive/negative integer overflow, the field is resolved
/// to the largest magnitude positive/negative integer.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Cloud.Firestore.V1.Value Increment {
get { return transformTypeCase_ == TransformTypeOneofCase.Increment ? (global::Google.Cloud.Firestore.V1.Value) transformType_ : null; }
set {
transformType_ = value;
transformTypeCase_ = value == null ? TransformTypeOneofCase.None : TransformTypeOneofCase.Increment;
}
}
/// <summary>Field number for the "maximum" field.</summary>
public const int MaximumFieldNumber = 4;
/// <summary>
/// Sets the field to the maximum of its current value and the given value.
///
/// This must be an integer or a double value.
/// If the field is not an integer or double, or if the field does not yet
/// exist, the transformation will set the field to the given value.
/// If a maximum operation is applied where the field and the input value
/// are of mixed types (that is - one is an integer and one is a double)
/// the field takes on the type of the larger operand. If the operands are
/// equivalent (e.g. 3 and 3.0), the field does not change.
/// 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and
/// zero input value is always the stored value.
/// The maximum of any numeric value x and NaN is NaN.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Cloud.Firestore.V1.Value Maximum {
get { return transformTypeCase_ == TransformTypeOneofCase.Maximum ? (global::Google.Cloud.Firestore.V1.Value) transformType_ : null; }
set {
transformType_ = value;
transformTypeCase_ = value == null ? TransformTypeOneofCase.None : TransformTypeOneofCase.Maximum;
}
}
/// <summary>Field number for the "minimum" field.</summary>
public const int MinimumFieldNumber = 5;
/// <summary>
/// Sets the field to the minimum of its current value and the given value.
///
/// This must be an integer or a double value.
/// If the field is not an integer or double, or if the field does not yet
/// exist, the transformation will set the field to the input value.
/// If a minimum operation is applied where the field and the input value
/// are of mixed types (that is - one is an integer and one is a double)
/// the field takes on the type of the smaller operand. If the operands are
/// equivalent (e.g. 3 and 3.0), the field does not change.
/// 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and
/// zero input value is always the stored value.
/// The minimum of any numeric value x and NaN is NaN.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Cloud.Firestore.V1.Value Minimum {
get { return transformTypeCase_ == TransformTypeOneofCase.Minimum ? (global::Google.Cloud.Firestore.V1.Value) transformType_ : null; }
set {
transformType_ = value;
transformTypeCase_ = value == null ? TransformTypeOneofCase.None : TransformTypeOneofCase.Minimum;
}
}
/// <summary>Field number for the "append_missing_elements" field.</summary>
public const int AppendMissingElementsFieldNumber = 6;
/// <summary>
/// Append the given elements in order if they are not already present in
/// the current field value.
/// If the field is not an array, or if the field does not yet exist, it is
/// first set to the empty array.
///
/// Equivalent numbers of different types (e.g. 3L and 3.0) are
/// considered equal when checking if a value is missing.
/// NaN is equal to NaN, and Null is equal to Null.
/// If the input contains multiple equivalent values, only the first will
/// be considered.
///
/// The corresponding transform_result will be the null value.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Cloud.Firestore.V1.ArrayValue AppendMissingElements {
get { return transformTypeCase_ == TransformTypeOneofCase.AppendMissingElements ? (global::Google.Cloud.Firestore.V1.ArrayValue) transformType_ : null; }
set {
transformType_ = value;
transformTypeCase_ = value == null ? TransformTypeOneofCase.None : TransformTypeOneofCase.AppendMissingElements;
}
}
/// <summary>Field number for the "remove_all_from_array" field.</summary>
public const int RemoveAllFromArrayFieldNumber = 7;
/// <summary>
/// Remove all of the given elements from the array in the field.
/// If the field is not an array, or if the field does not yet exist, it is
/// set to the empty array.
///
/// Equivalent numbers of the different types (e.g. 3L and 3.0) are
/// considered equal when deciding whether an element should be removed.
/// NaN is equal to NaN, and Null is equal to Null.
/// This will remove all equivalent values if there are duplicates.
///
/// The corresponding transform_result will be the null value.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Cloud.Firestore.V1.ArrayValue RemoveAllFromArray {
get { return transformTypeCase_ == TransformTypeOneofCase.RemoveAllFromArray ? (global::Google.Cloud.Firestore.V1.ArrayValue) transformType_ : null; }
set {
transformType_ = value;
transformTypeCase_ = value == null ? TransformTypeOneofCase.None : TransformTypeOneofCase.RemoveAllFromArray;
}
}
private object transformType_;
/// <summary>Enum of possible cases for the "transform_type" oneof.</summary>
public enum TransformTypeOneofCase {
None = 0,
SetToServerValue = 2,
Increment = 3,
Maximum = 4,
Minimum = 5,
AppendMissingElements = 6,
RemoveAllFromArray = 7,
}
private TransformTypeOneofCase transformTypeCase_ = TransformTypeOneofCase.None;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public TransformTypeOneofCase TransformTypeCase {
get { return transformTypeCase_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void ClearTransformType() {
transformTypeCase_ = TransformTypeOneofCase.None;
transformType_ = null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as FieldTransform);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(FieldTransform other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (FieldPath != other.FieldPath) return false;
if (SetToServerValue != other.SetToServerValue) return false;
if (!object.Equals(Increment, other.Increment)) return false;
if (!object.Equals(Maximum, other.Maximum)) return false;
if (!object.Equals(Minimum, other.Minimum)) return false;
if (!object.Equals(AppendMissingElements, other.AppendMissingElements)) return false;
if (!object.Equals(RemoveAllFromArray, other.RemoveAllFromArray)) return false;
if (TransformTypeCase != other.TransformTypeCase) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (FieldPath.Length != 0) hash ^= FieldPath.GetHashCode();
if (transformTypeCase_ == TransformTypeOneofCase.SetToServerValue) hash ^= SetToServerValue.GetHashCode();
if (transformTypeCase_ == TransformTypeOneofCase.Increment) hash ^= Increment.GetHashCode();
if (transformTypeCase_ == TransformTypeOneofCase.Maximum) hash ^= Maximum.GetHashCode();
if (transformTypeCase_ == TransformTypeOneofCase.Minimum) hash ^= Minimum.GetHashCode();
if (transformTypeCase_ == TransformTypeOneofCase.AppendMissingElements) hash ^= AppendMissingElements.GetHashCode();
if (transformTypeCase_ == TransformTypeOneofCase.RemoveAllFromArray) hash ^= RemoveAllFromArray.GetHashCode();
hash ^= (int) transformTypeCase_;
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (FieldPath.Length != 0) {
output.WriteRawTag(10);
output.WriteString(FieldPath);
}
if (transformTypeCase_ == TransformTypeOneofCase.SetToServerValue) {
output.WriteRawTag(16);
output.WriteEnum((int) SetToServerValue);
}
if (transformTypeCase_ == TransformTypeOneofCase.Increment) {
output.WriteRawTag(26);
output.WriteMessage(Increment);
}
if (transformTypeCase_ == TransformTypeOneofCase.Maximum) {
output.WriteRawTag(34);
output.WriteMessage(Maximum);
}
if (transformTypeCase_ == TransformTypeOneofCase.Minimum) {
output.WriteRawTag(42);
output.WriteMessage(Minimum);
}
if (transformTypeCase_ == TransformTypeOneofCase.AppendMissingElements) {
output.WriteRawTag(50);
output.WriteMessage(AppendMissingElements);
}
if (transformTypeCase_ == TransformTypeOneofCase.RemoveAllFromArray) {
output.WriteRawTag(58);
output.WriteMessage(RemoveAllFromArray);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (FieldPath.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(FieldPath);
}
if (transformTypeCase_ == TransformTypeOneofCase.SetToServerValue) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) SetToServerValue);
}
if (transformTypeCase_ == TransformTypeOneofCase.Increment) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Increment);
}
if (transformTypeCase_ == TransformTypeOneofCase.Maximum) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Maximum);
}
if (transformTypeCase_ == TransformTypeOneofCase.Minimum) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Minimum);
}
if (transformTypeCase_ == TransformTypeOneofCase.AppendMissingElements) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(AppendMissingElements);
}
if (transformTypeCase_ == TransformTypeOneofCase.RemoveAllFromArray) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(RemoveAllFromArray);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(FieldTransform other) {
if (other == null) {
return;
}
if (other.FieldPath.Length != 0) {
FieldPath = other.FieldPath;
}
switch (other.TransformTypeCase) {
case TransformTypeOneofCase.SetToServerValue:
SetToServerValue = other.SetToServerValue;
break;
case TransformTypeOneofCase.Increment:
if (Increment == null) {
Increment = new global::Google.Cloud.Firestore.V1.Value();
}
Increment.MergeFrom(other.Increment);
break;
case TransformTypeOneofCase.Maximum:
if (Maximum == null) {
Maximum = new global::Google.Cloud.Firestore.V1.Value();
}
Maximum.MergeFrom(other.Maximum);
break;
case TransformTypeOneofCase.Minimum:
if (Minimum == null) {
Minimum = new global::Google.Cloud.Firestore.V1.Value();
}
Minimum.MergeFrom(other.Minimum);
break;
case TransformTypeOneofCase.AppendMissingElements:
if (AppendMissingElements == null) {
AppendMissingElements = new global::Google.Cloud.Firestore.V1.ArrayValue();
}
AppendMissingElements.MergeFrom(other.AppendMissingElements);
break;
case TransformTypeOneofCase.RemoveAllFromArray:
if (RemoveAllFromArray == null) {
RemoveAllFromArray = new global::Google.Cloud.Firestore.V1.ArrayValue();
}
RemoveAllFromArray.MergeFrom(other.RemoveAllFromArray);
break;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 10: {
FieldPath = input.ReadString();
break;
}
case 16: {
transformType_ = input.ReadEnum();
transformTypeCase_ = TransformTypeOneofCase.SetToServerValue;
break;
}
case 26: {
global::Google.Cloud.Firestore.V1.Value subBuilder = new global::Google.Cloud.Firestore.V1.Value();
if (transformTypeCase_ == TransformTypeOneofCase.Increment) {
subBuilder.MergeFrom(Increment);
}
input.ReadMessage(subBuilder);
Increment = subBuilder;
break;
}
case 34: {
global::Google.Cloud.Firestore.V1.Value subBuilder = new global::Google.Cloud.Firestore.V1.Value();
if (transformTypeCase_ == TransformTypeOneofCase.Maximum) {
subBuilder.MergeFrom(Maximum);
}