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

#ifndef XDS_TYPE_V3_CEL_PROTO_UPB_H_
#define XDS_TYPE_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_v3_CelExpression;
struct xds_type_v3_CelExtractString;
typedef struct xds_type_v3_CelExpression xds_type_v3_CelExpression;
typedef struct xds_type_v3_CelExtractString xds_type_v3_CelExtractString;
extern const upb_MiniTable xds_type_v3_CelExpression_msginit;
extern const upb_MiniTable xds_type_v3_CelExtractString_msginit;
struct google_api_expr_v1alpha1_CheckedExpr;
struct google_api_expr_v1alpha1_ParsedExpr;
struct google_protobuf_StringValue;
extern const upb_MiniTable google_api_expr_v1alpha1_CheckedExpr_msginit;
extern const upb_MiniTable google_api_expr_v1alpha1_ParsedExpr_msginit;
extern const upb_MiniTable google_protobuf_StringValue_msginit;



/* xds.type.v3.CelExpression */

UPB_INLINE xds_type_v3_CelExpression* xds_type_v3_CelExpression_new(upb_Arena* arena) {
  return (xds_type_v3_CelExpression*)_upb_Message_New(&xds_type_v3_CelExpression_msginit, arena);
}
UPB_INLINE xds_type_v3_CelExpression* xds_type_v3_CelExpression_parse(const char* buf, size_t size, upb_Arena* arena) {
  xds_type_v3_CelExpression* ret = xds_type_v3_CelExpression_new(arena);
  if (!ret) return NULL;
  if (upb_Decode(buf, size, ret, &xds_type_v3_CelExpression_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
    return NULL;
  }
  return ret;
}
UPB_INLINE xds_type_v3_CelExpression* xds_type_v3_CelExpression_parse_ex(const char* buf, size_t size,
                           const upb_ExtensionRegistry* extreg,
                           int options, upb_Arena* arena) {
  xds_type_v3_CelExpression* ret = xds_type_v3_CelExpression_new(arena);
  if (!ret) return NULL;
  if (upb_Decode(buf, size, ret, &xds_type_v3_CelExpression_msginit, extreg, options, arena) !=
      kUpb_DecodeStatus_Ok) {
    return NULL;
  }
  return ret;
}
UPB_INLINE char* xds_type_v3_CelExpression_serialize(const xds_type_v3_CelExpression* msg, upb_Arena* arena, size_t* len) {
  char* ptr;
  (void)upb_Encode(msg, &xds_type_v3_CelExpression_msginit, 0, arena, &ptr, len);
  return ptr;
}
UPB_INLINE char* xds_type_v3_CelExpression_serialize_ex(const xds_type_v3_CelExpression* msg, int options,
                                 upb_Arena* arena, size_t* len) {
  char* ptr;
  (void)upb_Encode(msg, &xds_type_v3_CelExpression_msginit, options, arena, &ptr, len);
  return ptr;
}
typedef enum {
  xds_type_v3_CelExpression_expr_specifier_parsed_expr = 1,
  xds_type_v3_CelExpression_expr_specifier_checked_expr = 2,
  xds_type_v3_CelExpression_expr_specifier_NOT_SET = 0
} xds_type_v3_CelExpression_expr_specifier_oneofcases;
UPB_INLINE xds_type_v3_CelExpression_expr_specifier_oneofcases xds_type_v3_CelExpression_expr_specifier_case(const xds_type_v3_CelExpression* msg) {
  return (xds_type_v3_CelExpression_expr_specifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t);
}
UPB_INLINE bool xds_type_v3_CelExpression_has_parsed_expr(const xds_type_v3_CelExpression* msg) {
  return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 1;
}
UPB_INLINE void xds_type_v3_CelExpression_clear_parsed_expr(const xds_type_v3_CelExpression* msg) {
  UPB_WRITE_ONEOF(msg, struct google_api_expr_v1alpha1_ParsedExpr*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_type_v3_CelExpression_expr_specifier_NOT_SET);
}
UPB_INLINE const struct google_api_expr_v1alpha1_ParsedExpr* xds_type_v3_CelExpression_parsed_expr(const xds_type_v3_CelExpression* msg) {
  return UPB_READ_ONEOF(msg, const struct google_api_expr_v1alpha1_ParsedExpr*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 1, NULL);
}
UPB_INLINE bool xds_type_v3_CelExpression_has_checked_expr(const xds_type_v3_CelExpression* msg) {
  return _upb_getoneofcase(msg, UPB_SIZE(0, 0)) == 2;
}
UPB_INLINE void xds_type_v3_CelExpression_clear_checked_expr(const xds_type_v3_CelExpression* msg) {
  UPB_WRITE_ONEOF(msg, struct google_api_expr_v1alpha1_CheckedExpr*, UPB_SIZE(4, 8), 0, UPB_SIZE(0, 0), xds_type_v3_CelExpression_expr_specifier_NOT_SET);
}
UPB_INLINE const struct google_api_expr_v1alpha1_CheckedExpr* xds_type_v3_CelExpression_checked_expr(const xds_type_v3_CelExpression* msg) {
  return UPB_READ_ONEOF(msg, const struct google_api_expr_v1alpha1_CheckedExpr*, UPB_SIZE(4, 8), UPB_SIZE(0, 0), 2, NULL);
}

UPB_INLINE void xds_type_v3_CelExpression_set_parsed_expr(xds_type_v3_CelExpression *msg, struct google_api_expr_v1alpha1_ParsedExpr* value) {
  UPB_WRITE_ONEOF(msg, struct google_api_expr_v1alpha1_ParsedExpr*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 1);
}
UPB_INLINE struct google_api_expr_v1alpha1_ParsedExpr* xds_type_v3_CelExpression_mutable_parsed_expr(xds_type_v3_CelExpression* msg, upb_Arena* arena) {
  struct google_api_expr_v1alpha1_ParsedExpr* sub = (struct google_api_expr_v1alpha1_ParsedExpr*)xds_type_v3_CelExpression_parsed_expr(msg);
  if (sub == NULL) {
    sub = (struct google_api_expr_v1alpha1_ParsedExpr*)_upb_Message_New(&google_api_expr_v1alpha1_ParsedExpr_msginit, arena);
    if (!sub) return NULL;
    xds_type_v3_CelExpression_set_parsed_expr(msg, sub);
  }
  return sub;
}
UPB_INLINE void xds_type_v3_CelExpression_set_checked_expr(xds_type_v3_CelExpression *msg, struct google_api_expr_v1alpha1_CheckedExpr* value) {
  UPB_WRITE_ONEOF(msg, struct google_api_expr_v1alpha1_CheckedExpr*, UPB_SIZE(4, 8), value, UPB_SIZE(0, 0), 2);
}
UPB_INLINE struct google_api_expr_v1alpha1_CheckedExpr* xds_type_v3_CelExpression_mutable_checked_expr(xds_type_v3_CelExpression* msg, upb_Arena* arena) {
  struct google_api_expr_v1alpha1_CheckedExpr* sub = (struct google_api_expr_v1alpha1_CheckedExpr*)xds_type_v3_CelExpression_checked_expr(msg);
  if (sub == NULL) {
    sub = (struct google_api_expr_v1alpha1_CheckedExpr*)_upb_Message_New(&google_api_expr_v1alpha1_CheckedExpr_msginit, arena);
    if (!sub) return NULL;
    xds_type_v3_CelExpression_set_checked_expr(msg, sub);
  }
  return sub;
}

/* xds.type.v3.CelExtractString */

UPB_INLINE xds_type_v3_CelExtractString* xds_type_v3_CelExtractString_new(upb_Arena* arena) {
  return (xds_type_v3_CelExtractString*)_upb_Message_New(&xds_type_v3_CelExtractString_msginit, arena);
}
UPB_INLINE xds_type_v3_CelExtractString* xds_type_v3_CelExtractString_parse(const char* buf, size_t size, upb_Arena* arena) {
  xds_type_v3_CelExtractString* ret = xds_type_v3_CelExtractString_new(arena);
  if (!ret) return NULL;
  if (upb_Decode(buf, size, ret, &xds_type_v3_CelExtractString_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
    return NULL;
  }
  return ret;
}
UPB_INLINE xds_type_v3_CelExtractString* xds_type_v3_CelExtractString_parse_ex(const char* buf, size_t size,
                           const upb_ExtensionRegistry* extreg,
                           int options, upb_Arena* arena) {
  xds_type_v3_CelExtractString* ret = xds_type_v3_CelExtractString_new(arena);
  if (!ret) return NULL;
  if (upb_Decode(buf, size, ret, &xds_type_v3_CelExtractString_msginit, extreg, options, arena) !=
      kUpb_DecodeStatus_Ok) {
    return NULL;
  }
  return ret;
}
UPB_INLINE char* xds_type_v3_CelExtractString_serialize(const xds_type_v3_CelExtractString* msg, upb_Arena* arena, size_t* len) {
  char* ptr;
  (void)upb_Encode(msg, &xds_type_v3_CelExtractString_msginit, 0, arena, &ptr, len);
  return ptr;
}
UPB_INLINE char* xds_type_v3_CelExtractString_serialize_ex(const xds_type_v3_CelExtractString* msg, int options,
                                 upb_Arena* arena, size_t* len) {
  char* ptr;
  (void)upb_Encode(msg, &xds_type_v3_CelExtractString_msginit, options, arena, &ptr, len);
  return ptr;
}
UPB_INLINE bool xds_type_v3_CelExtractString_has_expr_extract(const xds_type_v3_CelExtractString* msg) {
  return _upb_hasbit(msg, 1);
}
UPB_INLINE void xds_type_v3_CelExtractString_clear_expr_extract(const xds_type_v3_CelExtractString* msg) {
  *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const upb_Message*) = NULL;
}
UPB_INLINE const xds_type_v3_CelExpression* xds_type_v3_CelExtractString_expr_extract(const xds_type_v3_CelExtractString* msg) {
  return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const xds_type_v3_CelExpression*);
}
UPB_INLINE bool xds_type_v3_CelExtractString_has_default_value(const xds_type_v3_CelExtractString* msg) {
  return _upb_hasbit(msg, 2);
}
UPB_INLINE void xds_type_v3_CelExtractString_clear_default_value(const xds_type_v3_CelExtractString* msg) {
  *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const upb_Message*) = NULL;
}
UPB_INLINE const struct google_protobuf_StringValue* xds_type_v3_CelExtractString_default_value(const xds_type_v3_CelExtractString* msg) {
  return *UPB_PTR_AT(msg, UPB_SIZE(8, 16), const struct google_protobuf_StringValue*);
}

UPB_INLINE void xds_type_v3_CelExtractString_set_expr_extract(xds_type_v3_CelExtractString *msg, xds_type_v3_CelExpression* value) {
  _upb_sethas(msg, 1);
  *UPB_PTR_AT(msg, UPB_SIZE(4, 8), xds_type_v3_CelExpression*) = value;
}
UPB_INLINE struct xds_type_v3_CelExpression* xds_type_v3_CelExtractString_mutable_expr_extract(xds_type_v3_CelExtractString* msg, upb_Arena* arena) {
  struct xds_type_v3_CelExpression* sub = (struct xds_type_v3_CelExpression*)xds_type_v3_CelExtractString_expr_extract(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_v3_CelExtractString_set_expr_extract(msg, sub);
  }
  return sub;
}
UPB_INLINE void xds_type_v3_CelExtractString_set_default_value(xds_type_v3_CelExtractString *msg, struct google_protobuf_StringValue* value) {
  _upb_sethas(msg, 2);
  *UPB_PTR_AT(msg, UPB_SIZE(8, 16), struct google_protobuf_StringValue*) = value;
}
UPB_INLINE struct google_protobuf_StringValue* xds_type_v3_CelExtractString_mutable_default_value(xds_type_v3_CelExtractString* msg, upb_Arena* arena) {
  struct google_protobuf_StringValue* sub = (struct google_protobuf_StringValue*)xds_type_v3_CelExtractString_default_value(msg);
  if (sub == NULL) {
    sub = (struct google_protobuf_StringValue*)_upb_Message_New(&google_protobuf_StringValue_msginit, arena);
    if (!sub) return NULL;
    xds_type_v3_CelExtractString_set_default_value(msg, sub);
  }
  return sub;
}

extern const upb_MiniTable_File xds_type_v3_cel_proto_upb_file_layout;

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

#include "upb/port_undef.inc"

#endif  /* XDS_TYPE_V3_CEL_PROTO_UPB_H_ */
