http.nanopb.cc 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. /*
  2. * Copyright 2023 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 "http.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_api_Http_fields[3] = {
  32. PB_FIELD( 1, MESSAGE , REPEATED, POINTER , FIRST, google_api_Http, rules, rules, &google_api_HttpRule_fields),
  33. PB_FIELD( 2, BOOL , SINGULAR, STATIC , OTHER, google_api_Http, fully_decode_reserved_expansion, rules, 0),
  34. PB_LAST_FIELD
  35. };
  36. const pb_field_t google_api_HttpRule_fields[10] = {
  37. PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_api_HttpRule, selector, selector, 0),
  38. PB_ANONYMOUS_ONEOF_FIELD(pattern, 2, BYTES , ONEOF, POINTER , OTHER, google_api_HttpRule, get, selector, 0),
  39. PB_ANONYMOUS_ONEOF_FIELD(pattern, 3, BYTES , ONEOF, POINTER , UNION, google_api_HttpRule, put, selector, 0),
  40. PB_ANONYMOUS_ONEOF_FIELD(pattern, 4, BYTES , ONEOF, POINTER , UNION, google_api_HttpRule, post, selector, 0),
  41. PB_ANONYMOUS_ONEOF_FIELD(pattern, 5, BYTES , ONEOF, POINTER , UNION, google_api_HttpRule, delete_, selector, 0),
  42. PB_ANONYMOUS_ONEOF_FIELD(pattern, 6, BYTES , ONEOF, POINTER , UNION, google_api_HttpRule, patch, selector, 0),
  43. PB_ANONYMOUS_ONEOF_FIELD(pattern, 8, MESSAGE , ONEOF, STATIC , UNION, google_api_HttpRule, custom, selector, &google_api_CustomHttpPattern_fields),
  44. PB_FIELD( 7, BYTES , SINGULAR, POINTER , OTHER, google_api_HttpRule, body, custom, 0),
  45. PB_FIELD( 11, MESSAGE , REPEATED, POINTER , OTHER, google_api_HttpRule, additional_bindings, body, &google_api_HttpRule_fields),
  46. PB_LAST_FIELD
  47. };
  48. const pb_field_t google_api_CustomHttpPattern_fields[3] = {
  49. PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_api_CustomHttpPattern, kind, kind, 0),
  50. PB_FIELD( 2, BYTES , SINGULAR, POINTER , OTHER, google_api_CustomHttpPattern, path, kind, 0),
  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_api_HttpRule, custom) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_google_api_Http_google_api_HttpRule_google_api_CustomHttpPattern)
  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_api_HttpRule, custom) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_google_api_Http_google_api_HttpRule_google_api_CustomHttpPattern)
  73. #endif
  74. std::string google_api_Http::ToString(int indent) const {
  75. std::string tostring_header = PrintHeader(indent, "Http", this);
  76. std::string tostring_result;
  77. for (pb_size_t i = 0; i != rules_count; ++i) {
  78. tostring_result += PrintMessageField("rules ",
  79. rules[i], indent + 1, true);
  80. }
  81. tostring_result += PrintPrimitiveField("fully_decode_reserved_expansion: ",
  82. fully_decode_reserved_expansion, indent + 1, false);
  83. bool is_root = indent == 0;
  84. if (!tostring_result.empty() || is_root) {
  85. std::string tostring_tail = PrintTail(indent);
  86. return tostring_header + tostring_result + tostring_tail;
  87. } else {
  88. return "";
  89. }
  90. }
  91. std::string google_api_HttpRule::ToString(int indent) const {
  92. std::string tostring_header = PrintHeader(indent, "HttpRule", this);
  93. std::string tostring_result;
  94. tostring_result += PrintPrimitiveField("selector: ",
  95. selector, indent + 1, false);
  96. switch (which_pattern) {
  97. case google_api_HttpRule_get_tag:
  98. tostring_result += PrintPrimitiveField("get: ", get, indent + 1, true);
  99. break;
  100. case google_api_HttpRule_put_tag:
  101. tostring_result += PrintPrimitiveField("put: ", put, indent + 1, true);
  102. break;
  103. case google_api_HttpRule_post_tag:
  104. tostring_result += PrintPrimitiveField("post: ",
  105. post, indent + 1, true);
  106. break;
  107. case google_api_HttpRule_delete_tag:
  108. tostring_result += PrintPrimitiveField("delete: ",
  109. delete_, indent + 1, true);
  110. break;
  111. case google_api_HttpRule_patch_tag:
  112. tostring_result += PrintPrimitiveField("patch: ",
  113. patch, indent + 1, true);
  114. break;
  115. case google_api_HttpRule_custom_tag:
  116. tostring_result += PrintMessageField("custom ",
  117. custom, indent + 1, true);
  118. break;
  119. }
  120. tostring_result += PrintPrimitiveField("body: ", body, indent + 1, false);
  121. for (pb_size_t i = 0; i != additional_bindings_count; ++i) {
  122. tostring_result += PrintMessageField("additional_bindings ",
  123. additional_bindings[i], indent + 1, true);
  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. std::string google_api_CustomHttpPattern::ToString(int indent) const {
  134. std::string tostring_header = PrintHeader(indent, "CustomHttpPattern", this);
  135. std::string tostring_result;
  136. tostring_result += PrintPrimitiveField("kind: ", kind, indent + 1, false);
  137. tostring_result += PrintPrimitiveField("path: ", path, indent + 1, false);
  138. bool is_root = indent == 0;
  139. if (!tostring_result.empty() || is_root) {
  140. std::string tostring_tail = PrintTail(indent);
  141. return tostring_header + tostring_result + tostring_tail;
  142. } else {
  143. return "";
  144. }
  145. }
  146. } // namespace firestore
  147. } // namespace firebase
  148. /* @@protoc_insertion_point(eof) */