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.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   return (ret && upb_decode(buf, size, ret, &google_api_Http_msginit, arena)) ? ret : NULL;
43 }
google_api_Http_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)44 UPB_INLINE google_api_Http *google_api_Http_parse_ex(const char *buf, size_t size,
45                            upb_arena *arena, int options) {
46   google_api_Http *ret = google_api_Http_new(arena);
47   return (ret && _upb_decode(buf, size, ret, &google_api_Http_msginit, arena, options))
48       ? ret : NULL;
49 }
google_api_Http_serialize(const google_api_Http * msg,upb_arena * arena,size_t * len)50 UPB_INLINE char *google_api_Http_serialize(const google_api_Http *msg, upb_arena *arena, size_t *len) {
51   return upb_encode(msg, &google_api_Http_msginit, arena, len);
52 }
53 
google_api_Http_has_rules(const google_api_Http * msg)54 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)55 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)56 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); }
57 
google_api_Http_mutable_rules(google_api_Http * msg,size_t * len)58 UPB_INLINE google_api_HttpRule** google_api_Http_mutable_rules(google_api_Http *msg, size_t *len) {
59   return (google_api_HttpRule**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
60 }
google_api_Http_resize_rules(google_api_Http * msg,size_t len,upb_arena * arena)61 UPB_INLINE google_api_HttpRule** google_api_Http_resize_rules(google_api_Http *msg, size_t len, upb_arena *arena) {
62   return (google_api_HttpRule**)_upb_array_resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
63 }
google_api_Http_add_rules(google_api_Http * msg,upb_arena * arena)64 UPB_INLINE struct google_api_HttpRule* google_api_Http_add_rules(google_api_Http *msg, upb_arena *arena) {
65   struct google_api_HttpRule* sub = (struct google_api_HttpRule*)_upb_msg_new(&google_api_HttpRule_msginit, arena);
66   bool ok = _upb_array_append_accessor2(
67       msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
68   if (!ok) return NULL;
69   return sub;
70 }
google_api_Http_set_fully_decode_reserved_expansion(google_api_Http * msg,bool value)71 UPB_INLINE void google_api_Http_set_fully_decode_reserved_expansion(google_api_Http *msg, bool value) {
72   *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
73 }
74 
75 /* google.api.HttpRule */
76 
google_api_HttpRule_new(upb_arena * arena)77 UPB_INLINE google_api_HttpRule *google_api_HttpRule_new(upb_arena *arena) {
78   return (google_api_HttpRule *)_upb_msg_new(&google_api_HttpRule_msginit, arena);
79 }
google_api_HttpRule_parse(const char * buf,size_t size,upb_arena * arena)80 UPB_INLINE google_api_HttpRule *google_api_HttpRule_parse(const char *buf, size_t size,
81                         upb_arena *arena) {
82   google_api_HttpRule *ret = google_api_HttpRule_new(arena);
83   return (ret && upb_decode(buf, size, ret, &google_api_HttpRule_msginit, arena)) ? ret : NULL;
84 }
google_api_HttpRule_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)85 UPB_INLINE google_api_HttpRule *google_api_HttpRule_parse_ex(const char *buf, size_t size,
86                            upb_arena *arena, int options) {
87   google_api_HttpRule *ret = google_api_HttpRule_new(arena);
88   return (ret && _upb_decode(buf, size, ret, &google_api_HttpRule_msginit, arena, options))
89       ? ret : NULL;
90 }
google_api_HttpRule_serialize(const google_api_HttpRule * msg,upb_arena * arena,size_t * len)91 UPB_INLINE char *google_api_HttpRule_serialize(const google_api_HttpRule *msg, upb_arena *arena, size_t *len) {
92   return upb_encode(msg, &google_api_HttpRule_msginit, arena, len);
93 }
94 
95 typedef enum {
96   google_api_HttpRule_pattern_get = 2,
97   google_api_HttpRule_pattern_put = 3,
98   google_api_HttpRule_pattern_post = 4,
99   google_api_HttpRule_pattern_delete = 5,
100   google_api_HttpRule_pattern_patch = 6,
101   google_api_HttpRule_pattern_custom = 8,
102   google_api_HttpRule_pattern_NOT_SET = 0
103 } google_api_HttpRule_pattern_oneofcases;
google_api_HttpRule_pattern_case(const google_api_HttpRule * msg)104 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); }
105 
google_api_HttpRule_selector(const google_api_HttpRule * msg)106 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)107 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)108 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)109 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)110 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)111 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)112 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)113 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)114 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)115 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)116 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)117 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)118 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)119 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)120 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)121 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)122 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); }
123 
google_api_HttpRule_set_selector(google_api_HttpRule * msg,upb_strview value)124 UPB_INLINE void google_api_HttpRule_set_selector(google_api_HttpRule *msg, upb_strview value) {
125   *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
126 }
google_api_HttpRule_set_get(google_api_HttpRule * msg,upb_strview value)127 UPB_INLINE void google_api_HttpRule_set_get(google_api_HttpRule *msg, upb_strview value) {
128   UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 2);
129 }
google_api_HttpRule_set_put(google_api_HttpRule * msg,upb_strview value)130 UPB_INLINE void google_api_HttpRule_set_put(google_api_HttpRule *msg, upb_strview value) {
131   UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 3);
132 }
google_api_HttpRule_set_post(google_api_HttpRule * msg,upb_strview value)133 UPB_INLINE void google_api_HttpRule_set_post(google_api_HttpRule *msg, upb_strview value) {
134   UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 4);
135 }
google_api_HttpRule_set_delete(google_api_HttpRule * msg,upb_strview value)136 UPB_INLINE void google_api_HttpRule_set_delete(google_api_HttpRule *msg, upb_strview value) {
137   UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 5);
138 }
google_api_HttpRule_set_patch(google_api_HttpRule * msg,upb_strview value)139 UPB_INLINE void google_api_HttpRule_set_patch(google_api_HttpRule *msg, upb_strview value) {
140   UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 6);
141 }
google_api_HttpRule_set_body(google_api_HttpRule * msg,upb_strview value)142 UPB_INLINE void google_api_HttpRule_set_body(google_api_HttpRule *msg, upb_strview value) {
143   *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
144 }
google_api_HttpRule_set_custom(google_api_HttpRule * msg,google_api_CustomHttpPattern * value)145 UPB_INLINE void google_api_HttpRule_set_custom(google_api_HttpRule *msg, google_api_CustomHttpPattern* value) {
146   UPB_WRITE_ONEOF(msg, google_api_CustomHttpPattern*, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 8);
147 }
google_api_HttpRule_mutable_custom(google_api_HttpRule * msg,upb_arena * arena)148 UPB_INLINE struct google_api_CustomHttpPattern* google_api_HttpRule_mutable_custom(google_api_HttpRule *msg, upb_arena *arena) {
149   struct google_api_CustomHttpPattern* sub = (struct google_api_CustomHttpPattern*)google_api_HttpRule_custom(msg);
150   if (sub == NULL) {
151     sub = (struct google_api_CustomHttpPattern*)_upb_msg_new(&google_api_CustomHttpPattern_msginit, arena);
152     if (!sub) return NULL;
153     google_api_HttpRule_set_custom(msg, sub);
154   }
155   return sub;
156 }
google_api_HttpRule_mutable_additional_bindings(google_api_HttpRule * msg,size_t * len)157 UPB_INLINE google_api_HttpRule** google_api_HttpRule_mutable_additional_bindings(google_api_HttpRule *msg, size_t *len) {
158   return (google_api_HttpRule**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
159 }
google_api_HttpRule_resize_additional_bindings(google_api_HttpRule * msg,size_t len,upb_arena * arena)160 UPB_INLINE google_api_HttpRule** google_api_HttpRule_resize_additional_bindings(google_api_HttpRule *msg, size_t len, upb_arena *arena) {
161   return (google_api_HttpRule**)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena);
162 }
google_api_HttpRule_add_additional_bindings(google_api_HttpRule * msg,upb_arena * arena)163 UPB_INLINE struct google_api_HttpRule* google_api_HttpRule_add_additional_bindings(google_api_HttpRule *msg, upb_arena *arena) {
164   struct google_api_HttpRule* sub = (struct google_api_HttpRule*)_upb_msg_new(&google_api_HttpRule_msginit, arena);
165   bool ok = _upb_array_append_accessor2(
166       msg, UPB_SIZE(24, 48), UPB_SIZE(2, 3), &sub, arena);
167   if (!ok) return NULL;
168   return sub;
169 }
google_api_HttpRule_set_response_body(google_api_HttpRule * msg,upb_strview value)170 UPB_INLINE void google_api_HttpRule_set_response_body(google_api_HttpRule *msg, upb_strview value) {
171   *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview) = value;
172 }
173 
174 /* google.api.CustomHttpPattern */
175 
google_api_CustomHttpPattern_new(upb_arena * arena)176 UPB_INLINE google_api_CustomHttpPattern *google_api_CustomHttpPattern_new(upb_arena *arena) {
177   return (google_api_CustomHttpPattern *)_upb_msg_new(&google_api_CustomHttpPattern_msginit, arena);
178 }
google_api_CustomHttpPattern_parse(const char * buf,size_t size,upb_arena * arena)179 UPB_INLINE google_api_CustomHttpPattern *google_api_CustomHttpPattern_parse(const char *buf, size_t size,
180                         upb_arena *arena) {
181   google_api_CustomHttpPattern *ret = google_api_CustomHttpPattern_new(arena);
182   return (ret && upb_decode(buf, size, ret, &google_api_CustomHttpPattern_msginit, arena)) ? ret : NULL;
183 }
google_api_CustomHttpPattern_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)184 UPB_INLINE google_api_CustomHttpPattern *google_api_CustomHttpPattern_parse_ex(const char *buf, size_t size,
185                            upb_arena *arena, int options) {
186   google_api_CustomHttpPattern *ret = google_api_CustomHttpPattern_new(arena);
187   return (ret && _upb_decode(buf, size, ret, &google_api_CustomHttpPattern_msginit, arena, options))
188       ? ret : NULL;
189 }
google_api_CustomHttpPattern_serialize(const google_api_CustomHttpPattern * msg,upb_arena * arena,size_t * len)190 UPB_INLINE char *google_api_CustomHttpPattern_serialize(const google_api_CustomHttpPattern *msg, upb_arena *arena, size_t *len) {
191   return upb_encode(msg, &google_api_CustomHttpPattern_msginit, arena, len);
192 }
193 
google_api_CustomHttpPattern_kind(const google_api_CustomHttpPattern * msg)194 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)195 UPB_INLINE upb_strview google_api_CustomHttpPattern_path(const google_api_CustomHttpPattern *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
196 
google_api_CustomHttpPattern_set_kind(google_api_CustomHttpPattern * msg,upb_strview value)197 UPB_INLINE void google_api_CustomHttpPattern_set_kind(google_api_CustomHttpPattern *msg, upb_strview value) {
198   *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
199 }
google_api_CustomHttpPattern_set_path(google_api_CustomHttpPattern * msg,upb_strview value)200 UPB_INLINE void google_api_CustomHttpPattern_set_path(google_api_CustomHttpPattern *msg, upb_strview value) {
201   *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
202 }
203 
204 #ifdef __cplusplus
205 }  /* extern "C" */
206 #endif
207 
208 #include "upb/port_undef.inc"
209 
210 #endif  /* GOOGLE_API_HTTP_PROTO_UPB_H_ */
211