• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/encode.h"
15 
16 #include "upb/port_def.inc"
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 struct google_api_Http;
23 struct google_api_HttpRule;
24 struct google_api_CustomHttpPattern;
25 typedef struct google_api_Http google_api_Http;
26 typedef struct google_api_HttpRule google_api_HttpRule;
27 typedef struct google_api_CustomHttpPattern google_api_CustomHttpPattern;
28 extern const upb_msglayout google_api_Http_msginit;
29 extern const upb_msglayout google_api_HttpRule_msginit;
30 extern const upb_msglayout google_api_CustomHttpPattern_msginit;
31 
32 
33 /* google.api.Http */
34 
google_api_Http_new(upb_arena * arena)35 UPB_INLINE google_api_Http *google_api_Http_new(upb_arena *arena) {
36   return (google_api_Http *)_upb_msg_new(&google_api_Http_msginit, arena);
37 }
google_api_Http_parse(const char * buf,size_t size,upb_arena * arena)38 UPB_INLINE google_api_Http *google_api_Http_parse(const char *buf, size_t size,
39                         upb_arena *arena) {
40   google_api_Http *ret = google_api_Http_new(arena);
41   return (ret && upb_decode(buf, size, ret, &google_api_Http_msginit, arena)) ? ret : NULL;
42 }
google_api_Http_serialize(const google_api_Http * msg,upb_arena * arena,size_t * len)43 UPB_INLINE char *google_api_Http_serialize(const google_api_Http *msg, upb_arena *arena, size_t *len) {
44   return upb_encode(msg, &google_api_Http_msginit, arena, len);
45 }
46 
google_api_Http_has_rules(const google_api_Http * msg)47 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)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_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
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_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_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 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_PTR_AT(msg, UPB_SIZE(36, 72), int32_t); }
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_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
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_getoneofcase(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_getoneofcase(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_getoneofcase(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_getoneofcase(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_getoneofcase(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_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
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_getoneofcase(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_has_additional_bindings(const google_api_HttpRule * msg)107 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)108 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)109 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); }
110 
google_api_HttpRule_set_selector(google_api_HttpRule * msg,upb_strview value)111 UPB_INLINE void google_api_HttpRule_set_selector(google_api_HttpRule *msg, upb_strview value) {
112   *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
113 }
google_api_HttpRule_set_get(google_api_HttpRule * msg,upb_strview value)114 UPB_INLINE void google_api_HttpRule_set_get(google_api_HttpRule *msg, upb_strview value) {
115   UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 2);
116 }
google_api_HttpRule_set_put(google_api_HttpRule * msg,upb_strview value)117 UPB_INLINE void google_api_HttpRule_set_put(google_api_HttpRule *msg, upb_strview value) {
118   UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 3);
119 }
google_api_HttpRule_set_post(google_api_HttpRule * msg,upb_strview value)120 UPB_INLINE void google_api_HttpRule_set_post(google_api_HttpRule *msg, upb_strview value) {
121   UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 4);
122 }
google_api_HttpRule_set_delete(google_api_HttpRule * msg,upb_strview value)123 UPB_INLINE void google_api_HttpRule_set_delete(google_api_HttpRule *msg, upb_strview value) {
124   UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 5);
125 }
google_api_HttpRule_set_patch(google_api_HttpRule * msg,upb_strview value)126 UPB_INLINE void google_api_HttpRule_set_patch(google_api_HttpRule *msg, upb_strview value) {
127   UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 6);
128 }
google_api_HttpRule_set_body(google_api_HttpRule * msg,upb_strview value)129 UPB_INLINE void google_api_HttpRule_set_body(google_api_HttpRule *msg, upb_strview value) {
130   *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
131 }
google_api_HttpRule_set_custom(google_api_HttpRule * msg,google_api_CustomHttpPattern * value)132 UPB_INLINE void google_api_HttpRule_set_custom(google_api_HttpRule *msg, google_api_CustomHttpPattern* value) {
133   UPB_WRITE_ONEOF(msg, google_api_CustomHttpPattern*, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 8);
134 }
google_api_HttpRule_mutable_custom(google_api_HttpRule * msg,upb_arena * arena)135 UPB_INLINE struct google_api_CustomHttpPattern* google_api_HttpRule_mutable_custom(google_api_HttpRule *msg, upb_arena *arena) {
136   struct google_api_CustomHttpPattern* sub = (struct google_api_CustomHttpPattern*)google_api_HttpRule_custom(msg);
137   if (sub == NULL) {
138     sub = (struct google_api_CustomHttpPattern*)_upb_msg_new(&google_api_CustomHttpPattern_msginit, arena);
139     if (!sub) return NULL;
140     google_api_HttpRule_set_custom(msg, sub);
141   }
142   return sub;
143 }
google_api_HttpRule_mutable_additional_bindings(google_api_HttpRule * msg,size_t * len)144 UPB_INLINE google_api_HttpRule** google_api_HttpRule_mutable_additional_bindings(google_api_HttpRule *msg, size_t *len) {
145   return (google_api_HttpRule**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
146 }
google_api_HttpRule_resize_additional_bindings(google_api_HttpRule * msg,size_t len,upb_arena * arena)147 UPB_INLINE google_api_HttpRule** google_api_HttpRule_resize_additional_bindings(google_api_HttpRule *msg, size_t len, upb_arena *arena) {
148   return (google_api_HttpRule**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_TYPE_MESSAGE, arena);
149 }
google_api_HttpRule_add_additional_bindings(google_api_HttpRule * msg,upb_arena * arena)150 UPB_INLINE struct google_api_HttpRule* google_api_HttpRule_add_additional_bindings(google_api_HttpRule *msg, upb_arena *arena) {
151   struct google_api_HttpRule* sub = (struct google_api_HttpRule*)_upb_msg_new(&google_api_HttpRule_msginit, arena);
152   bool ok = _upb_array_append_accessor(
153       msg, UPB_SIZE(24, 48), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
154   if (!ok) return NULL;
155   return sub;
156 }
google_api_HttpRule_set_response_body(google_api_HttpRule * msg,upb_strview value)157 UPB_INLINE void google_api_HttpRule_set_response_body(google_api_HttpRule *msg, upb_strview value) {
158   *UPB_PTR_AT(msg, UPB_SIZE(16, 32), upb_strview) = value;
159 }
160 
161 /* google.api.CustomHttpPattern */
162 
google_api_CustomHttpPattern_new(upb_arena * arena)163 UPB_INLINE google_api_CustomHttpPattern *google_api_CustomHttpPattern_new(upb_arena *arena) {
164   return (google_api_CustomHttpPattern *)_upb_msg_new(&google_api_CustomHttpPattern_msginit, arena);
165 }
google_api_CustomHttpPattern_parse(const char * buf,size_t size,upb_arena * arena)166 UPB_INLINE google_api_CustomHttpPattern *google_api_CustomHttpPattern_parse(const char *buf, size_t size,
167                         upb_arena *arena) {
168   google_api_CustomHttpPattern *ret = google_api_CustomHttpPattern_new(arena);
169   return (ret && upb_decode(buf, size, ret, &google_api_CustomHttpPattern_msginit, arena)) ? ret : NULL;
170 }
google_api_CustomHttpPattern_serialize(const google_api_CustomHttpPattern * msg,upb_arena * arena,size_t * len)171 UPB_INLINE char *google_api_CustomHttpPattern_serialize(const google_api_CustomHttpPattern *msg, upb_arena *arena, size_t *len) {
172   return upb_encode(msg, &google_api_CustomHttpPattern_msginit, arena, len);
173 }
174 
google_api_CustomHttpPattern_kind(const google_api_CustomHttpPattern * msg)175 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)176 UPB_INLINE upb_strview google_api_CustomHttpPattern_path(const google_api_CustomHttpPattern *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview); }
177 
google_api_CustomHttpPattern_set_kind(google_api_CustomHttpPattern * msg,upb_strview value)178 UPB_INLINE void google_api_CustomHttpPattern_set_kind(google_api_CustomHttpPattern *msg, upb_strview value) {
179   *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
180 }
google_api_CustomHttpPattern_set_path(google_api_CustomHttpPattern * msg,upb_strview value)181 UPB_INLINE void google_api_CustomHttpPattern_set_path(google_api_CustomHttpPattern *msg, upb_strview value) {
182   *UPB_PTR_AT(msg, UPB_SIZE(8, 16), upb_strview) = value;
183 }
184 
185 #ifdef __cplusplus
186 }  /* extern "C" */
187 #endif
188 
189 #include "upb/port_undef.inc"
190 
191 #endif  /* GOOGLE_API_HTTP_PROTO_UPB_H_ */
192