1 /* This file was generated by upbc (the upb compiler) from the input
2 * file:
3 *
4 * udpa/core/v1/resource_name.proto
5 *
6 * Do not edit -- your changes will be discarded when the file is
7 * regenerated. */
8
9 #ifndef UDPA_CORE_V1_RESOURCE_NAME_PROTO_UPB_H_
10 #define UDPA_CORE_V1_RESOURCE_NAME_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 udpa_core_v1_ResourceName;
24 typedef struct udpa_core_v1_ResourceName udpa_core_v1_ResourceName;
25 extern const upb_msglayout udpa_core_v1_ResourceName_msginit;
26 struct udpa_core_v1_ContextParams;
27 extern const upb_msglayout udpa_core_v1_ContextParams_msginit;
28
29
30 /* udpa.core.v1.ResourceName */
31
udpa_core_v1_ResourceName_new(upb_arena * arena)32 UPB_INLINE udpa_core_v1_ResourceName *udpa_core_v1_ResourceName_new(upb_arena *arena) {
33 return (udpa_core_v1_ResourceName *)_upb_msg_new(&udpa_core_v1_ResourceName_msginit, arena);
34 }
udpa_core_v1_ResourceName_parse(const char * buf,size_t size,upb_arena * arena)35 UPB_INLINE udpa_core_v1_ResourceName *udpa_core_v1_ResourceName_parse(const char *buf, size_t size,
36 upb_arena *arena) {
37 udpa_core_v1_ResourceName *ret = udpa_core_v1_ResourceName_new(arena);
38 return (ret && upb_decode(buf, size, ret, &udpa_core_v1_ResourceName_msginit, arena)) ? ret : NULL;
39 }
udpa_core_v1_ResourceName_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)40 UPB_INLINE udpa_core_v1_ResourceName *udpa_core_v1_ResourceName_parse_ex(const char *buf, size_t size,
41 upb_arena *arena, int options) {
42 udpa_core_v1_ResourceName *ret = udpa_core_v1_ResourceName_new(arena);
43 return (ret && _upb_decode(buf, size, ret, &udpa_core_v1_ResourceName_msginit, arena, options))
44 ? ret : NULL;
45 }
udpa_core_v1_ResourceName_serialize(const udpa_core_v1_ResourceName * msg,upb_arena * arena,size_t * len)46 UPB_INLINE char *udpa_core_v1_ResourceName_serialize(const udpa_core_v1_ResourceName *msg, upb_arena *arena, size_t *len) {
47 return upb_encode(msg, &udpa_core_v1_ResourceName_msginit, arena, len);
48 }
49
udpa_core_v1_ResourceName_id(const udpa_core_v1_ResourceName * msg,size_t * len)50 UPB_INLINE upb_strview const* udpa_core_v1_ResourceName_id(const udpa_core_v1_ResourceName *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(24, 48), len); }
udpa_core_v1_ResourceName_authority(const udpa_core_v1_ResourceName * msg)51 UPB_INLINE upb_strview udpa_core_v1_ResourceName_authority(const udpa_core_v1_ResourceName *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
udpa_core_v1_ResourceName_resource_type(const udpa_core_v1_ResourceName * msg)52 UPB_INLINE upb_strview udpa_core_v1_ResourceName_resource_type(const udpa_core_v1_ResourceName *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview); }
udpa_core_v1_ResourceName_has_context(const udpa_core_v1_ResourceName * msg)53 UPB_INLINE bool udpa_core_v1_ResourceName_has_context(const udpa_core_v1_ResourceName *msg) { return _upb_hasbit(msg, 1); }
udpa_core_v1_ResourceName_context(const udpa_core_v1_ResourceName * msg)54 UPB_INLINE const struct udpa_core_v1_ContextParams* udpa_core_v1_ResourceName_context(const udpa_core_v1_ResourceName *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(20, 40), const struct udpa_core_v1_ContextParams*); }
55
udpa_core_v1_ResourceName_mutable_id(udpa_core_v1_ResourceName * msg,size_t * len)56 UPB_INLINE upb_strview* udpa_core_v1_ResourceName_mutable_id(udpa_core_v1_ResourceName *msg, size_t *len) {
57 return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(24, 48), len);
58 }
udpa_core_v1_ResourceName_resize_id(udpa_core_v1_ResourceName * msg,size_t len,upb_arena * arena)59 UPB_INLINE upb_strview* udpa_core_v1_ResourceName_resize_id(udpa_core_v1_ResourceName *msg, size_t len, upb_arena *arena) {
60 return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(24, 48), len, UPB_SIZE(3, 4), arena);
61 }
udpa_core_v1_ResourceName_add_id(udpa_core_v1_ResourceName * msg,upb_strview val,upb_arena * arena)62 UPB_INLINE bool udpa_core_v1_ResourceName_add_id(udpa_core_v1_ResourceName *msg, upb_strview val, upb_arena *arena) {
63 return _upb_array_append_accessor2(msg, UPB_SIZE(24, 48), UPB_SIZE(3, 4), &val,
64 arena);
65 }
udpa_core_v1_ResourceName_set_authority(udpa_core_v1_ResourceName * msg,upb_strview value)66 UPB_INLINE void udpa_core_v1_ResourceName_set_authority(udpa_core_v1_ResourceName *msg, upb_strview value) {
67 *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
68 }
udpa_core_v1_ResourceName_set_resource_type(udpa_core_v1_ResourceName * msg,upb_strview value)69 UPB_INLINE void udpa_core_v1_ResourceName_set_resource_type(udpa_core_v1_ResourceName *msg, upb_strview value) {
70 *UPB_PTR_AT(msg, UPB_SIZE(12, 24), upb_strview) = value;
71 }
udpa_core_v1_ResourceName_set_context(udpa_core_v1_ResourceName * msg,struct udpa_core_v1_ContextParams * value)72 UPB_INLINE void udpa_core_v1_ResourceName_set_context(udpa_core_v1_ResourceName *msg, struct udpa_core_v1_ContextParams* value) {
73 _upb_sethas(msg, 1);
74 *UPB_PTR_AT(msg, UPB_SIZE(20, 40), struct udpa_core_v1_ContextParams*) = value;
75 }
udpa_core_v1_ResourceName_mutable_context(udpa_core_v1_ResourceName * msg,upb_arena * arena)76 UPB_INLINE struct udpa_core_v1_ContextParams* udpa_core_v1_ResourceName_mutable_context(udpa_core_v1_ResourceName *msg, upb_arena *arena) {
77 struct udpa_core_v1_ContextParams* sub = (struct udpa_core_v1_ContextParams*)udpa_core_v1_ResourceName_context(msg);
78 if (sub == NULL) {
79 sub = (struct udpa_core_v1_ContextParams*)_upb_msg_new(&udpa_core_v1_ContextParams_msginit, arena);
80 if (!sub) return NULL;
81 udpa_core_v1_ResourceName_set_context(msg, sub);
82 }
83 return sub;
84 }
85
86 #ifdef __cplusplus
87 } /* extern "C" */
88 #endif
89
90 #include "upb/port_undef.inc"
91
92 #endif /* UDPA_CORE_V1_RESOURCE_NAME_PROTO_UPB_H_ */
93