|
| 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 | + |
| 17 | +/* Automatically generated nanopb constant definitions */ |
| 18 | +/* Generated by nanopb-0.3.9.8 */ |
| 19 | + |
| 20 | +#include "resource.nanopb.h" |
| 21 | + |
| 22 | +#include "Firestore/core/src/nanopb/pretty_printing.h" |
| 23 | + |
| 24 | +namespace firebase { |
| 25 | +namespace firestore { |
| 26 | + |
| 27 | +using nanopb::PrintEnumField; |
| 28 | +using nanopb::PrintHeader; |
| 29 | +using nanopb::PrintMessageField; |
| 30 | +using nanopb::PrintPrimitiveField; |
| 31 | +using nanopb::PrintTail; |
| 32 | + |
| 33 | +/* @@protoc_insertion_point(includes) */ |
| 34 | +#if PB_PROTO_HEADER_VERSION != 30 |
| 35 | +#error Regenerate this file with the current version of nanopb generator. |
| 36 | +#endif |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | +const pb_field_t google_api_ResourceDescriptor_fields[7] = { |
| 41 | + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_api_ResourceDescriptor, type, type, 0), |
| 42 | + PB_FIELD( 2, BYTES , REPEATED, POINTER , OTHER, google_api_ResourceDescriptor, pattern, type, 0), |
| 43 | + PB_FIELD( 3, BYTES , SINGULAR, POINTER , OTHER, google_api_ResourceDescriptor, name_field, pattern, 0), |
| 44 | + PB_FIELD( 4, UENUM , SINGULAR, STATIC , OTHER, google_api_ResourceDescriptor, history, name_field, 0), |
| 45 | + PB_FIELD( 5, BYTES , SINGULAR, POINTER , OTHER, google_api_ResourceDescriptor, plural, history, 0), |
| 46 | + PB_FIELD( 6, BYTES , SINGULAR, POINTER , OTHER, google_api_ResourceDescriptor, singular, plural, 0), |
| 47 | + PB_LAST_FIELD |
| 48 | +}; |
| 49 | + |
| 50 | +const pb_field_t google_api_ResourceReference_fields[3] = { |
| 51 | + PB_FIELD( 1, BYTES , SINGULAR, POINTER , FIRST, google_api_ResourceReference, type, type, 0), |
| 52 | + PB_FIELD( 2, BYTES , SINGULAR, POINTER , OTHER, google_api_ResourceReference, child_type, type, 0), |
| 53 | + PB_LAST_FIELD |
| 54 | +}; |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | +/* Check that field information fits in pb_field_t */ |
| 62 | +#if !defined(PB_FIELD_32BIT) |
| 63 | +/* If you get an error here, it means that you need to define PB_FIELD_32BIT |
| 64 | + * compile-time option. You can do that in pb.h or on compiler command line. |
| 65 | + * |
| 66 | + * The reason you need to do this is that some of your messages contain tag |
| 67 | + * numbers or field sizes that are larger than what can fit in 8 or 16 bit |
| 68 | + * field descriptors. |
| 69 | + */ |
| 70 | +PB_STATIC_ASSERT((pb_membersize(google_api_resource_reference_struct, resource_reference) < 65536 && pb_membersize(google_api_resource_struct, resource) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_google_api_ResourceDescriptor_google_api_ResourceReference) |
| 71 | +#endif |
| 72 | + |
| 73 | +#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) |
| 74 | +#error Field descriptor for google_api_resource_reference_struct.resource_reference is too large. Define PB_FIELD_16BIT to fix this. |
| 75 | +#endif |
| 76 | + |
| 77 | + |
| 78 | +const char* EnumToString( |
| 79 | + google_api_ResourceDescriptor_History value) { |
| 80 | + switch (value) { |
| 81 | + case google_api_ResourceDescriptor_History_HISTORY_UNSPECIFIED: |
| 82 | + return "HISTORY_UNSPECIFIED"; |
| 83 | + case google_api_ResourceDescriptor_History_ORIGINALLY_SINGLE_PATTERN: |
| 84 | + return "ORIGINALLY_SINGLE_PATTERN"; |
| 85 | + case google_api_ResourceDescriptor_History_FUTURE_MULTI_PATTERN: |
| 86 | + return "FUTURE_MULTI_PATTERN"; |
| 87 | + } |
| 88 | + return "<unknown enum value>"; |
| 89 | +} |
| 90 | + |
| 91 | +std::string google_api_ResourceDescriptor::ToString(int indent) const { |
| 92 | + std::string header = PrintHeader(indent, "ResourceDescriptor", this); |
| 93 | + std::string result; |
| 94 | + |
| 95 | + result += PrintPrimitiveField("type: ", type, indent + 1, false); |
| 96 | + for (pb_size_t i = 0; i != pattern_count; ++i) { |
| 97 | + result += PrintPrimitiveField("pattern: ", |
| 98 | + pattern[i], indent + 1, true); |
| 99 | + } |
| 100 | + result += PrintPrimitiveField("name_field: ", |
| 101 | + name_field, indent + 1, false); |
| 102 | + result += PrintEnumField("history: ", history, indent + 1, false); |
| 103 | + result += PrintPrimitiveField("plural: ", plural, indent + 1, false); |
| 104 | + result += PrintPrimitiveField("singular: ", singular, indent + 1, false); |
| 105 | + |
| 106 | + bool is_root = indent == 0; |
| 107 | + if (!result.empty() || is_root) { |
| 108 | + std::string tail = PrintTail(indent); |
| 109 | + return header + result + tail; |
| 110 | + } else { |
| 111 | + return ""; |
| 112 | + } |
| 113 | +} |
| 114 | + |
| 115 | +std::string google_api_ResourceReference::ToString(int indent) const { |
| 116 | + std::string header = PrintHeader(indent, "ResourceReference", this); |
| 117 | + std::string result; |
| 118 | + |
| 119 | + result += PrintPrimitiveField("type: ", type, indent + 1, false); |
| 120 | + result += PrintPrimitiveField("child_type: ", |
| 121 | + child_type, indent + 1, false); |
| 122 | + |
| 123 | + bool is_root = indent == 0; |
| 124 | + if (!result.empty() || is_root) { |
| 125 | + std::string tail = PrintTail(indent); |
| 126 | + return header + result + tail; |
| 127 | + } else { |
| 128 | + return ""; |
| 129 | + } |
| 130 | +} |
| 131 | + |
| 132 | +} // namespace firestore |
| 133 | +} // namespace firebase |
| 134 | + |
| 135 | +/* @@protoc_insertion_point(eof) */ |
0 commit comments