/* This file was generated by upbc (the upb compiler) from the input
 * file:
 *
 *     envoy/extensions/filters/common/fault/v3/fault.proto
 *
 * Do not edit -- your changes will be discarded when the file is
 * regenerated. */

#ifndef ENVOY_EXTENSIONS_FILTERS_COMMON_FAULT_V3_FAULT_PROTO_UPB_H_
#define ENVOY_EXTENSIONS_FILTERS_COMMON_FAULT_V3_FAULT_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 envoy_extensions_filters_common_fault_v3_FaultDelay;
struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay;
struct envoy_extensions_filters_common_fault_v3_FaultRateLimit;
struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit;
struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit;
typedef struct envoy_extensions_filters_common_fault_v3_FaultDelay envoy_extensions_filters_common_fault_v3_FaultDelay;
typedef struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay;
typedef struct envoy_extensions_filters_common_fault_v3_FaultRateLimit envoy_extensions_filters_common_fault_v3_FaultRateLimit;
typedef struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit;
typedef struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit;
extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultDelay_msginit;
extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit;
extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit;
extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit;
extern const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit;
struct envoy_type_v3_FractionalPercent;
struct google_protobuf_Duration;
extern const upb_MiniTable envoy_type_v3_FractionalPercent_msginit;
extern const upb_MiniTable google_protobuf_Duration_msginit;

typedef enum {
  envoy_extensions_filters_common_fault_v3_FaultDelay_FIXED = 0
} envoy_extensions_filters_common_fault_v3_FaultDelay_FaultDelayType;



/* envoy.extensions.filters.common.fault.v3.FaultDelay */

UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_new(upb_Arena* arena) {
  return (envoy_extensions_filters_common_fault_v3_FaultDelay*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, arena);
}
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_parse(const char* buf, size_t size, upb_Arena* arena) {
  envoy_extensions_filters_common_fault_v3_FaultDelay* ret = envoy_extensions_filters_common_fault_v3_FaultDelay_new(arena);
  if (!ret) return NULL;
  if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
    return NULL;
  }
  return ret;
}
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_parse_ex(const char* buf, size_t size,
                           const upb_ExtensionRegistry* extreg,
                           int options, upb_Arena* arena) {
  envoy_extensions_filters_common_fault_v3_FaultDelay* ret = envoy_extensions_filters_common_fault_v3_FaultDelay_new(arena);
  if (!ret) return NULL;
  if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, extreg, options, arena) !=
      kUpb_DecodeStatus_Ok) {
    return NULL;
  }
  return ret;
}
UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultDelay_serialize(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg, upb_Arena* arena, size_t* len) {
  char* ptr;
  (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, 0, arena, &ptr, len);
  return ptr;
}
UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultDelay_serialize_ex(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg, int options,
                                 upb_Arena* arena, size_t* len) {
  char* ptr;
  (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, options, arena, &ptr, len);
  return ptr;
}
typedef enum {
  envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_fixed_delay = 3,
  envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_header_delay = 5,
  envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_NOT_SET = 0
} envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_oneofcases;
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_oneofcases envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_case(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
  return (envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
}
UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultDelay_has_fixed_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
  return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3;
}
UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_clear_fixed_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
  UPB_WRITE_ONEOF(msg, struct google_protobuf_Duration*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_NOT_SET);
}
UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_common_fault_v3_FaultDelay_fixed_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
  return UPB_READ_ONEOF(msg, const struct google_protobuf_Duration*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, NULL);
}
UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultDelay_has_percentage(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
  return _upb_hasbit(msg, 1);
}
UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_clear_percentage(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
  *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
}
UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_common_fault_v3_FaultDelay_percentage(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
  return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_type_v3_FractionalPercent*);
}
UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultDelay_has_header_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
  return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 5;
}
UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_clear_header_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
  UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_NOT_SET);
}
UPB_INLINE const envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_header_delay(const envoy_extensions_filters_common_fault_v3_FaultDelay* msg) {
  return UPB_READ_ONEOF(msg, const envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 5, NULL);
}

UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_set_fixed_delay(envoy_extensions_filters_common_fault_v3_FaultDelay *msg, struct google_protobuf_Duration* value) {
  UPB_WRITE_ONEOF(msg, struct google_protobuf_Duration*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 3);
}
UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_common_fault_v3_FaultDelay_mutable_fixed_delay(envoy_extensions_filters_common_fault_v3_FaultDelay* msg, upb_Arena* arena) {
  struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_common_fault_v3_FaultDelay_fixed_delay(msg);
  if (sub == NULL) {
    sub = (struct google_protobuf_Duration*)_upb_Message_New(&google_protobuf_Duration_msginit, arena);
    if (!sub) return NULL;
    envoy_extensions_filters_common_fault_v3_FaultDelay_set_fixed_delay(msg, sub);
  }
  return sub;
}
UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_set_percentage(envoy_extensions_filters_common_fault_v3_FaultDelay *msg, struct envoy_type_v3_FractionalPercent* value) {
  _upb_sethas(msg, 1);
  *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_type_v3_FractionalPercent*) = value;
}
UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_common_fault_v3_FaultDelay_mutable_percentage(envoy_extensions_filters_common_fault_v3_FaultDelay* msg, upb_Arena* arena) {
  struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_extensions_filters_common_fault_v3_FaultDelay_percentage(msg);
  if (sub == NULL) {
    sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena);
    if (!sub) return NULL;
    envoy_extensions_filters_common_fault_v3_FaultDelay_set_percentage(msg, sub);
  }
  return sub;
}
UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultDelay_set_header_delay(envoy_extensions_filters_common_fault_v3_FaultDelay *msg, envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* value) {
  UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 5);
}
UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_mutable_header_delay(envoy_extensions_filters_common_fault_v3_FaultDelay* msg, upb_Arena* arena) {
  struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* sub = (struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*)envoy_extensions_filters_common_fault_v3_FaultDelay_header_delay(msg);
  if (sub == NULL) {
    sub = (struct envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, arena);
    if (!sub) return NULL;
    envoy_extensions_filters_common_fault_v3_FaultDelay_set_header_delay(msg, sub);
  }
  return sub;
}

/* envoy.extensions.filters.common.fault.v3.FaultDelay.HeaderDelay */

UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_new(upb_Arena* arena) {
  return (envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, arena);
}
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_parse(const char* buf, size_t size, upb_Arena* arena) {
  envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* ret = envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_new(arena);
  if (!ret) return NULL;
  if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
    return NULL;
  }
  return ret;
}
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_parse_ex(const char* buf, size_t size,
                           const upb_ExtensionRegistry* extreg,
                           int options, upb_Arena* arena) {
  envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* ret = envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_new(arena);
  if (!ret) return NULL;
  if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, extreg, options, arena) !=
      kUpb_DecodeStatus_Ok) {
    return NULL;
  }
  return ret;
}
UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_serialize(const envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* msg, upb_Arena* arena, size_t* len) {
  char* ptr;
  (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, 0, arena, &ptr, len);
  return ptr;
}
UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_serialize_ex(const envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* msg, int options,
                                 upb_Arena* arena, size_t* len) {
  char* ptr;
  (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, options, arena, &ptr, len);
  return ptr;
}


/* envoy.extensions.filters.common.fault.v3.FaultRateLimit */

UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_new(upb_Arena* arena) {
  return (envoy_extensions_filters_common_fault_v3_FaultRateLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, arena);
}
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_parse(const char* buf, size_t size, upb_Arena* arena) {
  envoy_extensions_filters_common_fault_v3_FaultRateLimit* ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_new(arena);
  if (!ret) return NULL;
  if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
    return NULL;
  }
  return ret;
}
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_parse_ex(const char* buf, size_t size,
                           const upb_ExtensionRegistry* extreg,
                           int options, upb_Arena* arena) {
  envoy_extensions_filters_common_fault_v3_FaultRateLimit* ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_new(arena);
  if (!ret) return NULL;
  if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, extreg, options, arena) !=
      kUpb_DecodeStatus_Ok) {
    return NULL;
  }
  return ret;
}
UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultRateLimit_serialize(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg, upb_Arena* arena, size_t* len) {
  char* ptr;
  (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, 0, arena, &ptr, len);
  return ptr;
}
UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultRateLimit_serialize_ex(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg, int options,
                                 upb_Arena* arena, size_t* len) {
  char* ptr;
  (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, options, arena, &ptr, len);
  return ptr;
}
typedef enum {
  envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_fixed_limit = 1,
  envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_header_limit = 3,
  envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_NOT_SET = 0
} envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_oneofcases;
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_oneofcases envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_case(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
  return (envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t);
}
UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultRateLimit_has_fixed_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
  return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 1;
}
UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_clear_fixed_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
  UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_NOT_SET);
}
UPB_INLINE const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_fixed_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
  return UPB_READ_ONEOF(msg, const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 1, NULL);
}
UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultRateLimit_has_percentage(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
  return _upb_hasbit(msg, 1);
}
UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_clear_percentage(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
  *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const upb_Message*) = NULL;
}
UPB_INLINE const struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_common_fault_v3_FaultRateLimit_percentage(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
  return *UPB_PTR_AT(msg, UPB_SIZE(8, 8), const struct envoy_type_v3_FractionalPercent*);
}
UPB_INLINE bool envoy_extensions_filters_common_fault_v3_FaultRateLimit_has_header_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
  return _upb_getoneofcase(msg, UPB_SIZE(4, 4)) == 3;
}
UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_clear_header_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
  UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*, UPB_SIZE(12, 16), 0, UPB_SIZE(4, 4), envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_NOT_SET);
}
UPB_INLINE const envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_header_limit(const envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg) {
  return UPB_READ_ONEOF(msg, const envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*, UPB_SIZE(12, 16), UPB_SIZE(4, 4), 3, NULL);
}

UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_fixed_limit(envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* value) {
  UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 1);
}
UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_mutable_fixed_limit(envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg, upb_Arena* arena) {
  struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*)envoy_extensions_filters_common_fault_v3_FaultRateLimit_fixed_limit(msg);
  if (sub == NULL) {
    sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, arena);
    if (!sub) return NULL;
    envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_fixed_limit(msg, sub);
  }
  return sub;
}
UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_percentage(envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg, struct envoy_type_v3_FractionalPercent* value) {
  _upb_sethas(msg, 1);
  *UPB_PTR_AT(msg, UPB_SIZE(8, 8), struct envoy_type_v3_FractionalPercent*) = value;
}
UPB_INLINE struct envoy_type_v3_FractionalPercent* envoy_extensions_filters_common_fault_v3_FaultRateLimit_mutable_percentage(envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg, upb_Arena* arena) {
  struct envoy_type_v3_FractionalPercent* sub = (struct envoy_type_v3_FractionalPercent*)envoy_extensions_filters_common_fault_v3_FaultRateLimit_percentage(msg);
  if (sub == NULL) {
    sub = (struct envoy_type_v3_FractionalPercent*)_upb_Message_New(&envoy_type_v3_FractionalPercent_msginit, arena);
    if (!sub) return NULL;
    envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_percentage(msg, sub);
  }
  return sub;
}
UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_header_limit(envoy_extensions_filters_common_fault_v3_FaultRateLimit *msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* value) {
  UPB_WRITE_ONEOF(msg, envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*, UPB_SIZE(12, 16), value, UPB_SIZE(4, 4), 3);
}
UPB_INLINE struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_mutable_header_limit(envoy_extensions_filters_common_fault_v3_FaultRateLimit* msg, upb_Arena* arena) {
  struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*)envoy_extensions_filters_common_fault_v3_FaultRateLimit_header_limit(msg);
  if (sub == NULL) {
    sub = (struct envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, arena);
    if (!sub) return NULL;
    envoy_extensions_filters_common_fault_v3_FaultRateLimit_set_header_limit(msg, sub);
  }
  return sub;
}

/* envoy.extensions.filters.common.fault.v3.FaultRateLimit.FixedLimit */

UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_new(upb_Arena* arena) {
  return (envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, arena);
}
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_parse(const char* buf, size_t size, upb_Arena* arena) {
  envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_new(arena);
  if (!ret) return NULL;
  if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
    return NULL;
  }
  return ret;
}
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_parse_ex(const char* buf, size_t size,
                           const upb_ExtensionRegistry* extreg,
                           int options, upb_Arena* arena) {
  envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_new(arena);
  if (!ret) return NULL;
  if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, extreg, options, arena) !=
      kUpb_DecodeStatus_Ok) {
    return NULL;
  }
  return ret;
}
UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_serialize(const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* msg, upb_Arena* arena, size_t* len) {
  char* ptr;
  (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, 0, arena, &ptr, len);
  return ptr;
}
UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_serialize_ex(const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* msg, int options,
                                 upb_Arena* arena, size_t* len) {
  char* ptr;
  (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, options, arena, &ptr, len);
  return ptr;
}
UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_clear_limit_kbps(const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* msg) {
  *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = 0;
}
UPB_INLINE uint64_t envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_limit_kbps(const envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* msg) {
  return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t);
}

UPB_INLINE void envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_set_limit_kbps(envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit *msg, uint64_t value) {
  *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = value;
}

/* envoy.extensions.filters.common.fault.v3.FaultRateLimit.HeaderLimit */

UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_new(upb_Arena* arena) {
  return (envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit*)_upb_Message_New(&envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, arena);
}
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_parse(const char* buf, size_t size, upb_Arena* arena) {
  envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_new(arena);
  if (!ret) return NULL;
  if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, NULL, 0, arena) != kUpb_DecodeStatus_Ok) {
    return NULL;
  }
  return ret;
}
UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_parse_ex(const char* buf, size_t size,
                           const upb_ExtensionRegistry* extreg,
                           int options, upb_Arena* arena) {
  envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* ret = envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_new(arena);
  if (!ret) return NULL;
  if (upb_Decode(buf, size, ret, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, extreg, options, arena) !=
      kUpb_DecodeStatus_Ok) {
    return NULL;
  }
  return ret;
}
UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_serialize(const envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* msg, upb_Arena* arena, size_t* len) {
  char* ptr;
  (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, 0, arena, &ptr, len);
  return ptr;
}
UPB_INLINE char* envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_serialize_ex(const envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* msg, int options,
                                 upb_Arena* arena, size_t* len) {
  char* ptr;
  (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, options, arena, &ptr, len);
  return ptr;
}


extern const upb_MiniTable_File envoy_extensions_filters_common_fault_v3_fault_proto_upb_file_layout;

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

#include "upb/port_undef.inc"

#endif  /* ENVOY_EXTENSIONS_FILTERS_COMMON_FAULT_V3_FAULT_PROTO_UPB_H_ */
