/*
 *   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
// ====================================================================================================

#include "pycbc_kv_request.hxx"

namespace pycbc
{

static void
pycbc_kv_request__dealloc__(pycbc_kv_request* self)
{
  Py_XDECREF(self->bucket);
  Py_XDECREF(self->scope);
  Py_XDECREF(self->collection);
  Py_XDECREF(self->key);
  Py_XDECREF(self->access_deleted);
  Py_XDECREF(self->cas);
  Py_XDECREF(self->create_as_deleted);
  Py_XDECREF(self->delta);
  Py_XDECREF(self->durability_level);
  Py_XDECREF(self->effective_projections);
  Py_XDECREF(self->expiry);
  Py_XDECREF(self->flags);
  Py_XDECREF(self->initial_value);
  Py_XDECREF(self->lock_time);
  Py_XDECREF(self->persist_to);
  Py_XDECREF(self->preserve_array_indexes);
  Py_XDECREF(self->preserve_expiry);
  Py_XDECREF(self->projections);
  Py_XDECREF(self->read_preference);
  Py_XDECREF(self->replicate_to);
  Py_XDECREF(self->revive_document);
  Py_XDECREF(self->specs);
  Py_XDECREF(self->store_semantics);
  Py_XDECREF(self->timeout);
  Py_XDECREF(self->value);
  Py_XDECREF(self->with_expiry);
  Py_XDECREF(self->parent_span);
  Py_XDECREF(self->wrapper_span_name);
  Py_XDECREF(self->callback);
  Py_XDECREF(self->errback);
  Py_XDECREF(self->with_metrics);
  Py_TYPE(self)->tp_free((PyObject*)self);
}

static PyObject*
pycbc_kv_request__new__(PyTypeObject* type, PyObject* args, PyObject* kwds)
{
  pycbc_kv_request* self;
  self = (pycbc_kv_request*)type->tp_alloc(type, 0);
  if (self != nullptr) {
    self->opcode = 0;
    self->bucket = nullptr;
    self->scope = nullptr;
    self->collection = nullptr;
    self->key = nullptr;
    self->access_deleted = nullptr;
    self->cas = nullptr;
    self->create_as_deleted = nullptr;
    self->delta = nullptr;
    self->durability_level = nullptr;
    self->effective_projections = nullptr;
    self->expiry = nullptr;
    self->flags = nullptr;
    self->initial_value = nullptr;
    self->lock_time = nullptr;
    self->persist_to = nullptr;
    self->preserve_array_indexes = nullptr;
    self->preserve_expiry = nullptr;
    self->projections = nullptr;
    self->read_preference = nullptr;
    self->replicate_to = nullptr;
    self->revive_document = nullptr;
    self->specs = nullptr;
    self->store_semantics = nullptr;
    self->timeout = nullptr;
    self->value = nullptr;
    self->with_expiry = nullptr;
    self->parent_span = nullptr;
    self->wrapper_span_name = nullptr;
    self->callback = nullptr;
    self->errback = nullptr;
    self->with_metrics = nullptr;
  }
  return (PyObject*)self;
}

static PyMemberDef pycbc_kv_request_members[] = {
  { "opcode", T_INT, offsetof(pycbc_kv_request, opcode), 0, "operation opcode" },
  { "bucket", T_OBJECT_EX, offsetof(pycbc_kv_request, bucket), 0, "bucket name" },
  { "scope", T_OBJECT_EX, offsetof(pycbc_kv_request, scope), 0, "scope name" },
  { "collection", T_OBJECT_EX, offsetof(pycbc_kv_request, collection), 0, "collection name" },
  { "key", T_OBJECT_EX, offsetof(pycbc_kv_request, key), 0, "document key" },
  { "access_deleted",
    T_OBJECT_EX,
    offsetof(pycbc_kv_request, access_deleted),
    0,
    "access_deleted" },
  { "cas", T_OBJECT_EX, offsetof(pycbc_kv_request, cas), 0, "cas" },
  { "create_as_deleted",
    T_OBJECT_EX,
    offsetof(pycbc_kv_request, create_as_deleted),
    0,
    "create_as_deleted" },
  { "delta", T_OBJECT_EX, offsetof(pycbc_kv_request, delta), 0, "delta" },
  { "durability_level",
    T_OBJECT_EX,
    offsetof(pycbc_kv_request, durability_level),
    0,
    "durability_level" },
  { "effective_projections",
    T_OBJECT_EX,
    offsetof(pycbc_kv_request, effective_projections),
    0,
    "effective_projections" },
  { "expiry", T_OBJECT_EX, offsetof(pycbc_kv_request, expiry), 0, "expiry" },
  { "flags", T_OBJECT_EX, offsetof(pycbc_kv_request, flags), 0, "flags" },
  { "initial_value", T_OBJECT_EX, offsetof(pycbc_kv_request, initial_value), 0, "initial_value" },
  { "lock_time", T_OBJECT_EX, offsetof(pycbc_kv_request, lock_time), 0, "lock_time" },
  { "persist_to", T_OBJECT_EX, offsetof(pycbc_kv_request, persist_to), 0, "persist_to" },
  { "preserve_array_indexes",
    T_OBJECT_EX,
    offsetof(pycbc_kv_request, preserve_array_indexes),
    0,
    "preserve_array_indexes" },
  { "preserve_expiry",
    T_OBJECT_EX,
    offsetof(pycbc_kv_request, preserve_expiry),
    0,
    "preserve_expiry" },
  { "projections", T_OBJECT_EX, offsetof(pycbc_kv_request, projections), 0, "projections" },
  { "read_preference",
    T_OBJECT_EX,
    offsetof(pycbc_kv_request, read_preference),
    0,
    "read_preference" },
  { "replicate_to", T_OBJECT_EX, offsetof(pycbc_kv_request, replicate_to), 0, "replicate_to" },
  { "revive_document",
    T_OBJECT_EX,
    offsetof(pycbc_kv_request, revive_document),
    0,
    "revive_document" },
  { "specs", T_OBJECT_EX, offsetof(pycbc_kv_request, specs), 0, "specs" },
  { "store_semantics",
    T_OBJECT_EX,
    offsetof(pycbc_kv_request, store_semantics),
    0,
    "store_semantics" },
  { "timeout", T_OBJECT_EX, offsetof(pycbc_kv_request, timeout), 0, "timeout" },
  { "value", T_OBJECT_EX, offsetof(pycbc_kv_request, value), 0, "value" },
  { "with_expiry", T_OBJECT_EX, offsetof(pycbc_kv_request, with_expiry), 0, "with_expiry" },
  { "parent_span", T_OBJECT_EX, offsetof(pycbc_kv_request, parent_span), 0, "parent span" },
  { "wrapper_span_name",
    T_OBJECT_EX,
    offsetof(pycbc_kv_request, wrapper_span_name),
    0,
    "wrapper span name" },
  { "callback", T_OBJECT_EX, offsetof(pycbc_kv_request, callback), 0, "callback" },
  { "errback", T_OBJECT_EX, offsetof(pycbc_kv_request, errback), 0, "errback" },
  { "with_metrics", T_OBJECT_EX, offsetof(pycbc_kv_request, with_metrics), 0, "with metrics" },
  { nullptr }
};

PyTypeObject pycbc_kv_request_type = {
  PyVarObject_HEAD_INIT(nullptr, 0) "pycbc_core.pycbc_kv_request", /* tp_name */
  sizeof(pycbc_kv_request),                                        /* tp_basicsize */
  0,                                                               /* tp_itemsize */
  (destructor)pycbc_kv_request__dealloc__,                         /* tp_dealloc */
  0,                                                               /* tp_print */
  0,                                                               /* tp_getattr */
  0,                                                               /* tp_setattr */
  0,                                                               /* tp_reserved */
  0,                                                               /* tp_repr */
  0,                                                               /* tp_as_number */
  0,                                                               /* tp_as_sequence */
  0,                                                               /* tp_as_mapping */
  0,                                                               /* tp_hash */
  0,                                                               /* tp_call */
  0,                                                               /* tp_str */
  0,                                                               /* tp_getattro */
  0,                                                               /* tp_setattro */
  0,                                                               /* tp_as_buffer */
  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,                        /* tp_flags */
  PyDoc_STR("KV Operation Request"),                               /* tp_doc */
  0,                                                               /* tp_traverse */
  0,                                                               /* tp_clear */
  0,                                                               /* tp_richcompare */
  0,                                                               /* tp_weaklistoffset */
  0,                                                               /* tp_iter */
  0,                                                               /* tp_iternext */
  0,                                                               /* tp_methods */
  pycbc_kv_request_members,                                        /* tp_members */
  0,                                                               /* tp_getset */
  0,                                                               /* tp_base */
  0,                                                               /* tp_dict */
  0,                                                               /* tp_descr_get */
  0,                                                               /* tp_descr_set */
  0,                                                               /* tp_dictoffset */
  0,                                                               /* tp_init */
  0,                                                               /* tp_alloc */
  pycbc_kv_request__new__,                                         /* tp_new */
};

int
add_kv_request_type(PyObject* module)
{
  if (PyType_Ready(&pycbc_kv_request_type) < 0) {
    return -1;
  }

  Py_INCREF(&pycbc_kv_request_type);
  if (PyModule_AddObject(module, "pycbc_kv_request", (PyObject*)&pycbc_kv_request_type) < 0) {
    Py_DECREF(&pycbc_kv_request_type);
    return -1;
  }
  return 0;
}

} // namespace pycbc

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