// @generated by thrift-lite.py; do not edit.
#pragma once

#include <bitset>
#include <cstddef>
#include <cstdint>
#include <map>
#include <set>
#include <span>
#include <string>
#include <string_view>
#include <vector>

#include <dwarfs/thrift_lite/concepts.h>
#include <dwarfs/thrift_lite/enum_traits.h>
#include <dwarfs/thrift_lite/field_ref.h>
#include <dwarfs/thrift_lite/types.h>

namespace dwarfs::thrift_lite {

struct writer_options;

} // namespace dwarfs::thrift_lite

namespace dwarfs::thrift::history {

using UInt8 = std::uint8_t;
using UInt16 = std::uint16_t;
using UInt32 = std::uint32_t;
using UInt64 = std::uint64_t;

class dwarfs_version final {
 public:
  dwarfs_version();
  dwarfs_version(dwarfs_version const&);
  dwarfs_version(dwarfs_version&&) noexcept;
  auto operator=(dwarfs_version const&) -> dwarfs_version&;
  auto operator=(dwarfs_version&&) noexcept -> dwarfs_version&;

#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif
  friend bool operator==(dwarfs_version const& lhs, dwarfs_version const& rhs) = default;
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif

  void read(::dwarfs::thrift_lite::protocol_reader_type auto& r);
  void write(::dwarfs::thrift_lite::protocol_writer_type auto& w) const;

  [[nodiscard]] auto has_any_fields_for_write(::dwarfs::thrift_lite::writer_options const& opts) const noexcept -> bool;

  auto major() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<UInt16&>{major_};
  }
  auto major_ref() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<UInt16&>{major_};
  }
  auto major() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<UInt16 const&>{major_};
  }
  auto major_ref() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<UInt16 const&>{major_};
  }

  auto minor() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<UInt16&>{minor_};
  }
  auto minor_ref() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<UInt16&>{minor_};
  }
  auto minor() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<UInt16 const&>{minor_};
  }
  auto minor_ref() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<UInt16 const&>{minor_};
  }

  auto patch() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<UInt16&>{patch_};
  }
  auto patch_ref() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<UInt16&>{patch_};
  }
  auto patch() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<UInt16 const&>{patch_};
  }
  auto patch_ref() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<UInt16 const&>{patch_};
  }

  auto is_release() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<bool&>{is_release_};
  }
  auto is_release_ref() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<bool&>{is_release_};
  }
  auto is_release() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<bool const&>{is_release_};
  }
  auto is_release_ref() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<bool const&>{is_release_};
  }

  auto git_rev() & noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::string&, isset_ref>{git_rev_, isset_[git_rev_isset_index]};
  }
  auto git_rev_ref() & noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::string&, isset_ref>{git_rev_, isset_[git_rev_isset_index]};
  }
  auto git_rev() const& noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::string const&, bool>{git_rev_, isset_.test(git_rev_isset_index)};
  }
  auto git_rev_ref() const& noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::string const&, bool>{git_rev_, isset_.test(git_rev_isset_index)};
  }

  auto git_branch() & noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::string&, isset_ref>{git_branch_, isset_[git_branch_isset_index]};
  }
  auto git_branch_ref() & noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::string&, isset_ref>{git_branch_, isset_[git_branch_isset_index]};
  }
  auto git_branch() const& noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::string const&, bool>{git_branch_, isset_.test(git_branch_isset_index)};
  }
  auto git_branch_ref() const& noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::string const&, bool>{git_branch_, isset_.test(git_branch_isset_index)};
  }

  auto git_desc() & noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::string&, isset_ref>{git_desc_, isset_[git_desc_isset_index]};
  }
  auto git_desc_ref() & noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::string&, isset_ref>{git_desc_, isset_[git_desc_isset_index]};
  }
  auto git_desc() const& noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::string const&, bool>{git_desc_, isset_.test(git_desc_isset_index)};
  }
  auto git_desc_ref() const& noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::string const&, bool>{git_desc_, isset_.test(git_desc_isset_index)};
  }

 private:
  static constexpr auto git_rev_isset_index = std::size_t{0};
  static constexpr auto git_branch_isset_index = std::size_t{1};
  static constexpr auto git_desc_isset_index = std::size_t{2};
  using isset_type = std::bitset<3>;
  using isset_ref = isset_type::reference;
  isset_type isset_{};
  UInt16 major_{};
  UInt16 minor_{};
  UInt16 patch_{};
  bool is_release_{};
  std::string git_rev_{};
  std::string git_branch_{};
  std::string git_desc_{};
};

class history_entry final {
 public:
  history_entry();
  history_entry(history_entry const&);
  history_entry(history_entry&&) noexcept;
  auto operator=(history_entry const&) -> history_entry&;
  auto operator=(history_entry&&) noexcept -> history_entry&;

#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif
  friend bool operator==(history_entry const& lhs, history_entry const& rhs) = default;
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif

  void read(::dwarfs::thrift_lite::protocol_reader_type auto& r);
  void write(::dwarfs::thrift_lite::protocol_writer_type auto& w) const;

  [[nodiscard]] auto has_any_fields_for_write(::dwarfs::thrift_lite::writer_options const& opts) const noexcept -> bool;

  auto version() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<dwarfs_version&>{version_};
  }
  auto version_ref() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<dwarfs_version&>{version_};
  }
  auto version() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<dwarfs_version const&>{version_};
  }
  auto version_ref() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<dwarfs_version const&>{version_};
  }

  auto system_id() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::string&>{system_id_};
  }
  auto system_id_ref() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::string&>{system_id_};
  }
  auto system_id() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::string const&>{system_id_};
  }
  auto system_id_ref() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::string const&>{system_id_};
  }

  auto compiler_id() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::string&>{compiler_id_};
  }
  auto compiler_id_ref() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::string&>{compiler_id_};
  }
  auto compiler_id() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::string const&>{compiler_id_};
  }
  auto compiler_id_ref() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::string const&>{compiler_id_};
  }

  auto arguments() & noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::vector<std::string>&, isset_ref>{arguments_, isset_[arguments_isset_index]};
  }
  auto arguments_ref() & noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::vector<std::string>&, isset_ref>{arguments_, isset_[arguments_isset_index]};
  }
  auto arguments() const& noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::vector<std::string> const&, bool>{arguments_, isset_.test(arguments_isset_index)};
  }
  auto arguments_ref() const& noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::vector<std::string> const&, bool>{arguments_, isset_.test(arguments_isset_index)};
  }

  auto timestamp() & noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<UInt64&, isset_ref>{timestamp_, isset_[timestamp_isset_index]};
  }
  auto timestamp_ref() & noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<UInt64&, isset_ref>{timestamp_, isset_[timestamp_isset_index]};
  }
  auto timestamp() const& noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<UInt64 const&, bool>{timestamp_, isset_.test(timestamp_isset_index)};
  }
  auto timestamp_ref() const& noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<UInt64 const&, bool>{timestamp_, isset_.test(timestamp_isset_index)};
  }

  auto library_versions() & noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::set<std::string>&, isset_ref>{library_versions_, isset_[library_versions_isset_index]};
  }
  auto library_versions_ref() & noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::set<std::string>&, isset_ref>{library_versions_, isset_[library_versions_isset_index]};
  }
  auto library_versions() const& noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::set<std::string> const&, bool>{library_versions_, isset_.test(library_versions_isset_index)};
  }
  auto library_versions_ref() const& noexcept {
    return ::dwarfs::thrift_lite::optional_field_ref<std::set<std::string> const&, bool>{library_versions_, isset_.test(library_versions_isset_index)};
  }

 private:
  static constexpr auto arguments_isset_index = std::size_t{0};
  static constexpr auto timestamp_isset_index = std::size_t{1};
  static constexpr auto library_versions_isset_index = std::size_t{2};
  using isset_type = std::bitset<3>;
  using isset_ref = isset_type::reference;
  isset_type isset_{};
  dwarfs_version version_{};
  std::string system_id_{};
  std::string compiler_id_{};
  std::vector<std::string> arguments_{};
  UInt64 timestamp_{};
  std::set<std::string> library_versions_{};
};

class history final {
 public:
  history();
  history(history const&);
  history(history&&) noexcept;
  auto operator=(history const&) -> history&;
  auto operator=(history&&) noexcept -> history&;

#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif
  friend bool operator==(history const& lhs, history const& rhs) = default;
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif

  void read(::dwarfs::thrift_lite::protocol_reader_type auto& r);
  void write(::dwarfs::thrift_lite::protocol_writer_type auto& w) const;

  [[nodiscard]] auto has_any_fields_for_write(::dwarfs::thrift_lite::writer_options const& opts) const noexcept -> bool;

  auto entries() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::vector<history_entry>&>{entries_};
  }
  auto entries_ref() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::vector<history_entry>&>{entries_};
  }
  auto entries() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::vector<history_entry> const&>{entries_};
  }
  auto entries_ref() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::vector<history_entry> const&>{entries_};
  }

 private:
  std::vector<history_entry> entries_{};
};

} // namespace dwarfs::thrift::history

namespace dwarfs::thrift_lite {

} // namespace dwarfs::thrift_lite

#include "history_types-inl.h"
