| 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_internal.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_MiniTable google_rpc_Status_msginit; |
| 26 |
struct google_protobuf_Any; |
| 27 |
extern const upb_MiniTable google_protobuf_Any_msginit; |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
/* google.rpc.Status */ |
| 32 |
|
| 33 |
UPB_INLINE google_rpc_Status* google_rpc_Status_new(upb_Arena* arena) { |
| 34 |
return (google_rpc_Status*)_upb_Message_New(&google_rpc_Status_msginit, arena); |
| 35 |
} |
| 36 |
UPB_INLINE google_rpc_Status* google_rpc_Status_parse(const char* buf, size_t size, upb_Arena* arena) { |
| 37 |
google_rpc_Status* ret = google_rpc_Status_new(arena); |
| 38 |
if (!ret) return NULL; |
| 39 |
if (upb_Decode(buf, size, ret, &google_rpc_Status_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { |
| 40 |
return NULL; |
| 41 |
} |
| 42 |
return ret; |
| 43 |
} |
| 44 |
UPB_INLINE google_rpc_Status* google_rpc_Status_parse_ex(const char* buf, size_t size, |
| 45 |
const upb_ExtensionRegistry* extreg, |
| 46 |
int options, upb_Arena* arena) { |
| 47 |
google_rpc_Status* ret = google_rpc_Status_new(arena); |
| 48 |
if (!ret) return NULL; |
| 49 |
if (upb_Decode(buf, size, ret, &google_rpc_Status_msginit, extreg, options, arena) != |
| 50 |
kUpb_DecodeStatus_Ok) { |
| 51 |
return NULL; |
| 52 |
} |
| 53 |
return ret; |
| 54 |
} |
| 55 |
UPB_INLINE char* google_rpc_Status_serialize(const google_rpc_Status* msg, upb_Arena* arena, size_t* len) { |
| 56 |
char* ptr; |
| 57 |
(void)upb_Encode(msg, &google_rpc_Status_msginit, 0, arena, &ptr, len); |
| 58 |
return ptr; |
| 59 |
} |
| 60 |
UPB_INLINE char* google_rpc_Status_serialize_ex(const google_rpc_Status* msg, int options, |
| 61 |
upb_Arena* arena, size_t* len) { |
| 62 |
char* ptr; |
| 63 |
(void)upb_Encode(msg, &google_rpc_Status_msginit, options, arena, &ptr, len); |
| 64 |
return ptr; |
| 65 |
} |
| 66 |
UPB_INLINE void google_rpc_Status_clear_code(const google_rpc_Status* msg) { |
| 67 |
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; |
| 68 |
} |
| 69 |
UPB_INLINE int32_t google_rpc_Status_code(const google_rpc_Status* msg) { |
| 70 |
return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); |
| 71 |
} |
| 72 |
UPB_INLINE void google_rpc_Status_clear_message(const google_rpc_Status* msg) { |
| 73 |
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); |
| 74 |
} |
| 75 |
UPB_INLINE upb_StringView google_rpc_Status_message(const google_rpc_Status* msg) { |
| 76 |
return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView); |
| 77 |
} |
| 78 |
UPB_INLINE bool google_rpc_Status_has_details(const google_rpc_Status* msg) { |
| 79 |
return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); |
| 80 |
} |
| 81 |
UPB_INLINE void google_rpc_Status_clear_details(const google_rpc_Status* msg) { |
| 82 |
_upb_array_detach(msg, UPB_SIZE(12, 24)); |
| 83 |
} |
| 84 |
UPB_INLINE const struct google_protobuf_Any* const* google_rpc_Status_details(const google_rpc_Status* msg, size_t* len) { |
| 85 |
return (const struct google_protobuf_Any* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); |
| 86 |
} |
| 87 |
|
| 88 |
UPB_INLINE void google_rpc_Status_set_code(google_rpc_Status *msg, int32_t value) { |
| 89 |
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value; |
| 90 |
} |
| 91 |
UPB_INLINE void google_rpc_Status_set_message(google_rpc_Status *msg, upb_StringView value) { |
| 92 |
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_StringView) = value; |
| 93 |
} |
| 94 |
UPB_INLINE struct google_protobuf_Any** google_rpc_Status_mutable_details(google_rpc_Status* msg, size_t* len) { |
| 95 |
return (struct google_protobuf_Any**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len); |
| 96 |
} |
| 97 |
UPB_INLINE struct google_protobuf_Any** google_rpc_Status_resize_details(google_rpc_Status* msg, size_t len, upb_Arena* arena) { |
| 98 |
return (struct google_protobuf_Any**)_upb_Array_Resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena); |
| 99 |
} |
| 100 |
UPB_INLINE struct google_protobuf_Any* google_rpc_Status_add_details(google_rpc_Status* msg, upb_Arena* arena) { |
| 101 |
struct google_protobuf_Any* sub = (struct google_protobuf_Any*)_upb_Message_New(&google_protobuf_Any_msginit, arena); |
| 102 |
bool ok = _upb_Array_Append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena); |
| 103 |
if (!ok) return NULL; |
| 104 |
return sub; |
| 105 |
} |
| 106 |
|
| 107 |
extern const upb_MiniTable_File google_rpc_status_proto_upb_file_layout; |
| 108 |
|
| 109 |
#ifdef __cplusplus |
| 110 |
} /* extern "C" */ |
| 111 |
#endif |
| 112 |
|
| 113 |
#include "upb/port_undef.inc" |
| 114 |
|
| 115 |
#endif /* GOOGLE_RPC_STATUS_PROTO_UPB_H_ */ |