index.nanopb.cc 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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 "index.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_admin_v1_Index_fields[5] = {
  32. PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_admin_v1_Index, name, name, 0),
  33. PB_FIELD( 2, UENUM , SINGULAR, STATIC , OTHER, google_firestore_admin_v1_Index, query_scope, name, 0),
  34. PB_FIELD( 3, MESSAGE , REPEATED, POINTER , OTHER, google_firestore_admin_v1_Index, fields, query_scope, &google_firestore_admin_v1_Index_IndexField_fields),
  35. PB_FIELD( 4, UENUM , SINGULAR, STATIC , OTHER, google_firestore_admin_v1_Index, state, fields, 0),
  36. PB_LAST_FIELD
  37. };
  38. const pb_field_t google_firestore_admin_v1_Index_IndexField_fields[4] = {
  39. PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_firestore_admin_v1_Index_IndexField, field_path, field_path, 0),
  40. PB_ANONYMOUS_ONEOF_FIELD(value_mode, 2, UENUM , ONEOF, STATIC , OTHER, google_firestore_admin_v1_Index_IndexField, order, field_path, 0),
  41. PB_ANONYMOUS_ONEOF_FIELD(value_mode, 3, UENUM , ONEOF, STATIC , UNION, google_firestore_admin_v1_Index_IndexField, array_config, field_path, 0),
  42. PB_LAST_FIELD
  43. };
  44. const char* EnumToString(
  45. google_firestore_admin_v1_Index_QueryScope value) {
  46. switch (value) {
  47. case google_firestore_admin_v1_Index_QueryScope_QUERY_SCOPE_UNSPECIFIED:
  48. return "QUERY_SCOPE_UNSPECIFIED";
  49. case google_firestore_admin_v1_Index_QueryScope_COLLECTION:
  50. return "COLLECTION";
  51. case google_firestore_admin_v1_Index_QueryScope_COLLECTION_GROUP:
  52. return "COLLECTION_GROUP";
  53. }
  54. return "<unknown enum value>";
  55. }
  56. const char* EnumToString(
  57. google_firestore_admin_v1_Index_State value) {
  58. switch (value) {
  59. case google_firestore_admin_v1_Index_State_STATE_UNSPECIFIED:
  60. return "STATE_UNSPECIFIED";
  61. case google_firestore_admin_v1_Index_State_CREATING:
  62. return "CREATING";
  63. case google_firestore_admin_v1_Index_State_READY:
  64. return "READY";
  65. case google_firestore_admin_v1_Index_State_NEEDS_REPAIR:
  66. return "NEEDS_REPAIR";
  67. }
  68. return "<unknown enum value>";
  69. }
  70. const char* EnumToString(
  71. google_firestore_admin_v1_Index_IndexField_Order value) {
  72. switch (value) {
  73. case google_firestore_admin_v1_Index_IndexField_Order_ORDER_UNSPECIFIED:
  74. return "ORDER_UNSPECIFIED";
  75. case google_firestore_admin_v1_Index_IndexField_Order_ASCENDING:
  76. return "ASCENDING";
  77. case google_firestore_admin_v1_Index_IndexField_Order_DESCENDING:
  78. return "DESCENDING";
  79. }
  80. return "<unknown enum value>";
  81. }
  82. const char* EnumToString(
  83. google_firestore_admin_v1_Index_IndexField_ArrayConfig value) {
  84. switch (value) {
  85. case google_firestore_admin_v1_Index_IndexField_ArrayConfig_ARRAY_CONFIG_UNSPECIFIED:
  86. return "ARRAY_CONFIG_UNSPECIFIED";
  87. case google_firestore_admin_v1_Index_IndexField_ArrayConfig_CONTAINS:
  88. return "CONTAINS";
  89. }
  90. return "<unknown enum value>";
  91. }
  92. std::string google_firestore_admin_v1_Index::ToString(int indent) const {
  93. std::string tostring_header = PrintHeader(indent, "Index", this);
  94. std::string tostring_result;
  95. tostring_result += PrintPrimitiveField("name: ", name, indent + 1, false);
  96. tostring_result += PrintEnumField("query_scope: ",
  97. query_scope, indent + 1, false);
  98. for (pb_size_t i = 0; i != fields_count; ++i) {
  99. tostring_result += PrintMessageField("fields ",
  100. fields[i], indent + 1, true);
  101. }
  102. tostring_result += PrintEnumField("state: ", state, indent + 1, false);
  103. bool is_root = indent == 0;
  104. if (!tostring_result.empty() || is_root) {
  105. std::string tostring_tail = PrintTail(indent);
  106. return tostring_header + tostring_result + tostring_tail;
  107. } else {
  108. return "";
  109. }
  110. }
  111. std::string google_firestore_admin_v1_Index_IndexField::ToString(int indent) const {
  112. std::string tostring_header = PrintHeader(indent, "IndexField", this);
  113. std::string tostring_result;
  114. tostring_result += PrintPrimitiveField("field_path: ",
  115. field_path, indent + 1, false);
  116. switch (which_value_mode) {
  117. case google_firestore_admin_v1_Index_IndexField_order_tag:
  118. tostring_result += PrintEnumField("order: ", order, indent + 1, true);
  119. break;
  120. case google_firestore_admin_v1_Index_IndexField_array_config_tag:
  121. tostring_result += PrintEnumField("array_config: ",
  122. array_config, indent + 1, true);
  123. break;
  124. }
  125. bool is_root = indent == 0;
  126. if (!tostring_result.empty() || is_root) {
  127. std::string tostring_tail = PrintTail(indent);
  128. return tostring_header + tostring_result + tostring_tail;
  129. } else {
  130. return "";
  131. }
  132. }
  133. } // namespace firestore
  134. } // namespace firebase
  135. /* @@protoc_insertion_point(eof) */