document.pb.cc 92 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388
  1. /*
  2. * Copyright 2018 Google
  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: google/firestore/v1/document.proto
  18. #include "google/firestore/v1/document.pb.h"
  19. #include <algorithm>
  20. #include <google/protobuf/stubs/common.h>
  21. #include <google/protobuf/io/coded_stream.h>
  22. #include <google/protobuf/extension_set.h>
  23. #include <google/protobuf/wire_format_lite.h>
  24. #include <google/protobuf/descriptor.h>
  25. #include <google/protobuf/generated_message_reflection.h>
  26. #include <google/protobuf/reflection_ops.h>
  27. #include <google/protobuf/wire_format.h>
  28. // @@protoc_insertion_point(includes)
  29. #include <google/protobuf/port_def.inc>
  30. extern PROTOBUF_INTERNAL_EXPORT_google_2ffirestore_2fv1_2fdocument_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_ArrayValue_google_2ffirestore_2fv1_2fdocument_2eproto;
  31. extern PROTOBUF_INTERNAL_EXPORT_google_2ffirestore_2fv1_2fdocument_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Document_FieldsEntry_DoNotUse_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. extern PROTOBUF_INTERNAL_EXPORT_google_2ftype_2flatlng_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_LatLng_google_2ftype_2flatlng_2eproto;
  34. namespace google {
  35. namespace firestore {
  36. namespace v1 {
  37. class Document_FieldsEntry_DoNotUseDefaultTypeInternal {
  38. public:
  39. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Document_FieldsEntry_DoNotUse> _instance;
  40. } _Document_FieldsEntry_DoNotUse_default_instance_;
  41. class DocumentDefaultTypeInternal {
  42. public:
  43. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Document> _instance;
  44. } _Document_default_instance_;
  45. class ValueDefaultTypeInternal {
  46. public:
  47. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<Value> _instance;
  48. int null_value_;
  49. bool boolean_value_;
  50. ::PROTOBUF_NAMESPACE_ID::int64 integer_value_;
  51. double double_value_;
  52. const PROTOBUF_NAMESPACE_ID::Timestamp* timestamp_value_;
  53. ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr string_value_;
  54. ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr bytes_value_;
  55. ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr reference_value_;
  56. const ::google::type::LatLng* geo_point_value_;
  57. const ::google::firestore::v1::ArrayValue* array_value_;
  58. const ::google::firestore::v1::MapValue* map_value_;
  59. } _Value_default_instance_;
  60. class ArrayValueDefaultTypeInternal {
  61. public:
  62. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<ArrayValue> _instance;
  63. } _ArrayValue_default_instance_;
  64. class MapValue_FieldsEntry_DoNotUseDefaultTypeInternal {
  65. public:
  66. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MapValue_FieldsEntry_DoNotUse> _instance;
  67. } _MapValue_FieldsEntry_DoNotUse_default_instance_;
  68. class MapValueDefaultTypeInternal {
  69. public:
  70. ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<MapValue> _instance;
  71. } _MapValue_default_instance_;
  72. } // namespace v1
  73. } // namespace firestore
  74. } // namespace google
  75. static void InitDefaultsscc_info_ArrayValue_google_2ffirestore_2fv1_2fdocument_2eproto() {
  76. GOOGLE_PROTOBUF_VERIFY_VERSION;
  77. {
  78. void* ptr = &::google::firestore::v1::_Value_default_instance_;
  79. new (ptr) ::google::firestore::v1::Value();
  80. ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  81. }
  82. {
  83. void* ptr = &::google::firestore::v1::_ArrayValue_default_instance_;
  84. new (ptr) ::google::firestore::v1::ArrayValue();
  85. ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  86. }
  87. {
  88. void* ptr = &::google::firestore::v1::_MapValue_FieldsEntry_DoNotUse_default_instance_;
  89. new (ptr) ::google::firestore::v1::MapValue_FieldsEntry_DoNotUse();
  90. }
  91. {
  92. void* ptr = &::google::firestore::v1::_MapValue_default_instance_;
  93. new (ptr) ::google::firestore::v1::MapValue();
  94. ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  95. }
  96. ::google::firestore::v1::Value::InitAsDefaultInstance();
  97. ::google::firestore::v1::ArrayValue::InitAsDefaultInstance();
  98. ::google::firestore::v1::MapValue_FieldsEntry_DoNotUse::InitAsDefaultInstance();
  99. ::google::firestore::v1::MapValue::InitAsDefaultInstance();
  100. }
  101. ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_ArrayValue_google_2ffirestore_2fv1_2fdocument_2eproto =
  102. {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_ArrayValue_google_2ffirestore_2fv1_2fdocument_2eproto}, {
  103. &scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto.base,
  104. &scc_info_LatLng_google_2ftype_2flatlng_2eproto.base,}};
  105. static void InitDefaultsscc_info_Document_google_2ffirestore_2fv1_2fdocument_2eproto() {
  106. GOOGLE_PROTOBUF_VERIFY_VERSION;
  107. {
  108. void* ptr = &::google::firestore::v1::_Document_default_instance_;
  109. new (ptr) ::google::firestore::v1::Document();
  110. ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr);
  111. }
  112. ::google::firestore::v1::Document::InitAsDefaultInstance();
  113. }
  114. ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_Document_google_2ffirestore_2fv1_2fdocument_2eproto =
  115. {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, InitDefaultsscc_info_Document_google_2ffirestore_2fv1_2fdocument_2eproto}, {
  116. &scc_info_Document_FieldsEntry_DoNotUse_google_2ffirestore_2fv1_2fdocument_2eproto.base,
  117. &scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto.base,}};
  118. static void InitDefaultsscc_info_Document_FieldsEntry_DoNotUse_google_2ffirestore_2fv1_2fdocument_2eproto() {
  119. GOOGLE_PROTOBUF_VERIFY_VERSION;
  120. {
  121. void* ptr = &::google::firestore::v1::_Document_FieldsEntry_DoNotUse_default_instance_;
  122. new (ptr) ::google::firestore::v1::Document_FieldsEntry_DoNotUse();
  123. }
  124. ::google::firestore::v1::Document_FieldsEntry_DoNotUse::InitAsDefaultInstance();
  125. }
  126. ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_Document_FieldsEntry_DoNotUse_google_2ffirestore_2fv1_2fdocument_2eproto =
  127. {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, InitDefaultsscc_info_Document_FieldsEntry_DoNotUse_google_2ffirestore_2fv1_2fdocument_2eproto}, {
  128. &scc_info_ArrayValue_google_2ffirestore_2fv1_2fdocument_2eproto.base,}};
  129. static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_google_2ffirestore_2fv1_2fdocument_2eproto[6];
  130. static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_google_2ffirestore_2fv1_2fdocument_2eproto = nullptr;
  131. static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_google_2ffirestore_2fv1_2fdocument_2eproto = nullptr;
  132. const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_google_2ffirestore_2fv1_2fdocument_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  133. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::Document_FieldsEntry_DoNotUse, _has_bits_),
  134. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::Document_FieldsEntry_DoNotUse, _internal_metadata_),
  135. ~0u, // no _extensions_
  136. ~0u, // no _oneof_case_
  137. ~0u, // no _weak_field_map_
  138. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::Document_FieldsEntry_DoNotUse, key_),
  139. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::Document_FieldsEntry_DoNotUse, value_),
  140. 0,
  141. 1,
  142. ~0u, // no _has_bits_
  143. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::Document, _internal_metadata_),
  144. ~0u, // no _extensions_
  145. ~0u, // no _oneof_case_
  146. ~0u, // no _weak_field_map_
  147. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::Document, name_),
  148. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::Document, fields_),
  149. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::Document, create_time_),
  150. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::Document, update_time_),
  151. ~0u, // no _has_bits_
  152. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::Value, _internal_metadata_),
  153. ~0u, // no _extensions_
  154. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::Value, _oneof_case_[0]),
  155. ~0u, // no _weak_field_map_
  156. offsetof(::google::firestore::v1::ValueDefaultTypeInternal, null_value_),
  157. offsetof(::google::firestore::v1::ValueDefaultTypeInternal, boolean_value_),
  158. offsetof(::google::firestore::v1::ValueDefaultTypeInternal, integer_value_),
  159. offsetof(::google::firestore::v1::ValueDefaultTypeInternal, double_value_),
  160. offsetof(::google::firestore::v1::ValueDefaultTypeInternal, timestamp_value_),
  161. offsetof(::google::firestore::v1::ValueDefaultTypeInternal, string_value_),
  162. offsetof(::google::firestore::v1::ValueDefaultTypeInternal, bytes_value_),
  163. offsetof(::google::firestore::v1::ValueDefaultTypeInternal, reference_value_),
  164. offsetof(::google::firestore::v1::ValueDefaultTypeInternal, geo_point_value_),
  165. offsetof(::google::firestore::v1::ValueDefaultTypeInternal, array_value_),
  166. offsetof(::google::firestore::v1::ValueDefaultTypeInternal, map_value_),
  167. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::Value, value_type_),
  168. ~0u, // no _has_bits_
  169. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::ArrayValue, _internal_metadata_),
  170. ~0u, // no _extensions_
  171. ~0u, // no _oneof_case_
  172. ~0u, // no _weak_field_map_
  173. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::ArrayValue, values_),
  174. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::MapValue_FieldsEntry_DoNotUse, _has_bits_),
  175. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::MapValue_FieldsEntry_DoNotUse, _internal_metadata_),
  176. ~0u, // no _extensions_
  177. ~0u, // no _oneof_case_
  178. ~0u, // no _weak_field_map_
  179. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::MapValue_FieldsEntry_DoNotUse, key_),
  180. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::MapValue_FieldsEntry_DoNotUse, value_),
  181. 0,
  182. 1,
  183. ~0u, // no _has_bits_
  184. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::MapValue, _internal_metadata_),
  185. ~0u, // no _extensions_
  186. ~0u, // no _oneof_case_
  187. ~0u, // no _weak_field_map_
  188. PROTOBUF_FIELD_OFFSET(::google::firestore::v1::MapValue, fields_),
  189. };
  190. static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  191. { 0, 7, sizeof(::google::firestore::v1::Document_FieldsEntry_DoNotUse)},
  192. { 9, -1, sizeof(::google::firestore::v1::Document)},
  193. { 18, -1, sizeof(::google::firestore::v1::Value)},
  194. { 35, -1, sizeof(::google::firestore::v1::ArrayValue)},
  195. { 41, 48, sizeof(::google::firestore::v1::MapValue_FieldsEntry_DoNotUse)},
  196. { 50, -1, sizeof(::google::firestore::v1::MapValue)},
  197. };
  198. static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
  199. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::firestore::v1::_Document_FieldsEntry_DoNotUse_default_instance_),
  200. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::firestore::v1::_Document_default_instance_),
  201. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::firestore::v1::_Value_default_instance_),
  202. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::firestore::v1::_ArrayValue_default_instance_),
  203. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::firestore::v1::_MapValue_FieldsEntry_DoNotUse_default_instance_),
  204. reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::google::firestore::v1::_MapValue_default_instance_),
  205. };
  206. const char descriptor_table_protodef_google_2ffirestore_2fv1_2fdocument_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
  207. "\n\"google/firestore/v1/document.proto\022\023go"
  208. "ogle.firestore.v1\032\034google/api/annotation"
  209. "s.proto\032\034google/protobuf/struct.proto\032\037g"
  210. "oogle/protobuf/timestamp.proto\032\030google/t"
  211. "ype/latlng.proto\"\200\002\n\010Document\022\014\n\004name\030\001 "
  212. "\001(\t\0229\n\006fields\030\002 \003(\0132).google.firestore.v"
  213. "1.Document.FieldsEntry\022/\n\013create_time\030\003 "
  214. "\001(\0132\032.google.protobuf.Timestamp\022/\n\013updat"
  215. "e_time\030\004 \001(\0132\032.google.protobuf.Timestamp"
  216. "\032I\n\013FieldsEntry\022\013\n\003key\030\001 \001(\t\022)\n\005value\030\002 "
  217. "\001(\0132\032.google.firestore.v1.Value:\0028\001\"\256\003\n\005"
  218. "Value\0220\n\nnull_value\030\013 \001(\0162\032.google.proto"
  219. "buf.NullValueH\000\022\027\n\rboolean_value\030\001 \001(\010H\000"
  220. "\022\027\n\rinteger_value\030\002 \001(\003H\000\022\026\n\014double_valu"
  221. "e\030\003 \001(\001H\000\0225\n\017timestamp_value\030\n \001(\0132\032.goo"
  222. "gle.protobuf.TimestampH\000\022\026\n\014string_value"
  223. "\030\021 \001(\tH\000\022\025\n\013bytes_value\030\022 \001(\014H\000\022\031\n\017refer"
  224. "ence_value\030\005 \001(\tH\000\022.\n\017geo_point_value\030\010 "
  225. "\001(\0132\023.google.type.LatLngH\000\0226\n\013array_valu"
  226. "e\030\t \001(\0132\037.google.firestore.v1.ArrayValue"
  227. "H\000\0222\n\tmap_value\030\006 \001(\0132\035.google.firestore"
  228. ".v1.MapValueH\000B\014\n\nvalue_type\"8\n\nArrayVal"
  229. "ue\022*\n\006values\030\001 \003(\0132\032.google.firestore.v1"
  230. ".Value\"\220\001\n\010MapValue\0229\n\006fields\030\001 \003(\0132).go"
  231. "ogle.firestore.v1.MapValue.FieldsEntry\032I"
  232. "\n\013FieldsEntry\022\013\n\003key\030\001 \001(\t\022)\n\005value\030\002 \001("
  233. "\0132\032.google.firestore.v1.Value:\0028\001B\261\001\n\027co"
  234. "m.google.firestore.v1B\rDocumentProtoP\001Z<"
  235. "google.golang.org/genproto/googleapis/fi"
  236. "restore/v1;firestore\242\002\004GCFS\252\002\036Google.Clo"
  237. "ud.Firestore.V1Beta1\312\002\036Google\\Cloud\\Fire"
  238. "store\\V1beta1b\006proto3"
  239. ;
  240. static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_google_2ffirestore_2fv1_2fdocument_2eproto_deps[4] = {
  241. &::descriptor_table_google_2fapi_2fannotations_2eproto,
  242. &::descriptor_table_google_2fprotobuf_2fstruct_2eproto,
  243. &::descriptor_table_google_2fprotobuf_2ftimestamp_2eproto,
  244. &::descriptor_table_google_2ftype_2flatlng_2eproto,
  245. };
  246. static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_google_2ffirestore_2fv1_2fdocument_2eproto_sccs[3] = {
  247. &scc_info_ArrayValue_google_2ffirestore_2fv1_2fdocument_2eproto.base,
  248. &scc_info_Document_google_2ffirestore_2fv1_2fdocument_2eproto.base,
  249. &scc_info_Document_FieldsEntry_DoNotUse_google_2ffirestore_2fv1_2fdocument_2eproto.base,
  250. };
  251. static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_google_2ffirestore_2fv1_2fdocument_2eproto_once;
  252. static bool descriptor_table_google_2ffirestore_2fv1_2fdocument_2eproto_initialized = false;
  253. const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_google_2ffirestore_2fv1_2fdocument_2eproto = {
  254. &descriptor_table_google_2ffirestore_2fv1_2fdocument_2eproto_initialized, descriptor_table_protodef_google_2ffirestore_2fv1_2fdocument_2eproto, "google/firestore/v1/document.proto", 1261,
  255. &descriptor_table_google_2ffirestore_2fv1_2fdocument_2eproto_once, descriptor_table_google_2ffirestore_2fv1_2fdocument_2eproto_sccs, descriptor_table_google_2ffirestore_2fv1_2fdocument_2eproto_deps, 3, 4,
  256. schemas, file_default_instances, TableStruct_google_2ffirestore_2fv1_2fdocument_2eproto::offsets,
  257. file_level_metadata_google_2ffirestore_2fv1_2fdocument_2eproto, 6, file_level_enum_descriptors_google_2ffirestore_2fv1_2fdocument_2eproto, file_level_service_descriptors_google_2ffirestore_2fv1_2fdocument_2eproto,
  258. };
  259. // Force running AddDescriptors() at dynamic initialization time.
  260. static bool dynamic_init_dummy_google_2ffirestore_2fv1_2fdocument_2eproto = ( ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_google_2ffirestore_2fv1_2fdocument_2eproto), true);
  261. namespace google {
  262. namespace firestore {
  263. namespace v1 {
  264. // ===================================================================
  265. Document_FieldsEntry_DoNotUse::Document_FieldsEntry_DoNotUse() {}
  266. Document_FieldsEntry_DoNotUse::Document_FieldsEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  267. : SuperType(arena) {}
  268. void Document_FieldsEntry_DoNotUse::MergeFrom(const Document_FieldsEntry_DoNotUse& other) {
  269. MergeFromInternal(other);
  270. }
  271. ::PROTOBUF_NAMESPACE_ID::Metadata Document_FieldsEntry_DoNotUse::GetMetadata() const {
  272. return GetMetadataStatic();
  273. }
  274. void Document_FieldsEntry_DoNotUse::MergeFrom(
  275. const ::PROTOBUF_NAMESPACE_ID::Message& other) {
  276. ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom(other);
  277. }
  278. // ===================================================================
  279. void Document::InitAsDefaultInstance() {
  280. ::google::firestore::v1::_Document_default_instance_._instance.get_mutable()->create_time_ = const_cast< PROTOBUF_NAMESPACE_ID::Timestamp*>(
  281. PROTOBUF_NAMESPACE_ID::Timestamp::internal_default_instance());
  282. ::google::firestore::v1::_Document_default_instance_._instance.get_mutable()->update_time_ = const_cast< PROTOBUF_NAMESPACE_ID::Timestamp*>(
  283. PROTOBUF_NAMESPACE_ID::Timestamp::internal_default_instance());
  284. }
  285. class Document::_Internal {
  286. public:
  287. static const PROTOBUF_NAMESPACE_ID::Timestamp& create_time(const Document* msg);
  288. static const PROTOBUF_NAMESPACE_ID::Timestamp& update_time(const Document* msg);
  289. };
  290. const PROTOBUF_NAMESPACE_ID::Timestamp&
  291. Document::_Internal::create_time(const Document* msg) {
  292. return *msg->create_time_;
  293. }
  294. const PROTOBUF_NAMESPACE_ID::Timestamp&
  295. Document::_Internal::update_time(const Document* msg) {
  296. return *msg->update_time_;
  297. }
  298. void Document::clear_create_time() {
  299. if (GetArenaNoVirtual() == nullptr && create_time_ != nullptr) {
  300. delete create_time_;
  301. }
  302. create_time_ = nullptr;
  303. }
  304. void Document::clear_update_time() {
  305. if (GetArenaNoVirtual() == nullptr && update_time_ != nullptr) {
  306. delete update_time_;
  307. }
  308. update_time_ = nullptr;
  309. }
  310. Document::Document()
  311. : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  312. SharedCtor();
  313. // @@protoc_insertion_point(constructor:google.firestore.v1.Document)
  314. }
  315. Document::Document(const Document& from)
  316. : ::PROTOBUF_NAMESPACE_ID::Message(),
  317. _internal_metadata_(nullptr) {
  318. _internal_metadata_.MergeFrom(from._internal_metadata_);
  319. fields_.MergeFrom(from.fields_);
  320. name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  321. if (!from.name().empty()) {
  322. name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
  323. }
  324. if (from.has_create_time()) {
  325. create_time_ = new PROTOBUF_NAMESPACE_ID::Timestamp(*from.create_time_);
  326. } else {
  327. create_time_ = nullptr;
  328. }
  329. if (from.has_update_time()) {
  330. update_time_ = new PROTOBUF_NAMESPACE_ID::Timestamp(*from.update_time_);
  331. } else {
  332. update_time_ = nullptr;
  333. }
  334. // @@protoc_insertion_point(copy_constructor:google.firestore.v1.Document)
  335. }
  336. void Document::SharedCtor() {
  337. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Document_google_2ffirestore_2fv1_2fdocument_2eproto.base);
  338. name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  339. ::memset(&create_time_, 0, static_cast<size_t>(
  340. reinterpret_cast<char*>(&update_time_) -
  341. reinterpret_cast<char*>(&create_time_)) + sizeof(update_time_));
  342. }
  343. Document::~Document() {
  344. // @@protoc_insertion_point(destructor:google.firestore.v1.Document)
  345. SharedDtor();
  346. }
  347. void Document::SharedDtor() {
  348. name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  349. if (this != internal_default_instance()) delete create_time_;
  350. if (this != internal_default_instance()) delete update_time_;
  351. }
  352. void Document::SetCachedSize(int size) const {
  353. _cached_size_.Set(size);
  354. }
  355. const Document& Document::default_instance() {
  356. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Document_google_2ffirestore_2fv1_2fdocument_2eproto.base);
  357. return *internal_default_instance();
  358. }
  359. void Document::Clear() {
  360. // @@protoc_insertion_point(message_clear_start:google.firestore.v1.Document)
  361. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  362. // Prevent compiler warnings about cached_has_bits being unused
  363. (void) cached_has_bits;
  364. fields_.Clear();
  365. name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  366. if (GetArenaNoVirtual() == nullptr && create_time_ != nullptr) {
  367. delete create_time_;
  368. }
  369. create_time_ = nullptr;
  370. if (GetArenaNoVirtual() == nullptr && update_time_ != nullptr) {
  371. delete update_time_;
  372. }
  373. update_time_ = nullptr;
  374. _internal_metadata_.Clear();
  375. }
  376. #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  377. const char* Document::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  378. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  379. while (!ctx->Done(&ptr)) {
  380. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  381. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  382. CHK_(ptr);
  383. switch (tag >> 3) {
  384. // string name = 1;
  385. case 1:
  386. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
  387. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_name(), ptr, ctx, "google.firestore.v1.Document.name");
  388. CHK_(ptr);
  389. } else goto handle_unusual;
  390. continue;
  391. // map<string, .google.firestore.v1.Value> fields = 2;
  392. case 2:
  393. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
  394. ptr -= 1;
  395. do {
  396. ptr += 1;
  397. ptr = ctx->ParseMessage(&fields_, ptr);
  398. CHK_(ptr);
  399. if (!ctx->DataAvailable(ptr)) break;
  400. } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 18);
  401. } else goto handle_unusual;
  402. continue;
  403. // .google.protobuf.Timestamp create_time = 3;
  404. case 3:
  405. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) {
  406. ptr = ctx->ParseMessage(mutable_create_time(), ptr);
  407. CHK_(ptr);
  408. } else goto handle_unusual;
  409. continue;
  410. // .google.protobuf.Timestamp update_time = 4;
  411. case 4:
  412. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) {
  413. ptr = ctx->ParseMessage(mutable_update_time(), ptr);
  414. CHK_(ptr);
  415. } else goto handle_unusual;
  416. continue;
  417. default: {
  418. handle_unusual:
  419. if ((tag & 7) == 4 || tag == 0) {
  420. ctx->SetLastTag(tag);
  421. goto success;
  422. }
  423. ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
  424. CHK_(ptr != nullptr);
  425. continue;
  426. }
  427. } // switch
  428. } // while
  429. success:
  430. return ptr;
  431. failure:
  432. ptr = nullptr;
  433. goto success;
  434. #undef CHK_
  435. }
  436. #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  437. bool Document::MergePartialFromCodedStream(
  438. ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
  439. #define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
  440. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  441. // @@protoc_insertion_point(parse_start:google.firestore.v1.Document)
  442. for (;;) {
  443. ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  444. tag = p.first;
  445. if (!p.second) goto handle_unusual;
  446. switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  447. // string name = 1;
  448. case 1: {
  449. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
  450. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
  451. input, this->mutable_name()));
  452. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  453. this->name().data(), static_cast<int>(this->name().length()),
  454. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
  455. "google.firestore.v1.Document.name"));
  456. } else {
  457. goto handle_unusual;
  458. }
  459. break;
  460. }
  461. // map<string, .google.firestore.v1.Value> fields = 2;
  462. case 2: {
  463. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (18 & 0xFF)) {
  464. Document_FieldsEntry_DoNotUse::Parser< ::PROTOBUF_NAMESPACE_ID::internal::MapField<
  465. Document_FieldsEntry_DoNotUse,
  466. std::string, ::google::firestore::v1::Value,
  467. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
  468. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE,
  469. 0 >,
  470. ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value > > parser(&fields_);
  471. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessageNoVirtual(
  472. input, &parser));
  473. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  474. parser.key().data(), static_cast<int>(parser.key().length()),
  475. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
  476. "google.firestore.v1.Document.FieldsEntry.key"));
  477. } else {
  478. goto handle_unusual;
  479. }
  480. break;
  481. }
  482. // .google.protobuf.Timestamp create_time = 3;
  483. case 3: {
  484. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (26 & 0xFF)) {
  485. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
  486. input, mutable_create_time()));
  487. } else {
  488. goto handle_unusual;
  489. }
  490. break;
  491. }
  492. // .google.protobuf.Timestamp update_time = 4;
  493. case 4: {
  494. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (34 & 0xFF)) {
  495. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
  496. input, mutable_update_time()));
  497. } else {
  498. goto handle_unusual;
  499. }
  500. break;
  501. }
  502. default: {
  503. handle_unusual:
  504. if (tag == 0) {
  505. goto success;
  506. }
  507. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
  508. input, tag, _internal_metadata_.mutable_unknown_fields()));
  509. break;
  510. }
  511. }
  512. }
  513. success:
  514. // @@protoc_insertion_point(parse_success:google.firestore.v1.Document)
  515. return true;
  516. failure:
  517. // @@protoc_insertion_point(parse_failure:google.firestore.v1.Document)
  518. return false;
  519. #undef DO_
  520. }
  521. #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  522. void Document::SerializeWithCachedSizes(
  523. ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
  524. // @@protoc_insertion_point(serialize_start:google.firestore.v1.Document)
  525. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  526. (void) cached_has_bits;
  527. // string name = 1;
  528. if (this->name().size() > 0) {
  529. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  530. this->name().data(), static_cast<int>(this->name().length()),
  531. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  532. "google.firestore.v1.Document.name");
  533. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
  534. 1, this->name(), output);
  535. }
  536. // map<string, .google.firestore.v1.Value> fields = 2;
  537. if (!this->fields().empty()) {
  538. typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value >::const_pointer
  539. ConstPtr;
  540. typedef ConstPtr SortItem;
  541. typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst<SortItem> Less;
  542. struct Utf8Check {
  543. static void Check(ConstPtr p) {
  544. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  545. p->first.data(), static_cast<int>(p->first.length()),
  546. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  547. "google.firestore.v1.Document.FieldsEntry.key");
  548. }
  549. };
  550. if (output->IsSerializationDeterministic() &&
  551. this->fields().size() > 1) {
  552. ::std::unique_ptr<SortItem[]> items(
  553. new SortItem[this->fields().size()]);
  554. typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value >::size_type size_type;
  555. size_type n = 0;
  556. for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value >::const_iterator
  557. it = this->fields().begin();
  558. it != this->fields().end(); ++it, ++n) {
  559. items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
  560. }
  561. ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
  562. for (size_type i = 0; i < n; i++) {
  563. Document_FieldsEntry_DoNotUse::Funcs::SerializeToCodedStream(2, items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second, output);
  564. Utf8Check::Check(&(*items[static_cast<ptrdiff_t>(i)]));
  565. }
  566. } else {
  567. for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value >::const_iterator
  568. it = this->fields().begin();
  569. it != this->fields().end(); ++it) {
  570. Document_FieldsEntry_DoNotUse::Funcs::SerializeToCodedStream(2, it->first, it->second, output);
  571. Utf8Check::Check(&(*it));
  572. }
  573. }
  574. }
  575. // .google.protobuf.Timestamp create_time = 3;
  576. if (this->has_create_time()) {
  577. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
  578. 3, _Internal::create_time(this), output);
  579. }
  580. // .google.protobuf.Timestamp update_time = 4;
  581. if (this->has_update_time()) {
  582. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
  583. 4, _Internal::update_time(this), output);
  584. }
  585. if (_internal_metadata_.have_unknown_fields()) {
  586. ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
  587. _internal_metadata_.unknown_fields(), output);
  588. }
  589. // @@protoc_insertion_point(serialize_end:google.firestore.v1.Document)
  590. }
  591. ::PROTOBUF_NAMESPACE_ID::uint8* Document::InternalSerializeWithCachedSizesToArray(
  592. ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
  593. // @@protoc_insertion_point(serialize_to_array_start:google.firestore.v1.Document)
  594. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  595. (void) cached_has_bits;
  596. // string name = 1;
  597. if (this->name().size() > 0) {
  598. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  599. this->name().data(), static_cast<int>(this->name().length()),
  600. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  601. "google.firestore.v1.Document.name");
  602. target =
  603. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
  604. 1, this->name(), target);
  605. }
  606. // map<string, .google.firestore.v1.Value> fields = 2;
  607. if (!this->fields().empty()) {
  608. typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value >::const_pointer
  609. ConstPtr;
  610. typedef ConstPtr SortItem;
  611. typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst<SortItem> Less;
  612. struct Utf8Check {
  613. static void Check(ConstPtr p) {
  614. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  615. p->first.data(), static_cast<int>(p->first.length()),
  616. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  617. "google.firestore.v1.Document.FieldsEntry.key");
  618. }
  619. };
  620. if (false &&
  621. this->fields().size() > 1) {
  622. ::std::unique_ptr<SortItem[]> items(
  623. new SortItem[this->fields().size()]);
  624. typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value >::size_type size_type;
  625. size_type n = 0;
  626. for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value >::const_iterator
  627. it = this->fields().begin();
  628. it != this->fields().end(); ++it, ++n) {
  629. items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
  630. }
  631. ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
  632. for (size_type i = 0; i < n; i++) {
  633. target = Document_FieldsEntry_DoNotUse::Funcs::SerializeToArray(2, items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second, target);
  634. Utf8Check::Check(&(*items[static_cast<ptrdiff_t>(i)]));
  635. }
  636. } else {
  637. for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value >::const_iterator
  638. it = this->fields().begin();
  639. it != this->fields().end(); ++it) {
  640. target = Document_FieldsEntry_DoNotUse::Funcs::SerializeToArray(2, it->first, it->second, target);
  641. Utf8Check::Check(&(*it));
  642. }
  643. }
  644. }
  645. // .google.protobuf.Timestamp create_time = 3;
  646. if (this->has_create_time()) {
  647. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  648. InternalWriteMessageToArray(
  649. 3, _Internal::create_time(this), target);
  650. }
  651. // .google.protobuf.Timestamp update_time = 4;
  652. if (this->has_update_time()) {
  653. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  654. InternalWriteMessageToArray(
  655. 4, _Internal::update_time(this), target);
  656. }
  657. if (_internal_metadata_.have_unknown_fields()) {
  658. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
  659. _internal_metadata_.unknown_fields(), target);
  660. }
  661. // @@protoc_insertion_point(serialize_to_array_end:google.firestore.v1.Document)
  662. return target;
  663. }
  664. size_t Document::ByteSizeLong() const {
  665. // @@protoc_insertion_point(message_byte_size_start:google.firestore.v1.Document)
  666. size_t total_size = 0;
  667. if (_internal_metadata_.have_unknown_fields()) {
  668. total_size +=
  669. ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
  670. _internal_metadata_.unknown_fields());
  671. }
  672. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  673. // Prevent compiler warnings about cached_has_bits being unused
  674. (void) cached_has_bits;
  675. // map<string, .google.firestore.v1.Value> fields = 2;
  676. total_size += 1 *
  677. ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->fields_size());
  678. for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value >::const_iterator
  679. it = this->fields().begin();
  680. it != this->fields().end(); ++it) {
  681. total_size += Document_FieldsEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
  682. }
  683. // string name = 1;
  684. if (this->name().size() > 0) {
  685. total_size += 1 +
  686. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  687. this->name());
  688. }
  689. // .google.protobuf.Timestamp create_time = 3;
  690. if (this->has_create_time()) {
  691. total_size += 1 +
  692. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  693. *create_time_);
  694. }
  695. // .google.protobuf.Timestamp update_time = 4;
  696. if (this->has_update_time()) {
  697. total_size += 1 +
  698. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  699. *update_time_);
  700. }
  701. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  702. SetCachedSize(cached_size);
  703. return total_size;
  704. }
  705. void Document::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  706. // @@protoc_insertion_point(generalized_merge_from_start:google.firestore.v1.Document)
  707. GOOGLE_DCHECK_NE(&from, this);
  708. const Document* source =
  709. ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Document>(
  710. &from);
  711. if (source == nullptr) {
  712. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.firestore.v1.Document)
  713. ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  714. } else {
  715. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.firestore.v1.Document)
  716. MergeFrom(*source);
  717. }
  718. }
  719. void Document::MergeFrom(const Document& from) {
  720. // @@protoc_insertion_point(class_specific_merge_from_start:google.firestore.v1.Document)
  721. GOOGLE_DCHECK_NE(&from, this);
  722. _internal_metadata_.MergeFrom(from._internal_metadata_);
  723. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  724. (void) cached_has_bits;
  725. fields_.MergeFrom(from.fields_);
  726. if (from.name().size() > 0) {
  727. name_.AssignWithDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from.name_);
  728. }
  729. if (from.has_create_time()) {
  730. mutable_create_time()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from.create_time());
  731. }
  732. if (from.has_update_time()) {
  733. mutable_update_time()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from.update_time());
  734. }
  735. }
  736. void Document::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  737. // @@protoc_insertion_point(generalized_copy_from_start:google.firestore.v1.Document)
  738. if (&from == this) return;
  739. Clear();
  740. MergeFrom(from);
  741. }
  742. void Document::CopyFrom(const Document& from) {
  743. // @@protoc_insertion_point(class_specific_copy_from_start:google.firestore.v1.Document)
  744. if (&from == this) return;
  745. Clear();
  746. MergeFrom(from);
  747. }
  748. bool Document::IsInitialized() const {
  749. return true;
  750. }
  751. void Document::InternalSwap(Document* other) {
  752. using std::swap;
  753. _internal_metadata_.Swap(&other->_internal_metadata_);
  754. fields_.Swap(&other->fields_);
  755. name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
  756. GetArenaNoVirtual());
  757. swap(create_time_, other->create_time_);
  758. swap(update_time_, other->update_time_);
  759. }
  760. ::PROTOBUF_NAMESPACE_ID::Metadata Document::GetMetadata() const {
  761. return GetMetadataStatic();
  762. }
  763. // ===================================================================
  764. void Value::InitAsDefaultInstance() {
  765. ::google::firestore::v1::_Value_default_instance_.null_value_ = 0;
  766. ::google::firestore::v1::_Value_default_instance_.boolean_value_ = false;
  767. ::google::firestore::v1::_Value_default_instance_.integer_value_ = PROTOBUF_LONGLONG(0);
  768. ::google::firestore::v1::_Value_default_instance_.double_value_ = 0;
  769. ::google::firestore::v1::_Value_default_instance_.timestamp_value_ = const_cast< PROTOBUF_NAMESPACE_ID::Timestamp*>(
  770. PROTOBUF_NAMESPACE_ID::Timestamp::internal_default_instance());
  771. ::google::firestore::v1::_Value_default_instance_.string_value_.UnsafeSetDefault(
  772. &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  773. ::google::firestore::v1::_Value_default_instance_.bytes_value_.UnsafeSetDefault(
  774. &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  775. ::google::firestore::v1::_Value_default_instance_.reference_value_.UnsafeSetDefault(
  776. &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  777. ::google::firestore::v1::_Value_default_instance_.geo_point_value_ = const_cast< ::google::type::LatLng*>(
  778. ::google::type::LatLng::internal_default_instance());
  779. ::google::firestore::v1::_Value_default_instance_.array_value_ = const_cast< ::google::firestore::v1::ArrayValue*>(
  780. ::google::firestore::v1::ArrayValue::internal_default_instance());
  781. ::google::firestore::v1::_Value_default_instance_.map_value_ = const_cast< ::google::firestore::v1::MapValue*>(
  782. ::google::firestore::v1::MapValue::internal_default_instance());
  783. }
  784. class Value::_Internal {
  785. public:
  786. static const PROTOBUF_NAMESPACE_ID::Timestamp& timestamp_value(const Value* msg);
  787. static const ::google::type::LatLng& geo_point_value(const Value* msg);
  788. static const ::google::firestore::v1::ArrayValue& array_value(const Value* msg);
  789. static const ::google::firestore::v1::MapValue& map_value(const Value* msg);
  790. };
  791. const PROTOBUF_NAMESPACE_ID::Timestamp&
  792. Value::_Internal::timestamp_value(const Value* msg) {
  793. return *msg->value_type_.timestamp_value_;
  794. }
  795. const ::google::type::LatLng&
  796. Value::_Internal::geo_point_value(const Value* msg) {
  797. return *msg->value_type_.geo_point_value_;
  798. }
  799. const ::google::firestore::v1::ArrayValue&
  800. Value::_Internal::array_value(const Value* msg) {
  801. return *msg->value_type_.array_value_;
  802. }
  803. const ::google::firestore::v1::MapValue&
  804. Value::_Internal::map_value(const Value* msg) {
  805. return *msg->value_type_.map_value_;
  806. }
  807. void Value::set_allocated_timestamp_value(PROTOBUF_NAMESPACE_ID::Timestamp* timestamp_value) {
  808. ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
  809. clear_value_type();
  810. if (timestamp_value) {
  811. ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
  812. reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(timestamp_value)->GetArena();
  813. if (message_arena != submessage_arena) {
  814. timestamp_value = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
  815. message_arena, timestamp_value, submessage_arena);
  816. }
  817. set_has_timestamp_value();
  818. value_type_.timestamp_value_ = timestamp_value;
  819. }
  820. // @@protoc_insertion_point(field_set_allocated:google.firestore.v1.Value.timestamp_value)
  821. }
  822. void Value::clear_timestamp_value() {
  823. if (has_timestamp_value()) {
  824. delete value_type_.timestamp_value_;
  825. clear_has_value_type();
  826. }
  827. }
  828. void Value::set_allocated_geo_point_value(::google::type::LatLng* geo_point_value) {
  829. ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
  830. clear_value_type();
  831. if (geo_point_value) {
  832. ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
  833. if (message_arena != submessage_arena) {
  834. geo_point_value = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
  835. message_arena, geo_point_value, submessage_arena);
  836. }
  837. set_has_geo_point_value();
  838. value_type_.geo_point_value_ = geo_point_value;
  839. }
  840. // @@protoc_insertion_point(field_set_allocated:google.firestore.v1.Value.geo_point_value)
  841. }
  842. void Value::clear_geo_point_value() {
  843. if (has_geo_point_value()) {
  844. delete value_type_.geo_point_value_;
  845. clear_has_value_type();
  846. }
  847. }
  848. void Value::set_allocated_array_value(::google::firestore::v1::ArrayValue* array_value) {
  849. ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
  850. clear_value_type();
  851. if (array_value) {
  852. ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
  853. if (message_arena != submessage_arena) {
  854. array_value = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
  855. message_arena, array_value, submessage_arena);
  856. }
  857. set_has_array_value();
  858. value_type_.array_value_ = array_value;
  859. }
  860. // @@protoc_insertion_point(field_set_allocated:google.firestore.v1.Value.array_value)
  861. }
  862. void Value::set_allocated_map_value(::google::firestore::v1::MapValue* map_value) {
  863. ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual();
  864. clear_value_type();
  865. if (map_value) {
  866. ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr;
  867. if (message_arena != submessage_arena) {
  868. map_value = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
  869. message_arena, map_value, submessage_arena);
  870. }
  871. set_has_map_value();
  872. value_type_.map_value_ = map_value;
  873. }
  874. // @@protoc_insertion_point(field_set_allocated:google.firestore.v1.Value.map_value)
  875. }
  876. Value::Value()
  877. : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  878. SharedCtor();
  879. // @@protoc_insertion_point(constructor:google.firestore.v1.Value)
  880. }
  881. Value::Value(const Value& from)
  882. : ::PROTOBUF_NAMESPACE_ID::Message(),
  883. _internal_metadata_(nullptr) {
  884. _internal_metadata_.MergeFrom(from._internal_metadata_);
  885. clear_has_value_type();
  886. switch (from.value_type_case()) {
  887. case kNullValue: {
  888. set_null_value(from.null_value());
  889. break;
  890. }
  891. case kBooleanValue: {
  892. set_boolean_value(from.boolean_value());
  893. break;
  894. }
  895. case kIntegerValue: {
  896. set_integer_value(from.integer_value());
  897. break;
  898. }
  899. case kDoubleValue: {
  900. set_double_value(from.double_value());
  901. break;
  902. }
  903. case kTimestampValue: {
  904. mutable_timestamp_value()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from.timestamp_value());
  905. break;
  906. }
  907. case kStringValue: {
  908. set_string_value(from.string_value());
  909. break;
  910. }
  911. case kBytesValue: {
  912. set_bytes_value(from.bytes_value());
  913. break;
  914. }
  915. case kReferenceValue: {
  916. set_reference_value(from.reference_value());
  917. break;
  918. }
  919. case kGeoPointValue: {
  920. mutable_geo_point_value()->::google::type::LatLng::MergeFrom(from.geo_point_value());
  921. break;
  922. }
  923. case kArrayValue: {
  924. mutable_array_value()->::google::firestore::v1::ArrayValue::MergeFrom(from.array_value());
  925. break;
  926. }
  927. case kMapValue: {
  928. mutable_map_value()->::google::firestore::v1::MapValue::MergeFrom(from.map_value());
  929. break;
  930. }
  931. case VALUE_TYPE_NOT_SET: {
  932. break;
  933. }
  934. }
  935. // @@protoc_insertion_point(copy_constructor:google.firestore.v1.Value)
  936. }
  937. void Value::SharedCtor() {
  938. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ArrayValue_google_2ffirestore_2fv1_2fdocument_2eproto.base);
  939. clear_has_value_type();
  940. }
  941. Value::~Value() {
  942. // @@protoc_insertion_point(destructor:google.firestore.v1.Value)
  943. SharedDtor();
  944. }
  945. void Value::SharedDtor() {
  946. if (has_value_type()) {
  947. clear_value_type();
  948. }
  949. }
  950. void Value::SetCachedSize(int size) const {
  951. _cached_size_.Set(size);
  952. }
  953. const Value& Value::default_instance() {
  954. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ArrayValue_google_2ffirestore_2fv1_2fdocument_2eproto.base);
  955. return *internal_default_instance();
  956. }
  957. void Value::clear_value_type() {
  958. // @@protoc_insertion_point(one_of_clear_start:google.firestore.v1.Value)
  959. switch (value_type_case()) {
  960. case kNullValue: {
  961. // No need to clear
  962. break;
  963. }
  964. case kBooleanValue: {
  965. // No need to clear
  966. break;
  967. }
  968. case kIntegerValue: {
  969. // No need to clear
  970. break;
  971. }
  972. case kDoubleValue: {
  973. // No need to clear
  974. break;
  975. }
  976. case kTimestampValue: {
  977. delete value_type_.timestamp_value_;
  978. break;
  979. }
  980. case kStringValue: {
  981. value_type_.string_value_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  982. break;
  983. }
  984. case kBytesValue: {
  985. value_type_.bytes_value_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  986. break;
  987. }
  988. case kReferenceValue: {
  989. value_type_.reference_value_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
  990. break;
  991. }
  992. case kGeoPointValue: {
  993. delete value_type_.geo_point_value_;
  994. break;
  995. }
  996. case kArrayValue: {
  997. delete value_type_.array_value_;
  998. break;
  999. }
  1000. case kMapValue: {
  1001. delete value_type_.map_value_;
  1002. break;
  1003. }
  1004. case VALUE_TYPE_NOT_SET: {
  1005. break;
  1006. }
  1007. }
  1008. _oneof_case_[0] = VALUE_TYPE_NOT_SET;
  1009. }
  1010. void Value::Clear() {
  1011. // @@protoc_insertion_point(message_clear_start:google.firestore.v1.Value)
  1012. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1013. // Prevent compiler warnings about cached_has_bits being unused
  1014. (void) cached_has_bits;
  1015. clear_value_type();
  1016. _internal_metadata_.Clear();
  1017. }
  1018. #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  1019. const char* Value::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  1020. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  1021. while (!ctx->Done(&ptr)) {
  1022. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  1023. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  1024. CHK_(ptr);
  1025. switch (tag >> 3) {
  1026. // bool boolean_value = 1;
  1027. case 1:
  1028. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) {
  1029. set_boolean_value(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr));
  1030. CHK_(ptr);
  1031. } else goto handle_unusual;
  1032. continue;
  1033. // int64 integer_value = 2;
  1034. case 2:
  1035. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) {
  1036. set_integer_value(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr));
  1037. CHK_(ptr);
  1038. } else goto handle_unusual;
  1039. continue;
  1040. // double double_value = 3;
  1041. case 3:
  1042. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 25)) {
  1043. set_double_value(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
  1044. ptr += sizeof(double);
  1045. } else goto handle_unusual;
  1046. continue;
  1047. // string reference_value = 5;
  1048. case 5:
  1049. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) {
  1050. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_reference_value(), ptr, ctx, "google.firestore.v1.Value.reference_value");
  1051. CHK_(ptr);
  1052. } else goto handle_unusual;
  1053. continue;
  1054. // .google.firestore.v1.MapValue map_value = 6;
  1055. case 6:
  1056. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) {
  1057. ptr = ctx->ParseMessage(mutable_map_value(), ptr);
  1058. CHK_(ptr);
  1059. } else goto handle_unusual;
  1060. continue;
  1061. // .google.type.LatLng geo_point_value = 8;
  1062. case 8:
  1063. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) {
  1064. ptr = ctx->ParseMessage(mutable_geo_point_value(), ptr);
  1065. CHK_(ptr);
  1066. } else goto handle_unusual;
  1067. continue;
  1068. // .google.firestore.v1.ArrayValue array_value = 9;
  1069. case 9:
  1070. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) {
  1071. ptr = ctx->ParseMessage(mutable_array_value(), ptr);
  1072. CHK_(ptr);
  1073. } else goto handle_unusual;
  1074. continue;
  1075. // .google.protobuf.Timestamp timestamp_value = 10;
  1076. case 10:
  1077. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) {
  1078. ptr = ctx->ParseMessage(mutable_timestamp_value(), ptr);
  1079. CHK_(ptr);
  1080. } else goto handle_unusual;
  1081. continue;
  1082. // .google.protobuf.NullValue null_value = 11;
  1083. case 11:
  1084. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) {
  1085. ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint(&ptr);
  1086. CHK_(ptr);
  1087. set_null_value(static_cast<PROTOBUF_NAMESPACE_ID::NullValue>(val));
  1088. } else goto handle_unusual;
  1089. continue;
  1090. // string string_value = 17;
  1091. case 17:
  1092. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 138)) {
  1093. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParserUTF8(mutable_string_value(), ptr, ctx, "google.firestore.v1.Value.string_value");
  1094. CHK_(ptr);
  1095. } else goto handle_unusual;
  1096. continue;
  1097. // bytes bytes_value = 18;
  1098. case 18:
  1099. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 146)) {
  1100. ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(mutable_bytes_value(), ptr, ctx);
  1101. CHK_(ptr);
  1102. } else goto handle_unusual;
  1103. continue;
  1104. default: {
  1105. handle_unusual:
  1106. if ((tag & 7) == 4 || tag == 0) {
  1107. ctx->SetLastTag(tag);
  1108. goto success;
  1109. }
  1110. ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
  1111. CHK_(ptr != nullptr);
  1112. continue;
  1113. }
  1114. } // switch
  1115. } // while
  1116. success:
  1117. return ptr;
  1118. failure:
  1119. ptr = nullptr;
  1120. goto success;
  1121. #undef CHK_
  1122. }
  1123. #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  1124. bool Value::MergePartialFromCodedStream(
  1125. ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
  1126. #define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
  1127. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  1128. // @@protoc_insertion_point(parse_start:google.firestore.v1.Value)
  1129. for (;;) {
  1130. ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(16383u);
  1131. tag = p.first;
  1132. if (!p.second) goto handle_unusual;
  1133. switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  1134. // bool boolean_value = 1;
  1135. case 1: {
  1136. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (8 & 0xFF)) {
  1137. clear_value_type();
  1138. DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
  1139. bool, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_BOOL>(
  1140. input, &value_type_.boolean_value_)));
  1141. set_has_boolean_value();
  1142. } else {
  1143. goto handle_unusual;
  1144. }
  1145. break;
  1146. }
  1147. // int64 integer_value = 2;
  1148. case 2: {
  1149. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (16 & 0xFF)) {
  1150. clear_value_type();
  1151. DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
  1152. ::PROTOBUF_NAMESPACE_ID::int64, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_INT64>(
  1153. input, &value_type_.integer_value_)));
  1154. set_has_integer_value();
  1155. } else {
  1156. goto handle_unusual;
  1157. }
  1158. break;
  1159. }
  1160. // double double_value = 3;
  1161. case 3: {
  1162. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (25 & 0xFF)) {
  1163. clear_value_type();
  1164. DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
  1165. double, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_DOUBLE>(
  1166. input, &value_type_.double_value_)));
  1167. set_has_double_value();
  1168. } else {
  1169. goto handle_unusual;
  1170. }
  1171. break;
  1172. }
  1173. // string reference_value = 5;
  1174. case 5: {
  1175. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (42 & 0xFF)) {
  1176. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
  1177. input, this->mutable_reference_value()));
  1178. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  1179. this->reference_value().data(), static_cast<int>(this->reference_value().length()),
  1180. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
  1181. "google.firestore.v1.Value.reference_value"));
  1182. } else {
  1183. goto handle_unusual;
  1184. }
  1185. break;
  1186. }
  1187. // .google.firestore.v1.MapValue map_value = 6;
  1188. case 6: {
  1189. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (50 & 0xFF)) {
  1190. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
  1191. input, mutable_map_value()));
  1192. } else {
  1193. goto handle_unusual;
  1194. }
  1195. break;
  1196. }
  1197. // .google.type.LatLng geo_point_value = 8;
  1198. case 8: {
  1199. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (66 & 0xFF)) {
  1200. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
  1201. input, mutable_geo_point_value()));
  1202. } else {
  1203. goto handle_unusual;
  1204. }
  1205. break;
  1206. }
  1207. // .google.firestore.v1.ArrayValue array_value = 9;
  1208. case 9: {
  1209. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (74 & 0xFF)) {
  1210. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
  1211. input, mutable_array_value()));
  1212. } else {
  1213. goto handle_unusual;
  1214. }
  1215. break;
  1216. }
  1217. // .google.protobuf.Timestamp timestamp_value = 10;
  1218. case 10: {
  1219. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (82 & 0xFF)) {
  1220. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
  1221. input, mutable_timestamp_value()));
  1222. } else {
  1223. goto handle_unusual;
  1224. }
  1225. break;
  1226. }
  1227. // .google.protobuf.NullValue null_value = 11;
  1228. case 11: {
  1229. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (88 & 0xFF)) {
  1230. int value = 0;
  1231. DO_((::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadPrimitive<
  1232. int, ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_ENUM>(
  1233. input, &value)));
  1234. set_null_value(static_cast< PROTOBUF_NAMESPACE_ID::NullValue >(value));
  1235. } else {
  1236. goto handle_unusual;
  1237. }
  1238. break;
  1239. }
  1240. // string string_value = 17;
  1241. case 17: {
  1242. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (138 & 0xFF)) {
  1243. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadString(
  1244. input, this->mutable_string_value()));
  1245. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  1246. this->string_value().data(), static_cast<int>(this->string_value().length()),
  1247. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
  1248. "google.firestore.v1.Value.string_value"));
  1249. } else {
  1250. goto handle_unusual;
  1251. }
  1252. break;
  1253. }
  1254. // bytes bytes_value = 18;
  1255. case 18: {
  1256. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (146 & 0xFF)) {
  1257. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadBytes(
  1258. input, this->mutable_bytes_value()));
  1259. } else {
  1260. goto handle_unusual;
  1261. }
  1262. break;
  1263. }
  1264. default: {
  1265. handle_unusual:
  1266. if (tag == 0) {
  1267. goto success;
  1268. }
  1269. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
  1270. input, tag, _internal_metadata_.mutable_unknown_fields()));
  1271. break;
  1272. }
  1273. }
  1274. }
  1275. success:
  1276. // @@protoc_insertion_point(parse_success:google.firestore.v1.Value)
  1277. return true;
  1278. failure:
  1279. // @@protoc_insertion_point(parse_failure:google.firestore.v1.Value)
  1280. return false;
  1281. #undef DO_
  1282. }
  1283. #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  1284. void Value::SerializeWithCachedSizes(
  1285. ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
  1286. // @@protoc_insertion_point(serialize_start:google.firestore.v1.Value)
  1287. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1288. (void) cached_has_bits;
  1289. // bool boolean_value = 1;
  1290. if (has_boolean_value()) {
  1291. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBool(1, this->boolean_value(), output);
  1292. }
  1293. // int64 integer_value = 2;
  1294. if (has_integer_value()) {
  1295. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64(2, this->integer_value(), output);
  1296. }
  1297. // double double_value = 3;
  1298. if (has_double_value()) {
  1299. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDouble(3, this->double_value(), output);
  1300. }
  1301. // string reference_value = 5;
  1302. if (has_reference_value()) {
  1303. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  1304. this->reference_value().data(), static_cast<int>(this->reference_value().length()),
  1305. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  1306. "google.firestore.v1.Value.reference_value");
  1307. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
  1308. 5, this->reference_value(), output);
  1309. }
  1310. // .google.firestore.v1.MapValue map_value = 6;
  1311. if (has_map_value()) {
  1312. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
  1313. 6, _Internal::map_value(this), output);
  1314. }
  1315. // .google.type.LatLng geo_point_value = 8;
  1316. if (has_geo_point_value()) {
  1317. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
  1318. 8, _Internal::geo_point_value(this), output);
  1319. }
  1320. // .google.firestore.v1.ArrayValue array_value = 9;
  1321. if (has_array_value()) {
  1322. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
  1323. 9, _Internal::array_value(this), output);
  1324. }
  1325. // .google.protobuf.Timestamp timestamp_value = 10;
  1326. if (has_timestamp_value()) {
  1327. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
  1328. 10, _Internal::timestamp_value(this), output);
  1329. }
  1330. // .google.protobuf.NullValue null_value = 11;
  1331. if (has_null_value()) {
  1332. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnum(
  1333. 11, this->null_value(), output);
  1334. }
  1335. // string string_value = 17;
  1336. if (has_string_value()) {
  1337. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  1338. this->string_value().data(), static_cast<int>(this->string_value().length()),
  1339. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  1340. "google.firestore.v1.Value.string_value");
  1341. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringMaybeAliased(
  1342. 17, this->string_value(), output);
  1343. }
  1344. // bytes bytes_value = 18;
  1345. if (has_bytes_value()) {
  1346. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesMaybeAliased(
  1347. 18, this->bytes_value(), output);
  1348. }
  1349. if (_internal_metadata_.have_unknown_fields()) {
  1350. ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
  1351. _internal_metadata_.unknown_fields(), output);
  1352. }
  1353. // @@protoc_insertion_point(serialize_end:google.firestore.v1.Value)
  1354. }
  1355. ::PROTOBUF_NAMESPACE_ID::uint8* Value::InternalSerializeWithCachedSizesToArray(
  1356. ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
  1357. // @@protoc_insertion_point(serialize_to_array_start:google.firestore.v1.Value)
  1358. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1359. (void) cached_has_bits;
  1360. // bool boolean_value = 1;
  1361. if (has_boolean_value()) {
  1362. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->boolean_value(), target);
  1363. }
  1364. // int64 integer_value = 2;
  1365. if (has_integer_value()) {
  1366. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->integer_value(), target);
  1367. }
  1368. // double double_value = 3;
  1369. if (has_double_value()) {
  1370. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(3, this->double_value(), target);
  1371. }
  1372. // string reference_value = 5;
  1373. if (has_reference_value()) {
  1374. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  1375. this->reference_value().data(), static_cast<int>(this->reference_value().length()),
  1376. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  1377. "google.firestore.v1.Value.reference_value");
  1378. target =
  1379. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
  1380. 5, this->reference_value(), target);
  1381. }
  1382. // .google.firestore.v1.MapValue map_value = 6;
  1383. if (has_map_value()) {
  1384. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  1385. InternalWriteMessageToArray(
  1386. 6, _Internal::map_value(this), target);
  1387. }
  1388. // .google.type.LatLng geo_point_value = 8;
  1389. if (has_geo_point_value()) {
  1390. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  1391. InternalWriteMessageToArray(
  1392. 8, _Internal::geo_point_value(this), target);
  1393. }
  1394. // .google.firestore.v1.ArrayValue array_value = 9;
  1395. if (has_array_value()) {
  1396. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  1397. InternalWriteMessageToArray(
  1398. 9, _Internal::array_value(this), target);
  1399. }
  1400. // .google.protobuf.Timestamp timestamp_value = 10;
  1401. if (has_timestamp_value()) {
  1402. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  1403. InternalWriteMessageToArray(
  1404. 10, _Internal::timestamp_value(this), target);
  1405. }
  1406. // .google.protobuf.NullValue null_value = 11;
  1407. if (has_null_value()) {
  1408. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray(
  1409. 11, this->null_value(), target);
  1410. }
  1411. // string string_value = 17;
  1412. if (has_string_value()) {
  1413. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  1414. this->string_value().data(), static_cast<int>(this->string_value().length()),
  1415. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  1416. "google.firestore.v1.Value.string_value");
  1417. target =
  1418. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteStringToArray(
  1419. 17, this->string_value(), target);
  1420. }
  1421. // bytes bytes_value = 18;
  1422. if (has_bytes_value()) {
  1423. target =
  1424. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBytesToArray(
  1425. 18, this->bytes_value(), target);
  1426. }
  1427. if (_internal_metadata_.have_unknown_fields()) {
  1428. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
  1429. _internal_metadata_.unknown_fields(), target);
  1430. }
  1431. // @@protoc_insertion_point(serialize_to_array_end:google.firestore.v1.Value)
  1432. return target;
  1433. }
  1434. size_t Value::ByteSizeLong() const {
  1435. // @@protoc_insertion_point(message_byte_size_start:google.firestore.v1.Value)
  1436. size_t total_size = 0;
  1437. if (_internal_metadata_.have_unknown_fields()) {
  1438. total_size +=
  1439. ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
  1440. _internal_metadata_.unknown_fields());
  1441. }
  1442. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1443. // Prevent compiler warnings about cached_has_bits being unused
  1444. (void) cached_has_bits;
  1445. switch (value_type_case()) {
  1446. // .google.protobuf.NullValue null_value = 11;
  1447. case kNullValue: {
  1448. total_size += 1 +
  1449. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->null_value());
  1450. break;
  1451. }
  1452. // bool boolean_value = 1;
  1453. case kBooleanValue: {
  1454. total_size += 1 + 1;
  1455. break;
  1456. }
  1457. // int64 integer_value = 2;
  1458. case kIntegerValue: {
  1459. total_size += 1 +
  1460. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size(
  1461. this->integer_value());
  1462. break;
  1463. }
  1464. // double double_value = 3;
  1465. case kDoubleValue: {
  1466. total_size += 1 + 8;
  1467. break;
  1468. }
  1469. // .google.protobuf.Timestamp timestamp_value = 10;
  1470. case kTimestampValue: {
  1471. total_size += 1 +
  1472. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  1473. *value_type_.timestamp_value_);
  1474. break;
  1475. }
  1476. // string string_value = 17;
  1477. case kStringValue: {
  1478. total_size += 2 +
  1479. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  1480. this->string_value());
  1481. break;
  1482. }
  1483. // bytes bytes_value = 18;
  1484. case kBytesValue: {
  1485. total_size += 2 +
  1486. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::BytesSize(
  1487. this->bytes_value());
  1488. break;
  1489. }
  1490. // string reference_value = 5;
  1491. case kReferenceValue: {
  1492. total_size += 1 +
  1493. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
  1494. this->reference_value());
  1495. break;
  1496. }
  1497. // .google.type.LatLng geo_point_value = 8;
  1498. case kGeoPointValue: {
  1499. total_size += 1 +
  1500. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  1501. *value_type_.geo_point_value_);
  1502. break;
  1503. }
  1504. // .google.firestore.v1.ArrayValue array_value = 9;
  1505. case kArrayValue: {
  1506. total_size += 1 +
  1507. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  1508. *value_type_.array_value_);
  1509. break;
  1510. }
  1511. // .google.firestore.v1.MapValue map_value = 6;
  1512. case kMapValue: {
  1513. total_size += 1 +
  1514. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  1515. *value_type_.map_value_);
  1516. break;
  1517. }
  1518. case VALUE_TYPE_NOT_SET: {
  1519. break;
  1520. }
  1521. }
  1522. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  1523. SetCachedSize(cached_size);
  1524. return total_size;
  1525. }
  1526. void Value::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  1527. // @@protoc_insertion_point(generalized_merge_from_start:google.firestore.v1.Value)
  1528. GOOGLE_DCHECK_NE(&from, this);
  1529. const Value* source =
  1530. ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Value>(
  1531. &from);
  1532. if (source == nullptr) {
  1533. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.firestore.v1.Value)
  1534. ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  1535. } else {
  1536. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.firestore.v1.Value)
  1537. MergeFrom(*source);
  1538. }
  1539. }
  1540. void Value::MergeFrom(const Value& from) {
  1541. // @@protoc_insertion_point(class_specific_merge_from_start:google.firestore.v1.Value)
  1542. GOOGLE_DCHECK_NE(&from, this);
  1543. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1544. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1545. (void) cached_has_bits;
  1546. switch (from.value_type_case()) {
  1547. case kNullValue: {
  1548. set_null_value(from.null_value());
  1549. break;
  1550. }
  1551. case kBooleanValue: {
  1552. set_boolean_value(from.boolean_value());
  1553. break;
  1554. }
  1555. case kIntegerValue: {
  1556. set_integer_value(from.integer_value());
  1557. break;
  1558. }
  1559. case kDoubleValue: {
  1560. set_double_value(from.double_value());
  1561. break;
  1562. }
  1563. case kTimestampValue: {
  1564. mutable_timestamp_value()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from.timestamp_value());
  1565. break;
  1566. }
  1567. case kStringValue: {
  1568. set_string_value(from.string_value());
  1569. break;
  1570. }
  1571. case kBytesValue: {
  1572. set_bytes_value(from.bytes_value());
  1573. break;
  1574. }
  1575. case kReferenceValue: {
  1576. set_reference_value(from.reference_value());
  1577. break;
  1578. }
  1579. case kGeoPointValue: {
  1580. mutable_geo_point_value()->::google::type::LatLng::MergeFrom(from.geo_point_value());
  1581. break;
  1582. }
  1583. case kArrayValue: {
  1584. mutable_array_value()->::google::firestore::v1::ArrayValue::MergeFrom(from.array_value());
  1585. break;
  1586. }
  1587. case kMapValue: {
  1588. mutable_map_value()->::google::firestore::v1::MapValue::MergeFrom(from.map_value());
  1589. break;
  1590. }
  1591. case VALUE_TYPE_NOT_SET: {
  1592. break;
  1593. }
  1594. }
  1595. }
  1596. void Value::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  1597. // @@protoc_insertion_point(generalized_copy_from_start:google.firestore.v1.Value)
  1598. if (&from == this) return;
  1599. Clear();
  1600. MergeFrom(from);
  1601. }
  1602. void Value::CopyFrom(const Value& from) {
  1603. // @@protoc_insertion_point(class_specific_copy_from_start:google.firestore.v1.Value)
  1604. if (&from == this) return;
  1605. Clear();
  1606. MergeFrom(from);
  1607. }
  1608. bool Value::IsInitialized() const {
  1609. return true;
  1610. }
  1611. void Value::InternalSwap(Value* other) {
  1612. using std::swap;
  1613. _internal_metadata_.Swap(&other->_internal_metadata_);
  1614. swap(value_type_, other->value_type_);
  1615. swap(_oneof_case_[0], other->_oneof_case_[0]);
  1616. }
  1617. ::PROTOBUF_NAMESPACE_ID::Metadata Value::GetMetadata() const {
  1618. return GetMetadataStatic();
  1619. }
  1620. // ===================================================================
  1621. void ArrayValue::InitAsDefaultInstance() {
  1622. }
  1623. class ArrayValue::_Internal {
  1624. public:
  1625. };
  1626. ArrayValue::ArrayValue()
  1627. : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  1628. SharedCtor();
  1629. // @@protoc_insertion_point(constructor:google.firestore.v1.ArrayValue)
  1630. }
  1631. ArrayValue::ArrayValue(const ArrayValue& from)
  1632. : ::PROTOBUF_NAMESPACE_ID::Message(),
  1633. _internal_metadata_(nullptr),
  1634. values_(from.values_) {
  1635. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1636. // @@protoc_insertion_point(copy_constructor:google.firestore.v1.ArrayValue)
  1637. }
  1638. void ArrayValue::SharedCtor() {
  1639. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ArrayValue_google_2ffirestore_2fv1_2fdocument_2eproto.base);
  1640. }
  1641. ArrayValue::~ArrayValue() {
  1642. // @@protoc_insertion_point(destructor:google.firestore.v1.ArrayValue)
  1643. SharedDtor();
  1644. }
  1645. void ArrayValue::SharedDtor() {
  1646. }
  1647. void ArrayValue::SetCachedSize(int size) const {
  1648. _cached_size_.Set(size);
  1649. }
  1650. const ArrayValue& ArrayValue::default_instance() {
  1651. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ArrayValue_google_2ffirestore_2fv1_2fdocument_2eproto.base);
  1652. return *internal_default_instance();
  1653. }
  1654. void ArrayValue::Clear() {
  1655. // @@protoc_insertion_point(message_clear_start:google.firestore.v1.ArrayValue)
  1656. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1657. // Prevent compiler warnings about cached_has_bits being unused
  1658. (void) cached_has_bits;
  1659. values_.Clear();
  1660. _internal_metadata_.Clear();
  1661. }
  1662. #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  1663. const char* ArrayValue::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  1664. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  1665. while (!ctx->Done(&ptr)) {
  1666. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  1667. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  1668. CHK_(ptr);
  1669. switch (tag >> 3) {
  1670. // repeated .google.firestore.v1.Value values = 1;
  1671. case 1:
  1672. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
  1673. ptr -= 1;
  1674. do {
  1675. ptr += 1;
  1676. ptr = ctx->ParseMessage(add_values(), ptr);
  1677. CHK_(ptr);
  1678. if (!ctx->DataAvailable(ptr)) break;
  1679. } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 10);
  1680. } else goto handle_unusual;
  1681. continue;
  1682. default: {
  1683. handle_unusual:
  1684. if ((tag & 7) == 4 || tag == 0) {
  1685. ctx->SetLastTag(tag);
  1686. goto success;
  1687. }
  1688. ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
  1689. CHK_(ptr != nullptr);
  1690. continue;
  1691. }
  1692. } // switch
  1693. } // while
  1694. success:
  1695. return ptr;
  1696. failure:
  1697. ptr = nullptr;
  1698. goto success;
  1699. #undef CHK_
  1700. }
  1701. #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  1702. bool ArrayValue::MergePartialFromCodedStream(
  1703. ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
  1704. #define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
  1705. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  1706. // @@protoc_insertion_point(parse_start:google.firestore.v1.ArrayValue)
  1707. for (;;) {
  1708. ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  1709. tag = p.first;
  1710. if (!p.second) goto handle_unusual;
  1711. switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  1712. // repeated .google.firestore.v1.Value values = 1;
  1713. case 1: {
  1714. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
  1715. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessage(
  1716. input, add_values()));
  1717. } else {
  1718. goto handle_unusual;
  1719. }
  1720. break;
  1721. }
  1722. default: {
  1723. handle_unusual:
  1724. if (tag == 0) {
  1725. goto success;
  1726. }
  1727. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
  1728. input, tag, _internal_metadata_.mutable_unknown_fields()));
  1729. break;
  1730. }
  1731. }
  1732. }
  1733. success:
  1734. // @@protoc_insertion_point(parse_success:google.firestore.v1.ArrayValue)
  1735. return true;
  1736. failure:
  1737. // @@protoc_insertion_point(parse_failure:google.firestore.v1.ArrayValue)
  1738. return false;
  1739. #undef DO_
  1740. }
  1741. #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  1742. void ArrayValue::SerializeWithCachedSizes(
  1743. ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
  1744. // @@protoc_insertion_point(serialize_start:google.firestore.v1.ArrayValue)
  1745. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1746. (void) cached_has_bits;
  1747. // repeated .google.firestore.v1.Value values = 1;
  1748. for (unsigned int i = 0,
  1749. n = static_cast<unsigned int>(this->values_size()); i < n; i++) {
  1750. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteMessageMaybeToArray(
  1751. 1,
  1752. this->values(static_cast<int>(i)),
  1753. output);
  1754. }
  1755. if (_internal_metadata_.have_unknown_fields()) {
  1756. ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
  1757. _internal_metadata_.unknown_fields(), output);
  1758. }
  1759. // @@protoc_insertion_point(serialize_end:google.firestore.v1.ArrayValue)
  1760. }
  1761. ::PROTOBUF_NAMESPACE_ID::uint8* ArrayValue::InternalSerializeWithCachedSizesToArray(
  1762. ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
  1763. // @@protoc_insertion_point(serialize_to_array_start:google.firestore.v1.ArrayValue)
  1764. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1765. (void) cached_has_bits;
  1766. // repeated .google.firestore.v1.Value values = 1;
  1767. for (unsigned int i = 0,
  1768. n = static_cast<unsigned int>(this->values_size()); i < n; i++) {
  1769. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
  1770. InternalWriteMessageToArray(
  1771. 1, this->values(static_cast<int>(i)), target);
  1772. }
  1773. if (_internal_metadata_.have_unknown_fields()) {
  1774. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
  1775. _internal_metadata_.unknown_fields(), target);
  1776. }
  1777. // @@protoc_insertion_point(serialize_to_array_end:google.firestore.v1.ArrayValue)
  1778. return target;
  1779. }
  1780. size_t ArrayValue::ByteSizeLong() const {
  1781. // @@protoc_insertion_point(message_byte_size_start:google.firestore.v1.ArrayValue)
  1782. size_t total_size = 0;
  1783. if (_internal_metadata_.have_unknown_fields()) {
  1784. total_size +=
  1785. ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
  1786. _internal_metadata_.unknown_fields());
  1787. }
  1788. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1789. // Prevent compiler warnings about cached_has_bits being unused
  1790. (void) cached_has_bits;
  1791. // repeated .google.firestore.v1.Value values = 1;
  1792. {
  1793. unsigned int count = static_cast<unsigned int>(this->values_size());
  1794. total_size += 1UL * count;
  1795. for (unsigned int i = 0; i < count; i++) {
  1796. total_size +=
  1797. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
  1798. this->values(static_cast<int>(i)));
  1799. }
  1800. }
  1801. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  1802. SetCachedSize(cached_size);
  1803. return total_size;
  1804. }
  1805. void ArrayValue::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  1806. // @@protoc_insertion_point(generalized_merge_from_start:google.firestore.v1.ArrayValue)
  1807. GOOGLE_DCHECK_NE(&from, this);
  1808. const ArrayValue* source =
  1809. ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<ArrayValue>(
  1810. &from);
  1811. if (source == nullptr) {
  1812. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.firestore.v1.ArrayValue)
  1813. ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  1814. } else {
  1815. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.firestore.v1.ArrayValue)
  1816. MergeFrom(*source);
  1817. }
  1818. }
  1819. void ArrayValue::MergeFrom(const ArrayValue& from) {
  1820. // @@protoc_insertion_point(class_specific_merge_from_start:google.firestore.v1.ArrayValue)
  1821. GOOGLE_DCHECK_NE(&from, this);
  1822. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1823. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1824. (void) cached_has_bits;
  1825. values_.MergeFrom(from.values_);
  1826. }
  1827. void ArrayValue::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  1828. // @@protoc_insertion_point(generalized_copy_from_start:google.firestore.v1.ArrayValue)
  1829. if (&from == this) return;
  1830. Clear();
  1831. MergeFrom(from);
  1832. }
  1833. void ArrayValue::CopyFrom(const ArrayValue& from) {
  1834. // @@protoc_insertion_point(class_specific_copy_from_start:google.firestore.v1.ArrayValue)
  1835. if (&from == this) return;
  1836. Clear();
  1837. MergeFrom(from);
  1838. }
  1839. bool ArrayValue::IsInitialized() const {
  1840. return true;
  1841. }
  1842. void ArrayValue::InternalSwap(ArrayValue* other) {
  1843. using std::swap;
  1844. _internal_metadata_.Swap(&other->_internal_metadata_);
  1845. CastToBase(&values_)->InternalSwap(CastToBase(&other->values_));
  1846. }
  1847. ::PROTOBUF_NAMESPACE_ID::Metadata ArrayValue::GetMetadata() const {
  1848. return GetMetadataStatic();
  1849. }
  1850. // ===================================================================
  1851. MapValue_FieldsEntry_DoNotUse::MapValue_FieldsEntry_DoNotUse() {}
  1852. MapValue_FieldsEntry_DoNotUse::MapValue_FieldsEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
  1853. : SuperType(arena) {}
  1854. void MapValue_FieldsEntry_DoNotUse::MergeFrom(const MapValue_FieldsEntry_DoNotUse& other) {
  1855. MergeFromInternal(other);
  1856. }
  1857. ::PROTOBUF_NAMESPACE_ID::Metadata MapValue_FieldsEntry_DoNotUse::GetMetadata() const {
  1858. return GetMetadataStatic();
  1859. }
  1860. void MapValue_FieldsEntry_DoNotUse::MergeFrom(
  1861. const ::PROTOBUF_NAMESPACE_ID::Message& other) {
  1862. ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom(other);
  1863. }
  1864. // ===================================================================
  1865. void MapValue::InitAsDefaultInstance() {
  1866. }
  1867. class MapValue::_Internal {
  1868. public:
  1869. };
  1870. MapValue::MapValue()
  1871. : ::PROTOBUF_NAMESPACE_ID::Message(), _internal_metadata_(nullptr) {
  1872. SharedCtor();
  1873. // @@protoc_insertion_point(constructor:google.firestore.v1.MapValue)
  1874. }
  1875. MapValue::MapValue(const MapValue& from)
  1876. : ::PROTOBUF_NAMESPACE_ID::Message(),
  1877. _internal_metadata_(nullptr) {
  1878. _internal_metadata_.MergeFrom(from._internal_metadata_);
  1879. fields_.MergeFrom(from.fields_);
  1880. // @@protoc_insertion_point(copy_constructor:google.firestore.v1.MapValue)
  1881. }
  1882. void MapValue::SharedCtor() {
  1883. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_ArrayValue_google_2ffirestore_2fv1_2fdocument_2eproto.base);
  1884. }
  1885. MapValue::~MapValue() {
  1886. // @@protoc_insertion_point(destructor:google.firestore.v1.MapValue)
  1887. SharedDtor();
  1888. }
  1889. void MapValue::SharedDtor() {
  1890. }
  1891. void MapValue::SetCachedSize(int size) const {
  1892. _cached_size_.Set(size);
  1893. }
  1894. const MapValue& MapValue::default_instance() {
  1895. ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_ArrayValue_google_2ffirestore_2fv1_2fdocument_2eproto.base);
  1896. return *internal_default_instance();
  1897. }
  1898. void MapValue::Clear() {
  1899. // @@protoc_insertion_point(message_clear_start:google.firestore.v1.MapValue)
  1900. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  1901. // Prevent compiler warnings about cached_has_bits being unused
  1902. (void) cached_has_bits;
  1903. fields_.Clear();
  1904. _internal_metadata_.Clear();
  1905. }
  1906. #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  1907. const char* MapValue::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
  1908. #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  1909. while (!ctx->Done(&ptr)) {
  1910. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  1911. ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
  1912. CHK_(ptr);
  1913. switch (tag >> 3) {
  1914. // map<string, .google.firestore.v1.Value> fields = 1;
  1915. case 1:
  1916. if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
  1917. ptr -= 1;
  1918. do {
  1919. ptr += 1;
  1920. ptr = ctx->ParseMessage(&fields_, ptr);
  1921. CHK_(ptr);
  1922. if (!ctx->DataAvailable(ptr)) break;
  1923. } while (::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::PROTOBUF_NAMESPACE_ID::uint8>(ptr) == 10);
  1924. } else goto handle_unusual;
  1925. continue;
  1926. default: {
  1927. handle_unusual:
  1928. if ((tag & 7) == 4 || tag == 0) {
  1929. ctx->SetLastTag(tag);
  1930. goto success;
  1931. }
  1932. ptr = UnknownFieldParse(tag, &_internal_metadata_, ptr, ctx);
  1933. CHK_(ptr != nullptr);
  1934. continue;
  1935. }
  1936. } // switch
  1937. } // while
  1938. success:
  1939. return ptr;
  1940. failure:
  1941. ptr = nullptr;
  1942. goto success;
  1943. #undef CHK_
  1944. }
  1945. #else // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  1946. bool MapValue::MergePartialFromCodedStream(
  1947. ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) {
  1948. #define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
  1949. ::PROTOBUF_NAMESPACE_ID::uint32 tag;
  1950. // @@protoc_insertion_point(parse_start:google.firestore.v1.MapValue)
  1951. for (;;) {
  1952. ::std::pair<::PROTOBUF_NAMESPACE_ID::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
  1953. tag = p.first;
  1954. if (!p.second) goto handle_unusual;
  1955. switch (::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::GetTagFieldNumber(tag)) {
  1956. // map<string, .google.firestore.v1.Value> fields = 1;
  1957. case 1: {
  1958. if (static_cast< ::PROTOBUF_NAMESPACE_ID::uint8>(tag) == (10 & 0xFF)) {
  1959. MapValue_FieldsEntry_DoNotUse::Parser< ::PROTOBUF_NAMESPACE_ID::internal::MapField<
  1960. MapValue_FieldsEntry_DoNotUse,
  1961. std::string, ::google::firestore::v1::Value,
  1962. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_STRING,
  1963. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::TYPE_MESSAGE,
  1964. 0 >,
  1965. ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value > > parser(&fields_);
  1966. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::ReadMessageNoVirtual(
  1967. input, &parser));
  1968. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  1969. parser.key().data(), static_cast<int>(parser.key().length()),
  1970. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::PARSE,
  1971. "google.firestore.v1.MapValue.FieldsEntry.key"));
  1972. } else {
  1973. goto handle_unusual;
  1974. }
  1975. break;
  1976. }
  1977. default: {
  1978. handle_unusual:
  1979. if (tag == 0) {
  1980. goto success;
  1981. }
  1982. DO_(::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SkipField(
  1983. input, tag, _internal_metadata_.mutable_unknown_fields()));
  1984. break;
  1985. }
  1986. }
  1987. }
  1988. success:
  1989. // @@protoc_insertion_point(parse_success:google.firestore.v1.MapValue)
  1990. return true;
  1991. failure:
  1992. // @@protoc_insertion_point(parse_failure:google.firestore.v1.MapValue)
  1993. return false;
  1994. #undef DO_
  1995. }
  1996. #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
  1997. void MapValue::SerializeWithCachedSizes(
  1998. ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const {
  1999. // @@protoc_insertion_point(serialize_start:google.firestore.v1.MapValue)
  2000. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  2001. (void) cached_has_bits;
  2002. // map<string, .google.firestore.v1.Value> fields = 1;
  2003. if (!this->fields().empty()) {
  2004. typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value >::const_pointer
  2005. ConstPtr;
  2006. typedef ConstPtr SortItem;
  2007. typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst<SortItem> Less;
  2008. struct Utf8Check {
  2009. static void Check(ConstPtr p) {
  2010. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  2011. p->first.data(), static_cast<int>(p->first.length()),
  2012. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  2013. "google.firestore.v1.MapValue.FieldsEntry.key");
  2014. }
  2015. };
  2016. if (output->IsSerializationDeterministic() &&
  2017. this->fields().size() > 1) {
  2018. ::std::unique_ptr<SortItem[]> items(
  2019. new SortItem[this->fields().size()]);
  2020. typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value >::size_type size_type;
  2021. size_type n = 0;
  2022. for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value >::const_iterator
  2023. it = this->fields().begin();
  2024. it != this->fields().end(); ++it, ++n) {
  2025. items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
  2026. }
  2027. ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
  2028. for (size_type i = 0; i < n; i++) {
  2029. MapValue_FieldsEntry_DoNotUse::Funcs::SerializeToCodedStream(1, items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second, output);
  2030. Utf8Check::Check(&(*items[static_cast<ptrdiff_t>(i)]));
  2031. }
  2032. } else {
  2033. for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value >::const_iterator
  2034. it = this->fields().begin();
  2035. it != this->fields().end(); ++it) {
  2036. MapValue_FieldsEntry_DoNotUse::Funcs::SerializeToCodedStream(1, it->first, it->second, output);
  2037. Utf8Check::Check(&(*it));
  2038. }
  2039. }
  2040. }
  2041. if (_internal_metadata_.have_unknown_fields()) {
  2042. ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFields(
  2043. _internal_metadata_.unknown_fields(), output);
  2044. }
  2045. // @@protoc_insertion_point(serialize_end:google.firestore.v1.MapValue)
  2046. }
  2047. ::PROTOBUF_NAMESPACE_ID::uint8* MapValue::InternalSerializeWithCachedSizesToArray(
  2048. ::PROTOBUF_NAMESPACE_ID::uint8* target) const {
  2049. // @@protoc_insertion_point(serialize_to_array_start:google.firestore.v1.MapValue)
  2050. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  2051. (void) cached_has_bits;
  2052. // map<string, .google.firestore.v1.Value> fields = 1;
  2053. if (!this->fields().empty()) {
  2054. typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value >::const_pointer
  2055. ConstPtr;
  2056. typedef ConstPtr SortItem;
  2057. typedef ::PROTOBUF_NAMESPACE_ID::internal::CompareByDerefFirst<SortItem> Less;
  2058. struct Utf8Check {
  2059. static void Check(ConstPtr p) {
  2060. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
  2061. p->first.data(), static_cast<int>(p->first.length()),
  2062. ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
  2063. "google.firestore.v1.MapValue.FieldsEntry.key");
  2064. }
  2065. };
  2066. if (false &&
  2067. this->fields().size() > 1) {
  2068. ::std::unique_ptr<SortItem[]> items(
  2069. new SortItem[this->fields().size()]);
  2070. typedef ::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value >::size_type size_type;
  2071. size_type n = 0;
  2072. for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value >::const_iterator
  2073. it = this->fields().begin();
  2074. it != this->fields().end(); ++it, ++n) {
  2075. items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
  2076. }
  2077. ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less());
  2078. for (size_type i = 0; i < n; i++) {
  2079. target = MapValue_FieldsEntry_DoNotUse::Funcs::SerializeToArray(1, items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second, target);
  2080. Utf8Check::Check(&(*items[static_cast<ptrdiff_t>(i)]));
  2081. }
  2082. } else {
  2083. for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value >::const_iterator
  2084. it = this->fields().begin();
  2085. it != this->fields().end(); ++it) {
  2086. target = MapValue_FieldsEntry_DoNotUse::Funcs::SerializeToArray(1, it->first, it->second, target);
  2087. Utf8Check::Check(&(*it));
  2088. }
  2089. }
  2090. }
  2091. if (_internal_metadata_.have_unknown_fields()) {
  2092. target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::SerializeUnknownFieldsToArray(
  2093. _internal_metadata_.unknown_fields(), target);
  2094. }
  2095. // @@protoc_insertion_point(serialize_to_array_end:google.firestore.v1.MapValue)
  2096. return target;
  2097. }
  2098. size_t MapValue::ByteSizeLong() const {
  2099. // @@protoc_insertion_point(message_byte_size_start:google.firestore.v1.MapValue)
  2100. size_t total_size = 0;
  2101. if (_internal_metadata_.have_unknown_fields()) {
  2102. total_size +=
  2103. ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::ComputeUnknownFieldsSize(
  2104. _internal_metadata_.unknown_fields());
  2105. }
  2106. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  2107. // Prevent compiler warnings about cached_has_bits being unused
  2108. (void) cached_has_bits;
  2109. // map<string, .google.firestore.v1.Value> fields = 1;
  2110. total_size += 1 *
  2111. ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->fields_size());
  2112. for (::PROTOBUF_NAMESPACE_ID::Map< std::string, ::google::firestore::v1::Value >::const_iterator
  2113. it = this->fields().begin();
  2114. it != this->fields().end(); ++it) {
  2115. total_size += MapValue_FieldsEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
  2116. }
  2117. int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
  2118. SetCachedSize(cached_size);
  2119. return total_size;
  2120. }
  2121. void MapValue::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  2122. // @@protoc_insertion_point(generalized_merge_from_start:google.firestore.v1.MapValue)
  2123. GOOGLE_DCHECK_NE(&from, this);
  2124. const MapValue* source =
  2125. ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<MapValue>(
  2126. &from);
  2127. if (source == nullptr) {
  2128. // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.firestore.v1.MapValue)
  2129. ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
  2130. } else {
  2131. // @@protoc_insertion_point(generalized_merge_from_cast_success:google.firestore.v1.MapValue)
  2132. MergeFrom(*source);
  2133. }
  2134. }
  2135. void MapValue::MergeFrom(const MapValue& from) {
  2136. // @@protoc_insertion_point(class_specific_merge_from_start:google.firestore.v1.MapValue)
  2137. GOOGLE_DCHECK_NE(&from, this);
  2138. _internal_metadata_.MergeFrom(from._internal_metadata_);
  2139. ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
  2140. (void) cached_has_bits;
  2141. fields_.MergeFrom(from.fields_);
  2142. }
  2143. void MapValue::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
  2144. // @@protoc_insertion_point(generalized_copy_from_start:google.firestore.v1.MapValue)
  2145. if (&from == this) return;
  2146. Clear();
  2147. MergeFrom(from);
  2148. }
  2149. void MapValue::CopyFrom(const MapValue& from) {
  2150. // @@protoc_insertion_point(class_specific_copy_from_start:google.firestore.v1.MapValue)
  2151. if (&from == this) return;
  2152. Clear();
  2153. MergeFrom(from);
  2154. }
  2155. bool MapValue::IsInitialized() const {
  2156. return true;
  2157. }
  2158. void MapValue::InternalSwap(MapValue* other) {
  2159. using std::swap;
  2160. _internal_metadata_.Swap(&other->_internal_metadata_);
  2161. fields_.Swap(&other->fields_);
  2162. }
  2163. ::PROTOBUF_NAMESPACE_ID::Metadata MapValue::GetMetadata() const {
  2164. return GetMetadataStatic();
  2165. }
  2166. // @@protoc_insertion_point(namespace_scope)
  2167. } // namespace v1
  2168. } // namespace firestore
  2169. } // namespace google
  2170. PROTOBUF_NAMESPACE_OPEN
  2171. template<> PROTOBUF_NOINLINE ::google::firestore::v1::Document_FieldsEntry_DoNotUse* Arena::CreateMaybeMessage< ::google::firestore::v1::Document_FieldsEntry_DoNotUse >(Arena* arena) {
  2172. return Arena::CreateInternal< ::google::firestore::v1::Document_FieldsEntry_DoNotUse >(arena);
  2173. }
  2174. template<> PROTOBUF_NOINLINE ::google::firestore::v1::Document* Arena::CreateMaybeMessage< ::google::firestore::v1::Document >(Arena* arena) {
  2175. return Arena::CreateInternal< ::google::firestore::v1::Document >(arena);
  2176. }
  2177. template<> PROTOBUF_NOINLINE ::google::firestore::v1::Value* Arena::CreateMaybeMessage< ::google::firestore::v1::Value >(Arena* arena) {
  2178. return Arena::CreateInternal< ::google::firestore::v1::Value >(arena);
  2179. }
  2180. template<> PROTOBUF_NOINLINE ::google::firestore::v1::ArrayValue* Arena::CreateMaybeMessage< ::google::firestore::v1::ArrayValue >(Arena* arena) {
  2181. return Arena::CreateInternal< ::google::firestore::v1::ArrayValue >(arena);
  2182. }
  2183. template<> PROTOBUF_NOINLINE ::google::firestore::v1::MapValue_FieldsEntry_DoNotUse* Arena::CreateMaybeMessage< ::google::firestore::v1::MapValue_FieldsEntry_DoNotUse >(Arena* arena) {
  2184. return Arena::CreateInternal< ::google::firestore::v1::MapValue_FieldsEntry_DoNotUse >(arena);
  2185. }
  2186. template<> PROTOBUF_NOINLINE ::google::firestore::v1::MapValue* Arena::CreateMaybeMessage< ::google::firestore::v1::MapValue >(Arena* arena) {
  2187. return Arena::CreateInternal< ::google::firestore::v1::MapValue >(arena);
  2188. }
  2189. PROTOBUF_NAMESPACE_CLOSE
  2190. // @@protoc_insertion_point(global_scope)
  2191. #include <google/protobuf/port_undef.inc>