query.nanopb.cc 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  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 "query.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_StructuredQuery_fields[9] = {
  32. PB_FIELD( 1, MESSAGE , SINGULAR, STATIC , FIRST, google_firestore_v1_StructuredQuery, select, select, &google_firestore_v1_StructuredQuery_Projection_fields),
  33. PB_FIELD( 2, MESSAGE , REPEATED, POINTER , OTHER, google_firestore_v1_StructuredQuery, from, select, &google_firestore_v1_StructuredQuery_CollectionSelector_fields),
  34. PB_FIELD( 3, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_StructuredQuery, where, from, &google_firestore_v1_StructuredQuery_Filter_fields),
  35. PB_FIELD( 4, MESSAGE , REPEATED, POINTER , OTHER, google_firestore_v1_StructuredQuery, order_by, where, &google_firestore_v1_StructuredQuery_Order_fields),
  36. PB_FIELD( 5, MESSAGE , OPTIONAL, STATIC , OTHER, google_firestore_v1_StructuredQuery, limit, order_by, &google_protobuf_Int32Value_fields),
  37. PB_FIELD( 6, INT32 , SINGULAR, STATIC , OTHER, google_firestore_v1_StructuredQuery, offset, limit, 0),
  38. PB_FIELD( 7, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_StructuredQuery, start_at, offset, &google_firestore_v1_Cursor_fields),
  39. PB_FIELD( 8, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_StructuredQuery, end_at, start_at, &google_firestore_v1_Cursor_fields),
  40. PB_LAST_FIELD
  41. };
  42. const pb_field_t google_firestore_v1_StructuredQuery_CollectionSelector_fields[3] = {
  43. PB_FIELD( 2, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_StructuredQuery_CollectionSelector, collection_id, collection_id, 0),
  44. PB_FIELD( 3, BOOL , SINGULAR, STATIC , OTHER, google_firestore_v1_StructuredQuery_CollectionSelector, all_descendants, collection_id, 0),
  45. PB_LAST_FIELD
  46. };
  47. const pb_field_t google_firestore_v1_StructuredQuery_Filter_fields[4] = {
  48. PB_ANONYMOUS_ONEOF_FIELD(filter_type, 1, MESSAGE , ONEOF, STATIC , FIRST, google_firestore_v1_StructuredQuery_Filter, composite_filter, composite_filter, &google_firestore_v1_StructuredQuery_CompositeFilter_fields),
  49. PB_ANONYMOUS_ONEOF_FIELD(filter_type, 2, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_StructuredQuery_Filter, field_filter, field_filter, &google_firestore_v1_StructuredQuery_FieldFilter_fields),
  50. PB_ANONYMOUS_ONEOF_FIELD(filter_type, 3, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_StructuredQuery_Filter, unary_filter, unary_filter, &google_firestore_v1_StructuredQuery_UnaryFilter_fields),
  51. PB_LAST_FIELD
  52. };
  53. const pb_field_t google_firestore_v1_StructuredQuery_CompositeFilter_fields[3] = {
  54. PB_FIELD( 1, UENUM , SINGULAR, STATIC , FIRST, google_firestore_v1_StructuredQuery_CompositeFilter, op, op, 0),
  55. PB_FIELD( 2, MESSAGE , REPEATED, POINTER , OTHER, google_firestore_v1_StructuredQuery_CompositeFilter, filters, op, &google_firestore_v1_StructuredQuery_Filter_fields),
  56. PB_LAST_FIELD
  57. };
  58. const pb_field_t google_firestore_v1_StructuredQuery_FieldFilter_fields[4] = {
  59. PB_FIELD( 1, MESSAGE , SINGULAR, STATIC , FIRST, google_firestore_v1_StructuredQuery_FieldFilter, field, field, &google_firestore_v1_StructuredQuery_FieldReference_fields),
  60. PB_FIELD( 2, UENUM , SINGULAR, STATIC , OTHER, google_firestore_v1_StructuredQuery_FieldFilter, op, field, 0),
  61. PB_FIELD( 3, MESSAGE , SINGULAR, STATIC , OTHER, google_firestore_v1_StructuredQuery_FieldFilter, value, op, &google_firestore_v1_Value_fields),
  62. PB_LAST_FIELD
  63. };
  64. const pb_field_t google_firestore_v1_StructuredQuery_UnaryFilter_fields[3] = {
  65. PB_FIELD( 1, UENUM , SINGULAR, STATIC , FIRST, google_firestore_v1_StructuredQuery_UnaryFilter, op, op, 0),
  66. PB_ANONYMOUS_ONEOF_FIELD(operand_type, 2, MESSAGE , ONEOF, STATIC , OTHER, google_firestore_v1_StructuredQuery_UnaryFilter, field, op, &google_firestore_v1_StructuredQuery_FieldReference_fields),
  67. PB_LAST_FIELD
  68. };
  69. const pb_field_t google_firestore_v1_StructuredQuery_Order_fields[3] = {
  70. PB_FIELD( 1, MESSAGE , SINGULAR, STATIC , FIRST, google_firestore_v1_StructuredQuery_Order, field, field, &google_firestore_v1_StructuredQuery_FieldReference_fields),
  71. PB_FIELD( 2, UENUM , SINGULAR, STATIC , OTHER, google_firestore_v1_StructuredQuery_Order, direction, field, 0),
  72. PB_LAST_FIELD
  73. };
  74. const pb_field_t google_firestore_v1_StructuredQuery_FieldReference_fields[2] = {
  75. PB_FIELD( 2, BYTES , SINGULAR, POINTER , FIRST, google_firestore_v1_StructuredQuery_FieldReference, field_path, field_path, 0),
  76. PB_LAST_FIELD
  77. };
  78. const pb_field_t google_firestore_v1_StructuredQuery_Projection_fields[2] = {
  79. PB_FIELD( 2, MESSAGE , REPEATED, POINTER , FIRST, google_firestore_v1_StructuredQuery_Projection, fields, fields, &google_firestore_v1_StructuredQuery_FieldReference_fields),
  80. PB_LAST_FIELD
  81. };
  82. const pb_field_t google_firestore_v1_StructuredAggregationQuery_fields[3] = {
  83. PB_ANONYMOUS_ONEOF_FIELD(query_type, 1, MESSAGE , ONEOF, STATIC , FIRST, google_firestore_v1_StructuredAggregationQuery, structured_query, structured_query, &google_firestore_v1_StructuredQuery_fields),
  84. PB_FIELD( 3, MESSAGE , REPEATED, POINTER , OTHER, google_firestore_v1_StructuredAggregationQuery, aggregations, structured_query, &google_firestore_v1_StructuredAggregationQuery_Aggregation_fields),
  85. PB_LAST_FIELD
  86. };
  87. const pb_field_t google_firestore_v1_StructuredAggregationQuery_Aggregation_fields[5] = {
  88. PB_ANONYMOUS_ONEOF_FIELD(operator, 1, MESSAGE , ONEOF, STATIC , FIRST, google_firestore_v1_StructuredAggregationQuery_Aggregation, count, count, &google_firestore_v1_StructuredAggregationQuery_Aggregation_Count_fields),
  89. PB_ANONYMOUS_ONEOF_FIELD(operator, 2, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_StructuredAggregationQuery_Aggregation, sum, sum, &google_firestore_v1_StructuredAggregationQuery_Aggregation_Sum_fields),
  90. PB_ANONYMOUS_ONEOF_FIELD(operator, 3, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_StructuredAggregationQuery_Aggregation, avg, avg, &google_firestore_v1_StructuredAggregationQuery_Aggregation_Avg_fields),
  91. PB_FIELD( 7, BYTES , SINGULAR, POINTER , OTHER, google_firestore_v1_StructuredAggregationQuery_Aggregation, alias, avg, 0),
  92. PB_LAST_FIELD
  93. };
  94. const pb_field_t google_firestore_v1_StructuredAggregationQuery_Aggregation_Count_fields[2] = {
  95. PB_FIELD( 1, MESSAGE , SINGULAR, STATIC , FIRST, google_firestore_v1_StructuredAggregationQuery_Aggregation_Count, up_to, up_to, &google_protobuf_Int64Value_fields),
  96. PB_LAST_FIELD
  97. };
  98. const pb_field_t google_firestore_v1_StructuredAggregationQuery_Aggregation_Sum_fields[2] = {
  99. PB_FIELD( 1, MESSAGE , SINGULAR, STATIC , FIRST, google_firestore_v1_StructuredAggregationQuery_Aggregation_Sum, field, field, &google_firestore_v1_StructuredQuery_FieldReference_fields),
  100. PB_LAST_FIELD
  101. };
  102. const pb_field_t google_firestore_v1_StructuredAggregationQuery_Aggregation_Avg_fields[2] = {
  103. PB_FIELD( 1, MESSAGE , SINGULAR, STATIC , FIRST, google_firestore_v1_StructuredAggregationQuery_Aggregation_Avg, field, field, &google_firestore_v1_StructuredQuery_FieldReference_fields),
  104. PB_LAST_FIELD
  105. };
  106. const pb_field_t google_firestore_v1_Cursor_fields[3] = {
  107. PB_FIELD( 1, MESSAGE , REPEATED, POINTER , FIRST, google_firestore_v1_Cursor, values, values, &google_firestore_v1_Value_fields),
  108. PB_FIELD( 2, BOOL , SINGULAR, STATIC , OTHER, google_firestore_v1_Cursor, before, values, 0),
  109. PB_LAST_FIELD
  110. };
  111. /* Check that field information fits in pb_field_t */
  112. #if !defined(PB_FIELD_32BIT)
  113. /* If you get an error here, it means that you need to define PB_FIELD_32BIT
  114. * compile-time option. You can do that in pb.h or on compiler command line.
  115. *
  116. * The reason you need to do this is that some of your messages contain tag
  117. * numbers or field sizes that are larger than what can fit in 8 or 16 bit
  118. * field descriptors.
  119. */
  120. PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_StructuredQuery, select) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery, where) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery, start_at) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery, end_at) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery, limit) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery_Filter, composite_filter) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery_Filter, field_filter) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery_Filter, unary_filter) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery_FieldFilter, field) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery_FieldFilter, value) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery_UnaryFilter, field) < 65536 && pb_membersize(google_firestore_v1_StructuredQuery_Order, field) < 65536 && pb_membersize(google_firestore_v1_StructuredAggregationQuery, structured_query) < 65536 && pb_membersize(google_firestore_v1_StructuredAggregationQuery_Aggregation, count) < 65536 && pb_membersize(google_firestore_v1_StructuredAggregationQuery_Aggregation, sum) < 65536 && pb_membersize(google_firestore_v1_StructuredAggregationQuery_Aggregation, avg) < 65536 && pb_membersize(google_firestore_v1_StructuredAggregationQuery_Aggregation_Count, up_to) < 65536 && pb_membersize(google_firestore_v1_StructuredAggregationQuery_Aggregation_Sum, field) < 65536 && pb_membersize(google_firestore_v1_StructuredAggregationQuery_Aggregation_Avg, field) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_google_firestore_v1_StructuredQuery_google_firestore_v1_StructuredQuery_CollectionSelector_google_firestore_v1_StructuredQuery_Filter_google_firestore_v1_StructuredQuery_CompositeFilter_google_firestore_v1_StructuredQuery_FieldFilter_google_firestore_v1_StructuredQuery_UnaryFilter_google_firestore_v1_StructuredQuery_Order_google_firestore_v1_StructuredQuery_FieldReference_google_firestore_v1_StructuredQuery_Projection_google_firestore_v1_StructuredAggregationQuery_google_firestore_v1_StructuredAggregationQuery_Aggregation_google_firestore_v1_StructuredAggregationQuery_Aggregation_Count_google_firestore_v1_StructuredAggregationQuery_Aggregation_Sum_google_firestore_v1_StructuredAggregationQuery_Aggregation_Avg_google_firestore_v1_Cursor)
  121. #endif
  122. #if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT)
  123. /* If you get an error here, it means that you need to define PB_FIELD_16BIT
  124. * compile-time option. You can do that in pb.h or on compiler command line.
  125. *
  126. * The reason you need to do this is that some of your messages contain tag
  127. * numbers or field sizes that are larger than what can fit in the default
  128. * 8 bit descriptors.
  129. */
  130. PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_StructuredQuery, select) < 256 && pb_membersize(google_firestore_v1_StructuredQuery, where) < 256 && pb_membersize(google_firestore_v1_StructuredQuery, start_at) < 256 && pb_membersize(google_firestore_v1_StructuredQuery, end_at) < 256 && pb_membersize(google_firestore_v1_StructuredQuery, limit) < 256 && pb_membersize(google_firestore_v1_StructuredQuery_Filter, composite_filter) < 256 && pb_membersize(google_firestore_v1_StructuredQuery_Filter, field_filter) < 256 && pb_membersize(google_firestore_v1_StructuredQuery_Filter, unary_filter) < 256 && pb_membersize(google_firestore_v1_StructuredQuery_FieldFilter, field) < 256 && pb_membersize(google_firestore_v1_StructuredQuery_FieldFilter, value) < 256 && pb_membersize(google_firestore_v1_StructuredQuery_UnaryFilter, field) < 256 && pb_membersize(google_firestore_v1_StructuredQuery_Order, field) < 256 && pb_membersize(google_firestore_v1_StructuredAggregationQuery, structured_query) < 256 && pb_membersize(google_firestore_v1_StructuredAggregationQuery_Aggregation, count) < 256 && pb_membersize(google_firestore_v1_StructuredAggregationQuery_Aggregation, sum) < 256 && pb_membersize(google_firestore_v1_StructuredAggregationQuery_Aggregation, avg) < 256 && pb_membersize(google_firestore_v1_StructuredAggregationQuery_Aggregation_Count, up_to) < 256 && pb_membersize(google_firestore_v1_StructuredAggregationQuery_Aggregation_Sum, field) < 256 && pb_membersize(google_firestore_v1_StructuredAggregationQuery_Aggregation_Avg, field) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_google_firestore_v1_StructuredQuery_google_firestore_v1_StructuredQuery_CollectionSelector_google_firestore_v1_StructuredQuery_Filter_google_firestore_v1_StructuredQuery_CompositeFilter_google_firestore_v1_StructuredQuery_FieldFilter_google_firestore_v1_StructuredQuery_UnaryFilter_google_firestore_v1_StructuredQuery_Order_google_firestore_v1_StructuredQuery_FieldReference_google_firestore_v1_StructuredQuery_Projection_google_firestore_v1_StructuredAggregationQuery_google_firestore_v1_StructuredAggregationQuery_Aggregation_google_firestore_v1_StructuredAggregationQuery_Aggregation_Count_google_firestore_v1_StructuredAggregationQuery_Aggregation_Sum_google_firestore_v1_StructuredAggregationQuery_Aggregation_Avg_google_firestore_v1_Cursor)
  131. #endif
  132. const char* EnumToString(
  133. google_firestore_v1_StructuredQuery_Direction value) {
  134. switch (value) {
  135. case google_firestore_v1_StructuredQuery_Direction_DIRECTION_UNSPECIFIED:
  136. return "DIRECTION_UNSPECIFIED";
  137. case google_firestore_v1_StructuredQuery_Direction_ASCENDING:
  138. return "ASCENDING";
  139. case google_firestore_v1_StructuredQuery_Direction_DESCENDING:
  140. return "DESCENDING";
  141. }
  142. return "<unknown enum value>";
  143. }
  144. const char* EnumToString(
  145. google_firestore_v1_StructuredQuery_CompositeFilter_Operator value) {
  146. switch (value) {
  147. case google_firestore_v1_StructuredQuery_CompositeFilter_Operator_OPERATOR_UNSPECIFIED:
  148. return "OPERATOR_UNSPECIFIED";
  149. case google_firestore_v1_StructuredQuery_CompositeFilter_Operator_AND:
  150. return "AND";
  151. case google_firestore_v1_StructuredQuery_CompositeFilter_Operator_OR:
  152. return "OR";
  153. }
  154. return "<unknown enum value>";
  155. }
  156. const char* EnumToString(
  157. google_firestore_v1_StructuredQuery_FieldFilter_Operator value) {
  158. switch (value) {
  159. case google_firestore_v1_StructuredQuery_FieldFilter_Operator_OPERATOR_UNSPECIFIED:
  160. return "OPERATOR_UNSPECIFIED";
  161. case google_firestore_v1_StructuredQuery_FieldFilter_Operator_LESS_THAN:
  162. return "LESS_THAN";
  163. case google_firestore_v1_StructuredQuery_FieldFilter_Operator_LESS_THAN_OR_EQUAL:
  164. return "LESS_THAN_OR_EQUAL";
  165. case google_firestore_v1_StructuredQuery_FieldFilter_Operator_GREATER_THAN:
  166. return "GREATER_THAN";
  167. case google_firestore_v1_StructuredQuery_FieldFilter_Operator_GREATER_THAN_OR_EQUAL:
  168. return "GREATER_THAN_OR_EQUAL";
  169. case google_firestore_v1_StructuredQuery_FieldFilter_Operator_EQUAL:
  170. return "EQUAL";
  171. case google_firestore_v1_StructuredQuery_FieldFilter_Operator_NOT_EQUAL:
  172. return "NOT_EQUAL";
  173. case google_firestore_v1_StructuredQuery_FieldFilter_Operator_ARRAY_CONTAINS:
  174. return "ARRAY_CONTAINS";
  175. case google_firestore_v1_StructuredQuery_FieldFilter_Operator_IN:
  176. return "IN";
  177. case google_firestore_v1_StructuredQuery_FieldFilter_Operator_ARRAY_CONTAINS_ANY:
  178. return "ARRAY_CONTAINS_ANY";
  179. case google_firestore_v1_StructuredQuery_FieldFilter_Operator_NOT_IN:
  180. return "NOT_IN";
  181. }
  182. return "<unknown enum value>";
  183. }
  184. const char* EnumToString(
  185. google_firestore_v1_StructuredQuery_UnaryFilter_Operator value) {
  186. switch (value) {
  187. case google_firestore_v1_StructuredQuery_UnaryFilter_Operator_OPERATOR_UNSPECIFIED:
  188. return "OPERATOR_UNSPECIFIED";
  189. case google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NAN:
  190. return "IS_NAN";
  191. case google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NULL:
  192. return "IS_NULL";
  193. case google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NOT_NAN:
  194. return "IS_NOT_NAN";
  195. case google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NOT_NULL:
  196. return "IS_NOT_NULL";
  197. }
  198. return "<unknown enum value>";
  199. }
  200. std::string google_firestore_v1_StructuredQuery::ToString(int indent) const {
  201. std::string tostring_header = PrintHeader(indent, "StructuredQuery", this);
  202. std::string tostring_result;
  203. tostring_result += PrintMessageField("select ", select, indent + 1, false);
  204. for (pb_size_t i = 0; i != from_count; ++i) {
  205. tostring_result += PrintMessageField("from ",
  206. from[i], indent + 1, true);
  207. }
  208. tostring_result += PrintMessageField("where ", where, indent + 1, false);
  209. for (pb_size_t i = 0; i != order_by_count; ++i) {
  210. tostring_result += PrintMessageField("order_by ",
  211. order_by[i], indent + 1, true);
  212. }
  213. if (has_limit) {
  214. tostring_result += PrintMessageField("limit ",
  215. limit, indent + 1, true);
  216. }
  217. tostring_result += PrintPrimitiveField("offset: ",
  218. offset, indent + 1, false);
  219. tostring_result += PrintMessageField("start_at ",
  220. start_at, indent + 1, false);
  221. tostring_result += PrintMessageField("end_at ", end_at, indent + 1, false);
  222. std::string tostring_tail = PrintTail(indent);
  223. return tostring_header + tostring_result + tostring_tail;
  224. }
  225. std::string google_firestore_v1_StructuredQuery_CollectionSelector::ToString(int indent) const {
  226. std::string tostring_header = PrintHeader(indent, "CollectionSelector", this);
  227. std::string tostring_result;
  228. tostring_result += PrintPrimitiveField("collection_id: ",
  229. collection_id, indent + 1, false);
  230. tostring_result += PrintPrimitiveField("all_descendants: ",
  231. all_descendants, indent + 1, false);
  232. bool is_root = indent == 0;
  233. if (!tostring_result.empty() || is_root) {
  234. std::string tostring_tail = PrintTail(indent);
  235. return tostring_header + tostring_result + tostring_tail;
  236. } else {
  237. return "";
  238. }
  239. }
  240. std::string google_firestore_v1_StructuredQuery_Filter::ToString(int indent) const {
  241. std::string tostring_header = PrintHeader(indent, "Filter", this);
  242. std::string tostring_result;
  243. switch (which_filter_type) {
  244. case google_firestore_v1_StructuredQuery_Filter_composite_filter_tag:
  245. tostring_result += PrintMessageField("composite_filter ",
  246. composite_filter, indent + 1, true);
  247. break;
  248. case google_firestore_v1_StructuredQuery_Filter_field_filter_tag:
  249. tostring_result += PrintMessageField("field_filter ",
  250. field_filter, indent + 1, true);
  251. break;
  252. case google_firestore_v1_StructuredQuery_Filter_unary_filter_tag:
  253. tostring_result += PrintMessageField("unary_filter ",
  254. unary_filter, indent + 1, true);
  255. break;
  256. }
  257. bool is_root = indent == 0;
  258. if (!tostring_result.empty() || is_root) {
  259. std::string tostring_tail = PrintTail(indent);
  260. return tostring_header + tostring_result + tostring_tail;
  261. } else {
  262. return "";
  263. }
  264. }
  265. std::string google_firestore_v1_StructuredQuery_CompositeFilter::ToString(int indent) const {
  266. std::string tostring_header = PrintHeader(indent, "CompositeFilter", this);
  267. std::string tostring_result;
  268. tostring_result += PrintEnumField("op: ", op, indent + 1, false);
  269. for (pb_size_t i = 0; i != filters_count; ++i) {
  270. tostring_result += PrintMessageField("filters ",
  271. filters[i], indent + 1, true);
  272. }
  273. bool is_root = indent == 0;
  274. if (!tostring_result.empty() || is_root) {
  275. std::string tostring_tail = PrintTail(indent);
  276. return tostring_header + tostring_result + tostring_tail;
  277. } else {
  278. return "";
  279. }
  280. }
  281. std::string google_firestore_v1_StructuredQuery_FieldFilter::ToString(int indent) const {
  282. std::string tostring_header = PrintHeader(indent, "FieldFilter", this);
  283. std::string tostring_result;
  284. tostring_result += PrintMessageField("field ", field, indent + 1, false);
  285. tostring_result += PrintEnumField("op: ", op, indent + 1, false);
  286. tostring_result += PrintMessageField("value ", value, indent + 1, false);
  287. std::string tostring_tail = PrintTail(indent);
  288. return tostring_header + tostring_result + tostring_tail;
  289. }
  290. std::string google_firestore_v1_StructuredQuery_UnaryFilter::ToString(int indent) const {
  291. std::string tostring_header = PrintHeader(indent, "UnaryFilter", this);
  292. std::string tostring_result;
  293. tostring_result += PrintEnumField("op: ", op, indent + 1, false);
  294. switch (which_operand_type) {
  295. case google_firestore_v1_StructuredQuery_UnaryFilter_field_tag:
  296. tostring_result += PrintMessageField("field ",
  297. field, indent + 1, true);
  298. break;
  299. }
  300. bool is_root = indent == 0;
  301. if (!tostring_result.empty() || is_root) {
  302. std::string tostring_tail = PrintTail(indent);
  303. return tostring_header + tostring_result + tostring_tail;
  304. } else {
  305. return "";
  306. }
  307. }
  308. std::string google_firestore_v1_StructuredQuery_Order::ToString(int indent) const {
  309. std::string tostring_header = PrintHeader(indent, "Order", this);
  310. std::string tostring_result;
  311. tostring_result += PrintMessageField("field ", field, indent + 1, false);
  312. tostring_result += PrintEnumField("direction: ",
  313. direction, indent + 1, false);
  314. std::string tostring_tail = PrintTail(indent);
  315. return tostring_header + tostring_result + tostring_tail;
  316. }
  317. std::string google_firestore_v1_StructuredQuery_FieldReference::ToString(int indent) const {
  318. std::string tostring_header = PrintHeader(indent, "FieldReference", this);
  319. std::string tostring_result;
  320. tostring_result += PrintPrimitiveField("field_path: ",
  321. field_path, indent + 1, false);
  322. bool is_root = indent == 0;
  323. if (!tostring_result.empty() || is_root) {
  324. std::string tostring_tail = PrintTail(indent);
  325. return tostring_header + tostring_result + tostring_tail;
  326. } else {
  327. return "";
  328. }
  329. }
  330. std::string google_firestore_v1_StructuredQuery_Projection::ToString(int indent) const {
  331. std::string tostring_header = PrintHeader(indent, "Projection", this);
  332. std::string tostring_result;
  333. for (pb_size_t i = 0; i != fields_count; ++i) {
  334. tostring_result += PrintMessageField("fields ",
  335. fields[i], indent + 1, true);
  336. }
  337. bool is_root = indent == 0;
  338. if (!tostring_result.empty() || is_root) {
  339. std::string tostring_tail = PrintTail(indent);
  340. return tostring_header + tostring_result + tostring_tail;
  341. } else {
  342. return "";
  343. }
  344. }
  345. std::string google_firestore_v1_StructuredAggregationQuery::ToString(int indent) const {
  346. std::string tostring_header = PrintHeader(indent, "StructuredAggregationQuery", this);
  347. std::string tostring_result;
  348. switch (which_query_type) {
  349. case google_firestore_v1_StructuredAggregationQuery_structured_query_tag:
  350. tostring_result += PrintMessageField("structured_query ",
  351. structured_query, indent + 1, true);
  352. break;
  353. }
  354. for (pb_size_t i = 0; i != aggregations_count; ++i) {
  355. tostring_result += PrintMessageField("aggregations ",
  356. aggregations[i], indent + 1, true);
  357. }
  358. bool is_root = indent == 0;
  359. if (!tostring_result.empty() || is_root) {
  360. std::string tostring_tail = PrintTail(indent);
  361. return tostring_header + tostring_result + tostring_tail;
  362. } else {
  363. return "";
  364. }
  365. }
  366. std::string google_firestore_v1_StructuredAggregationQuery_Aggregation::ToString(int indent) const {
  367. std::string tostring_header = PrintHeader(indent, "Aggregation", this);
  368. std::string tostring_result;
  369. switch (which_operator) {
  370. case google_firestore_v1_StructuredAggregationQuery_Aggregation_count_tag:
  371. tostring_result += PrintMessageField("count ",
  372. count, indent + 1, true);
  373. break;
  374. case google_firestore_v1_StructuredAggregationQuery_Aggregation_sum_tag:
  375. tostring_result += PrintMessageField("sum ", sum, indent + 1, true);
  376. break;
  377. case google_firestore_v1_StructuredAggregationQuery_Aggregation_avg_tag:
  378. tostring_result += PrintMessageField("avg ", avg, indent + 1, true);
  379. break;
  380. }
  381. tostring_result += PrintPrimitiveField("alias: ",
  382. alias, indent + 1, false);
  383. bool is_root = indent == 0;
  384. if (!tostring_result.empty() || is_root) {
  385. std::string tostring_tail = PrintTail(indent);
  386. return tostring_header + tostring_result + tostring_tail;
  387. } else {
  388. return "";
  389. }
  390. }
  391. std::string google_firestore_v1_StructuredAggregationQuery_Aggregation_Count::ToString(int indent) const {
  392. std::string tostring_header = PrintHeader(indent, "Count", this);
  393. std::string tostring_result;
  394. tostring_result += PrintMessageField("up_to ", up_to, indent + 1, false);
  395. std::string tostring_tail = PrintTail(indent);
  396. return tostring_header + tostring_result + tostring_tail;
  397. }
  398. std::string google_firestore_v1_StructuredAggregationQuery_Aggregation_Sum::ToString(int indent) const {
  399. std::string tostring_header = PrintHeader(indent, "Sum", this);
  400. std::string tostring_result;
  401. tostring_result += PrintMessageField("field ", field, indent + 1, false);
  402. std::string tostring_tail = PrintTail(indent);
  403. return tostring_header + tostring_result + tostring_tail;
  404. }
  405. std::string google_firestore_v1_StructuredAggregationQuery_Aggregation_Avg::ToString(int indent) const {
  406. std::string tostring_header = PrintHeader(indent, "Avg", this);
  407. std::string tostring_result;
  408. tostring_result += PrintMessageField("field ", field, indent + 1, false);
  409. std::string tostring_tail = PrintTail(indent);
  410. return tostring_header + tostring_result + tostring_tail;
  411. }
  412. std::string google_firestore_v1_Cursor::ToString(int indent) const {
  413. std::string tostring_header = PrintHeader(indent, "Cursor", this);
  414. std::string tostring_result;
  415. for (pb_size_t i = 0; i != values_count; ++i) {
  416. tostring_result += PrintMessageField("values ",
  417. values[i], indent + 1, true);
  418. }
  419. tostring_result += PrintPrimitiveField("before: ",
  420. before, indent + 1, false);
  421. bool is_root = indent == 0;
  422. if (!tostring_result.empty() || is_root) {
  423. std::string tostring_tail = PrintTail(indent);
  424. return tostring_header + tostring_result + tostring_tail;
  425. } else {
  426. return "";
  427. }
  428. }
  429. } // namespace firestore
  430. } // namespace firebase
  431. /* @@protoc_insertion_point(eof) */