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

#pragma once

#include <NitroModules/JHybridObject.hpp>
#include <fbjni/fbjni.h>
#include "HybridOneMapServicesSpec.hpp"




namespace margelo::nitro::one {

  using namespace facebook;

  class JHybridOneMapServicesSpec: public virtual HybridOneMapServicesSpec, public virtual JHybridObject {
  public:
    struct JavaPart: public jni::JavaClass<JavaPart, JHybridObject::JavaPart> {
      static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/one/HybridOneMapServicesSpec;";
      std::shared_ptr<JHybridOneMapServicesSpec> getJHybridOneMapServicesSpec();
    };
    struct CxxPart: public jni::HybridClass<CxxPart, JHybridObject::CxxPart> {
      static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/one/HybridOneMapServicesSpec$CxxPart;";
      static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis);
      static void registerNatives();
      using HybridBase::HybridBase;
    protected:
      std::shared_ptr<JHybridObject> createHybridObject(const jni::local_ref<JHybridObject::JavaPart>& javaPart) override;
    };

  public:
    explicit JHybridOneMapServicesSpec(const jni::local_ref<JHybridOneMapServicesSpec::JavaPart>& javaPart):
      HybridObject(HybridOneMapServicesSpec::TAG),
      JHybridObject(javaPart),
      _javaPart(jni::make_global(javaPart)) {}
    ~JHybridOneMapServicesSpec() override {
      // Hermes GC can destroy JS objects on a non-JNI Thread.
      jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); });
    }

  public:
    inline const jni::global_ref<JHybridOneMapServicesSpec::JavaPart>& getJavaPart() const noexcept {
      return _javaPart;
    }

  public:
    // Properties
    

  public:
    // Methods
    std::shared_ptr<Promise<std::vector<MapPlace>>> search(const std::string& query, const MapCoordinate& center, double radiusMeters) override;
    std::shared_ptr<Promise<std::vector<MapSuggestion>>> autocomplete(const std::string& query, const MapCoordinate& center, double radiusMeters) override;
    std::shared_ptr<Promise<MapPlace>> resolveSuggestion(const std::string& id) override;
    std::shared_ptr<Promise<MapRoute>> directions(const MapCoordinate& origin, const MapCoordinate& destination, MapTransport transport) override;

  private:
    jni::global_ref<JHybridOneMapServicesSpec::JavaPart> _javaPart;
  };

} // namespace margelo::nitro::one
