HttpHealthCheckerImpl::HttpStatusChecker::HttpStatusChecker(
    const Protobuf::RepeatedPtrField<envoy::type::v3::Int64Range>& expected_statuses,
    const Protobuf::RepeatedPtrField<envoy::type::v3::Int64Range>& retriable_statuses,
    uint64_t default_expected_status) {
  for (const auto& status_range : expected_statuses) {
    const auto start = static_cast<uint64_t>(status_range.start());
    const auto end = static_cast<uint64_t>(status_range.end());

    validateRange(start, end, "expected");

    expected_ranges_.emplace_back(std::make_pair(start, end));
  }

  if (expected_ranges_.empty()) {
    expected_ranges_.emplace_back(
        std::make_pair(default_expected_status, default_expected_status + 1));
  }

  for (const auto& status_range : retriable_statuses) {
    const auto start = static_cast<uint64_t>(status_range.start());
    const auto end = static_cast<uint64_t>(status_range.end());

    validateRange(start, end, "retriable");

    retriable_ranges_.emplace_back(std::make_pair(start, end));
  }
}
HttpHealthCheckerImpl::HttpStatusChecker::HttpStatusChecker(
    const Protobuf::RepeatedPtrField<envoy::type::v3::Int64Range>& expected_statuses,
    const Protobuf::RepeatedPtrField<envoy::type::v3::Int64Range>& retriable_statuses,
    uint64_t default_expected_status) {
  for (const auto& status_range : expected_statuses) {
    const auto start = static_cast<uint64_t>(status_range.start());
    const auto end = static_cast<uint64_t>(status_range.end());

    validateRange(start, end, "expected");

    expected_ranges_.emplace_back(std::make_pair(start, end));
  }

  if (expected_ranges_.empty()) {
    expected_ranges_.emplace_back(
        std::make_pair(default_expected_status, default_expected_status + 1));
  }

  for (const auto& status_range : retriable_statuses) {
    const auto start = static_cast<uint64_t>(status_range.start());
    const auto end = static_cast<uint64_t>(status_range.end());

    validateRange(start, end, "retriable");

    retriable_ranges_.emplace_back(std::make_pair(start, end));
  }
}