GRPC Core  9.0.0
status.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/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/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_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 
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 }
35 UPB_INLINE google_rpc_Status *google_rpc_Status_parse(const char *buf, size_t size,
36  upb_arena *arena) {
38  return (ret && upb_decode(buf, size, ret, &google_rpc_Status_msginit, arena)) ? ret : NULL;
39 }
40 UPB_INLINE char *google_rpc_Status_serialize(const google_rpc_Status *msg, upb_arena *arena, size_t *len) {
41  return upb_encode(msg, &google_rpc_Status_msginit, arena, len);
42 }
43 
44 UPB_INLINE int32_t google_rpc_Status_code(const google_rpc_Status *msg) { return UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)); }
45 UPB_INLINE upb_strview google_rpc_Status_message(const google_rpc_Status *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(4, 8)); }
46 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); }
47 
48 UPB_INLINE void google_rpc_Status_set_code(google_rpc_Status *msg, int32_t value) {
49  UPB_FIELD_AT(msg, int32_t, UPB_SIZE(0, 0)) = value;
50 }
51 UPB_INLINE void google_rpc_Status_set_message(google_rpc_Status *msg, upb_strview value) {
52  UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(4, 8)) = value;
53 }
55  return (struct google_protobuf_Any**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
56 }
57 UPB_INLINE struct google_protobuf_Any** google_rpc_Status_resize_details(google_rpc_Status *msg, size_t len, upb_arena *arena) {
58  return (struct google_protobuf_Any**)_upb_array_resize_accessor(msg, UPB_SIZE(12, 24), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
59 }
60 UPB_INLINE struct google_protobuf_Any* google_rpc_Status_add_details(google_rpc_Status *msg, upb_arena *arena) {
61  struct google_protobuf_Any* sub = (struct google_protobuf_Any*)upb_msg_new(&google_protobuf_Any_msginit, arena);
62  bool ok = _upb_array_append_accessor(
63  msg, UPB_SIZE(12, 24), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
64  if (!ok) return NULL;
65  return sub;
66 }
67 
68 #ifdef __cplusplus
69 } /* extern "C" */
70 #endif
71 
72 #include "upb/port_undef.inc"
73 
74 #endif /* GOOGLE_RPC_STATUS_PROTO_UPB_H_ */
UPB_INLINE int32_t google_rpc_Status_code(const google_rpc_Status *msg)
Definition: status.upb.h:44
UPB_INLINE struct google_protobuf_Any * google_rpc_Status_add_details(google_rpc_Status *msg, upb_arena *arena)
Definition: status.upb.h:60
UPB_INLINE void google_rpc_Status_set_message(google_rpc_Status *msg, upb_strview value)
Definition: status.upb.h:51
UPB_INLINE struct google_protobuf_Any ** google_rpc_Status_mutable_details(google_rpc_Status *msg, size_t *len)
Definition: status.upb.h:54
UPB_INLINE google_rpc_Status * google_rpc_Status_new(upb_arena *arena)
Definition: status.upb.h:32
const upb_msglayout google_rpc_Status_msginit
Definition: status.upb.c:26
UPB_INLINE const struct google_protobuf_Any *const * google_rpc_Status_details(const google_rpc_Status *msg, size_t *len)
Definition: status.upb.h:46
const upb_msglayout google_protobuf_Any_msginit
Definition: any.upb.c:20
UPB_INLINE upb_strview google_rpc_Status_message(const google_rpc_Status *msg)
Definition: status.upb.h:45
UPB_INLINE char * google_rpc_Status_serialize(const google_rpc_Status *msg, upb_arena *arena, size_t *len)
Definition: status.upb.h:40
UPB_INLINE void google_rpc_Status_set_code(google_rpc_Status *msg, int32_t value)
Definition: status.upb.h:48
UPB_INLINE google_rpc_Status * google_rpc_Status_parse(const char *buf, size_t size, upb_arena *arena)
Definition: status.upb.h:35
struct google_protobuf_Any google_protobuf_Any
Definition: any.upb.h:24
struct google_rpc_Status google_rpc_Status
Definition: status.upb.h:24
UPB_INLINE struct google_protobuf_Any ** google_rpc_Status_resize_details(google_rpc_Status *msg, size_t len, upb_arena *arena)
Definition: status.upb.h:57