aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Protos/cpp/firestore/local/maybe_document.pb.cc
blob: 04f2b261c756f0888d4ae2c3a9d0a31bbf991a7e (plain)
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
/*
 * Copyright 2018 Google
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: firestore/local/maybe_document.proto

#include "firestore/local/maybe_document.pb.h"

#include <algorithm>

#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// This is a temporary google only hack
#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
#include "third_party/protobuf/version.h"
#endif
// @@protoc_insertion_point(includes)
namespace firestore {
namespace client {
class NoDocumentDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<NoDocument>
      _instance;
} _NoDocument_default_instance_;
class MaybeDocumentDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<MaybeDocument>
      _instance;
  const ::firestore::client::NoDocument* no_document_;
  const ::google::firestore::v1beta1::Document* document_;
} _MaybeDocument_default_instance_;
}  // namespace client
}  // namespace firestore
namespace protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto {
void InitDefaultsNoDocumentImpl() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
#else
  ::google::protobuf::internal::InitProtobufDefaults();
#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  protobuf_google_2fprotobuf_2ftimestamp_2eproto::InitDefaultsTimestamp();
  {
    void* ptr = &::firestore::client::_NoDocument_default_instance_;
    new (ptr) ::firestore::client::NoDocument();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::firestore::client::NoDocument::InitAsDefaultInstance();
}

void InitDefaultsNoDocument() {
  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsNoDocumentImpl);
}

void InitDefaultsMaybeDocumentImpl() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

#ifdef GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  ::google::protobuf::internal::InitProtobufDefaultsForceUnique();
#else
  ::google::protobuf::internal::InitProtobufDefaults();
#endif  // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
  protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsNoDocument();
  protobuf_google_2ffirestore_2fv1beta1_2fdocument_2eproto::InitDefaultsDocument();
  {
    void* ptr = &::firestore::client::_MaybeDocument_default_instance_;
    new (ptr) ::firestore::client::MaybeDocument();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::firestore::client::MaybeDocument::InitAsDefaultInstance();
}

void InitDefaultsMaybeDocument() {
  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  ::google::protobuf::GoogleOnceInit(&once, &InitDefaultsMaybeDocumentImpl);
}

::google::protobuf::Metadata file_level_metadata[2];

const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  ~0u,  // no _has_bits_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::NoDocument, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::NoDocument, name_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::NoDocument, read_time_),
  ~0u,  // no _has_bits_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::MaybeDocument, _internal_metadata_),
  ~0u,  // no _extensions_
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::MaybeDocument, _oneof_case_[0]),
  ~0u,  // no _weak_field_map_
  offsetof(::firestore::client::MaybeDocumentDefaultTypeInternal, no_document_),
  offsetof(::firestore::client::MaybeDocumentDefaultTypeInternal, document_),
  GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::firestore::client::MaybeDocument, document_type_),
};
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
  { 0, -1, sizeof(::firestore::client::NoDocument)},
  { 7, -1, sizeof(::firestore::client::MaybeDocument)},
};

static ::google::protobuf::Message const * const file_default_instances[] = {
  reinterpret_cast<const ::google::protobuf::Message*>(&::firestore::client::_NoDocument_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::firestore::client::_MaybeDocument_default_instance_),
};

void protobuf_AssignDescriptors() {
  AddDescriptors();
  ::google::protobuf::MessageFactory* factory = NULL;
  AssignDescriptors(
      "firestore/local/maybe_document.proto", schemas, file_default_instances, TableStruct::offsets, factory,
      file_level_metadata, NULL, NULL);
}

void protobuf_AssignDescriptorsOnce() {
  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  ::google::protobuf::GoogleOnceInit(&once, &protobuf_AssignDescriptors);
}

void protobuf_RegisterTypes(const ::std::string&) GOOGLE_PROTOBUF_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 2);
}

void AddDescriptorsImpl() {
  InitDefaults();
  static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
      "\n$firestore/local/maybe_document.proto\022\020"
      "firestore.client\032\'google/firestore/v1bet"
      "a1/document.proto\032\037google/protobuf/times"
      "tamp.proto\"I\n\nNoDocument\022\014\n\004name\030\001 \001(\t\022-"
      "\n\tread_time\030\002 \001(\0132\032.google.protobuf.Time"
      "stamp\"\215\001\n\rMaybeDocument\0223\n\013no_document\030\001"
      " \001(\0132\034.firestore.client.NoDocumentH\000\0226\n\010"
      "document\030\002 \001(\0132\".google.firestore.v1beta"
      "1.DocumentH\000B\017\n\rdocument_typeB/\n#com.goo"
      "gle.firebase.firestore.protoP\001\242\002\005FSTPBb\006"
      "proto3"
  };
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
      descriptor, 406);
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
    "firestore/local/maybe_document.proto", &protobuf_RegisterTypes);
  ::protobuf_google_2ffirestore_2fv1beta1_2fdocument_2eproto::AddDescriptors();
  ::protobuf_google_2fprotobuf_2ftimestamp_2eproto::AddDescriptors();
}

void AddDescriptors() {
  static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
  ::google::protobuf::GoogleOnceInit(&once, &AddDescriptorsImpl);
}
// Force AddDescriptors() to be called at dynamic initialization time.
struct StaticDescriptorInitializer {
  StaticDescriptorInitializer() {
    AddDescriptors();
  }
} static_descriptor_initializer;
}  // namespace protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto
namespace firestore {
namespace client {

// ===================================================================

void NoDocument::InitAsDefaultInstance() {
  ::firestore::client::_NoDocument_default_instance_._instance.get_mutable()->read_time_ = const_cast< ::google::protobuf::Timestamp*>(
      ::google::protobuf::Timestamp::internal_default_instance());
}
void NoDocument::clear_read_time() {
  if (GetArenaNoVirtual() == NULL && read_time_ != NULL) {
    delete read_time_;
  }
  read_time_ = NULL;
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int NoDocument::kNameFieldNumber;
const int NoDocument::kReadTimeFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

NoDocument::NoDocument()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
    ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsNoDocument();
  }
  SharedCtor();
  // @@protoc_insertion_point(constructor:firestore.client.NoDocument)
}
NoDocument::NoDocument(const NoDocument& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL),
      _cached_size_(0) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (from.name().size() > 0) {
    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
  }
  if (from.has_read_time()) {
    read_time_ = new ::google::protobuf::Timestamp(*from.read_time_);
  } else {
    read_time_ = NULL;
  }
  // @@protoc_insertion_point(copy_constructor:firestore.client.NoDocument)
}

void NoDocument::SharedCtor() {
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  read_time_ = NULL;
  _cached_size_ = 0;
}

NoDocument::~NoDocument() {
  // @@protoc_insertion_point(destructor:firestore.client.NoDocument)
  SharedDtor();
}

void NoDocument::SharedDtor() {
  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != internal_default_instance()) delete read_time_;
}

void NoDocument::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* NoDocument::descriptor() {
  ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const NoDocument& NoDocument::default_instance() {
  ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsNoDocument();
  return *internal_default_instance();
}

NoDocument* NoDocument::New(::google::protobuf::Arena* arena) const {
  NoDocument* n = new NoDocument;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void NoDocument::Clear() {
// @@protoc_insertion_point(message_clear_start:firestore.client.NoDocument)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (GetArenaNoVirtual() == NULL && read_time_ != NULL) {
    delete read_time_;
  }
  read_time_ = NULL;
  _internal_metadata_.Clear();
}

bool NoDocument::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:firestore.client.NoDocument)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // string name = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_name()));
          DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
            this->name().data(), static_cast<int>(this->name().length()),
            ::google::protobuf::internal::WireFormatLite::PARSE,
            "firestore.client.NoDocument.name"));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .google.protobuf.Timestamp read_time = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_read_time()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:firestore.client.NoDocument)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:firestore.client.NoDocument)
  return false;
#undef DO_
}

void NoDocument::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:firestore.client.NoDocument)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // string name = 1;
  if (this->name().size() > 0) {
    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
      "firestore.client.NoDocument.name");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->name(), output);
  }

  // .google.protobuf.Timestamp read_time = 2;
  if (this->has_read_time()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      2, *this->read_time_, output);
  }

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
  }
  // @@protoc_insertion_point(serialize_end:firestore.client.NoDocument)
}

::google::protobuf::uint8* NoDocument::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:firestore.client.NoDocument)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // string name = 1;
  if (this->name().size() > 0) {
    ::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
      this->name().data(), static_cast<int>(this->name().length()),
      ::google::protobuf::internal::WireFormatLite::SERIALIZE,
      "firestore.client.NoDocument.name");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->name(), target);
  }

  // .google.protobuf.Timestamp read_time = 2;
  if (this->has_read_time()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        2, *this->read_time_, deterministic, target);
  }

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:firestore.client.NoDocument)
  return target;
}

size_t NoDocument::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:firestore.client.NoDocument)
  size_t total_size = 0;

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
  }
  // string name = 1;
  if (this->name().size() > 0) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::StringSize(
        this->name());
  }

  // .google.protobuf.Timestamp read_time = 2;
  if (this->has_read_time()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::MessageSize(
        *this->read_time_);
  }

  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = cached_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void NoDocument::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:firestore.client.NoDocument)
  GOOGLE_DCHECK_NE(&from, this);
  const NoDocument* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const NoDocument>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:firestore.client.NoDocument)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:firestore.client.NoDocument)
    MergeFrom(*source);
  }
}

void NoDocument::MergeFrom(const NoDocument& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:firestore.client.NoDocument)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  if (from.name().size() > 0) {

    name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
  }
  if (from.has_read_time()) {
    mutable_read_time()->::google::protobuf::Timestamp::MergeFrom(from.read_time());
  }
}

void NoDocument::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:firestore.client.NoDocument)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void NoDocument::CopyFrom(const NoDocument& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:firestore.client.NoDocument)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool NoDocument::IsInitialized() const {
  return true;
}

void NoDocument::Swap(NoDocument* other) {
  if (other == this) return;
  InternalSwap(other);
}
void NoDocument::InternalSwap(NoDocument* other) {
  using std::swap;
  name_.Swap(&other->name_);
  swap(read_time_, other->read_time_);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata NoDocument::GetMetadata() const {
  protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::file_level_metadata[kIndexInFileMessages];
}


// ===================================================================

void MaybeDocument::InitAsDefaultInstance() {
  ::firestore::client::_MaybeDocument_default_instance_.no_document_ = const_cast< ::firestore::client::NoDocument*>(
      ::firestore::client::NoDocument::internal_default_instance());
  ::firestore::client::_MaybeDocument_default_instance_.document_ = const_cast< ::google::firestore::v1beta1::Document*>(
      ::google::firestore::v1beta1::Document::internal_default_instance());
}
void MaybeDocument::set_allocated_no_document(::firestore::client::NoDocument* no_document) {
  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  clear_document_type();
  if (no_document) {
    ::google::protobuf::Arena* submessage_arena = NULL;
    if (message_arena != submessage_arena) {
      no_document = ::google::protobuf::internal::GetOwnedMessage(
          message_arena, no_document, submessage_arena);
    }
    set_has_no_document();
    document_type_.no_document_ = no_document;
  }
  // @@protoc_insertion_point(field_set_allocated:firestore.client.MaybeDocument.no_document)
}
void MaybeDocument::set_allocated_document(::google::firestore::v1beta1::Document* document) {
  ::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
  clear_document_type();
  if (document) {
    ::google::protobuf::Arena* submessage_arena = NULL;
    if (message_arena != submessage_arena) {
      document = ::google::protobuf::internal::GetOwnedMessage(
          message_arena, document, submessage_arena);
    }
    set_has_document();
    document_type_.document_ = document;
  }
  // @@protoc_insertion_point(field_set_allocated:firestore.client.MaybeDocument.document)
}
void MaybeDocument::clear_document() {
  if (has_document()) {
    delete document_type_.document_;
    clear_has_document_type();
  }
}
#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int MaybeDocument::kNoDocumentFieldNumber;
const int MaybeDocument::kDocumentFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

MaybeDocument::MaybeDocument()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  if (GOOGLE_PREDICT_TRUE(this != internal_default_instance())) {
    ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsMaybeDocument();
  }
  SharedCtor();
  // @@protoc_insertion_point(constructor:firestore.client.MaybeDocument)
}
MaybeDocument::MaybeDocument(const MaybeDocument& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(NULL),
      _cached_size_(0) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  clear_has_document_type();
  switch (from.document_type_case()) {
    case kNoDocument: {
      mutable_no_document()->::firestore::client::NoDocument::MergeFrom(from.no_document());
      break;
    }
    case kDocument: {
      mutable_document()->::google::firestore::v1beta1::Document::MergeFrom(from.document());
      break;
    }
    case DOCUMENT_TYPE_NOT_SET: {
      break;
    }
  }
  // @@protoc_insertion_point(copy_constructor:firestore.client.MaybeDocument)
}

void MaybeDocument::SharedCtor() {
  clear_has_document_type();
  _cached_size_ = 0;
}

MaybeDocument::~MaybeDocument() {
  // @@protoc_insertion_point(destructor:firestore.client.MaybeDocument)
  SharedDtor();
}

void MaybeDocument::SharedDtor() {
  if (has_document_type()) {
    clear_document_type();
  }
}

void MaybeDocument::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* MaybeDocument::descriptor() {
  ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::file_level_metadata[kIndexInFileMessages].descriptor;
}

const MaybeDocument& MaybeDocument::default_instance() {
  ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::InitDefaultsMaybeDocument();
  return *internal_default_instance();
}

MaybeDocument* MaybeDocument::New(::google::protobuf::Arena* arena) const {
  MaybeDocument* n = new MaybeDocument;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void MaybeDocument::clear_document_type() {
// @@protoc_insertion_point(one_of_clear_start:firestore.client.MaybeDocument)
  switch (document_type_case()) {
    case kNoDocument: {
      delete document_type_.no_document_;
      break;
    }
    case kDocument: {
      delete document_type_.document_;
      break;
    }
    case DOCUMENT_TYPE_NOT_SET: {
      break;
    }
  }
  _oneof_case_[0] = DOCUMENT_TYPE_NOT_SET;
}


void MaybeDocument::Clear() {
// @@protoc_insertion_point(message_clear_start:firestore.client.MaybeDocument)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  clear_document_type();
  _internal_metadata_.Clear();
}

bool MaybeDocument::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:firestore.client.MaybeDocument)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // .firestore.client.NoDocument no_document = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_no_document()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .google.firestore.v1beta1.Document document = 2;
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) ==
            static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessage(
               input, mutable_document()));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:firestore.client.MaybeDocument)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:firestore.client.MaybeDocument)
  return false;
#undef DO_
}

void MaybeDocument::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:firestore.client.MaybeDocument)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // .firestore.client.NoDocument no_document = 1;
  if (has_no_document()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      1, *document_type_.no_document_, output);
  }

  // .google.firestore.v1beta1.Document document = 2;
  if (has_document()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      2, *document_type_.document_, output);
  }

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), output);
  }
  // @@protoc_insertion_point(serialize_end:firestore.client.MaybeDocument)
}

::google::protobuf::uint8* MaybeDocument::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  (void)deterministic; // Unused
  // @@protoc_insertion_point(serialize_to_array_start:firestore.client.MaybeDocument)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // .firestore.client.NoDocument no_document = 1;
  if (has_no_document()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        1, *document_type_.no_document_, deterministic, target);
  }

  // .google.firestore.v1beta1.Document document = 2;
  if (has_document()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageToArray(
        2, *document_type_.document_, deterministic, target);
  }

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:firestore.client.MaybeDocument)
  return target;
}

size_t MaybeDocument::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:firestore.client.MaybeDocument)
  size_t total_size = 0;

  if ((_internal_metadata_.have_unknown_fields() &&  ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        (::google::protobuf::internal::GetProto3PreserveUnknownsDefault()   ? _internal_metadata_.unknown_fields()   : _internal_metadata_.default_instance()));
  }
  switch (document_type_case()) {
    // .firestore.client.NoDocument no_document = 1;
    case kNoDocument: {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          *document_type_.no_document_);
      break;
    }
    // .google.firestore.v1beta1.Document document = 2;
    case kDocument: {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSize(
          *document_type_.document_);
      break;
    }
    case DOCUMENT_TYPE_NOT_SET: {
      break;
    }
  }
  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = cached_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void MaybeDocument::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:firestore.client.MaybeDocument)
  GOOGLE_DCHECK_NE(&from, this);
  const MaybeDocument* source =
      ::google::protobuf::internal::DynamicCastToGenerated<const MaybeDocument>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:firestore.client.MaybeDocument)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:firestore.client.MaybeDocument)
    MergeFrom(*source);
  }
}

void MaybeDocument::MergeFrom(const MaybeDocument& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:firestore.client.MaybeDocument)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  switch (from.document_type_case()) {
    case kNoDocument: {
      mutable_no_document()->::firestore::client::NoDocument::MergeFrom(from.no_document());
      break;
    }
    case kDocument: {
      mutable_document()->::google::firestore::v1beta1::Document::MergeFrom(from.document());
      break;
    }
    case DOCUMENT_TYPE_NOT_SET: {
      break;
    }
  }
}

void MaybeDocument::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:firestore.client.MaybeDocument)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void MaybeDocument::CopyFrom(const MaybeDocument& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:firestore.client.MaybeDocument)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool MaybeDocument::IsInitialized() const {
  return true;
}

void MaybeDocument::Swap(MaybeDocument* other) {
  if (other == this) return;
  InternalSwap(other);
}
void MaybeDocument::InternalSwap(MaybeDocument* other) {
  using std::swap;
  swap(document_type_, other->document_type_);
  swap(_oneof_case_[0], other->_oneof_case_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata MaybeDocument::GetMetadata() const {
  protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::protobuf_AssignDescriptorsOnce();
  return ::protobuf_firestore_2flocal_2fmaybe_5fdocument_2eproto::file_level_metadata[kIndexInFileMessages];
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace client
}  // namespace firestore

// @@protoc_insertion_point(global_scope)