///
/// HybridNitroDnsSpec.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

#pragma once

#if __has_include(<NitroModules/HybridObject.hpp>)
#include <NitroModules/HybridObject.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif

// Forward declaration of `HybridNitroResolverSpec` to properly resolve imports.
namespace margelo::nitro::nitro_dns { class HybridNitroResolverSpec; }
// Forward declaration of `CachePolicy` to properly resolve imports.
namespace margelo::nitro::nitro_dns { enum class CachePolicy; }

#include <memory>
#include "HybridNitroResolverSpec.hpp"
#include <string>
#include <optional>
#include <NitroModules/Promise.hpp>
#include "CachePolicy.hpp"

namespace margelo::nitro::nitro_dns {

  using namespace margelo::nitro;

  /**
   * An abstract base class for `NitroDns`
   * Inherit this class to create instances of `HybridNitroDnsSpec` in C++.
   * You must explicitly call `HybridObject`'s constructor yourself, because it is virtual.
   * @example
   * ```cpp
   * class HybridNitroDns: public HybridNitroDnsSpec {
   * public:
   *   HybridNitroDns(...): HybridObject(TAG) { ... }
   *   // ...
   * };
   * ```
   */
  class HybridNitroDnsSpec: public virtual HybridObject {
    public:
      // Constructor
      explicit HybridNitroDnsSpec(): HybridObject(TAG) { }

      // Destructor
      ~HybridNitroDnsSpec() override = default;

    public:
      // Properties
      

    public:
      // Methods
      virtual std::shared_ptr<HybridNitroResolverSpec> createResolver(const std::optional<std::string>& config) = 0;
      virtual std::string getServers() = 0;
      virtual void setServers(const std::string& servers) = 0;
      virtual std::string lookup(const std::string& hostname, double family) = 0;
      virtual std::shared_ptr<Promise<std::string>> resolve4(const std::string& hostname) = 0;
      virtual std::shared_ptr<Promise<std::string>> resolve6(const std::string& hostname) = 0;
      virtual std::shared_ptr<Promise<std::string>> resolveMx(const std::string& hostname) = 0;
      virtual std::shared_ptr<Promise<std::string>> resolveTxt(const std::string& hostname) = 0;
      virtual std::shared_ptr<Promise<std::string>> resolveCname(const std::string& hostname) = 0;
      virtual std::shared_ptr<Promise<std::string>> resolveNs(const std::string& hostname) = 0;
      virtual std::shared_ptr<Promise<std::string>> resolveSoa(const std::string& hostname) = 0;
      virtual std::shared_ptr<Promise<std::string>> resolveSrv(const std::string& hostname) = 0;
      virtual std::shared_ptr<Promise<std::string>> resolveCaa(const std::string& hostname) = 0;
      virtual std::shared_ptr<Promise<std::string>> resolveNaptr(const std::string& hostname) = 0;
      virtual std::shared_ptr<Promise<std::string>> resolvePtr(const std::string& hostname) = 0;
      virtual std::shared_ptr<Promise<std::string>> resolveTlsa(const std::string& hostname) = 0;
      virtual std::shared_ptr<Promise<std::string>> resolveAny(const std::string& hostname) = 0;
      virtual std::shared_ptr<Promise<std::string>> reverse(const std::string& ip) = 0;
      virtual std::shared_ptr<Promise<std::string>> lookupService(const std::string& address, double port) = 0;
      virtual void setNativeInterceptionEnabled(bool enabled) = 0;
      virtual void setVerbose(bool enabled) = 0;
      virtual void clearCache() = 0;
      virtual void setCacheSize(double size) = 0;
      virtual void setCachePolicy(CachePolicy policy, double staleTtl) = 0;

    protected:
      // Hybrid Setup
      void loadHybridMethods() override;

    protected:
      // Tag for logging
      static constexpr auto TAG = "NitroDns";
  };

} // namespace margelo::nitro::nitro_dns
