status.nanopb.cc 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright 2022 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 header = PrintHeader(indent, "Status", this);
  39. std::string result;
  40. result += PrintPrimitiveField("code: ", code, indent + 1, false);
  41. result += PrintPrimitiveField("message: ", message, indent + 1, false);
  42. for (pb_size_t i = 0; i != details_count; ++i) {
  43. result += PrintMessageField("details ", details[i], indent + 1, true);
  44. }
  45. bool is_root = indent == 0;
  46. if (!result.empty() || is_root) {
  47. std::string tail = PrintTail(indent);
  48. return header + result + tail;
  49. } else {
  50. return "";
  51. }
  52. }
  53. } // namespace firestore
  54. } // namespace firebase
  55. /* @@protoc_insertion_point(eof) */