1 /* This file was generated by upbc (the upb compiler) from the input
4 * envoy/config/core/v3/substitution_format_string.proto
6 * Do not edit -- your changes will be discarded when the file is
9 #ifndef ENVOY_CONFIG_CORE_V3_SUBSTITUTION_FORMAT_STRING_PROTO_UPB_H_
10 #define ENVOY_CONFIG_CORE_V3_SUBSTITUTION_FORMAT_STRING_PROTO_UPB_H_
13 #include "upb/decode.h"
14 #include "upb/decode_fast.h"
15 #include "upb/encode.h"
17 #include "upb/port_def.inc"
23 struct envoy_config_core_v3_SubstitutionFormatString;
24 typedef struct envoy_config_core_v3_SubstitutionFormatString envoy_config_core_v3_SubstitutionFormatString;
25 extern const upb_msglayout envoy_config_core_v3_SubstitutionFormatString_msginit;
26 struct envoy_config_core_v3_DataSource;
27 struct envoy_config_core_v3_TypedExtensionConfig;
28 struct google_protobuf_Struct;
29 extern const upb_msglayout envoy_config_core_v3_DataSource_msginit;
30 extern const upb_msglayout envoy_config_core_v3_TypedExtensionConfig_msginit;
31 extern const upb_msglayout google_protobuf_Struct_msginit;
34 /* envoy.config.core.v3.SubstitutionFormatString */
36 UPB_INLINE envoy_config_core_v3_SubstitutionFormatString *envoy_config_core_v3_SubstitutionFormatString_new(upb_arena *arena) {
37 return (envoy_config_core_v3_SubstitutionFormatString *)_upb_msg_new(&envoy_config_core_v3_SubstitutionFormatString_msginit, arena);
39 UPB_INLINE envoy_config_core_v3_SubstitutionFormatString *envoy_config_core_v3_SubstitutionFormatString_parse(const char *buf, size_t size,
41 envoy_config_core_v3_SubstitutionFormatString *ret = envoy_config_core_v3_SubstitutionFormatString_new(arena);
42 return (ret && upb_decode(buf, size, ret, &envoy_config_core_v3_SubstitutionFormatString_msginit, arena)) ? ret : NULL;
44 UPB_INLINE envoy_config_core_v3_SubstitutionFormatString *envoy_config_core_v3_SubstitutionFormatString_parse_ex(const char *buf, size_t size,
45 upb_arena *arena, int options) {
46 envoy_config_core_v3_SubstitutionFormatString *ret = envoy_config_core_v3_SubstitutionFormatString_new(arena);
47 return (ret && _upb_decode(buf, size, ret, &envoy_config_core_v3_SubstitutionFormatString_msginit, arena, options))
50 UPB_INLINE char *envoy_config_core_v3_SubstitutionFormatString_serialize(const envoy_config_core_v3_SubstitutionFormatString *msg, upb_arena *arena, size_t *len) {
51 return upb_encode(msg, &envoy_config_core_v3_SubstitutionFormatString_msginit, arena, len);
55 envoy_config_core_v3_SubstitutionFormatString_format_text_format = 1,
56 envoy_config_core_v3_SubstitutionFormatString_format_json_format = 2,
57 envoy_config_core_v3_SubstitutionFormatString_format_text_format_source = 5,
58 envoy_config_core_v3_SubstitutionFormatString_format_NOT_SET = 0
59 } envoy_config_core_v3_SubstitutionFormatString_format_oneofcases;
60 UPB_INLINE envoy_config_core_v3_SubstitutionFormatString_format_oneofcases envoy_config_core_v3_SubstitutionFormatString_format_case(const envoy_config_core_v3_SubstitutionFormatString* msg) { return (envoy_config_core_v3_SubstitutionFormatString_format_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(24, 48), int32_t); }
62 UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_has_text_format(const envoy_config_core_v3_SubstitutionFormatString *msg) { return _upb_getoneofcase(msg, UPB_SIZE(24, 48)) == 1; }
63 UPB_INLINE upb_strview envoy_config_core_v3_SubstitutionFormatString_text_format(const envoy_config_core_v3_SubstitutionFormatString *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(16, 32), UPB_SIZE(24, 48), 1, upb_strview_make("", strlen(""))); }
64 UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_has_json_format(const envoy_config_core_v3_SubstitutionFormatString *msg) { return _upb_getoneofcase(msg, UPB_SIZE(24, 48)) == 2; }
65 UPB_INLINE const struct google_protobuf_Struct* envoy_config_core_v3_SubstitutionFormatString_json_format(const envoy_config_core_v3_SubstitutionFormatString *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Struct*, UPB_SIZE(16, 32), UPB_SIZE(24, 48), 2, NULL); }
66 UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_omit_empty_values(const envoy_config_core_v3_SubstitutionFormatString *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
67 UPB_INLINE upb_strview envoy_config_core_v3_SubstitutionFormatString_content_type(const envoy_config_core_v3_SubstitutionFormatString *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
68 UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_has_text_format_source(const envoy_config_core_v3_SubstitutionFormatString *msg) { return _upb_getoneofcase(msg, UPB_SIZE(24, 48)) == 5; }
69 UPB_INLINE const struct envoy_config_core_v3_DataSource* envoy_config_core_v3_SubstitutionFormatString_text_format_source(const envoy_config_core_v3_SubstitutionFormatString *msg) { return UPB_READ_ONEOF(msg, const struct envoy_config_core_v3_DataSource*, UPB_SIZE(16, 32), UPB_SIZE(24, 48), 5, NULL); }
70 UPB_INLINE bool envoy_config_core_v3_SubstitutionFormatString_has_formatters(const envoy_config_core_v3_SubstitutionFormatString *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(12, 24)); }
71 UPB_INLINE const struct envoy_config_core_v3_TypedExtensionConfig* const* envoy_config_core_v3_SubstitutionFormatString_formatters(const envoy_config_core_v3_SubstitutionFormatString *msg, size_t *len) { return (const struct envoy_config_core_v3_TypedExtensionConfig* const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
73 UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_text_format(envoy_config_core_v3_SubstitutionFormatString *msg, upb_strview value) {
74 UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(16, 32), value, UPB_SIZE(24, 48), 1);
76 UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_json_format(envoy_config_core_v3_SubstitutionFormatString *msg, struct google_protobuf_Struct* value) {
77 UPB_WRITE_ONEOF(msg, struct google_protobuf_Struct*, UPB_SIZE(16, 32), value, UPB_SIZE(24, 48), 2);
79 UPB_INLINE struct google_protobuf_Struct* envoy_config_core_v3_SubstitutionFormatString_mutable_json_format(envoy_config_core_v3_SubstitutionFormatString *msg, upb_arena *arena) {
80 struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)envoy_config_core_v3_SubstitutionFormatString_json_format(msg);
82 sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
83 if (!sub) return NULL;
84 envoy_config_core_v3_SubstitutionFormatString_set_json_format(msg, sub);
88 UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_omit_empty_values(envoy_config_core_v3_SubstitutionFormatString *msg, bool value) {
89 *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
91 UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_content_type(envoy_config_core_v3_SubstitutionFormatString *msg, upb_strview value) {
92 *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
94 UPB_INLINE void envoy_config_core_v3_SubstitutionFormatString_set_text_format_source(envoy_config_core_v3_SubstitutionFormatString *msg, struct envoy_config_core_v3_DataSource* value) {
95 UPB_WRITE_ONEOF(msg, struct envoy_config_core_v3_DataSource*, UPB_SIZE(16, 32), value, UPB_SIZE(24, 48), 5);
97 UPB_INLINE struct envoy_config_core_v3_DataSource* envoy_config_core_v3_SubstitutionFormatString_mutable_text_format_source(envoy_config_core_v3_SubstitutionFormatString *msg, upb_arena *arena) {
98 struct envoy_config_core_v3_DataSource* sub = (struct envoy_config_core_v3_DataSource*)envoy_config_core_v3_SubstitutionFormatString_text_format_source(msg);
100 sub = (struct envoy_config_core_v3_DataSource*)_upb_msg_new(&envoy_config_core_v3_DataSource_msginit, arena);
101 if (!sub) return NULL;
102 envoy_config_core_v3_SubstitutionFormatString_set_text_format_source(msg, sub);
106 UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_core_v3_SubstitutionFormatString_mutable_formatters(envoy_config_core_v3_SubstitutionFormatString *msg, size_t *len) {
107 return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
109 UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig** envoy_config_core_v3_SubstitutionFormatString_resize_formatters(envoy_config_core_v3_SubstitutionFormatString *msg, size_t len, upb_arena *arena) {
110 return (struct envoy_config_core_v3_TypedExtensionConfig**)_upb_array_resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(2, 3), arena);
112 UPB_INLINE struct envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_SubstitutionFormatString_add_formatters(envoy_config_core_v3_SubstitutionFormatString *msg, upb_arena *arena) {
113 struct envoy_config_core_v3_TypedExtensionConfig* sub = (struct envoy_config_core_v3_TypedExtensionConfig*)_upb_msg_new(&envoy_config_core_v3_TypedExtensionConfig_msginit, arena);
114 bool ok = _upb_array_append_accessor2(
115 msg, UPB_SIZE(12, 24), UPB_SIZE(2, 3), &sub, arena);
116 if (!ok) return NULL;
124 #include "upb/port_undef.inc"
126 #endif /* ENVOY_CONFIG_CORE_V3_SUBSTITUTION_FORMAT_STRING_PROTO_UPB_H_ */