1 /* This file was generated by upb_generator from the input file:
2 *
3 * envoy/config/core/v3/grpc_method_list.proto
4 *
5 * Do not edit -- your changes will be discarded when the file is
6 * regenerated. */
7
8 #ifndef ENVOY_CONFIG_CORE_V3_GRPC_METHOD_LIST_PROTO_UPB_H_
9 #define ENVOY_CONFIG_CORE_V3_GRPC_METHOD_LIST_PROTO_UPB_H_
10
11 #include "upb/generated_code_support.h"
12
13 #include "envoy/config/core/v3/grpc_method_list.upb_minitable.h"
14
15 #include "udpa/annotations/status.upb_minitable.h"
16 #include "udpa/annotations/versioning.upb_minitable.h"
17 #include "validate/validate.upb_minitable.h"
18
19 // Must be last.
20 #include "upb/port/def.inc"
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 typedef struct envoy_config_core_v3_GrpcMethodList { upb_Message UPB_PRIVATE(base); } envoy_config_core_v3_GrpcMethodList;
27 typedef struct envoy_config_core_v3_GrpcMethodList_Service { upb_Message UPB_PRIVATE(base); } envoy_config_core_v3_GrpcMethodList_Service;
28
29
30
31 /* envoy.config.core.v3.GrpcMethodList */
32
envoy_config_core_v3_GrpcMethodList_new(upb_Arena * arena)33 UPB_INLINE envoy_config_core_v3_GrpcMethodList* envoy_config_core_v3_GrpcMethodList_new(upb_Arena* arena) {
34 return (envoy_config_core_v3_GrpcMethodList*)_upb_Message_New(&envoy__config__core__v3__GrpcMethodList_msg_init, arena);
35 }
envoy_config_core_v3_GrpcMethodList_parse(const char * buf,size_t size,upb_Arena * arena)36 UPB_INLINE envoy_config_core_v3_GrpcMethodList* envoy_config_core_v3_GrpcMethodList_parse(const char* buf, size_t size, upb_Arena* arena) {
37 envoy_config_core_v3_GrpcMethodList* ret = envoy_config_core_v3_GrpcMethodList_new(arena);
38 if (!ret) return NULL;
39 if (upb_Decode(buf, size, UPB_UPCAST(ret), &envoy__config__core__v3__GrpcMethodList_msg_init, NULL, 0, arena) !=
40 kUpb_DecodeStatus_Ok) {
41 return NULL;
42 }
43 return ret;
44 }
envoy_config_core_v3_GrpcMethodList_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)45 UPB_INLINE envoy_config_core_v3_GrpcMethodList* envoy_config_core_v3_GrpcMethodList_parse_ex(const char* buf, size_t size,
46 const upb_ExtensionRegistry* extreg,
47 int options, upb_Arena* arena) {
48 envoy_config_core_v3_GrpcMethodList* ret = envoy_config_core_v3_GrpcMethodList_new(arena);
49 if (!ret) return NULL;
50 if (upb_Decode(buf, size, UPB_UPCAST(ret), &envoy__config__core__v3__GrpcMethodList_msg_init, extreg, options,
51 arena) != kUpb_DecodeStatus_Ok) {
52 return NULL;
53 }
54 return ret;
55 }
envoy_config_core_v3_GrpcMethodList_serialize(const envoy_config_core_v3_GrpcMethodList * msg,upb_Arena * arena,size_t * len)56 UPB_INLINE char* envoy_config_core_v3_GrpcMethodList_serialize(const envoy_config_core_v3_GrpcMethodList* msg, upb_Arena* arena, size_t* len) {
57 char* ptr;
58 (void)upb_Encode(UPB_UPCAST(msg), &envoy__config__core__v3__GrpcMethodList_msg_init, 0, arena, &ptr, len);
59 return ptr;
60 }
envoy_config_core_v3_GrpcMethodList_serialize_ex(const envoy_config_core_v3_GrpcMethodList * msg,int options,upb_Arena * arena,size_t * len)61 UPB_INLINE char* envoy_config_core_v3_GrpcMethodList_serialize_ex(const envoy_config_core_v3_GrpcMethodList* msg, int options,
62 upb_Arena* arena, size_t* len) {
63 char* ptr;
64 (void)upb_Encode(UPB_UPCAST(msg), &envoy__config__core__v3__GrpcMethodList_msg_init, options, arena, &ptr, len);
65 return ptr;
66 }
envoy_config_core_v3_GrpcMethodList_clear_services(envoy_config_core_v3_GrpcMethodList * msg)67 UPB_INLINE void envoy_config_core_v3_GrpcMethodList_clear_services(envoy_config_core_v3_GrpcMethodList* msg) {
68 const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
69 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
70 }
envoy_config_core_v3_GrpcMethodList_services(const envoy_config_core_v3_GrpcMethodList * msg,size_t * size)71 UPB_INLINE const envoy_config_core_v3_GrpcMethodList_Service* const* envoy_config_core_v3_GrpcMethodList_services(const envoy_config_core_v3_GrpcMethodList* msg, size_t* size) {
72 const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
73 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
74 if (arr) {
75 if (size) *size = arr->UPB_PRIVATE(size);
76 return (const envoy_config_core_v3_GrpcMethodList_Service* const*)upb_Array_DataPtr(arr);
77 } else {
78 if (size) *size = 0;
79 return NULL;
80 }
81 }
_envoy_config_core_v3_GrpcMethodList_services_upb_array(const envoy_config_core_v3_GrpcMethodList * msg,size_t * size)82 UPB_INLINE const upb_Array* _envoy_config_core_v3_GrpcMethodList_services_upb_array(const envoy_config_core_v3_GrpcMethodList* msg, size_t* size) {
83 const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
84 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
85 if (size) {
86 *size = arr ? arr->UPB_PRIVATE(size) : 0;
87 }
88 return arr;
89 }
_envoy_config_core_v3_GrpcMethodList_services_mutable_upb_array(envoy_config_core_v3_GrpcMethodList * msg,size_t * size,upb_Arena * arena)90 UPB_INLINE upb_Array* _envoy_config_core_v3_GrpcMethodList_services_mutable_upb_array(envoy_config_core_v3_GrpcMethodList* msg, size_t* size, upb_Arena* arena) {
91 const upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
92 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
93 &field, arena);
94 if (size) {
95 *size = arr ? arr->UPB_PRIVATE(size) : 0;
96 }
97 return arr;
98 }
99
envoy_config_core_v3_GrpcMethodList_mutable_services(envoy_config_core_v3_GrpcMethodList * msg,size_t * size)100 UPB_INLINE envoy_config_core_v3_GrpcMethodList_Service** envoy_config_core_v3_GrpcMethodList_mutable_services(envoy_config_core_v3_GrpcMethodList* msg, size_t* size) {
101 upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
102 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
103 if (arr) {
104 if (size) *size = arr->UPB_PRIVATE(size);
105 return (envoy_config_core_v3_GrpcMethodList_Service**)upb_Array_MutableDataPtr(arr);
106 } else {
107 if (size) *size = 0;
108 return NULL;
109 }
110 }
envoy_config_core_v3_GrpcMethodList_resize_services(envoy_config_core_v3_GrpcMethodList * msg,size_t size,upb_Arena * arena)111 UPB_INLINE envoy_config_core_v3_GrpcMethodList_Service** envoy_config_core_v3_GrpcMethodList_resize_services(envoy_config_core_v3_GrpcMethodList* msg, size_t size, upb_Arena* arena) {
112 upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
113 return (envoy_config_core_v3_GrpcMethodList_Service**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
114 &field, size, arena);
115 }
envoy_config_core_v3_GrpcMethodList_add_services(envoy_config_core_v3_GrpcMethodList * msg,upb_Arena * arena)116 UPB_INLINE struct envoy_config_core_v3_GrpcMethodList_Service* envoy_config_core_v3_GrpcMethodList_add_services(envoy_config_core_v3_GrpcMethodList* msg, upb_Arena* arena) {
117 upb_MiniTableField field = {1, 8, 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
118 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
119 UPB_UPCAST(msg), &field, arena);
120 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
121 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
122 return NULL;
123 }
124 struct envoy_config_core_v3_GrpcMethodList_Service* sub = (struct envoy_config_core_v3_GrpcMethodList_Service*)_upb_Message_New(&envoy__config__core__v3__GrpcMethodList__Service_msg_init, arena);
125 if (!arr || !sub) return NULL;
126 UPB_PRIVATE(_upb_Array_Set)
127 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
128 return sub;
129 }
130
131 /* envoy.config.core.v3.GrpcMethodList.Service */
132
envoy_config_core_v3_GrpcMethodList_Service_new(upb_Arena * arena)133 UPB_INLINE envoy_config_core_v3_GrpcMethodList_Service* envoy_config_core_v3_GrpcMethodList_Service_new(upb_Arena* arena) {
134 return (envoy_config_core_v3_GrpcMethodList_Service*)_upb_Message_New(&envoy__config__core__v3__GrpcMethodList__Service_msg_init, arena);
135 }
envoy_config_core_v3_GrpcMethodList_Service_parse(const char * buf,size_t size,upb_Arena * arena)136 UPB_INLINE envoy_config_core_v3_GrpcMethodList_Service* envoy_config_core_v3_GrpcMethodList_Service_parse(const char* buf, size_t size, upb_Arena* arena) {
137 envoy_config_core_v3_GrpcMethodList_Service* ret = envoy_config_core_v3_GrpcMethodList_Service_new(arena);
138 if (!ret) return NULL;
139 if (upb_Decode(buf, size, UPB_UPCAST(ret), &envoy__config__core__v3__GrpcMethodList__Service_msg_init, NULL, 0, arena) !=
140 kUpb_DecodeStatus_Ok) {
141 return NULL;
142 }
143 return ret;
144 }
envoy_config_core_v3_GrpcMethodList_Service_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)145 UPB_INLINE envoy_config_core_v3_GrpcMethodList_Service* envoy_config_core_v3_GrpcMethodList_Service_parse_ex(const char* buf, size_t size,
146 const upb_ExtensionRegistry* extreg,
147 int options, upb_Arena* arena) {
148 envoy_config_core_v3_GrpcMethodList_Service* ret = envoy_config_core_v3_GrpcMethodList_Service_new(arena);
149 if (!ret) return NULL;
150 if (upb_Decode(buf, size, UPB_UPCAST(ret), &envoy__config__core__v3__GrpcMethodList__Service_msg_init, extreg, options,
151 arena) != kUpb_DecodeStatus_Ok) {
152 return NULL;
153 }
154 return ret;
155 }
envoy_config_core_v3_GrpcMethodList_Service_serialize(const envoy_config_core_v3_GrpcMethodList_Service * msg,upb_Arena * arena,size_t * len)156 UPB_INLINE char* envoy_config_core_v3_GrpcMethodList_Service_serialize(const envoy_config_core_v3_GrpcMethodList_Service* msg, upb_Arena* arena, size_t* len) {
157 char* ptr;
158 (void)upb_Encode(UPB_UPCAST(msg), &envoy__config__core__v3__GrpcMethodList__Service_msg_init, 0, arena, &ptr, len);
159 return ptr;
160 }
envoy_config_core_v3_GrpcMethodList_Service_serialize_ex(const envoy_config_core_v3_GrpcMethodList_Service * msg,int options,upb_Arena * arena,size_t * len)161 UPB_INLINE char* envoy_config_core_v3_GrpcMethodList_Service_serialize_ex(const envoy_config_core_v3_GrpcMethodList_Service* msg, int options,
162 upb_Arena* arena, size_t* len) {
163 char* ptr;
164 (void)upb_Encode(UPB_UPCAST(msg), &envoy__config__core__v3__GrpcMethodList__Service_msg_init, options, arena, &ptr, len);
165 return ptr;
166 }
envoy_config_core_v3_GrpcMethodList_Service_clear_name(envoy_config_core_v3_GrpcMethodList_Service * msg)167 UPB_INLINE void envoy_config_core_v3_GrpcMethodList_Service_clear_name(envoy_config_core_v3_GrpcMethodList_Service* msg) {
168 const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
169 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
170 }
envoy_config_core_v3_GrpcMethodList_Service_name(const envoy_config_core_v3_GrpcMethodList_Service * msg)171 UPB_INLINE upb_StringView envoy_config_core_v3_GrpcMethodList_Service_name(const envoy_config_core_v3_GrpcMethodList_Service* msg) {
172 upb_StringView default_val = upb_StringView_FromString("");
173 upb_StringView ret;
174 const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
175 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
176 &default_val, &ret);
177 return ret;
178 }
envoy_config_core_v3_GrpcMethodList_Service_clear_method_names(envoy_config_core_v3_GrpcMethodList_Service * msg)179 UPB_INLINE void envoy_config_core_v3_GrpcMethodList_Service_clear_method_names(envoy_config_core_v3_GrpcMethodList_Service* msg) {
180 const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
181 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
182 }
envoy_config_core_v3_GrpcMethodList_Service_method_names(const envoy_config_core_v3_GrpcMethodList_Service * msg,size_t * size)183 UPB_INLINE upb_StringView const* envoy_config_core_v3_GrpcMethodList_Service_method_names(const envoy_config_core_v3_GrpcMethodList_Service* msg, size_t* size) {
184 const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
185 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
186 if (arr) {
187 if (size) *size = arr->UPB_PRIVATE(size);
188 return (upb_StringView const*)upb_Array_DataPtr(arr);
189 } else {
190 if (size) *size = 0;
191 return NULL;
192 }
193 }
_envoy_config_core_v3_GrpcMethodList_Service_method_names_upb_array(const envoy_config_core_v3_GrpcMethodList_Service * msg,size_t * size)194 UPB_INLINE const upb_Array* _envoy_config_core_v3_GrpcMethodList_Service_method_names_upb_array(const envoy_config_core_v3_GrpcMethodList_Service* msg, size_t* size) {
195 const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
196 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
197 if (size) {
198 *size = arr ? arr->UPB_PRIVATE(size) : 0;
199 }
200 return arr;
201 }
_envoy_config_core_v3_GrpcMethodList_Service_method_names_mutable_upb_array(envoy_config_core_v3_GrpcMethodList_Service * msg,size_t * size,upb_Arena * arena)202 UPB_INLINE upb_Array* _envoy_config_core_v3_GrpcMethodList_Service_method_names_mutable_upb_array(envoy_config_core_v3_GrpcMethodList_Service* msg, size_t* size, upb_Arena* arena) {
203 const upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
204 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
205 &field, arena);
206 if (size) {
207 *size = arr ? arr->UPB_PRIVATE(size) : 0;
208 }
209 return arr;
210 }
211
envoy_config_core_v3_GrpcMethodList_Service_set_name(envoy_config_core_v3_GrpcMethodList_Service * msg,upb_StringView value)212 UPB_INLINE void envoy_config_core_v3_GrpcMethodList_Service_set_name(envoy_config_core_v3_GrpcMethodList_Service *msg, upb_StringView value) {
213 const upb_MiniTableField field = {1, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
214 _upb_Message_SetNonExtensionField((upb_Message *)msg, &field, &value);
215 }
envoy_config_core_v3_GrpcMethodList_Service_mutable_method_names(envoy_config_core_v3_GrpcMethodList_Service * msg,size_t * size)216 UPB_INLINE upb_StringView* envoy_config_core_v3_GrpcMethodList_Service_mutable_method_names(envoy_config_core_v3_GrpcMethodList_Service* msg, size_t* size) {
217 upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
218 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
219 if (arr) {
220 if (size) *size = arr->UPB_PRIVATE(size);
221 return (upb_StringView*)upb_Array_MutableDataPtr(arr);
222 } else {
223 if (size) *size = 0;
224 return NULL;
225 }
226 }
envoy_config_core_v3_GrpcMethodList_Service_resize_method_names(envoy_config_core_v3_GrpcMethodList_Service * msg,size_t size,upb_Arena * arena)227 UPB_INLINE upb_StringView* envoy_config_core_v3_GrpcMethodList_Service_resize_method_names(envoy_config_core_v3_GrpcMethodList_Service* msg, size_t size, upb_Arena* arena) {
228 upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
229 return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
230 &field, size, arena);
231 }
envoy_config_core_v3_GrpcMethodList_Service_add_method_names(envoy_config_core_v3_GrpcMethodList_Service * msg,upb_StringView val,upb_Arena * arena)232 UPB_INLINE bool envoy_config_core_v3_GrpcMethodList_Service_add_method_names(envoy_config_core_v3_GrpcMethodList_Service* msg, upb_StringView val, upb_Arena* arena) {
233 upb_MiniTableField field = {2, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
234 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
235 UPB_UPCAST(msg), &field, arena);
236 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
237 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
238 return false;
239 }
240 UPB_PRIVATE(_upb_Array_Set)
241 (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
242 return true;
243 }
244
245 #ifdef __cplusplus
246 } /* extern "C" */
247 #endif
248
249 #include "upb/port/undef.inc"
250
251 #endif /* ENVOY_CONFIG_CORE_V3_GRPC_METHOD_LIST_PROTO_UPB_H_ */
252