Skip to content

Commit d5c336f

Browse files
authored
Add index.proto (#9334)
1 parent 5e01dfc commit d5c336f

File tree

11 files changed

+5023
-0
lines changed

11 files changed

+5023
-0
lines changed

Firestore/Example/Firestore.xcodeproj/project.pbxproj

Lines changed: 40 additions & 0 deletions
Large diffs are not rendered by default.

Firestore/Protos/cpp/google/api/resource.pb.cc

Lines changed: 846 additions & 0 deletions
Large diffs are not rendered by default.

Firestore/Protos/cpp/google/api/resource.pb.h

Lines changed: 1266 additions & 0 deletions
Large diffs are not rendered by default.

Firestore/Protos/cpp/google/firestore/admin/index.pb.cc

Lines changed: 867 additions & 0 deletions
Large diffs are not rendered by default.

Firestore/Protos/cpp/google/firestore/admin/index.pb.h

Lines changed: 1025 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
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) */
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
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 header */
18+
/* Generated by nanopb-0.3.9.8 */
19+
20+
#ifndef PB_GOOGLE_API_RESOURCE_NANOPB_H_INCLUDED
21+
#define PB_GOOGLE_API_RESOURCE_NANOPB_H_INCLUDED
22+
#include <pb.h>
23+
24+
#include <string>
25+
26+
namespace firebase {
27+
namespace firestore {
28+
29+
/* @@protoc_insertion_point(includes) */
30+
#if PB_PROTO_HEADER_VERSION != 30
31+
#error Regenerate this file with the current version of nanopb generator.
32+
#endif
33+
34+
35+
/* Enum definitions */
36+
typedef enum _google_api_ResourceDescriptor_History {
37+
google_api_ResourceDescriptor_History_HISTORY_UNSPECIFIED = 0,
38+
google_api_ResourceDescriptor_History_ORIGINALLY_SINGLE_PATTERN = 1,
39+
google_api_ResourceDescriptor_History_FUTURE_MULTI_PATTERN = 2
40+
} google_api_ResourceDescriptor_History;
41+
#define _google_api_ResourceDescriptor_History_MIN google_api_ResourceDescriptor_History_HISTORY_UNSPECIFIED
42+
#define _google_api_ResourceDescriptor_History_MAX google_api_ResourceDescriptor_History_FUTURE_MULTI_PATTERN
43+
#define _google_api_ResourceDescriptor_History_ARRAYSIZE ((google_api_ResourceDescriptor_History)(google_api_ResourceDescriptor_History_FUTURE_MULTI_PATTERN+1))
44+
45+
/* Struct definitions */
46+
typedef struct _google_api_ResourceReference {
47+
pb_bytes_array_t *type;
48+
pb_bytes_array_t *child_type;
49+
50+
std::string ToString(int indent = 0) const;
51+
/* @@protoc_insertion_point(struct:google_api_ResourceReference) */
52+
} google_api_ResourceReference;
53+
54+
typedef struct _google_api_ResourceDescriptor {
55+
pb_bytes_array_t *type;
56+
pb_size_t pattern_count;
57+
pb_bytes_array_t **pattern;
58+
pb_bytes_array_t *name_field;
59+
google_api_ResourceDescriptor_History history;
60+
pb_bytes_array_t *plural;
61+
pb_bytes_array_t *singular;
62+
63+
std::string ToString(int indent = 0) const;
64+
/* @@protoc_insertion_point(struct:google_api_ResourceDescriptor) */
65+
} google_api_ResourceDescriptor;
66+
67+
/* Extensions */
68+
/* Extension field google_api_resource_reference was skipped because only "optional"
69+
type of extension fields is currently supported. */
70+
/* Extension field google_api_resource_definition was skipped because only "optional"
71+
type of extension fields is currently supported. */
72+
/* Extension field google_api_resource was skipped because only "optional"
73+
type of extension fields is currently supported. */
74+
75+
/* Default values for struct fields */
76+
77+
/* Initializer values for message structs */
78+
#define google_api_ResourceDescriptor_init_default {NULL, 0, NULL, NULL, _google_api_ResourceDescriptor_History_MIN, NULL, NULL}
79+
#define google_api_ResourceReference_init_default {NULL, NULL}
80+
#define google_api_ResourceDescriptor_init_zero {NULL, 0, NULL, NULL, _google_api_ResourceDescriptor_History_MIN, NULL, NULL}
81+
#define google_api_ResourceReference_init_zero {NULL, NULL}
82+
83+
/* Field tags (for use in manual encoding/decoding) */
84+
#define google_api_ResourceReference_type_tag 1
85+
#define google_api_ResourceReference_child_type_tag 2
86+
#define google_api_ResourceDescriptor_type_tag 1
87+
#define google_api_ResourceDescriptor_pattern_tag 2
88+
#define google_api_ResourceDescriptor_name_field_tag 3
89+
#define google_api_ResourceDescriptor_history_tag 4
90+
#define google_api_ResourceDescriptor_plural_tag 5
91+
#define google_api_ResourceDescriptor_singular_tag 6
92+
#define google_api_resource_reference_tag 1055
93+
#define google_api_resource_definition_tag 1053
94+
#define google_api_resource_tag 1053
95+
96+
/* Struct field encoding specification for nanopb */
97+
extern const pb_field_t google_api_ResourceDescriptor_fields[7];
98+
extern const pb_field_t google_api_ResourceReference_fields[3];
99+
100+
/* Maximum encoded size of messages (where known) */
101+
/* google_api_ResourceDescriptor_size depends on runtime parameters */
102+
/* google_api_ResourceReference_size depends on runtime parameters */
103+
104+
/* Message IDs (where set with "msgid" option) */
105+
#ifdef PB_MSGID
106+
107+
#define RESOURCE_MESSAGES \
108+
109+
110+
#endif
111+
112+
const char* EnumToString(google_api_ResourceDescriptor_History value);
113+
} // namespace firestore
114+
} // namespace firebase
115+
116+
/* @@protoc_insertion_point(eof) */
117+
118+
#endif

0 commit comments

Comments
 (0)