1 /* This file was generated by upbc (the upb compiler) from the input
2 * file:
3 *
4 * xds/core/v3/collection_entry.proto
5 *
6 * Do not edit -- your changes will be discarded when the file is
7 * regenerated. */
8
9 #ifndef XDS_CORE_V3_COLLECTION_ENTRY_PROTO_UPB_H_
10 #define XDS_CORE_V3_COLLECTION_ENTRY_PROTO_UPB_H_
11
12 #include "upb/collections/array_internal.h"
13 #include "upb/collections/map_gencode_util.h"
14 #include "upb/message/accessors.h"
15 #include "upb/message/internal.h"
16 #include "upb/mini_table/enum_internal.h"
17 #include "upb/wire/decode.h"
18 #include "upb/wire/decode_fast.h"
19 #include "upb/wire/encode.h"
20
21 // Must be last.
22 #include "upb/port/def.inc"
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 typedef struct xds_core_v3_CollectionEntry xds_core_v3_CollectionEntry;
29 typedef struct xds_core_v3_CollectionEntry_InlineEntry xds_core_v3_CollectionEntry_InlineEntry;
30 extern const upb_MiniTable xds_core_v3_CollectionEntry_msg_init;
31 extern const upb_MiniTable xds_core_v3_CollectionEntry_InlineEntry_msg_init;
32 struct google_protobuf_Any;
33 struct xds_core_v3_ResourceLocator;
34 extern const upb_MiniTable google_protobuf_Any_msg_init;
35 extern const upb_MiniTable xds_core_v3_ResourceLocator_msg_init;
36
37
38
39 /* xds.core.v3.CollectionEntry */
40
xds_core_v3_CollectionEntry_new(upb_Arena * arena)41 UPB_INLINE xds_core_v3_CollectionEntry* xds_core_v3_CollectionEntry_new(upb_Arena* arena) {
42 return (xds_core_v3_CollectionEntry*)_upb_Message_New(&xds_core_v3_CollectionEntry_msg_init, arena);
43 }
xds_core_v3_CollectionEntry_parse(const char * buf,size_t size,upb_Arena * arena)44 UPB_INLINE xds_core_v3_CollectionEntry* xds_core_v3_CollectionEntry_parse(const char* buf, size_t size, upb_Arena* arena) {
45 xds_core_v3_CollectionEntry* ret = xds_core_v3_CollectionEntry_new(arena);
46 if (!ret) return NULL;
47 if (upb_Decode(buf, size, ret, &xds_core_v3_CollectionEntry_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
48 return NULL;
49 }
50 return ret;
51 }
xds_core_v3_CollectionEntry_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)52 UPB_INLINE xds_core_v3_CollectionEntry* xds_core_v3_CollectionEntry_parse_ex(const char* buf, size_t size,
53 const upb_ExtensionRegistry* extreg,
54 int options, upb_Arena* arena) {
55 xds_core_v3_CollectionEntry* ret = xds_core_v3_CollectionEntry_new(arena);
56 if (!ret) return NULL;
57 if (upb_Decode(buf, size, ret, &xds_core_v3_CollectionEntry_msg_init, extreg, options, arena) !=
58 kUpb_DecodeStatus_Ok) {
59 return NULL;
60 }
61 return ret;
62 }
xds_core_v3_CollectionEntry_serialize(const xds_core_v3_CollectionEntry * msg,upb_Arena * arena,size_t * len)63 UPB_INLINE char* xds_core_v3_CollectionEntry_serialize(const xds_core_v3_CollectionEntry* msg, upb_Arena* arena, size_t* len) {
64 char* ptr;
65 (void)upb_Encode(msg, &xds_core_v3_CollectionEntry_msg_init, 0, arena, &ptr, len);
66 return ptr;
67 }
xds_core_v3_CollectionEntry_serialize_ex(const xds_core_v3_CollectionEntry * msg,int options,upb_Arena * arena,size_t * len)68 UPB_INLINE char* xds_core_v3_CollectionEntry_serialize_ex(const xds_core_v3_CollectionEntry* msg, int options,
69 upb_Arena* arena, size_t* len) {
70 char* ptr;
71 (void)upb_Encode(msg, &xds_core_v3_CollectionEntry_msg_init, options, arena, &ptr, len);
72 return ptr;
73 }
74 typedef enum {
75 xds_core_v3_CollectionEntry_resource_specifier_locator = 1,
76 xds_core_v3_CollectionEntry_resource_specifier_inline_entry = 2,
77 xds_core_v3_CollectionEntry_resource_specifier_NOT_SET = 0
78 } xds_core_v3_CollectionEntry_resource_specifier_oneofcases;
xds_core_v3_CollectionEntry_resource_specifier_case(const xds_core_v3_CollectionEntry * msg)79 UPB_INLINE xds_core_v3_CollectionEntry_resource_specifier_oneofcases xds_core_v3_CollectionEntry_resource_specifier_case(const xds_core_v3_CollectionEntry* msg) {
80 const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
81 return (xds_core_v3_CollectionEntry_resource_specifier_oneofcases)upb_Message_WhichOneofFieldNumber(msg, &field);
82 }
xds_core_v3_CollectionEntry_clear_locator(xds_core_v3_CollectionEntry * msg)83 UPB_INLINE void xds_core_v3_CollectionEntry_clear_locator(xds_core_v3_CollectionEntry* msg) {
84 const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
85 _upb_Message_ClearNonExtensionField(msg, &field);
86 }
xds_core_v3_CollectionEntry_locator(const xds_core_v3_CollectionEntry * msg)87 UPB_INLINE const struct xds_core_v3_ResourceLocator* xds_core_v3_CollectionEntry_locator(const xds_core_v3_CollectionEntry* msg) {
88 const struct xds_core_v3_ResourceLocator* default_val = NULL;
89 const struct xds_core_v3_ResourceLocator* ret;
90 const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
91 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
92 return ret;
93 }
xds_core_v3_CollectionEntry_has_locator(const xds_core_v3_CollectionEntry * msg)94 UPB_INLINE bool xds_core_v3_CollectionEntry_has_locator(const xds_core_v3_CollectionEntry* msg) {
95 const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
96 return _upb_Message_HasNonExtensionField(msg, &field);
97 }
xds_core_v3_CollectionEntry_clear_inline_entry(xds_core_v3_CollectionEntry * msg)98 UPB_INLINE void xds_core_v3_CollectionEntry_clear_inline_entry(xds_core_v3_CollectionEntry* msg) {
99 const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
100 _upb_Message_ClearNonExtensionField(msg, &field);
101 }
xds_core_v3_CollectionEntry_inline_entry(const xds_core_v3_CollectionEntry * msg)102 UPB_INLINE const xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_inline_entry(const xds_core_v3_CollectionEntry* msg) {
103 const xds_core_v3_CollectionEntry_InlineEntry* default_val = NULL;
104 const xds_core_v3_CollectionEntry_InlineEntry* ret;
105 const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
106 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
107 return ret;
108 }
xds_core_v3_CollectionEntry_has_inline_entry(const xds_core_v3_CollectionEntry * msg)109 UPB_INLINE bool xds_core_v3_CollectionEntry_has_inline_entry(const xds_core_v3_CollectionEntry* msg) {
110 const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
111 return _upb_Message_HasNonExtensionField(msg, &field);
112 }
113
xds_core_v3_CollectionEntry_set_locator(xds_core_v3_CollectionEntry * msg,struct xds_core_v3_ResourceLocator * value)114 UPB_INLINE void xds_core_v3_CollectionEntry_set_locator(xds_core_v3_CollectionEntry *msg, struct xds_core_v3_ResourceLocator* value) {
115 const upb_MiniTableField field = {1, UPB_SIZE(4, 8), -1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
116 _upb_Message_SetNonExtensionField(msg, &field, &value);
117 }
xds_core_v3_CollectionEntry_mutable_locator(xds_core_v3_CollectionEntry * msg,upb_Arena * arena)118 UPB_INLINE struct xds_core_v3_ResourceLocator* xds_core_v3_CollectionEntry_mutable_locator(xds_core_v3_CollectionEntry* msg, upb_Arena* arena) {
119 struct xds_core_v3_ResourceLocator* sub = (struct xds_core_v3_ResourceLocator*)xds_core_v3_CollectionEntry_locator(msg);
120 if (sub == NULL) {
121 sub = (struct xds_core_v3_ResourceLocator*)_upb_Message_New(&xds_core_v3_ResourceLocator_msg_init, arena);
122 if (sub) xds_core_v3_CollectionEntry_set_locator(msg, sub);
123 }
124 return sub;
125 }
xds_core_v3_CollectionEntry_set_inline_entry(xds_core_v3_CollectionEntry * msg,xds_core_v3_CollectionEntry_InlineEntry * value)126 UPB_INLINE void xds_core_v3_CollectionEntry_set_inline_entry(xds_core_v3_CollectionEntry *msg, xds_core_v3_CollectionEntry_InlineEntry* value) {
127 const upb_MiniTableField field = {2, UPB_SIZE(4, 8), -1, 1, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
128 _upb_Message_SetNonExtensionField(msg, &field, &value);
129 }
xds_core_v3_CollectionEntry_mutable_inline_entry(xds_core_v3_CollectionEntry * msg,upb_Arena * arena)130 UPB_INLINE struct xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_mutable_inline_entry(xds_core_v3_CollectionEntry* msg, upb_Arena* arena) {
131 struct xds_core_v3_CollectionEntry_InlineEntry* sub = (struct xds_core_v3_CollectionEntry_InlineEntry*)xds_core_v3_CollectionEntry_inline_entry(msg);
132 if (sub == NULL) {
133 sub = (struct xds_core_v3_CollectionEntry_InlineEntry*)_upb_Message_New(&xds_core_v3_CollectionEntry_InlineEntry_msg_init, arena);
134 if (sub) xds_core_v3_CollectionEntry_set_inline_entry(msg, sub);
135 }
136 return sub;
137 }
138
139 /* xds.core.v3.CollectionEntry.InlineEntry */
140
xds_core_v3_CollectionEntry_InlineEntry_new(upb_Arena * arena)141 UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_InlineEntry_new(upb_Arena* arena) {
142 return (xds_core_v3_CollectionEntry_InlineEntry*)_upb_Message_New(&xds_core_v3_CollectionEntry_InlineEntry_msg_init, arena);
143 }
xds_core_v3_CollectionEntry_InlineEntry_parse(const char * buf,size_t size,upb_Arena * arena)144 UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_InlineEntry_parse(const char* buf, size_t size, upb_Arena* arena) {
145 xds_core_v3_CollectionEntry_InlineEntry* ret = xds_core_v3_CollectionEntry_InlineEntry_new(arena);
146 if (!ret) return NULL;
147 if (upb_Decode(buf, size, ret, &xds_core_v3_CollectionEntry_InlineEntry_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
148 return NULL;
149 }
150 return ret;
151 }
xds_core_v3_CollectionEntry_InlineEntry_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)152 UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_InlineEntry_parse_ex(const char* buf, size_t size,
153 const upb_ExtensionRegistry* extreg,
154 int options, upb_Arena* arena) {
155 xds_core_v3_CollectionEntry_InlineEntry* ret = xds_core_v3_CollectionEntry_InlineEntry_new(arena);
156 if (!ret) return NULL;
157 if (upb_Decode(buf, size, ret, &xds_core_v3_CollectionEntry_InlineEntry_msg_init, extreg, options, arena) !=
158 kUpb_DecodeStatus_Ok) {
159 return NULL;
160 }
161 return ret;
162 }
xds_core_v3_CollectionEntry_InlineEntry_serialize(const xds_core_v3_CollectionEntry_InlineEntry * msg,upb_Arena * arena,size_t * len)163 UPB_INLINE char* xds_core_v3_CollectionEntry_InlineEntry_serialize(const xds_core_v3_CollectionEntry_InlineEntry* msg, upb_Arena* arena, size_t* len) {
164 char* ptr;
165 (void)upb_Encode(msg, &xds_core_v3_CollectionEntry_InlineEntry_msg_init, 0, arena, &ptr, len);
166 return ptr;
167 }
xds_core_v3_CollectionEntry_InlineEntry_serialize_ex(const xds_core_v3_CollectionEntry_InlineEntry * msg,int options,upb_Arena * arena,size_t * len)168 UPB_INLINE char* xds_core_v3_CollectionEntry_InlineEntry_serialize_ex(const xds_core_v3_CollectionEntry_InlineEntry* msg, int options,
169 upb_Arena* arena, size_t* len) {
170 char* ptr;
171 (void)upb_Encode(msg, &xds_core_v3_CollectionEntry_InlineEntry_msg_init, options, arena, &ptr, len);
172 return ptr;
173 }
xds_core_v3_CollectionEntry_InlineEntry_clear_name(xds_core_v3_CollectionEntry_InlineEntry * msg)174 UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_clear_name(xds_core_v3_CollectionEntry_InlineEntry* msg) {
175 const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
176 _upb_Message_ClearNonExtensionField(msg, &field);
177 }
xds_core_v3_CollectionEntry_InlineEntry_name(const xds_core_v3_CollectionEntry_InlineEntry * msg)178 UPB_INLINE upb_StringView xds_core_v3_CollectionEntry_InlineEntry_name(const xds_core_v3_CollectionEntry_InlineEntry* msg) {
179 upb_StringView default_val = upb_StringView_FromString("");
180 upb_StringView ret;
181 const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
182 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
183 return ret;
184 }
xds_core_v3_CollectionEntry_InlineEntry_clear_version(xds_core_v3_CollectionEntry_InlineEntry * msg)185 UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_clear_version(xds_core_v3_CollectionEntry_InlineEntry* msg) {
186 const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
187 _upb_Message_ClearNonExtensionField(msg, &field);
188 }
xds_core_v3_CollectionEntry_InlineEntry_version(const xds_core_v3_CollectionEntry_InlineEntry * msg)189 UPB_INLINE upb_StringView xds_core_v3_CollectionEntry_InlineEntry_version(const xds_core_v3_CollectionEntry_InlineEntry* msg) {
190 upb_StringView default_val = upb_StringView_FromString("");
191 upb_StringView ret;
192 const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
193 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
194 return ret;
195 }
xds_core_v3_CollectionEntry_InlineEntry_clear_resource(xds_core_v3_CollectionEntry_InlineEntry * msg)196 UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_clear_resource(xds_core_v3_CollectionEntry_InlineEntry* msg) {
197 const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
198 _upb_Message_ClearNonExtensionField(msg, &field);
199 }
xds_core_v3_CollectionEntry_InlineEntry_resource(const xds_core_v3_CollectionEntry_InlineEntry * msg)200 UPB_INLINE const struct google_protobuf_Any* xds_core_v3_CollectionEntry_InlineEntry_resource(const xds_core_v3_CollectionEntry_InlineEntry* msg) {
201 const struct google_protobuf_Any* default_val = NULL;
202 const struct google_protobuf_Any* ret;
203 const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
204 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
205 return ret;
206 }
xds_core_v3_CollectionEntry_InlineEntry_has_resource(const xds_core_v3_CollectionEntry_InlineEntry * msg)207 UPB_INLINE bool xds_core_v3_CollectionEntry_InlineEntry_has_resource(const xds_core_v3_CollectionEntry_InlineEntry* msg) {
208 const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
209 return _upb_Message_HasNonExtensionField(msg, &field);
210 }
211
xds_core_v3_CollectionEntry_InlineEntry_set_name(xds_core_v3_CollectionEntry_InlineEntry * msg,upb_StringView value)212 UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_set_name(xds_core_v3_CollectionEntry_InlineEntry *msg, upb_StringView value) {
213 const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
214 _upb_Message_SetNonExtensionField(msg, &field, &value);
215 }
xds_core_v3_CollectionEntry_InlineEntry_set_version(xds_core_v3_CollectionEntry_InlineEntry * msg,upb_StringView value)216 UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_set_version(xds_core_v3_CollectionEntry_InlineEntry *msg, upb_StringView value) {
217 const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
218 _upb_Message_SetNonExtensionField(msg, &field, &value);
219 }
xds_core_v3_CollectionEntry_InlineEntry_set_resource(xds_core_v3_CollectionEntry_InlineEntry * msg,struct google_protobuf_Any * value)220 UPB_INLINE void xds_core_v3_CollectionEntry_InlineEntry_set_resource(xds_core_v3_CollectionEntry_InlineEntry *msg, struct google_protobuf_Any* value) {
221 const upb_MiniTableField field = {3, UPB_SIZE(4, 40), 1, 0, 11, kUpb_FieldMode_Scalar | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
222 _upb_Message_SetNonExtensionField(msg, &field, &value);
223 }
xds_core_v3_CollectionEntry_InlineEntry_mutable_resource(xds_core_v3_CollectionEntry_InlineEntry * msg,upb_Arena * arena)224 UPB_INLINE struct google_protobuf_Any* xds_core_v3_CollectionEntry_InlineEntry_mutable_resource(xds_core_v3_CollectionEntry_InlineEntry* msg, upb_Arena* arena) {
225 struct google_protobuf_Any* sub = (struct google_protobuf_Any*)xds_core_v3_CollectionEntry_InlineEntry_resource(msg);
226 if (sub == NULL) {
227 sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena);
228 if (sub) xds_core_v3_CollectionEntry_InlineEntry_set_resource(msg, sub);
229 }
230 return sub;
231 }
232
233 extern const upb_MiniTableFile xds_core_v3_collection_entry_proto_upb_file_layout;
234
235 #ifdef __cplusplus
236 } /* extern "C" */
237 #endif
238
239 #include "upb/port/undef.inc"
240
241 #endif /* XDS_CORE_V3_COLLECTION_ENTRY_PROTO_UPB_H_ */
242