status.nanopb.cc 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 "status.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_rpc_Status_fields[4] = {
  32. PB_FIELD( 1, INT32 , SINGULAR, STATIC , FIRST, google_rpc_Status, code, code, 0),
  33. PB_FIELD( 2, BYTES , SINGULAR, POINTER , OTHER, google_rpc_Status, message, code, 0),
  34. PB_FIELD( 3, MESSAGE , REPEATED, POINTER , OTHER, google_rpc_Status, details, message, &google_protobuf_Any_fields),
  35. PB_LAST_FIELD
  36. };
  37. std::string google_rpc_Status::ToString(int indent) const {
  38. std::string tostring_header = PrintHeader(indent, "Status", this);
  39. std::string tostring_result;
  40. tostring_result += PrintPrimitiveField("code: ", code, indent + 1, false);
  41. tostring_result += PrintPrimitiveField("message: ",
  42. message, indent + 1, false);
  43. for (pb_size_t i = 0; i != details_count; ++i) {
  44. tostring_result += PrintMessageField("details ",
  45. details[i], indent + 1, true);
  46. }
  47. bool is_root = indent == 0;
  48. if (!tostring_result.empty() || is_root) {
  49. std::string tostring_tail = PrintTail(indent);
  50. return tostring_header + tostring_result + tostring_tail;
  51. } else {
  52. return "";
  53. }
  54. }
  55. } // namespace firestore
  56. } // namespace firebase
  57. /* @@protoc_insertion_point(eof) */