///
/// OneTapConfigureParams.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 <variant>
#include <optional>
#include <vector>

namespace margelo::nitro::nitrogooglesignin {

  /**
   * A struct which can be represented as a JavaScript object (OneTapConfigureParams).
   */
  struct OneTapConfigureParams final {
  public:
    std::string webClientId     SWIFT_PRIVATE;
    std::optional<std::variant<nitro::NullType, std::string>> iosClientId     SWIFT_PRIVATE;
    std::optional<bool> offlineAccess     SWIFT_PRIVATE;
    std::optional<std::variant<nitro::NullType, std::string>> hostedDomain     SWIFT_PRIVATE;
    std::optional<std::variant<nitro::NullType, std::string>> nonce     SWIFT_PRIVATE;
    std::optional<std::variant<nitro::NullType, std::vector<std::string>>> scopes     SWIFT_PRIVATE;
    std::optional<bool> autoSelectOnSignIn     SWIFT_PRIVATE;

  public:
    OneTapConfigureParams() = default;
    explicit OneTapConfigureParams(std::string webClientId, std::optional<std::variant<nitro::NullType, std::string>> iosClientId, std::optional<bool> offlineAccess, std::optional<std::variant<nitro::NullType, std::string>> hostedDomain, std::optional<std::variant<nitro::NullType, std::string>> nonce, std::optional<std::variant<nitro::NullType, std::vector<std::string>>> scopes, std::optional<bool> autoSelectOnSignIn): webClientId(webClientId), iosClientId(iosClientId), offlineAccess(offlineAccess), hostedDomain(hostedDomain), nonce(nonce), scopes(scopes), autoSelectOnSignIn(autoSelectOnSignIn) {}

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

} // namespace margelo::nitro::nitrogooglesignin

namespace margelo::nitro {

  // C++ OneTapConfigureParams <> JS OneTapConfigureParams (object)
  template <>
  struct JSIConverter<margelo::nitro::nitrogooglesignin::OneTapConfigureParams> final {
    static inline margelo::nitro::nitrogooglesignin::OneTapConfigureParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
      jsi::Object obj = arg.asObject(runtime);
      return margelo::nitro::nitrogooglesignin::OneTapConfigureParams(
        JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "webClientId"))),
        JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "iosClientId"))),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "offlineAccess"))),
        JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hostedDomain"))),
        JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "nonce"))),
        JSIConverter<std::optional<std::variant<nitro::NullType, std::vector<std::string>>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "scopes"))),
        JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "autoSelectOnSignIn")))
      );
    }
    static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitrogooglesignin::OneTapConfigureParams& arg) {
      jsi::Object obj(runtime);
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "webClientId"), JSIConverter<std::string>::toJSI(runtime, arg.webClientId));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "iosClientId"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.iosClientId));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "offlineAccess"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.offlineAccess));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "hostedDomain"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.hostedDomain));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "nonce"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.nonce));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "scopes"), JSIConverter<std::optional<std::variant<nitro::NullType, std::vector<std::string>>>>::toJSI(runtime, arg.scopes));
      obj.setProperty(runtime, PropNameIDCache::get(runtime, "autoSelectOnSignIn"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.autoSelectOnSignIn));
      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, "webClientId")))) return false;
      if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "iosClientId")))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "offlineAccess")))) return false;
      if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "hostedDomain")))) return false;
      if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "nonce")))) return false;
      if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::vector<std::string>>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "scopes")))) return false;
      if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "autoSelectOnSignIn")))) return false;
      return true;
    }
  };

} // namespace margelo::nitro
