1 /* This file was generated by upb_generator from the input file:
2 *
3 * google/api/http.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 GOOGLE_API_HTTP_PROTO_UPB_H__UPB_H_
10 #define GOOGLE_API_HTTP_PROTO_UPB_H__UPB_H_
11
12 #include "upb/generated_code_support.h"
13
14 #include "google/api/http.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 google_api_Http { upb_Message UPB_PRIVATE(base); } google_api_Http;
25 typedef struct google_api_HttpRule { upb_Message UPB_PRIVATE(base); } google_api_HttpRule;
26 typedef struct google_api_CustomHttpPattern { upb_Message UPB_PRIVATE(base); } google_api_CustomHttpPattern;
27
28
29
30 /* google.api.Http */
31
google_api_Http_new(upb_Arena * arena)32 UPB_INLINE google_api_Http* google_api_Http_new(upb_Arena* arena) {
33 return (google_api_Http*)_upb_Message_New(&google__api__Http_msg_init, arena);
34 }
google_api_Http_parse(const char * buf,size_t size,upb_Arena * arena)35 UPB_INLINE google_api_Http* google_api_Http_parse(const char* buf, size_t size, upb_Arena* arena) {
36 google_api_Http* ret = google_api_Http_new(arena);
37 if (!ret) return NULL;
38 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__api__Http_msg_init, NULL, 0, arena) !=
39 kUpb_DecodeStatus_Ok) {
40 return NULL;
41 }
42 return ret;
43 }
google_api_Http_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)44 UPB_INLINE google_api_Http* google_api_Http_parse_ex(const char* buf, size_t size,
45 const upb_ExtensionRegistry* extreg,
46 int options, upb_Arena* arena) {
47 google_api_Http* ret = google_api_Http_new(arena);
48 if (!ret) return NULL;
49 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__api__Http_msg_init, extreg, options,
50 arena) != kUpb_DecodeStatus_Ok) {
51 return NULL;
52 }
53 return ret;
54 }
google_api_Http_serialize(const google_api_Http * msg,upb_Arena * arena,size_t * len)55 UPB_INLINE char* google_api_Http_serialize(const google_api_Http* msg, upb_Arena* arena, size_t* len) {
56 char* ptr;
57 (void)upb_Encode(UPB_UPCAST(msg), &google__api__Http_msg_init, 0, arena, &ptr, len);
58 return ptr;
59 }
google_api_Http_serialize_ex(const google_api_Http * msg,int options,upb_Arena * arena,size_t * len)60 UPB_INLINE char* google_api_Http_serialize_ex(const google_api_Http* msg, int options,
61 upb_Arena* arena, size_t* len) {
62 char* ptr;
63 (void)upb_Encode(UPB_UPCAST(msg), &google__api__Http_msg_init, options, arena, &ptr, len);
64 return ptr;
65 }
google_api_Http_clear_rules(google_api_Http * msg)66 UPB_INLINE void google_api_Http_clear_rules(google_api_Http* msg) {
67 const upb_MiniTableField field = {1, UPB_SIZE(8, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
68 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
69 }
google_api_Http_rules(const google_api_Http * msg,size_t * size)70 UPB_INLINE const google_api_HttpRule* const* google_api_Http_rules(const google_api_Http* msg, size_t* size) {
71 const upb_MiniTableField field = {1, UPB_SIZE(8, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
72 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__api__HttpRule_msg_init);
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 google_api_HttpRule* const*)upb_Array_DataPtr(arr);
77 } else {
78 if (size) *size = 0;
79 return NULL;
80 }
81 }
_google_api_Http_rules_upb_array(const google_api_Http * msg,size_t * size)82 UPB_INLINE const upb_Array* _google_api_Http_rules_upb_array(const google_api_Http* msg, size_t* size) {
83 const upb_MiniTableField field = {1, UPB_SIZE(8, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
84 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__api__HttpRule_msg_init);
85 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
86 if (size) {
87 *size = arr ? arr->UPB_PRIVATE(size) : 0;
88 }
89 return arr;
90 }
_google_api_Http_rules_mutable_upb_array(google_api_Http * msg,size_t * size,upb_Arena * arena)91 UPB_INLINE upb_Array* _google_api_Http_rules_mutable_upb_array(google_api_Http* msg, size_t* size, upb_Arena* arena) {
92 const upb_MiniTableField field = {1, UPB_SIZE(8, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
93 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__api__HttpRule_msg_init);
94 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
95 &field, arena);
96 if (size) {
97 *size = arr ? arr->UPB_PRIVATE(size) : 0;
98 }
99 return arr;
100 }
google_api_Http_clear_fully_decode_reserved_expansion(google_api_Http * msg)101 UPB_INLINE void google_api_Http_clear_fully_decode_reserved_expansion(google_api_Http* msg) {
102 const upb_MiniTableField field = {2, UPB_SIZE(12, 8), 0, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
103 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
104 }
google_api_Http_fully_decode_reserved_expansion(const google_api_Http * msg)105 UPB_INLINE bool google_api_Http_fully_decode_reserved_expansion(const google_api_Http* msg) {
106 bool default_val = false;
107 bool ret;
108 const upb_MiniTableField field = {2, UPB_SIZE(12, 8), 0, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
109 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
110 &default_val, &ret);
111 return ret;
112 }
113
google_api_Http_mutable_rules(google_api_Http * msg,size_t * size)114 UPB_INLINE google_api_HttpRule** google_api_Http_mutable_rules(google_api_Http* msg, size_t* size) {
115 upb_MiniTableField field = {1, UPB_SIZE(8, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
116 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__api__HttpRule_msg_init);
117 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
118 if (arr) {
119 if (size) *size = arr->UPB_PRIVATE(size);
120 return (google_api_HttpRule**)upb_Array_MutableDataPtr(arr);
121 } else {
122 if (size) *size = 0;
123 return NULL;
124 }
125 }
google_api_Http_resize_rules(google_api_Http * msg,size_t size,upb_Arena * arena)126 UPB_INLINE google_api_HttpRule** google_api_Http_resize_rules(google_api_Http* msg, size_t size, upb_Arena* arena) {
127 upb_MiniTableField field = {1, UPB_SIZE(8, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
128 return (google_api_HttpRule**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
129 &field, size, arena);
130 }
google_api_Http_add_rules(google_api_Http * msg,upb_Arena * arena)131 UPB_INLINE struct google_api_HttpRule* google_api_Http_add_rules(google_api_Http* msg, upb_Arena* arena) {
132 upb_MiniTableField field = {1, UPB_SIZE(8, 16), 0, 0, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
133 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__api__HttpRule_msg_init);
134 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
135 UPB_UPCAST(msg), &field, arena);
136 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
137 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
138 return NULL;
139 }
140 struct google_api_HttpRule* sub = (struct google_api_HttpRule*)_upb_Message_New(&google__api__HttpRule_msg_init, arena);
141 if (!arr || !sub) return NULL;
142 UPB_PRIVATE(_upb_Array_Set)
143 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
144 return sub;
145 }
google_api_Http_set_fully_decode_reserved_expansion(google_api_Http * msg,bool value)146 UPB_INLINE void google_api_Http_set_fully_decode_reserved_expansion(google_api_Http *msg, bool value) {
147 const upb_MiniTableField field = {2, UPB_SIZE(12, 8), 0, kUpb_NoSub, 8, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_1Byte << kUpb_FieldRep_Shift)};
148 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
149 }
150
151 /* google.api.HttpRule */
152
google_api_HttpRule_new(upb_Arena * arena)153 UPB_INLINE google_api_HttpRule* google_api_HttpRule_new(upb_Arena* arena) {
154 return (google_api_HttpRule*)_upb_Message_New(&google__api__HttpRule_msg_init, arena);
155 }
google_api_HttpRule_parse(const char * buf,size_t size,upb_Arena * arena)156 UPB_INLINE google_api_HttpRule* google_api_HttpRule_parse(const char* buf, size_t size, upb_Arena* arena) {
157 google_api_HttpRule* ret = google_api_HttpRule_new(arena);
158 if (!ret) return NULL;
159 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__api__HttpRule_msg_init, NULL, 0, arena) !=
160 kUpb_DecodeStatus_Ok) {
161 return NULL;
162 }
163 return ret;
164 }
google_api_HttpRule_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)165 UPB_INLINE google_api_HttpRule* google_api_HttpRule_parse_ex(const char* buf, size_t size,
166 const upb_ExtensionRegistry* extreg,
167 int options, upb_Arena* arena) {
168 google_api_HttpRule* ret = google_api_HttpRule_new(arena);
169 if (!ret) return NULL;
170 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__api__HttpRule_msg_init, extreg, options,
171 arena) != kUpb_DecodeStatus_Ok) {
172 return NULL;
173 }
174 return ret;
175 }
google_api_HttpRule_serialize(const google_api_HttpRule * msg,upb_Arena * arena,size_t * len)176 UPB_INLINE char* google_api_HttpRule_serialize(const google_api_HttpRule* msg, upb_Arena* arena, size_t* len) {
177 char* ptr;
178 (void)upb_Encode(UPB_UPCAST(msg), &google__api__HttpRule_msg_init, 0, arena, &ptr, len);
179 return ptr;
180 }
google_api_HttpRule_serialize_ex(const google_api_HttpRule * msg,int options,upb_Arena * arena,size_t * len)181 UPB_INLINE char* google_api_HttpRule_serialize_ex(const google_api_HttpRule* msg, int options,
182 upb_Arena* arena, size_t* len) {
183 char* ptr;
184 (void)upb_Encode(UPB_UPCAST(msg), &google__api__HttpRule_msg_init, options, arena, &ptr, len);
185 return ptr;
186 }
187 typedef enum {
188 google_api_HttpRule_pattern_get = 2,
189 google_api_HttpRule_pattern_put = 3,
190 google_api_HttpRule_pattern_post = 4,
191 google_api_HttpRule_pattern_delete = 5,
192 google_api_HttpRule_pattern_patch = 6,
193 google_api_HttpRule_pattern_custom = 8,
194 google_api_HttpRule_pattern_NOT_SET = 0
195 } google_api_HttpRule_pattern_oneofcases;
google_api_HttpRule_pattern_case(const google_api_HttpRule * msg)196 UPB_INLINE google_api_HttpRule_pattern_oneofcases google_api_HttpRule_pattern_case(const google_api_HttpRule* msg) {
197 const upb_MiniTableField field = {2, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
198 return (google_api_HttpRule_pattern_oneofcases)upb_Message_WhichOneofFieldNumber(
199 UPB_UPCAST(msg), &field);
200 }
google_api_HttpRule_clear_selector(google_api_HttpRule * msg)201 UPB_INLINE void google_api_HttpRule_clear_selector(google_api_HttpRule* msg) {
202 const upb_MiniTableField field = {1, UPB_SIZE(24, 32), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
203 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
204 }
google_api_HttpRule_selector(const google_api_HttpRule * msg)205 UPB_INLINE upb_StringView google_api_HttpRule_selector(const google_api_HttpRule* msg) {
206 upb_StringView default_val = upb_StringView_FromString("");
207 upb_StringView ret;
208 const upb_MiniTableField field = {1, UPB_SIZE(24, 32), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
209 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
210 &default_val, &ret);
211 return ret;
212 }
google_api_HttpRule_clear_get(google_api_HttpRule * msg)213 UPB_INLINE void google_api_HttpRule_clear_get(google_api_HttpRule* msg) {
214 const upb_MiniTableField field = {2, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
215 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
216 }
google_api_HttpRule_get(const google_api_HttpRule * msg)217 UPB_INLINE upb_StringView google_api_HttpRule_get(const google_api_HttpRule* msg) {
218 upb_StringView default_val = upb_StringView_FromString("");
219 upb_StringView ret;
220 const upb_MiniTableField field = {2, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
221 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
222 &default_val, &ret);
223 return ret;
224 }
google_api_HttpRule_has_get(const google_api_HttpRule * msg)225 UPB_INLINE bool google_api_HttpRule_has_get(const google_api_HttpRule* msg) {
226 const upb_MiniTableField field = {2, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
227 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
228 }
google_api_HttpRule_clear_put(google_api_HttpRule * msg)229 UPB_INLINE void google_api_HttpRule_clear_put(google_api_HttpRule* msg) {
230 const upb_MiniTableField field = {3, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
231 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
232 }
google_api_HttpRule_put(const google_api_HttpRule * msg)233 UPB_INLINE upb_StringView google_api_HttpRule_put(const google_api_HttpRule* msg) {
234 upb_StringView default_val = upb_StringView_FromString("");
235 upb_StringView ret;
236 const upb_MiniTableField field = {3, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
237 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
238 &default_val, &ret);
239 return ret;
240 }
google_api_HttpRule_has_put(const google_api_HttpRule * msg)241 UPB_INLINE bool google_api_HttpRule_has_put(const google_api_HttpRule* msg) {
242 const upb_MiniTableField field = {3, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
243 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
244 }
google_api_HttpRule_clear_post(google_api_HttpRule * msg)245 UPB_INLINE void google_api_HttpRule_clear_post(google_api_HttpRule* msg) {
246 const upb_MiniTableField field = {4, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
247 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
248 }
google_api_HttpRule_post(const google_api_HttpRule * msg)249 UPB_INLINE upb_StringView google_api_HttpRule_post(const google_api_HttpRule* msg) {
250 upb_StringView default_val = upb_StringView_FromString("");
251 upb_StringView ret;
252 const upb_MiniTableField field = {4, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
253 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
254 &default_val, &ret);
255 return ret;
256 }
google_api_HttpRule_has_post(const google_api_HttpRule * msg)257 UPB_INLINE bool google_api_HttpRule_has_post(const google_api_HttpRule* msg) {
258 const upb_MiniTableField field = {4, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
259 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
260 }
google_api_HttpRule_clear_delete(google_api_HttpRule * msg)261 UPB_INLINE void google_api_HttpRule_clear_delete(google_api_HttpRule* msg) {
262 const upb_MiniTableField field = {5, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
263 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
264 }
google_api_HttpRule_delete(const google_api_HttpRule * msg)265 UPB_INLINE upb_StringView google_api_HttpRule_delete(const google_api_HttpRule* msg) {
266 upb_StringView default_val = upb_StringView_FromString("");
267 upb_StringView ret;
268 const upb_MiniTableField field = {5, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
269 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
270 &default_val, &ret);
271 return ret;
272 }
google_api_HttpRule_has_delete(const google_api_HttpRule * msg)273 UPB_INLINE bool google_api_HttpRule_has_delete(const google_api_HttpRule* msg) {
274 const upb_MiniTableField field = {5, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
275 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
276 }
google_api_HttpRule_clear_patch(google_api_HttpRule * msg)277 UPB_INLINE void google_api_HttpRule_clear_patch(google_api_HttpRule* msg) {
278 const upb_MiniTableField field = {6, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
279 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
280 }
google_api_HttpRule_patch(const google_api_HttpRule * msg)281 UPB_INLINE upb_StringView google_api_HttpRule_patch(const google_api_HttpRule* msg) {
282 upb_StringView default_val = upb_StringView_FromString("");
283 upb_StringView ret;
284 const upb_MiniTableField field = {6, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
285 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
286 &default_val, &ret);
287 return ret;
288 }
google_api_HttpRule_has_patch(const google_api_HttpRule * msg)289 UPB_INLINE bool google_api_HttpRule_has_patch(const google_api_HttpRule* msg) {
290 const upb_MiniTableField field = {6, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
291 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
292 }
google_api_HttpRule_clear_body(google_api_HttpRule * msg)293 UPB_INLINE void google_api_HttpRule_clear_body(google_api_HttpRule* msg) {
294 const upb_MiniTableField field = {7, UPB_SIZE(32, 48), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
295 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
296 }
google_api_HttpRule_body(const google_api_HttpRule * msg)297 UPB_INLINE upb_StringView google_api_HttpRule_body(const google_api_HttpRule* msg) {
298 upb_StringView default_val = upb_StringView_FromString("");
299 upb_StringView ret;
300 const upb_MiniTableField field = {7, UPB_SIZE(32, 48), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
301 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
302 &default_val, &ret);
303 return ret;
304 }
google_api_HttpRule_clear_custom(google_api_HttpRule * msg)305 UPB_INLINE void google_api_HttpRule_clear_custom(google_api_HttpRule* msg) {
306 const upb_MiniTableField field = {8, 16, -9, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
307 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
308 }
google_api_HttpRule_custom(const google_api_HttpRule * msg)309 UPB_INLINE const google_api_CustomHttpPattern* google_api_HttpRule_custom(const google_api_HttpRule* msg) {
310 const google_api_CustomHttpPattern* default_val = NULL;
311 const google_api_CustomHttpPattern* ret;
312 const upb_MiniTableField field = {8, 16, -9, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
313 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__api__CustomHttpPattern_msg_init);
314 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
315 &default_val, &ret);
316 return ret;
317 }
google_api_HttpRule_has_custom(const google_api_HttpRule * msg)318 UPB_INLINE bool google_api_HttpRule_has_custom(const google_api_HttpRule* msg) {
319 const upb_MiniTableField field = {8, 16, -9, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
320 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
321 }
google_api_HttpRule_clear_additional_bindings(google_api_HttpRule * msg)322 UPB_INLINE void google_api_HttpRule_clear_additional_bindings(google_api_HttpRule* msg) {
323 const upb_MiniTableField field = {11, UPB_SIZE(12, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
324 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
325 }
google_api_HttpRule_additional_bindings(const google_api_HttpRule * msg,size_t * size)326 UPB_INLINE const google_api_HttpRule* const* google_api_HttpRule_additional_bindings(const google_api_HttpRule* msg, size_t* size) {
327 const upb_MiniTableField field = {11, UPB_SIZE(12, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
328 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__api__HttpRule_msg_init);
329 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
330 if (arr) {
331 if (size) *size = arr->UPB_PRIVATE(size);
332 return (const google_api_HttpRule* const*)upb_Array_DataPtr(arr);
333 } else {
334 if (size) *size = 0;
335 return NULL;
336 }
337 }
_google_api_HttpRule_additional_bindings_upb_array(const google_api_HttpRule * msg,size_t * size)338 UPB_INLINE const upb_Array* _google_api_HttpRule_additional_bindings_upb_array(const google_api_HttpRule* msg, size_t* size) {
339 const upb_MiniTableField field = {11, UPB_SIZE(12, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
340 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__api__HttpRule_msg_init);
341 const upb_Array* arr = upb_Message_GetArray(UPB_UPCAST(msg), &field);
342 if (size) {
343 *size = arr ? arr->UPB_PRIVATE(size) : 0;
344 }
345 return arr;
346 }
_google_api_HttpRule_additional_bindings_mutable_upb_array(google_api_HttpRule * msg,size_t * size,upb_Arena * arena)347 UPB_INLINE upb_Array* _google_api_HttpRule_additional_bindings_mutable_upb_array(google_api_HttpRule* msg, size_t* size, upb_Arena* arena) {
348 const upb_MiniTableField field = {11, UPB_SIZE(12, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
349 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__api__HttpRule_msg_init);
350 upb_Array* arr = upb_Message_GetOrCreateMutableArray(UPB_UPCAST(msg),
351 &field, arena);
352 if (size) {
353 *size = arr ? arr->UPB_PRIVATE(size) : 0;
354 }
355 return arr;
356 }
google_api_HttpRule_clear_response_body(google_api_HttpRule * msg)357 UPB_INLINE void google_api_HttpRule_clear_response_body(google_api_HttpRule* msg) {
358 const upb_MiniTableField field = {12, UPB_SIZE(40, 72), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
359 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
360 }
google_api_HttpRule_response_body(const google_api_HttpRule * msg)361 UPB_INLINE upb_StringView google_api_HttpRule_response_body(const google_api_HttpRule* msg) {
362 upb_StringView default_val = upb_StringView_FromString("");
363 upb_StringView ret;
364 const upb_MiniTableField field = {12, UPB_SIZE(40, 72), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
365 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
366 &default_val, &ret);
367 return ret;
368 }
369
google_api_HttpRule_set_selector(google_api_HttpRule * msg,upb_StringView value)370 UPB_INLINE void google_api_HttpRule_set_selector(google_api_HttpRule *msg, upb_StringView value) {
371 const upb_MiniTableField field = {1, UPB_SIZE(24, 32), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
372 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
373 }
google_api_HttpRule_set_get(google_api_HttpRule * msg,upb_StringView value)374 UPB_INLINE void google_api_HttpRule_set_get(google_api_HttpRule *msg, upb_StringView value) {
375 const upb_MiniTableField field = {2, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
376 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
377 }
google_api_HttpRule_set_put(google_api_HttpRule * msg,upb_StringView value)378 UPB_INLINE void google_api_HttpRule_set_put(google_api_HttpRule *msg, upb_StringView value) {
379 const upb_MiniTableField field = {3, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
380 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
381 }
google_api_HttpRule_set_post(google_api_HttpRule * msg,upb_StringView value)382 UPB_INLINE void google_api_HttpRule_set_post(google_api_HttpRule *msg, upb_StringView value) {
383 const upb_MiniTableField field = {4, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
384 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
385 }
google_api_HttpRule_set_delete(google_api_HttpRule * msg,upb_StringView value)386 UPB_INLINE void google_api_HttpRule_set_delete(google_api_HttpRule *msg, upb_StringView value) {
387 const upb_MiniTableField field = {5, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
388 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
389 }
google_api_HttpRule_set_patch(google_api_HttpRule * msg,upb_StringView value)390 UPB_INLINE void google_api_HttpRule_set_patch(google_api_HttpRule *msg, upb_StringView value) {
391 const upb_MiniTableField field = {6, 16, -9, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
392 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
393 }
google_api_HttpRule_set_body(google_api_HttpRule * msg,upb_StringView value)394 UPB_INLINE void google_api_HttpRule_set_body(google_api_HttpRule *msg, upb_StringView value) {
395 const upb_MiniTableField field = {7, UPB_SIZE(32, 48), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
396 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
397 }
google_api_HttpRule_set_custom(google_api_HttpRule * msg,google_api_CustomHttpPattern * value)398 UPB_INLINE void google_api_HttpRule_set_custom(google_api_HttpRule *msg, google_api_CustomHttpPattern* value) {
399 const upb_MiniTableField field = {8, 16, -9, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
400 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__api__CustomHttpPattern_msg_init);
401 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
402 }
google_api_HttpRule_mutable_custom(google_api_HttpRule * msg,upb_Arena * arena)403 UPB_INLINE struct google_api_CustomHttpPattern* google_api_HttpRule_mutable_custom(google_api_HttpRule* msg, upb_Arena* arena) {
404 struct google_api_CustomHttpPattern* sub = (struct google_api_CustomHttpPattern*)google_api_HttpRule_custom(msg);
405 if (sub == NULL) {
406 sub = (struct google_api_CustomHttpPattern*)_upb_Message_New(&google__api__CustomHttpPattern_msg_init, arena);
407 if (sub) google_api_HttpRule_set_custom(msg, sub);
408 }
409 return sub;
410 }
google_api_HttpRule_mutable_additional_bindings(google_api_HttpRule * msg,size_t * size)411 UPB_INLINE google_api_HttpRule** google_api_HttpRule_mutable_additional_bindings(google_api_HttpRule* msg, size_t* size) {
412 upb_MiniTableField field = {11, UPB_SIZE(12, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
413 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__api__HttpRule_msg_init);
414 upb_Array* arr = upb_Message_GetMutableArray(UPB_UPCAST(msg), &field);
415 if (arr) {
416 if (size) *size = arr->UPB_PRIVATE(size);
417 return (google_api_HttpRule**)upb_Array_MutableDataPtr(arr);
418 } else {
419 if (size) *size = 0;
420 return NULL;
421 }
422 }
google_api_HttpRule_resize_additional_bindings(google_api_HttpRule * msg,size_t size,upb_Arena * arena)423 UPB_INLINE google_api_HttpRule** google_api_HttpRule_resize_additional_bindings(google_api_HttpRule* msg, size_t size, upb_Arena* arena) {
424 upb_MiniTableField field = {11, UPB_SIZE(12, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
425 return (google_api_HttpRule**)upb_Message_ResizeArrayUninitialized(UPB_UPCAST(msg),
426 &field, size, arena);
427 }
google_api_HttpRule_add_additional_bindings(google_api_HttpRule * msg,upb_Arena * arena)428 UPB_INLINE struct google_api_HttpRule* google_api_HttpRule_add_additional_bindings(google_api_HttpRule* msg, upb_Arena* arena) {
429 upb_MiniTableField field = {11, UPB_SIZE(12, 64), 0, 1, 11, (int)kUpb_FieldMode_Array | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
430 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__api__HttpRule_msg_init);
431 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
432 UPB_UPCAST(msg), &field, arena);
433 if (!arr || !UPB_PRIVATE(_upb_Array_ResizeUninitialized)(
434 arr, arr->UPB_PRIVATE(size) + 1, arena)) {
435 return NULL;
436 }
437 struct google_api_HttpRule* sub = (struct google_api_HttpRule*)_upb_Message_New(&google__api__HttpRule_msg_init, arena);
438 if (!arr || !sub) return NULL;
439 UPB_PRIVATE(_upb_Array_Set)
440 (arr, arr->UPB_PRIVATE(size) - 1, &sub, sizeof(sub));
441 return sub;
442 }
google_api_HttpRule_set_response_body(google_api_HttpRule * msg,upb_StringView value)443 UPB_INLINE void google_api_HttpRule_set_response_body(google_api_HttpRule *msg, upb_StringView value) {
444 const upb_MiniTableField field = {12, UPB_SIZE(40, 72), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
445 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
446 }
447
448 /* google.api.CustomHttpPattern */
449
google_api_CustomHttpPattern_new(upb_Arena * arena)450 UPB_INLINE google_api_CustomHttpPattern* google_api_CustomHttpPattern_new(upb_Arena* arena) {
451 return (google_api_CustomHttpPattern*)_upb_Message_New(&google__api__CustomHttpPattern_msg_init, arena);
452 }
google_api_CustomHttpPattern_parse(const char * buf,size_t size,upb_Arena * arena)453 UPB_INLINE google_api_CustomHttpPattern* google_api_CustomHttpPattern_parse(const char* buf, size_t size, upb_Arena* arena) {
454 google_api_CustomHttpPattern* ret = google_api_CustomHttpPattern_new(arena);
455 if (!ret) return NULL;
456 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__api__CustomHttpPattern_msg_init, NULL, 0, arena) !=
457 kUpb_DecodeStatus_Ok) {
458 return NULL;
459 }
460 return ret;
461 }
google_api_CustomHttpPattern_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)462 UPB_INLINE google_api_CustomHttpPattern* google_api_CustomHttpPattern_parse_ex(const char* buf, size_t size,
463 const upb_ExtensionRegistry* extreg,
464 int options, upb_Arena* arena) {
465 google_api_CustomHttpPattern* ret = google_api_CustomHttpPattern_new(arena);
466 if (!ret) return NULL;
467 if (upb_Decode(buf, size, UPB_UPCAST(ret), &google__api__CustomHttpPattern_msg_init, extreg, options,
468 arena) != kUpb_DecodeStatus_Ok) {
469 return NULL;
470 }
471 return ret;
472 }
google_api_CustomHttpPattern_serialize(const google_api_CustomHttpPattern * msg,upb_Arena * arena,size_t * len)473 UPB_INLINE char* google_api_CustomHttpPattern_serialize(const google_api_CustomHttpPattern* msg, upb_Arena* arena, size_t* len) {
474 char* ptr;
475 (void)upb_Encode(UPB_UPCAST(msg), &google__api__CustomHttpPattern_msg_init, 0, arena, &ptr, len);
476 return ptr;
477 }
google_api_CustomHttpPattern_serialize_ex(const google_api_CustomHttpPattern * msg,int options,upb_Arena * arena,size_t * len)478 UPB_INLINE char* google_api_CustomHttpPattern_serialize_ex(const google_api_CustomHttpPattern* msg, int options,
479 upb_Arena* arena, size_t* len) {
480 char* ptr;
481 (void)upb_Encode(UPB_UPCAST(msg), &google__api__CustomHttpPattern_msg_init, options, arena, &ptr, len);
482 return ptr;
483 }
google_api_CustomHttpPattern_clear_kind(google_api_CustomHttpPattern * msg)484 UPB_INLINE void google_api_CustomHttpPattern_clear_kind(google_api_CustomHttpPattern* msg) {
485 const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
486 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
487 }
google_api_CustomHttpPattern_kind(const google_api_CustomHttpPattern * msg)488 UPB_INLINE upb_StringView google_api_CustomHttpPattern_kind(const google_api_CustomHttpPattern* msg) {
489 upb_StringView default_val = upb_StringView_FromString("");
490 upb_StringView ret;
491 const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
492 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
493 &default_val, &ret);
494 return ret;
495 }
google_api_CustomHttpPattern_clear_path(google_api_CustomHttpPattern * msg)496 UPB_INLINE void google_api_CustomHttpPattern_clear_path(google_api_CustomHttpPattern* msg) {
497 const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
498 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
499 }
google_api_CustomHttpPattern_path(const google_api_CustomHttpPattern * msg)500 UPB_INLINE upb_StringView google_api_CustomHttpPattern_path(const google_api_CustomHttpPattern* msg) {
501 upb_StringView default_val = upb_StringView_FromString("");
502 upb_StringView ret;
503 const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
504 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
505 &default_val, &ret);
506 return ret;
507 }
508
google_api_CustomHttpPattern_set_kind(google_api_CustomHttpPattern * msg,upb_StringView value)509 UPB_INLINE void google_api_CustomHttpPattern_set_kind(google_api_CustomHttpPattern *msg, upb_StringView value) {
510 const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
511 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
512 }
google_api_CustomHttpPattern_set_path(google_api_CustomHttpPattern * msg,upb_StringView value)513 UPB_INLINE void google_api_CustomHttpPattern_set_path(google_api_CustomHttpPattern *msg, upb_StringView value) {
514 const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
515 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
516 }
517
518 #ifdef __cplusplus
519 } /* extern "C" */
520 #endif
521
522 #include "upb/port/undef.inc"
523
524 #endif /* GOOGLE_API_HTTP_PROTO_UPB_H__UPB_H_ */
525