/* This file was generated by upbc (the upb compiler) from the input
 * file:
 *
 *     xds/type/matcher/v3/cel.proto
 *
 * Do not edit -- your changes will be discarded when the file is
 * regenerated. */

#ifndef XDS_TYPE_MATCHER_V3_CEL_PROTO_UPB_H_
#define XDS_TYPE_MATCHER_V3_CEL_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 xds_type_matcher_v3_CelMatcher;
typedef struct xds_type_matcher_v3_CelMatcher xds_type_matcher_v3_CelMatcher;
extern const upb_MiniTable xds_type_matcher_v3_CelMatcher_msginit;
struct xds_type_v3_CelExpression;
extern const upb_MiniTable xds_type_v3_CelExpression_msginit;



/* xds.type.matcher.v3.CelMatcher */

UPB_INLINE xds_type_matcher_v3_CelMatcher* xds_type_matcher_v3_CelMatcher_new(upb_Arena* arena) {
  return (xds_type_matcher_v3_CelMatcher*)_upb_Message_New(&xds_type_matcher_v3_CelMatcher_msginit, arena);
}
UPB_INLINE xds_type_matcher_v3_CelMatcher* xds_type_matcher_v3_CelMatcher_parse(const char* buf, size_t size, upb_Arena* arena) {
  xds_type_matcher_v3_CelMatcher* ret = xds_type_matcher_v3_CelMatcher_new(arena);
  if (!ret) return NULL;
  if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_CelMatcher_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
    return NULL;
  }
  return ret;
}
UPB_INLINE xds_type_matcher_v3_CelMatcher* xds_type_matcher_v3_CelMatcher_parse_ex(const char* buf, size_t size,
                           const upb_ExtensionRegistry* extreg,
                           int options, upb_Arena* arena) {
  xds_type_matcher_v3_CelMatcher* ret = xds_type_matcher_v3_CelMatcher_new(arena);
  if (!ret) return NULL;
  if (upb_Decode(buf, size, ret, &xds_type_matcher_v3_CelMatcher_msginit, extreg, options, arena) !=
      kUpb_DecodeStatus_Ok) {
    return NULL;
  }
  return ret;
}
UPB_INLINE char* xds_type_matcher_v3_CelMatcher_serialize(const xds_type_matcher_v3_CelMatcher* msg, upb_Arena* arena, size_t* len) {
  char* ptr;
  (void)upb_Encode(msg, &xds_type_matcher_v3_CelMatcher_msginit, 0, arena, &ptr, len);
  return ptr;
}
UPB_INLINE char* xds_type_matcher_v3_CelMatcher_serialize_ex(const xds_type_matcher_v3_CelMatcher* msg, int options,
                                 upb_Arena* arena, size_t* len) {
  char* ptr;
  (void)upb_Encode(msg, &xds_type_matcher_v3_CelMatcher_msginit, options, arena, &ptr, len);
  return ptr;
}
UPB_INLINE bool xds_type_matcher_v3_CelMatcher_has_expr_match(const xds_type_matcher_v3_CelMatcher* msg) {
  return _upb_hasbit(msg, 1);
}
UPB_INLINE void xds_type_matcher_v3_CelMatcher_clear_expr_match(const xds_type_matcher_v3_CelMatcher* msg) {
  *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
}
UPB_INLINE const struct xds_type_v3_CelExpression* xds_type_matcher_v3_CelMatcher_expr_match(const xds_type_matcher_v3_CelMatcher* msg) {
  return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct xds_type_v3_CelExpression*);
}

UPB_INLINE void xds_type_matcher_v3_CelMatcher_set_expr_match(xds_type_matcher_v3_CelMatcher *msg, struct xds_type_v3_CelExpression* value) {
  _upb_sethas(msg, 1);
  *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct xds_type_v3_CelExpression*) = value;
}
UPB_INLINE struct xds_type_v3_CelExpression* xds_type_matcher_v3_CelMatcher_mutable_expr_match(xds_type_matcher_v3_CelMatcher* msg, upb_Arena* arena) {
  struct xds_type_v3_CelExpression* sub = (struct xds_type_v3_CelExpression*)xds_type_matcher_v3_CelMatcher_expr_match(msg);
  if (sub == NULL) {
    sub = (struct xds_type_v3_CelExpression*)_upb_Message_New(&xds_type_v3_CelExpression_msginit, arena);
    if (!sub) return NULL;
    xds_type_matcher_v3_CelMatcher_set_expr_match(msg, sub);
  }
  return sub;
}

extern const upb_MiniTable_File xds_type_matcher_v3_cel_proto_upb_file_layout;

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

#include "upb/port_undef.inc"

#endif  /* XDS_TYPE_MATCHER_V3_CEL_PROTO_UPB_H_ */
