1 /* This file was generated by upbc (the upb compiler) from the input
2 * file:
3 *
4 * envoy/api/v2/core/http_uri.proto
5 *
6 * Do not edit -- your changes will be discarded when the file is
7 * regenerated. */
8
9 #ifndef ENVOY_API_V2_CORE_HTTP_URI_PROTO_UPB_H_
10 #define ENVOY_API_V2_CORE_HTTP_URI_PROTO_UPB_H_
11
12 #include "upb/msg.h"
13 #include "upb/decode.h"
14 #include "upb/encode.h"
15
16 #include "upb/port_def.inc"
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 struct envoy_api_v2_core_HttpUri;
23 typedef struct envoy_api_v2_core_HttpUri envoy_api_v2_core_HttpUri;
24 extern const upb_msglayout envoy_api_v2_core_HttpUri_msginit;
25 struct google_protobuf_Duration;
26 extern const upb_msglayout google_protobuf_Duration_msginit;
27
28
29 /* envoy.api.v2.core.HttpUri */
30
envoy_api_v2_core_HttpUri_new(upb_arena * arena)31 UPB_INLINE envoy_api_v2_core_HttpUri *envoy_api_v2_core_HttpUri_new(upb_arena *arena) {
32 return (envoy_api_v2_core_HttpUri *)_upb_msg_new(&envoy_api_v2_core_HttpUri_msginit, arena);
33 }
envoy_api_v2_core_HttpUri_parse(const char * buf,size_t size,upb_arena * arena)34 UPB_INLINE envoy_api_v2_core_HttpUri *envoy_api_v2_core_HttpUri_parse(const char *buf, size_t size,
35 upb_arena *arena) {
36 envoy_api_v2_core_HttpUri *ret = envoy_api_v2_core_HttpUri_new(arena);
37 return (ret && upb_decode(buf, size, ret, &envoy_api_v2_core_HttpUri_msginit, arena)) ? ret : NULL;
38 }
envoy_api_v2_core_HttpUri_serialize(const envoy_api_v2_core_HttpUri * msg,upb_arena * arena,size_t * len)39 UPB_INLINE char *envoy_api_v2_core_HttpUri_serialize(const envoy_api_v2_core_HttpUri *msg, upb_arena *arena, size_t *len) {
40 return upb_encode(msg, &envoy_api_v2_core_HttpUri_msginit, arena, len);
41 }
42
43 typedef enum {
44 envoy_api_v2_core_HttpUri_http_upstream_type_cluster = 2,
45 envoy_api_v2_core_HttpUri_http_upstream_type_NOT_SET = 0
46 } envoy_api_v2_core_HttpUri_http_upstream_type_oneofcases;
envoy_api_v2_core_HttpUri_http_upstream_type_case(const envoy_api_v2_core_HttpUri * msg)47 UPB_INLINE envoy_api_v2_core_HttpUri_http_upstream_type_oneofcases envoy_api_v2_core_HttpUri_http_upstream_type_case(const envoy_api_v2_core_HttpUri* msg) { return (envoy_api_v2_core_HttpUri_http_upstream_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(20, 40), int32_t); }
48
envoy_api_v2_core_HttpUri_uri(const envoy_api_v2_core_HttpUri * msg)49 UPB_INLINE upb_strview envoy_api_v2_core_HttpUri_uri(const envoy_api_v2_core_HttpUri *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview); }
envoy_api_v2_core_HttpUri_has_cluster(const envoy_api_v2_core_HttpUri * msg)50 UPB_INLINE bool envoy_api_v2_core_HttpUri_has_cluster(const envoy_api_v2_core_HttpUri *msg) { return _upb_getoneofcase(msg, UPB_SIZE(20, 40)) == 2; }
envoy_api_v2_core_HttpUri_cluster(const envoy_api_v2_core_HttpUri * msg)51 UPB_INLINE upb_strview envoy_api_v2_core_HttpUri_cluster(const envoy_api_v2_core_HttpUri *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), UPB_SIZE(20, 40), 2, upb_strview_make("", strlen(""))); }
envoy_api_v2_core_HttpUri_has_timeout(const envoy_api_v2_core_HttpUri * msg)52 UPB_INLINE bool envoy_api_v2_core_HttpUri_has_timeout(const envoy_api_v2_core_HttpUri *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
envoy_api_v2_core_HttpUri_timeout(const envoy_api_v2_core_HttpUri * msg)53 UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_core_HttpUri_timeout(const envoy_api_v2_core_HttpUri *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_Duration*); }
54
envoy_api_v2_core_HttpUri_set_uri(envoy_api_v2_core_HttpUri * msg,upb_strview value)55 UPB_INLINE void envoy_api_v2_core_HttpUri_set_uri(envoy_api_v2_core_HttpUri *msg, upb_strview value) {
56 *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_strview) = value;
57 }
envoy_api_v2_core_HttpUri_set_cluster(envoy_api_v2_core_HttpUri * msg,upb_strview value)58 UPB_INLINE void envoy_api_v2_core_HttpUri_set_cluster(envoy_api_v2_core_HttpUri *msg, upb_strview value) {
59 UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(12, 24), value, UPB_SIZE(20, 40), 2);
60 }
envoy_api_v2_core_HttpUri_set_timeout(envoy_api_v2_core_HttpUri * msg,struct google_protobuf_Duration * value)61 UPB_INLINE void envoy_api_v2_core_HttpUri_set_timeout(envoy_api_v2_core_HttpUri *msg, struct google_protobuf_Duration* value) {
62 *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_Duration*) = value;
63 }
envoy_api_v2_core_HttpUri_mutable_timeout(envoy_api_v2_core_HttpUri * msg,upb_arena * arena)64 UPB_INLINE struct google_protobuf_Duration* envoy_api_v2_core_HttpUri_mutable_timeout(envoy_api_v2_core_HttpUri *msg, upb_arena *arena) {
65 struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_api_v2_core_HttpUri_timeout(msg);
66 if (sub == NULL) {
67 sub = (struct google_protobuf_Duration*)_upb_msg_new(&google_protobuf_Duration_msginit, arena);
68 if (!sub) return NULL;
69 envoy_api_v2_core_HttpUri_set_timeout(msg, sub);
70 }
71 return sub;
72 }
73
74 #ifdef __cplusplus
75 } /* extern "C" */
76 #endif
77
78 #include "upb/port_undef.inc"
79
80 #endif /* ENVOY_API_V2_CORE_HTTP_URI_PROTO_UPB_H_ */
81