///
/// HybridOneContactsSpec.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 `ContactsPermissionStatus` to properly resolve imports.
namespace margelo::nitro::one { enum class ContactsPermissionStatus; }
// Forward declaration of `ContactInfo` to properly resolve imports.
namespace margelo::nitro::one { struct ContactInfo; }
// Forward declaration of `ContactInput` to properly resolve imports.
namespace margelo::nitro::one { struct ContactInput; }
// Forward declaration of `ContactChanges` to properly resolve imports.
namespace margelo::nitro::one { struct ContactChanges; }

#include "ContactsPermissionStatus.hpp"
#include <NitroModules/Promise.hpp>
#include "ContactInfo.hpp"
#include <optional>
#include <vector>
#include <string>
#include "ContactInput.hpp"
#include "ContactChanges.hpp"

namespace margelo::nitro::one {

  using namespace margelo::nitro;

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

      // Destructor
      ~HybridOneContactsSpec() override = default;

    public:
      // Properties


    public:
      // Methods
      virtual ContactsPermissionStatus getPermissionStatus() = 0;
      virtual std::shared_ptr<Promise<ContactsPermissionStatus>> requestPermission() = 0;
      virtual std::shared_ptr<Promise<std::optional<ContactInfo>>> pickContact() = 0;
      virtual std::shared_ptr<Promise<std::vector<ContactInfo>>> search(const std::string& name, double limit) = 0;
      virtual std::shared_ptr<Promise<std::string>> create(const ContactInput& input) = 0;
      virtual std::shared_ptr<Promise<ContactInfo>> update(const std::string& identifier, const ContactChanges& changes) = 0;
      virtual std::shared_ptr<Promise<void>> remove(const std::string& identifier) = 0;

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

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

} // namespace margelo::nitro::one
