http.nanopb.cc 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /*
  2. * Copyright 2021 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.7 */
  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 header = PrintHeader(indent, "Http", this);
  76. std::string result;
  77. for (pb_size_t i = 0; i != rules_count; ++i) {
  78. result += PrintMessageField("rules ", rules[i], indent + 1, true);
  79. }
  80. result += PrintPrimitiveField("fully_decode_reserved_expansion: ",
  81. fully_decode_reserved_expansion, indent + 1, false);
  82. bool is_root = indent == 0;
  83. if (!result.empty() || is_root) {
  84. std::string tail = PrintTail(indent);
  85. return header + result + tail;
  86. } else {
  87. return "";
  88. }
  89. }
  90. std::string google_api_HttpRule::ToString(int indent) const {
  91. std::string header = PrintHeader(indent, "HttpRule", this);
  92. std::string result;
  93. result += PrintPrimitiveField("selector: ", selector, indent + 1, false);
  94. switch (which_pattern) {
  95. case google_api_HttpRule_get_tag:
  96. result += PrintPrimitiveField("get: ", get, indent + 1, true);
  97. break;
  98. case google_api_HttpRule_put_tag:
  99. result += PrintPrimitiveField("put: ", put, indent + 1, true);
  100. break;
  101. case google_api_HttpRule_post_tag:
  102. result += PrintPrimitiveField("post: ", post, indent + 1, true);
  103. break;
  104. case google_api_HttpRule_delete_tag:
  105. result += PrintPrimitiveField("delete: ", delete_, indent + 1, true);
  106. break;
  107. case google_api_HttpRule_patch_tag:
  108. result += PrintPrimitiveField("patch: ", patch, indent + 1, true);
  109. break;
  110. case google_api_HttpRule_custom_tag:
  111. result += PrintMessageField("custom ", custom, indent + 1, true);
  112. break;
  113. }
  114. result += PrintPrimitiveField("body: ", body, indent + 1, false);
  115. for (pb_size_t i = 0; i != additional_bindings_count; ++i) {
  116. result += PrintMessageField("additional_bindings ",
  117. additional_bindings[i], indent + 1, true);
  118. }
  119. bool is_root = indent == 0;
  120. if (!result.empty() || is_root) {
  121. std::string tail = PrintTail(indent);
  122. return header + result + tail;
  123. } else {
  124. return "";
  125. }
  126. }
  127. std::string google_api_CustomHttpPattern::ToString(int indent) const {
  128. std::string header = PrintHeader(indent, "CustomHttpPattern", this);
  129. std::string result;
  130. result += PrintPrimitiveField("kind: ", kind, indent + 1, false);
  131. result += PrintPrimitiveField("path: ", path, indent + 1, false);
  132. bool is_root = indent == 0;
  133. if (!result.empty() || is_root) {
  134. std::string tail = PrintTail(indent);
  135. return header + result + tail;
  136. } else {
  137. return "";
  138. }
  139. }
  140. } // namespace firestore
  141. } // namespace firebase
  142. /* @@protoc_insertion_point(eof) */