///
/// BatchQueryCommand.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/JSIConverter.hpp>)
#include <NitroModules/JSIConverter.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif
#if __has_include(<NitroModules/NitroDefines.hpp>)
#include <NitroModules/NitroDefines.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif
#if __has_include(<NitroModules/JSIHelpers.hpp>)
#include <NitroModules/JSIHelpers.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
#include <NitroModules/PropNameIDCache.hpp>
#else
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
#endif



#include <string>
#include <NitroModules/Null.hpp>
#include <NitroModules/ArrayBuffer.hpp>
#include <variant>
#include <vector>
#include <optional>

namespace margelo::nitro::rnnitrosqlite {

  /**
   * A struct which can be represented as a JavaScript object (BatchQueryCommand).
   */
  struct BatchQueryCommand final {
  public:
    std::string query     SWIFT_PRIVATE;
    std::optional<std::variant<std::vector<std::vector<std::variant<nitro::NullType, bool, std::shared_ptr<ArrayBuffer>, std::string, double>>>, std::vector<std::variant<nitro::NullType, bool, std::shared_ptr<ArrayBuffer>, std::string, double>>>> params     SWIFT_PRIVATE;

  public:
    BatchQueryCommand() = default;
    explicit BatchQueryCommand(std::string query, std::optional<std::variant<std::vector<std::vector<std::variant<nitro::NullType, bool, std::shared_ptr<ArrayBuffer>, std::string, double>>>, std::vector<std::variant<nitro::NullType, bool, std::shared_ptr<ArrayBuffer>, std::string, double>>>> params): query(query), params(params) {}

  public:
    friend bool operator==(const BatchQueryCommand& lhs, const BatchQueryCommand& rhs) = default;
  };

} // namespace margelo::nitro::rnnitrosqlite

namespace margelo::nitro {

  // C++ BatchQueryCommand <> JS BatchQueryCommand (object)
  template <>
  struct JSIConverter<margelo::nitro::rnnitrosqlite::BatchQueryCommand> final {
    static inline margelo::nitro::rnnitrosqlite::BatchQueryCommand fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
      jsi::Object obj = arg.asObject(runtime);
      return margelo::nitro::rnnitrosqlite::BatchQueryCommand(
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "query"))),
        JSIConverter<std::optional<std::variant<std::vector<std::vector<std::variant<nitro::NullType, bool, std::shared_ptr<ArrayBuffer>, std::string, double>>>, std::vector<std::variant<nitro::NullType, bool, std::shared_ptr<ArrayBuffer>, std::string, double>>>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "params")))
      );
    }
    static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::rnnitrosqlite::BatchQueryCommand& arg) {
      jsi::Object obj(runtime);
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "query"), JSIConverter<std::string>::toJSI(runtime, arg.query));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "params"), JSIConverter<std::optional<std::variant<std::vector<std::vector<std::variant<nitro::NullType, bool, std::shared_ptr<ArrayBuffer>, std::string, double>>>, std::vector<std::variant<nitro::NullType, bool, std::shared_ptr<ArrayBuffer>, std::string, double>>>>>::toJSI(runtime, arg.params));
      return obj;
    }
    static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
      if (!value.isObject()) {
        return false;
      }
      jsi::Object obj = value.getObject(runtime);
      if (!nitro::isPlainObject(runtime, obj)) {
        return false;
      }
      if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "query")))) return false;
      if (!JSIConverter<std::optional<std::variant<std::vector<std::vector<std::variant<nitro::NullType, bool, std::shared_ptr<ArrayBuffer>, std::string, double>>>, std::vector<std::variant<nitro::NullType, bool, std::shared_ptr<ArrayBuffer>, std::string, double>>>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "params")))) return false;
      return true;
    }
  };

} // namespace margelo::nitro
