1 /* This file was generated by upbc (the upb compiler) from the input
2 * file:
3 *
4 * google/rpc/status.proto
5 *
6 * Do not edit -- your changes will be discarded when the file is
7 * regenerated. */
8
9 #ifndef GOOGLE_RPC_STATUS_PROTO_UPB_H_
10 #define GOOGLE_RPC_STATUS_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_rpc_Status;
24 typedef struct google_rpc_Status google_rpc_Status;
25 extern const upb_msglayout google_rpc_Status_msginit;
26 struct google_protobuf_Any;
27 extern const upb_msglayout google_protobuf_Any_msginit;
28
29
30 /* google.rpc.Status */
31
google_rpc_Status_new(upb_arena * arena)32 UPB_INLINE google_rpc_Status *google_rpc_Status_new(upb_arena *arena) {
33 return (google_rpc_Status *)_upb_msg_new(&google_rpc_Status_msginit, arena);
34 }
google_rpc_Status_parse(const char * buf,size_t size,upb_arena * arena)35 UPB_INLINE google_rpc_Status *google_rpc_Status_parse(const char *buf, size_t size,
36 upb_arena *arena) {
37 google_rpc_Status *ret = google_rpc_Status_new(arena);
38 return (ret && upb_decode(buf, size, ret, &google_rpc_Status_msginit, arena)) ? ret : NULL;
39 }
google_rpc_Status_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)40 UPB_INLINE google_rpc_Status *google_rpc_Status_parse_ex(const char *buf, size_t size,
41 upb_arena *arena, int options) {
42 google_rpc_Status *ret = google_rpc_Status_new(arena);
43 return (ret && _upb_decode(buf, size, ret, &google_rpc_Status_msginit, arena, options))
44 ? ret : NULL;
45 }
google_rpc_Status_serialize(const google_rpc_Status * msg,upb_arena * arena,size_t * len)46 UPB_INLINE char *google_rpc_Status_serialize(const google_rpc_Status *msg, upb_arena *arena, size_t *len) {
47 return upb_encode(msg, &google_rpc_Status_msginit, arena, len);
48 }
49
google_rpc_Status_code(const google_rpc_Status * msg)50 UPB_INLINE int32_t google_rpc_Status_code(const google_rpc_Status *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
google_rpc_Status_message(const google_rpc_Status * msg)51 UPB_INLINE upb_strview google_rpc_Status_message(const google_rpc_Status *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
google_rpc_Status_has_details(const google_rpc_Status * msg)52 UPB_INLINE bool google_rpc_Status_has_details(const google_rpc_Status *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
google_rpc_Status_details(const google_rpc_Status * msg,size_t * len)53 UPB_INLINE const struct google_protobuf_Any* const* google_rpc_Status_details(const google_rpc_Status *msg, size_t *len) { return (const struct google_protobuf_Any* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
54
google_rpc_Status_set_code(google_rpc_Status * msg,int32_t value)55 UPB_INLINE void google_rpc_Status_set_code(google_rpc_Status *msg, int32_t value) {
56 *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
57 }
google_rpc_Status_set_message(google_rpc_Status * msg,upb_strview value)58 UPB_INLINE void google_rpc_Status_set_message(google_rpc_Status *msg, upb_strview value) {
59 *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
60 }
google_rpc_Status_mutable_details(google_rpc_Status * msg,size_t * len)61 UPB_INLINE struct google_protobuf_Any** google_rpc_Status_mutable_details(google_rpc_Status *msg, size_t *len) {
62 return (struct google_protobuf_Any**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
63 }
google_rpc_Status_resize_details(google_rpc_Status * msg,size_t len,upb_arena * arena)64 UPB_INLINE struct google_protobuf_Any** google_rpc_Status_resize_details(google_rpc_Status *msg, size_t len, upb_arena *arena) {
65 return (struct google_protobuf_Any**)_upb_array_resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
66 }
google_rpc_Status_add_details(google_rpc_Status * msg,upb_arena * arena)67 UPB_INLINE struct google_protobuf_Any* google_rpc_Status_add_details(google_rpc_Status *msg, upb_arena *arena) {
68 struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
69 bool ok = _upb_array_append_accessor2(
70 msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
71 if (!ok) return NULL;
72 return sub;
73 }
74
75 #ifdef __cplusplus
76 } /* extern "C" */
77 #endif
78
79 #include "upb/port_undef.inc"
80
81 #endif /* GOOGLE_RPC_STATUS_PROTO_UPB_H_ */
82