// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: envoy/type/percent.proto

#include "envoy/type/percent.pb.h"

#include <algorithm>

#include <google/protobuf/stubs/common.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>

namespace envoy {
namespace type {
class PercentDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<Percent> _instance;
} _Percent_default_instance_;
class FractionalPercentDefaultTypeInternal {
 public:
  ::google::protobuf::internal::ExplicitlyConstructed<FractionalPercent> _instance;
} _FractionalPercent_default_instance_;
}  // namespace type
}  // namespace envoy
static void InitDefaultsPercent_envoy_2ftype_2fpercent_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::envoy::type::_Percent_default_instance_;
    new (ptr) ::envoy::type::Percent();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::envoy::type::Percent::InitAsDefaultInstance();
}

::google::protobuf::internal::SCCInfo<0> scc_info_Percent_envoy_2ftype_2fpercent_2eproto =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsPercent_envoy_2ftype_2fpercent_2eproto}, {}};

static void InitDefaultsFractionalPercent_envoy_2ftype_2fpercent_2eproto() {
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  {
    void* ptr = &::envoy::type::_FractionalPercent_default_instance_;
    new (ptr) ::envoy::type::FractionalPercent();
    ::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
  }
  ::envoy::type::FractionalPercent::InitAsDefaultInstance();
}

::google::protobuf::internal::SCCInfo<0> scc_info_FractionalPercent_envoy_2ftype_2fpercent_2eproto =
    {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, InitDefaultsFractionalPercent_envoy_2ftype_2fpercent_2eproto}, {}};

void InitDefaults_envoy_2ftype_2fpercent_2eproto() {
  ::google::protobuf::internal::InitSCC(&scc_info_Percent_envoy_2ftype_2fpercent_2eproto.base);
  ::google::protobuf::internal::InitSCC(&scc_info_FractionalPercent_envoy_2ftype_2fpercent_2eproto.base);
}

::google::protobuf::Metadata file_level_metadata_envoy_2ftype_2fpercent_2eproto[2];
const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors_envoy_2ftype_2fpercent_2eproto[1];
constexpr ::google::protobuf::ServiceDescriptor const** file_level_service_descriptors_envoy_2ftype_2fpercent_2eproto = nullptr;

const ::google::protobuf::uint32 TableStruct_envoy_2ftype_2fpercent_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::envoy::type::Percent, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  PROTOBUF_FIELD_OFFSET(::envoy::type::Percent, value_),
  ~0u,  // no _has_bits_
  PROTOBUF_FIELD_OFFSET(::envoy::type::FractionalPercent, _internal_metadata_),
  ~0u,  // no _extensions_
  ~0u,  // no _oneof_case_
  ~0u,  // no _weak_field_map_
  PROTOBUF_FIELD_OFFSET(::envoy::type::FractionalPercent, numerator_),
  PROTOBUF_FIELD_OFFSET(::envoy::type::FractionalPercent, denominator_),
};
static const ::google::protobuf::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
  { 0, -1, sizeof(::envoy::type::Percent)},
  { 6, -1, sizeof(::envoy::type::FractionalPercent)},
};

static ::google::protobuf::Message const * const file_default_instances[] = {
  reinterpret_cast<const ::google::protobuf::Message*>(&::envoy::type::_Percent_default_instance_),
  reinterpret_cast<const ::google::protobuf::Message*>(&::envoy::type::_FractionalPercent_default_instance_),
};

::google::protobuf::internal::AssignDescriptorsTable assign_descriptors_table_envoy_2ftype_2fpercent_2eproto = {
  {}, AddDescriptors_envoy_2ftype_2fpercent_2eproto, "envoy/type/percent.proto", schemas,
  file_default_instances, TableStruct_envoy_2ftype_2fpercent_2eproto::offsets,
  file_level_metadata_envoy_2ftype_2fpercent_2eproto, 2, file_level_enum_descriptors_envoy_2ftype_2fpercent_2eproto, file_level_service_descriptors_envoy_2ftype_2fpercent_2eproto,
};

const char descriptor_table_protodef_envoy_2ftype_2fpercent_2eproto[] =
  "\n\030envoy/type/percent.proto\022\nenvoy.type\032\027"
  "validate/validate.proto\032\024gogoproto/gogo."
  "proto\"3\n\007Percent\022(\n\005value\030\001 \001(\001B\031\272\351\300\003\024\022\022"
  "\031\000\000\000\000\000\000Y@)\000\000\000\000\000\000\000\000\"\265\001\n\021FractionalPercent"
  "\022\021\n\tnumerator\030\001 \001(\r\022N\n\013denominator\030\002 \001(\016"
  "2-.envoy.type.FractionalPercent.Denomina"
  "torTypeB\n\272\351\300\003\005\202\001\002\020\001\"=\n\017DenominatorType\022\013"
  "\n\007HUNDRED\020\000\022\020\n\014TEN_THOUSAND\020\001\022\013\n\007MILLION"
  "\020\002B\004\250\342\036\001b\006proto3"
  ;
::google::protobuf::internal::DescriptorTable descriptor_table_envoy_2ftype_2fpercent_2eproto = {
  false, InitDefaults_envoy_2ftype_2fpercent_2eproto, 
  descriptor_table_protodef_envoy_2ftype_2fpercent_2eproto,
  "envoy/type/percent.proto", &assign_descriptors_table_envoy_2ftype_2fpercent_2eproto, 336,
};

void AddDescriptors_envoy_2ftype_2fpercent_2eproto() {
  static constexpr ::google::protobuf::internal::InitFunc deps[2] =
  {
    ::AddDescriptors_validate_2fvalidate_2eproto,
    ::AddDescriptors_gogoproto_2fgogo_2eproto,
  };
 ::google::protobuf::internal::AddDescriptors(&descriptor_table_envoy_2ftype_2fpercent_2eproto, deps, 2);
}

// Force running AddDescriptors() at dynamic initialization time.
static bool dynamic_init_dummy_envoy_2ftype_2fpercent_2eproto = []() { AddDescriptors_envoy_2ftype_2fpercent_2eproto(); return true; }();
namespace envoy {
namespace type {
const ::google::protobuf::EnumDescriptor* FractionalPercent_DenominatorType_descriptor() {
  ::google::protobuf::internal::AssignDescriptors(&assign_descriptors_table_envoy_2ftype_2fpercent_2eproto);
  return file_level_enum_descriptors_envoy_2ftype_2fpercent_2eproto[0];
}
bool FractionalPercent_DenominatorType_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const FractionalPercent_DenominatorType FractionalPercent::HUNDRED;
const FractionalPercent_DenominatorType FractionalPercent::TEN_THOUSAND;
const FractionalPercent_DenominatorType FractionalPercent::MILLION;
const FractionalPercent_DenominatorType FractionalPercent::DenominatorType_MIN;
const FractionalPercent_DenominatorType FractionalPercent::DenominatorType_MAX;
const int FractionalPercent::DenominatorType_ARRAYSIZE;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

// ===================================================================

void Percent::InitAsDefaultInstance() {
}
class Percent::HasBitSetters {
 public:
};

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int Percent::kValueFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

Percent::Percent()
  : ::google::protobuf::Message(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:envoy.type.Percent)
}
Percent::Percent(const Percent& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(nullptr) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  value_ = from.value_;
  // @@protoc_insertion_point(copy_constructor:envoy.type.Percent)
}

void Percent::SharedCtor() {
  value_ = 0;
}

Percent::~Percent() {
  // @@protoc_insertion_point(destructor:envoy.type.Percent)
  SharedDtor();
}

void Percent::SharedDtor() {
}

void Percent::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const Percent& Percent::default_instance() {
  ::google::protobuf::internal::InitSCC(&::scc_info_Percent_envoy_2ftype_2fpercent_2eproto.base);
  return *internal_default_instance();
}


void Percent::Clear() {
// @@protoc_insertion_point(message_clear_start:envoy.type.Percent)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  value_ = 0;
  _internal_metadata_.Clear();
}

#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* Percent::_InternalParse(const char* begin, const char* end, void* object,
                  ::google::protobuf::internal::ParseContext* ctx) {
  auto msg = static_cast<Percent*>(object);
  ::google::protobuf::int32 size; (void)size;
  int depth; (void)depth;
  ::google::protobuf::uint32 tag;
  ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end;
  auto ptr = begin;
  while (ptr < end) {
    ptr = ::google::protobuf::io::Parse32(ptr, &tag);
    GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
    switch (tag >> 3) {
      // double value = 1 [(.validate.rules) = {
      case 1: {
        if (static_cast<::google::protobuf::uint8>(tag) != 9) goto handle_unusual;
        msg->set_value(::google::protobuf::io::UnalignedLoad<double>(ptr));
        ptr += sizeof(double);
        break;
      }
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->EndGroup(tag);
          return ptr;
        }
        auto res = UnknownFieldParse(tag, {_InternalParse, msg},
          ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx);
        ptr = res.first;
        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr);
        if (res.second) return ptr;
      }
    }  // switch
  }  // while
  return ptr;
}
#else  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
bool Percent::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:envoy.type.Percent)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // double value = 1 [(.validate.rules) = {
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) == (9 & 0xFF)) {

          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>(
                 input, &value_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:envoy.type.Percent)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:envoy.type.Percent)
  return false;
#undef DO_
}
#endif  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER

void Percent::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:envoy.type.Percent)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // double value = 1 [(.validate.rules) = {
  if (this->value() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteDouble(1, this->value(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:envoy.type.Percent)
}

::google::protobuf::uint8* Percent::InternalSerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:envoy.type.Percent)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // double value = 1 [(.validate.rules) = {
  if (this->value() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(1, this->value(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:envoy.type.Percent)
  return target;
}

size_t Percent::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:envoy.type.Percent)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // double value = 1 [(.validate.rules) = {
  if (this->value() != 0) {
    total_size += 1 + 8;
  }

  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void Percent::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:envoy.type.Percent)
  GOOGLE_DCHECK_NE(&from, this);
  const Percent* source =
      ::google::protobuf::DynamicCastToGenerated<Percent>(
          &from);
  if (source == nullptr) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:envoy.type.Percent)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:envoy.type.Percent)
    MergeFrom(*source);
  }
}

void Percent::MergeFrom(const Percent& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:envoy.type.Percent)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  if (from.value() != 0) {
    set_value(from.value());
  }
}

void Percent::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:envoy.type.Percent)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void Percent::CopyFrom(const Percent& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:envoy.type.Percent)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Percent::IsInitialized() const {
  return true;
}

void Percent::Swap(Percent* other) {
  if (other == this) return;
  InternalSwap(other);
}
void Percent::InternalSwap(Percent* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(value_, other->value_);
}

::google::protobuf::Metadata Percent::GetMetadata() const {
  ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_envoy_2ftype_2fpercent_2eproto);
  return ::file_level_metadata_envoy_2ftype_2fpercent_2eproto[kIndexInFileMessages];
}


// ===================================================================

void FractionalPercent::InitAsDefaultInstance() {
}
class FractionalPercent::HasBitSetters {
 public:
};

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int FractionalPercent::kNumeratorFieldNumber;
const int FractionalPercent::kDenominatorFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

FractionalPercent::FractionalPercent()
  : ::google::protobuf::Message(), _internal_metadata_(nullptr) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:envoy.type.FractionalPercent)
}
FractionalPercent::FractionalPercent(const FractionalPercent& from)
  : ::google::protobuf::Message(),
      _internal_metadata_(nullptr) {
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::memcpy(&numerator_, &from.numerator_,
    static_cast<size_t>(reinterpret_cast<char*>(&denominator_) -
    reinterpret_cast<char*>(&numerator_)) + sizeof(denominator_));
  // @@protoc_insertion_point(copy_constructor:envoy.type.FractionalPercent)
}

void FractionalPercent::SharedCtor() {
  ::memset(&numerator_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&denominator_) -
      reinterpret_cast<char*>(&numerator_)) + sizeof(denominator_));
}

FractionalPercent::~FractionalPercent() {
  // @@protoc_insertion_point(destructor:envoy.type.FractionalPercent)
  SharedDtor();
}

void FractionalPercent::SharedDtor() {
}

void FractionalPercent::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}
const FractionalPercent& FractionalPercent::default_instance() {
  ::google::protobuf::internal::InitSCC(&::scc_info_FractionalPercent_envoy_2ftype_2fpercent_2eproto.base);
  return *internal_default_instance();
}


void FractionalPercent::Clear() {
// @@protoc_insertion_point(message_clear_start:envoy.type.FractionalPercent)
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  ::memset(&numerator_, 0, static_cast<size_t>(
      reinterpret_cast<char*>(&denominator_) -
      reinterpret_cast<char*>(&numerator_)) + sizeof(denominator_));
  _internal_metadata_.Clear();
}

#if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
const char* FractionalPercent::_InternalParse(const char* begin, const char* end, void* object,
                  ::google::protobuf::internal::ParseContext* ctx) {
  auto msg = static_cast<FractionalPercent*>(object);
  ::google::protobuf::int32 size; (void)size;
  int depth; (void)depth;
  ::google::protobuf::uint32 tag;
  ::google::protobuf::internal::ParseFunc parser_till_end; (void)parser_till_end;
  auto ptr = begin;
  while (ptr < end) {
    ptr = ::google::protobuf::io::Parse32(ptr, &tag);
    GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
    switch (tag >> 3) {
      // uint32 numerator = 1;
      case 1: {
        if (static_cast<::google::protobuf::uint8>(tag) != 8) goto handle_unusual;
        msg->set_numerator(::google::protobuf::internal::ReadVarint(&ptr));
        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
        break;
      }
      // .envoy.type.FractionalPercent.DenominatorType denominator = 2 [(.validate.rules) = {
      case 2: {
        if (static_cast<::google::protobuf::uint8>(tag) != 16) goto handle_unusual;
        ::google::protobuf::uint64 val = ::google::protobuf::internal::ReadVarint(&ptr);
        msg->set_denominator(static_cast<::envoy::type::FractionalPercent_DenominatorType>(val));
        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr);
        break;
      }
      default: {
      handle_unusual:
        if ((tag & 7) == 4 || tag == 0) {
          ctx->EndGroup(tag);
          return ptr;
        }
        auto res = UnknownFieldParse(tag, {_InternalParse, msg},
          ptr, end, msg->_internal_metadata_.mutable_unknown_fields(), ctx);
        ptr = res.first;
        GOOGLE_PROTOBUF_PARSER_ASSERT(ptr != nullptr);
        if (res.second) return ptr;
      }
    }  // switch
  }  // while
  return ptr;
}
#else  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER
bool FractionalPercent::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!PROTOBUF_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:envoy.type.FractionalPercent)
  for (;;) {
    ::std::pair<::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // uint32 numerator = 1;
      case 1: {
        if (static_cast< ::google::protobuf::uint8>(tag) == (8 & 0xFF)) {

          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &numerator_)));
        } else {
          goto handle_unusual;
        }
        break;
      }

      // .envoy.type.FractionalPercent.DenominatorType denominator = 2 [(.validate.rules) = {
      case 2: {
        if (static_cast< ::google::protobuf::uint8>(tag) == (16 & 0xFF)) {
          int value = 0;
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
                 input, &value)));
          set_denominator(static_cast< ::envoy::type::FractionalPercent_DenominatorType >(value));
        } else {
          goto handle_unusual;
        }
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, _internal_metadata_.mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:envoy.type.FractionalPercent)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:envoy.type.FractionalPercent)
  return false;
#undef DO_
}
#endif  // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER

void FractionalPercent::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:envoy.type.FractionalPercent)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // uint32 numerator = 1;
  if (this->numerator() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->numerator(), output);
  }

  // .envoy.type.FractionalPercent.DenominatorType denominator = 2 [(.validate.rules) = {
  if (this->denominator() != 0) {
    ::google::protobuf::internal::WireFormatLite::WriteEnum(
      2, this->denominator(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        _internal_metadata_.unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:envoy.type.FractionalPercent)
}

::google::protobuf::uint8* FractionalPercent::InternalSerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:envoy.type.FractionalPercent)
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  // uint32 numerator = 1;
  if (this->numerator() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->numerator(), target);
  }

  // .envoy.type.FractionalPercent.DenominatorType denominator = 2 [(.validate.rules) = {
  if (this->denominator() != 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
      2, this->denominator(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        _internal_metadata_.unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:envoy.type.FractionalPercent)
  return target;
}

size_t FractionalPercent::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:envoy.type.FractionalPercent)
  size_t total_size = 0;

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        _internal_metadata_.unknown_fields());
  }
  ::google::protobuf::uint32 cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  // uint32 numerator = 1;
  if (this->numerator() != 0) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::UInt32Size(
        this->numerator());
  }

  // .envoy.type.FractionalPercent.DenominatorType denominator = 2 [(.validate.rules) = {
  if (this->denominator() != 0) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::EnumSize(this->denominator());
  }

  int cached_size = ::google::protobuf::internal::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void FractionalPercent::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:envoy.type.FractionalPercent)
  GOOGLE_DCHECK_NE(&from, this);
  const FractionalPercent* source =
      ::google::protobuf::DynamicCastToGenerated<FractionalPercent>(
          &from);
  if (source == nullptr) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:envoy.type.FractionalPercent)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:envoy.type.FractionalPercent)
    MergeFrom(*source);
  }
}

void FractionalPercent::MergeFrom(const FractionalPercent& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:envoy.type.FractionalPercent)
  GOOGLE_DCHECK_NE(&from, this);
  _internal_metadata_.MergeFrom(from._internal_metadata_);
  ::google::protobuf::uint32 cached_has_bits = 0;
  (void) cached_has_bits;

  if (from.numerator() != 0) {
    set_numerator(from.numerator());
  }
  if (from.denominator() != 0) {
    set_denominator(from.denominator());
  }
}

void FractionalPercent::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:envoy.type.FractionalPercent)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void FractionalPercent::CopyFrom(const FractionalPercent& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:envoy.type.FractionalPercent)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool FractionalPercent::IsInitialized() const {
  return true;
}

void FractionalPercent::Swap(FractionalPercent* other) {
  if (other == this) return;
  InternalSwap(other);
}
void FractionalPercent::InternalSwap(FractionalPercent* other) {
  using std::swap;
  _internal_metadata_.Swap(&other->_internal_metadata_);
  swap(numerator_, other->numerator_);
  swap(denominator_, other->denominator_);
}

::google::protobuf::Metadata FractionalPercent::GetMetadata() const {
  ::google::protobuf::internal::AssignDescriptors(&::assign_descriptors_table_envoy_2ftype_2fpercent_2eproto);
  return ::file_level_metadata_envoy_2ftype_2fpercent_2eproto[kIndexInFileMessages];
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace type
}  // namespace envoy
namespace google {
namespace protobuf {
template<> PROTOBUF_NOINLINE ::envoy::type::Percent* Arena::CreateMaybeMessage< ::envoy::type::Percent >(Arena* arena) {
  return Arena::CreateInternal< ::envoy::type::Percent >(arena);
}
template<> PROTOBUF_NOINLINE ::envoy::type::FractionalPercent* Arena::CreateMaybeMessage< ::envoy::type::FractionalPercent >(Arena* arena) {
  return Arena::CreateInternal< ::envoy::type::FractionalPercent >(arena);
}
}  // namespace protobuf
}  // namespace google

// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
