1 /* This file was generated by upb_generator from the input file:
2 *
3 * src/proto/grpc/lookup/v1/rls.proto
4 *
5 * Do not edit -- your changes will be discarded when the file is
6 * regenerated.
7 * NO CHECKED-IN PROTOBUF GENCODE */
8
9 #ifndef SRC_PROTO_GRPC_LOOKUP_V1_RLS_PROTO_UPB_H__UPB_H_
10 #define SRC_PROTO_GRPC_LOOKUP_V1_RLS_PROTO_UPB_H__UPB_H_
11
12 #include "upb/generated_code_support.h"
13
14 #include "src/proto/grpc/lookup/v1/rls.upb_minitable.h"
15
16
17 // Must be last.
18 #include "upb/port/def.inc"
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 typedef struct grpc_lookup_v1_RouteLookupRequest { upb_Message UPB_PRIVATE(base); } grpc_lookup_v1_RouteLookupRequest;
25 typedef struct grpc_lookup_v1_RouteLookupRequest_KeyMapEntry { upb_Message UPB_PRIVATE(base); } grpc_lookup_v1_RouteLookupRequest_KeyMapEntry;
26 typedef struct grpc_lookup_v1_RouteLookupResponse { upb_Message UPB_PRIVATE(base); } grpc_lookup_v1_RouteLookupResponse;
27
28 typedef enum {
29 grpc_lookup_v1_RouteLookupRequest_REASON_UNKNOWN = 0,
30 grpc_lookup_v1_RouteLookupRequest_REASON_MISS = 1,
31 grpc_lookup_v1_RouteLookupRequest_REASON_STALE = 2
32 } grpc_lookup_v1_RouteLookupRequest_Reason;
33
34
35
36 /* grpc.lookup.v1.RouteLookupRequest */
37
grpc_lookup_v1_RouteLookupRequest_new(upb_Arena * arena)38 UPB_INLINE grpc_lookup_v1_RouteLookupRequest* grpc_lookup_v1_RouteLookupRequest_new(upb_Arena* arena) {
39 return (grpc_lookup_v1_RouteLookupRequest*)_upb_Message_New(&grpc__lookup__v1__RouteLookupRequest_msg_init, arena);
40 }
grpc_lookup_v1_RouteLookupRequest_parse(const char * buf,size_t size,upb_Arena * arena)41 UPB_INLINE grpc_lookup_v1_RouteLookupRequest* grpc_lookup_v1_RouteLookupRequest_parse(const char* buf, size_t size, upb_Arena* arena) {
42 grpc_lookup_v1_RouteLookupRequest* ret = grpc_lookup_v1_RouteLookupRequest_new(arena);
43 if (!ret) return NULL;
44 if (upb_Decode(buf, size, UPB_UPCAST(ret), &grpc__lookup__v1__RouteLookupRequest_msg_init, NULL, 0, arena) !=
45 kUpb_DecodeStatus_Ok) {
46 return NULL;
47 }
48 return ret;
49 }
grpc_lookup_v1_RouteLookupRequest_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)50 UPB_INLINE grpc_lookup_v1_RouteLookupRequest* grpc_lookup_v1_RouteLookupRequest_parse_ex(const char* buf, size_t size,
51 const upb_ExtensionRegistry* extreg,
52 int options, upb_Arena* arena) {
53 grpc_lookup_v1_RouteLookupRequest* ret = grpc_lookup_v1_RouteLookupRequest_new(arena);
54 if (!ret) return NULL;
55 if (upb_Decode(buf, size, UPB_UPCAST(ret), &grpc__lookup__v1__RouteLookupRequest_msg_init, extreg, options,
56 arena) != kUpb_DecodeStatus_Ok) {
57 return NULL;
58 }
59 return ret;
60 }
grpc_lookup_v1_RouteLookupRequest_serialize(const grpc_lookup_v1_RouteLookupRequest * msg,upb_Arena * arena,size_t * len)61 UPB_INLINE char* grpc_lookup_v1_RouteLookupRequest_serialize(const grpc_lookup_v1_RouteLookupRequest* msg, upb_Arena* arena, size_t* len) {
62 char* ptr;
63 (void)upb_Encode(UPB_UPCAST(msg), &grpc__lookup__v1__RouteLookupRequest_msg_init, 0, arena, &ptr, len);
64 return ptr;
65 }
grpc_lookup_v1_RouteLookupRequest_serialize_ex(const grpc_lookup_v1_RouteLookupRequest * msg,int options,upb_Arena * arena,size_t * len)66 UPB_INLINE char* grpc_lookup_v1_RouteLookupRequest_serialize_ex(const grpc_lookup_v1_RouteLookupRequest* msg, int options,
67 upb_Arena* arena, size_t* len) {
68 char* ptr;
69 (void)upb_Encode(UPB_UPCAST(msg), &grpc__lookup__v1__RouteLookupRequest_msg_init, options, arena, &ptr, len);
70 return ptr;
71 }
grpc_lookup_v1_RouteLookupRequest_clear_target_type(grpc_lookup_v1_RouteLookupRequest * msg)72 UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_clear_target_type(grpc_lookup_v1_RouteLookupRequest* msg) {
73 const upb_MiniTableField field = {3, 16, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
74 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
75 }
grpc_lookup_v1_RouteLookupRequest_target_type(const grpc_lookup_v1_RouteLookupRequest * msg)76 UPB_INLINE upb_StringView grpc_lookup_v1_RouteLookupRequest_target_type(const grpc_lookup_v1_RouteLookupRequest* msg) {
77 upb_StringView default_val = upb_StringView_FromString("");
78 upb_StringView ret;
79 const upb_MiniTableField field = {3, 16, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
80 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
81 &default_val, &ret);
82 return ret;
83 }
grpc_lookup_v1_RouteLookupRequest_clear_key_map(grpc_lookup_v1_RouteLookupRequest * msg)84 UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_clear_key_map(grpc_lookup_v1_RouteLookupRequest* msg) {
85 const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 0, 11, (int)kUpb_FieldMode_Map | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
86 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
87 }
grpc_lookup_v1_RouteLookupRequest_key_map_size(const grpc_lookup_v1_RouteLookupRequest * msg)88 UPB_INLINE size_t grpc_lookup_v1_RouteLookupRequest_key_map_size(const grpc_lookup_v1_RouteLookupRequest* msg) {
89 const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 0, 11, (int)kUpb_FieldMode_Map | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
90 const upb_Map* map = upb_Message_GetMap(UPB_UPCAST(msg), &field);
91 return map ? _upb_Map_Size(map) : 0;
92 }
grpc_lookup_v1_RouteLookupRequest_key_map_get(const grpc_lookup_v1_RouteLookupRequest * msg,upb_StringView key,upb_StringView * val)93 UPB_INLINE bool grpc_lookup_v1_RouteLookupRequest_key_map_get(const grpc_lookup_v1_RouteLookupRequest* msg, upb_StringView key, upb_StringView* val) {
94 const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 0, 11, (int)kUpb_FieldMode_Map | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
95 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&grpc__lookup__v1__RouteLookupRequest__KeyMapEntry_msg_init);
96 const upb_Map* map = upb_Message_GetMap(UPB_UPCAST(msg), &field);
97 if (!map) return false;
98 return _upb_Map_Get(map, &key, 0, val, 0);
99 }
grpc_lookup_v1_RouteLookupRequest_key_map_next(const grpc_lookup_v1_RouteLookupRequest * msg,size_t * iter)100 UPB_INLINE const grpc_lookup_v1_RouteLookupRequest_KeyMapEntry* grpc_lookup_v1_RouteLookupRequest_key_map_next(const grpc_lookup_v1_RouteLookupRequest* msg, size_t* iter) {
101 const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 0, 11, (int)kUpb_FieldMode_Map | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
102 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&grpc__lookup__v1__RouteLookupRequest__KeyMapEntry_msg_init);
103 const upb_Map* map = upb_Message_GetMap(UPB_UPCAST(msg), &field);
104 if (!map) return NULL;
105 return (const grpc_lookup_v1_RouteLookupRequest_KeyMapEntry*)_upb_map_next(map, iter);
106 }
_grpc_lookup_v1_RouteLookupRequest_key_map_upb_map(grpc_lookup_v1_RouteLookupRequest * msg)107 UPB_INLINE const upb_Map* _grpc_lookup_v1_RouteLookupRequest_key_map_upb_map(grpc_lookup_v1_RouteLookupRequest* msg) {
108 const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 0, 11, (int)kUpb_FieldMode_Map | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
109 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&grpc__lookup__v1__RouteLookupRequest__KeyMapEntry_msg_init);
110 return upb_Message_GetMap(UPB_UPCAST(msg), &field);
111 }
_grpc_lookup_v1_RouteLookupRequest_key_map_mutable_upb_map(grpc_lookup_v1_RouteLookupRequest * msg,upb_Arena * a)112 UPB_INLINE upb_Map* _grpc_lookup_v1_RouteLookupRequest_key_map_mutable_upb_map(grpc_lookup_v1_RouteLookupRequest* msg, upb_Arena* a) {
113 const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 0, 11, (int)kUpb_FieldMode_Map | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
114 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&grpc__lookup__v1__RouteLookupRequest__KeyMapEntry_msg_init);
115 return _upb_Message_GetOrCreateMutableMap(UPB_UPCAST(msg), &field, 0, 0, a);
116 }
grpc_lookup_v1_RouteLookupRequest_clear_reason(grpc_lookup_v1_RouteLookupRequest * msg)117 UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_clear_reason(grpc_lookup_v1_RouteLookupRequest* msg) {
118 const upb_MiniTableField field = {5, UPB_SIZE(12, 8), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
119 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
120 }
grpc_lookup_v1_RouteLookupRequest_reason(const grpc_lookup_v1_RouteLookupRequest * msg)121 UPB_INLINE int32_t grpc_lookup_v1_RouteLookupRequest_reason(const grpc_lookup_v1_RouteLookupRequest* msg) {
122 int32_t default_val = 0;
123 int32_t ret;
124 const upb_MiniTableField field = {5, UPB_SIZE(12, 8), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
125 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
126 &default_val, &ret);
127 return ret;
128 }
grpc_lookup_v1_RouteLookupRequest_clear_stale_header_data(grpc_lookup_v1_RouteLookupRequest * msg)129 UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_clear_stale_header_data(grpc_lookup_v1_RouteLookupRequest* msg) {
130 const upb_MiniTableField field = {6, UPB_SIZE(24, 40), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
131 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
132 }
grpc_lookup_v1_RouteLookupRequest_stale_header_data(const grpc_lookup_v1_RouteLookupRequest * msg)133 UPB_INLINE upb_StringView grpc_lookup_v1_RouteLookupRequest_stale_header_data(const grpc_lookup_v1_RouteLookupRequest* msg) {
134 upb_StringView default_val = upb_StringView_FromString("");
135 upb_StringView ret;
136 const upb_MiniTableField field = {6, UPB_SIZE(24, 40), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
137 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
138 &default_val, &ret);
139 return ret;
140 }
141
grpc_lookup_v1_RouteLookupRequest_set_target_type(grpc_lookup_v1_RouteLookupRequest * msg,upb_StringView value)142 UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_set_target_type(grpc_lookup_v1_RouteLookupRequest *msg, upb_StringView value) {
143 const upb_MiniTableField field = {3, 16, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
144 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
145 }
grpc_lookup_v1_RouteLookupRequest_key_map_clear(grpc_lookup_v1_RouteLookupRequest * msg)146 UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_key_map_clear(grpc_lookup_v1_RouteLookupRequest* msg) {
147 const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 0, 11, (int)kUpb_FieldMode_Map | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
148 upb_Map* map = (upb_Map*)upb_Message_GetMap(UPB_UPCAST(msg), &field);
149 if (!map) return;
150 _upb_Map_Clear(map);
151 }
grpc_lookup_v1_RouteLookupRequest_key_map_set(grpc_lookup_v1_RouteLookupRequest * msg,upb_StringView key,upb_StringView val,upb_Arena * a)152 UPB_INLINE bool grpc_lookup_v1_RouteLookupRequest_key_map_set(grpc_lookup_v1_RouteLookupRequest* msg, upb_StringView key, upb_StringView val, upb_Arena* a) {
153 const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 0, 11, (int)kUpb_FieldMode_Map | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
154 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&grpc__lookup__v1__RouteLookupRequest__KeyMapEntry_msg_init);
155 upb_Map* map = _upb_Message_GetOrCreateMutableMap(UPB_UPCAST(msg),
156 &field, 0, 0, a);
157 return _upb_Map_Insert(map, &key, 0, &val, 0, a) !=
158 kUpb_MapInsertStatus_OutOfMemory;
159 }
grpc_lookup_v1_RouteLookupRequest_key_map_delete(grpc_lookup_v1_RouteLookupRequest * msg,upb_StringView key)160 UPB_INLINE bool grpc_lookup_v1_RouteLookupRequest_key_map_delete(grpc_lookup_v1_RouteLookupRequest* msg, upb_StringView key) {
161 const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 0, 11, (int)kUpb_FieldMode_Map | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
162 upb_Map* map = (upb_Map*)upb_Message_GetMap(UPB_UPCAST(msg), &field);
163 if (!map) return false;
164 return _upb_Map_Delete(map, &key, 0, NULL);
165 }
grpc_lookup_v1_RouteLookupRequest_key_map_nextmutable(grpc_lookup_v1_RouteLookupRequest * msg,size_t * iter)166 UPB_INLINE grpc_lookup_v1_RouteLookupRequest_KeyMapEntry* grpc_lookup_v1_RouteLookupRequest_key_map_nextmutable(grpc_lookup_v1_RouteLookupRequest* msg, size_t* iter) {
167 const upb_MiniTableField field = {4, UPB_SIZE(8, 32), 0, 0, 11, (int)kUpb_FieldMode_Map | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
168 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&grpc__lookup__v1__RouteLookupRequest__KeyMapEntry_msg_init);
169 upb_Map* map = (upb_Map*)upb_Message_GetMap(UPB_UPCAST(msg), &field);
170 if (!map) return NULL;
171 return (grpc_lookup_v1_RouteLookupRequest_KeyMapEntry*)_upb_map_next(map, iter);
172 }
grpc_lookup_v1_RouteLookupRequest_set_reason(grpc_lookup_v1_RouteLookupRequest * msg,int32_t value)173 UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_set_reason(grpc_lookup_v1_RouteLookupRequest *msg, int32_t value) {
174 const upb_MiniTableField field = {5, UPB_SIZE(12, 8), 0, kUpb_NoSub, 5, (int)kUpb_FieldMode_Scalar | (int)kUpb_LabelFlags_IsAlternate | ((int)kUpb_FieldRep_4Byte << kUpb_FieldRep_Shift)};
175 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
176 }
grpc_lookup_v1_RouteLookupRequest_set_stale_header_data(grpc_lookup_v1_RouteLookupRequest * msg,upb_StringView value)177 UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_set_stale_header_data(grpc_lookup_v1_RouteLookupRequest *msg, upb_StringView value) {
178 const upb_MiniTableField field = {6, UPB_SIZE(24, 40), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
179 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
180 }
181
182 /* grpc.lookup.v1.RouteLookupRequest.KeyMapEntry */
183
grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_key(const grpc_lookup_v1_RouteLookupRequest_KeyMapEntry * msg)184 UPB_INLINE upb_StringView grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_key(const grpc_lookup_v1_RouteLookupRequest_KeyMapEntry* msg) {
185 upb_StringView ret;
186 _upb_msg_map_key(msg, &ret, 0);
187 return ret;
188 }
grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_value(const grpc_lookup_v1_RouteLookupRequest_KeyMapEntry * msg)189 UPB_INLINE upb_StringView grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_value(const grpc_lookup_v1_RouteLookupRequest_KeyMapEntry* msg) {
190 upb_StringView ret;
191 _upb_msg_map_value(msg, &ret, 0);
192 return ret;
193 }
194
grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_set_value(grpc_lookup_v1_RouteLookupRequest_KeyMapEntry * msg,upb_StringView value)195 UPB_INLINE void grpc_lookup_v1_RouteLookupRequest_KeyMapEntry_set_value(grpc_lookup_v1_RouteLookupRequest_KeyMapEntry *msg, upb_StringView value) {
196 _upb_msg_map_set_value(msg, &value, 0);
197 }
198
199 /* grpc.lookup.v1.RouteLookupResponse */
200
grpc_lookup_v1_RouteLookupResponse_new(upb_Arena * arena)201 UPB_INLINE grpc_lookup_v1_RouteLookupResponse* grpc_lookup_v1_RouteLookupResponse_new(upb_Arena* arena) {
202 return (grpc_lookup_v1_RouteLookupResponse*)_upb_Message_New(&grpc__lookup__v1__RouteLookupResponse_msg_init, arena);
203 }
grpc_lookup_v1_RouteLookupResponse_parse(const char * buf,size_t size,upb_Arena * arena)204 UPB_INLINE grpc_lookup_v1_RouteLookupResponse* grpc_lookup_v1_RouteLookupResponse_parse(const char* buf, size_t size, upb_Arena* arena) {
205 grpc_lookup_v1_RouteLookupResponse* ret = grpc_lookup_v1_RouteLookupResponse_new(arena);
206 if (!ret) return NULL;
207 if (upb_Decode(buf, size, UPB_UPCAST(ret), &grpc__lookup__v1__RouteLookupResponse_msg_init, NULL, 0, arena) !=
208 kUpb_DecodeStatus_Ok) {
209 return NULL;
210 }
211 return ret;
212 }
grpc_lookup_v1_RouteLookupResponse_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)213 UPB_INLINE grpc_lookup_v1_RouteLookupResponse* grpc_lookup_v1_RouteLookupResponse_parse_ex(const char* buf, size_t size,
214 const upb_ExtensionRegistry* extreg,
215 int options, upb_Arena* arena) {
216 grpc_lookup_v1_RouteLookupResponse* ret = grpc_lookup_v1_RouteLookupResponse_new(arena);
217 if (!ret) return NULL;
218 if (upb_Decode(buf, size, UPB_UPCAST(ret), &grpc__lookup__v1__RouteLookupResponse_msg_init, extreg, options,
219 arena) != kUpb_DecodeStatus_Ok) {
220 return NULL;
221 }
222 return ret;
223 }
grpc_lookup_v1_RouteLookupResponse_serialize(const grpc_lookup_v1_RouteLookupResponse * msg,upb_Arena * arena,size_t * len)224 UPB_INLINE char* grpc_lookup_v1_RouteLookupResponse_serialize(const grpc_lookup_v1_RouteLookupResponse* msg, upb_Arena* arena, size_t* len) {
225 char* ptr;
226 (void)upb_Encode(UPB_UPCAST(msg), &grpc__lookup__v1__RouteLookupResponse_msg_init, 0, arena, &ptr, len);
227 return ptr;
228 }
grpc_lookup_v1_RouteLookupResponse_serialize_ex(const grpc_lookup_v1_RouteLookupResponse * msg,int options,upb_Arena * arena,size_t * len)229 UPB_INLINE char* grpc_lookup_v1_RouteLookupResponse_serialize_ex(const grpc_lookup_v1_RouteLookupResponse* msg, int options,
230 upb_Arena* arena, size_t* len) {
231 char* ptr;
232 (void)upb_Encode(UPB_UPCAST(msg), &grpc__lookup__v1__RouteLookupResponse_msg_init, options, arena, &ptr, len);
233 return ptr;
234 }
grpc_lookup_v1_RouteLookupResponse_clear_header_data(grpc_lookup_v1_RouteLookupResponse * msg)235 UPB_INLINE void grpc_lookup_v1_RouteLookupResponse_clear_header_data(grpc_lookup_v1_RouteLookupResponse* msg) {
236 const upb_MiniTableField field = {2, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
237 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
238 }
grpc_lookup_v1_RouteLookupResponse_header_data(const grpc_lookup_v1_RouteLookupResponse * msg)239 UPB_INLINE upb_StringView grpc_lookup_v1_RouteLookupResponse_header_data(const grpc_lookup_v1_RouteLookupResponse* msg) {
240 upb_StringView default_val = upb_StringView_FromString("");
241 upb_StringView ret;
242 const upb_MiniTableField field = {2, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
243 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
244 &default_val, &ret);
245 return ret;
246 }
grpc_lookup_v1_RouteLookupResponse_clear_targets(grpc_lookup_v1_RouteLookupResponse * msg)247 UPB_INLINE void grpc_lookup_v1_RouteLookupResponse_clear_targets(grpc_lookup_v1_RouteLookupResponse* msg) {
248 const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
249 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
250 }
grpc_lookup_v1_RouteLookupResponse_targets(const grpc_lookup_v1_RouteLookupResponse * msg,size_t * size)251 UPB_INLINE upb_StringView const* grpc_lookup_v1_RouteLookupResponse_targets(const grpc_lookup_v1_RouteLookupResponse* msg, size_t* size) {
252 const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
253 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
254 if (arr) {
255 if (size) *size = arr->UPB_PRIVATE(size);
256 return (upb_StringView const*)upb_Array_DataPtr(arr);
257 } else {
258 if (size) *size = 0;
259 return NULL;
260 }
261 }
_grpc_lookup_v1_RouteLookupResponse_targets_upb_array(const grpc_lookup_v1_RouteLookupResponse * msg,size_t * size)262 UPB_INLINE const upb_Array* _grpc_lookup_v1_RouteLookupResponse_targets_upb_array(const grpc_lookup_v1_RouteLookupResponse* msg, size_t* size) {
263 const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
264 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
265 if (size) {
266 *size = arr ? arr->UPB_PRIVATE(size) : 0;
267 }
268 return arr;
269 }
_grpc_lookup_v1_RouteLookupResponse_targets_mutable_upb_array(grpc_lookup_v1_RouteLookupResponse * msg,size_t * size,upb_Arena * arena)270 UPB_INLINE upb_Array* _grpc_lookup_v1_RouteLookupResponse_targets_mutable_upb_array(grpc_lookup_v1_RouteLookupResponse* msg, size_t* size, upb_Arena* arena) {
271 const upb_MiniTableField field = {3, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
272 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
273 &field, arena);
274 if (size) {
275 *size = arr ? arr->UPB_PRIVATE(size) : 0;
276 }
277 return arr;
278 }
279
grpc_lookup_v1_RouteLookupResponse_set_header_data(grpc_lookup_v1_RouteLookupResponse * msg,upb_StringView value)280 UPB_INLINE void grpc_lookup_v1_RouteLookupResponse_set_header_data(grpc_lookup_v1_RouteLookupResponse *msg, upb_StringView value) {
281 const upb_MiniTableField field = {2, UPB_SIZE(12, 8), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
282 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
283 }
grpc_lookup_v1_RouteLookupResponse_mutable_targets(grpc_lookup_v1_RouteLookupResponse * msg,size_t * size)284 UPB_INLINE upb_StringView* grpc_lookup_v1_RouteLookupResponse_mutable_targets(grpc_lookup_v1_RouteLookupResponse* msg, size_t* size) {
285 upb_MiniTableField field = {3, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
286 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
287 if (arr) {
288 if (size) *size = arr->UPB_PRIVATE(size);
289 return (upb_StringView*)upb_Array_MutableDataPtr(arr);
290 } else {
291 if (size) *size = 0;
292 return NULL;
293 }
294 }
grpc_lookup_v1_RouteLookupResponse_resize_targets(grpc_lookup_v1_RouteLookupResponse * msg,size_t size,upb_Arena * arena)295 UPB_INLINE upb_StringView* grpc_lookup_v1_RouteLookupResponse_resize_targets(grpc_lookup_v1_RouteLookupResponse* msg, size_t size, upb_Arena* arena) {
296 upb_MiniTableField field = {3, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
297 return (upb_StringView*)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
298 &field, size, arena);
299 }
grpc_lookup_v1_RouteLookupResponse_add_targets(grpc_lookup_v1_RouteLookupResponse * msg,upb_StringView val,upb_Arena * arena)300 UPB_INLINE bool grpc_lookup_v1_RouteLookupResponse_add_targets(grpc_lookup_v1_RouteLookupResponse* msg, upb_StringView val, upb_Arena* arena) {
301 upb_MiniTableField field = {3, UPB_SIZE(8, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
302 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
303 UPB_UPCAST(msg), &field, arena);
304 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
305 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
306 return false;
307 }
308 UPB_PRIVATE(_upb_Array_Set)
309 (arr, arr->UPB_PRIVATE(size) - 1, &val, sizeof(val));
310 return true;
311 }
312
313 #ifdef __cplusplus
314 } /* extern "C" */
315 #endif
316
317 #include "upb/port/undef.inc"
318
319 #endif /* SRC_PROTO_GRPC_LOOKUP_V1_RLS_PROTO_UPB_H__UPB_H_ */
320