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

#ifndef GOOGLE_API_EXPR_V1ALPHA1_EXPLAIN_PROTO_UPB_H_
#define GOOGLE_API_EXPR_V1ALPHA1_EXPLAIN_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_Explain;
struct google_api_expr_v1alpha1_Explain_ExprStep;
typedef struct google_api_expr_v1alpha1_Explain google_api_expr_v1alpha1_Explain;
typedef struct google_api_expr_v1alpha1_Explain_ExprStep google_api_expr_v1alpha1_Explain_ExprStep;
extern const upb_msglayout google_api_expr_v1alpha1_Explain_msginit;
extern const upb_msglayout google_api_expr_v1alpha1_Explain_ExprStep_msginit;
struct google_api_expr_v1alpha1_Value;
extern const upb_msglayout google_api_expr_v1alpha1_Value_msginit;


/* google.api.expr.v1alpha1.Explain */

UPB_INLINE google_api_expr_v1alpha1_Explain *google_api_expr_v1alpha1_Explain_new(upb_arena *arena) {
  return (google_api_expr_v1alpha1_Explain *)_upb_msg_new(&google_api_expr_v1alpha1_Explain_msginit, arena);
}
UPB_INLINE google_api_expr_v1alpha1_Explain *google_api_expr_v1alpha1_Explain_parse(const char *buf, size_t size,
                        upb_arena *arena) {
  google_api_expr_v1alpha1_Explain *ret = google_api_expr_v1alpha1_Explain_new(arena);
  if (!ret) return NULL;
  if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Explain_msginit, arena)) return NULL;
  return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Explain *google_api_expr_v1alpha1_Explain_parse_ex(const char *buf, size_t size,
                           const upb_extreg *extreg, int options,
                           upb_arena *arena) {
  google_api_expr_v1alpha1_Explain *ret = google_api_expr_v1alpha1_Explain_new(arena);
  if (!ret) return NULL;
  if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Explain_msginit, extreg, options, arena)) {
    return NULL;
  }
  return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Explain_serialize(const google_api_expr_v1alpha1_Explain *msg, upb_arena *arena, size_t *len) {
  return upb_encode(msg, &google_api_expr_v1alpha1_Explain_msginit, arena, len);
}

UPB_INLINE bool google_api_expr_v1alpha1_Explain_has_values(const google_api_expr_v1alpha1_Explain *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
UPB_INLINE const struct google_api_expr_v1alpha1_Value* const* google_api_expr_v1alpha1_Explain_values(const google_api_expr_v1alpha1_Explain *msg, size_t *len) { return (const struct google_api_expr_v1alpha1_Value* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
UPB_INLINE bool google_api_expr_v1alpha1_Explain_has_expr_steps(const google_api_expr_v1alpha1_Explain *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); }
UPB_INLINE const google_api_expr_v1alpha1_Explain_ExprStep* const* google_api_expr_v1alpha1_Explain_expr_steps(const google_api_expr_v1alpha1_Explain *msg, size_t *len) { return (const google_api_expr_v1alpha1_Explain_ExprStep* const*)_upb_array_accessor(msg, UPB_SIZE(4, 8), len); }

UPB_INLINE struct google_api_expr_v1alpha1_Value** google_api_expr_v1alpha1_Explain_mutable_values(google_api_expr_v1alpha1_Explain *msg, size_t *len) {
  return (struct google_api_expr_v1alpha1_Value**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
}
UPB_INLINE struct google_api_expr_v1alpha1_Value** google_api_expr_v1alpha1_Explain_resize_values(google_api_expr_v1alpha1_Explain *msg, size_t len, upb_arena *arena) {
  return (struct 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_Explain_add_values(google_api_expr_v1alpha1_Explain *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;
}
UPB_INLINE google_api_expr_v1alpha1_Explain_ExprStep** google_api_expr_v1alpha1_Explain_mutable_expr_steps(google_api_expr_v1alpha1_Explain *msg, size_t *len) {
  return (google_api_expr_v1alpha1_Explain_ExprStep**)_upb_array_mutable_accessor(msg, UPB_SIZE(4, 8), len);
}
UPB_INLINE google_api_expr_v1alpha1_Explain_ExprStep** google_api_expr_v1alpha1_Explain_resize_expr_steps(google_api_expr_v1alpha1_Explain *msg, size_t len, upb_arena *arena) {
  return (google_api_expr_v1alpha1_Explain_ExprStep**)_upb_array_resize_accessor2(msg, UPB_SIZE(4, 8), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct google_api_expr_v1alpha1_Explain_ExprStep* google_api_expr_v1alpha1_Explain_add_expr_steps(google_api_expr_v1alpha1_Explain *msg, upb_arena *arena) {
  struct google_api_expr_v1alpha1_Explain_ExprStep* sub = (struct google_api_expr_v1alpha1_Explain_ExprStep*)_upb_msg_new(&google_api_expr_v1alpha1_Explain_ExprStep_msginit, arena);
  bool ok = _upb_array_append_accessor2(
      msg, UPB_SIZE(4, 8), UPB_SIZE(2, 3), &sub, arena);
  if (!ok) return NULL;
  return sub;
}

/* google.api.expr.v1alpha1.Explain.ExprStep */

UPB_INLINE google_api_expr_v1alpha1_Explain_ExprStep *google_api_expr_v1alpha1_Explain_ExprStep_new(upb_arena *arena) {
  return (google_api_expr_v1alpha1_Explain_ExprStep *)_upb_msg_new(&google_api_expr_v1alpha1_Explain_ExprStep_msginit, arena);
}
UPB_INLINE google_api_expr_v1alpha1_Explain_ExprStep *google_api_expr_v1alpha1_Explain_ExprStep_parse(const char *buf, size_t size,
                        upb_arena *arena) {
  google_api_expr_v1alpha1_Explain_ExprStep *ret = google_api_expr_v1alpha1_Explain_ExprStep_new(arena);
  if (!ret) return NULL;
  if (!upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Explain_ExprStep_msginit, arena)) return NULL;
  return ret;
}
UPB_INLINE google_api_expr_v1alpha1_Explain_ExprStep *google_api_expr_v1alpha1_Explain_ExprStep_parse_ex(const char *buf, size_t size,
                           const upb_extreg *extreg, int options,
                           upb_arena *arena) {
  google_api_expr_v1alpha1_Explain_ExprStep *ret = google_api_expr_v1alpha1_Explain_ExprStep_new(arena);
  if (!ret) return NULL;
  if (!_upb_decode(buf, size, ret, &google_api_expr_v1alpha1_Explain_ExprStep_msginit, extreg, options, arena)) {
    return NULL;
  }
  return ret;
}
UPB_INLINE char *google_api_expr_v1alpha1_Explain_ExprStep_serialize(const google_api_expr_v1alpha1_Explain_ExprStep *msg, upb_arena *arena, size_t *len) {
  return upb_encode(msg, &google_api_expr_v1alpha1_Explain_ExprStep_msginit, arena, len);
}

UPB_INLINE int64_t google_api_expr_v1alpha1_Explain_ExprStep_id(const google_api_expr_v1alpha1_Explain_ExprStep *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t); }
UPB_INLINE int32_t google_api_expr_v1alpha1_Explain_ExprStep_value_index(const google_api_expr_v1alpha1_Explain_ExprStep *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t); }

UPB_INLINE void google_api_expr_v1alpha1_Explain_ExprStep_set_id(google_api_expr_v1alpha1_Explain_ExprStep *msg, int64_t value) {
  *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = value;
}
UPB_INLINE void google_api_expr_v1alpha1_Explain_ExprStep_set_value_index(google_api_expr_v1alpha1_Explain_ExprStep *msg, int32_t value) {
  *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int32_t) = value;
}

extern const upb_msglayout_file google_api_expr_v1alpha1_explain_proto_upb_file_layout;

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

#include "upb/port_undef.inc"

#endif  /* GOOGLE_API_EXPR_V1ALPHA1_EXPLAIN_PROTO_UPB_H_ */
