1 /* This file was generated by upb_generator from the input file:
2 *
3 * xds/type/v3/typed_struct.proto
4 *
5 * Do not edit -- your changes will be discarded when the file is
6 * regenerated.
7 * NO CHECKED-IN PROTOBUF GENCODE */
8
9 #ifndef XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPB_H__UPB_H_
10 #define XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPB_H__UPB_H_
11
12 #include "upb/generated_code_support.h"
13
14 #include "xds/type/v3/typed_struct.upb_minitable.h"
15
16 #include "google/protobuf/struct.upb_minitable.h"
17
18 // Must be last.
19 #include "upb/port/def.inc"
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 typedef struct xds_type_v3_TypedStruct { upb_Message UPB_PRIVATE(base); } xds_type_v3_TypedStruct;
26 struct google_protobuf_Struct;
27
28
29
30 /* xds.type.v3.TypedStruct */
31
xds_type_v3_TypedStruct_new(upb_Arena * arena)32 UPB_INLINE xds_type_v3_TypedStruct* xds_type_v3_TypedStruct_new(upb_Arena* arena) {
33 return (xds_type_v3_TypedStruct*)_upb_Message_New(&xds__type__v3__TypedStruct_msg_init, arena);
34 }
xds_type_v3_TypedStruct_parse(const char * buf,size_t size,upb_Arena * arena)35 UPB_INLINE xds_type_v3_TypedStruct* xds_type_v3_TypedStruct_parse(const char* buf, size_t size, upb_Arena* arena) {
36 xds_type_v3_TypedStruct* ret = xds_type_v3_TypedStruct_new(arena);
37 if (!ret) return NULL;
38 if (upb_Decode(buf, size, UPB_UPCAST(ret), &xds__type__v3__TypedStruct_msg_init, NULL, 0, arena) !=
39 kUpb_DecodeStatus_Ok) {
40 return NULL;
41 }
42 return ret;
43 }
xds_type_v3_TypedStruct_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)44 UPB_INLINE xds_type_v3_TypedStruct* xds_type_v3_TypedStruct_parse_ex(const char* buf, size_t size,
45 const upb_ExtensionRegistry* extreg,
46 int options, upb_Arena* arena) {
47 xds_type_v3_TypedStruct* ret = xds_type_v3_TypedStruct_new(arena);
48 if (!ret) return NULL;
49 if (upb_Decode(buf, size, UPB_UPCAST(ret), &xds__type__v3__TypedStruct_msg_init, extreg, options,
50 arena) != kUpb_DecodeStatus_Ok) {
51 return NULL;
52 }
53 return ret;
54 }
xds_type_v3_TypedStruct_serialize(const xds_type_v3_TypedStruct * msg,upb_Arena * arena,size_t * len)55 UPB_INLINE char* xds_type_v3_TypedStruct_serialize(const xds_type_v3_TypedStruct* msg, upb_Arena* arena, size_t* len) {
56 char* ptr;
57 (void)upb_Encode(UPB_UPCAST(msg), &xds__type__v3__TypedStruct_msg_init, 0, arena, &ptr, len);
58 return ptr;
59 }
xds_type_v3_TypedStruct_serialize_ex(const xds_type_v3_TypedStruct * msg,int options,upb_Arena * arena,size_t * len)60 UPB_INLINE char* xds_type_v3_TypedStruct_serialize_ex(const xds_type_v3_TypedStruct* msg, int options,
61 upb_Arena* arena, size_t* len) {
62 char* ptr;
63 (void)upb_Encode(UPB_UPCAST(msg), &xds__type__v3__TypedStruct_msg_init, options, arena, &ptr, len);
64 return ptr;
65 }
xds_type_v3_TypedStruct_clear_type_url(xds_type_v3_TypedStruct * msg)66 UPB_INLINE void xds_type_v3_TypedStruct_clear_type_url(xds_type_v3_TypedStruct* msg) {
67 const upb_MiniTableField field = {1, 16, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
68 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
69 }
xds_type_v3_TypedStruct_type_url(const xds_type_v3_TypedStruct * msg)70 UPB_INLINE upb_StringView xds_type_v3_TypedStruct_type_url(const xds_type_v3_TypedStruct* msg) {
71 upb_StringView default_val = upb_StringView_FromString("");
72 upb_StringView ret;
73 const upb_MiniTableField field = {1, 16, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
74 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
75 &default_val, &ret);
76 return ret;
77 }
xds_type_v3_TypedStruct_clear_value(xds_type_v3_TypedStruct * msg)78 UPB_INLINE void xds_type_v3_TypedStruct_clear_value(xds_type_v3_TypedStruct* msg) {
79 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
80 upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
81 }
xds_type_v3_TypedStruct_value(const xds_type_v3_TypedStruct * msg)82 UPB_INLINE const struct google_protobuf_Struct* xds_type_v3_TypedStruct_value(const xds_type_v3_TypedStruct* msg) {
83 const struct google_protobuf_Struct* default_val = NULL;
84 const struct google_protobuf_Struct* ret;
85 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
86 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__Struct_msg_init);
87 _upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
88 &default_val, &ret);
89 return ret;
90 }
xds_type_v3_TypedStruct_has_value(const xds_type_v3_TypedStruct * msg)91 UPB_INLINE bool xds_type_v3_TypedStruct_has_value(const xds_type_v3_TypedStruct* msg) {
92 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
93 return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
94 }
95
xds_type_v3_TypedStruct_set_type_url(xds_type_v3_TypedStruct * msg,upb_StringView value)96 UPB_INLINE void xds_type_v3_TypedStruct_set_type_url(xds_type_v3_TypedStruct *msg, upb_StringView value) {
97 const upb_MiniTableField field = {1, 16, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
98 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
99 }
xds_type_v3_TypedStruct_set_value(xds_type_v3_TypedStruct * msg,struct google_protobuf_Struct * value)100 UPB_INLINE void xds_type_v3_TypedStruct_set_value(xds_type_v3_TypedStruct *msg, struct google_protobuf_Struct* value) {
101 const upb_MiniTableField field = {2, UPB_SIZE(12, 32), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
102 UPB_PRIVATE(_upb_MiniTable_StrongReference)(&google__protobuf__Struct_msg_init);
103 upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
104 }
xds_type_v3_TypedStruct_mutable_value(xds_type_v3_TypedStruct * msg,upb_Arena * arena)105 UPB_INLINE struct google_protobuf_Struct* xds_type_v3_TypedStruct_mutable_value(xds_type_v3_TypedStruct* msg, upb_Arena* arena) {
106 struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)xds_type_v3_TypedStruct_value(msg);
107 if (sub == NULL) {
108 sub = (struct google_protobuf_Struct*)_upb_Message_New(&google__protobuf__Struct_msg_init, arena);
109 if (sub) xds_type_v3_TypedStruct_set_value(msg, sub);
110 }
111 return sub;
112 }
113
114 #ifdef __cplusplus
115 } /* extern "C" */
116 #endif
117
118 #include "upb/port/undef.inc"
119
120 #endif /* XDS_TYPE_V3_TYPED_STRUCT_PROTO_UPB_H__UPB_H_ */
121