common.nanopb.cc 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. /*
  2. * Copyright 2024 Google LLC
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /* Automatically generated nanopb constant definitions */
  17. /* Generated by nanopb-0.3.9.8 */
  18. #include "common.nanopb.h"
  19. #include "Firestore/core/src/nanopb/pretty_printing.h"
  20. namespace firebase {
  21. namespace firestore {
  22. using nanopb::PrintEnumField;
  23. using nanopb::PrintHeader;
  24. using nanopb::PrintMessageField;
  25. using nanopb::PrintPrimitiveField;
  26. using nanopb::PrintTail;
  27. /* @@protoc_insertion_point(includes) */
  28. #if PB_PROTO_HEADER_VERSION != 30
  29. #error Regenerate this file with the current version of nanopb generator.
  30. #endif
  31. const pb_field_t google_firestore_v1_DocumentMask_fields[2] = {
  32. PB_FIELD( 1, BYTES , REPEATED, POINTER , FIRST, google_firestore_v1_DocumentMask, field_paths, field_paths, 0),
  33. PB_LAST_FIELD
  34. };
  35. const pb_field_t google_firestore_v1_Precondition_fields[3] = {
  36. PB_ANONYMOUS_ONEOF_FIELD(condition_type, 1, BOOL , ONEOF, STATIC , FIRST, google_firestore_v1_Precondition, exists, exists, 0),
  37. PB_ANONYMOUS_ONEOF_FIELD(condition_type, 2, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_Precondition, update_time, update_time, &google_protobuf_Timestamp_fields),
  38. PB_LAST_FIELD
  39. };
  40. const pb_field_t google_firestore_v1_TransactionOptions_fields[3] = {
  41. PB_ANONYMOUS_ONEOF_FIELD(mode, 2, MESSAGE , ONEOF, STATIC , FIRST, google_firestore_v1_TransactionOptions, read_only, read_only, &google_firestore_v1_TransactionOptions_ReadOnly_fields),
  42. PB_ANONYMOUS_ONEOF_FIELD(mode, 3, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_TransactionOptions, read_write, read_write, &google_firestore_v1_TransactionOptions_ReadWrite_fields),
  43. PB_LAST_FIELD
  44. };
  45. const pb_field_t google_firestore_v1_TransactionOptions_ReadWrite_fields[2] = {
  46. PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_TransactionOptions_ReadWrite, retry_transaction, retry_transaction, 0),
  47. PB_LAST_FIELD
  48. };
  49. const pb_field_t google_firestore_v1_TransactionOptions_ReadOnly_fields[2] = {
  50. PB_ANONYMOUS_ONEOF_FIELD(consistency_selector, 2, MESSAGE , ONEOF, STATIC , FIRST, google_firestore_v1_TransactionOptions_ReadOnly, read_time, read_time, &google_protobuf_Timestamp_fields),
  51. PB_LAST_FIELD
  52. };
  53. /* Check that field information fits in pb_field_t */
  54. #if !defined(PB_FIELD_32BIT)
  55. /* If you get an error here, it means that you need to define PB_FIELD_32BIT
  56. * compile-time option. You can do that in pb.h or on compiler command line.
  57. *
  58. * The reason you need to do this is that some of your messages contain tag
  59. * numbers or field sizes that are larger than what can fit in 8 or 16 bit
  60. * field descriptors.
  61. */
  62. PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_Precondition, update_time) < 65536 && pb_membersize(google_firestore_v1_TransactionOptions, read_only) < 65536 && pb_membersize(google_firestore_v1_TransactionOptions, read_write) < 65536 && pb_membersize(google_firestore_v1_TransactionOptions_ReadOnly, read_time) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_google_firestore_v1_DocumentMask_google_firestore_v1_Precondition_google_firestore_v1_TransactionOptions_google_firestore_v1_TransactionOptions_ReadWrite_google_firestore_v1_TransactionOptions_ReadOnly)
  63. #endif
  64. #if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT)
  65. /* If you get an error here, it means that you need to define PB_FIELD_16BIT
  66. * compile-time option. You can do that in pb.h or on compiler command line.
  67. *
  68. * The reason you need to do this is that some of your messages contain tag
  69. * numbers or field sizes that are larger than what can fit in the default
  70. * 8 bit descriptors.
  71. */
  72. PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_Precondition, update_time) < 256 && pb_membersize(google_firestore_v1_TransactionOptions, read_only) < 256 && pb_membersize(google_firestore_v1_TransactionOptions, read_write) < 256 && pb_membersize(google_firestore_v1_TransactionOptions_ReadOnly, read_time) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_google_firestore_v1_DocumentMask_google_firestore_v1_Precondition_google_firestore_v1_TransactionOptions_google_firestore_v1_TransactionOptions_ReadWrite_google_firestore_v1_TransactionOptions_ReadOnly)
  73. #endif
  74. std::string google_firestore_v1_DocumentMask::ToString(int indent) const {
  75. std::string tostring_header = PrintHeader(indent, "DocumentMask", this);
  76. std::string tostring_result;
  77. for (pb_size_t i = 0; i != field_paths_count; ++i) {
  78. tostring_result += PrintPrimitiveField("field_paths: ",
  79. field_paths[i], indent + 1, true);
  80. }
  81. bool is_root = indent == 0;
  82. if (!tostring_result.empty() || is_root) {
  83. std::string tostring_tail = PrintTail(indent);
  84. return tostring_header + tostring_result + tostring_tail;
  85. } else {
  86. return "";
  87. }
  88. }
  89. std::string google_firestore_v1_Precondition::ToString(int indent) const {
  90. std::string tostring_header = PrintHeader(indent, "Precondition", this);
  91. std::string tostring_result;
  92. switch (which_condition_type) {
  93. case google_firestore_v1_Precondition_exists_tag:
  94. tostring_result += PrintPrimitiveField("exists: ",
  95. exists, indent + 1, true);
  96. break;
  97. case google_firestore_v1_Precondition_update_time_tag:
  98. tostring_result += PrintMessageField("update_time ",
  99. update_time, indent + 1, true);
  100. break;
  101. }
  102. bool is_root = indent == 0;
  103. if (!tostring_result.empty() || is_root) {
  104. std::string tostring_tail = PrintTail(indent);
  105. return tostring_header + tostring_result + tostring_tail;
  106. } else {
  107. return "";
  108. }
  109. }
  110. std::string google_firestore_v1_TransactionOptions::ToString(int indent) const {
  111. std::string tostring_header = PrintHeader(indent, "TransactionOptions", this);
  112. std::string tostring_result;
  113. switch (which_mode) {
  114. case google_firestore_v1_TransactionOptions_read_only_tag:
  115. tostring_result += PrintMessageField("read_only ",
  116. read_only, indent + 1, true);
  117. break;
  118. case google_firestore_v1_TransactionOptions_read_write_tag:
  119. tostring_result += PrintMessageField("read_write ",
  120. read_write, indent + 1, true);
  121. break;
  122. }
  123. bool is_root = indent == 0;
  124. if (!tostring_result.empty() || is_root) {
  125. std::string tostring_tail = PrintTail(indent);
  126. return tostring_header + tostring_result + tostring_tail;
  127. } else {
  128. return "";
  129. }
  130. }
  131. std::string google_firestore_v1_TransactionOptions_ReadWrite::ToString(int indent) const {
  132. std::string tostring_header = PrintHeader(indent, "ReadWrite", this);
  133. std::string tostring_result;
  134. tostring_result += PrintPrimitiveField("retry_transaction: ",
  135. retry_transaction, indent + 1, false);
  136. bool is_root = indent == 0;
  137. if (!tostring_result.empty() || is_root) {
  138. std::string tostring_tail = PrintTail(indent);
  139. return tostring_header + tostring_result + tostring_tail;
  140. } else {
  141. return "";
  142. }
  143. }
  144. std::string google_firestore_v1_TransactionOptions_ReadOnly::ToString(int indent) const {
  145. std::string tostring_header = PrintHeader(indent, "ReadOnly", this);
  146. std::string tostring_result;
  147. switch (which_consistency_selector) {
  148. case google_firestore_v1_TransactionOptions_ReadOnly_read_time_tag:
  149. tostring_result += PrintMessageField("read_time ",
  150. read_time, indent + 1, true);
  151. break;
  152. }
  153. bool is_root = indent == 0;
  154. if (!tostring_result.empty() || is_root) {
  155. std::string tostring_tail = PrintTail(indent);
  156. return tostring_header + tostring_result + tostring_tail;
  157. } else {
  158. return "";
  159. }
  160. }
  161. } // namespace firestore
  162. } // namespace firebase
  163. /* @@protoc_insertion_point(eof) */