///
/// NativeBatchQueryCommand.hpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2025 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

// Forward declaration of `ArrayBuffer` to properly resolve imports.
namespace NitroModules { class ArrayBuffer; }
// Forward declaration of `SQLiteNullValue` to properly resolve imports.
namespace margelo::nitro::rnnitrosqlite { struct SQLiteNullValue; }

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

namespace margelo::nitro::rnnitrosqlite {

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

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

} // namespace margelo::nitro::rnnitrosqlite

namespace margelo::nitro {

  using namespace margelo::nitro::rnnitrosqlite;

  // C++ NativeBatchQueryCommand <> JS NativeBatchQueryCommand (object)
  template <>
  struct JSIConverter<NativeBatchQueryCommand> final {
    static inline NativeBatchQueryCommand fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
      jsi::Object obj = arg.asObject(runtime);
      return NativeBatchQueryCommand(
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, "query")),
        JSIConverter<std::optional<std::variant<std::vector<std::variant<std::string, double, bool, std::shared_ptr<ArrayBuffer>, SQLiteNullValue>>, std::vector<std::vector<std::variant<std::string, double, bool, std::shared_ptr<ArrayBuffer>, SQLiteNullValue>>>>>>::fromJSI(runtime, obj.getProperty(runtime, "params"))
      );
    }
    static inline jsi::Value toJSI(jsi::Runtime& runtime, const NativeBatchQueryCommand& arg) {
      jsi::Object obj(runtime);
      obj.setProperty(runtime, "query", JSIConverter<std::string>::toJSI(runtime, arg.query));
      obj.setProperty(runtime, "params", JSIConverter<std::optional<std::variant<std::vector<std::variant<std::string, double, bool, std::shared_ptr<ArrayBuffer>, SQLiteNullValue>>, std::vector<std::vector<std::variant<std::string, double, bool, std::shared_ptr<ArrayBuffer>, SQLiteNullValue>>>>>>::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 (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, "query"))) return false;
      if (!JSIConverter<std::optional<std::variant<std::vector<std::variant<std::string, double, bool, std::shared_ptr<ArrayBuffer>, SQLiteNullValue>>, std::vector<std::vector<std::variant<std::string, double, bool, std::shared_ptr<ArrayBuffer>, SQLiteNullValue>>>>>>::canConvert(runtime, obj.getProperty(runtime, "params"))) return false;
      return true;
    }
  };

} // namespace margelo::nitro
