1 /* This file was generated by upbc (the upb compiler) from the input
4 * src/proto/grpc/lb/v1/load_balancer.proto
6 * Do not edit -- your changes will be discarded when the file is
9 #ifndef SRC_PROTO_GRPC_LB_V1_LOAD_BALANCER_PROTO_UPB_H_
10 #define SRC_PROTO_GRPC_LB_V1_LOAD_BALANCER_PROTO_UPB_H_
12 #include "upb/msg_internal.h"
13 #include "upb/decode.h"
14 #include "upb/decode_fast.h"
15 #include "upb/encode.h"
17 #include "upb/port_def.inc"
23 struct grpc_lb_v1_LoadBalanceRequest;
24 struct grpc_lb_v1_InitialLoadBalanceRequest;
25 struct grpc_lb_v1_ClientStatsPerToken;
26 struct grpc_lb_v1_ClientStats;
27 struct grpc_lb_v1_LoadBalanceResponse;
28 struct grpc_lb_v1_InitialLoadBalanceResponse;
29 struct grpc_lb_v1_ServerList;
30 struct grpc_lb_v1_Server;
31 struct grpc_lb_v1_FallbackResponse;
32 typedef struct grpc_lb_v1_LoadBalanceRequest grpc_lb_v1_LoadBalanceRequest;
33 typedef struct grpc_lb_v1_InitialLoadBalanceRequest grpc_lb_v1_InitialLoadBalanceRequest;
34 typedef struct grpc_lb_v1_ClientStatsPerToken grpc_lb_v1_ClientStatsPerToken;
35 typedef struct grpc_lb_v1_ClientStats grpc_lb_v1_ClientStats;
36 typedef struct grpc_lb_v1_LoadBalanceResponse grpc_lb_v1_LoadBalanceResponse;
37 typedef struct grpc_lb_v1_InitialLoadBalanceResponse grpc_lb_v1_InitialLoadBalanceResponse;
38 typedef struct grpc_lb_v1_ServerList grpc_lb_v1_ServerList;
39 typedef struct grpc_lb_v1_Server grpc_lb_v1_Server;
40 typedef struct grpc_lb_v1_FallbackResponse grpc_lb_v1_FallbackResponse;
41 extern const upb_msglayout grpc_lb_v1_LoadBalanceRequest_msginit;
42 extern const upb_msglayout grpc_lb_v1_InitialLoadBalanceRequest_msginit;
43 extern const upb_msglayout grpc_lb_v1_ClientStatsPerToken_msginit;
44 extern const upb_msglayout grpc_lb_v1_ClientStats_msginit;
45 extern const upb_msglayout grpc_lb_v1_LoadBalanceResponse_msginit;
46 extern const upb_msglayout grpc_lb_v1_InitialLoadBalanceResponse_msginit;
47 extern const upb_msglayout grpc_lb_v1_ServerList_msginit;
48 extern const upb_msglayout grpc_lb_v1_Server_msginit;
49 extern const upb_msglayout grpc_lb_v1_FallbackResponse_msginit;
50 struct google_protobuf_Duration;
51 struct google_protobuf_Timestamp;
52 extern const upb_msglayout google_protobuf_Duration_msginit;
53 extern const upb_msglayout google_protobuf_Timestamp_msginit;
56 /* grpc.lb.v1.LoadBalanceRequest */
58 UPB_INLINE grpc_lb_v1_LoadBalanceRequest *grpc_lb_v1_LoadBalanceRequest_new(upb_arena *arena) {
59 return (grpc_lb_v1_LoadBalanceRequest *)_upb_msg_new(&grpc_lb_v1_LoadBalanceRequest_msginit, arena);
61 UPB_INLINE grpc_lb_v1_LoadBalanceRequest *grpc_lb_v1_LoadBalanceRequest_parse(const char *buf, size_t size,
63 grpc_lb_v1_LoadBalanceRequest *ret = grpc_lb_v1_LoadBalanceRequest_new(arena);
64 if (!ret) return NULL;
65 if (!upb_decode(buf, size, ret, &grpc_lb_v1_LoadBalanceRequest_msginit, arena)) return NULL;
68 UPB_INLINE grpc_lb_v1_LoadBalanceRequest *grpc_lb_v1_LoadBalanceRequest_parse_ex(const char *buf, size_t size,
69 const upb_extreg *extreg, int options,
71 grpc_lb_v1_LoadBalanceRequest *ret = grpc_lb_v1_LoadBalanceRequest_new(arena);
72 if (!ret) return NULL;
73 if (!_upb_decode(buf, size, ret, &grpc_lb_v1_LoadBalanceRequest_msginit, extreg, options, arena)) {
78 UPB_INLINE char *grpc_lb_v1_LoadBalanceRequest_serialize(const grpc_lb_v1_LoadBalanceRequest *msg, upb_arena *arena, size_t *len) {
79 return upb_encode(msg, &grpc_lb_v1_LoadBalanceRequest_msginit, arena, len);
83 grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_initial_request = 1,
84 grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_client_stats = 2,
85 grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_NOT_SET = 0
86 } grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_oneofcases;
87 UPB_INLINE grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_oneofcases grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_case(const grpc_lb_v1_LoadBalanceRequest* msg) { return (grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
89 UPB_INLINE bool grpc_lb_v1_LoadBalanceRequest_has_initial_request(const grpc_lb_v1_LoadBalanceRequest *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
90 UPB_INLINE const grpc_lb_v1_InitialLoadBalanceRequest* grpc_lb_v1_LoadBalanceRequest_initial_request(const grpc_lb_v1_LoadBalanceRequest *msg) { return UPB_READ_ONEOF(msg, const grpc_lb_v1_InitialLoadBalanceRequest*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
91 UPB_INLINE bool grpc_lb_v1_LoadBalanceRequest_has_client_stats(const grpc_lb_v1_LoadBalanceRequest *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
92 UPB_INLINE const grpc_lb_v1_ClientStats* grpc_lb_v1_LoadBalanceRequest_client_stats(const grpc_lb_v1_LoadBalanceRequest *msg) { return UPB_READ_ONEOF(msg, const grpc_lb_v1_ClientStats*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
94 UPB_INLINE void grpc_lb_v1_LoadBalanceRequest_set_initial_request(grpc_lb_v1_LoadBalanceRequest *msg, grpc_lb_v1_InitialLoadBalanceRequest* value) {
95 UPB_WRITE_ONEOF(msg, grpc_lb_v1_InitialLoadBalanceRequest*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
97 UPB_INLINE struct grpc_lb_v1_InitialLoadBalanceRequest* grpc_lb_v1_LoadBalanceRequest_mutable_initial_request(grpc_lb_v1_LoadBalanceRequest *msg, upb_arena *arena) {
98 struct grpc_lb_v1_InitialLoadBalanceRequest* sub = (struct grpc_lb_v1_InitialLoadBalanceRequest*)grpc_lb_v1_LoadBalanceRequest_initial_request(msg);
100 sub = (struct grpc_lb_v1_InitialLoadBalanceRequest*)_upb_msg_new(&grpc_lb_v1_InitialLoadBalanceRequest_msginit, arena);
101 if (!sub) return NULL;
102 grpc_lb_v1_LoadBalanceRequest_set_initial_request(msg, sub);
106 UPB_INLINE void grpc_lb_v1_LoadBalanceRequest_set_client_stats(grpc_lb_v1_LoadBalanceRequest *msg, grpc_lb_v1_ClientStats* value) {
107 UPB_WRITE_ONEOF(msg, grpc_lb_v1_ClientStats*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
109 UPB_INLINE struct grpc_lb_v1_ClientStats* grpc_lb_v1_LoadBalanceRequest_mutable_client_stats(grpc_lb_v1_LoadBalanceRequest *msg, upb_arena *arena) {
110 struct grpc_lb_v1_ClientStats* sub = (struct grpc_lb_v1_ClientStats*)grpc_lb_v1_LoadBalanceRequest_client_stats(msg);
112 sub = (struct grpc_lb_v1_ClientStats*)_upb_msg_new(&grpc_lb_v1_ClientStats_msginit, arena);
113 if (!sub) return NULL;
114 grpc_lb_v1_LoadBalanceRequest_set_client_stats(msg, sub);
119 /* grpc.lb.v1.InitialLoadBalanceRequest */
121 UPB_INLINE grpc_lb_v1_InitialLoadBalanceRequest *grpc_lb_v1_InitialLoadBalanceRequest_new(upb_arena *arena) {
122 return (grpc_lb_v1_InitialLoadBalanceRequest *)_upb_msg_new(&grpc_lb_v1_InitialLoadBalanceRequest_msginit, arena);
124 UPB_INLINE grpc_lb_v1_InitialLoadBalanceRequest *grpc_lb_v1_InitialLoadBalanceRequest_parse(const char *buf, size_t size,
126 grpc_lb_v1_InitialLoadBalanceRequest *ret = grpc_lb_v1_InitialLoadBalanceRequest_new(arena);
127 if (!ret) return NULL;
128 if (!upb_decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, arena)) return NULL;
131 UPB_INLINE grpc_lb_v1_InitialLoadBalanceRequest *grpc_lb_v1_InitialLoadBalanceRequest_parse_ex(const char *buf, size_t size,
132 const upb_extreg *extreg, int options,
134 grpc_lb_v1_InitialLoadBalanceRequest *ret = grpc_lb_v1_InitialLoadBalanceRequest_new(arena);
135 if (!ret) return NULL;
136 if (!_upb_decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, extreg, options, arena)) {
141 UPB_INLINE char *grpc_lb_v1_InitialLoadBalanceRequest_serialize(const grpc_lb_v1_InitialLoadBalanceRequest *msg, upb_arena *arena, size_t *len) {
142 return upb_encode(msg, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, arena, len);
145 UPB_INLINE upb_strview grpc_lb_v1_InitialLoadBalanceRequest_name(const grpc_lb_v1_InitialLoadBalanceRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
147 UPB_INLINE void grpc_lb_v1_InitialLoadBalanceRequest_set_name(grpc_lb_v1_InitialLoadBalanceRequest *msg, upb_strview value) {
148 *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
151 /* grpc.lb.v1.ClientStatsPerToken */
153 UPB_INLINE grpc_lb_v1_ClientStatsPerToken *grpc_lb_v1_ClientStatsPerToken_new(upb_arena *arena) {
154 return (grpc_lb_v1_ClientStatsPerToken *)_upb_msg_new(&grpc_lb_v1_ClientStatsPerToken_msginit, arena);
156 UPB_INLINE grpc_lb_v1_ClientStatsPerToken *grpc_lb_v1_ClientStatsPerToken_parse(const char *buf, size_t size,
158 grpc_lb_v1_ClientStatsPerToken *ret = grpc_lb_v1_ClientStatsPerToken_new(arena);
159 if (!ret) return NULL;
160 if (!upb_decode(buf, size, ret, &grpc_lb_v1_ClientStatsPerToken_msginit, arena)) return NULL;
163 UPB_INLINE grpc_lb_v1_ClientStatsPerToken *grpc_lb_v1_ClientStatsPerToken_parse_ex(const char *buf, size_t size,
164 const upb_extreg *extreg, int options,
166 grpc_lb_v1_ClientStatsPerToken *ret = grpc_lb_v1_ClientStatsPerToken_new(arena);
167 if (!ret) return NULL;
168 if (!_upb_decode(buf, size, ret, &grpc_lb_v1_ClientStatsPerToken_msginit, extreg, options, arena)) {
173 UPB_INLINE char *grpc_lb_v1_ClientStatsPerToken_serialize(const grpc_lb_v1_ClientStatsPerToken *msg, upb_arena *arena, size_t *len) {
174 return upb_encode(msg, &grpc_lb_v1_ClientStatsPerToken_msginit, arena, len);
177 UPB_INLINE upb_strview grpc_lb_v1_ClientStatsPerToken_load_balance_token(const grpc_lb_v1_ClientStatsPerToken *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
178 UPB_INLINE int64_t grpc_lb_v1_ClientStatsPerToken_num_calls(const grpc_lb_v1_ClientStatsPerToken *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
180 UPB_INLINE void grpc_lb_v1_ClientStatsPerToken_set_load_balance_token(grpc_lb_v1_ClientStatsPerToken *msg, upb_strview value) {
181 *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
183 UPB_INLINE void grpc_lb_v1_ClientStatsPerToken_set_num_calls(grpc_lb_v1_ClientStatsPerToken *msg, int64_t value) {
184 *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
187 /* grpc.lb.v1.ClientStats */
189 UPB_INLINE grpc_lb_v1_ClientStats *grpc_lb_v1_ClientStats_new(upb_arena *arena) {
190 return (grpc_lb_v1_ClientStats *)_upb_msg_new(&grpc_lb_v1_ClientStats_msginit, arena);
192 UPB_INLINE grpc_lb_v1_ClientStats *grpc_lb_v1_ClientStats_parse(const char *buf, size_t size,
194 grpc_lb_v1_ClientStats *ret = grpc_lb_v1_ClientStats_new(arena);
195 if (!ret) return NULL;
196 if (!upb_decode(buf, size, ret, &grpc_lb_v1_ClientStats_msginit, arena)) return NULL;
199 UPB_INLINE grpc_lb_v1_ClientStats *grpc_lb_v1_ClientStats_parse_ex(const char *buf, size_t size,
200 const upb_extreg *extreg, int options,
202 grpc_lb_v1_ClientStats *ret = grpc_lb_v1_ClientStats_new(arena);
203 if (!ret) return NULL;
204 if (!_upb_decode(buf, size, ret, &grpc_lb_v1_ClientStats_msginit, extreg, options, arena)) {
209 UPB_INLINE char *grpc_lb_v1_ClientStats_serialize(const grpc_lb_v1_ClientStats *msg, upb_arena *arena, size_t *len) {
210 return upb_encode(msg, &grpc_lb_v1_ClientStats_msginit, arena, len);
213 UPB_INLINE bool grpc_lb_v1_ClientStats_has_timestamp(const grpc_lb_v1_ClientStats *msg) { return _upb_hasbit(msg, 1); }
214 UPB_INLINE const struct google_protobuf_Timestamp* grpc_lb_v1_ClientStats_timestamp(const grpc_lb_v1_ClientStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(40, 40), const struct google_protobuf_Timestamp*); }
215 UPB_INLINE int64_t grpc_lb_v1_ClientStats_num_calls_started(const grpc_lb_v1_ClientStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t); }
216 UPB_INLINE int64_t grpc_lb_v1_ClientStats_num_calls_finished(const grpc_lb_v1_ClientStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t); }
217 UPB_INLINE int64_t grpc_lb_v1_ClientStats_num_calls_finished_with_client_failed_to_send(const grpc_lb_v1_ClientStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int64_t); }
218 UPB_INLINE int64_t grpc_lb_v1_ClientStats_num_calls_finished_known_received(const grpc_lb_v1_ClientStats *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int64_t); }
219 UPB_INLINE bool grpc_lb_v1_ClientStats_has_calls_finished_with_drop(const grpc_lb_v1_ClientStats *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(44, 48)); }
220 UPB_INLINE const grpc_lb_v1_ClientStatsPerToken* const* grpc_lb_v1_ClientStats_calls_finished_with_drop(const grpc_lb_v1_ClientStats *msg, size_t *len) { return (const grpc_lb_v1_ClientStatsPerToken* const*)_upb_array_accessor(msg, UPB_SIZE(44, 48), len); }
222 UPB_INLINE void grpc_lb_v1_ClientStats_set_timestamp(grpc_lb_v1_ClientStats *msg, struct google_protobuf_Timestamp* value) {
224 *UPB_PTR_AT(msg, UPB_SIZE(40, 40), struct google_protobuf_Timestamp*) = value;
226 UPB_INLINE struct google_protobuf_Timestamp* grpc_lb_v1_ClientStats_mutable_timestamp(grpc_lb_v1_ClientStats *msg, upb_arena *arena) {
227 struct google_protobuf_Timestamp* sub = (struct google_protobuf_Timestamp*)grpc_lb_v1_ClientStats_timestamp(msg);
229 sub = (struct google_protobuf_Timestamp*)_upb_msg_new(&google_protobuf_Timestamp_msginit, arena);
230 if (!sub) return NULL;
231 grpc_lb_v1_ClientStats_set_timestamp(msg, sub);
235 UPB_INLINE void grpc_lb_v1_ClientStats_set_num_calls_started(grpc_lb_v1_ClientStats *msg, int64_t value) {
236 *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = value;
238 UPB_INLINE void grpc_lb_v1_ClientStats_set_num_calls_finished(grpc_lb_v1_ClientStats *msg, int64_t value) {
239 *UPB_PTR_AT(msg, UPB_SIZE(16, 16), int64_t) = value;
241 UPB_INLINE void grpc_lb_v1_ClientStats_set_num_calls_finished_with_client_failed_to_send(grpc_lb_v1_ClientStats *msg, int64_t value) {
242 *UPB_PTR_AT(msg, UPB_SIZE(24, 24), int64_t) = value;
244 UPB_INLINE void grpc_lb_v1_ClientStats_set_num_calls_finished_known_received(grpc_lb_v1_ClientStats *msg, int64_t value) {
245 *UPB_PTR_AT(msg, UPB_SIZE(32, 32), int64_t) = value;
247 UPB_INLINE grpc_lb_v1_ClientStatsPerToken** grpc_lb_v1_ClientStats_mutable_calls_finished_with_drop(grpc_lb_v1_ClientStats *msg, size_t *len) {
248 return (grpc_lb_v1_ClientStatsPerToken**)_upb_array_mutable_accessor(msg, UPB_SIZE(44, 48), len);
250 UPB_INLINE grpc_lb_v1_ClientStatsPerToken** grpc_lb_v1_ClientStats_resize_calls_finished_with_drop(grpc_lb_v1_ClientStats *msg, size_t len, upb_arena *arena) {
251 return (grpc_lb_v1_ClientStatsPerToken**)_upb_array_resize_accessor2(msg, UPB_SIZE(44, 48), len, UPB_SIZE(2, 3), arena);
253 UPB_INLINE struct grpc_lb_v1_ClientStatsPerToken* grpc_lb_v1_ClientStats_add_calls_finished_with_drop(grpc_lb_v1_ClientStats *msg, upb_arena *arena) {
254 struct grpc_lb_v1_ClientStatsPerToken* sub = (struct grpc_lb_v1_ClientStatsPerToken*)_upb_msg_new(&grpc_lb_v1_ClientStatsPerToken_msginit, arena);
255 bool ok = _upb_array_append_accessor2(
256 msg, UPB_SIZE(44, 48), UPB_SIZE(2, 3), &sub, arena);
257 if (!ok) return NULL;
261 /* grpc.lb.v1.LoadBalanceResponse */
263 UPB_INLINE grpc_lb_v1_LoadBalanceResponse *grpc_lb_v1_LoadBalanceResponse_new(upb_arena *arena) {
264 return (grpc_lb_v1_LoadBalanceResponse *)_upb_msg_new(&grpc_lb_v1_LoadBalanceResponse_msginit, arena);
266 UPB_INLINE grpc_lb_v1_LoadBalanceResponse *grpc_lb_v1_LoadBalanceResponse_parse(const char *buf, size_t size,
268 grpc_lb_v1_LoadBalanceResponse *ret = grpc_lb_v1_LoadBalanceResponse_new(arena);
269 if (!ret) return NULL;
270 if (!upb_decode(buf, size, ret, &grpc_lb_v1_LoadBalanceResponse_msginit, arena)) return NULL;
273 UPB_INLINE grpc_lb_v1_LoadBalanceResponse *grpc_lb_v1_LoadBalanceResponse_parse_ex(const char *buf, size_t size,
274 const upb_extreg *extreg, int options,
276 grpc_lb_v1_LoadBalanceResponse *ret = grpc_lb_v1_LoadBalanceResponse_new(arena);
277 if (!ret) return NULL;
278 if (!_upb_decode(buf, size, ret, &grpc_lb_v1_LoadBalanceResponse_msginit, extreg, options, arena)) {
283 UPB_INLINE char *grpc_lb_v1_LoadBalanceResponse_serialize(const grpc_lb_v1_LoadBalanceResponse *msg, upb_arena *arena, size_t *len) {
284 return upb_encode(msg, &grpc_lb_v1_LoadBalanceResponse_msginit, arena, len);
288 grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_initial_response = 1,
289 grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_server_list = 2,
290 grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_fallback_response = 3,
291 grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_NOT_SET = 0
292 } grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_oneofcases;
293 UPB_INLINE grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_oneofcases grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_case(const grpc_lb_v1_LoadBalanceResponse* msg) { return (grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
295 UPB_INLINE bool grpc_lb_v1_LoadBalanceResponse_has_initial_response(const grpc_lb_v1_LoadBalanceResponse *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
296 UPB_INLINE const grpc_lb_v1_InitialLoadBalanceResponse* grpc_lb_v1_LoadBalanceResponse_initial_response(const grpc_lb_v1_LoadBalanceResponse *msg) { return UPB_READ_ONEOF(msg, const grpc_lb_v1_InitialLoadBalanceResponse*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
297 UPB_INLINE bool grpc_lb_v1_LoadBalanceResponse_has_server_list(const grpc_lb_v1_LoadBalanceResponse *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 2; }
298 UPB_INLINE const grpc_lb_v1_ServerList* grpc_lb_v1_LoadBalanceResponse_server_list(const grpc_lb_v1_LoadBalanceResponse *msg) { return UPB_READ_ONEOF(msg, const grpc_lb_v1_ServerList*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 2, NULL); }
299 UPB_INLINE bool grpc_lb_v1_LoadBalanceResponse_has_fallback_response(const grpc_lb_v1_LoadBalanceResponse *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 3; }
300 UPB_INLINE const grpc_lb_v1_FallbackResponse* grpc_lb_v1_LoadBalanceResponse_fallback_response(const grpc_lb_v1_LoadBalanceResponse *msg) { return UPB_READ_ONEOF(msg, const grpc_lb_v1_FallbackResponse*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 3, NULL); }
302 UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_set_initial_response(grpc_lb_v1_LoadBalanceResponse *msg, grpc_lb_v1_InitialLoadBalanceResponse* value) {
303 UPB_WRITE_ONEOF(msg, grpc_lb_v1_InitialLoadBalanceResponse*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
305 UPB_INLINE struct grpc_lb_v1_InitialLoadBalanceResponse* grpc_lb_v1_LoadBalanceResponse_mutable_initial_response(grpc_lb_v1_LoadBalanceResponse *msg, upb_arena *arena) {
306 struct grpc_lb_v1_InitialLoadBalanceResponse* sub = (struct grpc_lb_v1_InitialLoadBalanceResponse*)grpc_lb_v1_LoadBalanceResponse_initial_response(msg);
308 sub = (struct grpc_lb_v1_InitialLoadBalanceResponse*)_upb_msg_new(&grpc_lb_v1_InitialLoadBalanceResponse_msginit, arena);
309 if (!sub) return NULL;
310 grpc_lb_v1_LoadBalanceResponse_set_initial_response(msg, sub);
314 UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_set_server_list(grpc_lb_v1_LoadBalanceResponse *msg, grpc_lb_v1_ServerList* value) {
315 UPB_WRITE_ONEOF(msg, grpc_lb_v1_ServerList*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 2);
317 UPB_INLINE struct grpc_lb_v1_ServerList* grpc_lb_v1_LoadBalanceResponse_mutable_server_list(grpc_lb_v1_LoadBalanceResponse *msg, upb_arena *arena) {
318 struct grpc_lb_v1_ServerList* sub = (struct grpc_lb_v1_ServerList*)grpc_lb_v1_LoadBalanceResponse_server_list(msg);
320 sub = (struct grpc_lb_v1_ServerList*)_upb_msg_new(&grpc_lb_v1_ServerList_msginit, arena);
321 if (!sub) return NULL;
322 grpc_lb_v1_LoadBalanceResponse_set_server_list(msg, sub);
326 UPB_INLINE void grpc_lb_v1_LoadBalanceResponse_set_fallback_response(grpc_lb_v1_LoadBalanceResponse *msg, grpc_lb_v1_FallbackResponse* value) {
327 UPB_WRITE_ONEOF(msg, grpc_lb_v1_FallbackResponse*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 3);
329 UPB_INLINE struct grpc_lb_v1_FallbackResponse* grpc_lb_v1_LoadBalanceResponse_mutable_fallback_response(grpc_lb_v1_LoadBalanceResponse *msg, upb_arena *arena) {
330 struct grpc_lb_v1_FallbackResponse* sub = (struct grpc_lb_v1_FallbackResponse*)grpc_lb_v1_LoadBalanceResponse_fallback_response(msg);
332 sub = (struct grpc_lb_v1_FallbackResponse*)_upb_msg_new(&grpc_lb_v1_FallbackResponse_msginit, arena);
333 if (!sub) return NULL;
334 grpc_lb_v1_LoadBalanceResponse_set_fallback_response(msg, sub);
339 /* grpc.lb.v1.InitialLoadBalanceResponse */
341 UPB_INLINE grpc_lb_v1_InitialLoadBalanceResponse *grpc_lb_v1_InitialLoadBalanceResponse_new(upb_arena *arena) {
342 return (grpc_lb_v1_InitialLoadBalanceResponse *)_upb_msg_new(&grpc_lb_v1_InitialLoadBalanceResponse_msginit, arena);
344 UPB_INLINE grpc_lb_v1_InitialLoadBalanceResponse *grpc_lb_v1_InitialLoadBalanceResponse_parse(const char *buf, size_t size,
346 grpc_lb_v1_InitialLoadBalanceResponse *ret = grpc_lb_v1_InitialLoadBalanceResponse_new(arena);
347 if (!ret) return NULL;
348 if (!upb_decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, arena)) return NULL;
351 UPB_INLINE grpc_lb_v1_InitialLoadBalanceResponse *grpc_lb_v1_InitialLoadBalanceResponse_parse_ex(const char *buf, size_t size,
352 const upb_extreg *extreg, int options,
354 grpc_lb_v1_InitialLoadBalanceResponse *ret = grpc_lb_v1_InitialLoadBalanceResponse_new(arena);
355 if (!ret) return NULL;
356 if (!_upb_decode(buf, size, ret, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, extreg, options, arena)) {
361 UPB_INLINE char *grpc_lb_v1_InitialLoadBalanceResponse_serialize(const grpc_lb_v1_InitialLoadBalanceResponse *msg, upb_arena *arena, size_t *len) {
362 return upb_encode(msg, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, arena, len);
365 UPB_INLINE upb_strview grpc_lb_v1_InitialLoadBalanceResponse_load_balancer_delegate(const grpc_lb_v1_InitialLoadBalanceResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
366 UPB_INLINE bool grpc_lb_v1_InitialLoadBalanceResponse_has_client_stats_report_interval(const grpc_lb_v1_InitialLoadBalanceResponse *msg) { return _upb_hasbit(msg, 1); }
367 UPB_INLINE const struct google_protobuf_Duration* grpc_lb_v1_InitialLoadBalanceResponse_client_stats_report_interval(const grpc_lb_v1_InitialLoadBalanceResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Duration*); }
369 UPB_INLINE void grpc_lb_v1_InitialLoadBalanceResponse_set_load_balancer_delegate(grpc_lb_v1_InitialLoadBalanceResponse *msg, upb_strview value) {
370 *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
372 UPB_INLINE void grpc_lb_v1_InitialLoadBalanceResponse_set_client_stats_report_interval(grpc_lb_v1_InitialLoadBalanceResponse *msg, struct google_protobuf_Duration* value) {
374 *UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Duration*) = value;
376 UPB_INLINE struct google_protobuf_Duration* grpc_lb_v1_InitialLoadBalanceResponse_mutable_client_stats_report_interval(grpc_lb_v1_InitialLoadBalanceResponse *msg, upb_arena *arena) {
377 struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)grpc_lb_v1_InitialLoadBalanceResponse_client_stats_report_interval(msg);
379 sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
380 if (!sub) return NULL;
381 grpc_lb_v1_InitialLoadBalanceResponse_set_client_stats_report_interval(msg, sub);
386 /* grpc.lb.v1.ServerList */
388 UPB_INLINE grpc_lb_v1_ServerList *grpc_lb_v1_ServerList_new(upb_arena *arena) {
389 return (grpc_lb_v1_ServerList *)_upb_msg_new(&grpc_lb_v1_ServerList_msginit, arena);
391 UPB_INLINE grpc_lb_v1_ServerList *grpc_lb_v1_ServerList_parse(const char *buf, size_t size,
393 grpc_lb_v1_ServerList *ret = grpc_lb_v1_ServerList_new(arena);
394 if (!ret) return NULL;
395 if (!upb_decode(buf, size, ret, &grpc_lb_v1_ServerList_msginit, arena)) return NULL;
398 UPB_INLINE grpc_lb_v1_ServerList *grpc_lb_v1_ServerList_parse_ex(const char *buf, size_t size,
399 const upb_extreg *extreg, int options,
401 grpc_lb_v1_ServerList *ret = grpc_lb_v1_ServerList_new(arena);
402 if (!ret) return NULL;
403 if (!_upb_decode(buf, size, ret, &grpc_lb_v1_ServerList_msginit, extreg, options, arena)) {
408 UPB_INLINE char *grpc_lb_v1_ServerList_serialize(const grpc_lb_v1_ServerList *msg, upb_arena *arena, size_t *len) {
409 return upb_encode(msg, &grpc_lb_v1_ServerList_msginit, arena, len);
412 UPB_INLINE bool grpc_lb_v1_ServerList_has_servers(const grpc_lb_v1_ServerList *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
413 UPB_INLINE const grpc_lb_v1_Server* const* grpc_lb_v1_ServerList_servers(const grpc_lb_v1_ServerList *msg, size_t *len) { return (const grpc_lb_v1_Server* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
415 UPB_INLINE grpc_lb_v1_Server** grpc_lb_v1_ServerList_mutable_servers(grpc_lb_v1_ServerList *msg, size_t *len) {
416 return (grpc_lb_v1_Server**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
418 UPB_INLINE grpc_lb_v1_Server** grpc_lb_v1_ServerList_resize_servers(grpc_lb_v1_ServerList *msg, size_t len, upb_arena *arena) {
419 return (grpc_lb_v1_Server**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
421 UPB_INLINE struct grpc_lb_v1_Server* grpc_lb_v1_ServerList_add_servers(grpc_lb_v1_ServerList *msg, upb_arena *arena) {
422 struct grpc_lb_v1_Server* sub = (struct grpc_lb_v1_Server*)_upb_msg_new(&grpc_lb_v1_Server_msginit, arena);
423 bool ok = _upb_array_append_accessor2(
424 msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
425 if (!ok) return NULL;
429 /* grpc.lb.v1.Server */
431 UPB_INLINE grpc_lb_v1_Server *grpc_lb_v1_Server_new(upb_arena *arena) {
432 return (grpc_lb_v1_Server *)_upb_msg_new(&grpc_lb_v1_Server_msginit, arena);
434 UPB_INLINE grpc_lb_v1_Server *grpc_lb_v1_Server_parse(const char *buf, size_t size,
436 grpc_lb_v1_Server *ret = grpc_lb_v1_Server_new(arena);
437 if (!ret) return NULL;
438 if (!upb_decode(buf, size, ret, &grpc_lb_v1_Server_msginit, arena)) return NULL;
441 UPB_INLINE grpc_lb_v1_Server *grpc_lb_v1_Server_parse_ex(const char *buf, size_t size,
442 const upb_extreg *extreg, int options,
444 grpc_lb_v1_Server *ret = grpc_lb_v1_Server_new(arena);
445 if (!ret) return NULL;
446 if (!_upb_decode(buf, size, ret, &grpc_lb_v1_Server_msginit, extreg, options, arena)) {
451 UPB_INLINE char *grpc_lb_v1_Server_serialize(const grpc_lb_v1_Server *msg, upb_arena *arena, size_t *len) {
452 return upb_encode(msg, &grpc_lb_v1_Server_msginit, arena, len);
455 UPB_INLINE upb_strview grpc_lb_v1_Server_ip_address(const grpc_lb_v1_Server *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview); }
456 UPB_INLINE int32_t grpc_lb_v1_Server_port(const grpc_lb_v1_Server *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
457 UPB_INLINE upb_strview grpc_lb_v1_Server_load_balance_token(const grpc_lb_v1_Server *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview); }
458 UPB_INLINE bool grpc_lb_v1_Server_drop(const grpc_lb_v1_Server *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool); }
460 UPB_INLINE void grpc_lb_v1_Server_set_ip_address(grpc_lb_v1_Server *msg, upb_strview value) {
461 *UPB_PTR_AT(msg, UPB_SIZE(8, 8), upb_strview) = value;
463 UPB_INLINE void grpc_lb_v1_Server_set_port(grpc_lb_v1_Server *msg, int32_t value) {
464 *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
466 UPB_INLINE void grpc_lb_v1_Server_set_load_balance_token(grpc_lb_v1_Server *msg, upb_strview value) {
467 *UPB_PTR_AT(msg, UPB_SIZE(16, 24), upb_strview) = value;
469 UPB_INLINE void grpc_lb_v1_Server_set_drop(grpc_lb_v1_Server *msg, bool value) {
470 *UPB_PTR_AT(msg, UPB_SIZE(4, 4), bool) = value;
473 /* grpc.lb.v1.FallbackResponse */
475 UPB_INLINE grpc_lb_v1_FallbackResponse *grpc_lb_v1_FallbackResponse_new(upb_arena *arena) {
476 return (grpc_lb_v1_FallbackResponse *)_upb_msg_new(&grpc_lb_v1_FallbackResponse_msginit, arena);
478 UPB_INLINE grpc_lb_v1_FallbackResponse *grpc_lb_v1_FallbackResponse_parse(const char *buf, size_t size,
480 grpc_lb_v1_FallbackResponse *ret = grpc_lb_v1_FallbackResponse_new(arena);
481 if (!ret) return NULL;
482 if (!upb_decode(buf, size, ret, &grpc_lb_v1_FallbackResponse_msginit, arena)) return NULL;
485 UPB_INLINE grpc_lb_v1_FallbackResponse *grpc_lb_v1_FallbackResponse_parse_ex(const char *buf, size_t size,
486 const upb_extreg *extreg, int options,
488 grpc_lb_v1_FallbackResponse *ret = grpc_lb_v1_FallbackResponse_new(arena);
489 if (!ret) return NULL;
490 if (!_upb_decode(buf, size, ret, &grpc_lb_v1_FallbackResponse_msginit, extreg, options, arena)) {
495 UPB_INLINE char *grpc_lb_v1_FallbackResponse_serialize(const grpc_lb_v1_FallbackResponse *msg, upb_arena *arena, size_t *len) {
496 return upb_encode(msg, &grpc_lb_v1_FallbackResponse_msginit, arena, len);
505 #include "upb/port_undef.inc"
507 #endif /* SRC_PROTO_GRPC_LB_V1_LOAD_BALANCER_PROTO_UPB_H_ */