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