/* This file was generated by upbc (the upb compiler) from the input
 * file:
 *
 *     google/api/expr/v1alpha1/value.proto
 *
 * Do not edit -- your changes will be discarded when the file is
 * regenerated. */

#ifndef GOOGLE_API_EXPR_V1ALPHA1_VALUE_PROTO_UPB_H_
#define GOOGLE_API_EXPR_V1ALPHA1_VALUE_PROTO_UPB_H_

#include "upb/msg_internal.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"

#include "upb/port_def.inc"

#ifdef __cplusplus
extern "C" {
#endif

struct google_api_expr_v1alpha1_Value;
struct google_api_expr_v1alpha1_EnumValue;
struct google_api_expr_v1alpha1_ListValue;
struct google_api_expr_v1alpha1_MapValue;
struct google_api_expr_v1alpha1_MapValue_Entry;
typedef struct google_api_expr_v1alpha1_Value google_api_expr_v1alpha1_Value;
typedef struct google_api_expr_v1alpha1_EnumValue google_api_expr_v1alpha1_EnumValue;
typedef struct google_api_expr_v1alpha1_ListValue google_api_expr_v1alpha1_ListValue;
typedef struct google_api_expr_v1alpha1_MapValue google_api_expr_v1alpha1_MapValue;
typedef struct google_api_expr_v1alpha1_MapValue_Entry google_api_expr_v1alpha1_MapValue_Entry;
extern const upb_msglayout google_api_expr_v1alpha1_Value_msginit;
extern const upb_msglayout google_api_expr_v1alpha1_EnumValue_msginit;
extern const upb_msglayout google_api_expr_v1alpha1_ListValue_msginit;
extern const upb_msglayout google_api_expr_v1alpha1_MapValue_msginit;
extern const upb_msglayout google_api_expr_v1alpha1_MapValue_Entry_msginit;
struct google_protobuf_Any;
extern const upb_msglayout google_protobuf_Any_msginit;


/* google.api.expr.v1alpha1.Value */

UPB_INLINE google_api_expr_v1alpha1_Value *google_api_expr_v1alpha1_Value_new(upb_arena *arena) {
  return (google_api_expr_v1alpha1_Value *)_upb_msg_new(&google_api_expr_v1alpha1_Value_msginit, arena);
}
UPB_INLINE google_api_expr_v1alpha1_Value *google_api_expr_v1alpha1_Value_parse(const char *buf, size_t size,
                        upb_arena *arena) {
  google_api_expr_v1alpha1_Value *ret = google_api_expr_v1alpha1_Value_new(arena);
  if (!ret) return NULL;
  if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Value_msginit, arena)) return NULL;
  return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Value *google_api_expr_v1alpha1_Value_parse_ex(const char *buf, size_t size,
                           const upb_extreg *extreg, int options,
                           upb_arena *arena) {
  google_api_expr_v1alpha1_Value *ret = google_api_expr_v1alpha1_Value_new(arena);
  if (!ret) return NULL;
  if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Value_msginit, extreg, options, arena)) {
    return NULL;
  }
  return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Value_serialize(const google_api_expr_v1alpha1_Value *msg, upb_arena *arena, size_t *len) {
  return upb_encode(msg, &google_api_expr_v1alpha1_Value_msginit, arena, len);
}

typedef enum {
  google_api_expr_v1alpha1_Value_kind_null_value = 1,
  google_api_expr_v1alpha1_Value_kind_bool_value = 2,
  google_api_expr_v1alpha1_Value_kind_int64_value = 3,
  google_api_expr_v1alpha1_Value_kind_uint64_value = 4,
  google_api_expr_v1alpha1_Value_kind_double_value = 5,
  google_api_expr_v1alpha1_Value_kind_string_value = 6,
  google_api_expr_v1alpha1_Value_kind_bytes_value = 7,
  google_api_expr_v1alpha1_Value_kind_enum_value = 9,
  google_api_expr_v1alpha1_Value_kind_object_value = 10,
  google_api_expr_v1alpha1_Value_kind_map_value = 11,
  google_api_expr_v1alpha1_Value_kind_list_value = 12,
  google_api_expr_v1alpha1_Value_kind_type_value = 15,
  google_api_expr_v1alpha1_Value_kind_NOT_SET = 0
} google_api_expr_v1alpha1_Value_kind_oneofcases;
UPB_INLINE google_api_expr_v1alpha1_Value_kind_oneofcases google_api_expr_v1alpha1_Value_kind_case(const google_api_expr_v1alpha1_Value* msg) { return (google_api_expr_v1alpha1_Value_kind_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }

UPB_INLINE bool google_api_expr_v1alpha1_Value_has_null_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
UPB_INLINE int32_t google_api_expr_v1alpha1_Value_null_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, int32_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, 0); }
UPB_INLINE bool google_api_expr_v1alpha1_Value_has_bool_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 2; }
UPB_INLINE bool google_api_expr_v1alpha1_Value_bool_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, bool, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 2, false); }
UPB_INLINE bool google_api_expr_v1alpha1_Value_has_int64_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 3; }
UPB_INLINE int64_t google_api_expr_v1alpha1_Value_int64_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, int64_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 3, 0); }
UPB_INLINE bool google_api_expr_v1alpha1_Value_has_uint64_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 4; }
UPB_INLINE uint64_t google_api_expr_v1alpha1_Value_uint64_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, uint64_t, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 4, 0); }
UPB_INLINE bool google_api_expr_v1alpha1_Value_has_double_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 5; }
UPB_INLINE double google_api_expr_v1alpha1_Value_double_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, double, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 5, 0); }
UPB_INLINE bool google_api_expr_v1alpha1_Value_has_string_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 6; }
UPB_INLINE upb_strview google_api_expr_v1alpha1_Value_string_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 6, upb_strview_make("", strlen(""))); }
UPB_INLINE bool google_api_expr_v1alpha1_Value_has_bytes_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 7; }
UPB_INLINE upb_strview google_api_expr_v1alpha1_Value_bytes_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 7, upb_strview_make("", strlen(""))); }
UPB_INLINE bool google_api_expr_v1alpha1_Value_has_enum_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 9; }
UPB_INLINE const google_api_expr_v1alpha1_EnumValue* google_api_expr_v1alpha1_Value_enum_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_EnumValue*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 9, NULL); }
UPB_INLINE bool google_api_expr_v1alpha1_Value_has_object_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 10; }
UPB_INLINE const struct google_protobuf_Any* google_api_expr_v1alpha1_Value_object_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, const struct google_protobuf_Any*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 10, NULL); }
UPB_INLINE bool google_api_expr_v1alpha1_Value_has_map_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 11; }
UPB_INLINE const google_api_expr_v1alpha1_MapValue* google_api_expr_v1alpha1_Value_map_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_MapValue*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 11, NULL); }
UPB_INLINE bool google_api_expr_v1alpha1_Value_has_list_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 12; }
UPB_INLINE const google_api_expr_v1alpha1_ListValue* google_api_expr_v1alpha1_Value_list_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, const google_api_expr_v1alpha1_ListValue*, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 12, NULL); }
UPB_INLINE bool google_api_expr_v1alpha1_Value_has_type_value(const google_api_expr_v1alpha1_Value *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 15; }
UPB_INLINE upb_strview google_api_expr_v1alpha1_Value_type_value(const google_api_expr_v1alpha1_Value *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 15, upb_strview_make("", strlen(""))); }

UPB_INLINE void google_api_expr_v1alpha1_Value_set_null_value(google_api_expr_v1alpha1_Value *msg, int32_t value) {
  UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
}
UPB_INLINE void google_api_expr_v1alpha1_Value_set_bool_value(google_api_expr_v1alpha1_Value *msg, bool value) {
  UPB_WRITE_ONEOF(msg, bool, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
}
UPB_INLINE void google_api_expr_v1alpha1_Value_set_int64_value(google_api_expr_v1alpha1_Value *msg, int64_t value) {
  UPB_WRITE_ONEOF(msg, int64_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 3);
}
UPB_INLINE void google_api_expr_v1alpha1_Value_set_uint64_value(google_api_expr_v1alpha1_Value *msg, uint64_t value) {
  UPB_WRITE_ONEOF(msg, uint64_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 4);
}
UPB_INLINE void google_api_expr_v1alpha1_Value_set_double_value(google_api_expr_v1alpha1_Value *msg, double value) {
  UPB_WRITE_ONEOF(msg, double, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 5);
}
UPB_INLINE void google_api_expr_v1alpha1_Value_set_string_value(google_api_expr_v1alpha1_Value *msg, upb_strview value) {
  UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 6);
}
UPB_INLINE void google_api_expr_v1alpha1_Value_set_bytes_value(google_api_expr_v1alpha1_Value *msg, upb_strview value) {
  UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 7);
}
UPB_INLINE void google_api_expr_v1alpha1_Value_set_enum_value(google_api_expr_v1alpha1_Value *msg, google_api_expr_v1alpha1_EnumValue* value) {
  UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_EnumValue*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 9);
}
UPB_INLINE struct google_api_expr_v1alpha1_EnumValue* google_api_expr_v1alpha1_Value_mutable_enum_value(google_api_expr_v1alpha1_Value *msg, upb_arena *arena) {
  struct google_api_expr_v1alpha1_EnumValue* sub = (struct google_api_expr_v1alpha1_EnumValue*)google_api_expr_v1alpha1_Value_enum_value(msg);
  if (sub == NULL) {
    sub = (struct google_api_expr_v1alpha1_EnumValue*)_upb_msg_new(&google_api_expr_v1alpha1_EnumValue_msginit, arena);
    if (!sub) return NULL;
    google_api_expr_v1alpha1_Value_set_enum_value(msg, sub);
  }
  return sub;
}
UPB_INLINE void google_api_expr_v1alpha1_Value_set_object_value(google_api_expr_v1alpha1_Value *msg, struct google_protobuf_Any* value) {
  UPB_WRITE_ONEOF(msg, struct google_protobuf_Any*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 10);
}
UPB_INLINE struct google_protobuf_Any* google_api_expr_v1alpha1_Value_mutable_object_value(google_api_expr_v1alpha1_Value *msg, upb_arena *arena) {
  struct google_protobuf_Any* sub = (struct google_protobuf_Any*)google_api_expr_v1alpha1_Value_object_value(msg);
  if (sub == NULL) {
    sub = (struct google_protobuf_Any*)_upb_msg_new(&google_protobuf_Any_msginit, arena);
    if (!sub) return NULL;
    google_api_expr_v1alpha1_Value_set_object_value(msg, sub);
  }
  return sub;
}
UPB_INLINE void google_api_expr_v1alpha1_Value_set_map_value(google_api_expr_v1alpha1_Value *msg, google_api_expr_v1alpha1_MapValue* value) {
  UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_MapValue*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 11);
}
UPB_INLINE struct google_api_expr_v1alpha1_MapValue* google_api_expr_v1alpha1_Value_mutable_map_value(google_api_expr_v1alpha1_Value *msg, upb_arena *arena) {
  struct google_api_expr_v1alpha1_MapValue* sub = (struct google_api_expr_v1alpha1_MapValue*)google_api_expr_v1alpha1_Value_map_value(msg);
  if (sub == NULL) {
    sub = (struct google_api_expr_v1alpha1_MapValue*)_upb_msg_new(&google_api_expr_v1alpha1_MapValue_msginit, arena);
    if (!sub) return NULL;
    google_api_expr_v1alpha1_Value_set_map_value(msg, sub);
  }
  return sub;
}
UPB_INLINE void google_api_expr_v1alpha1_Value_set_list_value(google_api_expr_v1alpha1_Value *msg, google_api_expr_v1alpha1_ListValue* value) {
  UPB_WRITE_ONEOF(msg, google_api_expr_v1alpha1_ListValue*, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 12);
}
UPB_INLINE struct google_api_expr_v1alpha1_ListValue* google_api_expr_v1alpha1_Value_mutable_list_value(google_api_expr_v1alpha1_Value *msg, upb_arena *arena) {
  struct google_api_expr_v1alpha1_ListValue* sub = (struct google_api_expr_v1alpha1_ListValue*)google_api_expr_v1alpha1_Value_list_value(msg);
  if (sub == NULL) {
    sub = (struct google_api_expr_v1alpha1_ListValue*)_upb_msg_new(&google_api_expr_v1alpha1_ListValue_msginit, arena);
    if (!sub) return NULL;
    google_api_expr_v1alpha1_Value_set_list_value(msg, sub);
  }
  return sub;
}
UPB_INLINE void google_api_expr_v1alpha1_Value_set_type_value(google_api_expr_v1alpha1_Value *msg, upb_strview value) {
  UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 15);
}

/* google.api.expr.v1alpha1.EnumValue */

UPB_INLINE google_api_expr_v1alpha1_EnumValue *google_api_expr_v1alpha1_EnumValue_new(upb_arena *arena) {
  return (google_api_expr_v1alpha1_EnumValue *)_upb_msg_new(&google_api_expr_v1alpha1_EnumValue_msginit, arena);
}
UPB_INLINE google_api_expr_v1alpha1_EnumValue *google_api_expr_v1alpha1_EnumValue_parse(const char *buf, size_t size,
                        upb_arena *arena) {
  google_api_expr_v1alpha1_EnumValue *ret = google_api_expr_v1alpha1_EnumValue_new(arena);
  if (!ret) return NULL;
  if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_EnumValue_msginit, arena)) return NULL;
  return ret;
}
UPB_INLINE google_api_expr_v1alpha1_EnumValue *google_api_expr_v1alpha1_EnumValue_parse_ex(const char *buf, size_t size,
                           const upb_extreg *extreg, int options,
                           upb_arena *arena) {
  google_api_expr_v1alpha1_EnumValue *ret = google_api_expr_v1alpha1_EnumValue_new(arena);
  if (!ret) return NULL;
  if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_EnumValue_msginit, extreg, options, arena)) {
    return NULL;
  }
  return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_EnumValue_serialize(const google_api_expr_v1alpha1_EnumValue *msg, upb_arena *arena, size_t *len) {
  return upb_encode(msg, &google_api_expr_v1alpha1_EnumValue_msginit, arena, len);
}

UPB_INLINE upb_strview google_api_expr_v1alpha1_EnumValue_type(const google_api_expr_v1alpha1_EnumValue *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
UPB_INLINE int32_t google_api_expr_v1alpha1_EnumValue_value(const google_api_expr_v1alpha1_EnumValue *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t); }

UPB_INLINE void google_api_expr_v1alpha1_EnumValue_set_type(google_api_expr_v1alpha1_EnumValue *msg, upb_strview value) {
  *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
UPB_INLINE void google_api_expr_v1alpha1_EnumValue_set_value(google_api_expr_v1alpha1_EnumValue *msg, int32_t value) {
  *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = value;
}

/* google.api.expr.v1alpha1.ListValue */

UPB_INLINE google_api_expr_v1alpha1_ListValue *google_api_expr_v1alpha1_ListValue_new(upb_arena *arena) {
  return (google_api_expr_v1alpha1_ListValue *)_upb_msg_new(&google_api_expr_v1alpha1_ListValue_msginit, arena);
}
UPB_INLINE google_api_expr_v1alpha1_ListValue *google_api_expr_v1alpha1_ListValue_parse(const char *buf, size_t size,
                        upb_arena *arena) {
  google_api_expr_v1alpha1_ListValue *ret = google_api_expr_v1alpha1_ListValue_new(arena);
  if (!ret) return NULL;
  if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_ListValue_msginit, arena)) return NULL;
  return ret;
}
UPB_INLINE google_api_expr_v1alpha1_ListValue *google_api_expr_v1alpha1_ListValue_parse_ex(const char *buf, size_t size,
                           const upb_extreg *extreg, int options,
                           upb_arena *arena) {
  google_api_expr_v1alpha1_ListValue *ret = google_api_expr_v1alpha1_ListValue_new(arena);
  if (!ret) return NULL;
  if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_ListValue_msginit, extreg, options, arena)) {
    return NULL;
  }
  return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_ListValue_serialize(const google_api_expr_v1alpha1_ListValue *msg, upb_arena *arena, size_t *len) {
  return upb_encode(msg, &google_api_expr_v1alpha1_ListValue_msginit, arena, len);
}

UPB_INLINE bool google_api_expr_v1alpha1_ListValue_has_values(const google_api_expr_v1alpha1_ListValue *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
UPB_INLINE const google_api_expr_v1alpha1_Value* const* google_api_expr_v1alpha1_ListValue_values(const google_api_expr_v1alpha1_ListValue *msg, size_t *len) { return (const google_api_expr_v1alpha1_Value* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }

UPB_INLINE google_api_expr_v1alpha1_Value** google_api_expr_v1alpha1_ListValue_mutable_values(google_api_expr_v1alpha1_ListValue *msg, size_t *len) {
  return (google_api_expr_v1alpha1_Value**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
UPB_INLINE google_api_expr_v1alpha1_Value** google_api_expr_v1alpha1_ListValue_resize_values(google_api_expr_v1alpha1_ListValue *msg, size_t len, upb_arena *arena) {
  return (google_api_expr_v1alpha1_Value**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct google_api_expr_v1alpha1_Value* google_api_expr_v1alpha1_ListValue_add_values(google_api_expr_v1alpha1_ListValue *msg, upb_arena *arena) {
  struct google_api_expr_v1alpha1_Value* sub = (struct google_api_expr_v1alpha1_Value*)_upb_msg_new(&google_api_expr_v1alpha1_Value_msginit, arena);
  bool ok = _upb_array_append_accessor2(
      msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
  if (!ok) return NULL;
  return sub;
}

/* google.api.expr.v1alpha1.MapValue */

UPB_INLINE google_api_expr_v1alpha1_MapValue *google_api_expr_v1alpha1_MapValue_new(upb_arena *arena) {
  return (google_api_expr_v1alpha1_MapValue *)_upb_msg_new(&google_api_expr_v1alpha1_MapValue_msginit, arena);
}
UPB_INLINE google_api_expr_v1alpha1_MapValue *google_api_expr_v1alpha1_MapValue_parse(const char *buf, size_t size,
                        upb_arena *arena) {
  google_api_expr_v1alpha1_MapValue *ret = google_api_expr_v1alpha1_MapValue_new(arena);
  if (!ret) return NULL;
  if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_MapValue_msginit, arena)) return NULL;
  return ret;
}
UPB_INLINE google_api_expr_v1alpha1_MapValue *google_api_expr_v1alpha1_MapValue_parse_ex(const char *buf, size_t size,
                           const upb_extreg *extreg, int options,
                           upb_arena *arena) {
  google_api_expr_v1alpha1_MapValue *ret = google_api_expr_v1alpha1_MapValue_new(arena);
  if (!ret) return NULL;
  if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_MapValue_msginit, extreg, options, arena)) {
    return NULL;
  }
  return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_MapValue_serialize(const google_api_expr_v1alpha1_MapValue *msg, upb_arena *arena, size_t *len) {
  return upb_encode(msg, &google_api_expr_v1alpha1_MapValue_msginit, arena, len);
}

UPB_INLINE bool google_api_expr_v1alpha1_MapValue_has_entries(const google_api_expr_v1alpha1_MapValue *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
UPB_INLINE const google_api_expr_v1alpha1_MapValue_Entry* const* google_api_expr_v1alpha1_MapValue_entries(const google_api_expr_v1alpha1_MapValue *msg, size_t *len) { return (const google_api_expr_v1alpha1_MapValue_Entry* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }

UPB_INLINE google_api_expr_v1alpha1_MapValue_Entry** google_api_expr_v1alpha1_MapValue_mutable_entries(google_api_expr_v1alpha1_MapValue *msg, size_t *len) {
  return (google_api_expr_v1alpha1_MapValue_Entry**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
UPB_INLINE google_api_expr_v1alpha1_MapValue_Entry** google_api_expr_v1alpha1_MapValue_resize_entries(google_api_expr_v1alpha1_MapValue *msg, size_t len, upb_arena *arena) {
  return (google_api_expr_v1alpha1_MapValue_Entry**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct google_api_expr_v1alpha1_MapValue_Entry* google_api_expr_v1alpha1_MapValue_add_entries(google_api_expr_v1alpha1_MapValue *msg, upb_arena *arena) {
  struct google_api_expr_v1alpha1_MapValue_Entry* sub = (struct google_api_expr_v1alpha1_MapValue_Entry*)_upb_msg_new(&google_api_expr_v1alpha1_MapValue_Entry_msginit, arena);
  bool ok = _upb_array_append_accessor2(
      msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
  if (!ok) return NULL;
  return sub;
}

/* google.api.expr.v1alpha1.MapValue.Entry */

UPB_INLINE google_api_expr_v1alpha1_MapValue_Entry *google_api_expr_v1alpha1_MapValue_Entry_new(upb_arena *arena) {
  return (google_api_expr_v1alpha1_MapValue_Entry *)_upb_msg_new(&google_api_expr_v1alpha1_MapValue_Entry_msginit, arena);
}
UPB_INLINE google_api_expr_v1alpha1_MapValue_Entry *google_api_expr_v1alpha1_MapValue_Entry_parse(const char *buf, size_t size,
                        upb_arena *arena) {
  google_api_expr_v1alpha1_MapValue_Entry *ret = google_api_expr_v1alpha1_MapValue_Entry_new(arena);
  if (!ret) return NULL;
  if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_MapValue_Entry_msginit, arena)) return NULL;
  return ret;
}
UPB_INLINE google_api_expr_v1alpha1_MapValue_Entry *google_api_expr_v1alpha1_MapValue_Entry_parse_ex(const char *buf, size_t size,
                           const upb_extreg *extreg, int options,
                           upb_arena *arena) {
  google_api_expr_v1alpha1_MapValue_Entry *ret = google_api_expr_v1alpha1_MapValue_Entry_new(arena);
  if (!ret) return NULL;
  if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_MapValue_Entry_msginit, extreg, options, arena)) {
    return NULL;
  }
  return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_MapValue_Entry_serialize(const google_api_expr_v1alpha1_MapValue_Entry *msg, upb_arena *arena, size_t *len) {
  return upb_encode(msg, &google_api_expr_v1alpha1_MapValue_Entry_msginit, arena, len);
}

UPB_INLINE bool google_api_expr_v1alpha1_MapValue_Entry_has_key(const google_api_expr_v1alpha1_MapValue_Entry *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE const google_api_expr_v1alpha1_Value* google_api_expr_v1alpha1_MapValue_Entry_key(const google_api_expr_v1alpha1_MapValue_Entry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const google_api_expr_v1alpha1_Value*); }
UPB_INLINE bool google_api_expr_v1alpha1_MapValue_Entry_has_value(const google_api_expr_v1alpha1_MapValue_Entry *msg) { return _upb_hasbit(msg, 2); }
UPB_INLINE const google_api_expr_v1alpha1_Value* google_api_expr_v1alpha1_MapValue_Entry_value(const google_api_expr_v1alpha1_MapValue_Entry *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const google_api_expr_v1alpha1_Value*); }

UPB_INLINE void google_api_expr_v1alpha1_MapValue_Entry_set_key(google_api_expr_v1alpha1_MapValue_Entry *msg, google_api_expr_v1alpha1_Value* value) {
  _upb_sethas(msg, 1);
  *UPB_PTR_AT(msg, UPB_SIZE(4, 8), google_api_expr_v1alpha1_Value*) = value;
}
UPB_INLINE struct google_api_expr_v1alpha1_Value* google_api_expr_v1alpha1_MapValue_Entry_mutable_key(google_api_expr_v1alpha1_MapValue_Entry *msg, upb_arena *arena) {
  struct google_api_expr_v1alpha1_Value* sub = (struct google_api_expr_v1alpha1_Value*)google_api_expr_v1alpha1_MapValue_Entry_key(msg);
  if (sub == NULL) {
    sub = (struct google_api_expr_v1alpha1_Value*)_upb_msg_new(&google_api_expr_v1alpha1_Value_msginit, arena);
    if (!sub) return NULL;
    google_api_expr_v1alpha1_MapValue_Entry_set_key(msg, sub);
  }
  return sub;
}
UPB_INLINE void google_api_expr_v1alpha1_MapValue_Entry_set_value(google_api_expr_v1alpha1_MapValue_Entry *msg, google_api_expr_v1alpha1_Value* value) {
  _upb_sethas(msg, 2);
  *UPB_PTR_AT(msg, UPB_SIZE(8, 16), google_api_expr_v1alpha1_Value*) = value;
}
UPB_INLINE struct google_api_expr_v1alpha1_Value* google_api_expr_v1alpha1_MapValue_Entry_mutable_value(google_api_expr_v1alpha1_MapValue_Entry *msg, upb_arena *arena) {
  struct google_api_expr_v1alpha1_Value* sub = (struct google_api_expr_v1alpha1_Value*)google_api_expr_v1alpha1_MapValue_Entry_value(msg);
  if (sub == NULL) {
    sub = (struct google_api_expr_v1alpha1_Value*)_upb_msg_new(&google_api_expr_v1alpha1_Value_msginit, arena);
    if (!sub) return NULL;
    google_api_expr_v1alpha1_MapValue_Entry_set_value(msg, sub);
  }
  return sub;
}

extern const upb_msglayout_file google_api_expr_v1alpha1_value_proto_upb_file_layout;

#ifdef __cplusplus
}  /* extern "C" */
#endif

#include "upb/port_undef.inc"

#endif  /* GOOGLE_API_EXPR_V1ALPHA1_VALUE_PROTO_UPB_H_ */
