1 /* This file was generated by upbc (the upb compiler) from the input
2 * file:
3 *
4 * google/api/http.proto
5 *
6 * Do not edit -- your changes will be discarded when the file is
7 * regenerated. */
8
9 #ifndef GOOGLE_API_HTTP_PROTO_UPB_H_
10 #define GOOGLE_API_HTTP_PROTO_UPB_H_
11
12 #include "upb/msg_internal.h"
13 #include "upb/decode.h"
14 #include "upb/decode_fast.h"
15 #include "upb/encode.h"
16
17 #include "upb/port_def.inc"
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 struct google_api_Http;
24 struct google_api_HttpRule;
25 struct google_api_CustomHttpPattern;
26 typedef struct google_api_Http google_api_Http;
27 typedef struct google_api_HttpRule google_api_HttpRule;
28 typedef struct google_api_CustomHttpPattern google_api_CustomHttpPattern;
29 extern const upb_msglayout google_api_Http_msginit;
30 extern const upb_msglayout google_api_HttpRule_msginit;
31 extern const upb_msglayout google_api_CustomHttpPattern_msginit;
32
33
34 /* google.api.Http */
35
google_api_Http_new(upb_arena * arena)36 UPB_INLINE google_api_Http *google_api_Http_new(upb_arena *arena) {
37 return (google_api_Http *)_upb_msg_new(&google_api_Http_msginit, arena);
38 }
google_api_Http_parse(const char * buf,size_t size,upb_arena * arena)39 UPB_INLINE google_api_Http *google_api_Http_parse(const char *buf, size_t size,
40 upb_arena *arena) {
41 google_api_Http *ret = google_api_Http_new(arena);
42 if (!ret) return NULL;
43 if (!upb_decode(buf, size, ret, &google_api_Http_msginit, arena)) return NULL;
44 return ret;
45 }
google_api_Http_parse_ex(const char * buf,size_t size,const upb_extreg * extreg,int options,upb_arena * arena)46 UPB_INLINE google_api_Http *google_api_Http_parse_ex(const char *buf, size_t size,
47 const upb_extreg *extreg, int options,
48 upb_arena *arena) {
49 google_api_Http *ret = google_api_Http_new(arena);
50 if (!ret) return NULL;
51 if (!_upb_decode(buf, size, ret, &google_api_Http_msginit, extreg, options, arena)) {
52 return NULL;
53 }
54 return ret;
55 }
google_api_Http_serialize(const google_api_Http * msg,upb_arena * arena,size_t * len)56 UPB_INLINE char *google_api_Http_serialize(const google_api_Http *msg, upb_arena *arena, size_t *len) {
57 return upb_encode(msg, &google_api_Http_msginit, arena, len);
58 }
59
google_api_Http_has_rules(const google_api_Http * msg)60 UPB_INLINE bool google_api_Http_has_rules(const google_api_Http *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
google_api_Http_rules(const google_api_Http * msg,size_t * len)61 UPB_INLINE const google_api_HttpRule* const* google_api_Http_rules(const google_api_Http *msg, size_t *len) { return (const google_api_HttpRule* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }
google_api_Http_fully_decode_reserved_expansion(const google_api_Http * msg)62 UPB_INLINE bool google_api_Http_fully_decode_reserved_expansion(const google_api_Http *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
63
google_api_Http_mutable_rules(google_api_Http * msg,size_t * len)64 UPB_INLINE google_api_HttpRule** google_api_Http_mutable_rules(google_api_Http *msg, size_t *len) {
65 return (google_api_HttpRule**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
66 }
google_api_Http_resize_rules(google_api_Http * msg,size_t len,upb_arena * arena)67 UPB_INLINE google_api_HttpRule** google_api_Http_resize_rules(google_api_Http *msg, size_t len, upb_arena *arena) {
68 return (google_api_HttpRule**)_upb_array_resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
69 }
google_api_Http_add_rules(google_api_Http * msg,upb_arena * arena)70 UPB_INLINE struct google_api_HttpRule* google_api_Http_add_rules(google_api_Http *msg, upb_arena *arena) {
71 struct google_api_HttpRule* sub = (struct google_api_HttpRule*)_upb_msg_new(&google_api_HttpRule_msginit, arena);
72 bool ok = _upb_array_append_accessor2(
73 msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
74 if (!ok) return NULL;
75 return sub;
76 }
google_api_Http_set_fully_decode_reserved_expansion(google_api_Http * msg,bool value)77 UPB_INLINE void google_api_Http_set_fully_decode_reserved_expansion(google_api_Http *msg, bool value) {
78 *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
79 }
80
81 /* google.api.HttpRule */
82
google_api_HttpRule_new(upb_arena * arena)83 UPB_INLINE google_api_HttpRule *google_api_HttpRule_new(upb_arena *arena) {
84 return (google_api_HttpRule *)_upb_msg_new(&google_api_HttpRule_msginit, arena);
85 }
google_api_HttpRule_parse(const char * buf,size_t size,upb_arena * arena)86 UPB_INLINE google_api_HttpRule *google_api_HttpRule_parse(const char *buf, size_t size,
87 upb_arena *arena) {
88 google_api_HttpRule *ret = google_api_HttpRule_new(arena);
89 if (!ret) return NULL;
90 if (!upb_decode(buf, size, ret, &google_api_HttpRule_msginit, arena)) return NULL;
91 return ret;
92 }
google_api_HttpRule_parse_ex(const char * buf,size_t size,const upb_extreg * extreg,int options,upb_arena * arena)93 UPB_INLINE google_api_HttpRule *google_api_HttpRule_parse_ex(const char *buf, size_t size,
94 const upb_extreg *extreg, int options,
95 upb_arena *arena) {
96 google_api_HttpRule *ret = google_api_HttpRule_new(arena);
97 if (!ret) return NULL;
98 if (!_upb_decode(buf, size, ret, &google_api_HttpRule_msginit, extreg, options, arena)) {
99 return NULL;
100 }
101 return ret;
102 }
google_api_HttpRule_serialize(const google_api_HttpRule * msg,upb_arena * arena,size_t * len)103 UPB_INLINE char *google_api_HttpRule_serialize(const google_api_HttpRule *msg, upb_arena *arena, size_t *len) {
104 return upb_encode(msg, &google_api_HttpRule_msginit, arena, len);
105 }
106
107 typedef enum {
108 google_api_HttpRule_pattern_get = 2,
109 google_api_HttpRule_pattern_put = 3,
110 google_api_HttpRule_pattern_post = 4,
111 google_api_HttpRule_pattern_delete = 5,
112 google_api_HttpRule_pattern_patch = 6,
113 google_api_HttpRule_pattern_custom = 8,
114 google_api_HttpRule_pattern_NOT_SET = 0
115 } google_api_HttpRule_pattern_oneofcases;
google_api_HttpRule_pattern_case(const google_api_HttpRule * msg)116 UPB_INLINE google_api_HttpRule_pattern_oneofcases google_api_HttpRule_pattern_case(const google_api_HttpRule* msg) { return (google_api_HttpRule_pattern_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(36, 72), int32_t); }
117
google_api_HttpRule_selector(const google_api_HttpRule * msg)118 UPB_INLINE upb_strview google_api_HttpRule_selector(const google_api_HttpRule *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
google_api_HttpRule_has_get(const google_api_HttpRule * msg)119 UPB_INLINE bool google_api_HttpRule_has_get(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 2; }
google_api_HttpRule_get(const google_api_HttpRule * msg)120 UPB_INLINE upb_strview google_api_HttpRule_get(const google_api_HttpRule *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), UPB_SIZE(36, 72), 2, upb_strview_make("", strlen(""))); }
google_api_HttpRule_has_put(const google_api_HttpRule * msg)121 UPB_INLINE bool google_api_HttpRule_has_put(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 3; }
google_api_HttpRule_put(const google_api_HttpRule * msg)122 UPB_INLINE upb_strview google_api_HttpRule_put(const google_api_HttpRule *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), UPB_SIZE(36, 72), 3, upb_strview_make("", strlen(""))); }
google_api_HttpRule_has_post(const google_api_HttpRule * msg)123 UPB_INLINE bool google_api_HttpRule_has_post(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 4; }
google_api_HttpRule_post(const google_api_HttpRule * msg)124 UPB_INLINE upb_strview google_api_HttpRule_post(const google_api_HttpRule *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), UPB_SIZE(36, 72), 4, upb_strview_make("", strlen(""))); }
google_api_HttpRule_has_delete(const google_api_HttpRule * msg)125 UPB_INLINE bool google_api_HttpRule_has_delete(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 5; }
google_api_HttpRule_delete(const google_api_HttpRule * msg)126 UPB_INLINE upb_strview google_api_HttpRule_delete(const google_api_HttpRule *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), UPB_SIZE(36, 72), 5, upb_strview_make("", strlen(""))); }
google_api_HttpRule_has_patch(const google_api_HttpRule * msg)127 UPB_INLINE bool google_api_HttpRule_has_patch(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 6; }
google_api_HttpRule_patch(const google_api_HttpRule * msg)128 UPB_INLINE upb_strview google_api_HttpRule_patch(const google_api_HttpRule *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), UPB_SIZE(36, 72), 6, upb_strview_make("", strlen(""))); }
google_api_HttpRule_body(const google_api_HttpRule * msg)129 UPB_INLINE upb_strview google_api_HttpRule_body(const google_api_HttpRule *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
google_api_HttpRule_has_custom(const google_api_HttpRule * msg)130 UPB_INLINE bool google_api_HttpRule_has_custom(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 8; }
google_api_HttpRule_custom(const google_api_HttpRule * msg)131 UPB_INLINE const google_api_CustomHttpPattern* google_api_HttpRule_custom(const google_api_HttpRule *msg) { return UPB_READ_ONEOF(msg, const google_api_CustomHttpPattern*, UPB_SIZE(28, 56), UPB_SIZE(36, 72), 8, NULL); }
google_api_HttpRule_has_additional_bindings(const google_api_HttpRule * msg)132 UPB_INLINE bool google_api_HttpRule_has_additional_bindings(const google_api_HttpRule *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(24, 48)); }
google_api_HttpRule_additional_bindings(const google_api_HttpRule * msg,size_t * len)133 UPB_INLINE const google_api_HttpRule* const* google_api_HttpRule_additional_bindings(const google_api_HttpRule *msg, size_t *len) { return (const google_api_HttpRule* const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
google_api_HttpRule_response_body(const google_api_HttpRule * msg)134 UPB_INLINE upb_strview google_api_HttpRule_response_body(const google_api_HttpRule *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview); }
135
google_api_HttpRule_set_selector(google_api_HttpRule * msg,upb_strview value)136 UPB_INLINE void google_api_HttpRule_set_selector(google_api_HttpRule *msg, upb_strview value) {
137 *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
138 }
google_api_HttpRule_set_get(google_api_HttpRule * msg,upb_strview value)139 UPB_INLINE void google_api_HttpRule_set_get(google_api_HttpRule *msg, upb_strview value) {
140 UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 2);
141 }
google_api_HttpRule_set_put(google_api_HttpRule * msg,upb_strview value)142 UPB_INLINE void google_api_HttpRule_set_put(google_api_HttpRule *msg, upb_strview value) {
143 UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 3);
144 }
google_api_HttpRule_set_post(google_api_HttpRule * msg,upb_strview value)145 UPB_INLINE void google_api_HttpRule_set_post(google_api_HttpRule *msg, upb_strview value) {
146 UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 4);
147 }
google_api_HttpRule_set_delete(google_api_HttpRule * msg,upb_strview value)148 UPB_INLINE void google_api_HttpRule_set_delete(google_api_HttpRule *msg, upb_strview value) {
149 UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 5);
150 }
google_api_HttpRule_set_patch(google_api_HttpRule * msg,upb_strview value)151 UPB_INLINE void google_api_HttpRule_set_patch(google_api_HttpRule *msg, upb_strview value) {
152 UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 6);
153 }
google_api_HttpRule_set_body(google_api_HttpRule * msg,upb_strview value)154 UPB_INLINE void google_api_HttpRule_set_body(google_api_HttpRule *msg, upb_strview value) {
155 *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
156 }
google_api_HttpRule_set_custom(google_api_HttpRule * msg,google_api_CustomHttpPattern * value)157 UPB_INLINE void google_api_HttpRule_set_custom(google_api_HttpRule *msg, google_api_CustomHttpPattern* value) {
158 UPB_WRITE_ONEOF(msg, google_api_CustomHttpPattern*, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 8);
159 }
google_api_HttpRule_mutable_custom(google_api_HttpRule * msg,upb_arena * arena)160 UPB_INLINE struct google_api_CustomHttpPattern* google_api_HttpRule_mutable_custom(google_api_HttpRule *msg, upb_arena *arena) {
161 struct google_api_CustomHttpPattern* sub = (struct google_api_CustomHttpPattern*)google_api_HttpRule_custom(msg);
162 if (sub == NULL) {
163 sub = (struct google_api_CustomHttpPattern*)_upb_msg_new(&google_api_CustomHttpPattern_msginit, arena);
164 if (!sub) return NULL;
165 google_api_HttpRule_set_custom(msg, sub);
166 }
167 return sub;
168 }
google_api_HttpRule_mutable_additional_bindings(google_api_HttpRule * msg,size_t * len)169 UPB_INLINE google_api_HttpRule** google_api_HttpRule_mutable_additional_bindings(google_api_HttpRule *msg, size_t *len) {
170 return (google_api_HttpRule**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
171 }
google_api_HttpRule_resize_additional_bindings(google_api_HttpRule * msg,size_t len,upb_arena * arena)172 UPB_INLINE google_api_HttpRule** google_api_HttpRule_resize_additional_bindings(google_api_HttpRule *msg, size_t len, upb_arena *arena) {
173 return (google_api_HttpRule**)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena);
174 }
google_api_HttpRule_add_additional_bindings(google_api_HttpRule * msg,upb_arena * arena)175 UPB_INLINE struct google_api_HttpRule* google_api_HttpRule_add_additional_bindings(google_api_HttpRule *msg, upb_arena *arena) {
176 struct google_api_HttpRule* sub = (struct google_api_HttpRule*)_upb_msg_new(&google_api_HttpRule_msginit, arena);
177 bool ok = _upb_array_append_accessor2(
178 msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena);
179 if (!ok) return NULL;
180 return sub;
181 }
google_api_HttpRule_set_response_body(google_api_HttpRule * msg,upb_strview value)182 UPB_INLINE void google_api_HttpRule_set_response_body(google_api_HttpRule *msg, upb_strview value) {
183 *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview) = value;
184 }
185
186 /* google.api.CustomHttpPattern */
187
google_api_CustomHttpPattern_new(upb_arena * arena)188 UPB_INLINE google_api_CustomHttpPattern *google_api_CustomHttpPattern_new(upb_arena *arena) {
189 return (google_api_CustomHttpPattern *)_upb_msg_new(&google_api_CustomHttpPattern_msginit, arena);
190 }
google_api_CustomHttpPattern_parse(const char * buf,size_t size,upb_arena * arena)191 UPB_INLINE google_api_CustomHttpPattern *google_api_CustomHttpPattern_parse(const char *buf, size_t size,
192 upb_arena *arena) {
193 google_api_CustomHttpPattern *ret = google_api_CustomHttpPattern_new(arena);
194 if (!ret) return NULL;
195 if (!upb_decode(buf, size, ret, &google_api_CustomHttpPattern_msginit, arena)) return NULL;
196 return ret;
197 }
google_api_CustomHttpPattern_parse_ex(const char * buf,size_t size,const upb_extreg * extreg,int options,upb_arena * arena)198 UPB_INLINE google_api_CustomHttpPattern *google_api_CustomHttpPattern_parse_ex(const char *buf, size_t size,
199 const upb_extreg *extreg, int options,
200 upb_arena *arena) {
201 google_api_CustomHttpPattern *ret = google_api_CustomHttpPattern_new(arena);
202 if (!ret) return NULL;
203 if (!_upb_decode(buf, size, ret, &google_api_CustomHttpPattern_msginit, extreg, options, arena)) {
204 return NULL;
205 }
206 return ret;
207 }
google_api_CustomHttpPattern_serialize(const google_api_CustomHttpPattern * msg,upb_arena * arena,size_t * len)208 UPB_INLINE char *google_api_CustomHttpPattern_serialize(const google_api_CustomHttpPattern *msg, upb_arena *arena, size_t *len) {
209 return upb_encode(msg, &google_api_CustomHttpPattern_msginit, arena, len);
210 }
211
google_api_CustomHttpPattern_kind(const google_api_CustomHttpPattern * msg)212 UPB_INLINE upb_strview google_api_CustomHttpPattern_kind(const google_api_CustomHttpPattern *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
google_api_CustomHttpPattern_path(const google_api_CustomHttpPattern * msg)213 UPB_INLINE upb_strview google_api_CustomHttpPattern_path(const google_api_CustomHttpPattern *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
214
google_api_CustomHttpPattern_set_kind(google_api_CustomHttpPattern * msg,upb_strview value)215 UPB_INLINE void google_api_CustomHttpPattern_set_kind(google_api_CustomHttpPattern *msg, upb_strview value) {
216 *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
217 }
google_api_CustomHttpPattern_set_path(google_api_CustomHttpPattern * msg,upb_strview value)218 UPB_INLINE void google_api_CustomHttpPattern_set_path(google_api_CustomHttpPattern *msg, upb_strview value) {
219 *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
220 }
221
222 #ifdef __cplusplus
223 } /* extern "C" */
224 #endif
225
226 #include "upb/port_undef.inc"
227
228 #endif /* GOOGLE_API_HTTP_PROTO_UPB_H_ */
229