1 /* This file was generated by upbc (the upb compiler) from the input
4 * envoy/api/v2/core/http_uri.proto
6 * Do not edit -- your changes will be discarded when the file is
9 #ifndef ENVOY_API_V2_CORE_HTTP_URI_PROTO_UPB_H_
10 #define ENVOY_API_V2_CORE_HTTP_URI_PROTO_UPB_H_
12 #include "upb/generated_util.h"
14 #include "upb/decode.h"
15 #include "upb/encode.h"
17 #include "upb/port_def.inc"
23 struct envoy_api_v2_core_HttpUri;
24 typedef struct envoy_api_v2_core_HttpUri envoy_api_v2_core_HttpUri;
25 extern const upb_msglayout envoy_api_v2_core_HttpUri_msginit;
26 struct google_protobuf_Duration;
27 extern const upb_msglayout google_protobuf_Duration_msginit;
30 /* envoy.api.v2.core.HttpUri */
32 UPB_INLINE envoy_api_v2_core_HttpUri *envoy_api_v2_core_HttpUri_new(upb_arena *arena) {
33 return (envoy_api_v2_core_HttpUri *)upb_msg_new(&envoy_api_v2_core_HttpUri_msginit, arena);
35 UPB_INLINE envoy_api_v2_core_HttpUri *envoy_api_v2_core_HttpUri_parse(const char *buf, size_t size,
37 envoy_api_v2_core_HttpUri *ret = envoy_api_v2_core_HttpUri_new(arena);
38 return (ret && upb_decode(buf, size, ret, &envoy_api_v2_core_HttpUri_msginit, arena)) ? ret : NULL;
40 UPB_INLINE char *envoy_api_v2_core_HttpUri_serialize(const envoy_api_v2_core_HttpUri *msg, upb_arena *arena, size_t *len) {
41 return upb_encode(msg, &envoy_api_v2_core_HttpUri_msginit, arena, len);
45 envoy_api_v2_core_HttpUri_http_upstream_type_cluster = 2,
46 envoy_api_v2_core_HttpUri_http_upstream_type_NOT_SET = 0
47 } envoy_api_v2_core_HttpUri_http_upstream_type_oneofcases;
48 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_FIELD_AT(msg, int32_t, UPB_SIZE(20, 40)); }
50 UPB_INLINE upb_strview envoy_api_v2_core_HttpUri_uri(const envoy_api_v2_core_HttpUri *msg) { return UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)); }
51 UPB_INLINE bool envoy_api_v2_core_HttpUri_has_cluster(const envoy_api_v2_core_HttpUri *msg) { return _upb_has_oneof_field(msg, UPB_SIZE(20, 40), 2); }
52 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(""))); }
53 UPB_INLINE const struct google_protobuf_Duration* envoy_api_v2_core_HttpUri_timeout(const envoy_api_v2_core_HttpUri *msg) { return UPB_FIELD_AT(msg, const struct google_protobuf_Duration*, UPB_SIZE(8, 16)); }
55 UPB_INLINE void envoy_api_v2_core_HttpUri_set_uri(envoy_api_v2_core_HttpUri *msg, upb_strview value) {
56 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)) = 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);
61 UPB_INLINE void envoy_api_v2_core_HttpUri_set_timeout(envoy_api_v2_core_HttpUri *msg, struct google_protobuf_Duration* value) {
62 UPB_FIELD_AT(msg, struct google_protobuf_Duration*, UPB_SIZE(8, 16)) = value;
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);
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);
78 #include "upb/port_undef.inc"
80 #endif /* ENVOY_API_V2_CORE_HTTP_URI_PROTO_UPB_H_ */