1 /* This file was generated by upbc (the upb compiler) from the input
2 * file:
3 *
4 * xds/annotations/v3/versioning.proto
5 *
6 * Do not edit -- your changes will be discarded when the file is
7 * regenerated. */
8
9 #ifndef XDS_ANNOTATIONS_V3_VERSIONING_PROTO_UPB_H_
10 #define XDS_ANNOTATIONS_V3_VERSIONING_PROTO_UPB_H_
11
12 #include "upb/collections/array_internal.h"
13 #include "upb/collections/map_gencode_util.h"
14 #include "upb/message/accessors.h"
15 #include "upb/message/internal.h"
16 #include "upb/mini_table/enum_internal.h"
17 #include "upb/wire/decode.h"
18 #include "upb/wire/decode_fast.h"
19 #include "upb/wire/encode.h"
20
21 // Must be last.
22 #include "upb/port/def.inc"
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 typedef struct xds_annotations_v3_VersioningAnnotation xds_annotations_v3_VersioningAnnotation;
29 extern const upb_MiniTable xds_annotations_v3_VersioningAnnotation_msg_init;
30 extern const upb_MiniTableExtension xds_annotations_v3_versioning_ext;
31 struct google_protobuf_MessageOptions;
32 extern const upb_MiniTable google_protobuf_MessageOptions_msg_init;
33
34
35
36 /* xds.annotations.v3.VersioningAnnotation */
37
xds_annotations_v3_VersioningAnnotation_new(upb_Arena * arena)38 UPB_INLINE xds_annotations_v3_VersioningAnnotation* xds_annotations_v3_VersioningAnnotation_new(upb_Arena* arena) {
39 return (xds_annotations_v3_VersioningAnnotation*)_upb_Message_New(&xds_annotations_v3_VersioningAnnotation_msg_init, arena);
40 }
xds_annotations_v3_VersioningAnnotation_parse(const char * buf,size_t size,upb_Arena * arena)41 UPB_INLINE xds_annotations_v3_VersioningAnnotation* xds_annotations_v3_VersioningAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) {
42 xds_annotations_v3_VersioningAnnotation* ret = xds_annotations_v3_VersioningAnnotation_new(arena);
43 if (!ret) return NULL;
44 if (upb_Decode(buf, size, ret, &xds_annotations_v3_VersioningAnnotation_msg_init, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
45 return NULL;
46 }
47 return ret;
48 }
xds_annotations_v3_VersioningAnnotation_parse_ex(const char * buf,size_t size,const upb_ExtensionRegistry * extreg,int options,upb_Arena * arena)49 UPB_INLINE xds_annotations_v3_VersioningAnnotation* xds_annotations_v3_VersioningAnnotation_parse_ex(const char* buf, size_t size,
50 const upb_ExtensionRegistry* extreg,
51 int options, upb_Arena* arena) {
52 xds_annotations_v3_VersioningAnnotation* ret = xds_annotations_v3_VersioningAnnotation_new(arena);
53 if (!ret) return NULL;
54 if (upb_Decode(buf, size, ret, &xds_annotations_v3_VersioningAnnotation_msg_init, extreg, options, arena) !=
55 kUpb_DecodeStatus_Ok) {
56 return NULL;
57 }
58 return ret;
59 }
xds_annotations_v3_VersioningAnnotation_serialize(const xds_annotations_v3_VersioningAnnotation * msg,upb_Arena * arena,size_t * len)60 UPB_INLINE char* xds_annotations_v3_VersioningAnnotation_serialize(const xds_annotations_v3_VersioningAnnotation* msg, upb_Arena* arena, size_t* len) {
61 char* ptr;
62 (void)upb_Encode(msg, &xds_annotations_v3_VersioningAnnotation_msg_init, 0, arena, &ptr, len);
63 return ptr;
64 }
xds_annotations_v3_VersioningAnnotation_serialize_ex(const xds_annotations_v3_VersioningAnnotation * msg,int options,upb_Arena * arena,size_t * len)65 UPB_INLINE char* xds_annotations_v3_VersioningAnnotation_serialize_ex(const xds_annotations_v3_VersioningAnnotation* msg, int options,
66 upb_Arena* arena, size_t* len) {
67 char* ptr;
68 (void)upb_Encode(msg, &xds_annotations_v3_VersioningAnnotation_msg_init, options, arena, &ptr, len);
69 return ptr;
70 }
xds_annotations_v3_VersioningAnnotation_clear_previous_message_type(xds_annotations_v3_VersioningAnnotation * msg)71 UPB_INLINE void xds_annotations_v3_VersioningAnnotation_clear_previous_message_type(xds_annotations_v3_VersioningAnnotation* msg) {
72 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
73 _upb_Message_ClearNonExtensionField(msg, &field);
74 }
xds_annotations_v3_VersioningAnnotation_previous_message_type(const xds_annotations_v3_VersioningAnnotation * msg)75 UPB_INLINE upb_StringView xds_annotations_v3_VersioningAnnotation_previous_message_type(const xds_annotations_v3_VersioningAnnotation* msg) {
76 upb_StringView default_val = upb_StringView_FromString("");
77 upb_StringView ret;
78 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
79 _upb_Message_GetNonExtensionField(msg, &field, &default_val, &ret);
80 return ret;
81 }
82
xds_annotations_v3_VersioningAnnotation_set_previous_message_type(xds_annotations_v3_VersioningAnnotation * msg,upb_StringView value)83 UPB_INLINE void xds_annotations_v3_VersioningAnnotation_set_previous_message_type(xds_annotations_v3_VersioningAnnotation *msg, upb_StringView value) {
84 const upb_MiniTableField field = {1, 0, 0, kUpb_NoSub, 9, kUpb_FieldMode_Scalar | (kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
85 _upb_Message_SetNonExtensionField(msg, &field, &value);
86 }
87
xds_annotations_v3_has_versioning(const struct google_protobuf_MessageOptions * msg)88 UPB_INLINE bool xds_annotations_v3_has_versioning(const struct google_protobuf_MessageOptions* msg) {
89 return _upb_Message_HasExtensionField(msg, &xds_annotations_v3_versioning_ext);
90 }
xds_annotations_v3_clear_versioning(struct google_protobuf_MessageOptions * msg)91 UPB_INLINE void xds_annotations_v3_clear_versioning(struct google_protobuf_MessageOptions* msg) {
92 _upb_Message_ClearExtensionField(msg, &xds_annotations_v3_versioning_ext);
93 }
xds_annotations_v3_versioning(const struct google_protobuf_MessageOptions * msg)94 UPB_INLINE const xds_annotations_v3_VersioningAnnotation* xds_annotations_v3_versioning(const struct google_protobuf_MessageOptions* msg) {
95 const upb_MiniTableExtension* ext = &xds_annotations_v3_versioning_ext;
96 UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field));
97 UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte);
98 const xds_annotations_v3_VersioningAnnotation* default_val = NULL;
99 const xds_annotations_v3_VersioningAnnotation* ret;
100 _upb_Message_GetExtensionField(msg, ext, &default_val, &ret);
101 return ret;
102 }
xds_annotations_v3_set_versioning(struct google_protobuf_MessageOptions * msg,const xds_annotations_v3_VersioningAnnotation * val,upb_Arena * arena)103 UPB_INLINE void xds_annotations_v3_set_versioning(struct google_protobuf_MessageOptions* msg, const xds_annotations_v3_VersioningAnnotation* val, upb_Arena* arena) {
104 const upb_MiniTableExtension* ext = &xds_annotations_v3_versioning_ext;
105 UPB_ASSUME(!upb_IsRepeatedOrMap(&ext->field));
106 UPB_ASSUME(_upb_MiniTableField_GetRep(&ext->field) == kUpb_FieldRep_8Byte);
107 bool ok = _upb_Message_SetExtensionField(msg, ext, &val, arena);
108 UPB_ASSERT(ok);
109 }
110 extern const upb_MiniTableFile xds_annotations_v3_versioning_proto_upb_file_layout;
111
112 #ifdef __cplusplus
113 } /* extern "C" */
114 #endif
115
116 #include "upb/port/undef.inc"
117
118 #endif /* XDS_ANNOTATIONS_V3_VERSIONING_PROTO_UPB_H_ */
119