Imported Upstream version 1.41.0
[platform/upstream/grpc.git] / src / core / ext / upb-generated / envoy / type / matcher / v3 / struct.upb.h
1 /* This file was generated by upbc (the upb compiler) from the input
2  * file:
3  *
4  *     envoy/type/matcher/v3/struct.proto
5  *
6  * Do not edit -- your changes will be discarded when the file is
7  * regenerated. */
8
9 #ifndef ENVOY_TYPE_MATCHER_V3_STRUCT_PROTO_UPB_H_
10 #define ENVOY_TYPE_MATCHER_V3_STRUCT_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 envoy_type_matcher_v3_StructMatcher;
24 struct envoy_type_matcher_v3_StructMatcher_PathSegment;
25 typedef struct envoy_type_matcher_v3_StructMatcher envoy_type_matcher_v3_StructMatcher;
26 typedef struct envoy_type_matcher_v3_StructMatcher_PathSegment envoy_type_matcher_v3_StructMatcher_PathSegment;
27 extern const upb_msglayout envoy_type_matcher_v3_StructMatcher_msginit;
28 extern const upb_msglayout envoy_type_matcher_v3_StructMatcher_PathSegment_msginit;
29 struct envoy_type_matcher_v3_ValueMatcher;
30 extern const upb_msglayout envoy_type_matcher_v3_ValueMatcher_msginit;
31
32
33 /* envoy.type.matcher.v3.StructMatcher */
34
35 UPB_INLINE envoy_type_matcher_v3_StructMatcher *envoy_type_matcher_v3_StructMatcher_new(upb_arena *arena) {
36   return (envoy_type_matcher_v3_StructMatcher *)_upb_msg_new(&envoy_type_matcher_v3_StructMatcher_msginit, arena);
37 }
38 UPB_INLINE envoy_type_matcher_v3_StructMatcher *envoy_type_matcher_v3_StructMatcher_parse(const char *buf, size_t size,
39                         upb_arena *arena) {
40   envoy_type_matcher_v3_StructMatcher *ret = envoy_type_matcher_v3_StructMatcher_new(arena);
41   if (!ret) return NULL;
42   if (!upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_msginit, arena)) return NULL;
43   return ret;
44 }
45 UPB_INLINE envoy_type_matcher_v3_StructMatcher *envoy_type_matcher_v3_StructMatcher_parse_ex(const char *buf, size_t size,
46                            const upb_extreg *extreg, int options,
47                            upb_arena *arena) {
48   envoy_type_matcher_v3_StructMatcher *ret = envoy_type_matcher_v3_StructMatcher_new(arena);
49   if (!ret) return NULL;
50   if (!_upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_msginit, extreg, options, arena)) {
51     return NULL;
52   }
53   return ret;
54 }
55 UPB_INLINE char *envoy_type_matcher_v3_StructMatcher_serialize(const envoy_type_matcher_v3_StructMatcher *msg, upb_arena *arena, size_t *len) {
56   return upb_encode(msg, &envoy_type_matcher_v3_StructMatcher_msginit, arena, len);
57 }
58
59 UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_has_path(const envoy_type_matcher_v3_StructMatcher *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
60 UPB_INLINE const envoy_type_matcher_v3_StructMatcher_PathSegment* const* envoy_type_matcher_v3_StructMatcher_path(const envoy_type_matcher_v3_StructMatcher *msg, size_t *len) { return (const envoy_type_matcher_v3_StructMatcher_PathSegment* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
61 UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_has_value(const envoy_type_matcher_v3_StructMatcher *msg) { return _upb_hasbit(msg, 1); }
62 UPB_INLINE const struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_StructMatcher_value(const envoy_type_matcher_v3_StructMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_matcher_v3_ValueMatcher*); }
63
64 UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment** envoy_type_matcher_v3_StructMatcher_mutable_path(envoy_type_matcher_v3_StructMatcher *msg, size_t *len) {
65   return (envoy_type_matcher_v3_StructMatcher_PathSegment**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
66 }
67 UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment** envoy_type_matcher_v3_StructMatcher_resize_path(envoy_type_matcher_v3_StructMatcher *msg, size_t len, upb_arena *arena) {
68   return (envoy_type_matcher_v3_StructMatcher_PathSegment**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
69 }
70 UPB_INLINE struct envoy_type_matcher_v3_StructMatcher_PathSegment* envoy_type_matcher_v3_StructMatcher_add_path(envoy_type_matcher_v3_StructMatcher *msg, upb_arena *arena) {
71   struct envoy_type_matcher_v3_StructMatcher_PathSegment* sub = (struct envoy_type_matcher_v3_StructMatcher_PathSegment*)_upb_msg_new(&envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena);
72   bool ok = _upb_array_append_accessor2(
73       msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
74   if (!ok) return NULL;
75   return sub;
76 }
77 UPB_INLINE void envoy_type_matcher_v3_StructMatcher_set_value(envoy_type_matcher_v3_StructMatcher *msg, struct envoy_type_matcher_v3_ValueMatcher* value) {
78   _upb_sethas(msg, 1);
79   *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_matcher_v3_ValueMatcher*) = value;
80 }
81 UPB_INLINE struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_StructMatcher_mutable_value(envoy_type_matcher_v3_StructMatcher *msg, upb_arena *arena) {
82   struct envoy_type_matcher_v3_ValueMatcher* sub = (struct envoy_type_matcher_v3_ValueMatcher*)envoy_type_matcher_v3_StructMatcher_value(msg);
83   if (sub == NULL) {
84     sub = (struct envoy_type_matcher_v3_ValueMatcher*)_upb_msg_new(&envoy_type_matcher_v3_ValueMatcher_msginit, arena);
85     if (!sub) return NULL;
86     envoy_type_matcher_v3_StructMatcher_set_value(msg, sub);
87   }
88   return sub;
89 }
90
91 /* envoy.type.matcher.v3.StructMatcher.PathSegment */
92
93 UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment *envoy_type_matcher_v3_StructMatcher_PathSegment_new(upb_arena *arena) {
94   return (envoy_type_matcher_v3_StructMatcher_PathSegment *)_upb_msg_new(&envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena);
95 }
96 UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment *envoy_type_matcher_v3_StructMatcher_PathSegment_parse(const char *buf, size_t size,
97                         upb_arena *arena) {
98   envoy_type_matcher_v3_StructMatcher_PathSegment *ret = envoy_type_matcher_v3_StructMatcher_PathSegment_new(arena);
99   if (!ret) return NULL;
100   if (!upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena)) return NULL;
101   return ret;
102 }
103 UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment *envoy_type_matcher_v3_StructMatcher_PathSegment_parse_ex(const char *buf, size_t size,
104                            const upb_extreg *extreg, int options,
105                            upb_arena *arena) {
106   envoy_type_matcher_v3_StructMatcher_PathSegment *ret = envoy_type_matcher_v3_StructMatcher_PathSegment_new(arena);
107   if (!ret) return NULL;
108   if (!_upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, extreg, options, arena)) {
109     return NULL;
110   }
111   return ret;
112 }
113 UPB_INLINE char *envoy_type_matcher_v3_StructMatcher_PathSegment_serialize(const envoy_type_matcher_v3_StructMatcher_PathSegment *msg, upb_arena *arena, size_t *len) {
114   return upb_encode(msg, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena, len);
115 }
116
117 typedef enum {
118   envoy_type_matcher_v3_StructMatcher_PathSegment_segment_key = 1,
119   envoy_type_matcher_v3_StructMatcher_PathSegment_segment_NOT_SET = 0
120 } envoy_type_matcher_v3_StructMatcher_PathSegment_segment_oneofcases;
121 UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment_segment_oneofcases envoy_type_matcher_v3_StructMatcher_PathSegment_segment_case(const envoy_type_matcher_v3_StructMatcher_PathSegment* msg) { return (envoy_type_matcher_v3_StructMatcher_PathSegment_segment_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
122
123 UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_PathSegment_has_key(const envoy_type_matcher_v3_StructMatcher_PathSegment *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
124 UPB_INLINE upb_strview envoy_type_matcher_v3_StructMatcher_PathSegment_key(const envoy_type_matcher_v3_StructMatcher_PathSegment *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
125
126 UPB_INLINE void envoy_type_matcher_v3_StructMatcher_PathSegment_set_key(envoy_type_matcher_v3_StructMatcher_PathSegment *msg, upb_strview value) {
127   UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
128 }
129
130 #ifdef __cplusplus
131 }  /* extern "C" */
132 #endif
133
134 #include "upb/port_undef.inc"
135
136 #endif  /* ENVOY_TYPE_MATCHER_V3_STRUCT_PROTO_UPB_H_ */