GRPC C++  1.39.1
http.upb.h
Go to the documentation of this file.
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;
26 typedef struct google_api_Http google_api_Http;
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 
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 }
39 UPB_INLINE google_api_Http *google_api_Http_parse(const char *buf, size_t size,
40  upb_arena *arena) {
42  return (ret && upb_decode(buf, size, ret, &google_api_Http_msginit, arena)) ? ret : NULL;
43 }
44 UPB_INLINE google_api_Http *google_api_Http_parse_ex(const char *buf, size_t size,
45  upb_arena *arena, int options) {
47  return (ret && _upb_decode(buf, size, ret, &google_api_Http_msginit, arena, options))
48  ? ret : NULL;
49 }
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 
54 UPB_INLINE bool google_api_Http_has_rules(const google_api_Http *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
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); }
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 
59  return (google_api_HttpRule**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
60 }
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 }
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 }
72  *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
73 }
74 
75 /* google.api.HttpRule */
76 
78  return (google_api_HttpRule *)_upb_msg_new(&google_api_HttpRule_msginit, arena);
79 }
80 UPB_INLINE google_api_HttpRule *google_api_HttpRule_parse(const char *buf, size_t size,
81  upb_arena *arena) {
83  return (ret && upb_decode(buf, size, ret, &google_api_HttpRule_msginit, arena)) ? ret : NULL;
84 }
85 UPB_INLINE google_api_HttpRule *google_api_HttpRule_parse_ex(const char *buf, size_t size,
86  upb_arena *arena, int options) {
88  return (ret && _upb_decode(buf, size, ret, &google_api_HttpRule_msginit, arena, options))
89  ? ret : NULL;
90 }
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 {
105 
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); }
107 UPB_INLINE bool google_api_HttpRule_has_get(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 2; }
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(""))); }
109 UPB_INLINE bool google_api_HttpRule_has_put(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 3; }
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(""))); }
111 UPB_INLINE bool google_api_HttpRule_has_post(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 4; }
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(""))); }
113 UPB_INLINE bool google_api_HttpRule_has_delete(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 5; }
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(""))); }
115 UPB_INLINE bool google_api_HttpRule_has_patch(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 6; }
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(""))); }
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); }
118 UPB_INLINE bool google_api_HttpRule_has_custom(const google_api_HttpRule *msg) { return _upb_getoneofcase(msg, UPB_SIZE(36, 72)) == 8; }
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); }
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)); }
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); }
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 
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 }
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 }
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 }
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 }
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 }
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 }
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 }
146  UPB_WRITE_ONEOF(msg, google_api_CustomHttpPattern*, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 8);
147 }
150  if (sub == NULL) {
152  if (!sub) return NULL;
154  }
155  return sub;
156 }
158  return (google_api_HttpRule**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
159 }
161  return (google_api_HttpRule**)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(2, 3), arena);
162 }
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 }
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 
178 }
179 UPB_INLINE google_api_CustomHttpPattern *google_api_CustomHttpPattern_parse(const char *buf, size_t size,
180  upb_arena *arena) {
182  return (ret && upb_decode(buf, size, ret, &google_api_CustomHttpPattern_msginit, arena)) ? ret : NULL;
183 }
185  upb_arena *arena, int options) {
187  return (ret && _upb_decode(buf, size, ret, &google_api_CustomHttpPattern_msginit, arena, options))
188  ? ret : NULL;
189 }
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 
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); }
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 
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 }
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_ */
UPB_INLINE bool google_api_Http_fully_decode_reserved_expansion(const google_api_Http *msg)
Definition: http.upb.h:56
UPB_INLINE google_api_HttpRule ** google_api_Http_mutable_rules(google_api_Http *msg, size_t *len)
Definition: http.upb.h:58
UPB_INLINE google_api_HttpRule_pattern_oneofcases google_api_HttpRule_pattern_case(const google_api_HttpRule *msg)
Definition: http.upb.h:104
UPB_INLINE bool google_api_HttpRule_has_custom(const google_api_HttpRule *msg)
Definition: http.upb.h:118
UPB_INLINE bool google_api_HttpRule_has_put(const google_api_HttpRule *msg)
Definition: http.upb.h:109
UPB_INLINE void google_api_HttpRule_set_selector(google_api_HttpRule *msg, upb_strview value)
Definition: http.upb.h:124
UPB_INLINE void google_api_CustomHttpPattern_set_path(google_api_CustomHttpPattern *msg, upb_strview value)
Definition: http.upb.h:200
UPB_INLINE upb_strview google_api_HttpRule_response_body(const google_api_HttpRule *msg)
Definition: http.upb.h:122
UPB_INLINE google_api_CustomHttpPattern * google_api_CustomHttpPattern_parse_ex(const char *buf, size_t size, upb_arena *arena, int options)
Definition: http.upb.h:184
UPB_INLINE void google_api_HttpRule_set_custom(google_api_HttpRule *msg, google_api_CustomHttpPattern *value)
Definition: http.upb.h:145
UPB_INLINE upb_strview google_api_HttpRule_selector(const google_api_HttpRule *msg)
Definition: http.upb.h:106
struct google_api_Http google_api_Http
Definition: http.upb.h:26
const upb_msglayout google_api_HttpRule_msginit
Definition: http.upb.c:48
UPB_INLINE void google_api_HttpRule_set_delete(google_api_HttpRule *msg, upb_strview value)
Definition: http.upb.h:136
UPB_INLINE struct google_api_CustomHttpPattern * google_api_HttpRule_mutable_custom(google_api_HttpRule *msg, upb_arena *arena)
Definition: http.upb.h:148
UPB_INLINE void google_api_HttpRule_set_response_body(google_api_HttpRule *msg, upb_strview value)
Definition: http.upb.h:170
UPB_INLINE char * google_api_CustomHttpPattern_serialize(const google_api_CustomHttpPattern *msg, upb_arena *arena, size_t *len)
Definition: http.upb.h:190
UPB_INLINE google_api_HttpRule ** google_api_HttpRule_resize_additional_bindings(google_api_HttpRule *msg, size_t len, upb_arena *arena)
Definition: http.upb.h:160
UPB_INLINE google_api_Http * google_api_Http_parse_ex(const char *buf, size_t size, upb_arena *arena, int options)
Definition: http.upb.h:44
UPB_INLINE google_api_Http * google_api_Http_parse(const char *buf, size_t size, upb_arena *arena)
Definition: http.upb.h:39
UPB_INLINE void google_api_CustomHttpPattern_set_kind(google_api_CustomHttpPattern *msg, upb_strview value)
Definition: http.upb.h:197
UPB_INLINE upb_strview google_api_HttpRule_post(const google_api_HttpRule *msg)
Definition: http.upb.h:112
UPB_INLINE void google_api_HttpRule_set_put(google_api_HttpRule *msg, upb_strview value)
Definition: http.upb.h:130
UPB_INLINE void google_api_HttpRule_set_get(google_api_HttpRule *msg, upb_strview value)
Definition: http.upb.h:127
UPB_INLINE google_api_HttpRule * google_api_HttpRule_parse(const char *buf, size_t size, upb_arena *arena)
Definition: http.upb.h:80
UPB_INLINE upb_strview google_api_CustomHttpPattern_kind(const google_api_CustomHttpPattern *msg)
Definition: http.upb.h:194
const upb_msglayout google_api_Http_msginit
Definition: http.upb.c:24
UPB_INLINE upb_strview google_api_CustomHttpPattern_path(const google_api_CustomHttpPattern *msg)
Definition: http.upb.h:195
UPB_INLINE struct google_api_HttpRule * google_api_Http_add_rules(google_api_Http *msg, upb_arena *arena)
Definition: http.upb.h:64
UPB_INLINE void google_api_HttpRule_set_patch(google_api_HttpRule *msg, upb_strview value)
Definition: http.upb.h:139
UPB_INLINE bool google_api_HttpRule_has_additional_bindings(const google_api_HttpRule *msg)
Definition: http.upb.h:120
UPB_INLINE const google_api_HttpRule *const * google_api_HttpRule_additional_bindings(const google_api_HttpRule *msg, size_t *len)
Definition: http.upb.h:121
UPB_INLINE const google_api_HttpRule *const * google_api_Http_rules(const google_api_Http *msg, size_t *len)
Definition: http.upb.h:55
UPB_INLINE google_api_HttpRule ** google_api_Http_resize_rules(google_api_Http *msg, size_t len, upb_arena *arena)
Definition: http.upb.h:61
UPB_INLINE void google_api_HttpRule_set_body(google_api_HttpRule *msg, upb_strview value)
Definition: http.upb.h:142
UPB_INLINE upb_strview google_api_HttpRule_put(const google_api_HttpRule *msg)
Definition: http.upb.h:110
struct google_api_CustomHttpPattern google_api_CustomHttpPattern
Definition: http.upb.h:28
google_api_HttpRule_pattern_oneofcases
Definition: http.upb.h:95
@ google_api_HttpRule_pattern_delete
Definition: http.upb.h:99
@ google_api_HttpRule_pattern_put
Definition: http.upb.h:97
@ google_api_HttpRule_pattern_post
Definition: http.upb.h:98
@ google_api_HttpRule_pattern_get
Definition: http.upb.h:96
@ google_api_HttpRule_pattern_patch
Definition: http.upb.h:100
@ google_api_HttpRule_pattern_custom
Definition: http.upb.h:101
@ google_api_HttpRule_pattern_NOT_SET
Definition: http.upb.h:102
UPB_INLINE google_api_HttpRule * google_api_HttpRule_parse_ex(const char *buf, size_t size, upb_arena *arena, int options)
Definition: http.upb.h:85
UPB_INLINE upb_strview google_api_HttpRule_get(const google_api_HttpRule *msg)
Definition: http.upb.h:108
UPB_INLINE google_api_CustomHttpPattern * google_api_CustomHttpPattern_new(upb_arena *arena)
Definition: http.upb.h:176
UPB_INLINE google_api_Http * google_api_Http_new(upb_arena *arena)
Definition: http.upb.h:36
UPB_INLINE google_api_HttpRule ** google_api_HttpRule_mutable_additional_bindings(google_api_HttpRule *msg, size_t *len)
Definition: http.upb.h:157
UPB_INLINE bool google_api_HttpRule_has_delete(const google_api_HttpRule *msg)
Definition: http.upb.h:113
UPB_INLINE bool google_api_HttpRule_has_get(const google_api_HttpRule *msg)
Definition: http.upb.h:107
UPB_INLINE struct google_api_HttpRule * google_api_HttpRule_add_additional_bindings(google_api_HttpRule *msg, upb_arena *arena)
Definition: http.upb.h:163
const upb_msglayout google_api_CustomHttpPattern_msginit
Definition: http.upb.c:59
UPB_INLINE const google_api_CustomHttpPattern * google_api_HttpRule_custom(const google_api_HttpRule *msg)
Definition: http.upb.h:119
UPB_INLINE bool google_api_HttpRule_has_post(const google_api_HttpRule *msg)
Definition: http.upb.h:111
UPB_INLINE upb_strview google_api_HttpRule_body(const google_api_HttpRule *msg)
Definition: http.upb.h:117
UPB_INLINE void google_api_HttpRule_set_post(google_api_HttpRule *msg, upb_strview value)
Definition: http.upb.h:133
UPB_INLINE google_api_CustomHttpPattern * google_api_CustomHttpPattern_parse(const char *buf, size_t size, upb_arena *arena)
Definition: http.upb.h:179
UPB_INLINE upb_strview google_api_HttpRule_patch(const google_api_HttpRule *msg)
Definition: http.upb.h:116
UPB_INLINE bool google_api_Http_has_rules(const google_api_Http *msg)
Definition: http.upb.h:54
UPB_INLINE char * google_api_HttpRule_serialize(const google_api_HttpRule *msg, upb_arena *arena, size_t *len)
Definition: http.upb.h:91
UPB_INLINE bool google_api_HttpRule_has_patch(const google_api_HttpRule *msg)
Definition: http.upb.h:115
UPB_INLINE void google_api_Http_set_fully_decode_reserved_expansion(google_api_Http *msg, bool value)
Definition: http.upb.h:71
UPB_INLINE upb_strview google_api_HttpRule_delete(const google_api_HttpRule *msg)
Definition: http.upb.h:114
UPB_INLINE google_api_HttpRule * google_api_HttpRule_new(upb_arena *arena)
Definition: http.upb.h:77
struct google_api_HttpRule google_api_HttpRule
Definition: http.upb.h:27
UPB_INLINE char * google_api_Http_serialize(const google_api_Http *msg, upb_arena *arena, size_t *len)
Definition: http.upb.h:50
upb_arena * arena
Definition: xds_api.cc:909