#pragma once
#include "jstocbpp_defs.hpp"

#include "jstocbpp_basic.hpp"
#include "jstocbpp_cpptypes.hpp"

#include <core/cluster.hxx>
#include <core/operations.hxx>
#include <core/operations/management/analytics.hxx>
#include <core/operations/management/bucket.hxx>
#include <core/operations/management/bucket_describe.hxx>
#include <core/operations/management/cluster_describe.hxx>
#include <core/operations/management/cluster_developer_preview_enable.hxx>
#include <core/operations/management/collections.hxx>
#include <core/operations/management/eventing.hxx>
#include <core/operations/management/freeform.hxx>
#include <core/operations/management/query.hxx>
#include <core/operations/management/search.hxx>
#include <core/operations/management/user.hxx>
#include <core/operations/management/view.hxx>
#include <core/range_scan_orchestrator_options.hxx>

namespace couchnode
{

//#region Autogenerated Marshalling

template <>
struct js_to_cbpp_t<couchbase::core::management::analytics::dataset> {
    static inline couchbase::core::management::analytics::dataset
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::analytics::dataset cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::string>(cppObj.dataverse_name,
                                jsObj.Get("dataverse_name"));
        js_to_cbpp<std::string>(cppObj.link_name, jsObj.Get("link_name"));
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::analytics::dataset &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("dataverse_name",
                   cbpp_to_js<std::string>(env, cppObj.dataverse_name));
        resObj.Set("link_name", cbpp_to_js<std::string>(env, cppObj.link_name));
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::management::analytics::index> {
    static inline couchbase::core::management::analytics::index
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::analytics::index cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::string>(cppObj.dataverse_name,
                                jsObj.Get("dataverse_name"));
        js_to_cbpp<std::string>(cppObj.dataset_name, jsObj.Get("dataset_name"));
        js_to_cbpp<bool>(cppObj.is_primary, jsObj.Get("is_primary"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::analytics::index &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("dataverse_name",
                   cbpp_to_js<std::string>(env, cppObj.dataverse_name));
        resObj.Set("dataset_name",
                   cbpp_to_js<std::string>(env, cppObj.dataset_name));
        resObj.Set("is_primary", cbpp_to_js<bool>(env, cppObj.is_primary));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::management::analytics::azure_blob_external_link> {
    static inline couchbase::core::management::analytics::
        azure_blob_external_link
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::analytics::azure_blob_external_link cppObj;
        js_to_cbpp<std::string>(cppObj.link_name, jsObj.Get("link_name"));
        js_to_cbpp<std::string>(cppObj.dataverse, jsObj.Get("dataverse"));
        js_to_cbpp<std::optional<std::string>>(cppObj.connection_string,
                                               jsObj.Get("connection_string"));
        js_to_cbpp<std::optional<std::string>>(cppObj.account_name,
                                               jsObj.Get("account_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.account_key,
                                               jsObj.Get("account_key"));
        js_to_cbpp<std::optional<std::string>>(
            cppObj.shared_access_signature,
            jsObj.Get("shared_access_signature"));
        js_to_cbpp<std::optional<std::string>>(cppObj.blob_endpoint,
                                               jsObj.Get("blob_endpoint"));
        js_to_cbpp<std::optional<std::string>>(cppObj.endpoint_suffix,
                                               jsObj.Get("endpoint_suffix"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::analytics::azure_blob_external_link
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("link_name", cbpp_to_js<std::string>(env, cppObj.link_name));
        resObj.Set("dataverse", cbpp_to_js<std::string>(env, cppObj.dataverse));
        resObj.Set("connection_string", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.connection_string));
        resObj.Set("account_name", cbpp_to_js<std::optional<std::string>>(
                                       env, cppObj.account_name));
        resObj.Set("account_key", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.account_key));
        resObj.Set("shared_access_signature",
                   cbpp_to_js<std::optional<std::string>>(
                       env, cppObj.shared_access_signature));
        resObj.Set("blob_endpoint", cbpp_to_js<std::optional<std::string>>(
                                        env, cppObj.blob_endpoint));
        resObj.Set("endpoint_suffix", cbpp_to_js<std::optional<std::string>>(
                                          env, cppObj.endpoint_suffix));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::management::analytics::
                        couchbase_link_encryption_settings> {
    static inline couchbase::core::management::analytics::
        couchbase_link_encryption_settings
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::analytics::
            couchbase_link_encryption_settings cppObj;
        js_to_cbpp<couchbase::core::management::analytics::
                       couchbase_link_encryption_level>(cppObj.level,
                                                        jsObj.Get("level"));
        js_to_cbpp<std::optional<std::string>>(cppObj.certificate,
                                               jsObj.Get("certificate"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_certificate,
                                               jsObj.Get("client_certificate"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_key,
                                               jsObj.Get("client_key"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::management::analytics::
                             couchbase_link_encryption_settings &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("level", cbpp_to_js<couchbase::core::management::analytics::
                                           couchbase_link_encryption_level>(
                                env, cppObj.level));
        resObj.Set("certificate", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.certificate));
        resObj.Set("client_certificate", cbpp_to_js<std::optional<std::string>>(
                                             env, cppObj.client_certificate));
        resObj.Set("client_key", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.client_key));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::management::analytics::couchbase_remote_link> {
    static inline couchbase::core::management::analytics::couchbase_remote_link
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::analytics::couchbase_remote_link cppObj;
        js_to_cbpp<std::string>(cppObj.link_name, jsObj.Get("link_name"));
        js_to_cbpp<std::string>(cppObj.dataverse, jsObj.Get("dataverse"));
        js_to_cbpp<std::string>(cppObj.hostname, jsObj.Get("hostname"));
        js_to_cbpp<std::optional<std::string>>(cppObj.username,
                                               jsObj.Get("username"));
        js_to_cbpp<std::optional<std::string>>(cppObj.password,
                                               jsObj.Get("password"));
        js_to_cbpp<couchbase::core::management::analytics::
                       couchbase_link_encryption_settings>(
            cppObj.encryption, jsObj.Get("encryption"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::analytics::couchbase_remote_link
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("link_name", cbpp_to_js<std::string>(env, cppObj.link_name));
        resObj.Set("dataverse", cbpp_to_js<std::string>(env, cppObj.dataverse));
        resObj.Set("hostname", cbpp_to_js<std::string>(env, cppObj.hostname));
        resObj.Set("username", cbpp_to_js<std::optional<std::string>>(
                                   env, cppObj.username));
        resObj.Set("password", cbpp_to_js<std::optional<std::string>>(
                                   env, cppObj.password));
        resObj.Set("encryption",
                   cbpp_to_js<couchbase::core::management::analytics::
                                  couchbase_link_encryption_settings>(
                       env, cppObj.encryption));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::management::analytics::s3_external_link> {
    static inline couchbase::core::management::analytics::s3_external_link
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::analytics::s3_external_link cppObj;
        js_to_cbpp<std::string>(cppObj.link_name, jsObj.Get("link_name"));
        js_to_cbpp<std::string>(cppObj.dataverse, jsObj.Get("dataverse"));
        js_to_cbpp<std::string>(cppObj.access_key_id,
                                jsObj.Get("access_key_id"));
        js_to_cbpp<std::string>(cppObj.secret_access_key,
                                jsObj.Get("secret_access_key"));
        js_to_cbpp<std::optional<std::string>>(cppObj.session_token,
                                               jsObj.Get("session_token"));
        js_to_cbpp<std::string>(cppObj.region, jsObj.Get("region"));
        js_to_cbpp<std::optional<std::string>>(cppObj.service_endpoint,
                                               jsObj.Get("service_endpoint"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::management::analytics::s3_external_link &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("link_name", cbpp_to_js<std::string>(env, cppObj.link_name));
        resObj.Set("dataverse", cbpp_to_js<std::string>(env, cppObj.dataverse));
        resObj.Set("access_key_id",
                   cbpp_to_js<std::string>(env, cppObj.access_key_id));
        resObj.Set("secret_access_key",
                   cbpp_to_js<std::string>(env, cppObj.secret_access_key));
        resObj.Set("session_token", cbpp_to_js<std::optional<std::string>>(
                                        env, cppObj.session_token));
        resObj.Set("region", cbpp_to_js<std::string>(env, cppObj.region));
        resObj.Set("service_endpoint", cbpp_to_js<std::optional<std::string>>(
                                           env, cppObj.service_endpoint));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::management::cluster::bucket_settings> {
    static inline couchbase::core::management::cluster::bucket_settings
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::cluster::bucket_settings cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::string>(cppObj.uuid, jsObj.Get("uuid"));
        js_to_cbpp<std::uint64_t>(cppObj.ram_quota_mb,
                                  jsObj.Get("ram_quota_mb"));
        js_to_cbpp<couchbase::core::management::cluster::bucket_type>(
            cppObj.bucket_type, jsObj.Get("bucket_type"));
        js_to_cbpp<std::optional<std::uint32_t>>(cppObj.max_expiry,
                                                 jsObj.Get("max_expiry"));
        js_to_cbpp<couchbase::core::management::cluster::bucket_compression>(
            cppObj.compression_mode, jsObj.Get("compression_mode"));
        js_to_cbpp<std::optional<couchbase::durability_level>>(
            cppObj.minimum_durability_level,
            jsObj.Get("minimum_durability_level"));
        js_to_cbpp<std::optional<std::uint32_t>>(cppObj.num_replicas,
                                                 jsObj.Get("num_replicas"));
        js_to_cbpp<std::optional<bool>>(cppObj.replica_indexes,
                                        jsObj.Get("replica_indexes"));
        js_to_cbpp<std::optional<bool>>(cppObj.flush_enabled,
                                        jsObj.Get("flush_enabled"));
        js_to_cbpp<
            couchbase::core::management::cluster::bucket_eviction_policy>(
            cppObj.eviction_policy, jsObj.Get("eviction_policy"));
        js_to_cbpp<
            couchbase::core::management::cluster::bucket_conflict_resolution>(
            cppObj.conflict_resolution_type,
            jsObj.Get("conflict_resolution_type"));
        js_to_cbpp<std::optional<bool>>(
            cppObj.history_retention_collection_default,
            jsObj.Get("history_retention_collection_default"));
        js_to_cbpp<std::optional<std::uint32_t>>(
            cppObj.history_retention_bytes,
            jsObj.Get("history_retention_bytes"));
        js_to_cbpp<std::optional<std::uint32_t>>(
            cppObj.history_retention_duration,
            jsObj.Get("history_retention_duration"));
        js_to_cbpp<
            couchbase::core::management::cluster::bucket_storage_backend>(
            cppObj.storage_backend, jsObj.Get("storage_backend"));
        js_to_cbpp<std::vector<std::string>>(cppObj.capabilities,
                                             jsObj.Get("capabilities"));
        js_to_cbpp<std::vector<
            couchbase::core::management::cluster::bucket_settings::node>>(
            cppObj.nodes, jsObj.Get("nodes"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::cluster::bucket_settings &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("uuid", cbpp_to_js<std::string>(env, cppObj.uuid));
        resObj.Set("ram_quota_mb",
                   cbpp_to_js<std::uint64_t>(env, cppObj.ram_quota_mb));
        resObj.Set(
            "bucket_type",
            cbpp_to_js<couchbase::core::management::cluster::bucket_type>(
                env, cppObj.bucket_type));
        resObj.Set("max_expiry", cbpp_to_js<std::optional<std::uint32_t>>(
                                     env, cppObj.max_expiry));
        resObj.Set(
            "compression_mode",
            cbpp_to_js<
                couchbase::core::management::cluster::bucket_compression>(
                env, cppObj.compression_mode));
        resObj.Set("minimum_durability_level",
                   cbpp_to_js<std::optional<couchbase::durability_level>>(
                       env, cppObj.minimum_durability_level));
        resObj.Set("num_replicas", cbpp_to_js<std::optional<std::uint32_t>>(
                                       env, cppObj.num_replicas));
        resObj.Set("replica_indexes", cbpp_to_js<std::optional<bool>>(
                                          env, cppObj.replica_indexes));
        resObj.Set("flush_enabled",
                   cbpp_to_js<std::optional<bool>>(env, cppObj.flush_enabled));
        resObj.Set(
            "eviction_policy",
            cbpp_to_js<
                couchbase::core::management::cluster::bucket_eviction_policy>(
                env, cppObj.eviction_policy));
        resObj.Set("conflict_resolution_type",
                   cbpp_to_js<couchbase::core::management::cluster::
                                  bucket_conflict_resolution>(
                       env, cppObj.conflict_resolution_type));
        resObj.Set("history_retention_collection_default",
                   cbpp_to_js<std::optional<bool>>(
                       env, cppObj.history_retention_collection_default));
        resObj.Set("history_retention_bytes",
                   cbpp_to_js<std::optional<std::uint32_t>>(
                       env, cppObj.history_retention_bytes));
        resObj.Set("history_retention_duration",
                   cbpp_to_js<std::optional<std::uint32_t>>(
                       env, cppObj.history_retention_duration));
        resObj.Set(
            "storage_backend",
            cbpp_to_js<
                couchbase::core::management::cluster::bucket_storage_backend>(
                env, cppObj.storage_backend));
        resObj.Set("capabilities", cbpp_to_js<std::vector<std::string>>(
                                       env, cppObj.capabilities));
        resObj.Set(
            "nodes",
            cbpp_to_js<std::vector<
                couchbase::core::management::cluster::bucket_settings::node>>(
                env, cppObj.nodes));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::management::cluster::bucket_settings::node> {
    static inline couchbase::core::management::cluster::bucket_settings::node
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::cluster::bucket_settings::node cppObj;
        js_to_cbpp<std::string>(cppObj.hostname, jsObj.Get("hostname"));
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::string>(cppObj.version, jsObj.Get("version"));
        js_to_cbpp<std::vector<std::string>>(cppObj.services,
                                             jsObj.Get("services"));
        js_to_cbpp<std::map<std::string, std::uint16_t>>(cppObj.ports,
                                                         jsObj.Get("ports"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::cluster::bucket_settings::node
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("hostname", cbpp_to_js<std::string>(env, cppObj.hostname));
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set("version", cbpp_to_js<std::string>(env, cppObj.version));
        resObj.Set("services",
                   cbpp_to_js<std::vector<std::string>>(env, cppObj.services));
        resObj.Set("ports", cbpp_to_js<std::map<std::string, std::uint16_t>>(
                                env, cppObj.ports));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::management::views::design_document> {
    static inline couchbase::core::management::views::design_document
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::views::design_document cppObj;
        js_to_cbpp<std::optional<std::string>>(cppObj.rev, jsObj.Get("rev"));
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<couchbase::core::design_document_namespace>(cppObj.ns,
                                                               jsObj.Get("ns"));
        js_to_cbpp<std::map<std::string, couchbase::core::management::views::
                                             design_document::view>>(
            cppObj.views, jsObj.Get("views"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::views::design_document &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("rev",
                   cbpp_to_js<std::optional<std::string>>(env, cppObj.rev));
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("ns", cbpp_to_js<couchbase::core::design_document_namespace>(
                             env, cppObj.ns));
        resObj.Set(
            "views",
            cbpp_to_js<std::map<std::string, couchbase::core::management::
                                                 views::design_document::view>>(
                env, cppObj.views));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::management::views::design_document::view> {
    static inline couchbase::core::management::views::design_document::view
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::views::design_document::view cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.map, jsObj.Get("map"));
        js_to_cbpp<std::optional<std::string>>(cppObj.reduce,
                                               jsObj.Get("reduce"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::management::views::design_document::view &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("map",
                   cbpp_to_js<std::optional<std::string>>(env, cppObj.map));
        resObj.Set("reduce",
                   cbpp_to_js<std::optional<std::string>>(env, cppObj.reduce));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::management::eventing::function_keyspace> {
    static inline couchbase::core::management::eventing::function_keyspace
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::eventing::function_keyspace cppObj;
        js_to_cbpp<std::string>(cppObj.bucket, jsObj.Get("bucket"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope,
                                               jsObj.Get("scope"));
        js_to_cbpp<std::optional<std::string>>(cppObj.collection,
                                               jsObj.Get("collection"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::management::eventing::function_keyspace &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket", cbpp_to_js<std::string>(env, cppObj.bucket));
        resObj.Set("scope",
                   cbpp_to_js<std::optional<std::string>>(env, cppObj.scope));
        resObj.Set("collection", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.collection));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::management::eventing::function_settings> {
    static inline couchbase::core::management::eventing::function_settings
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::eventing::function_settings cppObj;
        js_to_cbpp<std::optional<std::int64_t>>(cppObj.cpp_worker_count,
                                                jsObj.Get("cpp_worker_count"));
        js_to_cbpp<std::optional<
            couchbase::core::management::eventing::function_dcp_boundary>>(
            cppObj.dcp_stream_boundary, jsObj.Get("dcp_stream_boundary"));
        js_to_cbpp<std::optional<std::string>>(cppObj.description,
                                               jsObj.Get("description"));
        js_to_cbpp<std::optional<
            couchbase::core::management::eventing::function_deployment_status>>(
            cppObj.deployment_status, jsObj.Get("deployment_status"));
        js_to_cbpp<std::optional<
            couchbase::core::management::eventing::function_processing_status>>(
            cppObj.processing_status, jsObj.Get("processing_status"));
        js_to_cbpp<std::optional<
            couchbase::core::management::eventing::function_log_level>>(
            cppObj.log_level, jsObj.Get("log_level"));
        js_to_cbpp<std::optional<couchbase::core::management::eventing::
                                     function_language_compatibility>>(
            cppObj.language_compatibility, jsObj.Get("language_compatibility"));
        js_to_cbpp<std::optional<std::chrono::seconds>>(
            cppObj.execution_timeout, jsObj.Get("execution_timeout"));
        js_to_cbpp<std::optional<std::int64_t>>(cppObj.lcb_inst_capacity,
                                                jsObj.Get("lcb_inst_capacity"));
        js_to_cbpp<std::optional<std::int64_t>>(cppObj.lcb_retry_count,
                                                jsObj.Get("lcb_retry_count"));
        js_to_cbpp<std::optional<std::chrono::seconds>>(
            cppObj.lcb_timeout, jsObj.Get("lcb_timeout"));
        js_to_cbpp<std::optional<couchbase::query_scan_consistency>>(
            cppObj.query_consistency, jsObj.Get("query_consistency"));
        js_to_cbpp<std::optional<std::int64_t>>(
            cppObj.num_timer_partitions, jsObj.Get("num_timer_partitions"));
        js_to_cbpp<std::optional<std::int64_t>>(cppObj.sock_batch_size,
                                                jsObj.Get("sock_batch_size"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.tick_duration, jsObj.Get("tick_duration"));
        js_to_cbpp<std::optional<std::int64_t>>(
            cppObj.timer_context_size, jsObj.Get("timer_context_size"));
        js_to_cbpp<std::optional<std::string>>(cppObj.user_prefix,
                                               jsObj.Get("user_prefix"));
        js_to_cbpp<std::optional<std::int64_t>>(cppObj.bucket_cache_size,
                                                jsObj.Get("bucket_cache_size"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.bucket_cache_age, jsObj.Get("bucket_cache_age"));
        js_to_cbpp<std::optional<std::int64_t>>(
            cppObj.curl_max_allowed_resp_size,
            jsObj.Get("curl_max_allowed_resp_size"));
        js_to_cbpp<std::optional<bool>>(cppObj.query_prepare_all,
                                        jsObj.Get("query_prepare_all"));
        js_to_cbpp<std::optional<std::int64_t>>(cppObj.worker_count,
                                                jsObj.Get("worker_count"));
        js_to_cbpp<std::vector<std::string>>(cppObj.handler_headers,
                                             jsObj.Get("handler_headers"));
        js_to_cbpp<std::vector<std::string>>(cppObj.handler_footers,
                                             jsObj.Get("handler_footers"));
        js_to_cbpp<std::optional<bool>>(cppObj.enable_app_log_rotation,
                                        jsObj.Get("enable_app_log_rotation"));
        js_to_cbpp<std::optional<std::string>>(cppObj.app_log_dir,
                                               jsObj.Get("app_log_dir"));
        js_to_cbpp<std::optional<std::int64_t>>(cppObj.app_log_max_size,
                                                jsObj.Get("app_log_max_size"));
        js_to_cbpp<std::optional<std::int64_t>>(cppObj.app_log_max_files,
                                                jsObj.Get("app_log_max_files"));
        js_to_cbpp<std::optional<std::chrono::seconds>>(
            cppObj.checkpoint_interval, jsObj.Get("checkpoint_interval"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::management::eventing::function_settings &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("cpp_worker_count", cbpp_to_js<std::optional<std::int64_t>>(
                                           env, cppObj.cpp_worker_count));
        resObj.Set(
            "dcp_stream_boundary",
            cbpp_to_js<std::optional<
                couchbase::core::management::eventing::function_dcp_boundary>>(
                env, cppObj.dcp_stream_boundary));
        resObj.Set("description", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.description));
        resObj.Set(
            "deployment_status",
            cbpp_to_js<std::optional<couchbase::core::management::eventing::
                                         function_deployment_status>>(
                env, cppObj.deployment_status));
        resObj.Set(
            "processing_status",
            cbpp_to_js<std::optional<couchbase::core::management::eventing::
                                         function_processing_status>>(
                env, cppObj.processing_status));
        resObj.Set(
            "log_level",
            cbpp_to_js<std::optional<
                couchbase::core::management::eventing::function_log_level>>(
                env, cppObj.log_level));
        resObj.Set(
            "language_compatibility",
            cbpp_to_js<std::optional<couchbase::core::management::eventing::
                                         function_language_compatibility>>(
                env, cppObj.language_compatibility));
        resObj.Set("execution_timeout",
                   cbpp_to_js<std::optional<std::chrono::seconds>>(
                       env, cppObj.execution_timeout));
        resObj.Set("lcb_inst_capacity", cbpp_to_js<std::optional<std::int64_t>>(
                                            env, cppObj.lcb_inst_capacity));
        resObj.Set("lcb_retry_count", cbpp_to_js<std::optional<std::int64_t>>(
                                          env, cppObj.lcb_retry_count));
        resObj.Set("lcb_timeout",
                   cbpp_to_js<std::optional<std::chrono::seconds>>(
                       env, cppObj.lcb_timeout));
        resObj.Set("query_consistency",
                   cbpp_to_js<std::optional<couchbase::query_scan_consistency>>(
                       env, cppObj.query_consistency));
        resObj.Set("num_timer_partitions",
                   cbpp_to_js<std::optional<std::int64_t>>(
                       env, cppObj.num_timer_partitions));
        resObj.Set("sock_batch_size", cbpp_to_js<std::optional<std::int64_t>>(
                                          env, cppObj.sock_batch_size));
        resObj.Set("tick_duration",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.tick_duration));
        resObj.Set("timer_context_size",
                   cbpp_to_js<std::optional<std::int64_t>>(
                       env, cppObj.timer_context_size));
        resObj.Set("user_prefix", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.user_prefix));
        resObj.Set("bucket_cache_size", cbpp_to_js<std::optional<std::int64_t>>(
                                            env, cppObj.bucket_cache_size));
        resObj.Set("bucket_cache_age",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.bucket_cache_age));
        resObj.Set("curl_max_allowed_resp_size",
                   cbpp_to_js<std::optional<std::int64_t>>(
                       env, cppObj.curl_max_allowed_resp_size));
        resObj.Set("query_prepare_all", cbpp_to_js<std::optional<bool>>(
                                            env, cppObj.query_prepare_all));
        resObj.Set("worker_count", cbpp_to_js<std::optional<std::int64_t>>(
                                       env, cppObj.worker_count));
        resObj.Set("handler_headers", cbpp_to_js<std::vector<std::string>>(
                                          env, cppObj.handler_headers));
        resObj.Set("handler_footers", cbpp_to_js<std::vector<std::string>>(
                                          env, cppObj.handler_footers));
        resObj.Set("enable_app_log_rotation",
                   cbpp_to_js<std::optional<bool>>(
                       env, cppObj.enable_app_log_rotation));
        resObj.Set("app_log_dir", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.app_log_dir));
        resObj.Set("app_log_max_size", cbpp_to_js<std::optional<std::int64_t>>(
                                           env, cppObj.app_log_max_size));
        resObj.Set("app_log_max_files", cbpp_to_js<std::optional<std::int64_t>>(
                                            env, cppObj.app_log_max_files));
        resObj.Set("checkpoint_interval",
                   cbpp_to_js<std::optional<std::chrono::seconds>>(
                       env, cppObj.checkpoint_interval));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::management::eventing::function_bucket_binding> {
    static inline couchbase::core::management::eventing::function_bucket_binding
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::eventing::function_bucket_binding cppObj;
        js_to_cbpp<std::string>(cppObj.alias, jsObj.Get("alias"));
        js_to_cbpp<couchbase::core::management::eventing::function_keyspace>(
            cppObj.name, jsObj.Get("name"));
        js_to_cbpp<
            couchbase::core::management::eventing::function_bucket_access>(
            cppObj.access, jsObj.Get("access"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::eventing::function_bucket_binding
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("alias", cbpp_to_js<std::string>(env, cppObj.alias));
        resObj.Set(
            "name",
            cbpp_to_js<
                couchbase::core::management::eventing::function_keyspace>(
                env, cppObj.name));
        resObj.Set(
            "access",
            cbpp_to_js<
                couchbase::core::management::eventing::function_bucket_access>(
                env, cppObj.access));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::management::eventing::function_url_no_auth> {
    static inline couchbase::core::management::eventing::function_url_no_auth
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::eventing::function_url_no_auth cppObj;
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::eventing::function_url_no_auth
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::management::eventing::function_url_auth_basic> {
    static inline couchbase::core::management::eventing::function_url_auth_basic
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::eventing::function_url_auth_basic cppObj;
        js_to_cbpp<std::string>(cppObj.username, jsObj.Get("username"));
        js_to_cbpp<std::string>(cppObj.password, jsObj.Get("password"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::eventing::function_url_auth_basic
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("username", cbpp_to_js<std::string>(env, cppObj.username));
        resObj.Set("password", cbpp_to_js<std::string>(env, cppObj.password));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::management::eventing::function_url_auth_digest> {
    static inline couchbase::core::management::eventing::
        function_url_auth_digest
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::eventing::function_url_auth_digest cppObj;
        js_to_cbpp<std::string>(cppObj.username, jsObj.Get("username"));
        js_to_cbpp<std::string>(cppObj.password, jsObj.Get("password"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::eventing::function_url_auth_digest
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("username", cbpp_to_js<std::string>(env, cppObj.username));
        resObj.Set("password", cbpp_to_js<std::string>(env, cppObj.password));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::management::eventing::function_url_auth_bearer> {
    static inline couchbase::core::management::eventing::
        function_url_auth_bearer
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::eventing::function_url_auth_bearer cppObj;
        js_to_cbpp<std::string>(cppObj.key, jsObj.Get("key"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::eventing::function_url_auth_bearer
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("key", cbpp_to_js<std::string>(env, cppObj.key));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::management::eventing::function_url_binding> {
    static inline couchbase::core::management::eventing::function_url_binding
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        auto auth_name = jsToCbpp<std::string>(jsObj.Get("auth_name"));
        std::variant<
            couchbase::core::management::eventing::function_url_no_auth,
            couchbase::core::management::eventing::function_url_auth_basic,
            couchbase::core::management::eventing::function_url_auth_digest,
            couchbase::core::management::eventing::function_url_auth_bearer>
            auth;
        if (auth_name.compare("function_url_no_auth") == 0) {
            auth = js_to_cbpp<
                couchbase::core::management::eventing::function_url_no_auth>(
                jsObj.Get("auth_value"));
        } else if (auth_name.compare("function_url_auth_basic") == 0) {
            auth = js_to_cbpp<
                couchbase::core::management::eventing::function_url_auth_basic>(
                jsObj.Get("auth_value"));
        } else if (auth_name.compare("function_url_auth_digest") == 0) {
            auth = js_to_cbpp<couchbase::core::management::eventing::
                                  function_url_auth_digest>(
                jsObj.Get("auth_value"));
        } else {
            auth = js_to_cbpp<couchbase::core::management::eventing::
                                  function_url_auth_bearer>(
                jsObj.Get("auth_value"));
        }
        couchbase::core::management::eventing::function_url_binding cppObj;
        js_to_cbpp<std::string>(cppObj.alias, jsObj.Get("alias"));
        js_to_cbpp<std::string>(cppObj.hostname, jsObj.Get("hostname"));
        js_to_cbpp<bool>(cppObj.allow_cookies, jsObj.Get("allow_cookies"));
        js_to_cbpp<bool>(cppObj.validate_ssl_certificate,
                         jsObj.Get("validate_ssl_certificate"));
        cppObj.auth = auth;
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::eventing::function_url_binding
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        if (std::holds_alternative<
                couchbase::core::management::eventing::function_url_no_auth>(
                cppObj.auth)) {
            resObj.Set("auth_name",
                       cbpp_to_js<std::string>(env, "function_url_no_auth"));
        } else if (std::holds_alternative<
                       couchbase::core::management::eventing::
                           function_url_auth_basic>(cppObj.auth)) {
            resObj.Set("auth_name",
                       cbpp_to_js<std::string>(env, "function_url_auth_basic"));
        } else if (std::holds_alternative<
                       couchbase::core::management::eventing::
                           function_url_auth_digest>(cppObj.auth)) {
            resObj.Set("auth_name", cbpp_to_js<std::string>(
                                        env, "function_url_auth_digest"));
        } else {
            resObj.Set("auth_name", cbpp_to_js<std::string>(
                                        env, "function_url_auth_bearer"));
        }
        resObj.Set("alias", cbpp_to_js<std::string>(env, cppObj.alias));
        resObj.Set("hostname", cbpp_to_js<std::string>(env, cppObj.hostname));
        resObj.Set("allow_cookies",
                   cbpp_to_js<bool>(env, cppObj.allow_cookies));
        resObj.Set("validate_ssl_certificate",
                   cbpp_to_js<bool>(env, cppObj.validate_ssl_certificate));
        resObj.Set(
            "auth_value",
            cbpp_to_js<std::variant<
                couchbase::core::management::eventing::function_url_no_auth,
                couchbase::core::management::eventing::function_url_auth_basic,
                couchbase::core::management::eventing::function_url_auth_digest,
                couchbase::core::management::eventing::
                    function_url_auth_bearer>>(env, cppObj.auth));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::management::eventing::function_constant_binding> {
    static inline couchbase::core::management::eventing::
        function_constant_binding
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::eventing::function_constant_binding cppObj;
        js_to_cbpp<std::string>(cppObj.alias, jsObj.Get("alias"));
        js_to_cbpp<std::string>(cppObj.literal, jsObj.Get("literal"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::eventing::function_constant_binding
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("alias", cbpp_to_js<std::string>(env, cppObj.alias));
        resObj.Set("literal", cbpp_to_js<std::string>(env, cppObj.literal));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::management::eventing::function> {
    static inline couchbase::core::management::eventing::function
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::eventing::function cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::string>(cppObj.code, jsObj.Get("code"));
        js_to_cbpp<couchbase::core::management::eventing::function_keyspace>(
            cppObj.metadata_keyspace, jsObj.Get("metadata_keyspace"));
        js_to_cbpp<couchbase::core::management::eventing::function_keyspace>(
            cppObj.source_keyspace, jsObj.Get("source_keyspace"));
        js_to_cbpp<std::optional<std::string>>(cppObj.version,
                                               jsObj.Get("version"));
        js_to_cbpp<std::optional<bool>>(cppObj.enforce_schema,
                                        jsObj.Get("enforce_schema"));
        js_to_cbpp<std::optional<std::int64_t>>(cppObj.handler_uuid,
                                                jsObj.Get("handler_uuid"));
        js_to_cbpp<std::optional<std::string>>(
            cppObj.function_instance_id, jsObj.Get("function_instance_id"));
        js_to_cbpp<std::vector<
            couchbase::core::management::eventing::function_bucket_binding>>(
            cppObj.bucket_bindings, jsObj.Get("bucket_bindings"));
        js_to_cbpp<std::vector<
            couchbase::core::management::eventing::function_url_binding>>(
            cppObj.url_bindings, jsObj.Get("url_bindings"));
        js_to_cbpp<std::vector<
            couchbase::core::management::eventing::function_constant_binding>>(
            cppObj.constant_bindings, jsObj.Get("constant_bindings"));
        js_to_cbpp<couchbase::core::management::eventing::function_settings>(
            cppObj.settings, jsObj.Get("settings"));
        // internal
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::eventing::function &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("code", cbpp_to_js<std::string>(env, cppObj.code));
        resObj.Set(
            "metadata_keyspace",
            cbpp_to_js<
                couchbase::core::management::eventing::function_keyspace>(
                env, cppObj.metadata_keyspace));
        resObj.Set(
            "source_keyspace",
            cbpp_to_js<
                couchbase::core::management::eventing::function_keyspace>(
                env, cppObj.source_keyspace));
        resObj.Set("version",
                   cbpp_to_js<std::optional<std::string>>(env, cppObj.version));
        resObj.Set("enforce_schema",
                   cbpp_to_js<std::optional<bool>>(env, cppObj.enforce_schema));
        resObj.Set("handler_uuid", cbpp_to_js<std::optional<std::int64_t>>(
                                       env, cppObj.handler_uuid));
        resObj.Set("function_instance_id",
                   cbpp_to_js<std::optional<std::string>>(
                       env, cppObj.function_instance_id));
        resObj.Set(
            "bucket_bindings",
            cbpp_to_js<std::vector<couchbase::core::management::eventing::
                                       function_bucket_binding>>(
                env, cppObj.bucket_bindings));
        resObj.Set(
            "url_bindings",
            cbpp_to_js<std::vector<
                couchbase::core::management::eventing::function_url_binding>>(
                env, cppObj.url_bindings));
        resObj.Set(
            "constant_bindings",
            cbpp_to_js<std::vector<couchbase::core::management::eventing::
                                       function_constant_binding>>(
                env, cppObj.constant_bindings));
        resObj.Set(
            "settings",
            cbpp_to_js<
                couchbase::core::management::eventing::function_settings>(
                env, cppObj.settings));
        // internal
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::management::eventing::function_state> {
    static inline couchbase::core::management::eventing::function_state
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::eventing::function_state cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<couchbase::core::management::eventing::function_status>(
            cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::uint64_t>(cppObj.num_bootstrapping_nodes,
                                  jsObj.Get("num_bootstrapping_nodes"));
        js_to_cbpp<std::uint64_t>(cppObj.num_deployed_nodes,
                                  jsObj.Get("num_deployed_nodes"));
        js_to_cbpp<
            couchbase::core::management::eventing::function_deployment_status>(
            cppObj.deployment_status, jsObj.Get("deployment_status"));
        js_to_cbpp<
            couchbase::core::management::eventing::function_processing_status>(
            cppObj.processing_status, jsObj.Get("processing_status"));
        js_to_cbpp<std::optional<bool>>(cppObj.redeploy_required,
                                        jsObj.Get("redeploy_required"));
        // internal
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::eventing::function_state &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set(
            "status",
            cbpp_to_js<couchbase::core::management::eventing::function_status>(
                env, cppObj.status));
        resObj.Set(
            "num_bootstrapping_nodes",
            cbpp_to_js<std::uint64_t>(env, cppObj.num_bootstrapping_nodes));
        resObj.Set("num_deployed_nodes",
                   cbpp_to_js<std::uint64_t>(env, cppObj.num_deployed_nodes));
        resObj.Set("deployment_status",
                   cbpp_to_js<couchbase::core::management::eventing::
                                  function_deployment_status>(
                       env, cppObj.deployment_status));
        resObj.Set("processing_status",
                   cbpp_to_js<couchbase::core::management::eventing::
                                  function_processing_status>(
                       env, cppObj.processing_status));
        resObj.Set("redeploy_required", cbpp_to_js<std::optional<bool>>(
                                            env, cppObj.redeploy_required));
        // internal
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::management::eventing::status> {
    static inline couchbase::core::management::eventing::status
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::eventing::status cppObj;
        js_to_cbpp<std::uint64_t>(cppObj.num_eventing_nodes,
                                  jsObj.Get("num_eventing_nodes"));
        js_to_cbpp<
            std::vector<couchbase::core::management::eventing::function_state>>(
            cppObj.functions, jsObj.Get("functions"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::eventing::status &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("num_eventing_nodes",
                   cbpp_to_js<std::uint64_t>(env, cppObj.num_eventing_nodes));
        resObj.Set("functions",
                   cbpp_to_js<std::vector<
                       couchbase::core::management::eventing::function_state>>(
                       env, cppObj.functions));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::management::rbac::role> {
    static inline couchbase::core::management::rbac::role
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::rbac::role cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket,
                                               jsObj.Get("bucket"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope,
                                               jsObj.Get("scope"));
        js_to_cbpp<std::optional<std::string>>(cppObj.collection,
                                               jsObj.Get("collection"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::management::rbac::role &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("bucket",
                   cbpp_to_js<std::optional<std::string>>(env, cppObj.bucket));
        resObj.Set("scope",
                   cbpp_to_js<std::optional<std::string>>(env, cppObj.scope));
        resObj.Set("collection", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.collection));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::management::rbac::role_and_description> {
    static inline couchbase::core::management::rbac::role_and_description
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::rbac::role_and_description cppObj;
        js_to_cbpp<std::string>(cppObj.display_name, jsObj.Get("display_name"));
        js_to_cbpp<std::string>(cppObj.description, jsObj.Get("description"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::rbac::role_and_description &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("display_name",
                   cbpp_to_js<std::string>(env, cppObj.display_name));
        resObj.Set("description",
                   cbpp_to_js<std::string>(env, cppObj.description));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::management::rbac::origin> {
    static inline couchbase::core::management::rbac::origin
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::rbac::origin cppObj;
        js_to_cbpp<std::string>(cppObj.type, jsObj.Get("type"));
        js_to_cbpp<std::optional<std::string>>(cppObj.name, jsObj.Get("name"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::rbac::origin &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("type", cbpp_to_js<std::string>(env, cppObj.type));
        resObj.Set("name",
                   cbpp_to_js<std::optional<std::string>>(env, cppObj.name));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::management::rbac::role_and_origins> {
    static inline couchbase::core::management::rbac::role_and_origins
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::rbac::role_and_origins cppObj;
        js_to_cbpp<std::vector<couchbase::core::management::rbac::origin>>(
            cppObj.origins, jsObj.Get("origins"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::rbac::role_and_origins &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set(
            "origins",
            cbpp_to_js<std::vector<couchbase::core::management::rbac::origin>>(
                env, cppObj.origins));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::management::rbac::user> {
    static inline couchbase::core::management::rbac::user
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::rbac::user cppObj;
        js_to_cbpp<std::string>(cppObj.username, jsObj.Get("username"));
        js_to_cbpp<std::optional<std::string>>(cppObj.display_name,
                                               jsObj.Get("display_name"));
        js_to_cbpp<std::set<std::string>>(cppObj.groups, jsObj.Get("groups"));
        js_to_cbpp<std::vector<couchbase::core::management::rbac::role>>(
            cppObj.roles, jsObj.Get("roles"));
        js_to_cbpp<std::optional<std::string>>(cppObj.password,
                                               jsObj.Get("password"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::management::rbac::user &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("username", cbpp_to_js<std::string>(env, cppObj.username));
        resObj.Set("display_name", cbpp_to_js<std::optional<std::string>>(
                                       env, cppObj.display_name));
        resObj.Set("groups",
                   cbpp_to_js<std::set<std::string>>(env, cppObj.groups));
        resObj.Set(
            "roles",
            cbpp_to_js<std::vector<couchbase::core::management::rbac::role>>(
                env, cppObj.roles));
        resObj.Set("password", cbpp_to_js<std::optional<std::string>>(
                                   env, cppObj.password));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::management::rbac::user_and_metadata> {
    static inline couchbase::core::management::rbac::user_and_metadata
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::rbac::user_and_metadata cppObj;
        js_to_cbpp<couchbase::core::management::rbac::auth_domain>(
            cppObj.domain, jsObj.Get("domain"));
        js_to_cbpp<
            std::vector<couchbase::core::management::rbac::role_and_origins>>(
            cppObj.effective_roles, jsObj.Get("effective_roles"));
        js_to_cbpp<std::optional<std::string>>(cppObj.password_changed,
                                               jsObj.Get("password_changed"));
        js_to_cbpp<std::set<std::string>>(cppObj.external_groups,
                                          jsObj.Get("external_groups"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::rbac::user_and_metadata &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("domain",
                   cbpp_to_js<couchbase::core::management::rbac::auth_domain>(
                       env, cppObj.domain));
        resObj.Set("effective_roles",
                   cbpp_to_js<std::vector<
                       couchbase::core::management::rbac::role_and_origins>>(
                       env, cppObj.effective_roles));
        resObj.Set("password_changed", cbpp_to_js<std::optional<std::string>>(
                                           env, cppObj.password_changed));
        resObj.Set("external_groups", cbpp_to_js<std::set<std::string>>(
                                          env, cppObj.external_groups));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::management::rbac::group> {
    static inline couchbase::core::management::rbac::group
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::rbac::group cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.description,
                                               jsObj.Get("description"));
        js_to_cbpp<std::vector<couchbase::core::management::rbac::role>>(
            cppObj.roles, jsObj.Get("roles"));
        js_to_cbpp<std::optional<std::string>>(
            cppObj.ldap_group_reference, jsObj.Get("ldap_group_reference"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::management::rbac::group &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("description", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.description));
        resObj.Set(
            "roles",
            cbpp_to_js<std::vector<couchbase::core::management::rbac::role>>(
                env, cppObj.roles));
        resObj.Set("ldap_group_reference",
                   cbpp_to_js<std::optional<std::string>>(
                       env, cppObj.ldap_group_reference));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::management::search::index> {
    static inline couchbase::core::management::search::index
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::management::search::index cppObj;
        js_to_cbpp<std::string>(cppObj.uuid, jsObj.Get("uuid"));
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::string>(cppObj.type, jsObj.Get("type"));
        js_to_cbpp<std::string>(cppObj.params_json, jsObj.Get("params_json"));
        js_to_cbpp<std::string>(cppObj.source_uuid, jsObj.Get("source_uuid"));
        js_to_cbpp<std::string>(cppObj.source_name, jsObj.Get("source_name"));
        js_to_cbpp<std::string>(cppObj.source_type, jsObj.Get("source_type"));
        js_to_cbpp<std::string>(cppObj.source_params_json,
                                jsObj.Get("source_params_json"));
        js_to_cbpp<std::string>(cppObj.plan_params_json,
                                jsObj.Get("plan_params_json"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::management::search::index &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("uuid", cbpp_to_js<std::string>(env, cppObj.uuid));
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("type", cbpp_to_js<std::string>(env, cppObj.type));
        resObj.Set("params_json",
                   cbpp_to_js<std::string>(env, cppObj.params_json));
        resObj.Set("source_uuid",
                   cbpp_to_js<std::string>(env, cppObj.source_uuid));
        resObj.Set("source_name",
                   cbpp_to_js<std::string>(env, cppObj.source_name));
        resObj.Set("source_type",
                   cbpp_to_js<std::string>(env, cppObj.source_type));
        resObj.Set("source_params_json",
                   cbpp_to_js<std::string>(env, cppObj.source_params_json));
        resObj.Set("plan_params_json",
                   cbpp_to_js<std::string>(env, cppObj.plan_params_json));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::management::query_index> {
    static inline couchbase::management::query_index from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::management::query_index cppObj;
        js_to_cbpp<bool>(cppObj.is_primary, jsObj.Get("is_primary"));
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::string>(cppObj.state, jsObj.Get("state"));
        js_to_cbpp<std::string>(cppObj.type, jsObj.Get("type"));
        js_to_cbpp<std::vector<std::string>>(cppObj.index_key,
                                             jsObj.Get("index_key"));
        js_to_cbpp<std::optional<std::string>>(cppObj.partition,
                                               jsObj.Get("partition"));
        js_to_cbpp<std::optional<std::string>>(cppObj.condition,
                                               jsObj.Get("condition"));
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.collection_name,
                                               jsObj.Get("collection_name"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::management::query_index &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("is_primary", cbpp_to_js<bool>(env, cppObj.is_primary));
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("state", cbpp_to_js<std::string>(env, cppObj.state));
        resObj.Set("type", cbpp_to_js<std::string>(env, cppObj.type));
        resObj.Set("index_key",
                   cbpp_to_js<std::vector<std::string>>(env, cppObj.index_key));
        resObj.Set("partition", cbpp_to_js<std::optional<std::string>>(
                                    env, cppObj.partition));
        resObj.Set("condition", cbpp_to_js<std::optional<std::string>>(
                                    env, cppObj.condition));
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("collection_name", cbpp_to_js<std::optional<std::string>>(
                                          env, cppObj.collection_name));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::topology::collections_manifest> {
    static inline couchbase::core::topology::collections_manifest
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::topology::collections_manifest cppObj;
        js_to_cbpp<std::array<std::uint8_t, 16>>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::uint64_t>(cppObj.uid, jsObj.Get("uid"));
        js_to_cbpp<std::vector<
            couchbase::core::topology::collections_manifest::scope>>(
            cppObj.scopes, jsObj.Get("scopes"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::topology::collections_manifest &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<std::array<std::uint8_t, 16>>(env, cppObj.id));
        resObj.Set("uid", cbpp_to_js<std::uint64_t>(env, cppObj.uid));
        resObj.Set("scopes",
                   cbpp_to_js<std::vector<
                       couchbase::core::topology::collections_manifest::scope>>(
                       env, cppObj.scopes));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::topology::collections_manifest::collection> {
    static inline couchbase::core::topology::collections_manifest::collection
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::topology::collections_manifest::collection cppObj;
        js_to_cbpp<std::uint64_t>(cppObj.uid, jsObj.Get("uid"));
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::int32_t>(cppObj.max_expiry, jsObj.Get("max_expiry"));
        js_to_cbpp<std::optional<bool>>(cppObj.history, jsObj.Get("history"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::topology::collections_manifest::collection
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("uid", cbpp_to_js<std::uint64_t>(env, cppObj.uid));
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("max_expiry",
                   cbpp_to_js<std::int32_t>(env, cppObj.max_expiry));
        resObj.Set("history",
                   cbpp_to_js<std::optional<bool>>(env, cppObj.history));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::topology::collections_manifest::scope> {
    static inline couchbase::core::topology::collections_manifest::scope
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::topology::collections_manifest::scope cppObj;
        js_to_cbpp<std::uint64_t>(cppObj.uid, jsObj.Get("uid"));
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::vector<
            couchbase::core::topology::collections_manifest::collection>>(
            cppObj.collections, jsObj.Get("collections"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::topology::collections_manifest::scope &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("uid", cbpp_to_js<std::uint64_t>(env, cppObj.uid));
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set(
            "collections",
            cbpp_to_js<std::vector<
                couchbase::core::topology::collections_manifest::collection>>(
                env, cppObj.collections));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::diag::endpoint_diag_info> {
    static inline couchbase::core::diag::endpoint_diag_info
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::diag::endpoint_diag_info cppObj;
        js_to_cbpp<couchbase::core::service_type>(cppObj.type,
                                                  jsObj.Get("type"));
        js_to_cbpp<std::string>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::optional<std::chrono::microseconds>>(
            cppObj.last_activity, jsObj.Get("last_activity"));
        js_to_cbpp<std::string>(cppObj.remote, jsObj.Get("remote"));
        js_to_cbpp<std::string>(cppObj.local, jsObj.Get("local"));
        js_to_cbpp<couchbase::core::diag::endpoint_state>(cppObj.state,
                                                          jsObj.Get("state"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket,
                                               jsObj.Get("bucket"));
        js_to_cbpp<std::optional<std::string>>(cppObj.details,
                                               jsObj.Get("details"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::diag::endpoint_diag_info &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("type",
                   cbpp_to_js<couchbase::core::service_type>(env, cppObj.type));
        resObj.Set("id", cbpp_to_js<std::string>(env, cppObj.id));
        resObj.Set("last_activity",
                   cbpp_to_js<std::optional<std::chrono::microseconds>>(
                       env, cppObj.last_activity));
        resObj.Set("remote", cbpp_to_js<std::string>(env, cppObj.remote));
        resObj.Set("local", cbpp_to_js<std::string>(env, cppObj.local));
        resObj.Set("state", cbpp_to_js<couchbase::core::diag::endpoint_state>(
                                env, cppObj.state));
        resObj.Set("bucket",
                   cbpp_to_js<std::optional<std::string>>(env, cppObj.bucket));
        resObj.Set("details",
                   cbpp_to_js<std::optional<std::string>>(env, cppObj.details));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::diag::diagnostics_result> {
    static inline couchbase::core::diag::diagnostics_result
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::diag::diagnostics_result cppObj;
        js_to_cbpp<std::string>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::string>(cppObj.sdk, jsObj.Get("sdk"));
        js_to_cbpp<
            std::map<couchbase::core::service_type,
                     std::vector<couchbase::core::diag::endpoint_diag_info>>>(
            cppObj.services, jsObj.Get("services"));
        js_to_cbpp<std::int32_t>(cppObj.version, jsObj.Get("version"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::diag::diagnostics_result &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id", cbpp_to_js<std::string>(env, cppObj.id));
        resObj.Set("sdk", cbpp_to_js<std::string>(env, cppObj.sdk));
        resObj.Set("services",
                   cbpp_to_js<std::map<
                       couchbase::core::service_type,
                       std::vector<couchbase::core::diag::endpoint_diag_info>>>(
                       env, cppObj.services));
        resObj.Set("version", cbpp_to_js<std::int32_t>(env, cppObj.version));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::diag::endpoint_ping_info> {
    static inline couchbase::core::diag::endpoint_ping_info
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::diag::endpoint_ping_info cppObj;
        js_to_cbpp<couchbase::core::service_type>(cppObj.type,
                                                  jsObj.Get("type"));
        js_to_cbpp<std::string>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::chrono::microseconds>(cppObj.latency,
                                              jsObj.Get("latency"));
        js_to_cbpp<std::string>(cppObj.remote, jsObj.Get("remote"));
        js_to_cbpp<std::string>(cppObj.local, jsObj.Get("local"));
        js_to_cbpp<couchbase::core::diag::ping_state>(cppObj.state,
                                                      jsObj.Get("state"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket,
                                               jsObj.Get("bucket"));
        js_to_cbpp<std::optional<std::string>>(cppObj.error,
                                               jsObj.Get("error"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::diag::endpoint_ping_info &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("type",
                   cbpp_to_js<couchbase::core::service_type>(env, cppObj.type));
        resObj.Set("id", cbpp_to_js<std::string>(env, cppObj.id));
        resObj.Set("latency",
                   cbpp_to_js<std::chrono::microseconds>(env, cppObj.latency));
        resObj.Set("remote", cbpp_to_js<std::string>(env, cppObj.remote));
        resObj.Set("local", cbpp_to_js<std::string>(env, cppObj.local));
        resObj.Set("state", cbpp_to_js<couchbase::core::diag::ping_state>(
                                env, cppObj.state));
        resObj.Set("bucket",
                   cbpp_to_js<std::optional<std::string>>(env, cppObj.bucket));
        resObj.Set("error",
                   cbpp_to_js<std::optional<std::string>>(env, cppObj.error));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::diag::ping_result> {
    static inline couchbase::core::diag::ping_result from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::diag::ping_result cppObj;
        js_to_cbpp<std::string>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::string>(cppObj.sdk, jsObj.Get("sdk"));
        js_to_cbpp<
            std::map<couchbase::core::service_type,
                     std::vector<couchbase::core::diag::endpoint_ping_info>>>(
            cppObj.services, jsObj.Get("services"));
        js_to_cbpp<std::int32_t>(cppObj.version, jsObj.Get("version"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::diag::ping_result &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id", cbpp_to_js<std::string>(env, cppObj.id));
        resObj.Set("sdk", cbpp_to_js<std::string>(env, cppObj.sdk));
        resObj.Set("services",
                   cbpp_to_js<std::map<
                       couchbase::core::service_type,
                       std::vector<couchbase::core::diag::endpoint_ping_info>>>(
                       env, cppObj.services));
        resObj.Set("version", cbpp_to_js<std::int32_t>(env, cppObj.version));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::prepend_response> {
    static inline couchbase::core::operations::prepend_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::prepend_response cppObj;
        // ctx
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<couchbase::mutation_token>(cppObj.token, jsObj.Get("token"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::prepend_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("token",
                   cbpp_to_js<couchbase::mutation_token>(env, cppObj.token));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::prepend_request> {
    static inline couchbase::core::operations::prepend_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::prepend_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<couchbase::durability_level>(cppObj.durability_level,
                                                jsObj.Get("durability_level"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::prepend_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("durability_level", cbpp_to_js<couchbase::durability_level>(
                                           env, cppObj.durability_level));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::prepend_request_with_legacy_durability> {
    static inline couchbase::core::operations::
        prepend_request_with_legacy_durability
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::prepend_request_with_legacy_durability
            cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        js_to_cbpp<couchbase::persist_to>(cppObj.persist_to,
                                          jsObj.Get("persist_to"));
        js_to_cbpp<couchbase::replicate_to>(cppObj.replicate_to,
                                            jsObj.Get("replicate_to"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::
                             prepend_request_with_legacy_durability &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        resObj.Set("persist_to",
                   cbpp_to_js<couchbase::persist_to>(env, cppObj.persist_to));
        resObj.Set("replicate_to", cbpp_to_js<couchbase::replicate_to>(
                                       env, cppObj.replicate_to));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::exists_response> {
    static inline couchbase::core::operations::exists_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::exists_response cppObj;
        // ctx
        js_to_cbpp<bool>(cppObj.deleted, jsObj.Get("deleted"));
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<std::uint32_t>(cppObj.flags, jsObj.Get("flags"));
        js_to_cbpp<std::uint32_t>(cppObj.expiry, jsObj.Get("expiry"));
        js_to_cbpp<std::uint64_t>(cppObj.sequence_number,
                                  jsObj.Get("sequence_number"));
        js_to_cbpp<std::uint8_t>(cppObj.datatype, jsObj.Get("datatype"));
        js_to_cbpp<bool>(cppObj.document_exists, jsObj.Get("document_exists"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::exists_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("deleted", cbpp_to_js<bool>(env, cppObj.deleted));
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("flags", cbpp_to_js<std::uint32_t>(env, cppObj.flags));
        resObj.Set("expiry", cbpp_to_js<std::uint32_t>(env, cppObj.expiry));
        resObj.Set("sequence_number",
                   cbpp_to_js<std::uint64_t>(env, cppObj.sequence_number));
        resObj.Set("datatype", cbpp_to_js<std::uint8_t>(env, cppObj.datatype));
        resObj.Set("document_exists",
                   cbpp_to_js<bool>(env, cppObj.document_exists));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::exists_request> {
    static inline couchbase::core::operations::exists_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::exists_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::exists_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::http_noop_response> {
    static inline couchbase::core::operations::http_noop_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::http_noop_response cppObj;
        // ctx
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::http_noop_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::http_noop_request> {
    static inline couchbase::core::operations::http_noop_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::http_noop_request cppObj;
        js_to_cbpp<couchbase::core::service_type>(cppObj.type,
                                                  jsObj.Get("type"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::http_noop_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("type",
                   cbpp_to_js<couchbase::core::service_type>(env, cppObj.type));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::unlock_response> {
    static inline couchbase::core::operations::unlock_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::unlock_response cppObj;
        // ctx
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::unlock_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::unlock_request> {
    static inline couchbase::core::operations::unlock_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::unlock_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::unlock_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::get_all_replicas_response> {
    static inline couchbase::core::operations::get_all_replicas_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::get_all_replicas_response cppObj;
        // ctx
        js_to_cbpp<std::vector<
            couchbase::core::operations::get_all_replicas_response::entry>>(
            cppObj.entries, jsObj.Get("entries"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::get_all_replicas_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set(
            "entries",
            cbpp_to_js<std::vector<
                couchbase::core::operations::get_all_replicas_response::entry>>(
                env, cppObj.entries));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::get_all_replicas_response::entry> {
    static inline couchbase::core::operations::get_all_replicas_response::entry
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::get_all_replicas_response::entry cppObj;
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<std::uint32_t>(cppObj.flags, jsObj.Get("flags"));
        js_to_cbpp<bool>(cppObj.replica, jsObj.Get("replica"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::get_all_replicas_response::entry
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("flags", cbpp_to_js<std::uint32_t>(env, cppObj.flags));
        resObj.Set("replica", cbpp_to_js<bool>(env, cppObj.replica));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::get_all_replicas_request> {
    static inline couchbase::core::operations::get_all_replicas_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::get_all_replicas_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // read_preference
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::get_all_replicas_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // read_preference
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::upsert_response> {
    static inline couchbase::core::operations::upsert_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::upsert_response cppObj;
        // ctx
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<couchbase::mutation_token>(cppObj.token, jsObj.Get("token"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::upsert_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("token",
                   cbpp_to_js<couchbase::mutation_token>(env, cppObj.token));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::upsert_request> {
    static inline couchbase::core::operations::upsert_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::upsert_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<std::uint32_t>(cppObj.flags, jsObj.Get("flags"));
        js_to_cbpp<std::uint32_t>(cppObj.expiry, jsObj.Get("expiry"));
        js_to_cbpp<couchbase::durability_level>(cppObj.durability_level,
                                                jsObj.Get("durability_level"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        js_to_cbpp<bool>(cppObj.preserve_expiry, jsObj.Get("preserve_expiry"));
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::upsert_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("flags", cbpp_to_js<std::uint32_t>(env, cppObj.flags));
        resObj.Set("expiry", cbpp_to_js<std::uint32_t>(env, cppObj.expiry));
        resObj.Set("durability_level", cbpp_to_js<couchbase::durability_level>(
                                           env, cppObj.durability_level));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        resObj.Set("preserve_expiry",
                   cbpp_to_js<bool>(env, cppObj.preserve_expiry));
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::upsert_request_with_legacy_durability> {
    static inline couchbase::core::operations::
        upsert_request_with_legacy_durability
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::upsert_request_with_legacy_durability
            cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<std::uint32_t>(cppObj.flags, jsObj.Get("flags"));
        js_to_cbpp<std::uint32_t>(cppObj.expiry, jsObj.Get("expiry"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        js_to_cbpp<bool>(cppObj.preserve_expiry, jsObj.Get("preserve_expiry"));
        // parent_span
        js_to_cbpp<couchbase::persist_to>(cppObj.persist_to,
                                          jsObj.Get("persist_to"));
        js_to_cbpp<couchbase::replicate_to>(cppObj.replicate_to,
                                            jsObj.Get("replicate_to"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::upsert_request_with_legacy_durability
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("flags", cbpp_to_js<std::uint32_t>(env, cppObj.flags));
        resObj.Set("expiry", cbpp_to_js<std::uint32_t>(env, cppObj.expiry));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        resObj.Set("preserve_expiry",
                   cbpp_to_js<bool>(env, cppObj.preserve_expiry));
        // parent_span
        resObj.Set("persist_to",
                   cbpp_to_js<couchbase::persist_to>(env, cppObj.persist_to));
        resObj.Set("replicate_to", cbpp_to_js<couchbase::replicate_to>(
                                       env, cppObj.replicate_to));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::get_any_replica_response> {
    static inline couchbase::core::operations::get_any_replica_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::get_any_replica_response cppObj;
        // ctx
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<std::uint32_t>(cppObj.flags, jsObj.Get("flags"));
        js_to_cbpp<bool>(cppObj.replica, jsObj.Get("replica"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::get_any_replica_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("flags", cbpp_to_js<std::uint32_t>(env, cppObj.flags));
        resObj.Set("replica", cbpp_to_js<bool>(env, cppObj.replica));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::get_any_replica_request> {
    static inline couchbase::core::operations::get_any_replica_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::get_any_replica_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // read_preference
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::get_any_replica_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // read_preference
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::append_response> {
    static inline couchbase::core::operations::append_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::append_response cppObj;
        // ctx
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<couchbase::mutation_token>(cppObj.token, jsObj.Get("token"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::append_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("token",
                   cbpp_to_js<couchbase::mutation_token>(env, cppObj.token));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::append_request> {
    static inline couchbase::core::operations::append_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::append_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<couchbase::durability_level>(cppObj.durability_level,
                                                jsObj.Get("durability_level"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::append_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("durability_level", cbpp_to_js<couchbase::durability_level>(
                                           env, cppObj.durability_level));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::append_request_with_legacy_durability> {
    static inline couchbase::core::operations::
        append_request_with_legacy_durability
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::append_request_with_legacy_durability
            cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        js_to_cbpp<couchbase::persist_to>(cppObj.persist_to,
                                          jsObj.Get("persist_to"));
        js_to_cbpp<couchbase::replicate_to>(cppObj.replicate_to,
                                            jsObj.Get("replicate_to"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::append_request_with_legacy_durability
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        resObj.Set("persist_to",
                   cbpp_to_js<couchbase::persist_to>(env, cppObj.persist_to));
        resObj.Set("replicate_to", cbpp_to_js<couchbase::replicate_to>(
                                       env, cppObj.replicate_to));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::query_response> {
    static inline couchbase::core::operations::query_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::query_response cppObj;
        // ctx
        js_to_cbpp<
            couchbase::core::operations::query_response::query_meta_data>(
            cppObj.meta, jsObj.Get("meta"));
        js_to_cbpp<std::optional<std::string>>(cppObj.prepared,
                                               jsObj.Get("prepared"));
        js_to_cbpp<std::vector<std::string>>(cppObj.rows, jsObj.Get("rows"));
        js_to_cbpp<std::string>(cppObj.served_by_node,
                                jsObj.Get("served_by_node"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::query_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set(
            "meta",
            cbpp_to_js<
                couchbase::core::operations::query_response::query_meta_data>(
                env, cppObj.meta));
        resObj.Set("prepared", cbpp_to_js<std::optional<std::string>>(
                                   env, cppObj.prepared));
        resObj.Set("rows",
                   cbpp_to_js<std::vector<std::string>>(env, cppObj.rows));
        resObj.Set("served_by_node",
                   cbpp_to_js<std::string>(env, cppObj.served_by_node));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::query_response::query_metrics> {
    static inline couchbase::core::operations::query_response::query_metrics
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::query_response::query_metrics cppObj;
        js_to_cbpp<std::chrono::nanoseconds>(cppObj.elapsed_time,
                                             jsObj.Get("elapsed_time"));
        js_to_cbpp<std::chrono::nanoseconds>(cppObj.execution_time,
                                             jsObj.Get("execution_time"));
        js_to_cbpp<std::uint64_t>(cppObj.result_count,
                                  jsObj.Get("result_count"));
        js_to_cbpp<std::uint64_t>(cppObj.result_size, jsObj.Get("result_size"));
        js_to_cbpp<std::uint64_t>(cppObj.sort_count, jsObj.Get("sort_count"));
        js_to_cbpp<std::uint64_t>(cppObj.mutation_count,
                                  jsObj.Get("mutation_count"));
        js_to_cbpp<std::uint64_t>(cppObj.error_count, jsObj.Get("error_count"));
        js_to_cbpp<std::uint64_t>(cppObj.warning_count,
                                  jsObj.Get("warning_count"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::query_response::query_metrics
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("elapsed_time", cbpp_to_js<std::chrono::nanoseconds>(
                                       env, cppObj.elapsed_time));
        resObj.Set("execution_time", cbpp_to_js<std::chrono::nanoseconds>(
                                         env, cppObj.execution_time));
        resObj.Set("result_count",
                   cbpp_to_js<std::uint64_t>(env, cppObj.result_count));
        resObj.Set("result_size",
                   cbpp_to_js<std::uint64_t>(env, cppObj.result_size));
        resObj.Set("sort_count",
                   cbpp_to_js<std::uint64_t>(env, cppObj.sort_count));
        resObj.Set("mutation_count",
                   cbpp_to_js<std::uint64_t>(env, cppObj.mutation_count));
        resObj.Set("error_count",
                   cbpp_to_js<std::uint64_t>(env, cppObj.error_count));
        resObj.Set("warning_count",
                   cbpp_to_js<std::uint64_t>(env, cppObj.warning_count));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::query_response::query_problem> {
    static inline couchbase::core::operations::query_response::query_problem
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::query_response::query_problem cppObj;
        js_to_cbpp<std::uint64_t>(cppObj.code, jsObj.Get("code"));
        js_to_cbpp<std::string>(cppObj.message, jsObj.Get("message"));
        js_to_cbpp<std::optional<std::uint64_t>>(cppObj.reason,
                                                 jsObj.Get("reason"));
        js_to_cbpp<std::optional<bool>>(cppObj.retry, jsObj.Get("retry"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::query_response::query_problem
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("code", cbpp_to_js<std::uint64_t>(env, cppObj.code));
        resObj.Set("message", cbpp_to_js<std::string>(env, cppObj.message));
        resObj.Set("reason", cbpp_to_js<std::optional<std::uint64_t>>(
                                 env, cppObj.reason));
        resObj.Set("retry", cbpp_to_js<std::optional<bool>>(env, cppObj.retry));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::query_response::query_meta_data> {
    static inline couchbase::core::operations::query_response::query_meta_data
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::query_response::query_meta_data cppObj;
        js_to_cbpp<std::string>(cppObj.request_id, jsObj.Get("request_id"));
        js_to_cbpp<std::string>(cppObj.client_context_id,
                                jsObj.Get("client_context_id"));
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::optional<
            couchbase::core::operations::query_response::query_metrics>>(
            cppObj.metrics, jsObj.Get("metrics"));
        js_to_cbpp<std::optional<std::string>>(cppObj.signature,
                                               jsObj.Get("signature"));
        js_to_cbpp<std::optional<std::string>>(cppObj.profile,
                                               jsObj.Get("profile"));
        js_to_cbpp<std::optional<std::vector<
            couchbase::core::operations::query_response::query_problem>>>(
            cppObj.warnings, jsObj.Get("warnings"));
        js_to_cbpp<std::optional<std::vector<
            couchbase::core::operations::query_response::query_problem>>>(
            cppObj.errors, jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::query_response::query_meta_data
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("request_id",
                   cbpp_to_js<std::string>(env, cppObj.request_id));
        resObj.Set("client_context_id",
                   cbpp_to_js<std::string>(env, cppObj.client_context_id));
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "metrics",
            cbpp_to_js<std::optional<
                couchbase::core::operations::query_response::query_metrics>>(
                env, cppObj.metrics));
        resObj.Set("signature", cbpp_to_js<std::optional<std::string>>(
                                    env, cppObj.signature));
        resObj.Set("profile",
                   cbpp_to_js<std::optional<std::string>>(env, cppObj.profile));
        resObj.Set(
            "warnings",
            cbpp_to_js<std::optional<std::vector<
                couchbase::core::operations::query_response::query_problem>>>(
                env, cppObj.warnings));
        resObj.Set(
            "errors",
            cbpp_to_js<std::optional<std::vector<
                couchbase::core::operations::query_response::query_problem>>>(
                env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::query_request> {
    static inline couchbase::core::operations::query_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::query_request cppObj;
        js_to_cbpp<std::string>(cppObj.statement, jsObj.Get("statement"));
        js_to_cbpp<bool>(cppObj.adhoc, jsObj.Get("adhoc"));
        js_to_cbpp<bool>(cppObj.metrics, jsObj.Get("metrics"));
        js_to_cbpp<bool>(cppObj.readonly, jsObj.Get("readonly"));
        js_to_cbpp<bool>(cppObj.flex_index, jsObj.Get("flex_index"));
        js_to_cbpp<bool>(cppObj.preserve_expiry, jsObj.Get("preserve_expiry"));
        js_to_cbpp<std::optional<bool>>(cppObj.use_replica,
                                        jsObj.Get("use_replica"));
        js_to_cbpp<std::optional<std::uint64_t>>(cppObj.max_parallelism,
                                                 jsObj.Get("max_parallelism"));
        js_to_cbpp<std::optional<std::uint64_t>>(cppObj.scan_cap,
                                                 jsObj.Get("scan_cap"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.scan_wait, jsObj.Get("scan_wait"));
        js_to_cbpp<std::optional<std::uint64_t>>(cppObj.pipeline_batch,
                                                 jsObj.Get("pipeline_batch"));
        js_to_cbpp<std::optional<std::uint64_t>>(cppObj.pipeline_cap,
                                                 jsObj.Get("pipeline_cap"));
        js_to_cbpp<std::optional<couchbase::query_scan_consistency>>(
            cppObj.scan_consistency, jsObj.Get("scan_consistency"));
        js_to_cbpp<std::vector<couchbase::mutation_token>>(
            cppObj.mutation_state, jsObj.Get("mutation_state"));
        js_to_cbpp<std::optional<std::string>>(cppObj.query_context,
                                               jsObj.Get("query_context"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        js_to_cbpp<std::optional<couchbase::query_profile>>(
            cppObj.profile, jsObj.Get("profile"));
        js_to_cbpp<
            std::map<std::string, couchbase::core::json_string, std::less<>>>(
            cppObj.raw, jsObj.Get("raw"));
        js_to_cbpp<std::vector<couchbase::core::json_string>>(
            cppObj.positional_parameters, jsObj.Get("positional_parameters"));
        js_to_cbpp<
            std::map<std::string, couchbase::core::json_string, std::less<>>>(
            cppObj.named_parameters, jsObj.Get("named_parameters"));
        // row_callback
        js_to_cbpp<std::optional<std::string>>(cppObj.send_to_node,
                                               jsObj.Get("send_to_node"));
        // ctx_
        // extract_encoded_plan_
        js_to_cbpp<std::string>(cppObj.body_str, jsObj.Get("body_str"));
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::query_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("statement", cbpp_to_js<std::string>(env, cppObj.statement));
        resObj.Set("adhoc", cbpp_to_js<bool>(env, cppObj.adhoc));
        resObj.Set("metrics", cbpp_to_js<bool>(env, cppObj.metrics));
        resObj.Set("readonly", cbpp_to_js<bool>(env, cppObj.readonly));
        resObj.Set("flex_index", cbpp_to_js<bool>(env, cppObj.flex_index));
        resObj.Set("preserve_expiry",
                   cbpp_to_js<bool>(env, cppObj.preserve_expiry));
        resObj.Set("use_replica",
                   cbpp_to_js<std::optional<bool>>(env, cppObj.use_replica));
        resObj.Set("max_parallelism", cbpp_to_js<std::optional<std::uint64_t>>(
                                          env, cppObj.max_parallelism));
        resObj.Set("scan_cap", cbpp_to_js<std::optional<std::uint64_t>>(
                                   env, cppObj.scan_cap));
        resObj.Set("scan_wait",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.scan_wait));
        resObj.Set("pipeline_batch", cbpp_to_js<std::optional<std::uint64_t>>(
                                         env, cppObj.pipeline_batch));
        resObj.Set("pipeline_cap", cbpp_to_js<std::optional<std::uint64_t>>(
                                       env, cppObj.pipeline_cap));
        resObj.Set("scan_consistency",
                   cbpp_to_js<std::optional<couchbase::query_scan_consistency>>(
                       env, cppObj.scan_consistency));
        resObj.Set("mutation_state",
                   cbpp_to_js<std::vector<couchbase::mutation_token>>(
                       env, cppObj.mutation_state));
        resObj.Set("query_context", cbpp_to_js<std::optional<std::string>>(
                                        env, cppObj.query_context));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        resObj.Set("profile",
                   cbpp_to_js<std::optional<couchbase::query_profile>>(
                       env, cppObj.profile));
        resObj.Set(
            "raw",
            cbpp_to_js<std::map<std::string, couchbase::core::json_string,
                                std::less<>>>(env, cppObj.raw));
        resObj.Set("positional_parameters",
                   cbpp_to_js<std::vector<couchbase::core::json_string>>(
                       env, cppObj.positional_parameters));
        resObj.Set(
            "named_parameters",
            cbpp_to_js<std::map<std::string, couchbase::core::json_string,
                                std::less<>>>(env, cppObj.named_parameters));
        // row_callback
        resObj.Set("send_to_node", cbpp_to_js<std::optional<std::string>>(
                                       env, cppObj.send_to_node));
        // ctx_
        // extract_encoded_plan_
        resObj.Set("body_str", cbpp_to_js<std::string>(env, cppObj.body_str));
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::replace_response> {
    static inline couchbase::core::operations::replace_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::replace_response cppObj;
        // ctx
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<couchbase::mutation_token>(cppObj.token, jsObj.Get("token"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::replace_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("token",
                   cbpp_to_js<couchbase::mutation_token>(env, cppObj.token));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::replace_request> {
    static inline couchbase::core::operations::replace_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::replace_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<std::uint32_t>(cppObj.flags, jsObj.Get("flags"));
        js_to_cbpp<std::uint32_t>(cppObj.expiry, jsObj.Get("expiry"));
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<couchbase::durability_level>(cppObj.durability_level,
                                                jsObj.Get("durability_level"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        js_to_cbpp<bool>(cppObj.preserve_expiry, jsObj.Get("preserve_expiry"));
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::replace_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("flags", cbpp_to_js<std::uint32_t>(env, cppObj.flags));
        resObj.Set("expiry", cbpp_to_js<std::uint32_t>(env, cppObj.expiry));
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("durability_level", cbpp_to_js<couchbase::durability_level>(
                                           env, cppObj.durability_level));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        resObj.Set("preserve_expiry",
                   cbpp_to_js<bool>(env, cppObj.preserve_expiry));
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::replace_request_with_legacy_durability> {
    static inline couchbase::core::operations::
        replace_request_with_legacy_durability
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::replace_request_with_legacy_durability
            cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<std::uint32_t>(cppObj.flags, jsObj.Get("flags"));
        js_to_cbpp<std::uint32_t>(cppObj.expiry, jsObj.Get("expiry"));
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        js_to_cbpp<bool>(cppObj.preserve_expiry, jsObj.Get("preserve_expiry"));
        // parent_span
        js_to_cbpp<couchbase::persist_to>(cppObj.persist_to,
                                          jsObj.Get("persist_to"));
        js_to_cbpp<couchbase::replicate_to>(cppObj.replicate_to,
                                            jsObj.Get("replicate_to"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::
                             replace_request_with_legacy_durability &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("flags", cbpp_to_js<std::uint32_t>(env, cppObj.flags));
        resObj.Set("expiry", cbpp_to_js<std::uint32_t>(env, cppObj.expiry));
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        resObj.Set("preserve_expiry",
                   cbpp_to_js<bool>(env, cppObj.preserve_expiry));
        // parent_span
        resObj.Set("persist_to",
                   cbpp_to_js<couchbase::persist_to>(env, cppObj.persist_to));
        resObj.Set("replicate_to", cbpp_to_js<couchbase::replicate_to>(
                                       env, cppObj.replicate_to));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::get_and_touch_response> {
    static inline couchbase::core::operations::get_and_touch_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::get_and_touch_response cppObj;
        // ctx
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<std::uint32_t>(cppObj.flags, jsObj.Get("flags"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::get_and_touch_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("flags", cbpp_to_js<std::uint32_t>(env, cppObj.flags));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::get_and_touch_request> {
    static inline couchbase::core::operations::get_and_touch_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::get_and_touch_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<std::uint32_t>(cppObj.expiry, jsObj.Get("expiry"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::get_and_touch_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("expiry", cbpp_to_js<std::uint32_t>(env, cppObj.expiry));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::remove_response> {
    static inline couchbase::core::operations::remove_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::remove_response cppObj;
        // ctx
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<couchbase::mutation_token>(cppObj.token, jsObj.Get("token"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::remove_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("token",
                   cbpp_to_js<couchbase::mutation_token>(env, cppObj.token));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::remove_request> {
    static inline couchbase::core::operations::remove_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::remove_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<couchbase::durability_level>(cppObj.durability_level,
                                                jsObj.Get("durability_level"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::remove_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("durability_level", cbpp_to_js<couchbase::durability_level>(
                                           env, cppObj.durability_level));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::remove_request_with_legacy_durability> {
    static inline couchbase::core::operations::
        remove_request_with_legacy_durability
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::remove_request_with_legacy_durability
            cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        js_to_cbpp<couchbase::persist_to>(cppObj.persist_to,
                                          jsObj.Get("persist_to"));
        js_to_cbpp<couchbase::replicate_to>(cppObj.replicate_to,
                                            jsObj.Get("replicate_to"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::remove_request_with_legacy_durability
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        resObj.Set("persist_to",
                   cbpp_to_js<couchbase::persist_to>(env, cppObj.persist_to));
        resObj.Set("replicate_to", cbpp_to_js<couchbase::replicate_to>(
                                       env, cppObj.replicate_to));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::get_response> {
    static inline couchbase::core::operations::get_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::get_response cppObj;
        // ctx
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<std::uint32_t>(cppObj.flags, jsObj.Get("flags"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::get_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("flags", cbpp_to_js<std::uint32_t>(env, cppObj.flags));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::get_request> {
    static inline couchbase::core::operations::get_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::get_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::get_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::lookup_in_all_replicas_response> {
    static inline couchbase::core::operations::lookup_in_all_replicas_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::lookup_in_all_replicas_response cppObj;
        // ctx
        js_to_cbpp<std::vector<couchbase::core::operations::
                                   lookup_in_all_replicas_response::entry>>(
            cppObj.entries, jsObj.Get("entries"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::lookup_in_all_replicas_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set(
            "entries",
            cbpp_to_js<std::vector<couchbase::core::operations::
                                       lookup_in_all_replicas_response::entry>>(
                env, cppObj.entries));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::lookup_in_all_replicas_response::entry> {
    static inline couchbase::core::operations::lookup_in_all_replicas_response::
        entry
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::lookup_in_all_replicas_response::entry
            cppObj;
        js_to_cbpp<std::vector<
            couchbase::core::operations::lookup_in_all_replicas_response::
                entry::lookup_in_entry>>(cppObj.fields, jsObj.Get("fields"));
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<bool>(cppObj.deleted, jsObj.Get("deleted"));
        js_to_cbpp<bool>(cppObj.is_replica, jsObj.Get("is_replica"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::
                             lookup_in_all_replicas_response::entry &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set(
            "fields",
            cbpp_to_js<std::vector<
                couchbase::core::operations::lookup_in_all_replicas_response::
                    entry::lookup_in_entry>>(env, cppObj.fields));
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("deleted", cbpp_to_js<bool>(env, cppObj.deleted));
        resObj.Set("is_replica", cbpp_to_js<bool>(env, cppObj.is_replica));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::lookup_in_all_replicas_response::entry::
        lookup_in_entry> {
    static inline couchbase::core::operations::lookup_in_all_replicas_response::
        entry::lookup_in_entry
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::lookup_in_all_replicas_response::entry::
            lookup_in_entry cppObj;
        js_to_cbpp<std::string>(cppObj.path, jsObj.Get("path"));
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<std::size_t>(cppObj.original_index,
                                jsObj.Get("original_index"));
        js_to_cbpp<bool>(cppObj.exists, jsObj.Get("exists"));
        js_to_cbpp<couchbase::core::protocol::subdoc_opcode>(
            cppObj.opcode, jsObj.Get("opcode"));
        js_to_cbpp<couchbase::core::key_value_status_code>(cppObj.status,
                                                           jsObj.Get("status"));
        js_to_cbpp<std::error_code>(cppObj.ec, jsObj.Get("ec"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::lookup_in_all_replicas_response::
              entry::lookup_in_entry &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("path", cbpp_to_js<std::string>(env, cppObj.path));
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("original_index",
                   cbpp_to_js<std::size_t>(env, cppObj.original_index));
        resObj.Set("exists", cbpp_to_js<bool>(env, cppObj.exists));
        resObj.Set("opcode",
                   cbpp_to_js<couchbase::core::protocol::subdoc_opcode>(
                       env, cppObj.opcode));
        resObj.Set("status", cbpp_to_js<couchbase::core::key_value_status_code>(
                                 env, cppObj.status));
        resObj.Set("ec", cbpp_to_js<std::error_code>(env, cppObj.ec));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::lookup_in_all_replicas_request> {
    static inline couchbase::core::operations::lookup_in_all_replicas_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::lookup_in_all_replicas_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::vector<couchbase::core::impl::subdoc::command>>(
            cppObj.specs, jsObj.Get("specs"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // parent_span
        // read_preference
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::lookup_in_all_replicas_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set(
            "specs",
            cbpp_to_js<std::vector<couchbase::core::impl::subdoc::command>>(
                env, cppObj.specs));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // parent_span
        // read_preference
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::analytics_response> {
    static inline couchbase::core::operations::analytics_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::analytics_response cppObj;
        // ctx
        js_to_cbpp<couchbase::core::operations::analytics_response::
                       analytics_meta_data>(cppObj.meta, jsObj.Get("meta"));
        js_to_cbpp<std::vector<std::string>>(cppObj.rows, jsObj.Get("rows"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::analytics_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("meta",
                   cbpp_to_js<couchbase::core::operations::analytics_response::
                                  analytics_meta_data>(env, cppObj.meta));
        resObj.Set("rows",
                   cbpp_to_js<std::vector<std::string>>(env, cppObj.rows));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::analytics_response::analytics_metrics> {
    static inline couchbase::core::operations::analytics_response::
        analytics_metrics
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::analytics_response::analytics_metrics
            cppObj;
        js_to_cbpp<std::chrono::nanoseconds>(cppObj.elapsed_time,
                                             jsObj.Get("elapsed_time"));
        js_to_cbpp<std::chrono::nanoseconds>(cppObj.execution_time,
                                             jsObj.Get("execution_time"));
        js_to_cbpp<std::uint64_t>(cppObj.result_count,
                                  jsObj.Get("result_count"));
        js_to_cbpp<std::uint64_t>(cppObj.result_size, jsObj.Get("result_size"));
        js_to_cbpp<std::uint64_t>(cppObj.error_count, jsObj.Get("error_count"));
        js_to_cbpp<std::uint64_t>(cppObj.processed_objects,
                                  jsObj.Get("processed_objects"));
        js_to_cbpp<std::uint64_t>(cppObj.warning_count,
                                  jsObj.Get("warning_count"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::analytics_response::analytics_metrics
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("elapsed_time", cbpp_to_js<std::chrono::nanoseconds>(
                                       env, cppObj.elapsed_time));
        resObj.Set("execution_time", cbpp_to_js<std::chrono::nanoseconds>(
                                         env, cppObj.execution_time));
        resObj.Set("result_count",
                   cbpp_to_js<std::uint64_t>(env, cppObj.result_count));
        resObj.Set("result_size",
                   cbpp_to_js<std::uint64_t>(env, cppObj.result_size));
        resObj.Set("error_count",
                   cbpp_to_js<std::uint64_t>(env, cppObj.error_count));
        resObj.Set("processed_objects",
                   cbpp_to_js<std::uint64_t>(env, cppObj.processed_objects));
        resObj.Set("warning_count",
                   cbpp_to_js<std::uint64_t>(env, cppObj.warning_count));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::analytics_response::analytics_problem> {
    static inline couchbase::core::operations::analytics_response::
        analytics_problem
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::analytics_response::analytics_problem
            cppObj;
        js_to_cbpp<std::uint64_t>(cppObj.code, jsObj.Get("code"));
        js_to_cbpp<std::string>(cppObj.message, jsObj.Get("message"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::analytics_response::analytics_problem
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("code", cbpp_to_js<std::uint64_t>(env, cppObj.code));
        resObj.Set("message", cbpp_to_js<std::string>(env, cppObj.message));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::analytics_response::analytics_meta_data> {
    static inline couchbase::core::operations::analytics_response::
        analytics_meta_data
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::analytics_response::analytics_meta_data
            cppObj;
        js_to_cbpp<std::string>(cppObj.request_id, jsObj.Get("request_id"));
        js_to_cbpp<std::string>(cppObj.client_context_id,
                                jsObj.Get("client_context_id"));
        js_to_cbpp<
            couchbase::core::operations::analytics_response::analytics_status>(
            cppObj.status, jsObj.Get("status"));
        js_to_cbpp<
            couchbase::core::operations::analytics_response::analytics_metrics>(
            cppObj.metrics, jsObj.Get("metrics"));
        js_to_cbpp<std::optional<std::string>>(cppObj.signature,
                                               jsObj.Get("signature"));
        js_to_cbpp<std::vector<couchbase::core::operations::analytics_response::
                                   analytics_problem>>(cppObj.errors,
                                                       jsObj.Get("errors"));
        js_to_cbpp<std::vector<couchbase::core::operations::analytics_response::
                                   analytics_problem>>(cppObj.warnings,
                                                       jsObj.Get("warnings"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::analytics_response::
                             analytics_meta_data &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("request_id",
                   cbpp_to_js<std::string>(env, cppObj.request_id));
        resObj.Set("client_context_id",
                   cbpp_to_js<std::string>(env, cppObj.client_context_id));
        resObj.Set("status",
                   cbpp_to_js<couchbase::core::operations::analytics_response::
                                  analytics_status>(env, cppObj.status));
        resObj.Set("metrics",
                   cbpp_to_js<couchbase::core::operations::analytics_response::
                                  analytics_metrics>(env, cppObj.metrics));
        resObj.Set("signature", cbpp_to_js<std::optional<std::string>>(
                                    env, cppObj.signature));
        resObj.Set(
            "errors",
            cbpp_to_js<std::vector<couchbase::core::operations::
                                       analytics_response::analytics_problem>>(
                env, cppObj.errors));
        resObj.Set(
            "warnings",
            cbpp_to_js<std::vector<couchbase::core::operations::
                                       analytics_response::analytics_problem>>(
                env, cppObj.warnings));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::analytics_request> {
    static inline couchbase::core::operations::analytics_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::analytics_request cppObj;
        js_to_cbpp<std::string>(cppObj.statement, jsObj.Get("statement"));
        js_to_cbpp<bool>(cppObj.readonly, jsObj.Get("readonly"));
        js_to_cbpp<bool>(cppObj.priority, jsObj.Get("priority"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_qualifier,
                                               jsObj.Get("scope_qualifier"));
        js_to_cbpp<std::optional<couchbase::core::analytics_scan_consistency>>(
            cppObj.scan_consistency, jsObj.Get("scan_consistency"));
        js_to_cbpp<std::map<std::string, couchbase::core::json_string>>(
            cppObj.raw, jsObj.Get("raw"));
        js_to_cbpp<std::vector<couchbase::core::json_string>>(
            cppObj.positional_parameters, jsObj.Get("positional_parameters"));
        js_to_cbpp<std::map<std::string, couchbase::core::json_string>>(
            cppObj.named_parameters, jsObj.Get("named_parameters"));
        // row_callback
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        js_to_cbpp<std::string>(cppObj.body_str, jsObj.Get("body_str"));
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::analytics_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("statement", cbpp_to_js<std::string>(env, cppObj.statement));
        resObj.Set("readonly", cbpp_to_js<bool>(env, cppObj.readonly));
        resObj.Set("priority", cbpp_to_js<bool>(env, cppObj.priority));
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("scope_qualifier", cbpp_to_js<std::optional<std::string>>(
                                          env, cppObj.scope_qualifier));
        resObj.Set(
            "scan_consistency",
            cbpp_to_js<
                std::optional<couchbase::core::analytics_scan_consistency>>(
                env, cppObj.scan_consistency));
        resObj.Set(
            "raw",
            cbpp_to_js<std::map<std::string, couchbase::core::json_string>>(
                env, cppObj.raw));
        resObj.Set("positional_parameters",
                   cbpp_to_js<std::vector<couchbase::core::json_string>>(
                       env, cppObj.positional_parameters));
        resObj.Set(
            "named_parameters",
            cbpp_to_js<std::map<std::string, couchbase::core::json_string>>(
                env, cppObj.named_parameters));
        // row_callback
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        resObj.Set("body_str", cbpp_to_js<std::string>(env, cppObj.body_str));
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::get_projected_response> {
    static inline couchbase::core::operations::get_projected_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::get_projected_response cppObj;
        // ctx
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<std::uint32_t>(cppObj.flags, jsObj.Get("flags"));
        js_to_cbpp<std::optional<std::uint32_t>>(cppObj.expiry,
                                                 jsObj.Get("expiry"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::get_projected_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("flags", cbpp_to_js<std::uint32_t>(env, cppObj.flags));
        resObj.Set("expiry", cbpp_to_js<std::optional<std::uint32_t>>(
                                 env, cppObj.expiry));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::get_projected_request> {
    static inline couchbase::core::operations::get_projected_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::get_projected_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<std::vector<std::string>>(cppObj.projections,
                                             jsObj.Get("projections"));
        js_to_cbpp<bool>(cppObj.with_expiry, jsObj.Get("with_expiry"));
        js_to_cbpp<std::vector<std::string>>(
            cppObj.effective_projections, jsObj.Get("effective_projections"));
        js_to_cbpp<bool>(cppObj.preserve_array_indexes,
                         jsObj.Get("preserve_array_indexes"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::get_projected_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("projections", cbpp_to_js<std::vector<std::string>>(
                                      env, cppObj.projections));
        resObj.Set("with_expiry", cbpp_to_js<bool>(env, cppObj.with_expiry));
        resObj.Set("effective_projections",
                   cbpp_to_js<std::vector<std::string>>(
                       env, cppObj.effective_projections));
        resObj.Set("preserve_array_indexes",
                   cbpp_to_js<bool>(env, cppObj.preserve_array_indexes));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::decrement_response> {
    static inline couchbase::core::operations::decrement_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::decrement_response cppObj;
        // ctx
        js_to_cbpp<std::uint64_t>(cppObj.content, jsObj.Get("content"));
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<couchbase::mutation_token>(cppObj.token, jsObj.Get("token"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::decrement_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("content", cbpp_to_js<std::uint64_t>(env, cppObj.content));
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("token",
                   cbpp_to_js<couchbase::mutation_token>(env, cppObj.token));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::decrement_request> {
    static inline couchbase::core::operations::decrement_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::decrement_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<std::uint32_t>(cppObj.expiry, jsObj.Get("expiry"));
        js_to_cbpp<std::uint64_t>(cppObj.delta, jsObj.Get("delta"));
        js_to_cbpp<std::optional<std::uint64_t>>(cppObj.initial_value,
                                                 jsObj.Get("initial_value"));
        js_to_cbpp<couchbase::durability_level>(cppObj.durability_level,
                                                jsObj.Get("durability_level"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::decrement_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("expiry", cbpp_to_js<std::uint32_t>(env, cppObj.expiry));
        resObj.Set("delta", cbpp_to_js<std::uint64_t>(env, cppObj.delta));
        resObj.Set("initial_value", cbpp_to_js<std::optional<std::uint64_t>>(
                                        env, cppObj.initial_value));
        resObj.Set("durability_level", cbpp_to_js<couchbase::durability_level>(
                                           env, cppObj.durability_level));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::decrement_request_with_legacy_durability> {
    static inline couchbase::core::operations::
        decrement_request_with_legacy_durability
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::decrement_request_with_legacy_durability
            cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<std::uint32_t>(cppObj.expiry, jsObj.Get("expiry"));
        js_to_cbpp<std::uint64_t>(cppObj.delta, jsObj.Get("delta"));
        js_to_cbpp<std::optional<std::uint64_t>>(cppObj.initial_value,
                                                 jsObj.Get("initial_value"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        js_to_cbpp<couchbase::persist_to>(cppObj.persist_to,
                                          jsObj.Get("persist_to"));
        js_to_cbpp<couchbase::replicate_to>(cppObj.replicate_to,
                                            jsObj.Get("replicate_to"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::
                             decrement_request_with_legacy_durability &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("expiry", cbpp_to_js<std::uint32_t>(env, cppObj.expiry));
        resObj.Set("delta", cbpp_to_js<std::uint64_t>(env, cppObj.delta));
        resObj.Set("initial_value", cbpp_to_js<std::optional<std::uint64_t>>(
                                        env, cppObj.initial_value));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        resObj.Set("persist_to",
                   cbpp_to_js<couchbase::persist_to>(env, cppObj.persist_to));
        resObj.Set("replicate_to", cbpp_to_js<couchbase::replicate_to>(
                                       env, cppObj.replicate_to));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::search_response> {
    static inline couchbase::core::operations::search_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::search_response cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<
            couchbase::core::operations::search_response::search_meta_data>(
            cppObj.meta, jsObj.Get("meta"));
        js_to_cbpp<std::string>(cppObj.error, jsObj.Get("error"));
        js_to_cbpp<std::vector<
            couchbase::core::operations::search_response::search_row>>(
            cppObj.rows, jsObj.Get("rows"));
        js_to_cbpp<std::vector<
            couchbase::core::operations::search_response::search_facet>>(
            cppObj.facets, jsObj.Get("facets"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::search_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "meta",
            cbpp_to_js<
                couchbase::core::operations::search_response::search_meta_data>(
                env, cppObj.meta));
        resObj.Set("error", cbpp_to_js<std::string>(env, cppObj.error));
        resObj.Set(
            "rows",
            cbpp_to_js<std::vector<
                couchbase::core::operations::search_response::search_row>>(
                env, cppObj.rows));
        resObj.Set(
            "facets",
            cbpp_to_js<std::vector<
                couchbase::core::operations::search_response::search_facet>>(
                env, cppObj.facets));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::search_response::search_metrics> {
    static inline couchbase::core::operations::search_response::search_metrics
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::search_response::search_metrics cppObj;
        js_to_cbpp<std::chrono::nanoseconds>(cppObj.took, jsObj.Get("took"));
        js_to_cbpp<std::uint64_t>(cppObj.total_rows, jsObj.Get("total_rows"));
        js_to_cbpp<double>(cppObj.max_score, jsObj.Get("max_score"));
        js_to_cbpp<std::uint64_t>(cppObj.success_partition_count,
                                  jsObj.Get("success_partition_count"));
        js_to_cbpp<std::uint64_t>(cppObj.error_partition_count,
                                  jsObj.Get("error_partition_count"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::search_response::search_metrics
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("took",
                   cbpp_to_js<std::chrono::nanoseconds>(env, cppObj.took));
        resObj.Set("total_rows",
                   cbpp_to_js<std::uint64_t>(env, cppObj.total_rows));
        resObj.Set("max_score", cbpp_to_js<double>(env, cppObj.max_score));
        resObj.Set(
            "success_partition_count",
            cbpp_to_js<std::uint64_t>(env, cppObj.success_partition_count));
        resObj.Set(
            "error_partition_count",
            cbpp_to_js<std::uint64_t>(env, cppObj.error_partition_count));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::search_response::search_meta_data> {
    static inline couchbase::core::operations::search_response::search_meta_data
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::search_response::search_meta_data cppObj;
        js_to_cbpp<std::string>(cppObj.client_context_id,
                                jsObj.Get("client_context_id"));
        js_to_cbpp<
            couchbase::core::operations::search_response::search_metrics>(
            cppObj.metrics, jsObj.Get("metrics"));
        js_to_cbpp<std::map<std::string, std::string>>(cppObj.errors,
                                                       jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::search_response::search_meta_data
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("client_context_id",
                   cbpp_to_js<std::string>(env, cppObj.client_context_id));
        resObj.Set(
            "metrics",
            cbpp_to_js<
                couchbase::core::operations::search_response::search_metrics>(
                env, cppObj.metrics));
        resObj.Set("errors", cbpp_to_js<std::map<std::string, std::string>>(
                                 env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::search_response::search_location> {
    static inline couchbase::core::operations::search_response::search_location
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::search_response::search_location cppObj;
        js_to_cbpp<std::string>(cppObj.field, jsObj.Get("field"));
        js_to_cbpp<std::string>(cppObj.term, jsObj.Get("term"));
        js_to_cbpp<std::uint64_t>(cppObj.position, jsObj.Get("position"));
        js_to_cbpp<std::uint64_t>(cppObj.start_offset,
                                  jsObj.Get("start_offset"));
        js_to_cbpp<std::uint64_t>(cppObj.end_offset, jsObj.Get("end_offset"));
        js_to_cbpp<std::optional<std::vector<std::uint64_t>>>(
            cppObj.array_positions, jsObj.Get("array_positions"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::search_response::search_location
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("field", cbpp_to_js<std::string>(env, cppObj.field));
        resObj.Set("term", cbpp_to_js<std::string>(env, cppObj.term));
        resObj.Set("position", cbpp_to_js<std::uint64_t>(env, cppObj.position));
        resObj.Set("start_offset",
                   cbpp_to_js<std::uint64_t>(env, cppObj.start_offset));
        resObj.Set("end_offset",
                   cbpp_to_js<std::uint64_t>(env, cppObj.end_offset));
        resObj.Set("array_positions",
                   cbpp_to_js<std::optional<std::vector<std::uint64_t>>>(
                       env, cppObj.array_positions));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::search_response::search_row> {
    static inline couchbase::core::operations::search_response::search_row
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::search_response::search_row cppObj;
        js_to_cbpp<std::string>(cppObj.index, jsObj.Get("index"));
        js_to_cbpp<std::string>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<double>(cppObj.score, jsObj.Get("score"));
        js_to_cbpp<std::vector<
            couchbase::core::operations::search_response::search_location>>(
            cppObj.locations, jsObj.Get("locations"));
        js_to_cbpp<std::map<std::string, std::vector<std::string>>>(
            cppObj.fragments, jsObj.Get("fragments"));
        js_to_cbpp<std::string>(cppObj.fields, jsObj.Get("fields"));
        js_to_cbpp<std::string>(cppObj.explanation, jsObj.Get("explanation"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::search_response::search_row &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("index", cbpp_to_js<std::string>(env, cppObj.index));
        resObj.Set("id", cbpp_to_js<std::string>(env, cppObj.id));
        resObj.Set("score", cbpp_to_js<double>(env, cppObj.score));
        resObj.Set(
            "locations",
            cbpp_to_js<std::vector<
                couchbase::core::operations::search_response::search_location>>(
                env, cppObj.locations));
        resObj.Set("fragments",
                   cbpp_to_js<std::map<std::string, std::vector<std::string>>>(
                       env, cppObj.fragments));
        resObj.Set("fields", cbpp_to_js<std::string>(env, cppObj.fields));
        resObj.Set("explanation",
                   cbpp_to_js<std::string>(env, cppObj.explanation));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::search_response::search_facet> {
    static inline couchbase::core::operations::search_response::search_facet
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::search_response::search_facet cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::string>(cppObj.field, jsObj.Get("field"));
        js_to_cbpp<std::uint64_t>(cppObj.total, jsObj.Get("total"));
        js_to_cbpp<std::uint64_t>(cppObj.missing, jsObj.Get("missing"));
        js_to_cbpp<std::uint64_t>(cppObj.other, jsObj.Get("other"));
        js_to_cbpp<std::vector<couchbase::core::operations::search_response::
                                   search_facet::term_facet>>(
            cppObj.terms, jsObj.Get("terms"));
        js_to_cbpp<std::vector<couchbase::core::operations::search_response::
                                   search_facet::date_range_facet>>(
            cppObj.date_ranges, jsObj.Get("date_ranges"));
        js_to_cbpp<std::vector<couchbase::core::operations::search_response::
                                   search_facet::numeric_range_facet>>(
            cppObj.numeric_ranges, jsObj.Get("numeric_ranges"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::search_response::search_facet
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("field", cbpp_to_js<std::string>(env, cppObj.field));
        resObj.Set("total", cbpp_to_js<std::uint64_t>(env, cppObj.total));
        resObj.Set("missing", cbpp_to_js<std::uint64_t>(env, cppObj.missing));
        resObj.Set("other", cbpp_to_js<std::uint64_t>(env, cppObj.other));
        resObj.Set(
            "terms",
            cbpp_to_js<
                std::vector<couchbase::core::operations::search_response::
                                search_facet::term_facet>>(env, cppObj.terms));
        resObj.Set(
            "date_ranges",
            cbpp_to_js<
                std::vector<couchbase::core::operations::search_response::
                                search_facet::date_range_facet>>(
                env, cppObj.date_ranges));
        resObj.Set(
            "numeric_ranges",
            cbpp_to_js<
                std::vector<couchbase::core::operations::search_response::
                                search_facet::numeric_range_facet>>(
                env, cppObj.numeric_ranges));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::search_response::search_facet::term_facet> {
    static inline couchbase::core::operations::search_response::search_facet::
        term_facet
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::search_response::search_facet::term_facet
            cppObj;
        js_to_cbpp<std::string>(cppObj.term, jsObj.Get("term"));
        js_to_cbpp<std::uint64_t>(cppObj.count, jsObj.Get("count"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::search_response::
                             search_facet::term_facet &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("term", cbpp_to_js<std::string>(env, cppObj.term));
        resObj.Set("count", cbpp_to_js<std::uint64_t>(env, cppObj.count));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::search_response::search_facet::
                        date_range_facet> {
    static inline couchbase::core::operations::search_response::search_facet::
        date_range_facet
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::search_response::search_facet::
            date_range_facet cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::uint64_t>(cppObj.count, jsObj.Get("count"));
        js_to_cbpp<std::optional<std::string>>(cppObj.start,
                                               jsObj.Get("start"));
        js_to_cbpp<std::optional<std::string>>(cppObj.end, jsObj.Get("end"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::search_response::
                             search_facet::date_range_facet &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("count", cbpp_to_js<std::uint64_t>(env, cppObj.count));
        resObj.Set("start",
                   cbpp_to_js<std::optional<std::string>>(env, cppObj.start));
        resObj.Set("end",
                   cbpp_to_js<std::optional<std::string>>(env, cppObj.end));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::search_response::search_facet::
                        numeric_range_facet> {
    static inline couchbase::core::operations::search_response::search_facet::
        numeric_range_facet
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::search_response::search_facet::
            numeric_range_facet cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::uint64_t>(cppObj.count, jsObj.Get("count"));
        js_to_cbpp<std::variant<std::monostate, std::uint64_t, double>>(
            cppObj.min, jsObj.Get("min"));
        js_to_cbpp<std::variant<std::monostate, std::uint64_t, double>>(
            cppObj.max, jsObj.Get("max"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::search_response::
                             search_facet::numeric_range_facet &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("count", cbpp_to_js<std::uint64_t>(env, cppObj.count));
        resObj.Set(
            "min",
            cbpp_to_js<std::variant<std::monostate, std::uint64_t, double>>(
                env, cppObj.min));
        resObj.Set(
            "max",
            cbpp_to_js<std::variant<std::monostate, std::uint64_t, double>>(
                env, cppObj.max));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::search_request> {
    static inline couchbase::core::operations::search_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::search_request cppObj;
        js_to_cbpp<std::string>(cppObj.index_name, jsObj.Get("index_name"));
        js_to_cbpp<couchbase::core::json_string>(cppObj.query,
                                                 jsObj.Get("query"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<bool>>(cppObj.show_request,
                                        jsObj.Get("show_request"));
        js_to_cbpp<std::optional<couchbase::core::json_string>>(
            cppObj.vector_search, jsObj.Get("vector_search"));
        js_to_cbpp<std::optional<couchbase::core::vector_query_combination>>(
            cppObj.vector_query_combination,
            jsObj.Get("vector_query_combination"));
        js_to_cbpp<std::optional<std::uint32_t>>(cppObj.limit,
                                                 jsObj.Get("limit"));
        js_to_cbpp<std::optional<std::uint32_t>>(cppObj.skip,
                                                 jsObj.Get("skip"));
        js_to_cbpp<std::optional<bool>>(cppObj.explain, jsObj.Get("explain"));
        js_to_cbpp<bool>(cppObj.disable_scoring, jsObj.Get("disable_scoring"));
        js_to_cbpp<bool>(cppObj.include_locations,
                         jsObj.Get("include_locations"));
        js_to_cbpp<std::optional<couchbase::core::search_highlight_style>>(
            cppObj.highlight_style, jsObj.Get("highlight_style"));
        js_to_cbpp<std::vector<std::string>>(cppObj.highlight_fields,
                                             jsObj.Get("highlight_fields"));
        js_to_cbpp<std::vector<std::string>>(cppObj.fields,
                                             jsObj.Get("fields"));
        js_to_cbpp<std::vector<std::string>>(cppObj.collections,
                                             jsObj.Get("collections"));
        js_to_cbpp<std::optional<couchbase::core::search_scan_consistency>>(
            cppObj.scan_consistency, jsObj.Get("scan_consistency"));
        js_to_cbpp<std::vector<couchbase::mutation_token>>(
            cppObj.mutation_state, jsObj.Get("mutation_state"));
        js_to_cbpp<std::vector<std::string>>(cppObj.sort_specs,
                                             jsObj.Get("sort_specs"));
        js_to_cbpp<std::map<std::string, std::string>>(cppObj.facets,
                                                       jsObj.Get("facets"));
        js_to_cbpp<std::map<std::string, couchbase::core::json_string>>(
            cppObj.raw, jsObj.Get("raw"));
        // row_callback
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        js_to_cbpp<std::optional<bool>>(cppObj.log_request,
                                        jsObj.Get("log_request"));
        js_to_cbpp<std::optional<bool>>(cppObj.log_response,
                                        jsObj.Get("log_response"));
        js_to_cbpp<std::string>(cppObj.body_str, jsObj.Get("body_str"));
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::search_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("index_name",
                   cbpp_to_js<std::string>(env, cppObj.index_name));
        resObj.Set("query",
                   cbpp_to_js<couchbase::core::json_string>(env, cppObj.query));
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("show_request",
                   cbpp_to_js<std::optional<bool>>(env, cppObj.show_request));
        resObj.Set("vector_search",
                   cbpp_to_js<std::optional<couchbase::core::json_string>>(
                       env, cppObj.vector_search));
        resObj.Set(
            "vector_query_combination",
            cbpp_to_js<
                std::optional<couchbase::core::vector_query_combination>>(
                env, cppObj.vector_query_combination));
        resObj.Set("limit",
                   cbpp_to_js<std::optional<std::uint32_t>>(env, cppObj.limit));
        resObj.Set("skip",
                   cbpp_to_js<std::optional<std::uint32_t>>(env, cppObj.skip));
        resObj.Set("explain",
                   cbpp_to_js<std::optional<bool>>(env, cppObj.explain));
        resObj.Set("disable_scoring",
                   cbpp_to_js<bool>(env, cppObj.disable_scoring));
        resObj.Set("include_locations",
                   cbpp_to_js<bool>(env, cppObj.include_locations));
        resObj.Set(
            "highlight_style",
            cbpp_to_js<std::optional<couchbase::core::search_highlight_style>>(
                env, cppObj.highlight_style));
        resObj.Set("highlight_fields", cbpp_to_js<std::vector<std::string>>(
                                           env, cppObj.highlight_fields));
        resObj.Set("fields",
                   cbpp_to_js<std::vector<std::string>>(env, cppObj.fields));
        resObj.Set("collections", cbpp_to_js<std::vector<std::string>>(
                                      env, cppObj.collections));
        resObj.Set(
            "scan_consistency",
            cbpp_to_js<std::optional<couchbase::core::search_scan_consistency>>(
                env, cppObj.scan_consistency));
        resObj.Set("mutation_state",
                   cbpp_to_js<std::vector<couchbase::mutation_token>>(
                       env, cppObj.mutation_state));
        resObj.Set("sort_specs", cbpp_to_js<std::vector<std::string>>(
                                     env, cppObj.sort_specs));
        resObj.Set("facets", cbpp_to_js<std::map<std::string, std::string>>(
                                 env, cppObj.facets));
        resObj.Set(
            "raw",
            cbpp_to_js<std::map<std::string, couchbase::core::json_string>>(
                env, cppObj.raw));
        // row_callback
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        resObj.Set("log_request",
                   cbpp_to_js<std::optional<bool>>(env, cppObj.log_request));
        resObj.Set("log_response",
                   cbpp_to_js<std::optional<bool>>(env, cppObj.log_response));
        resObj.Set("body_str", cbpp_to_js<std::string>(env, cppObj.body_str));
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::touch_response> {
    static inline couchbase::core::operations::touch_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::touch_response cppObj;
        // ctx
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::touch_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::touch_request> {
    static inline couchbase::core::operations::touch_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::touch_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<std::uint32_t>(cppObj.expiry, jsObj.Get("expiry"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::touch_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("expiry", cbpp_to_js<std::uint32_t>(env, cppObj.expiry));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::lookup_in_response> {
    static inline couchbase::core::operations::lookup_in_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::lookup_in_response cppObj;
        // ctx
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<std::vector<
            couchbase::core::operations::lookup_in_response::entry>>(
            cppObj.fields, jsObj.Get("fields"));
        js_to_cbpp<bool>(cppObj.deleted, jsObj.Get("deleted"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::lookup_in_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("fields",
                   cbpp_to_js<std::vector<
                       couchbase::core::operations::lookup_in_response::entry>>(
                       env, cppObj.fields));
        resObj.Set("deleted", cbpp_to_js<bool>(env, cppObj.deleted));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::lookup_in_response::entry> {
    static inline couchbase::core::operations::lookup_in_response::entry
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::lookup_in_response::entry cppObj;
        js_to_cbpp<std::string>(cppObj.path, jsObj.Get("path"));
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<std::size_t>(cppObj.original_index,
                                jsObj.Get("original_index"));
        js_to_cbpp<bool>(cppObj.exists, jsObj.Get("exists"));
        js_to_cbpp<couchbase::core::protocol::subdoc_opcode>(
            cppObj.opcode, jsObj.Get("opcode"));
        js_to_cbpp<couchbase::core::key_value_status_code>(cppObj.status,
                                                           jsObj.Get("status"));
        js_to_cbpp<std::error_code>(cppObj.ec, jsObj.Get("ec"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::lookup_in_response::entry &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("path", cbpp_to_js<std::string>(env, cppObj.path));
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("original_index",
                   cbpp_to_js<std::size_t>(env, cppObj.original_index));
        resObj.Set("exists", cbpp_to_js<bool>(env, cppObj.exists));
        resObj.Set("opcode",
                   cbpp_to_js<couchbase::core::protocol::subdoc_opcode>(
                       env, cppObj.opcode));
        resObj.Set("status", cbpp_to_js<couchbase::core::key_value_status_code>(
                                 env, cppObj.status));
        resObj.Set("ec", cbpp_to_js<std::error_code>(env, cppObj.ec));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::lookup_in_request> {
    static inline couchbase::core::operations::lookup_in_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::lookup_in_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<bool>(cppObj.access_deleted, jsObj.Get("access_deleted"));
        js_to_cbpp<std::vector<couchbase::core::impl::subdoc::command>>(
            cppObj.specs, jsObj.Get("specs"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::lookup_in_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("access_deleted",
                   cbpp_to_js<bool>(env, cppObj.access_deleted));
        resObj.Set(
            "specs",
            cbpp_to_js<std::vector<couchbase::core::impl::subdoc::command>>(
                env, cppObj.specs));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::document_view_response> {
    static inline couchbase::core::operations::document_view_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::document_view_response cppObj;
        // ctx
        js_to_cbpp<
            couchbase::core::operations::document_view_response::meta_data>(
            cppObj.meta, jsObj.Get("meta"));
        js_to_cbpp<std::vector<
            couchbase::core::operations::document_view_response::row>>(
            cppObj.rows, jsObj.Get("rows"));
        js_to_cbpp<std::optional<
            couchbase::core::operations::document_view_response::problem>>(
            cppObj.error, jsObj.Get("error"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::document_view_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set(
            "meta",
            cbpp_to_js<
                couchbase::core::operations::document_view_response::meta_data>(
                env, cppObj.meta));
        resObj.Set(
            "rows",
            cbpp_to_js<std::vector<
                couchbase::core::operations::document_view_response::row>>(
                env, cppObj.rows));
        resObj.Set(
            "error",
            cbpp_to_js<std::optional<
                couchbase::core::operations::document_view_response::problem>>(
                env, cppObj.error));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::document_view_response::meta_data> {
    static inline couchbase::core::operations::document_view_response::meta_data
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::document_view_response::meta_data cppObj;
        js_to_cbpp<std::optional<std::uint64_t>>(cppObj.total_rows,
                                                 jsObj.Get("total_rows"));
        js_to_cbpp<std::optional<std::string>>(cppObj.debug_info,
                                               jsObj.Get("debug_info"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::document_view_response::meta_data
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("total_rows", cbpp_to_js<std::optional<std::uint64_t>>(
                                     env, cppObj.total_rows));
        resObj.Set("debug_info", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.debug_info));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::document_view_response::row> {
    static inline couchbase::core::operations::document_view_response::row
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::document_view_response::row cppObj;
        js_to_cbpp<std::optional<std::string>>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::string>(cppObj.key, jsObj.Get("key"));
        js_to_cbpp<std::string>(cppObj.value, jsObj.Get("value"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::document_view_response::row &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<std::optional<std::string>>(env, cppObj.id));
        resObj.Set("key", cbpp_to_js<std::string>(env, cppObj.key));
        resObj.Set("value", cbpp_to_js<std::string>(env, cppObj.value));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::document_view_response::problem> {
    static inline couchbase::core::operations::document_view_response::problem
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::document_view_response::problem cppObj;
        js_to_cbpp<std::string>(cppObj.code, jsObj.Get("code"));
        js_to_cbpp<std::string>(cppObj.message, jsObj.Get("message"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::document_view_response::problem
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("code", cbpp_to_js<std::string>(env, cppObj.code));
        resObj.Set("message", cbpp_to_js<std::string>(env, cppObj.message));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::document_view_request> {
    static inline couchbase::core::operations::document_view_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::document_view_request cppObj;
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        js_to_cbpp<std::string>(cppObj.document_name,
                                jsObj.Get("document_name"));
        js_to_cbpp<std::string>(cppObj.view_name, jsObj.Get("view_name"));
        js_to_cbpp<couchbase::core::design_document_namespace>(cppObj.ns,
                                                               jsObj.Get("ns"));
        js_to_cbpp<std::optional<std::uint64_t>>(cppObj.limit,
                                                 jsObj.Get("limit"));
        js_to_cbpp<std::optional<std::uint64_t>>(cppObj.skip,
                                                 jsObj.Get("skip"));
        js_to_cbpp<std::optional<couchbase::core::view_scan_consistency>>(
            cppObj.consistency, jsObj.Get("consistency"));
        js_to_cbpp<std::vector<std::string>>(cppObj.keys, jsObj.Get("keys"));
        js_to_cbpp<std::optional<std::string>>(cppObj.key, jsObj.Get("key"));
        js_to_cbpp<std::optional<std::string>>(cppObj.start_key,
                                               jsObj.Get("start_key"));
        js_to_cbpp<std::optional<std::string>>(cppObj.end_key,
                                               jsObj.Get("end_key"));
        js_to_cbpp<std::optional<std::string>>(cppObj.start_key_doc_id,
                                               jsObj.Get("start_key_doc_id"));
        js_to_cbpp<std::optional<std::string>>(cppObj.end_key_doc_id,
                                               jsObj.Get("end_key_doc_id"));
        js_to_cbpp<std::optional<bool>>(cppObj.inclusive_end,
                                        jsObj.Get("inclusive_end"));
        js_to_cbpp<std::optional<bool>>(cppObj.reduce, jsObj.Get("reduce"));
        js_to_cbpp<std::optional<bool>>(cppObj.group, jsObj.Get("group"));
        js_to_cbpp<std::optional<std::uint32_t>>(cppObj.group_level,
                                                 jsObj.Get("group_level"));
        js_to_cbpp<bool>(cppObj.debug, jsObj.Get("debug"));
        js_to_cbpp<std::map<std::string, std::string>>(cppObj.raw,
                                                       jsObj.Get("raw"));
        js_to_cbpp<std::optional<bool>>(cppObj.full_set, jsObj.Get("full_set"));
        js_to_cbpp<std::optional<couchbase::core::view_sort_order>>(
            cppObj.order, jsObj.Get("order"));
        js_to_cbpp<std::optional<couchbase::core::view_on_error>>(
            cppObj.on_error, jsObj.Get("on_error"));
        js_to_cbpp<std::vector<std::string>>(cppObj.query_string,
                                             jsObj.Get("query_string"));
        // row_callback
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::document_view_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        resObj.Set("document_name",
                   cbpp_to_js<std::string>(env, cppObj.document_name));
        resObj.Set("view_name", cbpp_to_js<std::string>(env, cppObj.view_name));
        resObj.Set("ns", cbpp_to_js<couchbase::core::design_document_namespace>(
                             env, cppObj.ns));
        resObj.Set("limit",
                   cbpp_to_js<std::optional<std::uint64_t>>(env, cppObj.limit));
        resObj.Set("skip",
                   cbpp_to_js<std::optional<std::uint64_t>>(env, cppObj.skip));
        resObj.Set(
            "consistency",
            cbpp_to_js<std::optional<couchbase::core::view_scan_consistency>>(
                env, cppObj.consistency));
        resObj.Set("keys",
                   cbpp_to_js<std::vector<std::string>>(env, cppObj.keys));
        resObj.Set("key",
                   cbpp_to_js<std::optional<std::string>>(env, cppObj.key));
        resObj.Set("start_key", cbpp_to_js<std::optional<std::string>>(
                                    env, cppObj.start_key));
        resObj.Set("end_key",
                   cbpp_to_js<std::optional<std::string>>(env, cppObj.end_key));
        resObj.Set("start_key_doc_id", cbpp_to_js<std::optional<std::string>>(
                                           env, cppObj.start_key_doc_id));
        resObj.Set("end_key_doc_id", cbpp_to_js<std::optional<std::string>>(
                                         env, cppObj.end_key_doc_id));
        resObj.Set("inclusive_end",
                   cbpp_to_js<std::optional<bool>>(env, cppObj.inclusive_end));
        resObj.Set("reduce",
                   cbpp_to_js<std::optional<bool>>(env, cppObj.reduce));
        resObj.Set("group", cbpp_to_js<std::optional<bool>>(env, cppObj.group));
        resObj.Set("group_level", cbpp_to_js<std::optional<std::uint32_t>>(
                                      env, cppObj.group_level));
        resObj.Set("debug", cbpp_to_js<bool>(env, cppObj.debug));
        resObj.Set("raw", cbpp_to_js<std::map<std::string, std::string>>(
                              env, cppObj.raw));
        resObj.Set("full_set",
                   cbpp_to_js<std::optional<bool>>(env, cppObj.full_set));
        resObj.Set("order",
                   cbpp_to_js<std::optional<couchbase::core::view_sort_order>>(
                       env, cppObj.order));
        resObj.Set("on_error",
                   cbpp_to_js<std::optional<couchbase::core::view_on_error>>(
                       env, cppObj.on_error));
        resObj.Set("query_string", cbpp_to_js<std::vector<std::string>>(
                                       env, cppObj.query_string));
        // row_callback
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::get_and_lock_response> {
    static inline couchbase::core::operations::get_and_lock_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::get_and_lock_response cppObj;
        // ctx
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<std::uint32_t>(cppObj.flags, jsObj.Get("flags"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::get_and_lock_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("flags", cbpp_to_js<std::uint32_t>(env, cppObj.flags));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::get_and_lock_request> {
    static inline couchbase::core::operations::get_and_lock_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::get_and_lock_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<std::uint32_t>(cppObj.lock_time, jsObj.Get("lock_time"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::get_and_lock_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("lock_time",
                   cbpp_to_js<std::uint32_t>(env, cppObj.lock_time));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::insert_response> {
    static inline couchbase::core::operations::insert_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::insert_response cppObj;
        // ctx
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<couchbase::mutation_token>(cppObj.token, jsObj.Get("token"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::insert_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("token",
                   cbpp_to_js<couchbase::mutation_token>(env, cppObj.token));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::insert_request> {
    static inline couchbase::core::operations::insert_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::insert_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<std::uint32_t>(cppObj.flags, jsObj.Get("flags"));
        js_to_cbpp<std::uint32_t>(cppObj.expiry, jsObj.Get("expiry"));
        js_to_cbpp<couchbase::durability_level>(cppObj.durability_level,
                                                jsObj.Get("durability_level"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::insert_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("flags", cbpp_to_js<std::uint32_t>(env, cppObj.flags));
        resObj.Set("expiry", cbpp_to_js<std::uint32_t>(env, cppObj.expiry));
        resObj.Set("durability_level", cbpp_to_js<couchbase::durability_level>(
                                           env, cppObj.durability_level));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::insert_request_with_legacy_durability> {
    static inline couchbase::core::operations::
        insert_request_with_legacy_durability
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::insert_request_with_legacy_durability
            cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<std::uint32_t>(cppObj.flags, jsObj.Get("flags"));
        js_to_cbpp<std::uint32_t>(cppObj.expiry, jsObj.Get("expiry"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        js_to_cbpp<couchbase::persist_to>(cppObj.persist_to,
                                          jsObj.Get("persist_to"));
        js_to_cbpp<couchbase::replicate_to>(cppObj.replicate_to,
                                            jsObj.Get("replicate_to"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::insert_request_with_legacy_durability
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("flags", cbpp_to_js<std::uint32_t>(env, cppObj.flags));
        resObj.Set("expiry", cbpp_to_js<std::uint32_t>(env, cppObj.expiry));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        resObj.Set("persist_to",
                   cbpp_to_js<couchbase::persist_to>(env, cppObj.persist_to));
        resObj.Set("replicate_to", cbpp_to_js<couchbase::replicate_to>(
                                       env, cppObj.replicate_to));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::lookup_in_any_replica_response> {
    static inline couchbase::core::operations::lookup_in_any_replica_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::lookup_in_any_replica_response cppObj;
        // ctx
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<std::vector<couchbase::core::operations::
                                   lookup_in_any_replica_response::entry>>(
            cppObj.fields, jsObj.Get("fields"));
        js_to_cbpp<bool>(cppObj.deleted, jsObj.Get("deleted"));
        js_to_cbpp<bool>(cppObj.is_replica, jsObj.Get("is_replica"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::lookup_in_any_replica_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set(
            "fields",
            cbpp_to_js<std::vector<couchbase::core::operations::
                                       lookup_in_any_replica_response::entry>>(
                env, cppObj.fields));
        resObj.Set("deleted", cbpp_to_js<bool>(env, cppObj.deleted));
        resObj.Set("is_replica", cbpp_to_js<bool>(env, cppObj.is_replica));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::lookup_in_any_replica_response::entry> {
    static inline couchbase::core::operations::lookup_in_any_replica_response::
        entry
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::lookup_in_any_replica_response::entry
            cppObj;
        js_to_cbpp<std::string>(cppObj.path, jsObj.Get("path"));
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<std::size_t>(cppObj.original_index,
                                jsObj.Get("original_index"));
        js_to_cbpp<bool>(cppObj.exists, jsObj.Get("exists"));
        js_to_cbpp<couchbase::core::protocol::subdoc_opcode>(
            cppObj.opcode, jsObj.Get("opcode"));
        js_to_cbpp<couchbase::core::key_value_status_code>(cppObj.status,
                                                           jsObj.Get("status"));
        js_to_cbpp<std::error_code>(cppObj.ec, jsObj.Get("ec"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::lookup_in_any_replica_response::entry
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("path", cbpp_to_js<std::string>(env, cppObj.path));
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("original_index",
                   cbpp_to_js<std::size_t>(env, cppObj.original_index));
        resObj.Set("exists", cbpp_to_js<bool>(env, cppObj.exists));
        resObj.Set("opcode",
                   cbpp_to_js<couchbase::core::protocol::subdoc_opcode>(
                       env, cppObj.opcode));
        resObj.Set("status", cbpp_to_js<couchbase::core::key_value_status_code>(
                                 env, cppObj.status));
        resObj.Set("ec", cbpp_to_js<std::error_code>(env, cppObj.ec));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::lookup_in_any_replica_request> {
    static inline couchbase::core::operations::lookup_in_any_replica_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::lookup_in_any_replica_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::vector<couchbase::core::impl::subdoc::command>>(
            cppObj.specs, jsObj.Get("specs"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // parent_span
        // read_preference
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::lookup_in_any_replica_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set(
            "specs",
            cbpp_to_js<std::vector<couchbase::core::impl::subdoc::command>>(
                env, cppObj.specs));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // parent_span
        // read_preference
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::mutate_in_response> {
    static inline couchbase::core::operations::mutate_in_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::mutate_in_response cppObj;
        // ctx
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<couchbase::mutation_token>(cppObj.token, jsObj.Get("token"));
        js_to_cbpp<std::vector<
            couchbase::core::operations::mutate_in_response::entry>>(
            cppObj.fields, jsObj.Get("fields"));
        js_to_cbpp<bool>(cppObj.deleted, jsObj.Get("deleted"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::mutate_in_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("token",
                   cbpp_to_js<couchbase::mutation_token>(env, cppObj.token));
        resObj.Set("fields",
                   cbpp_to_js<std::vector<
                       couchbase::core::operations::mutate_in_response::entry>>(
                       env, cppObj.fields));
        resObj.Set("deleted", cbpp_to_js<bool>(env, cppObj.deleted));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::mutate_in_response::entry> {
    static inline couchbase::core::operations::mutate_in_response::entry
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::mutate_in_response::entry cppObj;
        js_to_cbpp<std::string>(cppObj.path, jsObj.Get("path"));
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        js_to_cbpp<std::size_t>(cppObj.original_index,
                                jsObj.Get("original_index"));
        js_to_cbpp<couchbase::core::protocol::subdoc_opcode>(
            cppObj.opcode, jsObj.Get("opcode"));
        js_to_cbpp<couchbase::core::key_value_status_code>(cppObj.status,
                                                           jsObj.Get("status"));
        js_to_cbpp<std::error_code>(cppObj.ec, jsObj.Get("ec"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::mutate_in_response::entry &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("path", cbpp_to_js<std::string>(env, cppObj.path));
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        resObj.Set("original_index",
                   cbpp_to_js<std::size_t>(env, cppObj.original_index));
        resObj.Set("opcode",
                   cbpp_to_js<couchbase::core::protocol::subdoc_opcode>(
                       env, cppObj.opcode));
        resObj.Set("status", cbpp_to_js<couchbase::core::key_value_status_code>(
                                 env, cppObj.status));
        resObj.Set("ec", cbpp_to_js<std::error_code>(env, cppObj.ec));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::mutate_in_request> {
    static inline couchbase::core::operations::mutate_in_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::mutate_in_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<bool>(cppObj.access_deleted, jsObj.Get("access_deleted"));
        js_to_cbpp<bool>(cppObj.create_as_deleted,
                         jsObj.Get("create_as_deleted"));
        js_to_cbpp<std::optional<std::uint32_t>>(cppObj.expiry,
                                                 jsObj.Get("expiry"));
        js_to_cbpp<couchbase::store_semantics>(cppObj.store_semantics,
                                               jsObj.Get("store_semantics"));
        js_to_cbpp<std::vector<couchbase::core::impl::subdoc::command>>(
            cppObj.specs, jsObj.Get("specs"));
        js_to_cbpp<couchbase::durability_level>(cppObj.durability_level,
                                                jsObj.Get("durability_level"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        js_to_cbpp<bool>(cppObj.preserve_expiry, jsObj.Get("preserve_expiry"));
        // parent_span
        js_to_cbpp<std::optional<std::uint32_t>>(cppObj.flags,
                                                 jsObj.Get("flags"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::mutate_in_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("access_deleted",
                   cbpp_to_js<bool>(env, cppObj.access_deleted));
        resObj.Set("create_as_deleted",
                   cbpp_to_js<bool>(env, cppObj.create_as_deleted));
        resObj.Set("expiry", cbpp_to_js<std::optional<std::uint32_t>>(
                                 env, cppObj.expiry));
        resObj.Set("store_semantics", cbpp_to_js<couchbase::store_semantics>(
                                          env, cppObj.store_semantics));
        resObj.Set(
            "specs",
            cbpp_to_js<std::vector<couchbase::core::impl::subdoc::command>>(
                env, cppObj.specs));
        resObj.Set("durability_level", cbpp_to_js<couchbase::durability_level>(
                                           env, cppObj.durability_level));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        resObj.Set("preserve_expiry",
                   cbpp_to_js<bool>(env, cppObj.preserve_expiry));
        // parent_span
        resObj.Set("flags",
                   cbpp_to_js<std::optional<std::uint32_t>>(env, cppObj.flags));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::mutate_in_request_with_legacy_durability> {
    static inline couchbase::core::operations::
        mutate_in_request_with_legacy_durability
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::mutate_in_request_with_legacy_durability
            cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<bool>(cppObj.access_deleted, jsObj.Get("access_deleted"));
        js_to_cbpp<bool>(cppObj.create_as_deleted,
                         jsObj.Get("create_as_deleted"));
        js_to_cbpp<std::optional<std::uint32_t>>(cppObj.expiry,
                                                 jsObj.Get("expiry"));
        js_to_cbpp<couchbase::store_semantics>(cppObj.store_semantics,
                                               jsObj.Get("store_semantics"));
        js_to_cbpp<std::vector<couchbase::core::impl::subdoc::command>>(
            cppObj.specs, jsObj.Get("specs"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        js_to_cbpp<bool>(cppObj.preserve_expiry, jsObj.Get("preserve_expiry"));
        // parent_span
        js_to_cbpp<std::optional<std::uint32_t>>(cppObj.flags,
                                                 jsObj.Get("flags"));
        js_to_cbpp<couchbase::persist_to>(cppObj.persist_to,
                                          jsObj.Get("persist_to"));
        js_to_cbpp<couchbase::replicate_to>(cppObj.replicate_to,
                                            jsObj.Get("replicate_to"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::
                             mutate_in_request_with_legacy_durability &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("access_deleted",
                   cbpp_to_js<bool>(env, cppObj.access_deleted));
        resObj.Set("create_as_deleted",
                   cbpp_to_js<bool>(env, cppObj.create_as_deleted));
        resObj.Set("expiry", cbpp_to_js<std::optional<std::uint32_t>>(
                                 env, cppObj.expiry));
        resObj.Set("store_semantics", cbpp_to_js<couchbase::store_semantics>(
                                          env, cppObj.store_semantics));
        resObj.Set(
            "specs",
            cbpp_to_js<std::vector<couchbase::core::impl::subdoc::command>>(
                env, cppObj.specs));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        resObj.Set("preserve_expiry",
                   cbpp_to_js<bool>(env, cppObj.preserve_expiry));
        // parent_span
        resObj.Set("flags",
                   cbpp_to_js<std::optional<std::uint32_t>>(env, cppObj.flags));
        resObj.Set("persist_to",
                   cbpp_to_js<couchbase::persist_to>(env, cppObj.persist_to));
        resObj.Set("replicate_to", cbpp_to_js<couchbase::replicate_to>(
                                       env, cppObj.replicate_to));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::increment_response> {
    static inline couchbase::core::operations::increment_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::increment_response cppObj;
        // ctx
        js_to_cbpp<std::uint64_t>(cppObj.content, jsObj.Get("content"));
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<couchbase::mutation_token>(cppObj.token, jsObj.Get("token"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::increment_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("content", cbpp_to_js<std::uint64_t>(env, cppObj.content));
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("token",
                   cbpp_to_js<couchbase::mutation_token>(env, cppObj.token));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::increment_request> {
    static inline couchbase::core::operations::increment_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::increment_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<std::uint32_t>(cppObj.expiry, jsObj.Get("expiry"));
        js_to_cbpp<std::uint64_t>(cppObj.delta, jsObj.Get("delta"));
        js_to_cbpp<std::optional<std::uint64_t>>(cppObj.initial_value,
                                                 jsObj.Get("initial_value"));
        js_to_cbpp<couchbase::durability_level>(cppObj.durability_level,
                                                jsObj.Get("durability_level"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::increment_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("expiry", cbpp_to_js<std::uint32_t>(env, cppObj.expiry));
        resObj.Set("delta", cbpp_to_js<std::uint64_t>(env, cppObj.delta));
        resObj.Set("initial_value", cbpp_to_js<std::optional<std::uint64_t>>(
                                        env, cppObj.initial_value));
        resObj.Set("durability_level", cbpp_to_js<couchbase::durability_level>(
                                           env, cppObj.durability_level));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::increment_request_with_legacy_durability> {
    static inline couchbase::core::operations::
        increment_request_with_legacy_durability
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::increment_request_with_legacy_durability
            cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<std::uint32_t>(cppObj.expiry, jsObj.Get("expiry"));
        js_to_cbpp<std::uint64_t>(cppObj.delta, jsObj.Get("delta"));
        js_to_cbpp<std::optional<std::uint64_t>>(cppObj.initial_value,
                                                 jsObj.Get("initial_value"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        // parent_span
        js_to_cbpp<couchbase::persist_to>(cppObj.persist_to,
                                          jsObj.Get("persist_to"));
        js_to_cbpp<couchbase::replicate_to>(cppObj.replicate_to,
                                            jsObj.Get("replicate_to"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::
                             increment_request_with_legacy_durability &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("expiry", cbpp_to_js<std::uint32_t>(env, cppObj.expiry));
        resObj.Set("delta", cbpp_to_js<std::uint64_t>(env, cppObj.delta));
        resObj.Set("initial_value", cbpp_to_js<std::optional<std::uint64_t>>(
                                        env, cppObj.initial_value));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        // parent_span
        resObj.Set("persist_to",
                   cbpp_to_js<couchbase::persist_to>(env, cppObj.persist_to));
        resObj.Set("replicate_to", cbpp_to_js<couchbase::replicate_to>(
                                       env, cppObj.replicate_to));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::group_upsert_response> {
    static inline couchbase::core::operations::management::group_upsert_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::group_upsert_response cppObj;
        // ctx
        js_to_cbpp<std::vector<std::string>>(cppObj.errors,
                                             jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::group_upsert_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("errors",
                   cbpp_to_js<std::vector<std::string>>(env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::group_upsert_request> {
    static inline couchbase::core::operations::management::group_upsert_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::group_upsert_request cppObj;
        js_to_cbpp<couchbase::core::management::rbac::group>(
            cppObj.group, jsObj.Get("group"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::group_upsert_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("group",
                   cbpp_to_js<couchbase::core::management::rbac::group>(
                       env, cppObj.group));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::eventing_pause_function_response> {
    static inline couchbase::core::operations::management::
        eventing_pause_function_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            eventing_pause_function_response cppObj;
        // ctx
        js_to_cbpp<std::optional<
            couchbase::core::operations::management::eventing_problem>>(
            cppObj.error, jsObj.Get("error"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             eventing_pause_function_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set(
            "error",
            cbpp_to_js<std::optional<
                couchbase::core::operations::management::eventing_problem>>(
                env, cppObj.error));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::eventing_pause_function_request> {
    static inline couchbase::core::operations::management::
        eventing_pause_function_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::eventing_pause_function_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             eventing_pause_function_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::query_index_get_all_response> {
    static inline couchbase::core::operations::management::
        query_index_get_all_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::query_index_get_all_response
            cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::vector<couchbase::management::query_index>>(
            cppObj.indexes, jsObj.Get("indexes"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             query_index_get_all_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set("indexes",
                   cbpp_to_js<std::vector<couchbase::management::query_index>>(
                       env, cppObj.indexes));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::query_index_get_all_request> {
    static inline couchbase::core::operations::management::
        query_index_get_all_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::query_index_get_all_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        js_to_cbpp<std::string>(cppObj.scope_name, jsObj.Get("scope_name"));
        js_to_cbpp<std::string>(cppObj.collection_name,
                                jsObj.Get("collection_name"));
        js_to_cbpp<couchbase::core::query_context>(cppObj.query_ctx,
                                                   jsObj.Get("query_ctx"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             query_index_get_all_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        resObj.Set("scope_name",
                   cbpp_to_js<std::string>(env, cppObj.scope_name));
        resObj.Set("collection_name",
                   cbpp_to_js<std::string>(env, cppObj.collection_name));
        resObj.Set("query_ctx", cbpp_to_js<couchbase::core::query_context>(
                                    env, cppObj.query_ctx));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::collection_create_response> {
    static inline couchbase::core::operations::management::
        collection_create_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::collection_create_response
            cppObj;
        // ctx
        js_to_cbpp<std::uint64_t>(cppObj.uid, jsObj.Get("uid"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             collection_create_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("uid", cbpp_to_js<std::uint64_t>(env, cppObj.uid));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::collection_create_request> {
    static inline couchbase::core::operations::management::
        collection_create_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::collection_create_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        js_to_cbpp<std::string>(cppObj.scope_name, jsObj.Get("scope_name"));
        js_to_cbpp<std::string>(cppObj.collection_name,
                                jsObj.Get("collection_name"));
        js_to_cbpp<std::optional<std::int32_t>>(cppObj.max_expiry,
                                                jsObj.Get("max_expiry"));
        js_to_cbpp<std::optional<bool>>(cppObj.history, jsObj.Get("history"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::collection_create_request
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        resObj.Set("scope_name",
                   cbpp_to_js<std::string>(env, cppObj.scope_name));
        resObj.Set("collection_name",
                   cbpp_to_js<std::string>(env, cppObj.collection_name));
        resObj.Set("max_expiry", cbpp_to_js<std::optional<std::int32_t>>(
                                     env, cppObj.max_expiry));
        resObj.Set("history",
                   cbpp_to_js<std::optional<bool>>(env, cppObj.history));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        eventing_resume_function_response> {
    static inline couchbase::core::operations::management::
        eventing_resume_function_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            eventing_resume_function_response cppObj;
        // ctx
        js_to_cbpp<std::optional<
            couchbase::core::operations::management::eventing_problem>>(
            cppObj.error, jsObj.Get("error"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             eventing_resume_function_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set(
            "error",
            cbpp_to_js<std::optional<
                couchbase::core::operations::management::eventing_problem>>(
                env, cppObj.error));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::eventing_resume_function_request> {
    static inline couchbase::core::operations::management::
        eventing_resume_function_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            eventing_resume_function_request cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             eventing_resume_function_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::search_index_get_stats_response> {
    static inline couchbase::core::operations::management::
        search_index_get_stats_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::search_index_get_stats_response
            cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::string>(cppObj.error, jsObj.Get("error"));
        js_to_cbpp<std::string>(cppObj.stats, jsObj.Get("stats"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             search_index_get_stats_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set("error", cbpp_to_js<std::string>(env, cppObj.error));
        resObj.Set("stats", cbpp_to_js<std::string>(env, cppObj.stats));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::search_index_get_stats_request> {
    static inline couchbase::core::operations::management::
        search_index_get_stats_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::search_index_get_stats_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.index_name, jsObj.Get("index_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             search_index_get_stats_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("index_name",
                   cbpp_to_js<std::string>(env, cppObj.index_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::bucket_get_all_response> {
    static inline couchbase::core::operations::management::
        bucket_get_all_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::bucket_get_all_response cppObj;
        // ctx
        js_to_cbpp<
            std::vector<couchbase::core::management::cluster::bucket_settings>>(
            cppObj.buckets, jsObj.Get("buckets"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::bucket_get_all_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("buckets",
                   cbpp_to_js<std::vector<
                       couchbase::core::management::cluster::bucket_settings>>(
                       env, cppObj.buckets));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::bucket_get_all_request> {
    static inline couchbase::core::operations::management::
        bucket_get_all_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::bucket_get_all_request cppObj;
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::bucket_get_all_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        query_index_build_deferred_response> {
    static inline couchbase::core::operations::management::
        query_index_build_deferred_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            query_index_build_deferred_response cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::vector<
            couchbase::core::operations::management::
                query_index_build_deferred_response::query_problem>>(
            cppObj.errors, jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             query_index_build_deferred_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set("errors",
                   cbpp_to_js<std::vector<
                       couchbase::core::operations::management::
                           query_index_build_deferred_response::query_problem>>(
                       env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        query_index_build_deferred_response::query_problem> {
    static inline couchbase::core::operations::management::
        query_index_build_deferred_response::query_problem
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            query_index_build_deferred_response::query_problem cppObj;
        js_to_cbpp<std::uint64_t>(cppObj.code, jsObj.Get("code"));
        js_to_cbpp<std::string>(cppObj.message, jsObj.Get("message"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::
              query_index_build_deferred_response::query_problem &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("code", cbpp_to_js<std::uint64_t>(env, cppObj.code));
        resObj.Set("message", cbpp_to_js<std::string>(env, cppObj.message));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        query_index_build_deferred_request> {
    static inline couchbase::core::operations::management::
        query_index_build_deferred_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            query_index_build_deferred_request cppObj;
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.collection_name,
                                               jsObj.Get("collection_name"));
        js_to_cbpp<couchbase::core::query_context>(cppObj.query_ctx,
                                                   jsObj.Get("query_ctx"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             query_index_build_deferred_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("collection_name", cbpp_to_js<std::optional<std::string>>(
                                          env, cppObj.collection_name));
        resObj.Set("query_ctx", cbpp_to_js<couchbase::core::query_context>(
                                    env, cppObj.query_ctx));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::cluster_describe_response> {
    static inline couchbase::core::operations::management::
        cluster_describe_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::cluster_describe_response
            cppObj;
        // ctx
        js_to_cbpp<couchbase::core::operations::management::
                       cluster_describe_response::cluster_info>(
            cppObj.info, jsObj.Get("info"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::cluster_describe_response
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("info",
                   cbpp_to_js<couchbase::core::operations::management::
                                  cluster_describe_response::cluster_info>(
                       env, cppObj.info));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        cluster_describe_response::cluster_info> {
    static inline couchbase::core::operations::management::
        cluster_describe_response::cluster_info
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::cluster_describe_response::
            cluster_info cppObj;
        js_to_cbpp<
            std::vector<couchbase::core::operations::management::
                            cluster_describe_response::cluster_info::node>>(
            cppObj.nodes, jsObj.Get("nodes"));
        js_to_cbpp<
            std::vector<couchbase::core::operations::management::
                            cluster_describe_response::cluster_info::bucket>>(
            cppObj.buckets, jsObj.Get("buckets"));
        js_to_cbpp<std::set<couchbase::core::service_type>>(
            cppObj.services, jsObj.Get("services"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             cluster_describe_response::cluster_info &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set(
            "nodes",
            cbpp_to_js<
                std::vector<couchbase::core::operations::management::
                                cluster_describe_response::cluster_info::node>>(
                env, cppObj.nodes));
        resObj.Set("buckets",
                   cbpp_to_js<std::vector<
                       couchbase::core::operations::management::
                           cluster_describe_response::cluster_info::bucket>>(
                       env, cppObj.buckets));
        resObj.Set("services",
                   cbpp_to_js<std::set<couchbase::core::service_type>>(
                       env, cppObj.services));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        cluster_describe_response::cluster_info::node> {
    static inline couchbase::core::operations::management::
        cluster_describe_response::cluster_info::node
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::cluster_describe_response::
            cluster_info::node cppObj;
        js_to_cbpp<std::string>(cppObj.uuid, jsObj.Get("uuid"));
        js_to_cbpp<std::string>(cppObj.otp_node, jsObj.Get("otp_node"));
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::string>(cppObj.hostname, jsObj.Get("hostname"));
        js_to_cbpp<std::string>(cppObj.os, jsObj.Get("os"));
        js_to_cbpp<std::string>(cppObj.version, jsObj.Get("version"));
        js_to_cbpp<std::vector<std::string>>(cppObj.services,
                                             jsObj.Get("services"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::
              cluster_describe_response::cluster_info::node &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("uuid", cbpp_to_js<std::string>(env, cppObj.uuid));
        resObj.Set("otp_node", cbpp_to_js<std::string>(env, cppObj.otp_node));
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set("hostname", cbpp_to_js<std::string>(env, cppObj.hostname));
        resObj.Set("os", cbpp_to_js<std::string>(env, cppObj.os));
        resObj.Set("version", cbpp_to_js<std::string>(env, cppObj.version));
        resObj.Set("services",
                   cbpp_to_js<std::vector<std::string>>(env, cppObj.services));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        cluster_describe_response::cluster_info::bucket> {
    static inline couchbase::core::operations::management::
        cluster_describe_response::cluster_info::bucket
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::cluster_describe_response::
            cluster_info::bucket cppObj;
        js_to_cbpp<std::string>(cppObj.uuid, jsObj.Get("uuid"));
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::
              cluster_describe_response::cluster_info::bucket &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("uuid", cbpp_to_js<std::string>(env, cppObj.uuid));
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::cluster_describe_request> {
    static inline couchbase::core::operations::management::
        cluster_describe_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::cluster_describe_request
            cppObj;
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::cluster_describe_request
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::search_index_get_all_response> {
    static inline couchbase::core::operations::management::
        search_index_get_all_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::search_index_get_all_response
            cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::string>(cppObj.impl_version, jsObj.Get("impl_version"));
        js_to_cbpp<std::vector<couchbase::core::management::search::index>>(
            cppObj.indexes, jsObj.Get("indexes"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             search_index_get_all_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set("impl_version",
                   cbpp_to_js<std::string>(env, cppObj.impl_version));
        resObj.Set(
            "indexes",
            cbpp_to_js<std::vector<couchbase::core::management::search::index>>(
                env, cppObj.indexes));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::search_index_get_all_request> {
    static inline couchbase::core::operations::management::
        search_index_get_all_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::search_index_get_all_request
            cppObj;
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             search_index_get_all_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        search_index_analyze_document_response> {
    static inline couchbase::core::operations::management::
        search_index_analyze_document_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            search_index_analyze_document_response cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::string>(cppObj.error, jsObj.Get("error"));
        js_to_cbpp<std::string>(cppObj.analysis, jsObj.Get("analysis"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             search_index_analyze_document_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set("error", cbpp_to_js<std::string>(env, cppObj.error));
        resObj.Set("analysis", cbpp_to_js<std::string>(env, cppObj.analysis));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        search_index_analyze_document_request> {
    static inline couchbase::core::operations::management::
        search_index_analyze_document_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            search_index_analyze_document_request cppObj;
        js_to_cbpp<std::string>(cppObj.index_name, jsObj.Get("index_name"));
        js_to_cbpp<std::string>(cppObj.encoded_document,
                                jsObj.Get("encoded_document"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             search_index_analyze_document_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("index_name",
                   cbpp_to_js<std::string>(env, cppObj.index_name));
        resObj.Set("encoded_document",
                   cbpp_to_js<std::string>(env, cppObj.encoded_document));
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::query_index_drop_response> {
    static inline couchbase::core::operations::management::
        query_index_drop_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::query_index_drop_response
            cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::vector<couchbase::core::operations::management::
                                   query_index_drop_response::query_problem>>(
            cppObj.errors, jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::query_index_drop_response
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "errors",
            cbpp_to_js<
                std::vector<couchbase::core::operations::management::
                                query_index_drop_response::query_problem>>(
                env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        query_index_drop_response::query_problem> {
    static inline couchbase::core::operations::management::
        query_index_drop_response::query_problem
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::query_index_drop_response::
            query_problem cppObj;
        js_to_cbpp<std::uint64_t>(cppObj.code, jsObj.Get("code"));
        js_to_cbpp<std::string>(cppObj.message, jsObj.Get("message"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             query_index_drop_response::query_problem &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("code", cbpp_to_js<std::uint64_t>(env, cppObj.code));
        resObj.Set("message", cbpp_to_js<std::string>(env, cppObj.message));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::query_index_drop_request> {
    static inline couchbase::core::operations::management::
        query_index_drop_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::query_index_drop_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        js_to_cbpp<std::string>(cppObj.scope_name, jsObj.Get("scope_name"));
        js_to_cbpp<std::string>(cppObj.collection_name,
                                jsObj.Get("collection_name"));
        js_to_cbpp<std::string>(cppObj.index_name, jsObj.Get("index_name"));
        js_to_cbpp<couchbase::core::query_context>(cppObj.query_ctx,
                                                   jsObj.Get("query_ctx"));
        js_to_cbpp<bool>(cppObj.is_primary, jsObj.Get("is_primary"));
        js_to_cbpp<bool>(cppObj.ignore_if_does_not_exist,
                         jsObj.Get("ignore_if_does_not_exist"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::query_index_drop_request
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        resObj.Set("scope_name",
                   cbpp_to_js<std::string>(env, cppObj.scope_name));
        resObj.Set("collection_name",
                   cbpp_to_js<std::string>(env, cppObj.collection_name));
        resObj.Set("index_name",
                   cbpp_to_js<std::string>(env, cppObj.index_name));
        resObj.Set("query_ctx", cbpp_to_js<couchbase::core::query_context>(
                                    env, cppObj.query_ctx));
        resObj.Set("is_primary", cbpp_to_js<bool>(env, cppObj.is_primary));
        resObj.Set("ignore_if_does_not_exist",
                   cbpp_to_js<bool>(env, cppObj.ignore_if_does_not_exist));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        analytics_dataset_create_response> {
    static inline couchbase::core::operations::management::
        analytics_dataset_create_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            analytics_dataset_create_response cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::vector<
            couchbase::core::operations::management::analytics_problem>>(
            cppObj.errors, jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_dataset_create_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "errors",
            cbpp_to_js<std::vector<
                couchbase::core::operations::management::analytics_problem>>(
                env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::analytics_dataset_create_request> {
    static inline couchbase::core::operations::management::
        analytics_dataset_create_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            analytics_dataset_create_request cppObj;
        js_to_cbpp<std::string>(cppObj.dataverse_name,
                                jsObj.Get("dataverse_name"));
        js_to_cbpp<std::string>(cppObj.dataset_name, jsObj.Get("dataset_name"));
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.condition,
                                               jsObj.Get("condition"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        js_to_cbpp<bool>(cppObj.ignore_if_exists,
                         jsObj.Get("ignore_if_exists"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_dataset_create_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("dataverse_name",
                   cbpp_to_js<std::string>(env, cppObj.dataverse_name));
        resObj.Set("dataset_name",
                   cbpp_to_js<std::string>(env, cppObj.dataset_name));
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        resObj.Set("condition", cbpp_to_js<std::optional<std::string>>(
                                    env, cppObj.condition));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        resObj.Set("ignore_if_exists",
                   cbpp_to_js<bool>(env, cppObj.ignore_if_exists));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::bucket_flush_response> {
    static inline couchbase::core::operations::management::bucket_flush_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::bucket_flush_response cppObj;
        // ctx
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::bucket_flush_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::bucket_flush_request> {
    static inline couchbase::core::operations::management::bucket_flush_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::bucket_flush_request cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::bucket_flush_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::analytics_index_drop_response> {
    static inline couchbase::core::operations::management::
        analytics_index_drop_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::analytics_index_drop_response
            cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::vector<
            couchbase::core::operations::management::analytics_problem>>(
            cppObj.errors, jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_index_drop_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "errors",
            cbpp_to_js<std::vector<
                couchbase::core::operations::management::analytics_problem>>(
                env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::analytics_index_drop_request> {
    static inline couchbase::core::operations::management::
        analytics_index_drop_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::analytics_index_drop_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.dataverse_name,
                                jsObj.Get("dataverse_name"));
        js_to_cbpp<std::string>(cppObj.dataset_name, jsObj.Get("dataset_name"));
        js_to_cbpp<std::string>(cppObj.index_name, jsObj.Get("index_name"));
        js_to_cbpp<bool>(cppObj.ignore_if_does_not_exist,
                         jsObj.Get("ignore_if_does_not_exist"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_index_drop_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("dataverse_name",
                   cbpp_to_js<std::string>(env, cppObj.dataverse_name));
        resObj.Set("dataset_name",
                   cbpp_to_js<std::string>(env, cppObj.dataset_name));
        resObj.Set("index_name",
                   cbpp_to_js<std::string>(env, cppObj.index_name));
        resObj.Set("ignore_if_does_not_exist",
                   cbpp_to_js<bool>(env, cppObj.ignore_if_does_not_exist));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::query_index_create_response> {
    static inline couchbase::core::operations::management::
        query_index_create_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::query_index_create_response
            cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::vector<couchbase::core::operations::management::
                                   query_index_create_response::query_problem>>(
            cppObj.errors, jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             query_index_create_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "errors",
            cbpp_to_js<
                std::vector<couchbase::core::operations::management::
                                query_index_create_response::query_problem>>(
                env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        query_index_create_response::query_problem> {
    static inline couchbase::core::operations::management::
        query_index_create_response::query_problem
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::query_index_create_response::
            query_problem cppObj;
        js_to_cbpp<std::uint64_t>(cppObj.code, jsObj.Get("code"));
        js_to_cbpp<std::string>(cppObj.message, jsObj.Get("message"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             query_index_create_response::query_problem &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("code", cbpp_to_js<std::uint64_t>(env, cppObj.code));
        resObj.Set("message", cbpp_to_js<std::string>(env, cppObj.message));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::query_index_create_request> {
    static inline couchbase::core::operations::management::
        query_index_create_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::query_index_create_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        js_to_cbpp<std::string>(cppObj.scope_name, jsObj.Get("scope_name"));
        js_to_cbpp<std::string>(cppObj.collection_name,
                                jsObj.Get("collection_name"));
        js_to_cbpp<std::string>(cppObj.index_name, jsObj.Get("index_name"));
        js_to_cbpp<std::vector<std::string>>(cppObj.keys, jsObj.Get("keys"));
        js_to_cbpp<couchbase::core::query_context>(cppObj.query_ctx,
                                                   jsObj.Get("query_ctx"));
        js_to_cbpp<bool>(cppObj.is_primary, jsObj.Get("is_primary"));
        js_to_cbpp<bool>(cppObj.ignore_if_exists,
                         jsObj.Get("ignore_if_exists"));
        js_to_cbpp<std::optional<std::string>>(cppObj.condition,
                                               jsObj.Get("condition"));
        js_to_cbpp<std::optional<bool>>(cppObj.deferred, jsObj.Get("deferred"));
        js_to_cbpp<std::optional<std::int32_t>>(cppObj.num_replicas,
                                                jsObj.Get("num_replicas"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             query_index_create_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        resObj.Set("scope_name",
                   cbpp_to_js<std::string>(env, cppObj.scope_name));
        resObj.Set("collection_name",
                   cbpp_to_js<std::string>(env, cppObj.collection_name));
        resObj.Set("index_name",
                   cbpp_to_js<std::string>(env, cppObj.index_name));
        resObj.Set("keys",
                   cbpp_to_js<std::vector<std::string>>(env, cppObj.keys));
        resObj.Set("query_ctx", cbpp_to_js<couchbase::core::query_context>(
                                    env, cppObj.query_ctx));
        resObj.Set("is_primary", cbpp_to_js<bool>(env, cppObj.is_primary));
        resObj.Set("ignore_if_exists",
                   cbpp_to_js<bool>(env, cppObj.ignore_if_exists));
        resObj.Set("condition", cbpp_to_js<std::optional<std::string>>(
                                    env, cppObj.condition));
        resObj.Set("deferred",
                   cbpp_to_js<std::optional<bool>>(env, cppObj.deferred));
        resObj.Set("num_replicas", cbpp_to_js<std::optional<std::int32_t>>(
                                       env, cppObj.num_replicas));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::search_index_upsert_response> {
    static inline couchbase::core::operations::management::
        search_index_upsert_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::search_index_upsert_response
            cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::string>(cppObj.uuid, jsObj.Get("uuid"));
        js_to_cbpp<std::string>(cppObj.error, jsObj.Get("error"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             search_index_upsert_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("uuid", cbpp_to_js<std::string>(env, cppObj.uuid));
        resObj.Set("error", cbpp_to_js<std::string>(env, cppObj.error));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::search_index_upsert_request> {
    static inline couchbase::core::operations::management::
        search_index_upsert_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::search_index_upsert_request
            cppObj;
        js_to_cbpp<couchbase::core::management::search::index>(
            cppObj.index, jsObj.Get("index"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             search_index_upsert_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("index",
                   cbpp_to_js<couchbase::core::management::search::index>(
                       env, cppObj.index));
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        analytics_dataset_get_all_response> {
    static inline couchbase::core::operations::management::
        analytics_dataset_get_all_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            analytics_dataset_get_all_response cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<
            std::vector<couchbase::core::management::analytics::dataset>>(
            cppObj.datasets, jsObj.Get("datasets"));
        js_to_cbpp<std::vector<
            couchbase::core::operations::management::analytics_problem>>(
            cppObj.errors, jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_dataset_get_all_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "datasets",
            cbpp_to_js<
                std::vector<couchbase::core::management::analytics::dataset>>(
                env, cppObj.datasets));
        resObj.Set(
            "errors",
            cbpp_to_js<std::vector<
                couchbase::core::operations::management::analytics_problem>>(
                env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        analytics_dataset_get_all_request> {
    static inline couchbase::core::operations::management::
        analytics_dataset_get_all_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            analytics_dataset_get_all_request cppObj;
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_dataset_get_all_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::analytics_index_get_all_response> {
    static inline couchbase::core::operations::management::
        analytics_index_get_all_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            analytics_index_get_all_response cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::vector<couchbase::core::management::analytics::index>>(
            cppObj.indexes, jsObj.Get("indexes"));
        js_to_cbpp<std::vector<
            couchbase::core::operations::management::analytics_problem>>(
            cppObj.errors, jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_index_get_all_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "indexes",
            cbpp_to_js<
                std::vector<couchbase::core::management::analytics::index>>(
                env, cppObj.indexes));
        resObj.Set(
            "errors",
            cbpp_to_js<std::vector<
                couchbase::core::operations::management::analytics_problem>>(
                env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::analytics_index_get_all_request> {
    static inline couchbase::core::operations::management::
        analytics_index_get_all_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::analytics_index_get_all_request
            cppObj;
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_index_get_all_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        analytics_get_pending_mutations_response> {
    static inline couchbase::core::operations::management::
        analytics_get_pending_mutations_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            analytics_get_pending_mutations_response cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::vector<
            couchbase::core::operations::management::analytics_problem>>(
            cppObj.errors, jsObj.Get("errors"));
        js_to_cbpp<std::map<std::string, std::int64_t>>(cppObj.stats,
                                                        jsObj.Get("stats"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_get_pending_mutations_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "errors",
            cbpp_to_js<std::vector<
                couchbase::core::operations::management::analytics_problem>>(
                env, cppObj.errors));
        resObj.Set("stats", cbpp_to_js<std::map<std::string, std::int64_t>>(
                                env, cppObj.stats));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        analytics_get_pending_mutations_request> {
    static inline couchbase::core::operations::management::
        analytics_get_pending_mutations_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            analytics_get_pending_mutations_request cppObj;
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_get_pending_mutations_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        analytics_dataverse_drop_response> {
    static inline couchbase::core::operations::management::
        analytics_dataverse_drop_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            analytics_dataverse_drop_response cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::vector<
            couchbase::core::operations::management::analytics_problem>>(
            cppObj.errors, jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_dataverse_drop_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "errors",
            cbpp_to_js<std::vector<
                couchbase::core::operations::management::analytics_problem>>(
                env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::analytics_dataverse_drop_request> {
    static inline couchbase::core::operations::management::
        analytics_dataverse_drop_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            analytics_dataverse_drop_request cppObj;
        js_to_cbpp<std::string>(cppObj.dataverse_name,
                                jsObj.Get("dataverse_name"));
        js_to_cbpp<bool>(cppObj.ignore_if_does_not_exist,
                         jsObj.Get("ignore_if_does_not_exist"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_dataverse_drop_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("dataverse_name",
                   cbpp_to_js<std::string>(env, cppObj.dataverse_name));
        resObj.Set("ignore_if_does_not_exist",
                   cbpp_to_js<bool>(env, cppObj.ignore_if_does_not_exist));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::eventing_problem> {
    static inline couchbase::core::operations::management::eventing_problem
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::eventing_problem cppObj;
        js_to_cbpp<std::uint64_t>(cppObj.code, jsObj.Get("code"));
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::string>(cppObj.description, jsObj.Get("description"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::eventing_problem &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("code", cbpp_to_js<std::uint64_t>(env, cppObj.code));
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("description",
                   cbpp_to_js<std::string>(env, cppObj.description));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::analytics_link_connect_response> {
    static inline couchbase::core::operations::management::
        analytics_link_connect_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::analytics_link_connect_response
            cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::vector<couchbase::core::operations::management::
                                   analytics_link_connect_response::problem>>(
            cppObj.errors, jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_link_connect_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "errors",
            cbpp_to_js<
                std::vector<couchbase::core::operations::management::
                                analytics_link_connect_response::problem>>(
                env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        analytics_link_connect_response::problem> {
    static inline couchbase::core::operations::management::
        analytics_link_connect_response::problem
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            analytics_link_connect_response::problem cppObj;
        js_to_cbpp<std::uint32_t>(cppObj.code, jsObj.Get("code"));
        js_to_cbpp<std::string>(cppObj.message, jsObj.Get("message"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_link_connect_response::problem &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("code", cbpp_to_js<std::uint32_t>(env, cppObj.code));
        resObj.Set("message", cbpp_to_js<std::string>(env, cppObj.message));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::analytics_link_connect_request> {
    static inline couchbase::core::operations::management::
        analytics_link_connect_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::analytics_link_connect_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.dataverse_name,
                                jsObj.Get("dataverse_name"));
        js_to_cbpp<std::string>(cppObj.link_name, jsObj.Get("link_name"));
        js_to_cbpp<bool>(cppObj.force, jsObj.Get("force"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_link_connect_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("dataverse_name",
                   cbpp_to_js<std::string>(env, cppObj.dataverse_name));
        resObj.Set("link_name", cbpp_to_js<std::string>(env, cppObj.link_name));
        resObj.Set("force", cbpp_to_js<bool>(env, cppObj.force));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        collections_manifest_get_response> {
    static inline couchbase::core::operations::management::
        collections_manifest_get_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            collections_manifest_get_response cppObj;
        // ctx
        js_to_cbpp<couchbase::core::topology::collections_manifest>(
            cppObj.manifest, jsObj.Get("manifest"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             collections_manifest_get_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("manifest",
                   cbpp_to_js<couchbase::core::topology::collections_manifest>(
                       env, cppObj.manifest));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::collections_manifest_get_request> {
    static inline couchbase::core::operations::management::
        collections_manifest_get_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            collections_manifest_get_request cppObj;
        js_to_cbpp<couchbase::core::document_id>(cppObj.id, jsObj.Get("id"));
        js_to_cbpp<std::uint16_t>(cppObj.partition, jsObj.Get("partition"));
        js_to_cbpp<std::uint32_t>(cppObj.opaque, jsObj.Get("opaque"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        // retries
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             collections_manifest_get_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("id",
                   cbpp_to_js<couchbase::core::document_id>(env, cppObj.id));
        resObj.Set("partition",
                   cbpp_to_js<std::uint16_t>(env, cppObj.partition));
        resObj.Set("opaque", cbpp_to_js<std::uint32_t>(env, cppObj.opaque));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        // retries
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::change_password_response> {
    static inline couchbase::core::operations::management::
        change_password_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::change_password_response
            cppObj;
        // ctx
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::change_password_response
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::change_password_request> {
    static inline couchbase::core::operations::management::
        change_password_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::change_password_request cppObj;
        js_to_cbpp<std::string>(cppObj.newPassword, jsObj.Get("newPassword"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::change_password_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("newPassword",
                   cbpp_to_js<std::string>(env, cppObj.newPassword));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        cluster_developer_preview_enable_response> {
    static inline couchbase::core::operations::management::
        cluster_developer_preview_enable_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            cluster_developer_preview_enable_response cppObj;
        // ctx
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             cluster_developer_preview_enable_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        cluster_developer_preview_enable_request> {
    static inline couchbase::core::operations::management::
        cluster_developer_preview_enable_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            cluster_developer_preview_enable_request cppObj;
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             cluster_developer_preview_enable_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::analytics_link_drop_response> {
    static inline couchbase::core::operations::management::
        analytics_link_drop_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::analytics_link_drop_response
            cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::vector<couchbase::core::operations::management::
                                   analytics_link_drop_response::problem>>(
            cppObj.errors, jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_link_drop_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "errors",
            cbpp_to_js<std::vector<couchbase::core::operations::management::
                                       analytics_link_drop_response::problem>>(
                env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        analytics_link_drop_response::problem> {
    static inline couchbase::core::operations::management::
        analytics_link_drop_response::problem
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::analytics_link_drop_response::
            problem cppObj;
        js_to_cbpp<std::uint32_t>(cppObj.code, jsObj.Get("code"));
        js_to_cbpp<std::string>(cppObj.message, jsObj.Get("message"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_link_drop_response::problem &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("code", cbpp_to_js<std::uint32_t>(env, cppObj.code));
        resObj.Set("message", cbpp_to_js<std::string>(env, cppObj.message));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::analytics_link_drop_request> {
    static inline couchbase::core::operations::management::
        analytics_link_drop_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::analytics_link_drop_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.link_name, jsObj.Get("link_name"));
        js_to_cbpp<std::string>(cppObj.dataverse_name,
                                jsObj.Get("dataverse_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_link_drop_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("link_name", cbpp_to_js<std::string>(env, cppObj.link_name));
        resObj.Set("dataverse_name",
                   cbpp_to_js<std::string>(env, cppObj.dataverse_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::collection_update_response> {
    static inline couchbase::core::operations::management::
        collection_update_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::collection_update_response
            cppObj;
        // ctx
        js_to_cbpp<std::uint64_t>(cppObj.uid, jsObj.Get("uid"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             collection_update_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("uid", cbpp_to_js<std::uint64_t>(env, cppObj.uid));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::collection_update_request> {
    static inline couchbase::core::operations::management::
        collection_update_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::collection_update_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        js_to_cbpp<std::string>(cppObj.scope_name, jsObj.Get("scope_name"));
        js_to_cbpp<std::string>(cppObj.collection_name,
                                jsObj.Get("collection_name"));
        js_to_cbpp<std::optional<std::int32_t>>(cppObj.max_expiry,
                                                jsObj.Get("max_expiry"));
        js_to_cbpp<std::optional<bool>>(cppObj.history, jsObj.Get("history"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::collection_update_request
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        resObj.Set("scope_name",
                   cbpp_to_js<std::string>(env, cppObj.scope_name));
        resObj.Set("collection_name",
                   cbpp_to_js<std::string>(env, cppObj.collection_name));
        resObj.Set("max_expiry", cbpp_to_js<std::optional<std::int32_t>>(
                                     env, cppObj.max_expiry));
        resObj.Set("history",
                   cbpp_to_js<std::optional<bool>>(env, cppObj.history));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::server_node_address> {
    static inline couchbase::core::operations::management::server_node_address
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::server_node_address cppObj;
        js_to_cbpp<std::string>(cppObj.hostname, jsObj.Get("hostname"));
        js_to_cbpp<std::uint16_t>(cppObj.kv_plain, jsObj.Get("kv_plain"));
        js_to_cbpp<std::uint16_t>(cppObj.kv_tls, jsObj.Get("kv_tls"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::server_node_address
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("hostname", cbpp_to_js<std::string>(env, cppObj.hostname));
        resObj.Set("kv_plain", cbpp_to_js<std::uint16_t>(env, cppObj.kv_plain));
        resObj.Set("kv_tls", cbpp_to_js<std::uint16_t>(env, cppObj.kv_tls));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::server_node> {
    static inline couchbase::core::operations::management::server_node
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::server_node cppObj;
        js_to_cbpp<std::string>(cppObj.server_group_name,
                                jsObj.Get("server_group_name"));
        js_to_cbpp<std::size_t>(cppObj.server_index, jsObj.Get("server_index"));
        js_to_cbpp<
            couchbase::core::operations::management::server_node_address>(
            cppObj.default_network, jsObj.Get("default_network"));
        js_to_cbpp<
            couchbase::core::operations::management::server_node_address>(
            cppObj.external_network, jsObj.Get("external_network"));
        js_to_cbpp<std::set<std::uint16_t>>(cppObj.active_vbuckets,
                                            jsObj.Get("active_vbuckets"));
        js_to_cbpp<std::set<std::uint16_t>>(cppObj.replica_vbuckets,
                                            jsObj.Get("replica_vbuckets"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::server_node &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("server_group_name",
                   cbpp_to_js<std::string>(env, cppObj.server_group_name));
        resObj.Set("server_index",
                   cbpp_to_js<std::size_t>(env, cppObj.server_index));
        resObj.Set(
            "default_network",
            cbpp_to_js<
                couchbase::core::operations::management::server_node_address>(
                env, cppObj.default_network));
        resObj.Set(
            "external_network",
            cbpp_to_js<
                couchbase::core::operations::management::server_node_address>(
                env, cppObj.external_network));
        resObj.Set("active_vbuckets", cbpp_to_js<std::set<std::uint16_t>>(
                                          env, cppObj.active_vbuckets));
        resObj.Set("replica_vbuckets", cbpp_to_js<std::set<std::uint16_t>>(
                                           env, cppObj.replica_vbuckets));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::server_group> {
    static inline couchbase::core::operations::management::server_group
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::server_group cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<
            std::vector<couchbase::core::operations::management::server_node>>(
            cppObj.nodes, jsObj.Get("nodes"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::server_group &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("nodes",
                   cbpp_to_js<std::vector<
                       couchbase::core::operations::management::server_node>>(
                       env, cppObj.nodes));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::bucket_describe_response> {
    static inline couchbase::core::operations::management::
        bucket_describe_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::bucket_describe_response
            cppObj;
        // ctx
        js_to_cbpp<couchbase::core::operations::management::
                       bucket_describe_response::bucket_info>(
            cppObj.info, jsObj.Get("info"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::bucket_describe_response
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("info",
                   cbpp_to_js<couchbase::core::operations::management::
                                  bucket_describe_response::bucket_info>(
                       env, cppObj.info));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        bucket_describe_response::bucket_info> {
    static inline couchbase::core::operations::management::
        bucket_describe_response::bucket_info
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::bucket_describe_response::
            bucket_info cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::string>(cppObj.uuid, jsObj.Get("uuid"));
        js_to_cbpp<std::size_t>(cppObj.number_of_nodes,
                                jsObj.Get("number_of_nodes"));
        js_to_cbpp<std::size_t>(cppObj.number_of_replicas,
                                jsObj.Get("number_of_replicas"));
        js_to_cbpp<std::vector<std::string>>(cppObj.bucket_capabilities,
                                             jsObj.Get("bucket_capabilities"));
        js_to_cbpp<
            std::map<std::string,
                     couchbase::core::operations::management::server_group>>(
            cppObj.server_groups, jsObj.Get("server_groups"));
        js_to_cbpp<
            couchbase::core::management::cluster::bucket_storage_backend>(
            cppObj.storage_backend, jsObj.Get("storage_backend"));
        js_to_cbpp<std::string>(cppObj.config_json, jsObj.Get("config_json"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             bucket_describe_response::bucket_info &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("uuid", cbpp_to_js<std::string>(env, cppObj.uuid));
        resObj.Set("number_of_nodes",
                   cbpp_to_js<std::size_t>(env, cppObj.number_of_nodes));
        resObj.Set("number_of_replicas",
                   cbpp_to_js<std::size_t>(env, cppObj.number_of_replicas));
        resObj.Set("bucket_capabilities", cbpp_to_js<std::vector<std::string>>(
                                              env, cppObj.bucket_capabilities));
        resObj.Set(
            "server_groups",
            cbpp_to_js<std::map<std::string, couchbase::core::operations::
                                                 management::server_group>>(
                env, cppObj.server_groups));
        resObj.Set(
            "storage_backend",
            cbpp_to_js<
                couchbase::core::management::cluster::bucket_storage_backend>(
                env, cppObj.storage_backend));
        resObj.Set("config_json",
                   cbpp_to_js<std::string>(env, cppObj.config_json));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::bucket_describe_request> {
    static inline couchbase::core::operations::management::
        bucket_describe_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::bucket_describe_request cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::bucket_describe_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        eventing_upsert_function_response> {
    static inline couchbase::core::operations::management::
        eventing_upsert_function_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            eventing_upsert_function_response cppObj;
        // ctx
        js_to_cbpp<std::optional<
            couchbase::core::operations::management::eventing_problem>>(
            cppObj.error, jsObj.Get("error"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             eventing_upsert_function_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set(
            "error",
            cbpp_to_js<std::optional<
                couchbase::core::operations::management::eventing_problem>>(
                env, cppObj.error));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::eventing_upsert_function_request> {
    static inline couchbase::core::operations::management::
        eventing_upsert_function_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            eventing_upsert_function_request cppObj;
        js_to_cbpp<couchbase::core::management::eventing::function>(
            cppObj.function, jsObj.Get("function"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             eventing_upsert_function_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("function",
                   cbpp_to_js<couchbase::core::management::eventing::function>(
                       env, cppObj.function));
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::view_index_get_all_response> {
    static inline couchbase::core::operations::management::
        view_index_get_all_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::view_index_get_all_response
            cppObj;
        // ctx
        js_to_cbpp<
            std::vector<couchbase::core::management::views::design_document>>(
            cppObj.design_documents, jsObj.Get("design_documents"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             view_index_get_all_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("design_documents",
                   cbpp_to_js<std::vector<
                       couchbase::core::management::views::design_document>>(
                       env, cppObj.design_documents));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::view_index_get_all_request> {
    static inline couchbase::core::operations::management::
        view_index_get_all_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::view_index_get_all_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        js_to_cbpp<couchbase::core::design_document_namespace>(cppObj.ns,
                                                               jsObj.Get("ns"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             view_index_get_all_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        resObj.Set("ns", cbpp_to_js<couchbase::core::design_document_namespace>(
                             env, cppObj.ns));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::bucket_get_response> {
    static inline couchbase::core::operations::management::bucket_get_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::bucket_get_response cppObj;
        // ctx
        js_to_cbpp<couchbase::core::management::cluster::bucket_settings>(
            cppObj.bucket, jsObj.Get("bucket"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::bucket_get_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set(
            "bucket",
            cbpp_to_js<couchbase::core::management::cluster::bucket_settings>(
                env, cppObj.bucket));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::bucket_get_request> {
    static inline couchbase::core::operations::management::bucket_get_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::bucket_get_request cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::bucket_get_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::bucket_update_response> {
    static inline couchbase::core::operations::management::
        bucket_update_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::bucket_update_response cppObj;
        // ctx
        js_to_cbpp<couchbase::core::management::cluster::bucket_settings>(
            cppObj.bucket, jsObj.Get("bucket"));
        js_to_cbpp<std::string>(cppObj.error_message,
                                jsObj.Get("error_message"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::bucket_update_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set(
            "bucket",
            cbpp_to_js<couchbase::core::management::cluster::bucket_settings>(
                env, cppObj.bucket));
        resObj.Set("error_message",
                   cbpp_to_js<std::string>(env, cppObj.error_message));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::bucket_update_request> {
    static inline couchbase::core::operations::management::bucket_update_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::bucket_update_request cppObj;
        js_to_cbpp<couchbase::core::management::cluster::bucket_settings>(
            cppObj.bucket, jsObj.Get("bucket"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::bucket_update_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set(
            "bucket",
            cbpp_to_js<couchbase::core::management::cluster::bucket_settings>(
                env, cppObj.bucket));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::bucket_drop_response> {
    static inline couchbase::core::operations::management::bucket_drop_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::bucket_drop_response cppObj;
        // ctx
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::bucket_drop_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::bucket_drop_request> {
    static inline couchbase::core::operations::management::bucket_drop_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::bucket_drop_request cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::bucket_drop_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::freeform_response> {
    static inline couchbase::core::operations::management::freeform_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::freeform_response cppObj;
        // ctx
        js_to_cbpp<std::uint32_t>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::map<std::string, std::string>>(cppObj.headers,
                                                       jsObj.Get("headers"));
        js_to_cbpp<std::string>(cppObj.body, jsObj.Get("body"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::freeform_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::uint32_t>(env, cppObj.status));
        resObj.Set("headers", cbpp_to_js<std::map<std::string, std::string>>(
                                  env, cppObj.headers));
        resObj.Set("body", cbpp_to_js<std::string>(env, cppObj.body));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::freeform_request> {
    static inline couchbase::core::operations::management::freeform_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::freeform_request cppObj;
        js_to_cbpp<couchbase::core::service_type>(cppObj.type,
                                                  jsObj.Get("type"));
        js_to_cbpp<std::string>(cppObj.method, jsObj.Get("method"));
        js_to_cbpp<std::string>(cppObj.path, jsObj.Get("path"));
        js_to_cbpp<std::map<std::string, std::string>>(cppObj.headers,
                                                       jsObj.Get("headers"));
        js_to_cbpp<std::string>(cppObj.body, jsObj.Get("body"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::freeform_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("type",
                   cbpp_to_js<couchbase::core::service_type>(env, cppObj.type));
        resObj.Set("method", cbpp_to_js<std::string>(env, cppObj.method));
        resObj.Set("path", cbpp_to_js<std::string>(env, cppObj.path));
        resObj.Set("headers", cbpp_to_js<std::map<std::string, std::string>>(
                                  env, cppObj.headers));
        resObj.Set("body", cbpp_to_js<std::string>(env, cppObj.body));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::scope_drop_response> {
    static inline couchbase::core::operations::management::scope_drop_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::scope_drop_response cppObj;
        // ctx
        js_to_cbpp<std::uint64_t>(cppObj.uid, jsObj.Get("uid"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::scope_drop_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("uid", cbpp_to_js<std::uint64_t>(env, cppObj.uid));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::scope_drop_request> {
    static inline couchbase::core::operations::management::scope_drop_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::scope_drop_request cppObj;
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        js_to_cbpp<std::string>(cppObj.scope_name, jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::scope_drop_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        resObj.Set("scope_name",
                   cbpp_to_js<std::string>(env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::view_index_upsert_response> {
    static inline couchbase::core::operations::management::
        view_index_upsert_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::view_index_upsert_response
            cppObj;
        // ctx
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             view_index_upsert_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::view_index_upsert_request> {
    static inline couchbase::core::operations::management::
        view_index_upsert_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::view_index_upsert_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        js_to_cbpp<couchbase::core::management::views::design_document>(
            cppObj.document, jsObj.Get("document"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::view_index_upsert_request
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        resObj.Set(
            "document",
            cbpp_to_js<couchbase::core::management::views::design_document>(
                env, cppObj.document));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::user_get_all_response> {
    static inline couchbase::core::operations::management::user_get_all_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::user_get_all_response cppObj;
        // ctx
        js_to_cbpp<
            std::vector<couchbase::core::management::rbac::user_and_metadata>>(
            cppObj.users, jsObj.Get("users"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::user_get_all_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("users",
                   cbpp_to_js<std::vector<
                       couchbase::core::management::rbac::user_and_metadata>>(
                       env, cppObj.users));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::user_get_all_request> {
    static inline couchbase::core::operations::management::user_get_all_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::user_get_all_request cppObj;
        js_to_cbpp<couchbase::core::management::rbac::auth_domain>(
            cppObj.domain, jsObj.Get("domain"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::user_get_all_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("domain",
                   cbpp_to_js<couchbase::core::management::rbac::auth_domain>(
                       env, cppObj.domain));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::scope_create_response> {
    static inline couchbase::core::operations::management::scope_create_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::scope_create_response cppObj;
        // ctx
        js_to_cbpp<std::uint64_t>(cppObj.uid, jsObj.Get("uid"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::scope_create_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("uid", cbpp_to_js<std::uint64_t>(env, cppObj.uid));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::scope_create_request> {
    static inline couchbase::core::operations::management::scope_create_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::scope_create_request cppObj;
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        js_to_cbpp<std::string>(cppObj.scope_name, jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::scope_create_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        resObj.Set("scope_name",
                   cbpp_to_js<std::string>(env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::eventing_get_function_response> {
    static inline couchbase::core::operations::management::
        eventing_get_function_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::eventing_get_function_response
            cppObj;
        // ctx
        js_to_cbpp<couchbase::core::management::eventing::function>(
            cppObj.function, jsObj.Get("function"));
        js_to_cbpp<std::optional<
            couchbase::core::operations::management::eventing_problem>>(
            cppObj.error, jsObj.Get("error"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             eventing_get_function_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("function",
                   cbpp_to_js<couchbase::core::management::eventing::function>(
                       env, cppObj.function));
        resObj.Set(
            "error",
            cbpp_to_js<std::optional<
                couchbase::core::operations::management::eventing_problem>>(
                env, cppObj.error));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::eventing_get_function_request> {
    static inline couchbase::core::operations::management::
        eventing_get_function_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::eventing_get_function_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             eventing_get_function_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::view_index_drop_response> {
    static inline couchbase::core::operations::management::
        view_index_drop_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::view_index_drop_response
            cppObj;
        // ctx
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::view_index_drop_response
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::view_index_drop_request> {
    static inline couchbase::core::operations::management::
        view_index_drop_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::view_index_drop_request cppObj;
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        js_to_cbpp<std::string>(cppObj.document_name,
                                jsObj.Get("document_name"));
        js_to_cbpp<couchbase::core::design_document_namespace>(cppObj.ns,
                                                               jsObj.Get("ns"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::view_index_drop_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        resObj.Set("document_name",
                   cbpp_to_js<std::string>(env, cppObj.document_name));
        resObj.Set("ns", cbpp_to_js<couchbase::core::design_document_namespace>(
                             env, cppObj.ns));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::analytics_link_replace_response> {
    static inline couchbase::core::operations::management::
        analytics_link_replace_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::analytics_link_replace_response
            cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::vector<couchbase::core::operations::management::
                                   analytics_link_replace_response::problem>>(
            cppObj.errors, jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_link_replace_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "errors",
            cbpp_to_js<
                std::vector<couchbase::core::operations::management::
                                analytics_link_replace_response::problem>>(
                env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        analytics_link_replace_response::problem> {
    static inline couchbase::core::operations::management::
        analytics_link_replace_response::problem
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            analytics_link_replace_response::problem cppObj;
        js_to_cbpp<std::uint32_t>(cppObj.code, jsObj.Get("code"));
        js_to_cbpp<std::string>(cppObj.message, jsObj.Get("message"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_link_replace_response::problem &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("code", cbpp_to_js<std::uint32_t>(env, cppObj.code));
        resObj.Set("message", cbpp_to_js<std::string>(env, cppObj.message));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        analytics_link_disconnect_response> {
    static inline couchbase::core::operations::management::
        analytics_link_disconnect_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            analytics_link_disconnect_response cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<
            std::vector<couchbase::core::operations::management::
                            analytics_link_disconnect_response::problem>>(
            cppObj.errors, jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_link_disconnect_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "errors",
            cbpp_to_js<
                std::vector<couchbase::core::operations::management::
                                analytics_link_disconnect_response::problem>>(
                env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        analytics_link_disconnect_response::problem> {
    static inline couchbase::core::operations::management::
        analytics_link_disconnect_response::problem
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            analytics_link_disconnect_response::problem cppObj;
        js_to_cbpp<std::uint32_t>(cppObj.code, jsObj.Get("code"));
        js_to_cbpp<std::string>(cppObj.message, jsObj.Get("message"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::
              analytics_link_disconnect_response::problem &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("code", cbpp_to_js<std::uint32_t>(env, cppObj.code));
        resObj.Set("message", cbpp_to_js<std::string>(env, cppObj.message));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        analytics_link_disconnect_request> {
    static inline couchbase::core::operations::management::
        analytics_link_disconnect_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            analytics_link_disconnect_request cppObj;
        js_to_cbpp<std::string>(cppObj.dataverse_name,
                                jsObj.Get("dataverse_name"));
        js_to_cbpp<std::string>(cppObj.link_name, jsObj.Get("link_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_link_disconnect_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("dataverse_name",
                   cbpp_to_js<std::string>(env, cppObj.dataverse_name));
        resObj.Set("link_name", cbpp_to_js<std::string>(env, cppObj.link_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::user_upsert_response> {
    static inline couchbase::core::operations::management::user_upsert_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::user_upsert_response cppObj;
        // ctx
        js_to_cbpp<std::vector<std::string>>(cppObj.errors,
                                             jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::user_upsert_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("errors",
                   cbpp_to_js<std::vector<std::string>>(env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::user_upsert_request> {
    static inline couchbase::core::operations::management::user_upsert_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::user_upsert_request cppObj;
        js_to_cbpp<couchbase::core::management::rbac::auth_domain>(
            cppObj.domain, jsObj.Get("domain"));
        js_to_cbpp<couchbase::core::management::rbac::user>(cppObj.user,
                                                            jsObj.Get("user"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::user_upsert_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("domain",
                   cbpp_to_js<couchbase::core::management::rbac::auth_domain>(
                       env, cppObj.domain));
        resObj.Set("user", cbpp_to_js<couchbase::core::management::rbac::user>(
                               env, cppObj.user));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::eventing_get_status_response> {
    static inline couchbase::core::operations::management::
        eventing_get_status_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::eventing_get_status_response
            cppObj;
        // ctx
        js_to_cbpp<couchbase::core::management::eventing::status>(
            cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::optional<
            couchbase::core::operations::management::eventing_problem>>(
            cppObj.error, jsObj.Get("error"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             eventing_get_status_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status",
                   cbpp_to_js<couchbase::core::management::eventing::status>(
                       env, cppObj.status));
        resObj.Set(
            "error",
            cbpp_to_js<std::optional<
                couchbase::core::operations::management::eventing_problem>>(
                env, cppObj.error));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::eventing_get_status_request> {
    static inline couchbase::core::operations::management::
        eventing_get_status_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::eventing_get_status_request
            cppObj;
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             eventing_get_status_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        eventing_get_all_functions_response> {
    static inline couchbase::core::operations::management::
        eventing_get_all_functions_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            eventing_get_all_functions_response cppObj;
        // ctx
        js_to_cbpp<
            std::vector<couchbase::core::management::eventing::function>>(
            cppObj.functions, jsObj.Get("functions"));
        js_to_cbpp<std::optional<
            couchbase::core::operations::management::eventing_problem>>(
            cppObj.error, jsObj.Get("error"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             eventing_get_all_functions_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set(
            "functions",
            cbpp_to_js<
                std::vector<couchbase::core::management::eventing::function>>(
                env, cppObj.functions));
        resObj.Set(
            "error",
            cbpp_to_js<std::optional<
                couchbase::core::operations::management::eventing_problem>>(
                env, cppObj.error));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        eventing_get_all_functions_request> {
    static inline couchbase::core::operations::management::
        eventing_get_all_functions_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            eventing_get_all_functions_request cppObj;
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             eventing_get_all_functions_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::analytics_index_create_response> {
    static inline couchbase::core::operations::management::
        analytics_index_create_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::analytics_index_create_response
            cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::vector<
            couchbase::core::operations::management::analytics_problem>>(
            cppObj.errors, jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_index_create_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "errors",
            cbpp_to_js<std::vector<
                couchbase::core::operations::management::analytics_problem>>(
                env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::analytics_index_create_request> {
    static inline couchbase::core::operations::management::
        analytics_index_create_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::analytics_index_create_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.dataverse_name,
                                jsObj.Get("dataverse_name"));
        js_to_cbpp<std::string>(cppObj.dataset_name, jsObj.Get("dataset_name"));
        js_to_cbpp<std::string>(cppObj.index_name, jsObj.Get("index_name"));
        js_to_cbpp<std::map<std::string, std::string>>(cppObj.fields,
                                                       jsObj.Get("fields"));
        js_to_cbpp<bool>(cppObj.ignore_if_exists,
                         jsObj.Get("ignore_if_exists"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_index_create_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("dataverse_name",
                   cbpp_to_js<std::string>(env, cppObj.dataverse_name));
        resObj.Set("dataset_name",
                   cbpp_to_js<std::string>(env, cppObj.dataset_name));
        resObj.Set("index_name",
                   cbpp_to_js<std::string>(env, cppObj.index_name));
        resObj.Set("fields", cbpp_to_js<std::map<std::string, std::string>>(
                                 env, cppObj.fields));
        resObj.Set("ignore_if_exists",
                   cbpp_to_js<bool>(env, cppObj.ignore_if_exists));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::scope_get_all_response> {
    static inline couchbase::core::operations::management::
        scope_get_all_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::scope_get_all_response cppObj;
        // ctx
        js_to_cbpp<couchbase::core::topology::collections_manifest>(
            cppObj.manifest, jsObj.Get("manifest"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::scope_get_all_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("manifest",
                   cbpp_to_js<couchbase::core::topology::collections_manifest>(
                       env, cppObj.manifest));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::scope_get_all_request> {
    static inline couchbase::core::operations::management::scope_get_all_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::scope_get_all_request cppObj;
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::scope_get_all_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::user_get_response> {
    static inline couchbase::core::operations::management::user_get_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::user_get_response cppObj;
        // ctx
        js_to_cbpp<couchbase::core::management::rbac::user_and_metadata>(
            cppObj.user, jsObj.Get("user"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::user_get_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set(
            "user",
            cbpp_to_js<couchbase::core::management::rbac::user_and_metadata>(
                env, cppObj.user));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::user_get_request> {
    static inline couchbase::core::operations::management::user_get_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::user_get_request cppObj;
        js_to_cbpp<std::string>(cppObj.username, jsObj.Get("username"));
        js_to_cbpp<couchbase::core::management::rbac::auth_domain>(
            cppObj.domain, jsObj.Get("domain"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::user_get_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("username", cbpp_to_js<std::string>(env, cppObj.username));
        resObj.Set("domain",
                   cbpp_to_js<couchbase::core::management::rbac::auth_domain>(
                       env, cppObj.domain));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::search_index_drop_response> {
    static inline couchbase::core::operations::management::
        search_index_drop_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::search_index_drop_response
            cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::string>(cppObj.error, jsObj.Get("error"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             search_index_drop_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set("error", cbpp_to_js<std::string>(env, cppObj.error));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::search_index_drop_request> {
    static inline couchbase::core::operations::management::
        search_index_drop_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::search_index_drop_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.index_name, jsObj.Get("index_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::search_index_drop_request
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("index_name",
                   cbpp_to_js<std::string>(env, cppObj.index_name));
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        search_index_control_plan_freeze_response> {
    static inline couchbase::core::operations::management::
        search_index_control_plan_freeze_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            search_index_control_plan_freeze_response cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::string>(cppObj.error, jsObj.Get("error"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             search_index_control_plan_freeze_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set("error", cbpp_to_js<std::string>(env, cppObj.error));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        search_index_control_plan_freeze_request> {
    static inline couchbase::core::operations::management::
        search_index_control_plan_freeze_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            search_index_control_plan_freeze_request cppObj;
        js_to_cbpp<std::string>(cppObj.index_name, jsObj.Get("index_name"));
        js_to_cbpp<bool>(cppObj.freeze, jsObj.Get("freeze"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             search_index_control_plan_freeze_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("index_name",
                   cbpp_to_js<std::string>(env, cppObj.index_name));
        resObj.Set("freeze", cbpp_to_js<bool>(env, cppObj.freeze));
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::search_get_stats_response> {
    static inline couchbase::core::operations::management::
        search_get_stats_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::search_get_stats_response
            cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.stats, jsObj.Get("stats"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::search_get_stats_response
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("stats", cbpp_to_js<std::string>(env, cppObj.stats));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::search_get_stats_request> {
    static inline couchbase::core::operations::management::
        search_get_stats_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::search_get_stats_request
            cppObj;
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::search_get_stats_request
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::user_drop_response> {
    static inline couchbase::core::operations::management::user_drop_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::user_drop_response cppObj;
        // ctx
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::user_drop_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::user_drop_request> {
    static inline couchbase::core::operations::management::user_drop_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::user_drop_request cppObj;
        js_to_cbpp<std::string>(cppObj.username, jsObj.Get("username"));
        js_to_cbpp<couchbase::core::management::rbac::auth_domain>(
            cppObj.domain, jsObj.Get("domain"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::user_drop_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("username", cbpp_to_js<std::string>(env, cppObj.username));
        resObj.Set("domain",
                   cbpp_to_js<couchbase::core::management::rbac::auth_domain>(
                       env, cppObj.domain));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        analytics_dataverse_create_response> {
    static inline couchbase::core::operations::management::
        analytics_dataverse_create_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            analytics_dataverse_create_response cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::vector<
            couchbase::core::operations::management::analytics_problem>>(
            cppObj.errors, jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_dataverse_create_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "errors",
            cbpp_to_js<std::vector<
                couchbase::core::operations::management::analytics_problem>>(
                env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        analytics_dataverse_create_request> {
    static inline couchbase::core::operations::management::
        analytics_dataverse_create_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            analytics_dataverse_create_request cppObj;
        js_to_cbpp<std::string>(cppObj.dataverse_name,
                                jsObj.Get("dataverse_name"));
        js_to_cbpp<bool>(cppObj.ignore_if_exists,
                         jsObj.Get("ignore_if_exists"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_dataverse_create_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("dataverse_name",
                   cbpp_to_js<std::string>(env, cppObj.dataverse_name));
        resObj.Set("ignore_if_exists",
                   cbpp_to_js<bool>(env, cppObj.ignore_if_exists));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        search_index_control_query_response> {
    static inline couchbase::core::operations::management::
        search_index_control_query_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            search_index_control_query_response cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::string>(cppObj.error, jsObj.Get("error"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             search_index_control_query_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set("error", cbpp_to_js<std::string>(env, cppObj.error));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        search_index_control_query_request> {
    static inline couchbase::core::operations::management::
        search_index_control_query_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            search_index_control_query_request cppObj;
        js_to_cbpp<std::string>(cppObj.index_name, jsObj.Get("index_name"));
        js_to_cbpp<bool>(cppObj.allow, jsObj.Get("allow"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             search_index_control_query_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("index_name",
                   cbpp_to_js<std::string>(env, cppObj.index_name));
        resObj.Set("allow", cbpp_to_js<bool>(env, cppObj.allow));
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::role_get_all_response> {
    static inline couchbase::core::operations::management::role_get_all_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::role_get_all_response cppObj;
        // ctx
        js_to_cbpp<std::vector<
            couchbase::core::management::rbac::role_and_description>>(
            cppObj.roles, jsObj.Get("roles"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::role_get_all_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set(
            "roles",
            cbpp_to_js<std::vector<
                couchbase::core::management::rbac::role_and_description>>(
                env, cppObj.roles));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::role_get_all_request> {
    static inline couchbase::core::operations::management::role_get_all_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::role_get_all_request cppObj;
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::role_get_all_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::group_get_all_response> {
    static inline couchbase::core::operations::management::
        group_get_all_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::group_get_all_response cppObj;
        // ctx
        js_to_cbpp<std::vector<couchbase::core::management::rbac::group>>(
            cppObj.groups, jsObj.Get("groups"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::group_get_all_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set(
            "groups",
            cbpp_to_js<std::vector<couchbase::core::management::rbac::group>>(
                env, cppObj.groups));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::group_get_all_request> {
    static inline couchbase::core::operations::management::group_get_all_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::group_get_all_request cppObj;
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::group_get_all_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::analytics_link_create_response> {
    static inline couchbase::core::operations::management::
        analytics_link_create_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::analytics_link_create_response
            cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::vector<couchbase::core::operations::management::
                                   analytics_link_create_response::problem>>(
            cppObj.errors, jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_link_create_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "errors",
            cbpp_to_js<
                std::vector<couchbase::core::operations::management::
                                analytics_link_create_response::problem>>(
                env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        analytics_link_create_response::problem> {
    static inline couchbase::core::operations::management::
        analytics_link_create_response::problem
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            analytics_link_create_response::problem cppObj;
        js_to_cbpp<std::uint32_t>(cppObj.code, jsObj.Get("code"));
        js_to_cbpp<std::string>(cppObj.message, jsObj.Get("message"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_link_create_response::problem &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("code", cbpp_to_js<std::uint32_t>(env, cppObj.code));
        resObj.Set("message", cbpp_to_js<std::string>(env, cppObj.message));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::eventing_drop_function_response> {
    static inline couchbase::core::operations::management::
        eventing_drop_function_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::eventing_drop_function_response
            cppObj;
        // ctx
        js_to_cbpp<std::optional<
            couchbase::core::operations::management::eventing_problem>>(
            cppObj.error, jsObj.Get("error"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             eventing_drop_function_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set(
            "error",
            cbpp_to_js<std::optional<
                couchbase::core::operations::management::eventing_problem>>(
                env, cppObj.error));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::eventing_drop_function_request> {
    static inline couchbase::core::operations::management::
        eventing_drop_function_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::eventing_drop_function_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             eventing_drop_function_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::collection_drop_response> {
    static inline couchbase::core::operations::management::
        collection_drop_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::collection_drop_response
            cppObj;
        // ctx
        js_to_cbpp<std::uint64_t>(cppObj.uid, jsObj.Get("uid"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::collection_drop_response
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("uid", cbpp_to_js<std::uint64_t>(env, cppObj.uid));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::collection_drop_request> {
    static inline couchbase::core::operations::management::
        collection_drop_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::collection_drop_request cppObj;
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        js_to_cbpp<std::string>(cppObj.scope_name, jsObj.Get("scope_name"));
        js_to_cbpp<std::string>(cppObj.collection_name,
                                jsObj.Get("collection_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::collection_drop_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        resObj.Set("scope_name",
                   cbpp_to_js<std::string>(env, cppObj.scope_name));
        resObj.Set("collection_name",
                   cbpp_to_js<std::string>(env, cppObj.collection_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::analytics_problem> {
    static inline couchbase::core::operations::management::analytics_problem
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::analytics_problem cppObj;
        js_to_cbpp<std::uint32_t>(cppObj.code, jsObj.Get("code"));
        js_to_cbpp<std::string>(cppObj.message, jsObj.Get("message"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::analytics_problem
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("code", cbpp_to_js<std::uint32_t>(env, cppObj.code));
        resObj.Set("message", cbpp_to_js<std::string>(env, cppObj.message));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        search_index_control_ingest_response> {
    static inline couchbase::core::operations::management::
        search_index_control_ingest_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            search_index_control_ingest_response cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::string>(cppObj.error, jsObj.Get("error"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             search_index_control_ingest_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set("error", cbpp_to_js<std::string>(env, cppObj.error));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        search_index_control_ingest_request> {
    static inline couchbase::core::operations::management::
        search_index_control_ingest_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            search_index_control_ingest_request cppObj;
        js_to_cbpp<std::string>(cppObj.index_name, jsObj.Get("index_name"));
        js_to_cbpp<bool>(cppObj.pause, jsObj.Get("pause"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             search_index_control_ingest_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("index_name",
                   cbpp_to_js<std::string>(env, cppObj.index_name));
        resObj.Set("pause", cbpp_to_js<bool>(env, cppObj.pause));
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        eventing_deploy_function_response> {
    static inline couchbase::core::operations::management::
        eventing_deploy_function_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            eventing_deploy_function_response cppObj;
        // ctx
        js_to_cbpp<std::optional<
            couchbase::core::operations::management::eventing_problem>>(
            cppObj.error, jsObj.Get("error"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             eventing_deploy_function_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set(
            "error",
            cbpp_to_js<std::optional<
                couchbase::core::operations::management::eventing_problem>>(
                env, cppObj.error));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::eventing_deploy_function_request> {
    static inline couchbase::core::operations::management::
        eventing_deploy_function_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            eventing_deploy_function_request cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             eventing_deploy_function_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::group_get_response> {
    static inline couchbase::core::operations::management::group_get_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::group_get_response cppObj;
        // ctx
        js_to_cbpp<couchbase::core::management::rbac::group>(
            cppObj.group, jsObj.Get("group"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::group_get_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("group",
                   cbpp_to_js<couchbase::core::management::rbac::group>(
                       env, cppObj.group));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::group_get_request> {
    static inline couchbase::core::operations::management::group_get_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::group_get_request cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::group_get_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::view_index_get_response> {
    static inline couchbase::core::operations::management::
        view_index_get_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::view_index_get_response cppObj;
        // ctx
        js_to_cbpp<couchbase::core::management::views::design_document>(
            cppObj.document, jsObj.Get("document"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::view_index_get_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set(
            "document",
            cbpp_to_js<couchbase::core::management::views::design_document>(
                env, cppObj.document));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::view_index_get_request> {
    static inline couchbase::core::operations::management::
        view_index_get_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::view_index_get_request cppObj;
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        js_to_cbpp<std::string>(cppObj.document_name,
                                jsObj.Get("document_name"));
        js_to_cbpp<couchbase::core::design_document_namespace>(cppObj.ns,
                                                               jsObj.Get("ns"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::view_index_get_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        resObj.Set("document_name",
                   cbpp_to_js<std::string>(env, cppObj.document_name));
        resObj.Set("ns", cbpp_to_js<couchbase::core::design_document_namespace>(
                             env, cppObj.ns));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::bucket_create_response> {
    static inline couchbase::core::operations::management::
        bucket_create_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::bucket_create_response cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.error_message,
                                jsObj.Get("error_message"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::bucket_create_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("error_message",
                   cbpp_to_js<std::string>(env, cppObj.error_message));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::bucket_create_request> {
    static inline couchbase::core::operations::management::bucket_create_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::bucket_create_request cppObj;
        js_to_cbpp<couchbase::core::management::cluster::bucket_settings>(
            cppObj.bucket, jsObj.Get("bucket"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::bucket_create_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set(
            "bucket",
            cbpp_to_js<couchbase::core::management::cluster::bucket_settings>(
                env, cppObj.bucket));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::analytics_dataset_drop_response> {
    static inline couchbase::core::operations::management::
        analytics_dataset_drop_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::analytics_dataset_drop_response
            cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::vector<
            couchbase::core::operations::management::analytics_problem>>(
            cppObj.errors, jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_dataset_drop_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "errors",
            cbpp_to_js<std::vector<
                couchbase::core::operations::management::analytics_problem>>(
                env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::analytics_dataset_drop_request> {
    static inline couchbase::core::operations::management::
        analytics_dataset_drop_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::analytics_dataset_drop_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.dataverse_name,
                                jsObj.Get("dataverse_name"));
        js_to_cbpp<std::string>(cppObj.dataset_name, jsObj.Get("dataset_name"));
        js_to_cbpp<bool>(cppObj.ignore_if_does_not_exist,
                         jsObj.Get("ignore_if_does_not_exist"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_dataset_drop_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("dataverse_name",
                   cbpp_to_js<std::string>(env, cppObj.dataverse_name));
        resObj.Set("dataset_name",
                   cbpp_to_js<std::string>(env, cppObj.dataset_name));
        resObj.Set("ignore_if_does_not_exist",
                   cbpp_to_js<bool>(env, cppObj.ignore_if_does_not_exist));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::group_drop_response> {
    static inline couchbase::core::operations::management::group_drop_response
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::group_drop_response cppObj;
        // ctx
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::group_drop_response
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::group_drop_request> {
    static inline couchbase::core::operations::management::group_drop_request
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::group_drop_request cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::operations::management::group_drop_request
              &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::search_index_get_response> {
    static inline couchbase::core::operations::management::
        search_index_get_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::search_index_get_response
            cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<couchbase::core::management::search::index>(
            cppObj.index, jsObj.Get("index"));
        js_to_cbpp<std::string>(cppObj.error, jsObj.Get("error"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::search_index_get_response
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set("index",
                   cbpp_to_js<couchbase::core::management::search::index>(
                       env, cppObj.index));
        resObj.Set("error", cbpp_to_js<std::string>(env, cppObj.error));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::search_index_get_request> {
    static inline couchbase::core::operations::management::
        search_index_get_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::search_index_get_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.index_name, jsObj.Get("index_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::search_index_get_request
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("index_name",
                   cbpp_to_js<std::string>(env, cppObj.index_name));
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        query_index_get_all_deferred_response> {
    static inline couchbase::core::operations::management::
        query_index_get_all_deferred_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            query_index_get_all_deferred_response cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::vector<std::string>>(cppObj.index_names,
                                             jsObj.Get("index_names"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             query_index_get_all_deferred_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set("index_names", cbpp_to_js<std::vector<std::string>>(
                                      env, cppObj.index_names));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        query_index_get_all_deferred_request> {
    static inline couchbase::core::operations::management::
        query_index_get_all_deferred_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            query_index_get_all_deferred_request cppObj;
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        js_to_cbpp<std::string>(cppObj.scope_name, jsObj.Get("scope_name"));
        js_to_cbpp<std::string>(cppObj.collection_name,
                                jsObj.Get("collection_name"));
        js_to_cbpp<couchbase::core::query_context>(cppObj.query_ctx,
                                                   jsObj.Get("query_ctx"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             query_index_get_all_deferred_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        resObj.Set("scope_name",
                   cbpp_to_js<std::string>(env, cppObj.scope_name));
        resObj.Set("collection_name",
                   cbpp_to_js<std::string>(env, cppObj.collection_name));
        resObj.Set("query_ctx", cbpp_to_js<couchbase::core::query_context>(
                                    env, cppObj.query_ctx));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::query_index_build_response> {
    static inline couchbase::core::operations::management::
        query_index_build_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::query_index_build_response
            cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::vector<couchbase::core::operations::management::
                                   query_index_build_response::query_problem>>(
            cppObj.errors, jsObj.Get("errors"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             query_index_build_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "errors",
            cbpp_to_js<
                std::vector<couchbase::core::operations::management::
                                query_index_build_response::query_problem>>(
                env, cppObj.errors));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        query_index_build_response::query_problem> {
    static inline couchbase::core::operations::management::
        query_index_build_response::query_problem
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::query_index_build_response::
            query_problem cppObj;
        js_to_cbpp<std::uint64_t>(cppObj.code, jsObj.Get("code"));
        js_to_cbpp<std::string>(cppObj.message, jsObj.Get("message"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             query_index_build_response::query_problem &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("code", cbpp_to_js<std::uint64_t>(env, cppObj.code));
        resObj.Set("message", cbpp_to_js<std::string>(env, cppObj.message));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::query_index_build_request> {
    static inline couchbase::core::operations::management::
        query_index_build_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::query_index_build_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.bucket_name, jsObj.Get("bucket_name"));
        js_to_cbpp<std::string>(cppObj.scope_name, jsObj.Get("scope_name"));
        js_to_cbpp<std::string>(cppObj.collection_name,
                                jsObj.Get("collection_name"));
        js_to_cbpp<couchbase::core::query_context>(cppObj.query_ctx,
                                                   jsObj.Get("query_ctx"));
        js_to_cbpp<std::vector<std::string>>(cppObj.index_names,
                                             jsObj.Get("index_names"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value to_js(
        Napi::Env env,
        const couchbase::core::operations::management::query_index_build_request
            &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("bucket_name",
                   cbpp_to_js<std::string>(env, cppObj.bucket_name));
        resObj.Set("scope_name",
                   cbpp_to_js<std::string>(env, cppObj.scope_name));
        resObj.Set("collection_name",
                   cbpp_to_js<std::string>(env, cppObj.collection_name));
        resObj.Set("query_ctx", cbpp_to_js<couchbase::core::query_context>(
                                    env, cppObj.query_ctx));
        resObj.Set("index_names", cbpp_to_js<std::vector<std::string>>(
                                      env, cppObj.index_names));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        eventing_undeploy_function_response> {
    static inline couchbase::core::operations::management::
        eventing_undeploy_function_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            eventing_undeploy_function_response cppObj;
        // ctx
        js_to_cbpp<std::optional<
            couchbase::core::operations::management::eventing_problem>>(
            cppObj.error, jsObj.Get("error"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             eventing_undeploy_function_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set(
            "error",
            cbpp_to_js<std::optional<
                couchbase::core::operations::management::eventing_problem>>(
                env, cppObj.error));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        eventing_undeploy_function_request> {
    static inline couchbase::core::operations::management::
        eventing_undeploy_function_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            eventing_undeploy_function_request cppObj;
        js_to_cbpp<std::string>(cppObj.name, jsObj.Get("name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             eventing_undeploy_function_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("name", cbpp_to_js<std::string>(env, cppObj.name));
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        search_index_get_documents_count_response> {
    static inline couchbase::core::operations::management::
        search_index_get_documents_count_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            search_index_get_documents_count_response cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::uint64_t>(cppObj.count, jsObj.Get("count"));
        js_to_cbpp<std::string>(cppObj.error, jsObj.Get("error"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             search_index_get_documents_count_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set("count", cbpp_to_js<std::uint64_t>(env, cppObj.count));
        resObj.Set("error", cbpp_to_js<std::string>(env, cppObj.error));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        search_index_get_documents_count_request> {
    static inline couchbase::core::operations::management::
        search_index_get_documents_count_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            search_index_get_documents_count_request cppObj;
        js_to_cbpp<std::string>(cppObj.index_name, jsObj.Get("index_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.bucket_name,
                                               jsObj.Get("bucket_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.scope_name,
                                               jsObj.Get("scope_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             search_index_get_documents_count_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("index_name",
                   cbpp_to_js<std::string>(env, cppObj.index_name));
        resObj.Set("bucket_name", cbpp_to_js<std::optional<std::string>>(
                                      env, cppObj.bucket_name));
        resObj.Set("scope_name", cbpp_to_js<std::optional<std::string>>(
                                     env, cppObj.scope_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::analytics_link_get_all_response> {
    static inline couchbase::core::operations::management::
        analytics_link_get_all_response
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::analytics_link_get_all_response
            cppObj;
        // ctx
        js_to_cbpp<std::string>(cppObj.status, jsObj.Get("status"));
        js_to_cbpp<std::vector<couchbase::core::operations::management::
                                   analytics_link_get_all_response::problem>>(
            cppObj.errors, jsObj.Get("errors"));
        js_to_cbpp<std::vector<
            couchbase::core::management::analytics::couchbase_remote_link>>(
            cppObj.couchbase, jsObj.Get("couchbase"));
        js_to_cbpp<std::vector<
            couchbase::core::management::analytics::s3_external_link>>(
            cppObj.s3, jsObj.Get("s3"));
        js_to_cbpp<std::vector<
            couchbase::core::management::analytics::azure_blob_external_link>>(
            cppObj.azure_blob, jsObj.Get("azure_blob"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_link_get_all_response &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        // ctx
        resObj.Set("status", cbpp_to_js<std::string>(env, cppObj.status));
        resObj.Set(
            "errors",
            cbpp_to_js<
                std::vector<couchbase::core::operations::management::
                                analytics_link_get_all_response::problem>>(
                env, cppObj.errors));
        resObj.Set(
            "couchbase",
            cbpp_to_js<std::vector<
                couchbase::core::management::analytics::couchbase_remote_link>>(
                env, cppObj.couchbase));
        resObj.Set(
            "s3",
            cbpp_to_js<std::vector<
                couchbase::core::management::analytics::s3_external_link>>(
                env, cppObj.s3));
        resObj.Set(
            "azure_blob",
            cbpp_to_js<std::vector<couchbase::core::management::analytics::
                                       azure_blob_external_link>>(
                env, cppObj.azure_blob));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::operations::management::
                        analytics_link_get_all_response::problem> {
    static inline couchbase::core::operations::management::
        analytics_link_get_all_response::problem
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::
            analytics_link_get_all_response::problem cppObj;
        js_to_cbpp<std::uint32_t>(cppObj.code, jsObj.Get("code"));
        js_to_cbpp<std::string>(cppObj.message, jsObj.Get("message"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_link_get_all_response::problem &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("code", cbpp_to_js<std::uint32_t>(env, cppObj.code));
        resObj.Set("message", cbpp_to_js<std::string>(env, cppObj.message));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<
    couchbase::core::operations::management::analytics_link_get_all_request> {
    static inline couchbase::core::operations::management::
        analytics_link_get_all_request
        from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::operations::management::analytics_link_get_all_request
            cppObj;
        js_to_cbpp<std::string>(cppObj.link_type, jsObj.Get("link_type"));
        js_to_cbpp<std::string>(cppObj.link_name, jsObj.Get("link_name"));
        js_to_cbpp<std::string>(cppObj.dataverse_name,
                                jsObj.Get("dataverse_name"));
        js_to_cbpp<std::optional<std::string>>(cppObj.client_context_id,
                                               jsObj.Get("client_context_id"));
        js_to_cbpp<std::optional<std::chrono::milliseconds>>(
            cppObj.timeout, jsObj.Get("timeout"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::operations::management::
                             analytics_link_get_all_request &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("link_type", cbpp_to_js<std::string>(env, cppObj.link_type));
        resObj.Set("link_name", cbpp_to_js<std::string>(env, cppObj.link_name));
        resObj.Set("dataverse_name",
                   cbpp_to_js<std::string>(env, cppObj.dataverse_name));
        resObj.Set("client_context_id", cbpp_to_js<std::optional<std::string>>(
                                            env, cppObj.client_context_id));
        resObj.Set("timeout",
                   cbpp_to_js<std::optional<std::chrono::milliseconds>>(
                       env, cppObj.timeout));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::impl::subdoc::command> {
    static inline couchbase::core::impl::subdoc::command
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::impl::subdoc::command cppObj;
        js_to_cbpp<couchbase::core::impl::subdoc::opcode>(cppObj.opcode_,
                                                          jsObj.Get("opcode_"));
        js_to_cbpp<std::string>(cppObj.path_, jsObj.Get("path_"));
        js_to_cbpp<std::vector<std::byte>>(cppObj.value_, jsObj.Get("value_"));
        js_to_cbpp<std::byte>(cppObj.flags_, jsObj.Get("flags_"));
        js_to_cbpp<std::size_t>(cppObj.original_index_,
                                jsObj.Get("original_index_"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::impl::subdoc::command &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("opcode_", cbpp_to_js<couchbase::core::impl::subdoc::opcode>(
                                  env, cppObj.opcode_));
        resObj.Set("path_", cbpp_to_js<std::string>(env, cppObj.path_));
        resObj.Set("value_",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value_));
        resObj.Set("flags_", cbpp_to_js<std::byte>(env, cppObj.flags_));
        resObj.Set("original_index_",
                   cbpp_to_js<std::size_t>(env, cppObj.original_index_));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::scan_term> {
    static inline couchbase::core::scan_term from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::scan_term cppObj;
        js_to_cbpp<std::string>(cppObj.term, jsObj.Get("term"));
        js_to_cbpp<bool>(cppObj.exclusive, jsObj.Get("exclusive"));
        return cppObj;
    }
    static inline Napi::Value to_js(Napi::Env env,
                                    const couchbase::core::scan_term &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("term", cbpp_to_js<std::string>(env, cppObj.term));
        resObj.Set("exclusive", cbpp_to_js<bool>(env, cppObj.exclusive));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::range_scan> {
    static inline couchbase::core::range_scan from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::range_scan cppObj;
        js_to_cbpp<std::optional<couchbase::core::scan_term>>(
            cppObj.from, jsObj.Get("from"));
        js_to_cbpp<std::optional<couchbase::core::scan_term>>(cppObj.to,
                                                              jsObj.Get("to"));
        return cppObj;
    }
    static inline Napi::Value to_js(Napi::Env env,
                                    const couchbase::core::range_scan &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("from",
                   cbpp_to_js<std::optional<couchbase::core::scan_term>>(
                       env, cppObj.from));
        resObj.Set("to", cbpp_to_js<std::optional<couchbase::core::scan_term>>(
                             env, cppObj.to));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::prefix_scan> {
    static inline couchbase::core::prefix_scan from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::prefix_scan cppObj;
        js_to_cbpp<std::string>(cppObj.prefix, jsObj.Get("prefix"));
        return cppObj;
    }
    static inline Napi::Value to_js(Napi::Env env,
                                    const couchbase::core::prefix_scan &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("prefix", cbpp_to_js<std::string>(env, cppObj.prefix));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::sampling_scan> {
    static inline couchbase::core::sampling_scan from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::sampling_scan cppObj;
        js_to_cbpp<std::size_t>(cppObj.limit, jsObj.Get("limit"));
        js_to_cbpp<std::optional<std::uint64_t>>(cppObj.seed,
                                                 jsObj.Get("seed"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::sampling_scan &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("limit", cbpp_to_js<std::size_t>(env, cppObj.limit));
        resObj.Set("seed",
                   cbpp_to_js<std::optional<std::uint64_t>>(env, cppObj.seed));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::range_snapshot_requirements> {
    static inline couchbase::core::range_snapshot_requirements
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::range_snapshot_requirements cppObj;
        js_to_cbpp<std::uint64_t>(cppObj.vbucket_uuid,
                                  jsObj.Get("vbucket_uuid"));
        js_to_cbpp<std::uint64_t>(cppObj.sequence_number,
                                  jsObj.Get("sequence_number"));
        js_to_cbpp<bool>(cppObj.sequence_number_exists,
                         jsObj.Get("sequence_number_exists"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::range_snapshot_requirements &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("vbucket_uuid",
                   cbpp_to_js<std::uint64_t>(env, cppObj.vbucket_uuid));
        resObj.Set("sequence_number",
                   cbpp_to_js<std::uint64_t>(env, cppObj.sequence_number));
        resObj.Set("sequence_number_exists",
                   cbpp_to_js<bool>(env, cppObj.sequence_number_exists));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::range_scan_create_options> {
    static inline couchbase::core::range_scan_create_options
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        auto scan_type_name =
            jsToCbpp<std::string>(jsObj.Get("scan_type_name"));
        std::variant<std::monostate, couchbase::core::range_scan,
                     couchbase::core::prefix_scan,
                     couchbase::core::sampling_scan>
            scan_type;
        if (scan_type_name.compare("range_scan") == 0) {
            scan_type = js_to_cbpp<couchbase::core::range_scan>(
                jsObj.Get("scan_type_value"));
        } else if (scan_type_name.compare("prefix_scan") == 0) {
            scan_type = js_to_cbpp<couchbase::core::prefix_scan>(
                jsObj.Get("scan_type_value"));
        } else if (scan_type_name.compare("sampling_scan") == 0) {
            scan_type = js_to_cbpp<couchbase::core::sampling_scan>(
                jsObj.Get("scan_type_value"));
        }
        couchbase::core::range_scan_create_options cppObj;
        js_to_cbpp<std::string>(cppObj.scope_name, jsObj.Get("scope_name"));
        js_to_cbpp<std::string>(cppObj.collection_name,
                                jsObj.Get("collection_name"));
        cppObj.scan_type = scan_type;
        js_to_cbpp<std::chrono::milliseconds>(cppObj.timeout,
                                              jsObj.Get("timeout"));
        js_to_cbpp<std::uint32_t>(cppObj.collection_id,
                                  jsObj.Get("collection_id"));
        js_to_cbpp<std::optional<couchbase::core::range_snapshot_requirements>>(
            cppObj.snapshot_requirements, jsObj.Get("snapshot_requirements"));
        js_to_cbpp<bool>(cppObj.ids_only, jsObj.Get("ids_only"));
        // retry_strategy
        // internal
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::range_scan_create_options &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        if (std::holds_alternative<couchbase::core::range_scan>(
                cppObj.scan_type)) {
            resObj.Set("scan_type_name",
                       cbpp_to_js<std::string>(env, "range_scan"));
        } else if (std::holds_alternative<couchbase::core::prefix_scan>(
                       cppObj.scan_type)) {
            resObj.Set("scan_type_name",
                       cbpp_to_js<std::string>(env, "prefix_scan"));
        } else if (std::holds_alternative<couchbase::core::sampling_scan>(
                       cppObj.scan_type)) {
            resObj.Set("scan_type_name",
                       cbpp_to_js<std::string>(env, "sampling_scan"));
        }
        resObj.Set("scope_name",
                   cbpp_to_js<std::string>(env, cppObj.scope_name));
        resObj.Set("collection_name",
                   cbpp_to_js<std::string>(env, cppObj.collection_name));
        resObj.Set(
            "scan_type_value",
            cbpp_to_js<std::variant<std::monostate, couchbase::core::range_scan,
                                    couchbase::core::prefix_scan,
                                    couchbase::core::sampling_scan>>(
                env, cppObj.scan_type));
        resObj.Set("timeout",
                   cbpp_to_js<std::chrono::milliseconds>(env, cppObj.timeout));
        resObj.Set("collection_id",
                   cbpp_to_js<std::uint32_t>(env, cppObj.collection_id));
        resObj.Set(
            "snapshot_requirements",
            cbpp_to_js<
                std::optional<couchbase::core::range_snapshot_requirements>>(
                env, cppObj.snapshot_requirements));
        resObj.Set("ids_only", cbpp_to_js<bool>(env, cppObj.ids_only));
        // retry_strategy
        // internal
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::range_scan_create_result> {
    static inline couchbase::core::range_scan_create_result
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::range_scan_create_result cppObj;
        js_to_cbpp<std::vector<std::byte>>(cppObj.scan_uuid,
                                           jsObj.Get("scan_uuid"));
        js_to_cbpp<bool>(cppObj.ids_only, jsObj.Get("ids_only"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::range_scan_create_result &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("scan_uuid",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.scan_uuid));
        resObj.Set("ids_only", cbpp_to_js<bool>(env, cppObj.ids_only));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::range_scan_continue_options> {
    static inline couchbase::core::range_scan_continue_options
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::range_scan_continue_options cppObj;
        js_to_cbpp<std::uint32_t>(cppObj.batch_item_limit,
                                  jsObj.Get("batch_item_limit"));
        js_to_cbpp<std::uint32_t>(cppObj.batch_byte_limit,
                                  jsObj.Get("batch_byte_limit"));
        js_to_cbpp<std::chrono::milliseconds>(cppObj.timeout,
                                              jsObj.Get("timeout"));
        js_to_cbpp<std::chrono::milliseconds>(cppObj.batch_time_limit,
                                              jsObj.Get("batch_time_limit"));
        // retry_strategy
        // internal
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::range_scan_continue_options &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("batch_item_limit",
                   cbpp_to_js<std::uint32_t>(env, cppObj.batch_item_limit));
        resObj.Set("batch_byte_limit",
                   cbpp_to_js<std::uint32_t>(env, cppObj.batch_byte_limit));
        resObj.Set("timeout",
                   cbpp_to_js<std::chrono::milliseconds>(env, cppObj.timeout));
        resObj.Set("batch_time_limit", cbpp_to_js<std::chrono::milliseconds>(
                                           env, cppObj.batch_time_limit));
        // retry_strategy
        // internal
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::range_scan_continue_result> {
    static inline couchbase::core::range_scan_continue_result
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::range_scan_continue_result cppObj;
        js_to_cbpp<bool>(cppObj.more, jsObj.Get("more"));
        js_to_cbpp<bool>(cppObj.complete, jsObj.Get("complete"));
        js_to_cbpp<bool>(cppObj.ids_only, jsObj.Get("ids_only"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::range_scan_continue_result &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("more", cbpp_to_js<bool>(env, cppObj.more));
        resObj.Set("complete", cbpp_to_js<bool>(env, cppObj.complete));
        resObj.Set("ids_only", cbpp_to_js<bool>(env, cppObj.ids_only));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::range_scan_cancel_options> {
    static inline couchbase::core::range_scan_cancel_options
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::range_scan_cancel_options cppObj;
        js_to_cbpp<std::chrono::milliseconds>(cppObj.timeout,
                                              jsObj.Get("timeout"));
        // retry_strategy
        // internal
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::range_scan_cancel_options &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("timeout",
                   cbpp_to_js<std::chrono::milliseconds>(env, cppObj.timeout));
        // retry_strategy
        // internal
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::range_scan_item_body> {
    static inline couchbase::core::range_scan_item_body
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::range_scan_item_body cppObj;
        js_to_cbpp<std::uint32_t>(cppObj.flags, jsObj.Get("flags"));
        js_to_cbpp<std::uint32_t>(cppObj.expiry, jsObj.Get("expiry"));
        js_to_cbpp<couchbase::cas>(cppObj.cas, jsObj.Get("cas"));
        js_to_cbpp<std::uint64_t>(cppObj.sequence_number,
                                  jsObj.Get("sequence_number"));
        js_to_cbpp<std::byte>(cppObj.datatype, jsObj.Get("datatype"));
        js_to_cbpp<std::vector<std::byte>>(cppObj.value, jsObj.Get("value"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::range_scan_item_body &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("flags", cbpp_to_js<std::uint32_t>(env, cppObj.flags));
        resObj.Set("expiry", cbpp_to_js<std::uint32_t>(env, cppObj.expiry));
        resObj.Set("cas", cbpp_to_js<couchbase::cas>(env, cppObj.cas));
        resObj.Set("sequence_number",
                   cbpp_to_js<std::uint64_t>(env, cppObj.sequence_number));
        resObj.Set("datatype", cbpp_to_js<std::byte>(env, cppObj.datatype));
        resObj.Set("value",
                   cbpp_to_js<std::vector<std::byte>>(env, cppObj.value));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::range_scan_item> {
    static inline couchbase::core::range_scan_item from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::range_scan_item cppObj;
        js_to_cbpp<std::string>(cppObj.key, jsObj.Get("key"));
        js_to_cbpp<std::optional<couchbase::core::range_scan_item_body>>(
            cppObj.body, jsObj.Get("body"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::range_scan_item &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("key", cbpp_to_js<std::string>(env, cppObj.key));
        resObj.Set(
            "body",
            cbpp_to_js<std::optional<couchbase::core::range_scan_item_body>>(
                env, cppObj.body));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::range_scan_cancel_result> {
    static inline couchbase::core::range_scan_cancel_result
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::range_scan_cancel_result cppObj;
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::range_scan_cancel_result &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::mutation_state> {
    static inline couchbase::core::mutation_state from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::mutation_state cppObj;
        js_to_cbpp<std::vector<couchbase::mutation_token>>(cppObj.tokens,
                                                           jsObj.Get("tokens"));
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env, const couchbase::core::mutation_state &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("tokens", cbpp_to_js<std::vector<couchbase::mutation_token>>(
                                 env, cppObj.tokens));
        return resObj;
    }
};

template <>
struct js_to_cbpp_t<couchbase::core::range_scan_orchestrator_options> {
    static inline couchbase::core::range_scan_orchestrator_options
    from_js(Napi::Value jsVal)
    {
        auto jsObj = jsVal.ToObject();
        couchbase::core::range_scan_orchestrator_options cppObj;
        js_to_cbpp<bool>(cppObj.ids_only, jsObj.Get("ids_only"));
        js_to_cbpp<std::optional<couchbase::core::mutation_state>>(
            cppObj.consistent_with, jsObj.Get("consistent_with"));
        js_to_cbpp<std::uint32_t>(cppObj.batch_item_limit,
                                  jsObj.Get("batch_item_limit"));
        js_to_cbpp<std::uint32_t>(cppObj.batch_byte_limit,
                                  jsObj.Get("batch_byte_limit"));
        js_to_cbpp<std::uint16_t>(cppObj.concurrency, jsObj.Get("concurrency"));
        // retry_strategy
        js_to_cbpp<std::chrono::milliseconds>(cppObj.timeout,
                                              jsObj.Get("timeout"));
        // parent_span
        return cppObj;
    }
    static inline Napi::Value
    to_js(Napi::Env env,
          const couchbase::core::range_scan_orchestrator_options &cppObj)
    {
        auto resObj = Napi::Object::New(env);
        resObj.Set("ids_only", cbpp_to_js<bool>(env, cppObj.ids_only));
        resObj.Set("consistent_with",
                   cbpp_to_js<std::optional<couchbase::core::mutation_state>>(
                       env, cppObj.consistent_with));
        resObj.Set("batch_item_limit",
                   cbpp_to_js<std::uint32_t>(env, cppObj.batch_item_limit));
        resObj.Set("batch_byte_limit",
                   cbpp_to_js<std::uint32_t>(env, cppObj.batch_byte_limit));
        resObj.Set("concurrency",
                   cbpp_to_js<std::uint16_t>(env, cppObj.concurrency));
        // retry_strategy
        resObj.Set("timeout",
                   cbpp_to_js<std::chrono::milliseconds>(env, cppObj.timeout));
        // parent_span
        return resObj;
    }
};

//#endregion Autogenerated Marshalling

} // namespace couchnode
