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