| 1 |
/* This file was generated by upbc (the upb compiler) from the input |
| 2 |
* file: |
| 3 |
* |
| 4 |
* envoy/annotations/resource.proto |
| 5 |
* |
| 6 |
* Do not edit -- your changes will be discarded when the file is |
| 7 |
* regenerated. */ |
| 8 |
|
| 9 |
#ifndef ENVOY_ANNOTATIONS_RESOURCE_PROTO_UPB_H_ |
| 10 |
#define ENVOY_ANNOTATIONS_RESOURCE_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_annotations_ResourceAnnotation; |
| 24 |
typedef struct envoy_annotations_ResourceAnnotation envoy_annotations_ResourceAnnotation; |
| 25 |
extern const upb_MiniTable envoy_annotations_ResourceAnnotation_msginit; |
| 26 |
extern const upb_MiniTable_Extension envoy_annotations_resource_ext; |
| 27 |
struct google_protobuf_ServiceOptions; |
| 28 |
extern const upb_MiniTable google_protobuf_ServiceOptions_msginit; |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
/* envoy.annotations.ResourceAnnotation */ |
| 33 |
|
| 34 |
UPB_INLINE envoy_annotations_ResourceAnnotation* envoy_annotations_ResourceAnnotation_new(upb_Arena* arena) { |
| 35 |
return (envoy_annotations_ResourceAnnotation*)_upb_Message_New(&envoy_annotations_ResourceAnnotation_msginit, arena); |
| 36 |
} |
| 37 |
UPB_INLINE envoy_annotations_ResourceAnnotation* envoy_annotations_ResourceAnnotation_parse(const char* buf, size_t size, upb_Arena* arena) { |
| 38 |
envoy_annotations_ResourceAnnotation* ret = envoy_annotations_ResourceAnnotation_new(arena); |
| 39 |
if (!ret) return NULL; |
| 40 |
if (upb_Decode(buf, size, ret, &envoy_annotations_ResourceAnnotation_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) { |
| 41 |
return NULL; |
| 42 |
} |
| 43 |
return ret; |
| 44 |
} |
| 45 |
UPB_INLINE envoy_annotations_ResourceAnnotation* envoy_annotations_ResourceAnnotation_parse_ex(const char* buf, size_t size, |
| 46 |
const upb_ExtensionRegistry* extreg, |
| 47 |
int options, upb_Arena* arena) { |
| 48 |
envoy_annotations_ResourceAnnotation* ret = envoy_annotations_ResourceAnnotation_new(arena); |
| 49 |
if (!ret) return NULL; |
| 50 |
if (upb_Decode(buf, size, ret, &envoy_annotations_ResourceAnnotation_msginit, extreg, options, arena) != |
| 51 |
kUpb_DecodeStatus_Ok) { |
| 52 |
return NULL; |
| 53 |
} |
| 54 |
return ret; |
| 55 |
} |
| 56 |
UPB_INLINE char* envoy_annotations_ResourceAnnotation_serialize(const envoy_annotations_ResourceAnnotation* msg, upb_Arena* arena, size_t* len) { |
| 57 |
char* ptr; |
| 58 |
(void)upb_Encode(msg, &envoy_annotations_ResourceAnnotation_msginit, 0, arena, &ptr, len); |
| 59 |
return ptr; |
| 60 |
} |
| 61 |
UPB_INLINE char* envoy_annotations_ResourceAnnotation_serialize_ex(const envoy_annotations_ResourceAnnotation* msg, int options, |
| 62 |
upb_Arena* arena, size_t* len) { |
| 63 |
char* ptr; |
| 64 |
(void)upb_Encode(msg, &envoy_annotations_ResourceAnnotation_msginit, options, arena, &ptr, len); |
| 65 |
return ptr; |
| 66 |
} |
| 67 |
UPB_INLINE void envoy_annotations_ResourceAnnotation_clear_type(const envoy_annotations_ResourceAnnotation* msg) { |
| 68 |
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); |
| 69 |
} |
| 70 |
UPB_INLINE upb_StringView envoy_annotations_ResourceAnnotation_type(const envoy_annotations_ResourceAnnotation* msg) { |
| 71 |
return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView); |
| 72 |
} |
| 73 |
|
| 74 |
UPB_INLINE void envoy_annotations_ResourceAnnotation_set_type(envoy_annotations_ResourceAnnotation *msg, upb_StringView value) { |
| 75 |
*UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = value; |
| 76 |
} |
| 77 |
|
| 78 |
UPB_INLINE bool envoy_annotations_has_resource(const struct google_protobuf_ServiceOptions* msg) { |
| 79 |
return _upb_Message_Getext(msg, &envoy_annotations_resource_ext) != NULL; |
| 80 |
} |
| 81 |
UPB_INLINE void envoy_annotations_clear_resource(struct google_protobuf_ServiceOptions* msg) { |
| 82 |
_upb_Message_Clearext(msg, &envoy_annotations_resource_ext); |
| 83 |
} |
| 84 |
UPB_INLINE const envoy_annotations_ResourceAnnotation* envoy_annotations_resource(const struct google_protobuf_ServiceOptions* msg) { |
| 85 |
const upb_Message_Extension* ext = _upb_Message_Getext(msg, &envoy_annotations_resource_ext); |
| 86 |
UPB_ASSERT(ext); |
| 87 |
return *UPB_PTR_AT(&ext->data, 0, const envoy_annotations_ResourceAnnotation*); |
| 88 |
} |
| 89 |
UPB_INLINE void envoy_annotations_set_resource(struct google_protobuf_ServiceOptions* msg, const envoy_annotations_ResourceAnnotation* ext, upb_Arena* arena) { |
| 90 |
const upb_Message_Extension* msg_ext = |
| 91 |
_upb_Message_GetOrCreateExtension(msg, &envoy_annotations_resource_ext, arena); |
| 92 |
UPB_ASSERT(msg_ext); |
| 93 |
*UPB_PTR_AT(&msg_ext->data, 0, const envoy_annotations_ResourceAnnotation*) = ext; |
| 94 |
} |
| 95 |
extern const upb_MiniTable_File envoy_annotations_resource_proto_upb_file_layout; |
| 96 |
|
| 97 |
#ifdef __cplusplus |
| 98 |
} /* extern "C" */ |
| 99 |
#endif |
| 100 |
|
| 101 |
#include "upb/port_undef.inc" |
| 102 |
|
| 103 |
#endif /* ENVOY_ANNOTATIONS_RESOURCE_PROTO_UPB_H_ */ |