GRPC Core  9.0.0
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/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;
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 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 
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); }
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 
52  return (google_api_HttpRule**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
53 }
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 }
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 }
65  UPB_FIELD_AT(msg, bool, UPB_SIZE(0, 0)) = value;
66 }
67 
68 /* google.api.HttpRule */
69 
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 }
73 UPB_INLINE google_api_HttpRule *google_api_HttpRule_parse(const char *buf, size_t size,
74  upb_arena *arena) {
76  return (ret && upb_decode(buf, size, ret, &google_api_HttpRule_msginit, arena)) ? ret : NULL;
77 }
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 {
92 
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)); }
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); }
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(""))); }
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); }
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(""))); }
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); }
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(""))); }
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); }
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(""))); }
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); }
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(""))); }
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)); }
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); }
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); }
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); }
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 
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 }
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 }
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 }
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 }
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 }
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 }
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 }
132  UPB_WRITE_ONEOF(msg, google_api_CustomHttpPattern*, UPB_SIZE(28, 56), value, UPB_SIZE(36, 72), 8);
133 }
136  if (sub == NULL) {
137  sub = (struct google_api_CustomHttpPattern*)upb_msg_new(&google_api_CustomHttpPattern_msginit, arena);
138  if (!sub) return NULL;
140  }
141  return sub;
142 }
144  return (google_api_HttpRule**)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
145 }
147  return (google_api_HttpRule**)_upb_array_resize_accessor(msg, UPB_SIZE(24, 48), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
148 }
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 }
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 
164 }
165 UPB_INLINE google_api_CustomHttpPattern *google_api_CustomHttpPattern_parse(const char *buf, size_t size,
166  upb_arena *arena) {
168  return (ret && upb_decode(buf, size, ret, &google_api_CustomHttpPattern_msginit, arena)) ? ret : NULL;
169 }
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 
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)); }
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 
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 }
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_ */
UPB_INLINE bool google_api_Http_fully_decode_reserved_expansion(const google_api_Http *msg)
Definition: http.upb.h:49
UPB_INLINE google_api_HttpRule ** google_api_Http_mutable_rules(google_api_Http *msg, size_t *len)
Definition: http.upb.h:51
UPB_INLINE google_api_HttpRule_pattern_oneofcases google_api_HttpRule_pattern_case(const google_api_HttpRule *msg)
Definition: http.upb.h:91
UPB_INLINE bool google_api_HttpRule_has_custom(const google_api_HttpRule *msg)
Definition: http.upb.h:105
UPB_INLINE bool google_api_HttpRule_has_put(const google_api_HttpRule *msg)
Definition: http.upb.h:96
UPB_INLINE void google_api_HttpRule_set_selector(google_api_HttpRule *msg, upb_strview value)
Definition: http.upb.h:110
UPB_INLINE void google_api_CustomHttpPattern_set_path(google_api_CustomHttpPattern *msg, upb_strview value)
Definition: http.upb.h:180
UPB_INLINE upb_strview google_api_HttpRule_response_body(const google_api_HttpRule *msg)
Definition: http.upb.h:108
UPB_INLINE void google_api_HttpRule_set_custom(google_api_HttpRule *msg, google_api_CustomHttpPattern *value)
Definition: http.upb.h:131
UPB_INLINE upb_strview google_api_HttpRule_selector(const google_api_HttpRule *msg)
Definition: http.upb.h:93
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:122
UPB_INLINE struct google_api_CustomHttpPattern * google_api_HttpRule_mutable_custom(google_api_HttpRule *msg, upb_arena *arena)
Definition: http.upb.h:134
UPB_INLINE void google_api_HttpRule_set_response_body(google_api_HttpRule *msg, upb_strview value)
Definition: http.upb.h:156
UPB_INLINE char * google_api_CustomHttpPattern_serialize(const google_api_CustomHttpPattern *msg, upb_arena *arena, size_t *len)
Definition: http.upb.h:170
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:146
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:177
UPB_INLINE upb_strview google_api_HttpRule_post(const google_api_HttpRule *msg)
Definition: http.upb.h:99
UPB_INLINE void google_api_HttpRule_set_put(google_api_HttpRule *msg, upb_strview value)
Definition: http.upb.h:116
UPB_INLINE void google_api_HttpRule_set_get(google_api_HttpRule *msg, upb_strview value)
Definition: http.upb.h:113
UPB_INLINE google_api_HttpRule * google_api_HttpRule_parse(const char *buf, size_t size, upb_arena *arena)
Definition: http.upb.h:73
UPB_INLINE upb_strview google_api_CustomHttpPattern_kind(const google_api_CustomHttpPattern *msg)
Definition: http.upb.h:174
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:175
UPB_INLINE struct google_api_HttpRule * google_api_Http_add_rules(google_api_Http *msg, upb_arena *arena)
Definition: http.upb.h:57
UPB_INLINE void google_api_HttpRule_set_patch(google_api_HttpRule *msg, upb_strview value)
Definition: http.upb.h:125
UPB_INLINE const google_api_HttpRule *const * google_api_HttpRule_additional_bindings(const google_api_HttpRule *msg, size_t *len)
Definition: http.upb.h:107
UPB_INLINE const google_api_HttpRule *const * google_api_Http_rules(const google_api_Http *msg, size_t *len)
Definition: http.upb.h:48
UPB_INLINE google_api_HttpRule ** google_api_Http_resize_rules(google_api_Http *msg, size_t len, upb_arena *arena)
Definition: http.upb.h:54
UPB_INLINE void google_api_HttpRule_set_body(google_api_HttpRule *msg, upb_strview value)
Definition: http.upb.h:128
UPB_INLINE upb_strview google_api_HttpRule_put(const google_api_HttpRule *msg)
Definition: http.upb.h:97
struct google_api_CustomHttpPattern google_api_CustomHttpPattern
Definition: http.upb.h:28
google_api_HttpRule_pattern_oneofcases
Definition: http.upb.h:82
@ google_api_HttpRule_pattern_delete
Definition: http.upb.h:86
@ google_api_HttpRule_pattern_put
Definition: http.upb.h:84
@ google_api_HttpRule_pattern_post
Definition: http.upb.h:85
@ google_api_HttpRule_pattern_get
Definition: http.upb.h:83
@ google_api_HttpRule_pattern_patch
Definition: http.upb.h:87
@ google_api_HttpRule_pattern_custom
Definition: http.upb.h:88
@ google_api_HttpRule_pattern_NOT_SET
Definition: http.upb.h:89
UPB_INLINE upb_strview google_api_HttpRule_get(const google_api_HttpRule *msg)
Definition: http.upb.h:95
UPB_INLINE google_api_CustomHttpPattern * google_api_CustomHttpPattern_new(upb_arena *arena)
Definition: http.upb.h:162
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:143
UPB_INLINE bool google_api_HttpRule_has_delete(const google_api_HttpRule *msg)
Definition: http.upb.h:100
UPB_INLINE bool google_api_HttpRule_has_get(const google_api_HttpRule *msg)
Definition: http.upb.h:94
UPB_INLINE struct google_api_HttpRule * google_api_HttpRule_add_additional_bindings(google_api_HttpRule *msg, upb_arena *arena)
Definition: http.upb.h:149
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:106
UPB_INLINE bool google_api_HttpRule_has_post(const google_api_HttpRule *msg)
Definition: http.upb.h:98
UPB_INLINE upb_strview google_api_HttpRule_body(const google_api_HttpRule *msg)
Definition: http.upb.h:104
UPB_INLINE void google_api_HttpRule_set_post(google_api_HttpRule *msg, upb_strview value)
Definition: http.upb.h:119
UPB_INLINE google_api_CustomHttpPattern * google_api_CustomHttpPattern_parse(const char *buf, size_t size, upb_arena *arena)
Definition: http.upb.h:165
UPB_INLINE upb_strview google_api_HttpRule_patch(const google_api_HttpRule *msg)
Definition: http.upb.h:103
UPB_INLINE char * google_api_HttpRule_serialize(const google_api_HttpRule *msg, upb_arena *arena, size_t *len)
Definition: http.upb.h:78
UPB_INLINE bool google_api_HttpRule_has_patch(const google_api_HttpRule *msg)
Definition: http.upb.h:102
UPB_INLINE void google_api_Http_set_fully_decode_reserved_expansion(google_api_Http *msg, bool value)
Definition: http.upb.h:64
UPB_INLINE upb_strview google_api_HttpRule_delete(const google_api_HttpRule *msg)
Definition: http.upb.h:101
UPB_INLINE google_api_HttpRule * google_api_HttpRule_new(upb_arena *arena)
Definition: http.upb.h:70
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:44