/// /// NativeDrmParams.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() #include #else #error NitroModules cannot be found! Are you sure you installed NitroModules properly? #endif #if __has_include() #include #else #error NitroModules cannot be found! Are you sure you installed NitroModules properly? #endif #if __has_include() #include #else #error NitroModules cannot be found! Are you sure you installed NitroModules properly? #endif // Forward declaration of `OnGetLicensePayload` to properly resolve imports. namespace margelo::nitro::video { struct OnGetLicensePayload; } #include #include #include #include #include "OnGetLicensePayload.hpp" #include namespace margelo::nitro::video { /** * A struct which can be represented as a JavaScript object (NativeDrmParams). */ struct NativeDrmParams { public: std::optional type SWIFT_PRIVATE; std::optional licenseUrl SWIFT_PRIVATE; std::optional certificateUrl SWIFT_PRIVATE; std::optional contentId SWIFT_PRIVATE; std::optional> licenseHeaders SWIFT_PRIVATE; std::optional multiSession SWIFT_PRIVATE; std::optional>>>(const OnGetLicensePayload& /* payload */)>> getLicense SWIFT_PRIVATE; public: NativeDrmParams() = default; explicit NativeDrmParams(std::optional type, std::optional licenseUrl, std::optional certificateUrl, std::optional contentId, std::optional> licenseHeaders, std::optional multiSession, std::optional>>>(const OnGetLicensePayload& /* payload */)>> getLicense): type(type), licenseUrl(licenseUrl), certificateUrl(certificateUrl), contentId(contentId), licenseHeaders(licenseHeaders), multiSession(multiSession), getLicense(getLicense) {} }; } // namespace margelo::nitro::video namespace margelo::nitro { // C++ NativeDrmParams <> JS NativeDrmParams (object) template <> struct JSIConverter final { static inline margelo::nitro::video::NativeDrmParams fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) { jsi::Object obj = arg.asObject(runtime); return margelo::nitro::video::NativeDrmParams( JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "type")), JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "licenseUrl")), JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "certificateUrl")), JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "contentId")), JSIConverter>>::fromJSI(runtime, obj.getProperty(runtime, "licenseHeaders")), JSIConverter>::fromJSI(runtime, obj.getProperty(runtime, "multiSession")), JSIConverter>>>(const margelo::nitro::video::OnGetLicensePayload&)>>>::fromJSI(runtime, obj.getProperty(runtime, "getLicense")) ); } static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::video::NativeDrmParams& arg) { jsi::Object obj(runtime); obj.setProperty(runtime, "type", JSIConverter>::toJSI(runtime, arg.type)); obj.setProperty(runtime, "licenseUrl", JSIConverter>::toJSI(runtime, arg.licenseUrl)); obj.setProperty(runtime, "certificateUrl", JSIConverter>::toJSI(runtime, arg.certificateUrl)); obj.setProperty(runtime, "contentId", JSIConverter>::toJSI(runtime, arg.contentId)); obj.setProperty(runtime, "licenseHeaders", JSIConverter>>::toJSI(runtime, arg.licenseHeaders)); obj.setProperty(runtime, "multiSession", JSIConverter>::toJSI(runtime, arg.multiSession)); obj.setProperty(runtime, "getLicense", JSIConverter>>>(const margelo::nitro::video::OnGetLicensePayload&)>>>::toJSI(runtime, arg.getLicense)); 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>::canConvert(runtime, obj.getProperty(runtime, "type"))) return false; if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, "licenseUrl"))) return false; if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, "certificateUrl"))) return false; if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, "contentId"))) return false; if (!JSIConverter>>::canConvert(runtime, obj.getProperty(runtime, "licenseHeaders"))) return false; if (!JSIConverter>::canConvert(runtime, obj.getProperty(runtime, "multiSession"))) return false; if (!JSIConverter>>>(const margelo::nitro::video::OnGetLicensePayload&)>>>::canConvert(runtime, obj.getProperty(runtime, "getLicense"))) return false; return true; } }; } // namespace margelo::nitro