1 /* This file was generated by upbc (the upb compiler) from the input
2 * file:
3 *
4 * google/api/httpbody.proto
5 *
6 * Do not edit -- your changes will be discarded when the file is
7 * regenerated. */
8
9 #ifndef GOOGLE_API_HTTPBODY_PROTO_UPB_H_
10 #define GOOGLE_API_HTTPBODY_PROTO_UPB_H_
11
12 #include "upb/collections/array_internal.h"
13 #include "upb/collections/map_gencode_util.h"
14 #include "upb/message/accessors.h"
15 #include "upb/message/internal.h"
16 #include "upb/mini_table/enum_internal.h"
17 #include "upb/wire/decode.h"
18 #include "upb/wire/decode_fast.h"
19 #include "upb/wire/encode.h"
20
21 // Must be last.
22 #include "upb/port/def.inc"
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 typedef struct google_api_HttpBody google_api_HttpBody;
29 extern const upb_MiniTable google_api_HttpBody_msg_init;
30 struct google_protobuf_Any;
31 extern const upb_MiniTable google_protobuf_Any_msg_init;
32
33
34
35 /* google.api.HttpBody */
36
google_api_HttpBody_new(upb_Arena * arena)37 UPB_INLINE google_api_HttpBody* google_api_HttpBody_new(upb_Arena* arena) {
38 return (google_api_HttpBody*)_upb_Message_New(&google_api_HttpBody_msg_init, arena);
39 }
google_api_HttpBody_parse(const char * buf,size_t size,upb_Arena * arena)40 UPB_INLINE google_api_HttpBody* google_api_HttpBody_parse(const char* buf, size_t size, upb_Arena* arena) {
41 google_api_HttpBody* ret = google_api_HttpBody_new(arena);
42 if (!ret) return NULL;
43 if (upb_Decode(buf, size, ret, &google_api_HttpBody_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
44 return NULL;
45 }
46 return ret;
47 }
google_api_HttpBody_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)48 UPB_INLINE google_api_HttpBody* google_api_HttpBody_parse_ex(const char* buf, size_t size,
49 const upb_ExtensionRegistry* extreg,
50 int options, upb_Arena* arena) {
51 google_api_HttpBody* ret = google_api_HttpBody_new(arena);
52 if (!ret) return NULL;
53 if (upb_Decode(buf, size, ret, &google_api_HttpBody_msg_init, extreg, options, arena) !=
54 kUpb_DecodeStatus_Ok) {
55 return NULL;
56 }
57 return ret;
58 }
google_api_HttpBody_serialize(const google_api_HttpBody * msg,upb_Arena * arena,size_t * len)59 UPB_INLINE char* google_api_HttpBody_serialize(const google_api_HttpBody* msg, upb_Arena* arena, size_t* len) {
60 char* ptr;
61 (void)upb_Encode(msg, &google_api_HttpBody_msg_init, 0, arena, &ptr, len);
62 return ptr;
63 }
google_api_HttpBody_serialize_ex(const google_api_HttpBody * msg,int options,upb_Arena * arena,size_t * len)64 UPB_INLINE char* google_api_HttpBody_serialize_ex(const google_api_HttpBody* msg, int options,
65 upb_Arena* arena, size_t* len) {
66 char* ptr;
67 (void)upb_Encode(msg, &google_api_HttpBody_msg_init, options, arena, &ptr, len);
68 return ptr;
69 }
google_api_HttpBody_clear_content_type(google_api_HttpBody * msg)70 UPB_INLINE void google_api_HttpBody_clear_content_type(google_api_HttpBody* msg) {
71 const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
72 _upb_Message_ClearNonExtensionField(msg, &field);
73 }
google_api_HttpBody_content_type(const google_api_HttpBody * msg)74 UPB_INLINE upb_StringView google_api_HttpBody_content_type(const google_api_HttpBody* msg) {
75 upb_StringView default_val = upb_StringView_FromString("");
76 upb_StringView ret;
77 const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
78 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
79 return ret;
80 }
google_api_HttpBody_clear_data(google_api_HttpBody * msg)81 UPB_INLINE void google_api_HttpBody_clear_data(google_api_HttpBody* msg) {
82 const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
83 _upb_Message_ClearNonExtensionField(msg, &field);
84 }
google_api_HttpBody_data(const google_api_HttpBody * msg)85 UPB_INLINE upb_StringView google_api_HttpBody_data(const google_api_HttpBody* msg) {
86 upb_StringView default_val = upb_StringView_FromString("");
87 upb_StringView ret;
88 const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
89 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
90 return ret;
91 }
google_api_HttpBody_clear_extensions(google_api_HttpBody * msg)92 UPB_INLINE void google_api_HttpBody_clear_extensions(google_api_HttpBody* msg) {
93 const upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
94 _upb_Message_ClearNonExtensionField(msg, &field);
95 }
google_api_HttpBody_extensions(const google_api_HttpBody * msg,size_t * size)96 UPB_INLINE const struct google_protobuf_Any* const* google_api_HttpBody_extensions(const google_api_HttpBody* msg, size_t* size) {
97 const upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
98 const upb_Array* arr = upb_Message_GetArray(msg, &field);
99 if (arr) {
100 if (size) *size = arr->size;
101 return (const struct google_protobuf_Any* const*)_upb_array_constptr(arr);
102 } else {
103 if (size) *size = 0;
104 return NULL;
105 }
106 }
_google_api_HttpBody_extensions_upb_array(const google_api_HttpBody * msg,size_t * size)107 UPB_INLINE const upb_Array* _google_api_HttpBody_extensions_upb_array(const google_api_HttpBody* msg, size_t* size) {
108 const upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
109 const upb_Array* arr = upb_Message_GetArray(msg, &field);
110 if (size) {
111 *size = arr ? arr->size : 0;
112 }
113 return arr;
114 }
_google_api_HttpBody_extensions_mutable_upb_array(const google_api_HttpBody * msg,size_t * size,upb_Arena * arena)115 UPB_INLINE upb_Array* _google_api_HttpBody_extensions_mutable_upb_array(const google_api_HttpBody* msg, size_t* size, upb_Arena* arena) {
116 const upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
117 upb_Array* arr = upb_Message_GetOrCreateMutableArray(
118 (upb_Message*)msg, &field, arena);
119 if (size) {
120 *size = arr ? arr->size : 0;
121 }
122 return arr;
123 }
google_api_HttpBody_has_extensions(const google_api_HttpBody * msg)124 UPB_INLINE bool google_api_HttpBody_has_extensions(const google_api_HttpBody* msg) {
125 size_t size;
126 google_api_HttpBody_extensions(msg, &size);
127 return size != 0;
128 }
129
google_api_HttpBody_set_content_type(google_api_HttpBody * msg,upb_StringView value)130 UPB_INLINE void google_api_HttpBody_set_content_type(google_api_HttpBody *msg, upb_StringView value) {
131 const upb_MiniTableField field = {1, UPB_SIZE(4, 0), 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
132 _upb_Message_SetNonExtensionField(msg, &field, &value);
133 }
google_api_HttpBody_set_data(google_api_HttpBody * msg,upb_StringView value)134 UPB_INLINE void google_api_HttpBody_set_data(google_api_HttpBody *msg, upb_StringView value) {
135 const upb_MiniTableField field = {2, UPB_SIZE(12, 16), 0, kUpb_NoSub, 12, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
136 _upb_Message_SetNonExtensionField(msg, &field, &value);
137 }
google_api_HttpBody_mutable_extensions(google_api_HttpBody * msg,size_t * size)138 UPB_INLINE struct google_protobuf_Any** google_api_HttpBody_mutable_extensions(google_api_HttpBody* msg, size_t* size) {
139 upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
140 upb_Array* arr = upb_Message_GetMutableArray(msg, &field);
141 if (arr) {
142 if (size) *size = arr->size;
143 return (struct google_protobuf_Any**)_upb_array_ptr(arr);
144 } else {
145 if (size) *size = 0;
146 return NULL;
147 }
148 }
google_api_HttpBody_resize_extensions(google_api_HttpBody * msg,size_t size,upb_Arena * arena)149 UPB_INLINE struct google_protobuf_Any** google_api_HttpBody_resize_extensions(google_api_HttpBody* msg, size_t size, upb_Arena* arena) {
150 upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
151 return (struct google_protobuf_Any**)upb_Message_ResizeArray(msg, &field, size, arena);
152 }
google_api_HttpBody_add_extensions(google_api_HttpBody * msg,upb_Arena * arena)153 UPB_INLINE struct google_protobuf_Any* google_api_HttpBody_add_extensions(google_api_HttpBody* msg, upb_Arena* arena) {
154 upb_MiniTableField field = {3, UPB_SIZE(0, 32), 0, 0, 11, kUpb_FieldMode_Array | (UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
155 upb_Array* arr = upb_Message_GetOrCreateMutableArray(msg, &field, arena);
156 if (!arr || !_upb_Array_ResizeUninitialized(arr, arr->size + 1, arena)) {
157 return NULL;
158 }
159 struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msg_init, arena);
160 if (!arr || !sub) return NULL;
161 _upb_Array_Set(arr, arr->size - 1, &sub, sizeof(sub));
162 return sub;
163 }
164
165 extern const upb_MiniTableFile google_api_httpbody_proto_upb_file_layout;
166
167 #ifdef __cplusplus
168 } /* extern "C" */
169 #endif
170
171 #include "upb/port/undef.inc"
172
173 #endif /* GOOGLE_API_HTTPBODY_PROTO_UPB_H_ */
174