1 /* This file was generated by upbc (the upb compiler) from the input
2 * file:
3 *
4 * src/proto/grpc/health/v1/health.proto
5 *
6 * Do not edit -- your changes will be discarded when the file is
7 * regenerated. */
8
9 #ifndef SRC_PROTO_GRPC_HEALTH_V1_HEALTH_PROTO_UPB_H_
10 #define SRC_PROTO_GRPC_HEALTH_V1_HEALTH_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 grpc_health_v1_HealthCheckRequest;
24 struct grpc_health_v1_HealthCheckResponse;
25 typedef struct grpc_health_v1_HealthCheckRequest grpc_health_v1_HealthCheckRequest;
26 typedef struct grpc_health_v1_HealthCheckResponse grpc_health_v1_HealthCheckResponse;
27 extern const upb_msglayout grpc_health_v1_HealthCheckRequest_msginit;
28 extern const upb_msglayout grpc_health_v1_HealthCheckResponse_msginit;
29
30 typedef enum {
31 grpc_health_v1_HealthCheckResponse_UNKNOWN = 0,
32 grpc_health_v1_HealthCheckResponse_SERVING = 1,
33 grpc_health_v1_HealthCheckResponse_NOT_SERVING = 2,
34 grpc_health_v1_HealthCheckResponse_SERVICE_UNKNOWN = 3
35 } grpc_health_v1_HealthCheckResponse_ServingStatus;
36
37
38 /* grpc.health.v1.HealthCheckRequest */
39
grpc_health_v1_HealthCheckRequest_new(upb_arena * arena)40 UPB_INLINE grpc_health_v1_HealthCheckRequest *grpc_health_v1_HealthCheckRequest_new(upb_arena *arena) {
41 return (grpc_health_v1_HealthCheckRequest *)_upb_msg_new(&grpc_health_v1_HealthCheckRequest_msginit, arena);
42 }
grpc_health_v1_HealthCheckRequest_parse(const char * buf,size_t size,upb_arena * arena)43 UPB_INLINE grpc_health_v1_HealthCheckRequest *grpc_health_v1_HealthCheckRequest_parse(const char *buf, size_t size,
44 upb_arena *arena) {
45 grpc_health_v1_HealthCheckRequest *ret = grpc_health_v1_HealthCheckRequest_new(arena);
46 return (ret && upb_decode(buf, size, ret, &grpc_health_v1_HealthCheckRequest_msginit, arena)) ? ret : NULL;
47 }
grpc_health_v1_HealthCheckRequest_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)48 UPB_INLINE grpc_health_v1_HealthCheckRequest *grpc_health_v1_HealthCheckRequest_parse_ex(const char *buf, size_t size,
49 upb_arena *arena, int options) {
50 grpc_health_v1_HealthCheckRequest *ret = grpc_health_v1_HealthCheckRequest_new(arena);
51 return (ret && _upb_decode(buf, size, ret, &grpc_health_v1_HealthCheckRequest_msginit, arena, options))
52 ? ret : NULL;
53 }
grpc_health_v1_HealthCheckRequest_serialize(const grpc_health_v1_HealthCheckRequest * msg,upb_arena * arena,size_t * len)54 UPB_INLINE char *grpc_health_v1_HealthCheckRequest_serialize(const grpc_health_v1_HealthCheckRequest *msg, upb_arena *arena, size_t *len) {
55 return upb_encode(msg, &grpc_health_v1_HealthCheckRequest_msginit, arena, len);
56 }
57
grpc_health_v1_HealthCheckRequest_service(const grpc_health_v1_HealthCheckRequest * msg)58 UPB_INLINE upb_strview grpc_health_v1_HealthCheckRequest_service(const grpc_health_v1_HealthCheckRequest *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
59
grpc_health_v1_HealthCheckRequest_set_service(grpc_health_v1_HealthCheckRequest * msg,upb_strview value)60 UPB_INLINE void grpc_health_v1_HealthCheckRequest_set_service(grpc_health_v1_HealthCheckRequest *msg, upb_strview value) {
61 *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
62 }
63
64 /* grpc.health.v1.HealthCheckResponse */
65
grpc_health_v1_HealthCheckResponse_new(upb_arena * arena)66 UPB_INLINE grpc_health_v1_HealthCheckResponse *grpc_health_v1_HealthCheckResponse_new(upb_arena *arena) {
67 return (grpc_health_v1_HealthCheckResponse *)_upb_msg_new(&grpc_health_v1_HealthCheckResponse_msginit, arena);
68 }
grpc_health_v1_HealthCheckResponse_parse(const char * buf,size_t size,upb_arena * arena)69 UPB_INLINE grpc_health_v1_HealthCheckResponse *grpc_health_v1_HealthCheckResponse_parse(const char *buf, size_t size,
70 upb_arena *arena) {
71 grpc_health_v1_HealthCheckResponse *ret = grpc_health_v1_HealthCheckResponse_new(arena);
72 return (ret && upb_decode(buf, size, ret, &grpc_health_v1_HealthCheckResponse_msginit, arena)) ? ret : NULL;
73 }
grpc_health_v1_HealthCheckResponse_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)74 UPB_INLINE grpc_health_v1_HealthCheckResponse *grpc_health_v1_HealthCheckResponse_parse_ex(const char *buf, size_t size,
75 upb_arena *arena, int options) {
76 grpc_health_v1_HealthCheckResponse *ret = grpc_health_v1_HealthCheckResponse_new(arena);
77 return (ret && _upb_decode(buf, size, ret, &grpc_health_v1_HealthCheckResponse_msginit, arena, options))
78 ? ret : NULL;
79 }
grpc_health_v1_HealthCheckResponse_serialize(const grpc_health_v1_HealthCheckResponse * msg,upb_arena * arena,size_t * len)80 UPB_INLINE char *grpc_health_v1_HealthCheckResponse_serialize(const grpc_health_v1_HealthCheckResponse *msg, upb_arena *arena, size_t *len) {
81 return upb_encode(msg, &grpc_health_v1_HealthCheckResponse_msginit, arena, len);
82 }
83
grpc_health_v1_HealthCheckResponse_status(const grpc_health_v1_HealthCheckResponse * msg)84 UPB_INLINE int32_t grpc_health_v1_HealthCheckResponse_status(const grpc_health_v1_HealthCheckResponse *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }
85
grpc_health_v1_HealthCheckResponse_set_status(grpc_health_v1_HealthCheckResponse * msg,int32_t value)86 UPB_INLINE void grpc_health_v1_HealthCheckResponse_set_status(grpc_health_v1_HealthCheckResponse *msg, int32_t value) {
87 *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
88 }
89
90 #ifdef __cplusplus
91 } /* extern "C" */
92 #endif
93
94 #include "upb/port_undef.inc"
95
96 #endif /* SRC_PROTO_GRPC_HEALTH_V1_HEALTH_PROTO_UPB_H_ */
97