/*
 *   Copyright 2016-2026. Couchbase, Inc.
 *   All Rights Reserved.
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

// ====================================================================================================
// AUTOGENERATED FILE START - DO NOT EDIT MANUALLY
// Generated-On: 2026-04-25 14:10:18
// ====================================================================================================

#pragma once

#include "Python.h"
#include "structmember.h"

#include <future>
#include <optional>

#include "pycbc_dict_keys.hxx"
#include <core/operations.hxx>
#include <core/tracing/wrapper_sdk_tracer.hxx>

namespace pycbc
{

struct pycbc_kv_request {
  PyObject_HEAD int opcode;
  /* document identity — always set */
  PyObject* bucket;
  PyObject* scope;
  PyObject* collection;
  PyObject* key;
  /* union of all KV op request fields (autogenerated) */
  PyObject* access_deleted; // bool — used by: lookup_in, lookup_in_all_replicas,
                            // lookup_in_any_replica, mutate_in, mutate_in_with_legacy_durability
  PyObject*
    cas; // couchbase::cas — used by: append, append_with_legacy_durability, mutate_in,
         // mutate_in_with_legacy_durability, prepend, prepend_with_legacy_durability, remove,
         // remove_with_legacy_durability, replace, replace_with_legacy_durability, unlock
  PyObject* create_as_deleted; // bool — used by: mutate_in, mutate_in_with_legacy_durability
  PyObject* delta; // std::uint64_t — used by: decrement, decrement_with_legacy_durability,
                   // increment, increment_with_legacy_durability
  PyObject* durability_level;      // couchbase::durability_level — used by: append, decrement,
                                   // increment, insert, mutate_in, prepend, remove, replace, upsert
  PyObject* effective_projections; // std::vector<std::string> — used by: get_projected
  PyObject*
    expiry; // std::uint32_t — used by: decrement, decrement_with_legacy_durability, get_and_touch,
            // increment, increment_with_legacy_durability, insert, insert_with_legacy_durability,
            // mutate_in, mutate_in_with_legacy_durability, replace, replace_with_legacy_durability,
            // touch, upsert, upsert_with_legacy_durability
  PyObject* flags; // std::uint32_t — used by: insert, insert_with_legacy_durability, mutate_in,
                   // mutate_in_with_legacy_durability, replace, replace_with_legacy_durability,
                   // upsert, upsert_with_legacy_durability
  PyObject*
    initial_value; // std::optional<std::uint64_t> — used by: decrement,
                   // decrement_with_legacy_durability, increment, increment_with_legacy_durability
  PyObject* lock_time;  // std::uint32_t — used by: get_and_lock
  PyObject* persist_to; // couchbase::persist_to — used by: append_with_legacy_durability,
                        // decrement_with_legacy_durability, increment_with_legacy_durability,
                        // insert_with_legacy_durability, mutate_in_with_legacy_durability,
                        // prepend_with_legacy_durability, remove_with_legacy_durability,
                        // replace_with_legacy_durability, upsert_with_legacy_durability
  PyObject* preserve_array_indexes; // bool — used by: get_projected
  PyObject*
    preserve_expiry;     // bool — used by: mutate_in, mutate_in_with_legacy_durability, replace,
                         // replace_with_legacy_durability, upsert, upsert_with_legacy_durability
  PyObject* projections; // std::vector<std::string> — used by: get_projected
  PyObject* read_preference; // couchbase::read_preference — used by: get_all_replicas,
                             // get_any_replica, lookup_in_all_replicas, lookup_in_any_replica
  PyObject* replicate_to;    // couchbase::replicate_to — used by: append_with_legacy_durability,
                             // decrement_with_legacy_durability, increment_with_legacy_durability,
                             // insert_with_legacy_durability, mutate_in_with_legacy_durability,
                             // prepend_with_legacy_durability, remove_with_legacy_durability,
                             // replace_with_legacy_durability, upsert_with_legacy_durability
  PyObject* revive_document; // bool — used by: mutate_in, mutate_in_with_legacy_durability
  PyObject* specs; // std::vector<couchbase::core::impl::subdoc::command> — used by: lookup_in,
                   // lookup_in_all_replicas, lookup_in_any_replica, mutate_in,
                   // mutate_in_with_legacy_durability
  PyObject* store_semantics; // couchbase::store_semantics — used by: mutate_in,
                             // mutate_in_with_legacy_durability
  PyObject*
    timeout; // std::optional<std::chrono::milliseconds> — used by: append,
             // append_with_legacy_durability, decrement, decrement_with_legacy_durability, exists,
             // get, get_all_replicas, get_and_lock, get_and_touch, get_any_replica, get_projected,
             // increment, increment_with_legacy_durability, insert, insert_with_legacy_durability,
             // lookup_in, lookup_in_all_replicas, lookup_in_any_replica, mutate_in,
             // mutate_in_with_legacy_durability, prepend, prepend_with_legacy_durability, remove,
             // remove_with_legacy_durability, replace, replace_with_legacy_durability, touch,
             // unlock, upsert, upsert_with_legacy_durability
  PyObject*
    value; // std::vector<std::byte> — used by: append, append_with_legacy_durability, insert,
           // insert_with_legacy_durability, prepend, prepend_with_legacy_durability, replace,
           // replace_with_legacy_durability, upsert, upsert_with_legacy_durability
  PyObject* with_expiry; // bool — used by: get_projected

  /* observability */
  PyObject* parent_span;
  PyObject* wrapper_span_name;
  /* async (acouchbase path only) */
  PyObject* callback;
  PyObject* errback;
  /* metrics control */
  PyObject* with_metrics;
};

extern PyTypeObject pycbc_kv_request_type;

int
add_kv_request_type(PyObject* module);

struct append_staging {
  couchbase::core::operations::append_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::append_response>> barrier;
  std::future<couchbase::core::operations::append_response> fut;
};

struct append_with_legacy_durability_staging {
  couchbase::core::operations::append_request_with_legacy_durability req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::append_response>> barrier;
  std::future<couchbase::core::operations::append_response> fut;
};

struct decrement_staging {
  couchbase::core::operations::decrement_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::decrement_response>> barrier;
  std::future<couchbase::core::operations::decrement_response> fut;
};

struct decrement_with_legacy_durability_staging {
  couchbase::core::operations::decrement_request_with_legacy_durability req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::decrement_response>> barrier;
  std::future<couchbase::core::operations::decrement_response> fut;
};

struct exists_staging {
  couchbase::core::operations::exists_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::exists_response>> barrier;
  std::future<couchbase::core::operations::exists_response> fut;
};

struct get_staging {
  couchbase::core::operations::get_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::get_response>> barrier;
  std::future<couchbase::core::operations::get_response> fut;
};

struct get_all_replicas_staging {
  couchbase::core::operations::get_all_replicas_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::get_all_replicas_response>> barrier;
  std::future<couchbase::core::operations::get_all_replicas_response> fut;
};

struct get_and_lock_staging {
  couchbase::core::operations::get_and_lock_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::get_and_lock_response>> barrier;
  std::future<couchbase::core::operations::get_and_lock_response> fut;
};

struct get_and_touch_staging {
  couchbase::core::operations::get_and_touch_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::get_and_touch_response>> barrier;
  std::future<couchbase::core::operations::get_and_touch_response> fut;
};

struct get_any_replica_staging {
  couchbase::core::operations::get_any_replica_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::get_any_replica_response>> barrier;
  std::future<couchbase::core::operations::get_any_replica_response> fut;
};

struct get_projected_staging {
  couchbase::core::operations::get_projected_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::get_projected_response>> barrier;
  std::future<couchbase::core::operations::get_projected_response> fut;
};

struct increment_staging {
  couchbase::core::operations::increment_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::increment_response>> barrier;
  std::future<couchbase::core::operations::increment_response> fut;
};

struct increment_with_legacy_durability_staging {
  couchbase::core::operations::increment_request_with_legacy_durability req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::increment_response>> barrier;
  std::future<couchbase::core::operations::increment_response> fut;
};

struct insert_staging {
  couchbase::core::operations::insert_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::insert_response>> barrier;
  std::future<couchbase::core::operations::insert_response> fut;
};

struct insert_with_legacy_durability_staging {
  couchbase::core::operations::insert_request_with_legacy_durability req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::insert_response>> barrier;
  std::future<couchbase::core::operations::insert_response> fut;
};

struct lookup_in_staging {
  couchbase::core::operations::lookup_in_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::lookup_in_response>> barrier;
  std::future<couchbase::core::operations::lookup_in_response> fut;
};

struct lookup_in_all_replicas_staging {
  couchbase::core::operations::lookup_in_all_replicas_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::lookup_in_all_replicas_response>>
    barrier;
  std::future<couchbase::core::operations::lookup_in_all_replicas_response> fut;
};

struct lookup_in_any_replica_staging {
  couchbase::core::operations::lookup_in_any_replica_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::lookup_in_any_replica_response>>
    barrier;
  std::future<couchbase::core::operations::lookup_in_any_replica_response> fut;
};

struct mutate_in_staging {
  couchbase::core::operations::mutate_in_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::mutate_in_response>> barrier;
  std::future<couchbase::core::operations::mutate_in_response> fut;
};

struct mutate_in_with_legacy_durability_staging {
  couchbase::core::operations::mutate_in_request_with_legacy_durability req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::mutate_in_response>> barrier;
  std::future<couchbase::core::operations::mutate_in_response> fut;
};

struct prepend_staging {
  couchbase::core::operations::prepend_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::prepend_response>> barrier;
  std::future<couchbase::core::operations::prepend_response> fut;
};

struct prepend_with_legacy_durability_staging {
  couchbase::core::operations::prepend_request_with_legacy_durability req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::prepend_response>> barrier;
  std::future<couchbase::core::operations::prepend_response> fut;
};

struct remove_staging {
  couchbase::core::operations::remove_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::remove_response>> barrier;
  std::future<couchbase::core::operations::remove_response> fut;
};

struct remove_with_legacy_durability_staging {
  couchbase::core::operations::remove_request_with_legacy_durability req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::remove_response>> barrier;
  std::future<couchbase::core::operations::remove_response> fut;
};

struct replace_staging {
  couchbase::core::operations::replace_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::replace_response>> barrier;
  std::future<couchbase::core::operations::replace_response> fut;
};

struct replace_with_legacy_durability_staging {
  couchbase::core::operations::replace_request_with_legacy_durability req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::replace_response>> barrier;
  std::future<couchbase::core::operations::replace_response> fut;
};

struct touch_staging {
  couchbase::core::operations::touch_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::touch_response>> barrier;
  std::future<couchbase::core::operations::touch_response> fut;
};

struct unlock_staging {
  couchbase::core::operations::unlock_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::unlock_response>> barrier;
  std::future<couchbase::core::operations::unlock_response> fut;
};

struct upsert_staging {
  couchbase::core::operations::upsert_request req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::upsert_response>> barrier;
  std::future<couchbase::core::operations::upsert_response> fut;
};

struct upsert_with_legacy_durability_staging {
  couchbase::core::operations::upsert_request_with_legacy_durability req;
  std::string key_str;
  std::shared_ptr<couchbase::core::tracing::wrapper_sdk_span> wrapper_span;
  std::optional<std::chrono::system_clock::time_point> start_time;
  std::shared_ptr<std::promise<couchbase::core::operations::upsert_response>> barrier;
  std::future<couchbase::core::operations::upsert_response> fut;
};

} // namespace pycbc

// ====================================================================================================
// AUTOGENERATED FILE END - DO NOT EDIT MANUALLY
// Generated-On: 2026-04-25 14:10:18
// ====================================================================================================
