maybe_document.pb.cc 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089
  1. /*
  2. * Copyright 2021 Google LLC
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. // Generated by the protocol buffer compiler. DO NOT EDIT!
  17. // source: firestore/local/maybe_document.proto
  18. #include "firestore/local/maybe_document.pb.h"
  19. #include <algorithm>
  20. #include <google/protobuf/io/coded_stream.h>
  21. #include <google/protobuf/extension_set.h>
  22. #include <google/protobuf/wire_format_lite.h>
  23. #include <google/protobuf/descriptor.h>
  24. #include <google/protobuf/generated_message_reflection.h>
  25. #include <google/protobuf/reflection_ops.h>
  26. #include <google/protobuf/wire_format.h>
  27. // @@protoc_insertion_point(includes)
  28. #include <google/protobuf/port_def.inc>
  29. extern PROTOBUF_INTERNAL_EXPORT_firestore_2flocal_2fmaybe_5fdocument_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_NoDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto;
  30. extern PROTOBUF_INTERNAL_EXPORT_firestore_2flocal_2fmaybe_5fdocument_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_UnknownDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto;
  31. extern PROTOBUF_INTERNAL_EXPORT_google_2ffirestore_2fv1_2fdocument_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_Document_google_2ffirestore_2fv1_2fdocument_2eproto;
  32. extern PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2ftimestamp_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto;
  33. namespace firestore {
  34. namespace client {
  35. class NoDocumentDefaultTypeInternal {
  36. public:
  37. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<NoDocument> _instance;
  38. } _NoDocument_default_instance_;
  39. class UnknownDocumentDefaultTypeInternal {
  40. public:
  41. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<UnknownDocument> _instance;
  42. } _UnknownDocument_default_instance_;
  43. class MaybeDocumentDefaultTypeInternal {
  44. public:
  45. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MaybeDocument> _instance;
  46. const ::firestore::client::NoDocument* no_document_;
  47. const ::google::firestore::v1::Document* document_;
  48. const ::firestore::client::UnknownDocument* unknown_document_;
  49. } _MaybeDocument_default_instance_;
  50. } // namespace client
  51. } // namespace firestore
  52. static void InitDefaultsscc_info_MaybeDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto() {
  53. GOOGLE_PROTOBUF_VERIFY_VERSION;
  54. {
  55. void* ptr = &::firestore::client::_MaybeDocument_default_instance_;
  56. new (ptr) ::firestore::client::MaybeDocument();
  57. ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  58. }
  59. ::firestore::client::MaybeDocument::InitAsDefaultInstance();
  60. }
  61. ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_MaybeDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto =
  62. {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 3, 0, InitDefaultsscc_info_MaybeDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto}, {
  63. &scc_info_NoDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto.base,
  64. &scc_info_Document_google_2ffirestore_2fv1_2fdocument_2eproto.base,
  65. &scc_info_UnknownDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto.base,}};
  66. static void InitDefaultsscc_info_NoDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto() {
  67. GOOGLE_PROTOBUF_VERIFY_VERSION;
  68. {
  69. void* ptr = &::firestore::client::_NoDocument_default_instance_;
  70. new (ptr) ::firestore::client::NoDocument();
  71. ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  72. }
  73. ::firestore::client::NoDocument::InitAsDefaultInstance();
  74. }
  75. ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_NoDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto =
  76. {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_NoDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto}, {
  77. &scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto.base,}};
  78. static void InitDefaultsscc_info_UnknownDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto() {
  79. GOOGLE_PROTOBUF_VERIFY_VERSION;
  80. {
  81. void* ptr = &::firestore::client::_UnknownDocument_default_instance_;
  82. new (ptr) ::firestore::client::UnknownDocument();
  83. ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  84. }
  85. ::firestore::client::UnknownDocument::InitAsDefaultInstance();
  86. }
  87. ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_UnknownDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto =
  88. {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_UnknownDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto}, {
  89. &scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto.base,}};
  90. static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_firestore_2flocal_2fmaybe_5fdocument_2eproto[3];
  91. static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_firestore_2flocal_2fmaybe_5fdocument_2eproto = nullptr;
  92. static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_firestore_2flocal_2fmaybe_5fdocument_2eproto = nullptr;
  93. const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_firestore_2flocal_2fmaybe_5fdocument_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  94. ~0u, // no _has_bits_
  95. PROTOBUF_FIELD_OFFSET(::firestore::client::NoDocument, _internal_metadata_),
  96. ~0u, // no _extensions_
  97. ~0u, // no _oneof_case_
  98. ~0u, // no _weak_field_map_
  99. PROTOBUF_FIELD_OFFSET(::firestore::client::NoDocument, name_),
  100. PROTOBUF_FIELD_OFFSET(::firestore::client::NoDocument, read_time_),
  101. ~0u, // no _has_bits_
  102. PROTOBUF_FIELD_OFFSET(::firestore::client::UnknownDocument, _internal_metadata_),
  103. ~0u, // no _extensions_
  104. ~0u, // no _oneof_case_
  105. ~0u, // no _weak_field_map_
  106. PROTOBUF_FIELD_OFFSET(::firestore::client::UnknownDocument, name_),
  107. PROTOBUF_FIELD_OFFSET(::firestore::client::UnknownDocument, version_),
  108. ~0u, // no _has_bits_
  109. PROTOBUF_FIELD_OFFSET(::firestore::client::MaybeDocument, _internal_metadata_),
  110. ~0u, // no _extensions_
  111. PROTOBUF_FIELD_OFFSET(::firestore::client::MaybeDocument, _oneof_case_[0]),
  112. ~0u, // no _weak_field_map_
  113. offsetof(::firestore::client::MaybeDocumentDefaultTypeInternal, no_document_),
  114. offsetof(::firestore::client::MaybeDocumentDefaultTypeInternal, document_),
  115. offsetof(::firestore::client::MaybeDocumentDefaultTypeInternal, unknown_document_),
  116. PROTOBUF_FIELD_OFFSET(::firestore::client::MaybeDocument, has_committed_mutations_),
  117. PROTOBUF_FIELD_OFFSET(::firestore::client::MaybeDocument, document_type_),
  118. };
  119. static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  120. { 0, -1, sizeof(::firestore::client::NoDocument)},
  121. { 7, -1, sizeof(::firestore::client::UnknownDocument)},
  122. { 14, -1, sizeof(::firestore::client::MaybeDocument)},
  123. };
  124. static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
  125. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::firestore::client::_NoDocument_default_instance_),
  126. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::firestore::client::_UnknownDocument_default_instance_),
  127. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::firestore::client::_MaybeDocument_default_instance_),
  128. };
  129. const char descriptor_table_protodef_firestore_2flocal_2fmaybe_5fdocument_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  130. "\n$firestore/local/maybe_document.proto\022\020"
  131. "firestore.client\032\"google/firestore/v1/do"
  132. "cument.proto\032\037google/protobuf/timestamp."
  133. "proto\"I\n\nNoDocument\022\014\n\004name\030\001 \001(\t\022-\n\trea"
  134. "d_time\030\002 \001(\0132\032.google.protobuf.Timestamp"
  135. "\"L\n\017UnknownDocument\022\014\n\004name\030\001 \001(\t\022+\n\007ver"
  136. "sion\030\002 \001(\0132\032.google.protobuf.Timestamp\"\350"
  137. "\001\n\rMaybeDocument\0223\n\013no_document\030\001 \001(\0132\034."
  138. "firestore.client.NoDocumentH\000\0221\n\010documen"
  139. "t\030\002 \001(\0132\035.google.firestore.v1.DocumentH\000"
  140. "\022=\n\020unknown_document\030\003 \001(\0132!.firestore.c"
  141. "lient.UnknownDocumentH\000\022\037\n\027has_committed"
  142. "_mutations\030\004 \001(\010B\017\n\rdocument_typeB/\n#com"
  143. ".google.firebase.firestore.protoP\001\242\002\005FST"
  144. "PBb\006proto3"
  145. ;
  146. static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_firestore_2flocal_2fmaybe_5fdocument_2eproto_deps[2] = {
  147. &::descriptor_table_google_2ffirestore_2fv1_2fdocument_2eproto,
  148. &::descriptor_table_google_2fprotobuf_2ftimestamp_2eproto,
  149. };
  150. static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_firestore_2flocal_2fmaybe_5fdocument_2eproto_sccs[3] = {
  151. &scc_info_MaybeDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto.base,
  152. &scc_info_NoDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto.base,
  153. &scc_info_UnknownDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto.base,
  154. };
  155. static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_firestore_2flocal_2fmaybe_5fdocument_2eproto_once;
  156. static bool descriptor_table_firestore_2flocal_2fmaybe_5fdocument_2eproto_initialized = false;
  157. const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_firestore_2flocal_2fmaybe_5fdocument_2eproto = {
  158. &descriptor_table_firestore_2flocal_2fmaybe_5fdocument_2eproto_initialized, descriptor_table_protodef_firestore_2flocal_2fmaybe_5fdocument_2eproto, "firestore/local/maybe_document.proto", 570,
  159. &descriptor_table_firestore_2flocal_2fmaybe_5fdocument_2eproto_once, descriptor_table_firestore_2flocal_2fmaybe_5fdocument_2eproto_sccs, descriptor_table_firestore_2flocal_2fmaybe_5fdocument_2eproto_deps, 3, 2,
  160. schemas, file_default_instances, TableStruct_firestore_2flocal_2fmaybe_5fdocument_2eproto::offsets,
  161. file_level_metadata_firestore_2flocal_2fmaybe_5fdocument_2eproto, 3, file_level_enum_descriptors_firestore_2flocal_2fmaybe_5fdocument_2eproto, file_level_service_descriptors_firestore_2flocal_2fmaybe_5fdocument_2eproto,
  162. };
  163. // Force running AddDescriptors() at dynamic initialization time.
  164. static bool dynamic_init_dummy_firestore_2flocal_2fmaybe_5fdocument_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_firestore_2flocal_2fmaybe_5fdocument_2eproto), true);
  165. namespace firestore {
  166. namespace client {
  167. // ===================================================================
  168. void NoDocument::InitAsDefaultInstance() {
  169. ::firestore::client::_NoDocument_default_instance_._instance.get_mutable()->read_time_ = const_cast< PROTOBUF_NAMESPACE_ID::Timestamp*>(
  170. PROTOBUF_NAMESPACE_ID::Timestamp::internal_default_instance());
  171. }
  172. class NoDocument::_Internal {
  173. public:
  174. static const PROTOBUF_NAMESPACE_ID::Timestamp& read_time(const NoDocument* msg);
  175. };
  176. const PROTOBUF_NAMESPACE_ID::Timestamp&
  177. NoDocument::_Internal::read_time(const NoDocument* msg) {
  178. return *msg->read_time_;
  179. }
  180. void NoDocument::clear_read_time() {
  181. if (GetArenaNoVirtual() == nullptr && read_time_ != nullptr) {
  182. delete read_time_;
  183. }
  184. read_time_ = nullptr;
  185. }
  186. NoDocument::NoDocument()
  187. : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  188. SharedCtor();
  189. // @@protoc_insertion_point(constructor:firestore.client.NoDocument)
  190. }
  191. NoDocument::NoDocument(const NoDocument& from)
  192. : ::PROTOBUF_NAMESPACE_ID::Message(),
  193. _internal_metadata_(nullptr) {
  194. _internal_metadata_.MergeFrom(from._internal_metadata_);
  195. name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  196. if (!from._internal_name().empty()) {
  197. name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
  198. }
  199. if (from._internal_has_read_time()) {
  200. read_time_ = new PROTOBUF_NAMESPACE_ID::Timestamp(*from.read_time_);
  201. } else {
  202. read_time_ = nullptr;
  203. }
  204. // @@protoc_insertion_point(copy_constructor:firestore.client.NoDocument)
  205. }
  206. void NoDocument::SharedCtor() {
  207. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_NoDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto.base);
  208. name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  209. read_time_ = nullptr;
  210. }
  211. NoDocument::~NoDocument() {
  212. // @@protoc_insertion_point(destructor:firestore.client.NoDocument)
  213. SharedDtor();
  214. }
  215. void NoDocument::SharedDtor() {
  216. name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  217. if (this != internal_default_instance()) delete read_time_;
  218. }
  219. void NoDocument::SetCachedSize(int size) const {
  220. _cached_size_.Set(size);
  221. }
  222. const NoDocument& NoDocument::default_instance() {
  223. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_NoDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto.base);
  224. return *internal_default_instance();
  225. }
  226. void NoDocument::Clear() {
  227. // @@protoc_insertion_point(message_clear_start:firestore.client.NoDocument)
  228. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  229. // Prevent compiler warnings about cached_has_bits being unused
  230. (void) cached_has_bits;
  231. name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  232. if (GetArenaNoVirtual() == nullptr && read_time_ != nullptr) {
  233. delete read_time_;
  234. }
  235. read_time_ = nullptr;
  236. _internal_metadata_.Clear();
  237. }
  238. const char* NoDocument::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  239. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  240. while (!ctx->Done(&ptr)) {
  241. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  242. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  243. CHK_(ptr);
  244. switch (tag >> 3) {
  245. // string name = 1;
  246. case 1:
  247. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
  248. auto str = _internal_mutable_name();
  249. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
  250. CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "firestore.client.NoDocument.name"));
  251. CHK_(ptr);
  252. } else goto handle_unusual;
  253. continue;
  254. // .google.protobuf.Timestamp read_time = 2;
  255. case 2:
  256. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
  257. ptr = ctx->ParseMessage(_internal_mutable_read_time(), ptr);
  258. CHK_(ptr);
  259. } else goto handle_unusual;
  260. continue;
  261. default: {
  262. handle_unusual:
  263. if ((tag & 7) == 4 || tag == 0) {
  264. ctx->SetLastTag(tag);
  265. goto success;
  266. }
  267. ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
  268. CHK_(ptr != nullptr);
  269. continue;
  270. }
  271. } // switch
  272. } // while
  273. success:
  274. return ptr;
  275. failure:
  276. ptr = nullptr;
  277. goto success;
  278. #undef CHK_
  279. }
  280. ::PROTOBUF_NAMESPACE_ID::uint8* NoDocument::_InternalSerialize(
  281. ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  282. // @@protoc_insertion_point(serialize_to_array_start:firestore.client.NoDocument)
  283. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  284. (void) cached_has_bits;
  285. // string name = 1;
  286. if (this->name().size() > 0) {
  287. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  288. this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
  289. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  290. "firestore.client.NoDocument.name");
  291. target = stream->WriteStringMaybeAliased(
  292. 1, this->_internal_name(), target);
  293. }
  294. // .google.protobuf.Timestamp read_time = 2;
  295. if (this->has_read_time()) {
  296. target = stream->EnsureSpace(target);
  297. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  298. InternalWriteMessage(
  299. 2, _Internal::read_time(this), target, stream);
  300. }
  301. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  302. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
  303. _internal_metadata_.unknown_fields(), target, stream);
  304. }
  305. // @@protoc_insertion_point(serialize_to_array_end:firestore.client.NoDocument)
  306. return target;
  307. }
  308. size_t NoDocument::ByteSizeLong() const {
  309. // @@protoc_insertion_point(message_byte_size_start:firestore.client.NoDocument)
  310. size_t total_size = 0;
  311. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  312. // Prevent compiler warnings about cached_has_bits being unused
  313. (void) cached_has_bits;
  314. // string name = 1;
  315. if (this->name().size() > 0) {
  316. total_size += 1 +
  317. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  318. this->_internal_name());
  319. }
  320. // .google.protobuf.Timestamp read_time = 2;
  321. if (this->has_read_time()) {
  322. total_size += 1 +
  323. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  324. *read_time_);
  325. }
  326. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  327. return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
  328. _internal_metadata_, total_size, &_cached_size_);
  329. }
  330. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  331. SetCachedSize(cached_size);
  332. return total_size;
  333. }
  334. void NoDocument::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  335. // @@protoc_insertion_point(generalized_merge_from_start:firestore.client.NoDocument)
  336. GOOGLE_DCHECK_NE(&from, this);
  337. const NoDocument* source =
  338. ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<NoDocument>(
  339. &from);
  340. if (source == nullptr) {
  341. // @@protoc_insertion_point(generalized_merge_from_cast_fail:firestore.client.NoDocument)
  342. ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  343. } else {
  344. // @@protoc_insertion_point(generalized_merge_from_cast_success:firestore.client.NoDocument)
  345. MergeFrom(*source);
  346. }
  347. }
  348. void NoDocument::MergeFrom(const NoDocument& from) {
  349. // @@protoc_insertion_point(class_specific_merge_from_start:firestore.client.NoDocument)
  350. GOOGLE_DCHECK_NE(&from, this);
  351. _internal_metadata_.MergeFrom(from._internal_metadata_);
  352. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  353. (void) cached_has_bits;
  354. if (from.name().size() > 0) {
  355. name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
  356. }
  357. if (from.has_read_time()) {
  358. _internal_mutable_read_time()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from._internal_read_time());
  359. }
  360. }
  361. void NoDocument::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  362. // @@protoc_insertion_point(generalized_copy_from_start:firestore.client.NoDocument)
  363. if (&from == this) return;
  364. Clear();
  365. MergeFrom(from);
  366. }
  367. void NoDocument::CopyFrom(const NoDocument& from) {
  368. // @@protoc_insertion_point(class_specific_copy_from_start:firestore.client.NoDocument)
  369. if (&from == this) return;
  370. Clear();
  371. MergeFrom(from);
  372. }
  373. bool NoDocument::IsInitialized() const {
  374. return true;
  375. }
  376. void NoDocument::InternalSwap(NoDocument* other) {
  377. using std::swap;
  378. _internal_metadata_.Swap(&other->_internal_metadata_);
  379. name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  380. GetArenaNoVirtual());
  381. swap(read_time_, other->read_time_);
  382. }
  383. ::PROTOBUF_NAMESPACE_ID::Metadata NoDocument::GetMetadata() const {
  384. return GetMetadataStatic();
  385. }
  386. // ===================================================================
  387. void UnknownDocument::InitAsDefaultInstance() {
  388. ::firestore::client::_UnknownDocument_default_instance_._instance.get_mutable()->version_ = const_cast< PROTOBUF_NAMESPACE_ID::Timestamp*>(
  389. PROTOBUF_NAMESPACE_ID::Timestamp::internal_default_instance());
  390. }
  391. class UnknownDocument::_Internal {
  392. public:
  393. static const PROTOBUF_NAMESPACE_ID::Timestamp& version(const UnknownDocument* msg);
  394. };
  395. const PROTOBUF_NAMESPACE_ID::Timestamp&
  396. UnknownDocument::_Internal::version(const UnknownDocument* msg) {
  397. return *msg->version_;
  398. }
  399. void UnknownDocument::clear_version() {
  400. if (GetArenaNoVirtual() == nullptr && version_ != nullptr) {
  401. delete version_;
  402. }
  403. version_ = nullptr;
  404. }
  405. UnknownDocument::UnknownDocument()
  406. : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  407. SharedCtor();
  408. // @@protoc_insertion_point(constructor:firestore.client.UnknownDocument)
  409. }
  410. UnknownDocument::UnknownDocument(const UnknownDocument& from)
  411. : ::PROTOBUF_NAMESPACE_ID::Message(),
  412. _internal_metadata_(nullptr) {
  413. _internal_metadata_.MergeFrom(from._internal_metadata_);
  414. name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  415. if (!from._internal_name().empty()) {
  416. name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
  417. }
  418. if (from._internal_has_version()) {
  419. version_ = new PROTOBUF_NAMESPACE_ID::Timestamp(*from.version_);
  420. } else {
  421. version_ = nullptr;
  422. }
  423. // @@protoc_insertion_point(copy_constructor:firestore.client.UnknownDocument)
  424. }
  425. void UnknownDocument::SharedCtor() {
  426. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_UnknownDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto.base);
  427. name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  428. version_ = nullptr;
  429. }
  430. UnknownDocument::~UnknownDocument() {
  431. // @@protoc_insertion_point(destructor:firestore.client.UnknownDocument)
  432. SharedDtor();
  433. }
  434. void UnknownDocument::SharedDtor() {
  435. name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  436. if (this != internal_default_instance()) delete version_;
  437. }
  438. void UnknownDocument::SetCachedSize(int size) const {
  439. _cached_size_.Set(size);
  440. }
  441. const UnknownDocument& UnknownDocument::default_instance() {
  442. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_UnknownDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto.base);
  443. return *internal_default_instance();
  444. }
  445. void UnknownDocument::Clear() {
  446. // @@protoc_insertion_point(message_clear_start:firestore.client.UnknownDocument)
  447. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  448. // Prevent compiler warnings about cached_has_bits being unused
  449. (void) cached_has_bits;
  450. name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  451. if (GetArenaNoVirtual() == nullptr && version_ != nullptr) {
  452. delete version_;
  453. }
  454. version_ = nullptr;
  455. _internal_metadata_.Clear();
  456. }
  457. const char* UnknownDocument::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  458. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  459. while (!ctx->Done(&ptr)) {
  460. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  461. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  462. CHK_(ptr);
  463. switch (tag >> 3) {
  464. // string name = 1;
  465. case 1:
  466. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
  467. auto str = _internal_mutable_name();
  468. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
  469. CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "firestore.client.UnknownDocument.name"));
  470. CHK_(ptr);
  471. } else goto handle_unusual;
  472. continue;
  473. // .google.protobuf.Timestamp version = 2;
  474. case 2:
  475. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
  476. ptr = ctx->ParseMessage(_internal_mutable_version(), ptr);
  477. CHK_(ptr);
  478. } else goto handle_unusual;
  479. continue;
  480. default: {
  481. handle_unusual:
  482. if ((tag & 7) == 4 || tag == 0) {
  483. ctx->SetLastTag(tag);
  484. goto success;
  485. }
  486. ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
  487. CHK_(ptr != nullptr);
  488. continue;
  489. }
  490. } // switch
  491. } // while
  492. success:
  493. return ptr;
  494. failure:
  495. ptr = nullptr;
  496. goto success;
  497. #undef CHK_
  498. }
  499. ::PROTOBUF_NAMESPACE_ID::uint8* UnknownDocument::_InternalSerialize(
  500. ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  501. // @@protoc_insertion_point(serialize_to_array_start:firestore.client.UnknownDocument)
  502. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  503. (void) cached_has_bits;
  504. // string name = 1;
  505. if (this->name().size() > 0) {
  506. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  507. this->_internal_name().data(), static_cast<int>(this->_internal_name().length()),
  508. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  509. "firestore.client.UnknownDocument.name");
  510. target = stream->WriteStringMaybeAliased(
  511. 1, this->_internal_name(), target);
  512. }
  513. // .google.protobuf.Timestamp version = 2;
  514. if (this->has_version()) {
  515. target = stream->EnsureSpace(target);
  516. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  517. InternalWriteMessage(
  518. 2, _Internal::version(this), target, stream);
  519. }
  520. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  521. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
  522. _internal_metadata_.unknown_fields(), target, stream);
  523. }
  524. // @@protoc_insertion_point(serialize_to_array_end:firestore.client.UnknownDocument)
  525. return target;
  526. }
  527. size_t UnknownDocument::ByteSizeLong() const {
  528. // @@protoc_insertion_point(message_byte_size_start:firestore.client.UnknownDocument)
  529. size_t total_size = 0;
  530. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  531. // Prevent compiler warnings about cached_has_bits being unused
  532. (void) cached_has_bits;
  533. // string name = 1;
  534. if (this->name().size() > 0) {
  535. total_size += 1 +
  536. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  537. this->_internal_name());
  538. }
  539. // .google.protobuf.Timestamp version = 2;
  540. if (this->has_version()) {
  541. total_size += 1 +
  542. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  543. *version_);
  544. }
  545. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  546. return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
  547. _internal_metadata_, total_size, &_cached_size_);
  548. }
  549. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  550. SetCachedSize(cached_size);
  551. return total_size;
  552. }
  553. void UnknownDocument::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  554. // @@protoc_insertion_point(generalized_merge_from_start:firestore.client.UnknownDocument)
  555. GOOGLE_DCHECK_NE(&from, this);
  556. const UnknownDocument* source =
  557. ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<UnknownDocument>(
  558. &from);
  559. if (source == nullptr) {
  560. // @@protoc_insertion_point(generalized_merge_from_cast_fail:firestore.client.UnknownDocument)
  561. ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  562. } else {
  563. // @@protoc_insertion_point(generalized_merge_from_cast_success:firestore.client.UnknownDocument)
  564. MergeFrom(*source);
  565. }
  566. }
  567. void UnknownDocument::MergeFrom(const UnknownDocument& from) {
  568. // @@protoc_insertion_point(class_specific_merge_from_start:firestore.client.UnknownDocument)
  569. GOOGLE_DCHECK_NE(&from, this);
  570. _internal_metadata_.MergeFrom(from._internal_metadata_);
  571. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  572. (void) cached_has_bits;
  573. if (from.name().size() > 0) {
  574. name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
  575. }
  576. if (from.has_version()) {
  577. _internal_mutable_version()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from._internal_version());
  578. }
  579. }
  580. void UnknownDocument::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  581. // @@protoc_insertion_point(generalized_copy_from_start:firestore.client.UnknownDocument)
  582. if (&from == this) return;
  583. Clear();
  584. MergeFrom(from);
  585. }
  586. void UnknownDocument::CopyFrom(const UnknownDocument& from) {
  587. // @@protoc_insertion_point(class_specific_copy_from_start:firestore.client.UnknownDocument)
  588. if (&from == this) return;
  589. Clear();
  590. MergeFrom(from);
  591. }
  592. bool UnknownDocument::IsInitialized() const {
  593. return true;
  594. }
  595. void UnknownDocument::InternalSwap(UnknownDocument* other) {
  596. using std::swap;
  597. _internal_metadata_.Swap(&other->_internal_metadata_);
  598. name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  599. GetArenaNoVirtual());
  600. swap(version_, other->version_);
  601. }
  602. ::PROTOBUF_NAMESPACE_ID::Metadata UnknownDocument::GetMetadata() const {
  603. return GetMetadataStatic();
  604. }
  605. // ===================================================================
  606. void MaybeDocument::InitAsDefaultInstance() {
  607. ::firestore::client::_MaybeDocument_default_instance_.no_document_ = const_cast< ::firestore::client::NoDocument*>(
  608. ::firestore::client::NoDocument::internal_default_instance());
  609. ::firestore::client::_MaybeDocument_default_instance_.document_ = const_cast< ::google::firestore::v1::Document*>(
  610. ::google::firestore::v1::Document::internal_default_instance());
  611. ::firestore::client::_MaybeDocument_default_instance_.unknown_document_ = const_cast< ::firestore::client::UnknownDocument*>(
  612. ::firestore::client::UnknownDocument::internal_default_instance());
  613. }
  614. class MaybeDocument::_Internal {
  615. public:
  616. static const ::firestore::client::NoDocument& no_document(const MaybeDocument* msg);
  617. static const ::google::firestore::v1::Document& document(const MaybeDocument* msg);
  618. static const ::firestore::client::UnknownDocument& unknown_document(const MaybeDocument* msg);
  619. };
  620. const ::firestore::client::NoDocument&
  621. MaybeDocument::_Internal::no_document(const MaybeDocument* msg) {
  622. return *msg->document_type_.no_document_;
  623. }
  624. const ::google::firestore::v1::Document&
  625. MaybeDocument::_Internal::document(const MaybeDocument* msg) {
  626. return *msg->document_type_.document_;
  627. }
  628. const ::firestore::client::UnknownDocument&
  629. MaybeDocument::_Internal::unknown_document(const MaybeDocument* msg) {
  630. return *msg->document_type_.unknown_document_;
  631. }
  632. void MaybeDocument::set_allocated_no_document(::firestore::client::NoDocument* no_document) {
  633. ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
  634. clear_document_type();
  635. if (no_document) {
  636. ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
  637. if (message_arena != submessage_arena) {
  638. no_document = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
  639. message_arena, no_document, submessage_arena);
  640. }
  641. set_has_no_document();
  642. document_type_.no_document_ = no_document;
  643. }
  644. // @@protoc_insertion_point(field_set_allocated:firestore.client.MaybeDocument.no_document)
  645. }
  646. void MaybeDocument::set_allocated_document(::google::firestore::v1::Document* document) {
  647. ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
  648. clear_document_type();
  649. if (document) {
  650. ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
  651. if (message_arena != submessage_arena) {
  652. document = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
  653. message_arena, document, submessage_arena);
  654. }
  655. set_has_document();
  656. document_type_.document_ = document;
  657. }
  658. // @@protoc_insertion_point(field_set_allocated:firestore.client.MaybeDocument.document)
  659. }
  660. void MaybeDocument::clear_document() {
  661. if (_internal_has_document()) {
  662. delete document_type_.document_;
  663. clear_has_document_type();
  664. }
  665. }
  666. void MaybeDocument::set_allocated_unknown_document(::firestore::client::UnknownDocument* unknown_document) {
  667. ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
  668. clear_document_type();
  669. if (unknown_document) {
  670. ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
  671. if (message_arena != submessage_arena) {
  672. unknown_document = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
  673. message_arena, unknown_document, submessage_arena);
  674. }
  675. set_has_unknown_document();
  676. document_type_.unknown_document_ = unknown_document;
  677. }
  678. // @@protoc_insertion_point(field_set_allocated:firestore.client.MaybeDocument.unknown_document)
  679. }
  680. MaybeDocument::MaybeDocument()
  681. : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  682. SharedCtor();
  683. // @@protoc_insertion_point(constructor:firestore.client.MaybeDocument)
  684. }
  685. MaybeDocument::MaybeDocument(const MaybeDocument& from)
  686. : ::PROTOBUF_NAMESPACE_ID::Message(),
  687. _internal_metadata_(nullptr) {
  688. _internal_metadata_.MergeFrom(from._internal_metadata_);
  689. has_committed_mutations_ = from.has_committed_mutations_;
  690. clear_has_document_type();
  691. switch (from.document_type_case()) {
  692. case kNoDocument: {
  693. _internal_mutable_no_document()->::firestore::client::NoDocument::MergeFrom(from._internal_no_document());
  694. break;
  695. }
  696. case kDocument: {
  697. _internal_mutable_document()->::google::firestore::v1::Document::MergeFrom(from._internal_document());
  698. break;
  699. }
  700. case kUnknownDocument: {
  701. _internal_mutable_unknown_document()->::firestore::client::UnknownDocument::MergeFrom(from._internal_unknown_document());
  702. break;
  703. }
  704. case DOCUMENT_TYPE_NOT_SET: {
  705. break;
  706. }
  707. }
  708. // @@protoc_insertion_point(copy_constructor:firestore.client.MaybeDocument)
  709. }
  710. void MaybeDocument::SharedCtor() {
  711. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_MaybeDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto.base);
  712. has_committed_mutations_ = false;
  713. clear_has_document_type();
  714. }
  715. MaybeDocument::~MaybeDocument() {
  716. // @@protoc_insertion_point(destructor:firestore.client.MaybeDocument)
  717. SharedDtor();
  718. }
  719. void MaybeDocument::SharedDtor() {
  720. if (has_document_type()) {
  721. clear_document_type();
  722. }
  723. }
  724. void MaybeDocument::SetCachedSize(int size) const {
  725. _cached_size_.Set(size);
  726. }
  727. const MaybeDocument& MaybeDocument::default_instance() {
  728. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MaybeDocument_firestore_2flocal_2fmaybe_5fdocument_2eproto.base);
  729. return *internal_default_instance();
  730. }
  731. void MaybeDocument::clear_document_type() {
  732. // @@protoc_insertion_point(one_of_clear_start:firestore.client.MaybeDocument)
  733. switch (document_type_case()) {
  734. case kNoDocument: {
  735. delete document_type_.no_document_;
  736. break;
  737. }
  738. case kDocument: {
  739. delete document_type_.document_;
  740. break;
  741. }
  742. case kUnknownDocument: {
  743. delete document_type_.unknown_document_;
  744. break;
  745. }
  746. case DOCUMENT_TYPE_NOT_SET: {
  747. break;
  748. }
  749. }
  750. _oneof_case_[0] = DOCUMENT_TYPE_NOT_SET;
  751. }
  752. void MaybeDocument::Clear() {
  753. // @@protoc_insertion_point(message_clear_start:firestore.client.MaybeDocument)
  754. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  755. // Prevent compiler warnings about cached_has_bits being unused
  756. (void) cached_has_bits;
  757. has_committed_mutations_ = false;
  758. clear_document_type();
  759. _internal_metadata_.Clear();
  760. }
  761. const char* MaybeDocument::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  762. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  763. while (!ctx->Done(&ptr)) {
  764. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  765. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  766. CHK_(ptr);
  767. switch (tag >> 3) {
  768. // .firestore.client.NoDocument no_document = 1;
  769. case 1:
  770. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
  771. ptr = ctx->ParseMessage(_internal_mutable_no_document(), ptr);
  772. CHK_(ptr);
  773. } else goto handle_unusual;
  774. continue;
  775. // .google.firestore.v1.Document document = 2;
  776. case 2:
  777. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
  778. ptr = ctx->ParseMessage(_internal_mutable_document(), ptr);
  779. CHK_(ptr);
  780. } else goto handle_unusual;
  781. continue;
  782. // .firestore.client.UnknownDocument unknown_document = 3;
  783. case 3:
  784. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
  785. ptr = ctx->ParseMessage(_internal_mutable_unknown_document(), ptr);
  786. CHK_(ptr);
  787. } else goto handle_unusual;
  788. continue;
  789. // bool has_committed_mutations = 4;
  790. case 4:
  791. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) {
  792. has_committed_mutations_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
  793. CHK_(ptr);
  794. } else goto handle_unusual;
  795. continue;
  796. default: {
  797. handle_unusual:
  798. if ((tag & 7) == 4 || tag == 0) {
  799. ctx->SetLastTag(tag);
  800. goto success;
  801. }
  802. ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
  803. CHK_(ptr != nullptr);
  804. continue;
  805. }
  806. } // switch
  807. } // while
  808. success:
  809. return ptr;
  810. failure:
  811. ptr = nullptr;
  812. goto success;
  813. #undef CHK_
  814. }
  815. ::PROTOBUF_NAMESPACE_ID::uint8* MaybeDocument::_InternalSerialize(
  816. ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  817. // @@protoc_insertion_point(serialize_to_array_start:firestore.client.MaybeDocument)
  818. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  819. (void) cached_has_bits;
  820. // .firestore.client.NoDocument no_document = 1;
  821. if (_internal_has_no_document()) {
  822. target = stream->EnsureSpace(target);
  823. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  824. InternalWriteMessage(
  825. 1, _Internal::no_document(this), target, stream);
  826. }
  827. // .google.firestore.v1.Document document = 2;
  828. if (_internal_has_document()) {
  829. target = stream->EnsureSpace(target);
  830. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  831. InternalWriteMessage(
  832. 2, _Internal::document(this), target, stream);
  833. }
  834. // .firestore.client.UnknownDocument unknown_document = 3;
  835. if (_internal_has_unknown_document()) {
  836. target = stream->EnsureSpace(target);
  837. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  838. InternalWriteMessage(
  839. 3, _Internal::unknown_document(this), target, stream);
  840. }
  841. // bool has_committed_mutations = 4;
  842. if (this->has_committed_mutations() != 0) {
  843. target = stream->EnsureSpace(target);
  844. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_has_committed_mutations(), target);
  845. }
  846. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  847. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
  848. _internal_metadata_.unknown_fields(), target, stream);
  849. }
  850. // @@protoc_insertion_point(serialize_to_array_end:firestore.client.MaybeDocument)
  851. return target;
  852. }
  853. size_t MaybeDocument::ByteSizeLong() const {
  854. // @@protoc_insertion_point(message_byte_size_start:firestore.client.MaybeDocument)
  855. size_t total_size = 0;
  856. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  857. // Prevent compiler warnings about cached_has_bits being unused
  858. (void) cached_has_bits;
  859. // bool has_committed_mutations = 4;
  860. if (this->has_committed_mutations() != 0) {
  861. total_size += 1 + 1;
  862. }
  863. switch (document_type_case()) {
  864. // .firestore.client.NoDocument no_document = 1;
  865. case kNoDocument: {
  866. total_size += 1 +
  867. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  868. *document_type_.no_document_);
  869. break;
  870. }
  871. // .google.firestore.v1.Document document = 2;
  872. case kDocument: {
  873. total_size += 1 +
  874. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  875. *document_type_.document_);
  876. break;
  877. }
  878. // .firestore.client.UnknownDocument unknown_document = 3;
  879. case kUnknownDocument: {
  880. total_size += 1 +
  881. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  882. *document_type_.unknown_document_);
  883. break;
  884. }
  885. case DOCUMENT_TYPE_NOT_SET: {
  886. break;
  887. }
  888. }
  889. if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
  890. return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
  891. _internal_metadata_, total_size, &_cached_size_);
  892. }
  893. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  894. SetCachedSize(cached_size);
  895. return total_size;
  896. }
  897. void MaybeDocument::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  898. // @@protoc_insertion_point(generalized_merge_from_start:firestore.client.MaybeDocument)
  899. GOOGLE_DCHECK_NE(&from, this);
  900. const MaybeDocument* source =
  901. ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MaybeDocument>(
  902. &from);
  903. if (source == nullptr) {
  904. // @@protoc_insertion_point(generalized_merge_from_cast_fail:firestore.client.MaybeDocument)
  905. ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  906. } else {
  907. // @@protoc_insertion_point(generalized_merge_from_cast_success:firestore.client.MaybeDocument)
  908. MergeFrom(*source);
  909. }
  910. }
  911. void MaybeDocument::MergeFrom(const MaybeDocument& from) {
  912. // @@protoc_insertion_point(class_specific_merge_from_start:firestore.client.MaybeDocument)
  913. GOOGLE_DCHECK_NE(&from, this);
  914. _internal_metadata_.MergeFrom(from._internal_metadata_);
  915. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  916. (void) cached_has_bits;
  917. if (from.has_committed_mutations() != 0) {
  918. _internal_set_has_committed_mutations(from._internal_has_committed_mutations());
  919. }
  920. switch (from.document_type_case()) {
  921. case kNoDocument: {
  922. _internal_mutable_no_document()->::firestore::client::NoDocument::MergeFrom(from._internal_no_document());
  923. break;
  924. }
  925. case kDocument: {
  926. _internal_mutable_document()->::google::firestore::v1::Document::MergeFrom(from._internal_document());
  927. break;
  928. }
  929. case kUnknownDocument: {
  930. _internal_mutable_unknown_document()->::firestore::client::UnknownDocument::MergeFrom(from._internal_unknown_document());
  931. break;
  932. }
  933. case DOCUMENT_TYPE_NOT_SET: {
  934. break;
  935. }
  936. }
  937. }
  938. void MaybeDocument::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  939. // @@protoc_insertion_point(generalized_copy_from_start:firestore.client.MaybeDocument)
  940. if (&from == this) return;
  941. Clear();
  942. MergeFrom(from);
  943. }
  944. void MaybeDocument::CopyFrom(const MaybeDocument& from) {
  945. // @@protoc_insertion_point(class_specific_copy_from_start:firestore.client.MaybeDocument)
  946. if (&from == this) return;
  947. Clear();
  948. MergeFrom(from);
  949. }
  950. bool MaybeDocument::IsInitialized() const {
  951. return true;
  952. }
  953. void MaybeDocument::InternalSwap(MaybeDocument* other) {
  954. using std::swap;
  955. _internal_metadata_.Swap(&other->_internal_metadata_);
  956. swap(has_committed_mutations_, other->has_committed_mutations_);
  957. swap(document_type_, other->document_type_);
  958. swap(_oneof_case_[0], other->_oneof_case_[0]);
  959. }
  960. ::PROTOBUF_NAMESPACE_ID::Metadata MaybeDocument::GetMetadata() const {
  961. return GetMetadataStatic();
  962. }
  963. // @@protoc_insertion_point(namespace_scope)
  964. } // namespace client
  965. } // namespace firestore
  966. PROTOBUF_NAMESPACE_OPEN
  967. template<> PROTOBUF_NOINLINE ::firestore::client::NoDocument* Arena::CreateMaybeMessage< ::firestore::client::NoDocument >(Arena* arena) {
  968. return Arena::CreateInternal< ::firestore::client::NoDocument >(arena);
  969. }
  970. template<> PROTOBUF_NOINLINE ::firestore::client::UnknownDocument* Arena::CreateMaybeMessage< ::firestore::client::UnknownDocument >(Arena* arena) {
  971. return Arena::CreateInternal< ::firestore::client::UnknownDocument >(arena);
  972. }
  973. template<> PROTOBUF_NOINLINE ::firestore::client::MaybeDocument* Arena::CreateMaybeMessage< ::firestore::client::MaybeDocument >(Arena* arena) {
  974. return Arena::CreateInternal< ::firestore::client::MaybeDocument >(arena);
  975. }
  976. PROTOBUF_NAMESPACE_CLOSE
  977. // @@protoc_insertion_point(global_scope)
  978. #include <google/protobuf/port_undef.inc>