LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - py_srvsvc.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 1118 31142 3.6 %
Date: 2021-09-23 10:06:22 Functions: 14 2169 0.6 %

          Line data    Source code
       1             : 
       2             : /* Python wrapper functions auto-generated by pidl */
       3             : #define PY_SSIZE_T_CLEAN 1 /* We use Py_ssize_t for PyArg_ParseTupleAndKeywords */
       4             : #include <Python.h>
       5             : #include "python/py3compat.h"
       6             : #include "includes.h"
       7             : #include "python/modules.h"
       8             : #include <pytalloc.h>
       9             : #include "librpc/rpc/pyrpc.h"
      10             : #include "librpc/rpc/pyrpc_util.h"
      11             : #include "bin/default/librpc/gen_ndr/ndr_srvsvc.h"
      12             : #include "bin/default/librpc/gen_ndr/ndr_srvsvc_c.h"
      13             : 
      14             : /*
      15             :  * Suppress compiler warnings if the generated code does not call these
      16             :  * functions
      17             :  */
      18             : #ifndef _MAYBE_UNUSED_
      19             : #ifdef __has_attribute
      20             : #if __has_attribute(unused)
      21             : #define _MAYBE_UNUSED_ __attribute__ ((unused))
      22             : #else
      23             : #define _MAYBE_UNUSED_
      24             : #endif
      25             : #endif
      26             : #endif
      27             : /*
      28             :  * These functions are here to ensure they can be optimized out by
      29             :  * the compiler based on the constant input values
      30             :  */
      31             : 
      32           2 : static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
      33             : {
      34           2 :         switch (var_size) {
      35           0 :         case 8:
      36           0 :                 return UINT64_MAX;
      37           2 :         case 4:
      38           2 :                 return UINT32_MAX;
      39           0 :         case 2:
      40           0 :                 return UINT16_MAX;
      41           0 :         case 1:
      42           0 :                 return UINT8_MAX;
      43             :         }
      44             : 
      45           0 :         return 0;
      46             : }
      47             : 
      48           0 : static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
      49             : {
      50           0 :         switch (var_size) {
      51           0 :         case 8:
      52           0 :                 return INT64_MAX;
      53           0 :         case 4:
      54           0 :                 return INT32_MAX;
      55           0 :         case 2:
      56           0 :                 return INT16_MAX;
      57           0 :         case 1:
      58           0 :                 return INT8_MAX;
      59             :         }
      60             : 
      61           0 :         return 0;
      62             : }
      63             : 
      64             : #include "librpc/gen_ndr/misc.h"
      65             : #include "librpc/gen_ndr/security.h"
      66             : #include "librpc/gen_ndr/svcctl.h"
      67             : static PyTypeObject srvsvc_NetCharDevInfo0_Type;
      68             : static PyTypeObject srvsvc_NetCharDevCtr0_Type;
      69             : static PyTypeObject srvsvc_NetCharDevInfo1_Type;
      70             : static PyTypeObject srvsvc_NetCharDevCtr1_Type;
      71             : static PyTypeObject srvsvc_NetCharDevInfo_Type;
      72             : static PyTypeObject srvsvc_NetCharDevCtr_Type;
      73             : static PyTypeObject srvsvc_NetCharDevInfoCtr_Type;
      74             : static PyTypeObject srvsvc_NetCharDevQInfo0_Type;
      75             : static PyTypeObject srvsvc_NetCharDevQCtr0_Type;
      76             : static PyTypeObject srvsvc_NetCharDevQInfo1_Type;
      77             : static PyTypeObject srvsvc_NetCharDevQCtr1_Type;
      78             : static PyTypeObject srvsvc_NetCharDevQInfo_Type;
      79             : static PyTypeObject srvsvc_NetCharDevQCtr_Type;
      80             : static PyTypeObject srvsvc_NetCharDevQInfoCtr_Type;
      81             : static PyTypeObject srvsvc_NetConnInfo0_Type;
      82             : static PyTypeObject srvsvc_NetConnCtr0_Type;
      83             : static PyTypeObject srvsvc_NetConnInfo1_Type;
      84             : static PyTypeObject srvsvc_NetConnCtr1_Type;
      85             : static PyTypeObject srvsvc_NetConnCtr_Type;
      86             : static PyTypeObject srvsvc_NetConnInfoCtr_Type;
      87             : static PyTypeObject srvsvc_NetFileInfo2_Type;
      88             : static PyTypeObject srvsvc_NetFileCtr2_Type;
      89             : static PyTypeObject srvsvc_NetFileInfo3_Type;
      90             : static PyTypeObject srvsvc_NetFileCtr3_Type;
      91             : static PyTypeObject srvsvc_NetFileInfo_Type;
      92             : static PyTypeObject srvsvc_NetFileCtr_Type;
      93             : static PyTypeObject srvsvc_NetFileInfoCtr_Type;
      94             : static PyTypeObject srvsvc_NetSessInfo0_Type;
      95             : static PyTypeObject srvsvc_NetSessCtr0_Type;
      96             : static PyTypeObject srvsvc_NetSessInfo1_Type;
      97             : static PyTypeObject srvsvc_NetSessCtr1_Type;
      98             : static PyTypeObject srvsvc_NetSessInfo2_Type;
      99             : static PyTypeObject srvsvc_NetSessCtr2_Type;
     100             : static PyTypeObject srvsvc_NetSessInfo10_Type;
     101             : static PyTypeObject srvsvc_NetSessCtr10_Type;
     102             : static PyTypeObject srvsvc_NetSessInfo502_Type;
     103             : static PyTypeObject srvsvc_NetSessCtr502_Type;
     104             : static PyTypeObject srvsvc_NetSessCtr_Type;
     105             : static PyTypeObject srvsvc_NetSessInfoCtr_Type;
     106             : static PyTypeObject srvsvc_NetShareInfo0_Type;
     107             : static PyTypeObject srvsvc_NetShareCtr0_Type;
     108             : static PyTypeObject srvsvc_NetShareInfo1_Type;
     109             : static PyTypeObject srvsvc_NetShareCtr1_Type;
     110             : static PyTypeObject srvsvc_NetShareInfo2_Type;
     111             : static PyTypeObject srvsvc_NetShareCtr2_Type;
     112             : static PyTypeObject srvsvc_NetShareInfo501_Type;
     113             : static PyTypeObject srvsvc_NetShareCtr501_Type;
     114             : static PyTypeObject srvsvc_NetShareInfo502_Type;
     115             : static PyTypeObject srvsvc_NetShareCtr502_Type;
     116             : static PyTypeObject srvsvc_NetShareInfo1004_Type;
     117             : static PyTypeObject srvsvc_NetShareCtr1004_Type;
     118             : static PyTypeObject srvsvc_NetShareInfo1005_Type;
     119             : static PyTypeObject srvsvc_NetShareCtr1005_Type;
     120             : static PyTypeObject srvsvc_NetShareInfo1006_Type;
     121             : static PyTypeObject srvsvc_NetShareCtr1006_Type;
     122             : static PyTypeObject srvsvc_NetShareInfo1007_Type;
     123             : static PyTypeObject srvsvc_NetShareCtr1007_Type;
     124             : static PyTypeObject srvsvc_NetShareCtr1501_Type;
     125             : static PyTypeObject srvsvc_NetShareInfo_Type;
     126             : static PyTypeObject srvsvc_NetShareCtr_Type;
     127             : static PyTypeObject srvsvc_NetShareInfoCtr_Type;
     128             : static PyTypeObject srvsvc_NetSrvInfo100_Type;
     129             : static PyTypeObject srvsvc_NetSrvInfo101_Type;
     130             : static PyTypeObject srvsvc_NetSrvInfo102_Type;
     131             : static PyTypeObject srvsvc_NetSrvInfo402_Type;
     132             : static PyTypeObject srvsvc_NetSrvInfo403_Type;
     133             : static PyTypeObject srvsvc_NetSrvInfo502_Type;
     134             : static PyTypeObject srvsvc_NetSrvInfo503_Type;
     135             : static PyTypeObject srvsvc_NetSrvInfo599_Type;
     136             : static PyTypeObject srvsvc_NetSrvInfo1005_Type;
     137             : static PyTypeObject srvsvc_NetSrvInfo1010_Type;
     138             : static PyTypeObject srvsvc_NetSrvInfo1016_Type;
     139             : static PyTypeObject srvsvc_NetSrvInfo1017_Type;
     140             : static PyTypeObject srvsvc_NetSrvInfo1018_Type;
     141             : static PyTypeObject srvsvc_NetSrvInfo1107_Type;
     142             : static PyTypeObject srvsvc_NetSrvInfo1501_Type;
     143             : static PyTypeObject srvsvc_NetSrvInfo1502_Type;
     144             : static PyTypeObject srvsvc_NetSrvInfo1503_Type;
     145             : static PyTypeObject srvsvc_NetSrvInfo1506_Type;
     146             : static PyTypeObject srvsvc_NetSrvInfo1509_Type;
     147             : static PyTypeObject srvsvc_NetSrvInfo1510_Type;
     148             : static PyTypeObject srvsvc_NetSrvInfo1511_Type;
     149             : static PyTypeObject srvsvc_NetSrvInfo1512_Type;
     150             : static PyTypeObject srvsvc_NetSrvInfo1513_Type;
     151             : static PyTypeObject srvsvc_NetSrvInfo1514_Type;
     152             : static PyTypeObject srvsvc_NetSrvInfo1515_Type;
     153             : static PyTypeObject srvsvc_NetSrvInfo1516_Type;
     154             : static PyTypeObject srvsvc_NetSrvInfo1518_Type;
     155             : static PyTypeObject srvsvc_NetSrvInfo1520_Type;
     156             : static PyTypeObject srvsvc_NetSrvInfo1521_Type;
     157             : static PyTypeObject srvsvc_NetSrvInfo1522_Type;
     158             : static PyTypeObject srvsvc_NetSrvInfo1523_Type;
     159             : static PyTypeObject srvsvc_NetSrvInfo1524_Type;
     160             : static PyTypeObject srvsvc_NetSrvInfo1525_Type;
     161             : static PyTypeObject srvsvc_NetSrvInfo1528_Type;
     162             : static PyTypeObject srvsvc_NetSrvInfo1529_Type;
     163             : static PyTypeObject srvsvc_NetSrvInfo1530_Type;
     164             : static PyTypeObject srvsvc_NetSrvInfo1533_Type;
     165             : static PyTypeObject srvsvc_NetSrvInfo1534_Type;
     166             : static PyTypeObject srvsvc_NetSrvInfo1535_Type;
     167             : static PyTypeObject srvsvc_NetSrvInfo1536_Type;
     168             : static PyTypeObject srvsvc_NetSrvInfo1537_Type;
     169             : static PyTypeObject srvsvc_NetSrvInfo1538_Type;
     170             : static PyTypeObject srvsvc_NetSrvInfo1539_Type;
     171             : static PyTypeObject srvsvc_NetSrvInfo1540_Type;
     172             : static PyTypeObject srvsvc_NetSrvInfo1541_Type;
     173             : static PyTypeObject srvsvc_NetSrvInfo1542_Type;
     174             : static PyTypeObject srvsvc_NetSrvInfo1543_Type;
     175             : static PyTypeObject srvsvc_NetSrvInfo1544_Type;
     176             : static PyTypeObject srvsvc_NetSrvInfo1545_Type;
     177             : static PyTypeObject srvsvc_NetSrvInfo1546_Type;
     178             : static PyTypeObject srvsvc_NetSrvInfo1547_Type;
     179             : static PyTypeObject srvsvc_NetSrvInfo1548_Type;
     180             : static PyTypeObject srvsvc_NetSrvInfo1549_Type;
     181             : static PyTypeObject srvsvc_NetSrvInfo1550_Type;
     182             : static PyTypeObject srvsvc_NetSrvInfo1552_Type;
     183             : static PyTypeObject srvsvc_NetSrvInfo1553_Type;
     184             : static PyTypeObject srvsvc_NetSrvInfo1554_Type;
     185             : static PyTypeObject srvsvc_NetSrvInfo1555_Type;
     186             : static PyTypeObject srvsvc_NetSrvInfo1556_Type;
     187             : static PyTypeObject srvsvc_NetSrvInfo_Type;
     188             : static PyTypeObject srvsvc_NetDiskInfo0_Type;
     189             : static PyTypeObject srvsvc_NetDiskInfo_Type;
     190             : static PyTypeObject srvsvc_Statistics_Type;
     191             : static PyTypeObject srvsvc_NetTransportInfo0_Type;
     192             : static PyTypeObject srvsvc_NetTransportCtr0_Type;
     193             : static PyTypeObject srvsvc_NetTransportInfo1_Type;
     194             : static PyTypeObject srvsvc_NetTransportCtr1_Type;
     195             : static PyTypeObject srvsvc_NetTransportInfo2_Type;
     196             : static PyTypeObject srvsvc_NetTransportCtr2_Type;
     197             : static PyTypeObject srvsvc_NetTransportInfo3_Type;
     198             : static PyTypeObject srvsvc_NetTransportCtr3_Type;
     199             : static PyTypeObject srvsvc_NetTransportCtr_Type;
     200             : static PyTypeObject srvsvc_NetTransportInfoCtr_Type;
     201             : static PyTypeObject srvsvc_NetRemoteTODInfo_Type;
     202             : static PyTypeObject srvsvc_NetTransportInfo_Type;
     203             : static PyTypeObject srvsvc_InterfaceType;
     204             : static PyTypeObject srvsvc_NetCharDevEnum_Type;
     205             : static PyTypeObject srvsvc_NetCharDevGetInfo_Type;
     206             : static PyTypeObject srvsvc_NetCharDevControl_Type;
     207             : static PyTypeObject srvsvc_NetCharDevQEnum_Type;
     208             : static PyTypeObject srvsvc_NetCharDevQGetInfo_Type;
     209             : static PyTypeObject srvsvc_NetCharDevQSetInfo_Type;
     210             : static PyTypeObject srvsvc_NetCharDevQPurge_Type;
     211             : static PyTypeObject srvsvc_NetCharDevQPurgeSelf_Type;
     212             : static PyTypeObject srvsvc_NetConnEnum_Type;
     213             : static PyTypeObject srvsvc_NetFileEnum_Type;
     214             : static PyTypeObject srvsvc_NetFileGetInfo_Type;
     215             : static PyTypeObject srvsvc_NetFileClose_Type;
     216             : static PyTypeObject srvsvc_NetSessEnum_Type;
     217             : static PyTypeObject srvsvc_NetSessDel_Type;
     218             : static PyTypeObject srvsvc_NetShareAdd_Type;
     219             : static PyTypeObject srvsvc_NetShareEnumAll_Type;
     220             : static PyTypeObject srvsvc_NetShareGetInfo_Type;
     221             : static PyTypeObject srvsvc_NetShareSetInfo_Type;
     222             : static PyTypeObject srvsvc_NetShareDel_Type;
     223             : static PyTypeObject srvsvc_NetShareDelSticky_Type;
     224             : static PyTypeObject srvsvc_NetShareCheck_Type;
     225             : static PyTypeObject srvsvc_NetSrvGetInfo_Type;
     226             : static PyTypeObject srvsvc_NetSrvSetInfo_Type;
     227             : static PyTypeObject srvsvc_NetDiskEnum_Type;
     228             : static PyTypeObject srvsvc_NetServerStatisticsGet_Type;
     229             : static PyTypeObject srvsvc_NetTransportAdd_Type;
     230             : static PyTypeObject srvsvc_NetTransportEnum_Type;
     231             : static PyTypeObject srvsvc_NetTransportDel_Type;
     232             : static PyTypeObject srvsvc_NetRemoteTOD_Type;
     233             : static PyTypeObject srvsvc_NetSetServiceBits_Type;
     234             : static PyTypeObject srvsvc_NetPathType_Type;
     235             : static PyTypeObject srvsvc_NetPathCanonicalize_Type;
     236             : static PyTypeObject srvsvc_NetPathCompare_Type;
     237             : static PyTypeObject srvsvc_NetNameValidate_Type;
     238             : static PyTypeObject srvsvc_NetPRNameCompare_Type;
     239             : static PyTypeObject srvsvc_NetShareEnum_Type;
     240             : static PyTypeObject srvsvc_NetShareDelStart_Type;
     241             : static PyTypeObject srvsvc_NetShareDelCommit_Type;
     242             : static PyTypeObject srvsvc_NetGetFileSecurity_Type;
     243             : static PyTypeObject srvsvc_NetSetFileSecurity_Type;
     244             : static PyTypeObject srvsvc_NetServerTransportAddEx_Type;
     245             : static PyTypeObject srvsvc_NetServerSetServiceBitsEx_Type;
     246             : 
     247             : static PyTypeObject *BaseObject_Type;
     248             : static PyTypeObject *sec_desc_buf_Type;
     249             : static PyTypeObject *policy_handle_Type;
     250             : static PyTypeObject *ClientConnection_Type;
     251             : static PyTypeObject *ndr_syntax_id_Type;
     252             : 
     253           0 : static PyObject *py_srvsvc_NetCharDevInfo0_get_device(PyObject *obj, void *closure)
     254             : {
     255           0 :         struct srvsvc_NetCharDevInfo0 *object = (struct srvsvc_NetCharDevInfo0 *)pytalloc_get_ptr(obj);
     256             :         PyObject *py_device;
     257           0 :         if (object->device == NULL) {
     258           0 :                 Py_RETURN_NONE;
     259             :         }
     260           0 :         if (object->device == NULL) {
     261           0 :                 py_device = Py_None;
     262           0 :                 Py_INCREF(py_device);
     263             :         } else {
     264           0 :                 if (object->device == NULL) {
     265           0 :                         py_device = Py_None;
     266           0 :                         Py_INCREF(py_device);
     267             :                 } else {
     268           0 :                         py_device = PyUnicode_Decode(object->device, strlen(object->device), "utf-8", "ignore");
     269             :                 }
     270             :         }
     271           0 :         return py_device;
     272             : }
     273             : 
     274           0 : static int py_srvsvc_NetCharDevInfo0_set_device(PyObject *py_obj, PyObject *value, void *closure)
     275             : {
     276           0 :         struct srvsvc_NetCharDevInfo0 *object = (struct srvsvc_NetCharDevInfo0 *)pytalloc_get_ptr(py_obj);
     277           0 :         if (value == NULL) {
     278           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->device");
     279           0 :                 return -1;
     280             :         }
     281           0 :         if (value == Py_None) {
     282           0 :                 object->device = NULL;
     283             :         } else {
     284           0 :                 object->device = NULL;
     285             :                 {
     286             :                         const char *test_str;
     287             :                         const char *talloc_str;
     288           0 :                         PyObject *unicode = NULL;
     289           0 :                         if (PyUnicode_Check(value)) {
     290           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     291           0 :                                 if (unicode == NULL) {
     292           0 :                                         PyErr_NoMemory();
     293           0 :                                         return -1;
     294             :                                 }
     295           0 :                                 test_str = PyBytes_AS_STRING(unicode);
     296           0 :                         } else if (PyBytes_Check(value)) {
     297           0 :                                 test_str = PyBytes_AS_STRING(value);
     298             :                         } else {
     299           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     300           0 :                                 return -1;
     301             :                         }
     302           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     303           0 :                         if (unicode != NULL) {
     304           0 :                                 Py_DECREF(unicode);
     305             :                         }
     306           0 :                         if (talloc_str == NULL) {
     307           0 :                                 PyErr_NoMemory();
     308           0 :                                 return -1;
     309             :                         }
     310           0 :                         object->device = talloc_str;
     311             :                 }
     312             :         }
     313           0 :         return 0;
     314             : }
     315             : 
     316             : static PyGetSetDef py_srvsvc_NetCharDevInfo0_getsetters[] = {
     317             :         {
     318             :                 .name = discard_const_p(char, "device"),
     319             :                 .get = py_srvsvc_NetCharDevInfo0_get_device,
     320             :                 .set = py_srvsvc_NetCharDevInfo0_set_device,
     321             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
     322             :         },
     323             :         { .name = NULL }
     324             : };
     325             : 
     326           0 : static PyObject *py_srvsvc_NetCharDevInfo0_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     327             : {
     328           0 :         return pytalloc_new(struct srvsvc_NetCharDevInfo0, type);
     329             : }
     330             : 
     331             : 
     332             : static PyTypeObject srvsvc_NetCharDevInfo0_Type = {
     333             :         PyVarObject_HEAD_INIT(NULL, 0)
     334             :         .tp_name = "srvsvc.NetCharDevInfo0",
     335             :         .tp_getset = py_srvsvc_NetCharDevInfo0_getsetters,
     336             :         .tp_methods = NULL,
     337             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     338             :         .tp_new = py_srvsvc_NetCharDevInfo0_new,
     339             : };
     340             : 
     341             : 
     342           0 : static PyObject *py_srvsvc_NetCharDevCtr0_get_count(PyObject *obj, void *closure)
     343             : {
     344           0 :         struct srvsvc_NetCharDevCtr0 *object = (struct srvsvc_NetCharDevCtr0 *)pytalloc_get_ptr(obj);
     345             :         PyObject *py_count;
     346           0 :         py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
     347           0 :         return py_count;
     348             : }
     349             : 
     350           0 : static int py_srvsvc_NetCharDevCtr0_set_count(PyObject *py_obj, PyObject *value, void *closure)
     351             : {
     352           0 :         struct srvsvc_NetCharDevCtr0 *object = (struct srvsvc_NetCharDevCtr0 *)pytalloc_get_ptr(py_obj);
     353           0 :         if (value == NULL) {
     354           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
     355           0 :                 return -1;
     356             :         }
     357             :         {
     358           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
     359           0 :                 if (PyLong_Check(value)) {
     360             :                         unsigned long long test_var;
     361           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     362           0 :                         if (PyErr_Occurred() != NULL) {
     363           0 :                                 return -1;
     364             :                         }
     365           0 :                         if (test_var > uint_max) {
     366           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     367             :                                   PyLong_Type.tp_name, uint_max, test_var);
     368           0 :                                 return -1;
     369             :                         }
     370           0 :                         object->count = test_var;
     371             :                 } else {
     372           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     373             :                           PyLong_Type.tp_name);
     374           0 :                         return -1;
     375             :                 }
     376             :         }
     377           0 :         return 0;
     378             : }
     379             : 
     380           0 : static PyObject *py_srvsvc_NetCharDevCtr0_get_array(PyObject *obj, void *closure)
     381             : {
     382           0 :         struct srvsvc_NetCharDevCtr0 *object = (struct srvsvc_NetCharDevCtr0 *)pytalloc_get_ptr(obj);
     383             :         PyObject *py_array;
     384           0 :         if (object->array == NULL) {
     385           0 :                 Py_RETURN_NONE;
     386             :         }
     387           0 :         if (object->array == NULL) {
     388           0 :                 py_array = Py_None;
     389           0 :                 Py_INCREF(py_array);
     390             :         } else {
     391           0 :                 py_array = PyList_New(object->count);
     392           0 :                 if (py_array == NULL) {
     393           0 :                         return NULL;
     394             :                 }
     395             :                 {
     396             :                         int array_cntr_1;
     397           0 :                         for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
     398             :                                 PyObject *py_array_1;
     399           0 :                                 py_array_1 = pytalloc_reference_ex(&srvsvc_NetCharDevInfo0_Type, object->array, &object->array[array_cntr_1]);
     400           0 :                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
     401             :                         }
     402             :                 }
     403             :         }
     404           0 :         return py_array;
     405             : }
     406             : 
     407           0 : static int py_srvsvc_NetCharDevCtr0_set_array(PyObject *py_obj, PyObject *value, void *closure)
     408             : {
     409           0 :         struct srvsvc_NetCharDevCtr0 *object = (struct srvsvc_NetCharDevCtr0 *)pytalloc_get_ptr(py_obj);
     410           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
     411           0 :         if (value == NULL) {
     412           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
     413           0 :                 return -1;
     414             :         }
     415           0 :         if (value == Py_None) {
     416           0 :                 object->array = NULL;
     417             :         } else {
     418           0 :                 object->array = NULL;
     419           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
     420             :                 {
     421             :                         int array_cntr_1;
     422           0 :                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
     423           0 :                         if (!object->array) { return -1;; }
     424           0 :                         talloc_set_name_const(object->array, "ARRAY: object->array");
     425           0 :                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
     426           0 :                                 if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
     427           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
     428           0 :                                         return -1;
     429             :                                 }
     430           0 :                                 PY_CHECK_TYPE(&srvsvc_NetCharDevInfo0_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
     431           0 :                                 if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
     432           0 :                                         PyErr_NoMemory();
     433           0 :                                         return -1;
     434             :                                 }
     435           0 :                                 object->array[array_cntr_1] = *(struct srvsvc_NetCharDevInfo0 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
     436             :                         }
     437             :                 }
     438             :         }
     439           0 :         return 0;
     440             : }
     441             : 
     442             : static PyGetSetDef py_srvsvc_NetCharDevCtr0_getsetters[] = {
     443             :         {
     444             :                 .name = discard_const_p(char, "count"),
     445             :                 .get = py_srvsvc_NetCharDevCtr0_get_count,
     446             :                 .set = py_srvsvc_NetCharDevCtr0_set_count,
     447             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     448             :         },
     449             :         {
     450             :                 .name = discard_const_p(char, "array"),
     451             :                 .get = py_srvsvc_NetCharDevCtr0_get_array,
     452             :                 .set = py_srvsvc_NetCharDevCtr0_set_array,
     453             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetCharDevInfo0")
     454             :         },
     455             :         { .name = NULL }
     456             : };
     457             : 
     458           0 : static PyObject *py_srvsvc_NetCharDevCtr0_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     459             : {
     460           0 :         return pytalloc_new(struct srvsvc_NetCharDevCtr0, type);
     461             : }
     462             : 
     463             : 
     464             : static PyTypeObject srvsvc_NetCharDevCtr0_Type = {
     465             :         PyVarObject_HEAD_INIT(NULL, 0)
     466             :         .tp_name = "srvsvc.NetCharDevCtr0",
     467             :         .tp_getset = py_srvsvc_NetCharDevCtr0_getsetters,
     468             :         .tp_methods = NULL,
     469             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     470             :         .tp_new = py_srvsvc_NetCharDevCtr0_new,
     471             : };
     472             : 
     473             : 
     474           0 : static PyObject *py_srvsvc_NetCharDevInfo1_get_device(PyObject *obj, void *closure)
     475             : {
     476           0 :         struct srvsvc_NetCharDevInfo1 *object = (struct srvsvc_NetCharDevInfo1 *)pytalloc_get_ptr(obj);
     477             :         PyObject *py_device;
     478           0 :         if (object->device == NULL) {
     479           0 :                 Py_RETURN_NONE;
     480             :         }
     481           0 :         if (object->device == NULL) {
     482           0 :                 py_device = Py_None;
     483           0 :                 Py_INCREF(py_device);
     484             :         } else {
     485           0 :                 if (object->device == NULL) {
     486           0 :                         py_device = Py_None;
     487           0 :                         Py_INCREF(py_device);
     488             :                 } else {
     489           0 :                         py_device = PyUnicode_Decode(object->device, strlen(object->device), "utf-8", "ignore");
     490             :                 }
     491             :         }
     492           0 :         return py_device;
     493             : }
     494             : 
     495           0 : static int py_srvsvc_NetCharDevInfo1_set_device(PyObject *py_obj, PyObject *value, void *closure)
     496             : {
     497           0 :         struct srvsvc_NetCharDevInfo1 *object = (struct srvsvc_NetCharDevInfo1 *)pytalloc_get_ptr(py_obj);
     498           0 :         if (value == NULL) {
     499           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->device");
     500           0 :                 return -1;
     501             :         }
     502           0 :         if (value == Py_None) {
     503           0 :                 object->device = NULL;
     504             :         } else {
     505           0 :                 object->device = NULL;
     506             :                 {
     507             :                         const char *test_str;
     508             :                         const char *talloc_str;
     509           0 :                         PyObject *unicode = NULL;
     510           0 :                         if (PyUnicode_Check(value)) {
     511           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     512           0 :                                 if (unicode == NULL) {
     513           0 :                                         PyErr_NoMemory();
     514           0 :                                         return -1;
     515             :                                 }
     516           0 :                                 test_str = PyBytes_AS_STRING(unicode);
     517           0 :                         } else if (PyBytes_Check(value)) {
     518           0 :                                 test_str = PyBytes_AS_STRING(value);
     519             :                         } else {
     520           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     521           0 :                                 return -1;
     522             :                         }
     523           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     524           0 :                         if (unicode != NULL) {
     525           0 :                                 Py_DECREF(unicode);
     526             :                         }
     527           0 :                         if (talloc_str == NULL) {
     528           0 :                                 PyErr_NoMemory();
     529           0 :                                 return -1;
     530             :                         }
     531           0 :                         object->device = talloc_str;
     532             :                 }
     533             :         }
     534           0 :         return 0;
     535             : }
     536             : 
     537           0 : static PyObject *py_srvsvc_NetCharDevInfo1_get_status(PyObject *obj, void *closure)
     538             : {
     539           0 :         struct srvsvc_NetCharDevInfo1 *object = (struct srvsvc_NetCharDevInfo1 *)pytalloc_get_ptr(obj);
     540             :         PyObject *py_status;
     541           0 :         py_status = PyLong_FromUnsignedLongLong((uint32_t)object->status);
     542           0 :         return py_status;
     543             : }
     544             : 
     545           0 : static int py_srvsvc_NetCharDevInfo1_set_status(PyObject *py_obj, PyObject *value, void *closure)
     546             : {
     547           0 :         struct srvsvc_NetCharDevInfo1 *object = (struct srvsvc_NetCharDevInfo1 *)pytalloc_get_ptr(py_obj);
     548           0 :         if (value == NULL) {
     549           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->status");
     550           0 :                 return -1;
     551             :         }
     552             :         {
     553           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->status));
     554           0 :                 if (PyLong_Check(value)) {
     555             :                         unsigned long long test_var;
     556           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     557           0 :                         if (PyErr_Occurred() != NULL) {
     558           0 :                                 return -1;
     559             :                         }
     560           0 :                         if (test_var > uint_max) {
     561           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     562             :                                   PyLong_Type.tp_name, uint_max, test_var);
     563           0 :                                 return -1;
     564             :                         }
     565           0 :                         object->status = test_var;
     566             :                 } else {
     567           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     568             :                           PyLong_Type.tp_name);
     569           0 :                         return -1;
     570             :                 }
     571             :         }
     572           0 :         return 0;
     573             : }
     574             : 
     575           0 : static PyObject *py_srvsvc_NetCharDevInfo1_get_user(PyObject *obj, void *closure)
     576             : {
     577           0 :         struct srvsvc_NetCharDevInfo1 *object = (struct srvsvc_NetCharDevInfo1 *)pytalloc_get_ptr(obj);
     578             :         PyObject *py_user;
     579           0 :         if (object->user == NULL) {
     580           0 :                 Py_RETURN_NONE;
     581             :         }
     582           0 :         if (object->user == NULL) {
     583           0 :                 py_user = Py_None;
     584           0 :                 Py_INCREF(py_user);
     585             :         } else {
     586           0 :                 if (object->user == NULL) {
     587           0 :                         py_user = Py_None;
     588           0 :                         Py_INCREF(py_user);
     589             :                 } else {
     590           0 :                         py_user = PyUnicode_Decode(object->user, strlen(object->user), "utf-8", "ignore");
     591             :                 }
     592             :         }
     593           0 :         return py_user;
     594             : }
     595             : 
     596           0 : static int py_srvsvc_NetCharDevInfo1_set_user(PyObject *py_obj, PyObject *value, void *closure)
     597             : {
     598           0 :         struct srvsvc_NetCharDevInfo1 *object = (struct srvsvc_NetCharDevInfo1 *)pytalloc_get_ptr(py_obj);
     599           0 :         if (value == NULL) {
     600           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user");
     601           0 :                 return -1;
     602             :         }
     603           0 :         if (value == Py_None) {
     604           0 :                 object->user = NULL;
     605             :         } else {
     606           0 :                 object->user = NULL;
     607             :                 {
     608             :                         const char *test_str;
     609             :                         const char *talloc_str;
     610           0 :                         PyObject *unicode = NULL;
     611           0 :                         if (PyUnicode_Check(value)) {
     612           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
     613           0 :                                 if (unicode == NULL) {
     614           0 :                                         PyErr_NoMemory();
     615           0 :                                         return -1;
     616             :                                 }
     617           0 :                                 test_str = PyBytes_AS_STRING(unicode);
     618           0 :                         } else if (PyBytes_Check(value)) {
     619           0 :                                 test_str = PyBytes_AS_STRING(value);
     620             :                         } else {
     621           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
     622           0 :                                 return -1;
     623             :                         }
     624           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
     625           0 :                         if (unicode != NULL) {
     626           0 :                                 Py_DECREF(unicode);
     627             :                         }
     628           0 :                         if (talloc_str == NULL) {
     629           0 :                                 PyErr_NoMemory();
     630           0 :                                 return -1;
     631             :                         }
     632           0 :                         object->user = talloc_str;
     633             :                 }
     634             :         }
     635           0 :         return 0;
     636             : }
     637             : 
     638           0 : static PyObject *py_srvsvc_NetCharDevInfo1_get_time(PyObject *obj, void *closure)
     639             : {
     640           0 :         struct srvsvc_NetCharDevInfo1 *object = (struct srvsvc_NetCharDevInfo1 *)pytalloc_get_ptr(obj);
     641             :         PyObject *py_time;
     642           0 :         py_time = PyLong_FromUnsignedLongLong((uint32_t)object->time);
     643           0 :         return py_time;
     644             : }
     645             : 
     646           0 : static int py_srvsvc_NetCharDevInfo1_set_time(PyObject *py_obj, PyObject *value, void *closure)
     647             : {
     648           0 :         struct srvsvc_NetCharDevInfo1 *object = (struct srvsvc_NetCharDevInfo1 *)pytalloc_get_ptr(py_obj);
     649           0 :         if (value == NULL) {
     650           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->time");
     651           0 :                 return -1;
     652             :         }
     653             :         {
     654           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time));
     655           0 :                 if (PyLong_Check(value)) {
     656             :                         unsigned long long test_var;
     657           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     658           0 :                         if (PyErr_Occurred() != NULL) {
     659           0 :                                 return -1;
     660             :                         }
     661           0 :                         if (test_var > uint_max) {
     662           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     663             :                                   PyLong_Type.tp_name, uint_max, test_var);
     664           0 :                                 return -1;
     665             :                         }
     666           0 :                         object->time = test_var;
     667             :                 } else {
     668           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     669             :                           PyLong_Type.tp_name);
     670           0 :                         return -1;
     671             :                 }
     672             :         }
     673           0 :         return 0;
     674             : }
     675             : 
     676             : static PyGetSetDef py_srvsvc_NetCharDevInfo1_getsetters[] = {
     677             :         {
     678             :                 .name = discard_const_p(char, "device"),
     679             :                 .get = py_srvsvc_NetCharDevInfo1_get_device,
     680             :                 .set = py_srvsvc_NetCharDevInfo1_set_device,
     681             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
     682             :         },
     683             :         {
     684             :                 .name = discard_const_p(char, "status"),
     685             :                 .get = py_srvsvc_NetCharDevInfo1_get_status,
     686             :                 .set = py_srvsvc_NetCharDevInfo1_set_status,
     687             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     688             :         },
     689             :         {
     690             :                 .name = discard_const_p(char, "user"),
     691             :                 .get = py_srvsvc_NetCharDevInfo1_get_user,
     692             :                 .set = py_srvsvc_NetCharDevInfo1_set_user,
     693             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
     694             :         },
     695             :         {
     696             :                 .name = discard_const_p(char, "time"),
     697             :                 .get = py_srvsvc_NetCharDevInfo1_get_time,
     698             :                 .set = py_srvsvc_NetCharDevInfo1_set_time,
     699             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     700             :         },
     701             :         { .name = NULL }
     702             : };
     703             : 
     704           0 : static PyObject *py_srvsvc_NetCharDevInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     705             : {
     706           0 :         return pytalloc_new(struct srvsvc_NetCharDevInfo1, type);
     707             : }
     708             : 
     709             : 
     710             : static PyTypeObject srvsvc_NetCharDevInfo1_Type = {
     711             :         PyVarObject_HEAD_INIT(NULL, 0)
     712             :         .tp_name = "srvsvc.NetCharDevInfo1",
     713             :         .tp_getset = py_srvsvc_NetCharDevInfo1_getsetters,
     714             :         .tp_methods = NULL,
     715             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     716             :         .tp_new = py_srvsvc_NetCharDevInfo1_new,
     717             : };
     718             : 
     719             : 
     720           0 : static PyObject *py_srvsvc_NetCharDevCtr1_get_count(PyObject *obj, void *closure)
     721             : {
     722           0 :         struct srvsvc_NetCharDevCtr1 *object = (struct srvsvc_NetCharDevCtr1 *)pytalloc_get_ptr(obj);
     723             :         PyObject *py_count;
     724           0 :         py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
     725           0 :         return py_count;
     726             : }
     727             : 
     728           0 : static int py_srvsvc_NetCharDevCtr1_set_count(PyObject *py_obj, PyObject *value, void *closure)
     729             : {
     730           0 :         struct srvsvc_NetCharDevCtr1 *object = (struct srvsvc_NetCharDevCtr1 *)pytalloc_get_ptr(py_obj);
     731           0 :         if (value == NULL) {
     732           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
     733           0 :                 return -1;
     734             :         }
     735             :         {
     736           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
     737           0 :                 if (PyLong_Check(value)) {
     738             :                         unsigned long long test_var;
     739           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
     740           0 :                         if (PyErr_Occurred() != NULL) {
     741           0 :                                 return -1;
     742             :                         }
     743           0 :                         if (test_var > uint_max) {
     744           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
     745             :                                   PyLong_Type.tp_name, uint_max, test_var);
     746           0 :                                 return -1;
     747             :                         }
     748           0 :                         object->count = test_var;
     749             :                 } else {
     750           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
     751             :                           PyLong_Type.tp_name);
     752           0 :                         return -1;
     753             :                 }
     754             :         }
     755           0 :         return 0;
     756             : }
     757             : 
     758           0 : static PyObject *py_srvsvc_NetCharDevCtr1_get_array(PyObject *obj, void *closure)
     759             : {
     760           0 :         struct srvsvc_NetCharDevCtr1 *object = (struct srvsvc_NetCharDevCtr1 *)pytalloc_get_ptr(obj);
     761             :         PyObject *py_array;
     762           0 :         if (object->array == NULL) {
     763           0 :                 Py_RETURN_NONE;
     764             :         }
     765           0 :         if (object->array == NULL) {
     766           0 :                 py_array = Py_None;
     767           0 :                 Py_INCREF(py_array);
     768             :         } else {
     769           0 :                 py_array = PyList_New(object->count);
     770           0 :                 if (py_array == NULL) {
     771           0 :                         return NULL;
     772             :                 }
     773             :                 {
     774             :                         int array_cntr_1;
     775           0 :                         for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
     776             :                                 PyObject *py_array_1;
     777           0 :                                 py_array_1 = pytalloc_reference_ex(&srvsvc_NetCharDevInfo1_Type, object->array, &object->array[array_cntr_1]);
     778           0 :                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
     779             :                         }
     780             :                 }
     781             :         }
     782           0 :         return py_array;
     783             : }
     784             : 
     785           0 : static int py_srvsvc_NetCharDevCtr1_set_array(PyObject *py_obj, PyObject *value, void *closure)
     786             : {
     787           0 :         struct srvsvc_NetCharDevCtr1 *object = (struct srvsvc_NetCharDevCtr1 *)pytalloc_get_ptr(py_obj);
     788           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
     789           0 :         if (value == NULL) {
     790           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
     791           0 :                 return -1;
     792             :         }
     793           0 :         if (value == Py_None) {
     794           0 :                 object->array = NULL;
     795             :         } else {
     796           0 :                 object->array = NULL;
     797           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
     798             :                 {
     799             :                         int array_cntr_1;
     800           0 :                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
     801           0 :                         if (!object->array) { return -1;; }
     802           0 :                         talloc_set_name_const(object->array, "ARRAY: object->array");
     803           0 :                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
     804           0 :                                 if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
     805           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
     806           0 :                                         return -1;
     807             :                                 }
     808           0 :                                 PY_CHECK_TYPE(&srvsvc_NetCharDevInfo1_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
     809           0 :                                 if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
     810           0 :                                         PyErr_NoMemory();
     811           0 :                                         return -1;
     812             :                                 }
     813           0 :                                 object->array[array_cntr_1] = *(struct srvsvc_NetCharDevInfo1 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
     814             :                         }
     815             :                 }
     816             :         }
     817           0 :         return 0;
     818             : }
     819             : 
     820             : static PyGetSetDef py_srvsvc_NetCharDevCtr1_getsetters[] = {
     821             :         {
     822             :                 .name = discard_const_p(char, "count"),
     823             :                 .get = py_srvsvc_NetCharDevCtr1_get_count,
     824             :                 .set = py_srvsvc_NetCharDevCtr1_set_count,
     825             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
     826             :         },
     827             :         {
     828             :                 .name = discard_const_p(char, "array"),
     829             :                 .get = py_srvsvc_NetCharDevCtr1_get_array,
     830             :                 .set = py_srvsvc_NetCharDevCtr1_set_array,
     831             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetCharDevInfo1")
     832             :         },
     833             :         { .name = NULL }
     834             : };
     835             : 
     836           0 : static PyObject *py_srvsvc_NetCharDevCtr1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     837             : {
     838           0 :         return pytalloc_new(struct srvsvc_NetCharDevCtr1, type);
     839             : }
     840             : 
     841             : 
     842             : static PyTypeObject srvsvc_NetCharDevCtr1_Type = {
     843             :         PyVarObject_HEAD_INIT(NULL, 0)
     844             :         .tp_name = "srvsvc.NetCharDevCtr1",
     845             :         .tp_getset = py_srvsvc_NetCharDevCtr1_getsetters,
     846             :         .tp_methods = NULL,
     847             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
     848             :         .tp_new = py_srvsvc_NetCharDevCtr1_new,
     849             : };
     850             : 
     851           0 : static PyObject *py_import_srvsvc_NetCharDevInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetCharDevInfo *in)
     852             : {
     853             :         PyObject *ret;
     854             : 
     855           0 :         switch (level) {
     856           0 :                 case 0:
     857           0 :                         if (in->info0 == NULL) {
     858           0 :                                 ret = Py_None;
     859           0 :                                 Py_INCREF(ret);
     860             :                         } else {
     861           0 :                                 ret = pytalloc_reference_ex(&srvsvc_NetCharDevInfo0_Type, in->info0, in->info0);
     862             :                         }
     863           0 :                         return ret;
     864             : 
     865           0 :                 case 1:
     866           0 :                         if (in->info1 == NULL) {
     867           0 :                                 ret = Py_None;
     868           0 :                                 Py_INCREF(ret);
     869             :                         } else {
     870           0 :                                 ret = pytalloc_reference_ex(&srvsvc_NetCharDevInfo1_Type, in->info1, in->info1);
     871             :                         }
     872           0 :                         return ret;
     873             : 
     874           0 :                 default:
     875           0 :                         ret = Py_None;
     876           0 :                         Py_INCREF(ret);
     877           0 :                         return ret;
     878             : 
     879             :         }
     880             :         PyErr_SetString(PyExc_TypeError, "unknown union level");
     881             :         return NULL;
     882             : }
     883             : 
     884           0 : static union srvsvc_NetCharDevInfo *py_export_srvsvc_NetCharDevInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
     885             : {
     886           0 :         union srvsvc_NetCharDevInfo *ret = talloc_zero(mem_ctx, union srvsvc_NetCharDevInfo);
     887           0 :         switch (level) {
     888           0 :                 case 0:
     889           0 :                         if (in == NULL) {
     890           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info0");
     891           0 :                                 talloc_free(ret); return NULL;
     892             :                         }
     893           0 :                         if (in == Py_None) {
     894           0 :                                 ret->info0 = NULL;
     895             :                         } else {
     896           0 :                                 ret->info0 = NULL;
     897           0 :                                 PY_CHECK_TYPE(&srvsvc_NetCharDevInfo0_Type, in, talloc_free(ret); return NULL;);
     898           0 :                                 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
     899           0 :                                         PyErr_NoMemory();
     900           0 :                                         talloc_free(ret); return NULL;
     901             :                                 }
     902           0 :                                 ret->info0 = (struct srvsvc_NetCharDevInfo0 *)pytalloc_get_ptr(in);
     903             :                         }
     904           0 :                         break;
     905             : 
     906           0 :                 case 1:
     907           0 :                         if (in == NULL) {
     908           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info1");
     909           0 :                                 talloc_free(ret); return NULL;
     910             :                         }
     911           0 :                         if (in == Py_None) {
     912           0 :                                 ret->info1 = NULL;
     913             :                         } else {
     914           0 :                                 ret->info1 = NULL;
     915           0 :                                 PY_CHECK_TYPE(&srvsvc_NetCharDevInfo1_Type, in, talloc_free(ret); return NULL;);
     916           0 :                                 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
     917           0 :                                         PyErr_NoMemory();
     918           0 :                                         talloc_free(ret); return NULL;
     919             :                                 }
     920           0 :                                 ret->info1 = (struct srvsvc_NetCharDevInfo1 *)pytalloc_get_ptr(in);
     921             :                         }
     922           0 :                         break;
     923             : 
     924           0 :                 default:
     925           0 :                         break;
     926             : 
     927             :         }
     928             : 
     929           0 :         return ret;
     930             : }
     931             : 
     932           0 : static PyObject *py_srvsvc_NetCharDevInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     933             : {
     934           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
     935           0 :         PyObject *mem_ctx_obj = NULL;
     936           0 :         TALLOC_CTX *mem_ctx = NULL;
     937           0 :         int level = 0;
     938           0 :         PyObject *in_obj = NULL;
     939           0 :         union srvsvc_NetCharDevInfo *in = NULL;
     940             : 
     941           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
     942             :                 discard_const_p(char *, kwnames),
     943             :                 &mem_ctx_obj,
     944             :                 &level,
     945             :                 &in_obj)) {
     946           0 :                 return NULL;
     947             :         }
     948           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
     949           0 :         if (mem_ctx == NULL) {
     950           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
     951           0 :                 return NULL;
     952             :         }
     953           0 :         in = (union srvsvc_NetCharDevInfo *)pytalloc_get_ptr(in_obj);
     954           0 :         if (in == NULL) {
     955           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union srvsvc_NetCharDevInfo!");
     956           0 :                 return NULL;
     957             :         }
     958             : 
     959           0 :         return py_import_srvsvc_NetCharDevInfo(mem_ctx, level, in);
     960             : }
     961             : 
     962           0 : static PyObject *py_srvsvc_NetCharDevInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
     963             : {
     964           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
     965           0 :         PyObject *mem_ctx_obj = NULL;
     966           0 :         TALLOC_CTX *mem_ctx = NULL;
     967           0 :         int level = 0;
     968           0 :         PyObject *in = NULL;
     969           0 :         union srvsvc_NetCharDevInfo *out = NULL;
     970             : 
     971           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
     972             :                 discard_const_p(char *, kwnames),
     973             :                 &mem_ctx_obj,
     974             :                 &level,
     975             :                 &in)) {
     976           0 :                 return NULL;
     977             :         }
     978           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
     979           0 :         if (mem_ctx == NULL) {
     980           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
     981           0 :                 return NULL;
     982             :         }
     983             : 
     984           0 :         out = py_export_srvsvc_NetCharDevInfo(mem_ctx, level, in);
     985           0 :         if (out == NULL) {
     986           0 :                 return NULL;
     987             :         }
     988             : 
     989           0 :         return pytalloc_GenericObject_reference(out);
     990             : }
     991             : 
     992             : static PyMethodDef py_srvsvc_NetCharDevInfo_methods[] = {
     993             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_srvsvc_NetCharDevInfo_import),
     994             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
     995             :                 "T.__import__(mem_ctx, level, in) => ret." },
     996             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_srvsvc_NetCharDevInfo_export),
     997             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
     998             :                 "T.__export__(mem_ctx, level, in) => ret." },
     999             :         { NULL, NULL, 0, NULL }
    1000             : };
    1001             : 
    1002           0 : static PyObject *py_srvsvc_NetCharDevInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1003             : {
    1004           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
    1005           0 :         return NULL;
    1006             : }
    1007             : 
    1008             : 
    1009             : static PyTypeObject srvsvc_NetCharDevInfo_Type = {
    1010             :         PyVarObject_HEAD_INIT(NULL, 0)
    1011             :         .tp_name = "srvsvc.NetCharDevInfo",
    1012             :         .tp_getset = NULL,
    1013             :         .tp_methods = py_srvsvc_NetCharDevInfo_methods,
    1014             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1015             :         .tp_new = py_srvsvc_NetCharDevInfo_new,
    1016             : };
    1017             : 
    1018           0 : static PyObject *py_import_srvsvc_NetCharDevCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetCharDevCtr *in)
    1019             : {
    1020             :         PyObject *ret;
    1021             : 
    1022           0 :         switch (level) {
    1023           0 :                 case 0:
    1024           0 :                         if (in->ctr0 == NULL) {
    1025           0 :                                 ret = Py_None;
    1026           0 :                                 Py_INCREF(ret);
    1027             :                         } else {
    1028           0 :                                 ret = pytalloc_reference_ex(&srvsvc_NetCharDevCtr0_Type, in->ctr0, in->ctr0);
    1029             :                         }
    1030           0 :                         return ret;
    1031             : 
    1032           0 :                 case 1:
    1033           0 :                         if (in->ctr1 == NULL) {
    1034           0 :                                 ret = Py_None;
    1035           0 :                                 Py_INCREF(ret);
    1036             :                         } else {
    1037           0 :                                 ret = pytalloc_reference_ex(&srvsvc_NetCharDevCtr1_Type, in->ctr1, in->ctr1);
    1038             :                         }
    1039           0 :                         return ret;
    1040             : 
    1041           0 :                 default:
    1042           0 :                         ret = Py_None;
    1043           0 :                         Py_INCREF(ret);
    1044           0 :                         return ret;
    1045             : 
    1046             :         }
    1047             :         PyErr_SetString(PyExc_TypeError, "unknown union level");
    1048             :         return NULL;
    1049             : }
    1050             : 
    1051           0 : static union srvsvc_NetCharDevCtr *py_export_srvsvc_NetCharDevCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in)
    1052             : {
    1053           0 :         union srvsvc_NetCharDevCtr *ret = talloc_zero(mem_ctx, union srvsvc_NetCharDevCtr);
    1054           0 :         switch (level) {
    1055           0 :                 case 0:
    1056           0 :                         if (in == NULL) {
    1057           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr0");
    1058           0 :                                 talloc_free(ret); return NULL;
    1059             :                         }
    1060           0 :                         if (in == Py_None) {
    1061           0 :                                 ret->ctr0 = NULL;
    1062             :                         } else {
    1063           0 :                                 ret->ctr0 = NULL;
    1064           0 :                                 PY_CHECK_TYPE(&srvsvc_NetCharDevCtr0_Type, in, talloc_free(ret); return NULL;);
    1065           0 :                                 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1066           0 :                                         PyErr_NoMemory();
    1067           0 :                                         talloc_free(ret); return NULL;
    1068             :                                 }
    1069           0 :                                 ret->ctr0 = (struct srvsvc_NetCharDevCtr0 *)pytalloc_get_ptr(in);
    1070             :                         }
    1071           0 :                         break;
    1072             : 
    1073           0 :                 case 1:
    1074           0 :                         if (in == NULL) {
    1075           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr1");
    1076           0 :                                 talloc_free(ret); return NULL;
    1077             :                         }
    1078           0 :                         if (in == Py_None) {
    1079           0 :                                 ret->ctr1 = NULL;
    1080             :                         } else {
    1081           0 :                                 ret->ctr1 = NULL;
    1082           0 :                                 PY_CHECK_TYPE(&srvsvc_NetCharDevCtr1_Type, in, talloc_free(ret); return NULL;);
    1083           0 :                                 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1084           0 :                                         PyErr_NoMemory();
    1085           0 :                                         talloc_free(ret); return NULL;
    1086             :                                 }
    1087           0 :                                 ret->ctr1 = (struct srvsvc_NetCharDevCtr1 *)pytalloc_get_ptr(in);
    1088             :                         }
    1089           0 :                         break;
    1090             : 
    1091           0 :                 default:
    1092           0 :                         break;
    1093             : 
    1094             :         }
    1095             : 
    1096           0 :         return ret;
    1097             : }
    1098             : 
    1099           0 : static PyObject *py_srvsvc_NetCharDevCtr_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1100             : {
    1101           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    1102           0 :         PyObject *mem_ctx_obj = NULL;
    1103           0 :         TALLOC_CTX *mem_ctx = NULL;
    1104           0 :         int level = 0;
    1105           0 :         PyObject *in_obj = NULL;
    1106           0 :         union srvsvc_NetCharDevCtr *in = NULL;
    1107             : 
    1108           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
    1109             :                 discard_const_p(char *, kwnames),
    1110             :                 &mem_ctx_obj,
    1111             :                 &level,
    1112             :                 &in_obj)) {
    1113           0 :                 return NULL;
    1114             :         }
    1115           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    1116           0 :         if (mem_ctx == NULL) {
    1117           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    1118           0 :                 return NULL;
    1119             :         }
    1120           0 :         in = (union srvsvc_NetCharDevCtr *)pytalloc_get_ptr(in_obj);
    1121           0 :         if (in == NULL) {
    1122           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union srvsvc_NetCharDevCtr!");
    1123           0 :                 return NULL;
    1124             :         }
    1125             : 
    1126           0 :         return py_import_srvsvc_NetCharDevCtr(mem_ctx, level, in);
    1127             : }
    1128             : 
    1129           0 : static PyObject *py_srvsvc_NetCharDevCtr_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1130             : {
    1131           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    1132           0 :         PyObject *mem_ctx_obj = NULL;
    1133           0 :         TALLOC_CTX *mem_ctx = NULL;
    1134           0 :         int level = 0;
    1135           0 :         PyObject *in = NULL;
    1136           0 :         union srvsvc_NetCharDevCtr *out = NULL;
    1137             : 
    1138           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
    1139             :                 discard_const_p(char *, kwnames),
    1140             :                 &mem_ctx_obj,
    1141             :                 &level,
    1142             :                 &in)) {
    1143           0 :                 return NULL;
    1144             :         }
    1145           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    1146           0 :         if (mem_ctx == NULL) {
    1147           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    1148           0 :                 return NULL;
    1149             :         }
    1150             : 
    1151           0 :         out = py_export_srvsvc_NetCharDevCtr(mem_ctx, level, in);
    1152           0 :         if (out == NULL) {
    1153           0 :                 return NULL;
    1154             :         }
    1155             : 
    1156           0 :         return pytalloc_GenericObject_reference(out);
    1157             : }
    1158             : 
    1159             : static PyMethodDef py_srvsvc_NetCharDevCtr_methods[] = {
    1160             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_srvsvc_NetCharDevCtr_import),
    1161             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    1162             :                 "T.__import__(mem_ctx, level, in) => ret." },
    1163             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_srvsvc_NetCharDevCtr_export),
    1164             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    1165             :                 "T.__export__(mem_ctx, level, in) => ret." },
    1166             :         { NULL, NULL, 0, NULL }
    1167             : };
    1168             : 
    1169           0 : static PyObject *py_srvsvc_NetCharDevCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1170             : {
    1171           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
    1172           0 :         return NULL;
    1173             : }
    1174             : 
    1175             : 
    1176             : static PyTypeObject srvsvc_NetCharDevCtr_Type = {
    1177             :         PyVarObject_HEAD_INIT(NULL, 0)
    1178             :         .tp_name = "srvsvc.NetCharDevCtr",
    1179             :         .tp_getset = NULL,
    1180             :         .tp_methods = py_srvsvc_NetCharDevCtr_methods,
    1181             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1182             :         .tp_new = py_srvsvc_NetCharDevCtr_new,
    1183             : };
    1184             : 
    1185             : 
    1186           0 : static PyObject *py_srvsvc_NetCharDevInfoCtr_get_level(PyObject *obj, void *closure)
    1187             : {
    1188           0 :         struct srvsvc_NetCharDevInfoCtr *object = (struct srvsvc_NetCharDevInfoCtr *)pytalloc_get_ptr(obj);
    1189             :         PyObject *py_level;
    1190           0 :         py_level = PyLong_FromUnsignedLongLong((uint32_t)object->level);
    1191           0 :         return py_level;
    1192             : }
    1193             : 
    1194           0 : static int py_srvsvc_NetCharDevInfoCtr_set_level(PyObject *py_obj, PyObject *value, void *closure)
    1195             : {
    1196           0 :         struct srvsvc_NetCharDevInfoCtr *object = (struct srvsvc_NetCharDevInfoCtr *)pytalloc_get_ptr(py_obj);
    1197           0 :         if (value == NULL) {
    1198           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->level");
    1199           0 :                 return -1;
    1200             :         }
    1201             :         {
    1202           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level));
    1203           0 :                 if (PyLong_Check(value)) {
    1204             :                         unsigned long long test_var;
    1205           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1206           0 :                         if (PyErr_Occurred() != NULL) {
    1207           0 :                                 return -1;
    1208             :                         }
    1209           0 :                         if (test_var > uint_max) {
    1210           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1211             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1212           0 :                                 return -1;
    1213             :                         }
    1214           0 :                         object->level = test_var;
    1215             :                 } else {
    1216           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1217             :                           PyLong_Type.tp_name);
    1218           0 :                         return -1;
    1219             :                 }
    1220             :         }
    1221           0 :         return 0;
    1222             : }
    1223             : 
    1224           0 : static PyObject *py_srvsvc_NetCharDevInfoCtr_get_ctr(PyObject *obj, void *closure)
    1225             : {
    1226           0 :         struct srvsvc_NetCharDevInfoCtr *object = (struct srvsvc_NetCharDevInfoCtr *)pytalloc_get_ptr(obj);
    1227             :         PyObject *py_ctr;
    1228           0 :         py_ctr = pyrpc_import_union(&srvsvc_NetCharDevCtr_Type, pytalloc_get_mem_ctx(obj), object->level, &object->ctr, "union srvsvc_NetCharDevCtr");
    1229           0 :         if (py_ctr == NULL) {
    1230           0 :                 return NULL;
    1231             :         }
    1232           0 :         return py_ctr;
    1233             : }
    1234             : 
    1235           0 : static int py_srvsvc_NetCharDevInfoCtr_set_ctr(PyObject *py_obj, PyObject *value, void *closure)
    1236             : {
    1237           0 :         struct srvsvc_NetCharDevInfoCtr *object = (struct srvsvc_NetCharDevInfoCtr *)pytalloc_get_ptr(py_obj);
    1238           0 :         if (value == NULL) {
    1239           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ctr");
    1240           0 :                 return -1;
    1241             :         }
    1242             :         {
    1243             :                 union srvsvc_NetCharDevCtr *ctr_switch_0;
    1244           0 :                 ctr_switch_0 = (union srvsvc_NetCharDevCtr *)pyrpc_export_union(&srvsvc_NetCharDevCtr_Type, pytalloc_get_mem_ctx(py_obj), object->level, value, "union srvsvc_NetCharDevCtr");
    1245           0 :                 if (ctr_switch_0 == NULL) {
    1246           0 :                         return -1;
    1247             :                 }
    1248           0 :                 object->ctr = *ctr_switch_0;
    1249             :         }
    1250           0 :         return 0;
    1251             : }
    1252             : 
    1253             : static PyGetSetDef py_srvsvc_NetCharDevInfoCtr_getsetters[] = {
    1254             :         {
    1255             :                 .name = discard_const_p(char, "level"),
    1256             :                 .get = py_srvsvc_NetCharDevInfoCtr_get_level,
    1257             :                 .set = py_srvsvc_NetCharDevInfoCtr_set_level,
    1258             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1259             :         },
    1260             :         {
    1261             :                 .name = discard_const_p(char, "ctr"),
    1262             :                 .get = py_srvsvc_NetCharDevInfoCtr_get_ctr,
    1263             :                 .set = py_srvsvc_NetCharDevInfoCtr_set_ctr,
    1264             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetCharDevCtr")
    1265             :         },
    1266             :         { .name = NULL }
    1267             : };
    1268             : 
    1269           0 : static PyObject *py_srvsvc_NetCharDevInfoCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1270             : {
    1271           0 :         return pytalloc_new(struct srvsvc_NetCharDevInfoCtr, type);
    1272             : }
    1273             : 
    1274             : 
    1275             : static PyTypeObject srvsvc_NetCharDevInfoCtr_Type = {
    1276             :         PyVarObject_HEAD_INIT(NULL, 0)
    1277             :         .tp_name = "srvsvc.NetCharDevInfoCtr",
    1278             :         .tp_getset = py_srvsvc_NetCharDevInfoCtr_getsetters,
    1279             :         .tp_methods = NULL,
    1280             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1281             :         .tp_new = py_srvsvc_NetCharDevInfoCtr_new,
    1282             : };
    1283             : 
    1284             : 
    1285           0 : static PyObject *py_srvsvc_NetCharDevQInfo0_get_device(PyObject *obj, void *closure)
    1286             : {
    1287           0 :         struct srvsvc_NetCharDevQInfo0 *object = (struct srvsvc_NetCharDevQInfo0 *)pytalloc_get_ptr(obj);
    1288             :         PyObject *py_device;
    1289           0 :         if (object->device == NULL) {
    1290           0 :                 Py_RETURN_NONE;
    1291             :         }
    1292           0 :         if (object->device == NULL) {
    1293           0 :                 py_device = Py_None;
    1294           0 :                 Py_INCREF(py_device);
    1295             :         } else {
    1296           0 :                 if (object->device == NULL) {
    1297           0 :                         py_device = Py_None;
    1298           0 :                         Py_INCREF(py_device);
    1299             :                 } else {
    1300           0 :                         py_device = PyUnicode_Decode(object->device, strlen(object->device), "utf-8", "ignore");
    1301             :                 }
    1302             :         }
    1303           0 :         return py_device;
    1304             : }
    1305             : 
    1306           0 : static int py_srvsvc_NetCharDevQInfo0_set_device(PyObject *py_obj, PyObject *value, void *closure)
    1307             : {
    1308           0 :         struct srvsvc_NetCharDevQInfo0 *object = (struct srvsvc_NetCharDevQInfo0 *)pytalloc_get_ptr(py_obj);
    1309           0 :         if (value == NULL) {
    1310           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->device");
    1311           0 :                 return -1;
    1312             :         }
    1313           0 :         if (value == Py_None) {
    1314           0 :                 object->device = NULL;
    1315             :         } else {
    1316           0 :                 object->device = NULL;
    1317             :                 {
    1318             :                         const char *test_str;
    1319             :                         const char *talloc_str;
    1320           0 :                         PyObject *unicode = NULL;
    1321           0 :                         if (PyUnicode_Check(value)) {
    1322           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    1323           0 :                                 if (unicode == NULL) {
    1324           0 :                                         PyErr_NoMemory();
    1325           0 :                                         return -1;
    1326             :                                 }
    1327           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    1328           0 :                         } else if (PyBytes_Check(value)) {
    1329           0 :                                 test_str = PyBytes_AS_STRING(value);
    1330             :                         } else {
    1331           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    1332           0 :                                 return -1;
    1333             :                         }
    1334           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    1335           0 :                         if (unicode != NULL) {
    1336           0 :                                 Py_DECREF(unicode);
    1337             :                         }
    1338           0 :                         if (talloc_str == NULL) {
    1339           0 :                                 PyErr_NoMemory();
    1340           0 :                                 return -1;
    1341             :                         }
    1342           0 :                         object->device = talloc_str;
    1343             :                 }
    1344             :         }
    1345           0 :         return 0;
    1346             : }
    1347             : 
    1348             : static PyGetSetDef py_srvsvc_NetCharDevQInfo0_getsetters[] = {
    1349             :         {
    1350             :                 .name = discard_const_p(char, "device"),
    1351             :                 .get = py_srvsvc_NetCharDevQInfo0_get_device,
    1352             :                 .set = py_srvsvc_NetCharDevQInfo0_set_device,
    1353             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1354             :         },
    1355             :         { .name = NULL }
    1356             : };
    1357             : 
    1358           0 : static PyObject *py_srvsvc_NetCharDevQInfo0_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1359             : {
    1360           0 :         return pytalloc_new(struct srvsvc_NetCharDevQInfo0, type);
    1361             : }
    1362             : 
    1363             : 
    1364             : static PyTypeObject srvsvc_NetCharDevQInfo0_Type = {
    1365             :         PyVarObject_HEAD_INIT(NULL, 0)
    1366             :         .tp_name = "srvsvc.NetCharDevQInfo0",
    1367             :         .tp_getset = py_srvsvc_NetCharDevQInfo0_getsetters,
    1368             :         .tp_methods = NULL,
    1369             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1370             :         .tp_new = py_srvsvc_NetCharDevQInfo0_new,
    1371             : };
    1372             : 
    1373             : 
    1374           0 : static PyObject *py_srvsvc_NetCharDevQCtr0_get_count(PyObject *obj, void *closure)
    1375             : {
    1376           0 :         struct srvsvc_NetCharDevQCtr0 *object = (struct srvsvc_NetCharDevQCtr0 *)pytalloc_get_ptr(obj);
    1377             :         PyObject *py_count;
    1378           0 :         py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
    1379           0 :         return py_count;
    1380             : }
    1381             : 
    1382           0 : static int py_srvsvc_NetCharDevQCtr0_set_count(PyObject *py_obj, PyObject *value, void *closure)
    1383             : {
    1384           0 :         struct srvsvc_NetCharDevQCtr0 *object = (struct srvsvc_NetCharDevQCtr0 *)pytalloc_get_ptr(py_obj);
    1385           0 :         if (value == NULL) {
    1386           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
    1387           0 :                 return -1;
    1388             :         }
    1389             :         {
    1390           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
    1391           0 :                 if (PyLong_Check(value)) {
    1392             :                         unsigned long long test_var;
    1393           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1394           0 :                         if (PyErr_Occurred() != NULL) {
    1395           0 :                                 return -1;
    1396             :                         }
    1397           0 :                         if (test_var > uint_max) {
    1398           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1399             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1400           0 :                                 return -1;
    1401             :                         }
    1402           0 :                         object->count = test_var;
    1403             :                 } else {
    1404           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1405             :                           PyLong_Type.tp_name);
    1406           0 :                         return -1;
    1407             :                 }
    1408             :         }
    1409           0 :         return 0;
    1410             : }
    1411             : 
    1412           0 : static PyObject *py_srvsvc_NetCharDevQCtr0_get_array(PyObject *obj, void *closure)
    1413             : {
    1414           0 :         struct srvsvc_NetCharDevQCtr0 *object = (struct srvsvc_NetCharDevQCtr0 *)pytalloc_get_ptr(obj);
    1415             :         PyObject *py_array;
    1416           0 :         if (object->array == NULL) {
    1417           0 :                 Py_RETURN_NONE;
    1418             :         }
    1419           0 :         if (object->array == NULL) {
    1420           0 :                 py_array = Py_None;
    1421           0 :                 Py_INCREF(py_array);
    1422             :         } else {
    1423           0 :                 py_array = PyList_New(object->count);
    1424           0 :                 if (py_array == NULL) {
    1425           0 :                         return NULL;
    1426             :                 }
    1427             :                 {
    1428             :                         int array_cntr_1;
    1429           0 :                         for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
    1430             :                                 PyObject *py_array_1;
    1431           0 :                                 py_array_1 = pytalloc_reference_ex(&srvsvc_NetCharDevQInfo0_Type, object->array, &object->array[array_cntr_1]);
    1432           0 :                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
    1433             :                         }
    1434             :                 }
    1435             :         }
    1436           0 :         return py_array;
    1437             : }
    1438             : 
    1439           0 : static int py_srvsvc_NetCharDevQCtr0_set_array(PyObject *py_obj, PyObject *value, void *closure)
    1440             : {
    1441           0 :         struct srvsvc_NetCharDevQCtr0 *object = (struct srvsvc_NetCharDevQCtr0 *)pytalloc_get_ptr(py_obj);
    1442           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
    1443           0 :         if (value == NULL) {
    1444           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
    1445           0 :                 return -1;
    1446             :         }
    1447           0 :         if (value == Py_None) {
    1448           0 :                 object->array = NULL;
    1449             :         } else {
    1450           0 :                 object->array = NULL;
    1451           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    1452             :                 {
    1453             :                         int array_cntr_1;
    1454           0 :                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
    1455           0 :                         if (!object->array) { return -1;; }
    1456           0 :                         talloc_set_name_const(object->array, "ARRAY: object->array");
    1457           0 :                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
    1458           0 :                                 if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
    1459           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
    1460           0 :                                         return -1;
    1461             :                                 }
    1462           0 :                                 PY_CHECK_TYPE(&srvsvc_NetCharDevQInfo0_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
    1463           0 :                                 if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
    1464           0 :                                         PyErr_NoMemory();
    1465           0 :                                         return -1;
    1466             :                                 }
    1467           0 :                                 object->array[array_cntr_1] = *(struct srvsvc_NetCharDevQInfo0 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
    1468             :                         }
    1469             :                 }
    1470             :         }
    1471           0 :         return 0;
    1472             : }
    1473             : 
    1474             : static PyGetSetDef py_srvsvc_NetCharDevQCtr0_getsetters[] = {
    1475             :         {
    1476             :                 .name = discard_const_p(char, "count"),
    1477             :                 .get = py_srvsvc_NetCharDevQCtr0_get_count,
    1478             :                 .set = py_srvsvc_NetCharDevQCtr0_set_count,
    1479             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1480             :         },
    1481             :         {
    1482             :                 .name = discard_const_p(char, "array"),
    1483             :                 .get = py_srvsvc_NetCharDevQCtr0_get_array,
    1484             :                 .set = py_srvsvc_NetCharDevQCtr0_set_array,
    1485             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetCharDevQInfo0")
    1486             :         },
    1487             :         { .name = NULL }
    1488             : };
    1489             : 
    1490           0 : static PyObject *py_srvsvc_NetCharDevQCtr0_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1491             : {
    1492           0 :         return pytalloc_new(struct srvsvc_NetCharDevQCtr0, type);
    1493             : }
    1494             : 
    1495             : 
    1496             : static PyTypeObject srvsvc_NetCharDevQCtr0_Type = {
    1497             :         PyVarObject_HEAD_INIT(NULL, 0)
    1498             :         .tp_name = "srvsvc.NetCharDevQCtr0",
    1499             :         .tp_getset = py_srvsvc_NetCharDevQCtr0_getsetters,
    1500             :         .tp_methods = NULL,
    1501             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1502             :         .tp_new = py_srvsvc_NetCharDevQCtr0_new,
    1503             : };
    1504             : 
    1505             : 
    1506           0 : static PyObject *py_srvsvc_NetCharDevQInfo1_get_device(PyObject *obj, void *closure)
    1507             : {
    1508           0 :         struct srvsvc_NetCharDevQInfo1 *object = (struct srvsvc_NetCharDevQInfo1 *)pytalloc_get_ptr(obj);
    1509             :         PyObject *py_device;
    1510           0 :         if (object->device == NULL) {
    1511           0 :                 Py_RETURN_NONE;
    1512             :         }
    1513           0 :         if (object->device == NULL) {
    1514           0 :                 py_device = Py_None;
    1515           0 :                 Py_INCREF(py_device);
    1516             :         } else {
    1517           0 :                 if (object->device == NULL) {
    1518           0 :                         py_device = Py_None;
    1519           0 :                         Py_INCREF(py_device);
    1520             :                 } else {
    1521           0 :                         py_device = PyUnicode_Decode(object->device, strlen(object->device), "utf-8", "ignore");
    1522             :                 }
    1523             :         }
    1524           0 :         return py_device;
    1525             : }
    1526             : 
    1527           0 : static int py_srvsvc_NetCharDevQInfo1_set_device(PyObject *py_obj, PyObject *value, void *closure)
    1528             : {
    1529           0 :         struct srvsvc_NetCharDevQInfo1 *object = (struct srvsvc_NetCharDevQInfo1 *)pytalloc_get_ptr(py_obj);
    1530           0 :         if (value == NULL) {
    1531           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->device");
    1532           0 :                 return -1;
    1533             :         }
    1534           0 :         if (value == Py_None) {
    1535           0 :                 object->device = NULL;
    1536             :         } else {
    1537           0 :                 object->device = NULL;
    1538             :                 {
    1539             :                         const char *test_str;
    1540             :                         const char *talloc_str;
    1541           0 :                         PyObject *unicode = NULL;
    1542           0 :                         if (PyUnicode_Check(value)) {
    1543           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    1544           0 :                                 if (unicode == NULL) {
    1545           0 :                                         PyErr_NoMemory();
    1546           0 :                                         return -1;
    1547             :                                 }
    1548           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    1549           0 :                         } else if (PyBytes_Check(value)) {
    1550           0 :                                 test_str = PyBytes_AS_STRING(value);
    1551             :                         } else {
    1552           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    1553           0 :                                 return -1;
    1554             :                         }
    1555           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    1556           0 :                         if (unicode != NULL) {
    1557           0 :                                 Py_DECREF(unicode);
    1558             :                         }
    1559           0 :                         if (talloc_str == NULL) {
    1560           0 :                                 PyErr_NoMemory();
    1561           0 :                                 return -1;
    1562             :                         }
    1563           0 :                         object->device = talloc_str;
    1564             :                 }
    1565             :         }
    1566           0 :         return 0;
    1567             : }
    1568             : 
    1569           0 : static PyObject *py_srvsvc_NetCharDevQInfo1_get_priority(PyObject *obj, void *closure)
    1570             : {
    1571           0 :         struct srvsvc_NetCharDevQInfo1 *object = (struct srvsvc_NetCharDevQInfo1 *)pytalloc_get_ptr(obj);
    1572             :         PyObject *py_priority;
    1573           0 :         py_priority = PyLong_FromUnsignedLongLong((uint32_t)object->priority);
    1574           0 :         return py_priority;
    1575             : }
    1576             : 
    1577           0 : static int py_srvsvc_NetCharDevQInfo1_set_priority(PyObject *py_obj, PyObject *value, void *closure)
    1578             : {
    1579           0 :         struct srvsvc_NetCharDevQInfo1 *object = (struct srvsvc_NetCharDevQInfo1 *)pytalloc_get_ptr(py_obj);
    1580           0 :         if (value == NULL) {
    1581           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->priority");
    1582           0 :                 return -1;
    1583             :         }
    1584             :         {
    1585           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->priority));
    1586           0 :                 if (PyLong_Check(value)) {
    1587             :                         unsigned long long test_var;
    1588           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1589           0 :                         if (PyErr_Occurred() != NULL) {
    1590           0 :                                 return -1;
    1591             :                         }
    1592           0 :                         if (test_var > uint_max) {
    1593           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1594             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1595           0 :                                 return -1;
    1596             :                         }
    1597           0 :                         object->priority = test_var;
    1598             :                 } else {
    1599           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1600             :                           PyLong_Type.tp_name);
    1601           0 :                         return -1;
    1602             :                 }
    1603             :         }
    1604           0 :         return 0;
    1605             : }
    1606             : 
    1607           0 : static PyObject *py_srvsvc_NetCharDevQInfo1_get_devices(PyObject *obj, void *closure)
    1608             : {
    1609           0 :         struct srvsvc_NetCharDevQInfo1 *object = (struct srvsvc_NetCharDevQInfo1 *)pytalloc_get_ptr(obj);
    1610             :         PyObject *py_devices;
    1611           0 :         if (object->devices == NULL) {
    1612           0 :                 Py_RETURN_NONE;
    1613             :         }
    1614           0 :         if (object->devices == NULL) {
    1615           0 :                 py_devices = Py_None;
    1616           0 :                 Py_INCREF(py_devices);
    1617             :         } else {
    1618           0 :                 if (object->devices == NULL) {
    1619           0 :                         py_devices = Py_None;
    1620           0 :                         Py_INCREF(py_devices);
    1621             :                 } else {
    1622           0 :                         py_devices = PyUnicode_Decode(object->devices, strlen(object->devices), "utf-8", "ignore");
    1623             :                 }
    1624             :         }
    1625           0 :         return py_devices;
    1626             : }
    1627             : 
    1628           0 : static int py_srvsvc_NetCharDevQInfo1_set_devices(PyObject *py_obj, PyObject *value, void *closure)
    1629             : {
    1630           0 :         struct srvsvc_NetCharDevQInfo1 *object = (struct srvsvc_NetCharDevQInfo1 *)pytalloc_get_ptr(py_obj);
    1631           0 :         if (value == NULL) {
    1632           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->devices");
    1633           0 :                 return -1;
    1634             :         }
    1635           0 :         if (value == Py_None) {
    1636           0 :                 object->devices = NULL;
    1637             :         } else {
    1638           0 :                 object->devices = NULL;
    1639             :                 {
    1640             :                         const char *test_str;
    1641             :                         const char *talloc_str;
    1642           0 :                         PyObject *unicode = NULL;
    1643           0 :                         if (PyUnicode_Check(value)) {
    1644           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    1645           0 :                                 if (unicode == NULL) {
    1646           0 :                                         PyErr_NoMemory();
    1647           0 :                                         return -1;
    1648             :                                 }
    1649           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    1650           0 :                         } else if (PyBytes_Check(value)) {
    1651           0 :                                 test_str = PyBytes_AS_STRING(value);
    1652             :                         } else {
    1653           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    1654           0 :                                 return -1;
    1655             :                         }
    1656           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    1657           0 :                         if (unicode != NULL) {
    1658           0 :                                 Py_DECREF(unicode);
    1659             :                         }
    1660           0 :                         if (talloc_str == NULL) {
    1661           0 :                                 PyErr_NoMemory();
    1662           0 :                                 return -1;
    1663             :                         }
    1664           0 :                         object->devices = talloc_str;
    1665             :                 }
    1666             :         }
    1667           0 :         return 0;
    1668             : }
    1669             : 
    1670           0 : static PyObject *py_srvsvc_NetCharDevQInfo1_get_users(PyObject *obj, void *closure)
    1671             : {
    1672           0 :         struct srvsvc_NetCharDevQInfo1 *object = (struct srvsvc_NetCharDevQInfo1 *)pytalloc_get_ptr(obj);
    1673             :         PyObject *py_users;
    1674           0 :         py_users = PyLong_FromUnsignedLongLong((uint32_t)object->users);
    1675           0 :         return py_users;
    1676             : }
    1677             : 
    1678           0 : static int py_srvsvc_NetCharDevQInfo1_set_users(PyObject *py_obj, PyObject *value, void *closure)
    1679             : {
    1680           0 :         struct srvsvc_NetCharDevQInfo1 *object = (struct srvsvc_NetCharDevQInfo1 *)pytalloc_get_ptr(py_obj);
    1681           0 :         if (value == NULL) {
    1682           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->users");
    1683           0 :                 return -1;
    1684             :         }
    1685             :         {
    1686           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->users));
    1687           0 :                 if (PyLong_Check(value)) {
    1688             :                         unsigned long long test_var;
    1689           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1690           0 :                         if (PyErr_Occurred() != NULL) {
    1691           0 :                                 return -1;
    1692             :                         }
    1693           0 :                         if (test_var > uint_max) {
    1694           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1695             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1696           0 :                                 return -1;
    1697             :                         }
    1698           0 :                         object->users = test_var;
    1699             :                 } else {
    1700           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1701             :                           PyLong_Type.tp_name);
    1702           0 :                         return -1;
    1703             :                 }
    1704             :         }
    1705           0 :         return 0;
    1706             : }
    1707             : 
    1708           0 : static PyObject *py_srvsvc_NetCharDevQInfo1_get_num_ahead(PyObject *obj, void *closure)
    1709             : {
    1710           0 :         struct srvsvc_NetCharDevQInfo1 *object = (struct srvsvc_NetCharDevQInfo1 *)pytalloc_get_ptr(obj);
    1711             :         PyObject *py_num_ahead;
    1712           0 :         py_num_ahead = PyLong_FromUnsignedLongLong((uint32_t)object->num_ahead);
    1713           0 :         return py_num_ahead;
    1714             : }
    1715             : 
    1716           0 : static int py_srvsvc_NetCharDevQInfo1_set_num_ahead(PyObject *py_obj, PyObject *value, void *closure)
    1717             : {
    1718           0 :         struct srvsvc_NetCharDevQInfo1 *object = (struct srvsvc_NetCharDevQInfo1 *)pytalloc_get_ptr(py_obj);
    1719           0 :         if (value == NULL) {
    1720           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_ahead");
    1721           0 :                 return -1;
    1722             :         }
    1723             :         {
    1724           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_ahead));
    1725           0 :                 if (PyLong_Check(value)) {
    1726             :                         unsigned long long test_var;
    1727           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1728           0 :                         if (PyErr_Occurred() != NULL) {
    1729           0 :                                 return -1;
    1730             :                         }
    1731           0 :                         if (test_var > uint_max) {
    1732           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1733             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1734           0 :                                 return -1;
    1735             :                         }
    1736           0 :                         object->num_ahead = test_var;
    1737             :                 } else {
    1738           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1739             :                           PyLong_Type.tp_name);
    1740           0 :                         return -1;
    1741             :                 }
    1742             :         }
    1743           0 :         return 0;
    1744             : }
    1745             : 
    1746             : static PyGetSetDef py_srvsvc_NetCharDevQInfo1_getsetters[] = {
    1747             :         {
    1748             :                 .name = discard_const_p(char, "device"),
    1749             :                 .get = py_srvsvc_NetCharDevQInfo1_get_device,
    1750             :                 .set = py_srvsvc_NetCharDevQInfo1_set_device,
    1751             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1752             :         },
    1753             :         {
    1754             :                 .name = discard_const_p(char, "priority"),
    1755             :                 .get = py_srvsvc_NetCharDevQInfo1_get_priority,
    1756             :                 .set = py_srvsvc_NetCharDevQInfo1_set_priority,
    1757             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1758             :         },
    1759             :         {
    1760             :                 .name = discard_const_p(char, "devices"),
    1761             :                 .get = py_srvsvc_NetCharDevQInfo1_get_devices,
    1762             :                 .set = py_srvsvc_NetCharDevQInfo1_set_devices,
    1763             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    1764             :         },
    1765             :         {
    1766             :                 .name = discard_const_p(char, "users"),
    1767             :                 .get = py_srvsvc_NetCharDevQInfo1_get_users,
    1768             :                 .set = py_srvsvc_NetCharDevQInfo1_set_users,
    1769             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1770             :         },
    1771             :         {
    1772             :                 .name = discard_const_p(char, "num_ahead"),
    1773             :                 .get = py_srvsvc_NetCharDevQInfo1_get_num_ahead,
    1774             :                 .set = py_srvsvc_NetCharDevQInfo1_set_num_ahead,
    1775             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1776             :         },
    1777             :         { .name = NULL }
    1778             : };
    1779             : 
    1780           0 : static PyObject *py_srvsvc_NetCharDevQInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1781             : {
    1782           0 :         return pytalloc_new(struct srvsvc_NetCharDevQInfo1, type);
    1783             : }
    1784             : 
    1785             : 
    1786             : static PyTypeObject srvsvc_NetCharDevQInfo1_Type = {
    1787             :         PyVarObject_HEAD_INIT(NULL, 0)
    1788             :         .tp_name = "srvsvc.NetCharDevQInfo1",
    1789             :         .tp_getset = py_srvsvc_NetCharDevQInfo1_getsetters,
    1790             :         .tp_methods = NULL,
    1791             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1792             :         .tp_new = py_srvsvc_NetCharDevQInfo1_new,
    1793             : };
    1794             : 
    1795             : 
    1796           0 : static PyObject *py_srvsvc_NetCharDevQCtr1_get_count(PyObject *obj, void *closure)
    1797             : {
    1798           0 :         struct srvsvc_NetCharDevQCtr1 *object = (struct srvsvc_NetCharDevQCtr1 *)pytalloc_get_ptr(obj);
    1799             :         PyObject *py_count;
    1800           0 :         py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
    1801           0 :         return py_count;
    1802             : }
    1803             : 
    1804           0 : static int py_srvsvc_NetCharDevQCtr1_set_count(PyObject *py_obj, PyObject *value, void *closure)
    1805             : {
    1806           0 :         struct srvsvc_NetCharDevQCtr1 *object = (struct srvsvc_NetCharDevQCtr1 *)pytalloc_get_ptr(py_obj);
    1807           0 :         if (value == NULL) {
    1808           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
    1809           0 :                 return -1;
    1810             :         }
    1811             :         {
    1812           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
    1813           0 :                 if (PyLong_Check(value)) {
    1814             :                         unsigned long long test_var;
    1815           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    1816           0 :                         if (PyErr_Occurred() != NULL) {
    1817           0 :                                 return -1;
    1818             :                         }
    1819           0 :                         if (test_var > uint_max) {
    1820           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    1821             :                                   PyLong_Type.tp_name, uint_max, test_var);
    1822           0 :                                 return -1;
    1823             :                         }
    1824           0 :                         object->count = test_var;
    1825             :                 } else {
    1826           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    1827             :                           PyLong_Type.tp_name);
    1828           0 :                         return -1;
    1829             :                 }
    1830             :         }
    1831           0 :         return 0;
    1832             : }
    1833             : 
    1834           0 : static PyObject *py_srvsvc_NetCharDevQCtr1_get_array(PyObject *obj, void *closure)
    1835             : {
    1836           0 :         struct srvsvc_NetCharDevQCtr1 *object = (struct srvsvc_NetCharDevQCtr1 *)pytalloc_get_ptr(obj);
    1837             :         PyObject *py_array;
    1838           0 :         if (object->array == NULL) {
    1839           0 :                 Py_RETURN_NONE;
    1840             :         }
    1841           0 :         if (object->array == NULL) {
    1842           0 :                 py_array = Py_None;
    1843           0 :                 Py_INCREF(py_array);
    1844             :         } else {
    1845           0 :                 py_array = PyList_New(object->count);
    1846           0 :                 if (py_array == NULL) {
    1847           0 :                         return NULL;
    1848             :                 }
    1849             :                 {
    1850             :                         int array_cntr_1;
    1851           0 :                         for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
    1852             :                                 PyObject *py_array_1;
    1853           0 :                                 py_array_1 = pytalloc_reference_ex(&srvsvc_NetCharDevQInfo1_Type, object->array, &object->array[array_cntr_1]);
    1854           0 :                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
    1855             :                         }
    1856             :                 }
    1857             :         }
    1858           0 :         return py_array;
    1859             : }
    1860             : 
    1861           0 : static int py_srvsvc_NetCharDevQCtr1_set_array(PyObject *py_obj, PyObject *value, void *closure)
    1862             : {
    1863           0 :         struct srvsvc_NetCharDevQCtr1 *object = (struct srvsvc_NetCharDevQCtr1 *)pytalloc_get_ptr(py_obj);
    1864           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
    1865           0 :         if (value == NULL) {
    1866           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
    1867           0 :                 return -1;
    1868             :         }
    1869           0 :         if (value == Py_None) {
    1870           0 :                 object->array = NULL;
    1871             :         } else {
    1872           0 :                 object->array = NULL;
    1873           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    1874             :                 {
    1875             :                         int array_cntr_1;
    1876           0 :                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
    1877           0 :                         if (!object->array) { return -1;; }
    1878           0 :                         talloc_set_name_const(object->array, "ARRAY: object->array");
    1879           0 :                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
    1880           0 :                                 if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
    1881           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
    1882           0 :                                         return -1;
    1883             :                                 }
    1884           0 :                                 PY_CHECK_TYPE(&srvsvc_NetCharDevQInfo1_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
    1885           0 :                                 if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
    1886           0 :                                         PyErr_NoMemory();
    1887           0 :                                         return -1;
    1888             :                                 }
    1889           0 :                                 object->array[array_cntr_1] = *(struct srvsvc_NetCharDevQInfo1 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
    1890             :                         }
    1891             :                 }
    1892             :         }
    1893           0 :         return 0;
    1894             : }
    1895             : 
    1896             : static PyGetSetDef py_srvsvc_NetCharDevQCtr1_getsetters[] = {
    1897             :         {
    1898             :                 .name = discard_const_p(char, "count"),
    1899             :                 .get = py_srvsvc_NetCharDevQCtr1_get_count,
    1900             :                 .set = py_srvsvc_NetCharDevQCtr1_set_count,
    1901             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    1902             :         },
    1903             :         {
    1904             :                 .name = discard_const_p(char, "array"),
    1905             :                 .get = py_srvsvc_NetCharDevQCtr1_get_array,
    1906             :                 .set = py_srvsvc_NetCharDevQCtr1_set_array,
    1907             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetCharDevQInfo1")
    1908             :         },
    1909             :         { .name = NULL }
    1910             : };
    1911             : 
    1912           0 : static PyObject *py_srvsvc_NetCharDevQCtr1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    1913             : {
    1914           0 :         return pytalloc_new(struct srvsvc_NetCharDevQCtr1, type);
    1915             : }
    1916             : 
    1917             : 
    1918             : static PyTypeObject srvsvc_NetCharDevQCtr1_Type = {
    1919             :         PyVarObject_HEAD_INIT(NULL, 0)
    1920             :         .tp_name = "srvsvc.NetCharDevQCtr1",
    1921             :         .tp_getset = py_srvsvc_NetCharDevQCtr1_getsetters,
    1922             :         .tp_methods = NULL,
    1923             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    1924             :         .tp_new = py_srvsvc_NetCharDevQCtr1_new,
    1925             : };
    1926             : 
    1927           0 : static PyObject *py_import_srvsvc_NetCharDevQInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetCharDevQInfo *in)
    1928             : {
    1929             :         PyObject *ret;
    1930             : 
    1931           0 :         switch (level) {
    1932           0 :                 case 0:
    1933           0 :                         if (in->info0 == NULL) {
    1934           0 :                                 ret = Py_None;
    1935           0 :                                 Py_INCREF(ret);
    1936             :                         } else {
    1937           0 :                                 ret = pytalloc_reference_ex(&srvsvc_NetCharDevQInfo0_Type, in->info0, in->info0);
    1938             :                         }
    1939           0 :                         return ret;
    1940             : 
    1941           0 :                 case 1:
    1942           0 :                         if (in->info1 == NULL) {
    1943           0 :                                 ret = Py_None;
    1944           0 :                                 Py_INCREF(ret);
    1945             :                         } else {
    1946           0 :                                 ret = pytalloc_reference_ex(&srvsvc_NetCharDevQInfo1_Type, in->info1, in->info1);
    1947             :                         }
    1948           0 :                         return ret;
    1949             : 
    1950           0 :                 default:
    1951           0 :                         ret = Py_None;
    1952           0 :                         Py_INCREF(ret);
    1953           0 :                         return ret;
    1954             : 
    1955             :         }
    1956             :         PyErr_SetString(PyExc_TypeError, "unknown union level");
    1957             :         return NULL;
    1958             : }
    1959             : 
    1960           0 : static union srvsvc_NetCharDevQInfo *py_export_srvsvc_NetCharDevQInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
    1961             : {
    1962           0 :         union srvsvc_NetCharDevQInfo *ret = talloc_zero(mem_ctx, union srvsvc_NetCharDevQInfo);
    1963           0 :         switch (level) {
    1964           0 :                 case 0:
    1965           0 :                         if (in == NULL) {
    1966           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info0");
    1967           0 :                                 talloc_free(ret); return NULL;
    1968             :                         }
    1969           0 :                         if (in == Py_None) {
    1970           0 :                                 ret->info0 = NULL;
    1971             :                         } else {
    1972           0 :                                 ret->info0 = NULL;
    1973           0 :                                 PY_CHECK_TYPE(&srvsvc_NetCharDevQInfo0_Type, in, talloc_free(ret); return NULL;);
    1974           0 :                                 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1975           0 :                                         PyErr_NoMemory();
    1976           0 :                                         talloc_free(ret); return NULL;
    1977             :                                 }
    1978           0 :                                 ret->info0 = (struct srvsvc_NetCharDevQInfo0 *)pytalloc_get_ptr(in);
    1979             :                         }
    1980           0 :                         break;
    1981             : 
    1982           0 :                 case 1:
    1983           0 :                         if (in == NULL) {
    1984           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info1");
    1985           0 :                                 talloc_free(ret); return NULL;
    1986             :                         }
    1987           0 :                         if (in == Py_None) {
    1988           0 :                                 ret->info1 = NULL;
    1989             :                         } else {
    1990           0 :                                 ret->info1 = NULL;
    1991           0 :                                 PY_CHECK_TYPE(&srvsvc_NetCharDevQInfo1_Type, in, talloc_free(ret); return NULL;);
    1992           0 :                                 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    1993           0 :                                         PyErr_NoMemory();
    1994           0 :                                         talloc_free(ret); return NULL;
    1995             :                                 }
    1996           0 :                                 ret->info1 = (struct srvsvc_NetCharDevQInfo1 *)pytalloc_get_ptr(in);
    1997             :                         }
    1998           0 :                         break;
    1999             : 
    2000           0 :                 default:
    2001           0 :                         break;
    2002             : 
    2003             :         }
    2004             : 
    2005           0 :         return ret;
    2006             : }
    2007             : 
    2008           0 : static PyObject *py_srvsvc_NetCharDevQInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2009             : {
    2010           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    2011           0 :         PyObject *mem_ctx_obj = NULL;
    2012           0 :         TALLOC_CTX *mem_ctx = NULL;
    2013           0 :         int level = 0;
    2014           0 :         PyObject *in_obj = NULL;
    2015           0 :         union srvsvc_NetCharDevQInfo *in = NULL;
    2016             : 
    2017           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
    2018             :                 discard_const_p(char *, kwnames),
    2019             :                 &mem_ctx_obj,
    2020             :                 &level,
    2021             :                 &in_obj)) {
    2022           0 :                 return NULL;
    2023             :         }
    2024           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    2025           0 :         if (mem_ctx == NULL) {
    2026           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    2027           0 :                 return NULL;
    2028             :         }
    2029           0 :         in = (union srvsvc_NetCharDevQInfo *)pytalloc_get_ptr(in_obj);
    2030           0 :         if (in == NULL) {
    2031           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union srvsvc_NetCharDevQInfo!");
    2032           0 :                 return NULL;
    2033             :         }
    2034             : 
    2035           0 :         return py_import_srvsvc_NetCharDevQInfo(mem_ctx, level, in);
    2036             : }
    2037             : 
    2038           0 : static PyObject *py_srvsvc_NetCharDevQInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2039             : {
    2040           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    2041           0 :         PyObject *mem_ctx_obj = NULL;
    2042           0 :         TALLOC_CTX *mem_ctx = NULL;
    2043           0 :         int level = 0;
    2044           0 :         PyObject *in = NULL;
    2045           0 :         union srvsvc_NetCharDevQInfo *out = NULL;
    2046             : 
    2047           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
    2048             :                 discard_const_p(char *, kwnames),
    2049             :                 &mem_ctx_obj,
    2050             :                 &level,
    2051             :                 &in)) {
    2052           0 :                 return NULL;
    2053             :         }
    2054           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    2055           0 :         if (mem_ctx == NULL) {
    2056           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    2057           0 :                 return NULL;
    2058             :         }
    2059             : 
    2060           0 :         out = py_export_srvsvc_NetCharDevQInfo(mem_ctx, level, in);
    2061           0 :         if (out == NULL) {
    2062           0 :                 return NULL;
    2063             :         }
    2064             : 
    2065           0 :         return pytalloc_GenericObject_reference(out);
    2066             : }
    2067             : 
    2068             : static PyMethodDef py_srvsvc_NetCharDevQInfo_methods[] = {
    2069             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_srvsvc_NetCharDevQInfo_import),
    2070             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    2071             :                 "T.__import__(mem_ctx, level, in) => ret." },
    2072             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_srvsvc_NetCharDevQInfo_export),
    2073             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    2074             :                 "T.__export__(mem_ctx, level, in) => ret." },
    2075             :         { NULL, NULL, 0, NULL }
    2076             : };
    2077             : 
    2078           0 : static PyObject *py_srvsvc_NetCharDevQInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2079             : {
    2080           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
    2081           0 :         return NULL;
    2082             : }
    2083             : 
    2084             : 
    2085             : static PyTypeObject srvsvc_NetCharDevQInfo_Type = {
    2086             :         PyVarObject_HEAD_INIT(NULL, 0)
    2087             :         .tp_name = "srvsvc.NetCharDevQInfo",
    2088             :         .tp_getset = NULL,
    2089             :         .tp_methods = py_srvsvc_NetCharDevQInfo_methods,
    2090             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2091             :         .tp_new = py_srvsvc_NetCharDevQInfo_new,
    2092             : };
    2093             : 
    2094           0 : static PyObject *py_import_srvsvc_NetCharDevQCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetCharDevQCtr *in)
    2095             : {
    2096             :         PyObject *ret;
    2097             : 
    2098           0 :         switch (level) {
    2099           0 :                 case 0:
    2100           0 :                         if (in->ctr0 == NULL) {
    2101           0 :                                 ret = Py_None;
    2102           0 :                                 Py_INCREF(ret);
    2103             :                         } else {
    2104           0 :                                 ret = pytalloc_reference_ex(&srvsvc_NetCharDevQCtr0_Type, in->ctr0, in->ctr0);
    2105             :                         }
    2106           0 :                         return ret;
    2107             : 
    2108           0 :                 case 1:
    2109           0 :                         if (in->ctr1 == NULL) {
    2110           0 :                                 ret = Py_None;
    2111           0 :                                 Py_INCREF(ret);
    2112             :                         } else {
    2113           0 :                                 ret = pytalloc_reference_ex(&srvsvc_NetCharDevQCtr1_Type, in->ctr1, in->ctr1);
    2114             :                         }
    2115           0 :                         return ret;
    2116             : 
    2117           0 :                 default:
    2118           0 :                         ret = Py_None;
    2119           0 :                         Py_INCREF(ret);
    2120           0 :                         return ret;
    2121             : 
    2122             :         }
    2123             :         PyErr_SetString(PyExc_TypeError, "unknown union level");
    2124             :         return NULL;
    2125             : }
    2126             : 
    2127           0 : static union srvsvc_NetCharDevQCtr *py_export_srvsvc_NetCharDevQCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in)
    2128             : {
    2129           0 :         union srvsvc_NetCharDevQCtr *ret = talloc_zero(mem_ctx, union srvsvc_NetCharDevQCtr);
    2130           0 :         switch (level) {
    2131           0 :                 case 0:
    2132           0 :                         if (in == NULL) {
    2133           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr0");
    2134           0 :                                 talloc_free(ret); return NULL;
    2135             :                         }
    2136           0 :                         if (in == Py_None) {
    2137           0 :                                 ret->ctr0 = NULL;
    2138             :                         } else {
    2139           0 :                                 ret->ctr0 = NULL;
    2140           0 :                                 PY_CHECK_TYPE(&srvsvc_NetCharDevQCtr0_Type, in, talloc_free(ret); return NULL;);
    2141           0 :                                 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    2142           0 :                                         PyErr_NoMemory();
    2143           0 :                                         talloc_free(ret); return NULL;
    2144             :                                 }
    2145           0 :                                 ret->ctr0 = (struct srvsvc_NetCharDevQCtr0 *)pytalloc_get_ptr(in);
    2146             :                         }
    2147           0 :                         break;
    2148             : 
    2149           0 :                 case 1:
    2150           0 :                         if (in == NULL) {
    2151           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr1");
    2152           0 :                                 talloc_free(ret); return NULL;
    2153             :                         }
    2154           0 :                         if (in == Py_None) {
    2155           0 :                                 ret->ctr1 = NULL;
    2156             :                         } else {
    2157           0 :                                 ret->ctr1 = NULL;
    2158           0 :                                 PY_CHECK_TYPE(&srvsvc_NetCharDevQCtr1_Type, in, talloc_free(ret); return NULL;);
    2159           0 :                                 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    2160           0 :                                         PyErr_NoMemory();
    2161           0 :                                         talloc_free(ret); return NULL;
    2162             :                                 }
    2163           0 :                                 ret->ctr1 = (struct srvsvc_NetCharDevQCtr1 *)pytalloc_get_ptr(in);
    2164             :                         }
    2165           0 :                         break;
    2166             : 
    2167           0 :                 default:
    2168           0 :                         break;
    2169             : 
    2170             :         }
    2171             : 
    2172           0 :         return ret;
    2173             : }
    2174             : 
    2175           0 : static PyObject *py_srvsvc_NetCharDevQCtr_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2176             : {
    2177           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    2178           0 :         PyObject *mem_ctx_obj = NULL;
    2179           0 :         TALLOC_CTX *mem_ctx = NULL;
    2180           0 :         int level = 0;
    2181           0 :         PyObject *in_obj = NULL;
    2182           0 :         union srvsvc_NetCharDevQCtr *in = NULL;
    2183             : 
    2184           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
    2185             :                 discard_const_p(char *, kwnames),
    2186             :                 &mem_ctx_obj,
    2187             :                 &level,
    2188             :                 &in_obj)) {
    2189           0 :                 return NULL;
    2190             :         }
    2191           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    2192           0 :         if (mem_ctx == NULL) {
    2193           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    2194           0 :                 return NULL;
    2195             :         }
    2196           0 :         in = (union srvsvc_NetCharDevQCtr *)pytalloc_get_ptr(in_obj);
    2197           0 :         if (in == NULL) {
    2198           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union srvsvc_NetCharDevQCtr!");
    2199           0 :                 return NULL;
    2200             :         }
    2201             : 
    2202           0 :         return py_import_srvsvc_NetCharDevQCtr(mem_ctx, level, in);
    2203             : }
    2204             : 
    2205           0 : static PyObject *py_srvsvc_NetCharDevQCtr_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2206             : {
    2207           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    2208           0 :         PyObject *mem_ctx_obj = NULL;
    2209           0 :         TALLOC_CTX *mem_ctx = NULL;
    2210           0 :         int level = 0;
    2211           0 :         PyObject *in = NULL;
    2212           0 :         union srvsvc_NetCharDevQCtr *out = NULL;
    2213             : 
    2214           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
    2215             :                 discard_const_p(char *, kwnames),
    2216             :                 &mem_ctx_obj,
    2217             :                 &level,
    2218             :                 &in)) {
    2219           0 :                 return NULL;
    2220             :         }
    2221           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    2222           0 :         if (mem_ctx == NULL) {
    2223           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    2224           0 :                 return NULL;
    2225             :         }
    2226             : 
    2227           0 :         out = py_export_srvsvc_NetCharDevQCtr(mem_ctx, level, in);
    2228           0 :         if (out == NULL) {
    2229           0 :                 return NULL;
    2230             :         }
    2231             : 
    2232           0 :         return pytalloc_GenericObject_reference(out);
    2233             : }
    2234             : 
    2235             : static PyMethodDef py_srvsvc_NetCharDevQCtr_methods[] = {
    2236             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_srvsvc_NetCharDevQCtr_import),
    2237             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    2238             :                 "T.__import__(mem_ctx, level, in) => ret." },
    2239             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_srvsvc_NetCharDevQCtr_export),
    2240             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    2241             :                 "T.__export__(mem_ctx, level, in) => ret." },
    2242             :         { NULL, NULL, 0, NULL }
    2243             : };
    2244             : 
    2245           0 : static PyObject *py_srvsvc_NetCharDevQCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2246             : {
    2247           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
    2248           0 :         return NULL;
    2249             : }
    2250             : 
    2251             : 
    2252             : static PyTypeObject srvsvc_NetCharDevQCtr_Type = {
    2253             :         PyVarObject_HEAD_INIT(NULL, 0)
    2254             :         .tp_name = "srvsvc.NetCharDevQCtr",
    2255             :         .tp_getset = NULL,
    2256             :         .tp_methods = py_srvsvc_NetCharDevQCtr_methods,
    2257             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2258             :         .tp_new = py_srvsvc_NetCharDevQCtr_new,
    2259             : };
    2260             : 
    2261             : 
    2262           0 : static PyObject *py_srvsvc_NetCharDevQInfoCtr_get_level(PyObject *obj, void *closure)
    2263             : {
    2264           0 :         struct srvsvc_NetCharDevQInfoCtr *object = (struct srvsvc_NetCharDevQInfoCtr *)pytalloc_get_ptr(obj);
    2265             :         PyObject *py_level;
    2266           0 :         py_level = PyLong_FromUnsignedLongLong((uint32_t)object->level);
    2267           0 :         return py_level;
    2268             : }
    2269             : 
    2270           0 : static int py_srvsvc_NetCharDevQInfoCtr_set_level(PyObject *py_obj, PyObject *value, void *closure)
    2271             : {
    2272           0 :         struct srvsvc_NetCharDevQInfoCtr *object = (struct srvsvc_NetCharDevQInfoCtr *)pytalloc_get_ptr(py_obj);
    2273           0 :         if (value == NULL) {
    2274           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->level");
    2275           0 :                 return -1;
    2276             :         }
    2277             :         {
    2278           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level));
    2279           0 :                 if (PyLong_Check(value)) {
    2280             :                         unsigned long long test_var;
    2281           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2282           0 :                         if (PyErr_Occurred() != NULL) {
    2283           0 :                                 return -1;
    2284             :                         }
    2285           0 :                         if (test_var > uint_max) {
    2286           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2287             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2288           0 :                                 return -1;
    2289             :                         }
    2290           0 :                         object->level = test_var;
    2291             :                 } else {
    2292           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2293             :                           PyLong_Type.tp_name);
    2294           0 :                         return -1;
    2295             :                 }
    2296             :         }
    2297           0 :         return 0;
    2298             : }
    2299             : 
    2300           0 : static PyObject *py_srvsvc_NetCharDevQInfoCtr_get_ctr(PyObject *obj, void *closure)
    2301             : {
    2302           0 :         struct srvsvc_NetCharDevQInfoCtr *object = (struct srvsvc_NetCharDevQInfoCtr *)pytalloc_get_ptr(obj);
    2303             :         PyObject *py_ctr;
    2304           0 :         py_ctr = pyrpc_import_union(&srvsvc_NetCharDevQCtr_Type, pytalloc_get_mem_ctx(obj), object->level, &object->ctr, "union srvsvc_NetCharDevQCtr");
    2305           0 :         if (py_ctr == NULL) {
    2306           0 :                 return NULL;
    2307             :         }
    2308           0 :         return py_ctr;
    2309             : }
    2310             : 
    2311           0 : static int py_srvsvc_NetCharDevQInfoCtr_set_ctr(PyObject *py_obj, PyObject *value, void *closure)
    2312             : {
    2313           0 :         struct srvsvc_NetCharDevQInfoCtr *object = (struct srvsvc_NetCharDevQInfoCtr *)pytalloc_get_ptr(py_obj);
    2314           0 :         if (value == NULL) {
    2315           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ctr");
    2316           0 :                 return -1;
    2317             :         }
    2318             :         {
    2319             :                 union srvsvc_NetCharDevQCtr *ctr_switch_0;
    2320           0 :                 ctr_switch_0 = (union srvsvc_NetCharDevQCtr *)pyrpc_export_union(&srvsvc_NetCharDevQCtr_Type, pytalloc_get_mem_ctx(py_obj), object->level, value, "union srvsvc_NetCharDevQCtr");
    2321           0 :                 if (ctr_switch_0 == NULL) {
    2322           0 :                         return -1;
    2323             :                 }
    2324           0 :                 object->ctr = *ctr_switch_0;
    2325             :         }
    2326           0 :         return 0;
    2327             : }
    2328             : 
    2329             : static PyGetSetDef py_srvsvc_NetCharDevQInfoCtr_getsetters[] = {
    2330             :         {
    2331             :                 .name = discard_const_p(char, "level"),
    2332             :                 .get = py_srvsvc_NetCharDevQInfoCtr_get_level,
    2333             :                 .set = py_srvsvc_NetCharDevQInfoCtr_set_level,
    2334             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2335             :         },
    2336             :         {
    2337             :                 .name = discard_const_p(char, "ctr"),
    2338             :                 .get = py_srvsvc_NetCharDevQInfoCtr_get_ctr,
    2339             :                 .set = py_srvsvc_NetCharDevQInfoCtr_set_ctr,
    2340             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetCharDevQCtr")
    2341             :         },
    2342             :         { .name = NULL }
    2343             : };
    2344             : 
    2345           0 : static PyObject *py_srvsvc_NetCharDevQInfoCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2346             : {
    2347           0 :         return pytalloc_new(struct srvsvc_NetCharDevQInfoCtr, type);
    2348             : }
    2349             : 
    2350             : 
    2351             : static PyTypeObject srvsvc_NetCharDevQInfoCtr_Type = {
    2352             :         PyVarObject_HEAD_INIT(NULL, 0)
    2353             :         .tp_name = "srvsvc.NetCharDevQInfoCtr",
    2354             :         .tp_getset = py_srvsvc_NetCharDevQInfoCtr_getsetters,
    2355             :         .tp_methods = NULL,
    2356             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2357             :         .tp_new = py_srvsvc_NetCharDevQInfoCtr_new,
    2358             : };
    2359             : 
    2360             : 
    2361           0 : static PyObject *py_srvsvc_NetConnInfo0_get_conn_id(PyObject *obj, void *closure)
    2362             : {
    2363           0 :         struct srvsvc_NetConnInfo0 *object = (struct srvsvc_NetConnInfo0 *)pytalloc_get_ptr(obj);
    2364             :         PyObject *py_conn_id;
    2365           0 :         py_conn_id = PyLong_FromUnsignedLongLong((uint32_t)object->conn_id);
    2366           0 :         return py_conn_id;
    2367             : }
    2368             : 
    2369           0 : static int py_srvsvc_NetConnInfo0_set_conn_id(PyObject *py_obj, PyObject *value, void *closure)
    2370             : {
    2371           0 :         struct srvsvc_NetConnInfo0 *object = (struct srvsvc_NetConnInfo0 *)pytalloc_get_ptr(py_obj);
    2372           0 :         if (value == NULL) {
    2373           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->conn_id");
    2374           0 :                 return -1;
    2375             :         }
    2376             :         {
    2377           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->conn_id));
    2378           0 :                 if (PyLong_Check(value)) {
    2379             :                         unsigned long long test_var;
    2380           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2381           0 :                         if (PyErr_Occurred() != NULL) {
    2382           0 :                                 return -1;
    2383             :                         }
    2384           0 :                         if (test_var > uint_max) {
    2385           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2386             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2387           0 :                                 return -1;
    2388             :                         }
    2389           0 :                         object->conn_id = test_var;
    2390             :                 } else {
    2391           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2392             :                           PyLong_Type.tp_name);
    2393           0 :                         return -1;
    2394             :                 }
    2395             :         }
    2396           0 :         return 0;
    2397             : }
    2398             : 
    2399             : static PyGetSetDef py_srvsvc_NetConnInfo0_getsetters[] = {
    2400             :         {
    2401             :                 .name = discard_const_p(char, "conn_id"),
    2402             :                 .get = py_srvsvc_NetConnInfo0_get_conn_id,
    2403             :                 .set = py_srvsvc_NetConnInfo0_set_conn_id,
    2404             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2405             :         },
    2406             :         { .name = NULL }
    2407             : };
    2408             : 
    2409           0 : static PyObject *py_srvsvc_NetConnInfo0_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2410             : {
    2411           0 :         return pytalloc_new(struct srvsvc_NetConnInfo0, type);
    2412             : }
    2413             : 
    2414             : 
    2415             : static PyTypeObject srvsvc_NetConnInfo0_Type = {
    2416             :         PyVarObject_HEAD_INIT(NULL, 0)
    2417             :         .tp_name = "srvsvc.NetConnInfo0",
    2418             :         .tp_getset = py_srvsvc_NetConnInfo0_getsetters,
    2419             :         .tp_methods = NULL,
    2420             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2421             :         .tp_new = py_srvsvc_NetConnInfo0_new,
    2422             : };
    2423             : 
    2424             : 
    2425           0 : static PyObject *py_srvsvc_NetConnCtr0_get_count(PyObject *obj, void *closure)
    2426             : {
    2427           0 :         struct srvsvc_NetConnCtr0 *object = (struct srvsvc_NetConnCtr0 *)pytalloc_get_ptr(obj);
    2428             :         PyObject *py_count;
    2429           0 :         py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
    2430           0 :         return py_count;
    2431             : }
    2432             : 
    2433           0 : static int py_srvsvc_NetConnCtr0_set_count(PyObject *py_obj, PyObject *value, void *closure)
    2434             : {
    2435           0 :         struct srvsvc_NetConnCtr0 *object = (struct srvsvc_NetConnCtr0 *)pytalloc_get_ptr(py_obj);
    2436           0 :         if (value == NULL) {
    2437           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
    2438           0 :                 return -1;
    2439             :         }
    2440             :         {
    2441           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
    2442           0 :                 if (PyLong_Check(value)) {
    2443             :                         unsigned long long test_var;
    2444           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2445           0 :                         if (PyErr_Occurred() != NULL) {
    2446           0 :                                 return -1;
    2447             :                         }
    2448           0 :                         if (test_var > uint_max) {
    2449           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2450             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2451           0 :                                 return -1;
    2452             :                         }
    2453           0 :                         object->count = test_var;
    2454             :                 } else {
    2455           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2456             :                           PyLong_Type.tp_name);
    2457           0 :                         return -1;
    2458             :                 }
    2459             :         }
    2460           0 :         return 0;
    2461             : }
    2462             : 
    2463           0 : static PyObject *py_srvsvc_NetConnCtr0_get_array(PyObject *obj, void *closure)
    2464             : {
    2465           0 :         struct srvsvc_NetConnCtr0 *object = (struct srvsvc_NetConnCtr0 *)pytalloc_get_ptr(obj);
    2466             :         PyObject *py_array;
    2467           0 :         if (object->array == NULL) {
    2468           0 :                 Py_RETURN_NONE;
    2469             :         }
    2470           0 :         if (object->array == NULL) {
    2471           0 :                 py_array = Py_None;
    2472           0 :                 Py_INCREF(py_array);
    2473             :         } else {
    2474           0 :                 py_array = PyList_New(object->count);
    2475           0 :                 if (py_array == NULL) {
    2476           0 :                         return NULL;
    2477             :                 }
    2478             :                 {
    2479             :                         int array_cntr_1;
    2480           0 :                         for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
    2481             :                                 PyObject *py_array_1;
    2482           0 :                                 py_array_1 = pytalloc_reference_ex(&srvsvc_NetConnInfo0_Type, object->array, &object->array[array_cntr_1]);
    2483           0 :                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
    2484             :                         }
    2485             :                 }
    2486             :         }
    2487           0 :         return py_array;
    2488             : }
    2489             : 
    2490           0 : static int py_srvsvc_NetConnCtr0_set_array(PyObject *py_obj, PyObject *value, void *closure)
    2491             : {
    2492           0 :         struct srvsvc_NetConnCtr0 *object = (struct srvsvc_NetConnCtr0 *)pytalloc_get_ptr(py_obj);
    2493           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
    2494           0 :         if (value == NULL) {
    2495           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
    2496           0 :                 return -1;
    2497             :         }
    2498           0 :         if (value == Py_None) {
    2499           0 :                 object->array = NULL;
    2500             :         } else {
    2501           0 :                 object->array = NULL;
    2502           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    2503             :                 {
    2504             :                         int array_cntr_1;
    2505           0 :                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
    2506           0 :                         if (!object->array) { return -1;; }
    2507           0 :                         talloc_set_name_const(object->array, "ARRAY: object->array");
    2508           0 :                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
    2509           0 :                                 if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
    2510           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
    2511           0 :                                         return -1;
    2512             :                                 }
    2513           0 :                                 PY_CHECK_TYPE(&srvsvc_NetConnInfo0_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
    2514           0 :                                 if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
    2515           0 :                                         PyErr_NoMemory();
    2516           0 :                                         return -1;
    2517             :                                 }
    2518           0 :                                 object->array[array_cntr_1] = *(struct srvsvc_NetConnInfo0 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
    2519             :                         }
    2520             :                 }
    2521             :         }
    2522           0 :         return 0;
    2523             : }
    2524             : 
    2525             : static PyGetSetDef py_srvsvc_NetConnCtr0_getsetters[] = {
    2526             :         {
    2527             :                 .name = discard_const_p(char, "count"),
    2528             :                 .get = py_srvsvc_NetConnCtr0_get_count,
    2529             :                 .set = py_srvsvc_NetConnCtr0_set_count,
    2530             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2531             :         },
    2532             :         {
    2533             :                 .name = discard_const_p(char, "array"),
    2534             :                 .get = py_srvsvc_NetConnCtr0_get_array,
    2535             :                 .set = py_srvsvc_NetConnCtr0_set_array,
    2536             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetConnInfo0")
    2537             :         },
    2538             :         { .name = NULL }
    2539             : };
    2540             : 
    2541           0 : static PyObject *py_srvsvc_NetConnCtr0_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2542             : {
    2543           0 :         return pytalloc_new(struct srvsvc_NetConnCtr0, type);
    2544             : }
    2545             : 
    2546             : 
    2547             : static PyTypeObject srvsvc_NetConnCtr0_Type = {
    2548             :         PyVarObject_HEAD_INIT(NULL, 0)
    2549             :         .tp_name = "srvsvc.NetConnCtr0",
    2550             :         .tp_getset = py_srvsvc_NetConnCtr0_getsetters,
    2551             :         .tp_methods = NULL,
    2552             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2553             :         .tp_new = py_srvsvc_NetConnCtr0_new,
    2554             : };
    2555             : 
    2556             : 
    2557           0 : static PyObject *py_srvsvc_NetConnInfo1_get_conn_id(PyObject *obj, void *closure)
    2558             : {
    2559           0 :         struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(obj);
    2560             :         PyObject *py_conn_id;
    2561           0 :         py_conn_id = PyLong_FromUnsignedLongLong((uint32_t)object->conn_id);
    2562           0 :         return py_conn_id;
    2563             : }
    2564             : 
    2565           0 : static int py_srvsvc_NetConnInfo1_set_conn_id(PyObject *py_obj, PyObject *value, void *closure)
    2566             : {
    2567           0 :         struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(py_obj);
    2568           0 :         if (value == NULL) {
    2569           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->conn_id");
    2570           0 :                 return -1;
    2571             :         }
    2572             :         {
    2573           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->conn_id));
    2574           0 :                 if (PyLong_Check(value)) {
    2575             :                         unsigned long long test_var;
    2576           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2577           0 :                         if (PyErr_Occurred() != NULL) {
    2578           0 :                                 return -1;
    2579             :                         }
    2580           0 :                         if (test_var > uint_max) {
    2581           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2582             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2583           0 :                                 return -1;
    2584             :                         }
    2585           0 :                         object->conn_id = test_var;
    2586             :                 } else {
    2587           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2588             :                           PyLong_Type.tp_name);
    2589           0 :                         return -1;
    2590             :                 }
    2591             :         }
    2592           0 :         return 0;
    2593             : }
    2594             : 
    2595           0 : static PyObject *py_srvsvc_NetConnInfo1_get_conn_type(PyObject *obj, void *closure)
    2596             : {
    2597           0 :         struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(obj);
    2598             :         PyObject *py_conn_type;
    2599           0 :         py_conn_type = PyLong_FromUnsignedLongLong((uint32_t)object->conn_type);
    2600           0 :         return py_conn_type;
    2601             : }
    2602             : 
    2603           0 : static int py_srvsvc_NetConnInfo1_set_conn_type(PyObject *py_obj, PyObject *value, void *closure)
    2604             : {
    2605           0 :         struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(py_obj);
    2606           0 :         if (value == NULL) {
    2607           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->conn_type");
    2608           0 :                 return -1;
    2609             :         }
    2610             :         {
    2611           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->conn_type));
    2612           0 :                 if (PyLong_Check(value)) {
    2613             :                         unsigned long long test_var;
    2614           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2615           0 :                         if (PyErr_Occurred() != NULL) {
    2616           0 :                                 return -1;
    2617             :                         }
    2618           0 :                         if (test_var > uint_max) {
    2619           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2620             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2621           0 :                                 return -1;
    2622             :                         }
    2623           0 :                         object->conn_type = test_var;
    2624             :                 } else {
    2625           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2626             :                           PyLong_Type.tp_name);
    2627           0 :                         return -1;
    2628             :                 }
    2629             :         }
    2630           0 :         return 0;
    2631             : }
    2632             : 
    2633           0 : static PyObject *py_srvsvc_NetConnInfo1_get_num_open(PyObject *obj, void *closure)
    2634             : {
    2635           0 :         struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(obj);
    2636             :         PyObject *py_num_open;
    2637           0 :         py_num_open = PyLong_FromUnsignedLongLong((uint32_t)object->num_open);
    2638           0 :         return py_num_open;
    2639             : }
    2640             : 
    2641           0 : static int py_srvsvc_NetConnInfo1_set_num_open(PyObject *py_obj, PyObject *value, void *closure)
    2642             : {
    2643           0 :         struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(py_obj);
    2644           0 :         if (value == NULL) {
    2645           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_open");
    2646           0 :                 return -1;
    2647             :         }
    2648             :         {
    2649           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_open));
    2650           0 :                 if (PyLong_Check(value)) {
    2651             :                         unsigned long long test_var;
    2652           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2653           0 :                         if (PyErr_Occurred() != NULL) {
    2654           0 :                                 return -1;
    2655             :                         }
    2656           0 :                         if (test_var > uint_max) {
    2657           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2658             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2659           0 :                                 return -1;
    2660             :                         }
    2661           0 :                         object->num_open = test_var;
    2662             :                 } else {
    2663           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2664             :                           PyLong_Type.tp_name);
    2665           0 :                         return -1;
    2666             :                 }
    2667             :         }
    2668           0 :         return 0;
    2669             : }
    2670             : 
    2671           0 : static PyObject *py_srvsvc_NetConnInfo1_get_num_users(PyObject *obj, void *closure)
    2672             : {
    2673           0 :         struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(obj);
    2674             :         PyObject *py_num_users;
    2675           0 :         py_num_users = PyLong_FromUnsignedLongLong((uint32_t)object->num_users);
    2676           0 :         return py_num_users;
    2677             : }
    2678             : 
    2679           0 : static int py_srvsvc_NetConnInfo1_set_num_users(PyObject *py_obj, PyObject *value, void *closure)
    2680             : {
    2681           0 :         struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(py_obj);
    2682           0 :         if (value == NULL) {
    2683           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_users");
    2684           0 :                 return -1;
    2685             :         }
    2686             :         {
    2687           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_users));
    2688           0 :                 if (PyLong_Check(value)) {
    2689             :                         unsigned long long test_var;
    2690           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2691           0 :                         if (PyErr_Occurred() != NULL) {
    2692           0 :                                 return -1;
    2693             :                         }
    2694           0 :                         if (test_var > uint_max) {
    2695           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2696             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2697           0 :                                 return -1;
    2698             :                         }
    2699           0 :                         object->num_users = test_var;
    2700             :                 } else {
    2701           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2702             :                           PyLong_Type.tp_name);
    2703           0 :                         return -1;
    2704             :                 }
    2705             :         }
    2706           0 :         return 0;
    2707             : }
    2708             : 
    2709           0 : static PyObject *py_srvsvc_NetConnInfo1_get_conn_time(PyObject *obj, void *closure)
    2710             : {
    2711           0 :         struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(obj);
    2712             :         PyObject *py_conn_time;
    2713           0 :         py_conn_time = PyLong_FromUnsignedLongLong((uint32_t)object->conn_time);
    2714           0 :         return py_conn_time;
    2715             : }
    2716             : 
    2717           0 : static int py_srvsvc_NetConnInfo1_set_conn_time(PyObject *py_obj, PyObject *value, void *closure)
    2718             : {
    2719           0 :         struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(py_obj);
    2720           0 :         if (value == NULL) {
    2721           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->conn_time");
    2722           0 :                 return -1;
    2723             :         }
    2724             :         {
    2725           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->conn_time));
    2726           0 :                 if (PyLong_Check(value)) {
    2727             :                         unsigned long long test_var;
    2728           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2729           0 :                         if (PyErr_Occurred() != NULL) {
    2730           0 :                                 return -1;
    2731             :                         }
    2732           0 :                         if (test_var > uint_max) {
    2733           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2734             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2735           0 :                                 return -1;
    2736             :                         }
    2737           0 :                         object->conn_time = test_var;
    2738             :                 } else {
    2739           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2740             :                           PyLong_Type.tp_name);
    2741           0 :                         return -1;
    2742             :                 }
    2743             :         }
    2744           0 :         return 0;
    2745             : }
    2746             : 
    2747           0 : static PyObject *py_srvsvc_NetConnInfo1_get_user(PyObject *obj, void *closure)
    2748             : {
    2749           0 :         struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(obj);
    2750             :         PyObject *py_user;
    2751           0 :         if (object->user == NULL) {
    2752           0 :                 Py_RETURN_NONE;
    2753             :         }
    2754           0 :         if (object->user == NULL) {
    2755           0 :                 py_user = Py_None;
    2756           0 :                 Py_INCREF(py_user);
    2757             :         } else {
    2758           0 :                 if (object->user == NULL) {
    2759           0 :                         py_user = Py_None;
    2760           0 :                         Py_INCREF(py_user);
    2761             :                 } else {
    2762           0 :                         py_user = PyUnicode_Decode(object->user, strlen(object->user), "utf-8", "ignore");
    2763             :                 }
    2764             :         }
    2765           0 :         return py_user;
    2766             : }
    2767             : 
    2768           0 : static int py_srvsvc_NetConnInfo1_set_user(PyObject *py_obj, PyObject *value, void *closure)
    2769             : {
    2770           0 :         struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(py_obj);
    2771           0 :         if (value == NULL) {
    2772           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user");
    2773           0 :                 return -1;
    2774             :         }
    2775           0 :         if (value == Py_None) {
    2776           0 :                 object->user = NULL;
    2777             :         } else {
    2778           0 :                 object->user = NULL;
    2779             :                 {
    2780             :                         const char *test_str;
    2781             :                         const char *talloc_str;
    2782           0 :                         PyObject *unicode = NULL;
    2783           0 :                         if (PyUnicode_Check(value)) {
    2784           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    2785           0 :                                 if (unicode == NULL) {
    2786           0 :                                         PyErr_NoMemory();
    2787           0 :                                         return -1;
    2788             :                                 }
    2789           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    2790           0 :                         } else if (PyBytes_Check(value)) {
    2791           0 :                                 test_str = PyBytes_AS_STRING(value);
    2792             :                         } else {
    2793           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    2794           0 :                                 return -1;
    2795             :                         }
    2796           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    2797           0 :                         if (unicode != NULL) {
    2798           0 :                                 Py_DECREF(unicode);
    2799             :                         }
    2800           0 :                         if (talloc_str == NULL) {
    2801           0 :                                 PyErr_NoMemory();
    2802           0 :                                 return -1;
    2803             :                         }
    2804           0 :                         object->user = talloc_str;
    2805             :                 }
    2806             :         }
    2807           0 :         return 0;
    2808             : }
    2809             : 
    2810           0 : static PyObject *py_srvsvc_NetConnInfo1_get_share(PyObject *obj, void *closure)
    2811             : {
    2812           0 :         struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(obj);
    2813             :         PyObject *py_share;
    2814           0 :         if (object->share == NULL) {
    2815           0 :                 Py_RETURN_NONE;
    2816             :         }
    2817           0 :         if (object->share == NULL) {
    2818           0 :                 py_share = Py_None;
    2819           0 :                 Py_INCREF(py_share);
    2820             :         } else {
    2821           0 :                 if (object->share == NULL) {
    2822           0 :                         py_share = Py_None;
    2823           0 :                         Py_INCREF(py_share);
    2824             :                 } else {
    2825           0 :                         py_share = PyUnicode_Decode(object->share, strlen(object->share), "utf-8", "ignore");
    2826             :                 }
    2827             :         }
    2828           0 :         return py_share;
    2829             : }
    2830             : 
    2831           0 : static int py_srvsvc_NetConnInfo1_set_share(PyObject *py_obj, PyObject *value, void *closure)
    2832             : {
    2833           0 :         struct srvsvc_NetConnInfo1 *object = (struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(py_obj);
    2834           0 :         if (value == NULL) {
    2835           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->share");
    2836           0 :                 return -1;
    2837             :         }
    2838           0 :         if (value == Py_None) {
    2839           0 :                 object->share = NULL;
    2840             :         } else {
    2841           0 :                 object->share = NULL;
    2842             :                 {
    2843             :                         const char *test_str;
    2844             :                         const char *talloc_str;
    2845           0 :                         PyObject *unicode = NULL;
    2846           0 :                         if (PyUnicode_Check(value)) {
    2847           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    2848           0 :                                 if (unicode == NULL) {
    2849           0 :                                         PyErr_NoMemory();
    2850           0 :                                         return -1;
    2851             :                                 }
    2852           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    2853           0 :                         } else if (PyBytes_Check(value)) {
    2854           0 :                                 test_str = PyBytes_AS_STRING(value);
    2855             :                         } else {
    2856           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    2857           0 :                                 return -1;
    2858             :                         }
    2859           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    2860           0 :                         if (unicode != NULL) {
    2861           0 :                                 Py_DECREF(unicode);
    2862             :                         }
    2863           0 :                         if (talloc_str == NULL) {
    2864           0 :                                 PyErr_NoMemory();
    2865           0 :                                 return -1;
    2866             :                         }
    2867           0 :                         object->share = talloc_str;
    2868             :                 }
    2869             :         }
    2870           0 :         return 0;
    2871             : }
    2872             : 
    2873             : static PyGetSetDef py_srvsvc_NetConnInfo1_getsetters[] = {
    2874             :         {
    2875             :                 .name = discard_const_p(char, "conn_id"),
    2876             :                 .get = py_srvsvc_NetConnInfo1_get_conn_id,
    2877             :                 .set = py_srvsvc_NetConnInfo1_set_conn_id,
    2878             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2879             :         },
    2880             :         {
    2881             :                 .name = discard_const_p(char, "conn_type"),
    2882             :                 .get = py_srvsvc_NetConnInfo1_get_conn_type,
    2883             :                 .set = py_srvsvc_NetConnInfo1_set_conn_type,
    2884             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2885             :         },
    2886             :         {
    2887             :                 .name = discard_const_p(char, "num_open"),
    2888             :                 .get = py_srvsvc_NetConnInfo1_get_num_open,
    2889             :                 .set = py_srvsvc_NetConnInfo1_set_num_open,
    2890             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2891             :         },
    2892             :         {
    2893             :                 .name = discard_const_p(char, "num_users"),
    2894             :                 .get = py_srvsvc_NetConnInfo1_get_num_users,
    2895             :                 .set = py_srvsvc_NetConnInfo1_set_num_users,
    2896             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2897             :         },
    2898             :         {
    2899             :                 .name = discard_const_p(char, "conn_time"),
    2900             :                 .get = py_srvsvc_NetConnInfo1_get_conn_time,
    2901             :                 .set = py_srvsvc_NetConnInfo1_set_conn_time,
    2902             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    2903             :         },
    2904             :         {
    2905             :                 .name = discard_const_p(char, "user"),
    2906             :                 .get = py_srvsvc_NetConnInfo1_get_user,
    2907             :                 .set = py_srvsvc_NetConnInfo1_set_user,
    2908             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2909             :         },
    2910             :         {
    2911             :                 .name = discard_const_p(char, "share"),
    2912             :                 .get = py_srvsvc_NetConnInfo1_get_share,
    2913             :                 .set = py_srvsvc_NetConnInfo1_set_share,
    2914             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    2915             :         },
    2916             :         { .name = NULL }
    2917             : };
    2918             : 
    2919           0 : static PyObject *py_srvsvc_NetConnInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    2920             : {
    2921           0 :         return pytalloc_new(struct srvsvc_NetConnInfo1, type);
    2922             : }
    2923             : 
    2924             : 
    2925             : static PyTypeObject srvsvc_NetConnInfo1_Type = {
    2926             :         PyVarObject_HEAD_INIT(NULL, 0)
    2927             :         .tp_name = "srvsvc.NetConnInfo1",
    2928             :         .tp_getset = py_srvsvc_NetConnInfo1_getsetters,
    2929             :         .tp_methods = NULL,
    2930             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    2931             :         .tp_new = py_srvsvc_NetConnInfo1_new,
    2932             : };
    2933             : 
    2934             : 
    2935           0 : static PyObject *py_srvsvc_NetConnCtr1_get_count(PyObject *obj, void *closure)
    2936             : {
    2937           0 :         struct srvsvc_NetConnCtr1 *object = (struct srvsvc_NetConnCtr1 *)pytalloc_get_ptr(obj);
    2938             :         PyObject *py_count;
    2939           0 :         py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
    2940           0 :         return py_count;
    2941             : }
    2942             : 
    2943           0 : static int py_srvsvc_NetConnCtr1_set_count(PyObject *py_obj, PyObject *value, void *closure)
    2944             : {
    2945           0 :         struct srvsvc_NetConnCtr1 *object = (struct srvsvc_NetConnCtr1 *)pytalloc_get_ptr(py_obj);
    2946           0 :         if (value == NULL) {
    2947           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
    2948           0 :                 return -1;
    2949             :         }
    2950             :         {
    2951           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
    2952           0 :                 if (PyLong_Check(value)) {
    2953             :                         unsigned long long test_var;
    2954           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    2955           0 :                         if (PyErr_Occurred() != NULL) {
    2956           0 :                                 return -1;
    2957             :                         }
    2958           0 :                         if (test_var > uint_max) {
    2959           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    2960             :                                   PyLong_Type.tp_name, uint_max, test_var);
    2961           0 :                                 return -1;
    2962             :                         }
    2963           0 :                         object->count = test_var;
    2964             :                 } else {
    2965           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    2966             :                           PyLong_Type.tp_name);
    2967           0 :                         return -1;
    2968             :                 }
    2969             :         }
    2970           0 :         return 0;
    2971             : }
    2972             : 
    2973           0 : static PyObject *py_srvsvc_NetConnCtr1_get_array(PyObject *obj, void *closure)
    2974             : {
    2975           0 :         struct srvsvc_NetConnCtr1 *object = (struct srvsvc_NetConnCtr1 *)pytalloc_get_ptr(obj);
    2976             :         PyObject *py_array;
    2977           0 :         if (object->array == NULL) {
    2978           0 :                 Py_RETURN_NONE;
    2979             :         }
    2980           0 :         if (object->array == NULL) {
    2981           0 :                 py_array = Py_None;
    2982           0 :                 Py_INCREF(py_array);
    2983             :         } else {
    2984           0 :                 py_array = PyList_New(object->count);
    2985           0 :                 if (py_array == NULL) {
    2986           0 :                         return NULL;
    2987             :                 }
    2988             :                 {
    2989             :                         int array_cntr_1;
    2990           0 :                         for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
    2991             :                                 PyObject *py_array_1;
    2992           0 :                                 py_array_1 = pytalloc_reference_ex(&srvsvc_NetConnInfo1_Type, object->array, &object->array[array_cntr_1]);
    2993           0 :                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
    2994             :                         }
    2995             :                 }
    2996             :         }
    2997           0 :         return py_array;
    2998             : }
    2999             : 
    3000           0 : static int py_srvsvc_NetConnCtr1_set_array(PyObject *py_obj, PyObject *value, void *closure)
    3001             : {
    3002           0 :         struct srvsvc_NetConnCtr1 *object = (struct srvsvc_NetConnCtr1 *)pytalloc_get_ptr(py_obj);
    3003           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
    3004           0 :         if (value == NULL) {
    3005           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
    3006           0 :                 return -1;
    3007             :         }
    3008           0 :         if (value == Py_None) {
    3009           0 :                 object->array = NULL;
    3010             :         } else {
    3011           0 :                 object->array = NULL;
    3012           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    3013             :                 {
    3014             :                         int array_cntr_1;
    3015           0 :                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
    3016           0 :                         if (!object->array) { return -1;; }
    3017           0 :                         talloc_set_name_const(object->array, "ARRAY: object->array");
    3018           0 :                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
    3019           0 :                                 if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
    3020           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
    3021           0 :                                         return -1;
    3022             :                                 }
    3023           0 :                                 PY_CHECK_TYPE(&srvsvc_NetConnInfo1_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
    3024           0 :                                 if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
    3025           0 :                                         PyErr_NoMemory();
    3026           0 :                                         return -1;
    3027             :                                 }
    3028           0 :                                 object->array[array_cntr_1] = *(struct srvsvc_NetConnInfo1 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
    3029             :                         }
    3030             :                 }
    3031             :         }
    3032           0 :         return 0;
    3033             : }
    3034             : 
    3035             : static PyGetSetDef py_srvsvc_NetConnCtr1_getsetters[] = {
    3036             :         {
    3037             :                 .name = discard_const_p(char, "count"),
    3038             :                 .get = py_srvsvc_NetConnCtr1_get_count,
    3039             :                 .set = py_srvsvc_NetConnCtr1_set_count,
    3040             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3041             :         },
    3042             :         {
    3043             :                 .name = discard_const_p(char, "array"),
    3044             :                 .get = py_srvsvc_NetConnCtr1_get_array,
    3045             :                 .set = py_srvsvc_NetConnCtr1_set_array,
    3046             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetConnInfo1")
    3047             :         },
    3048             :         { .name = NULL }
    3049             : };
    3050             : 
    3051           0 : static PyObject *py_srvsvc_NetConnCtr1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3052             : {
    3053           0 :         return pytalloc_new(struct srvsvc_NetConnCtr1, type);
    3054             : }
    3055             : 
    3056             : 
    3057             : static PyTypeObject srvsvc_NetConnCtr1_Type = {
    3058             :         PyVarObject_HEAD_INIT(NULL, 0)
    3059             :         .tp_name = "srvsvc.NetConnCtr1",
    3060             :         .tp_getset = py_srvsvc_NetConnCtr1_getsetters,
    3061             :         .tp_methods = NULL,
    3062             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3063             :         .tp_new = py_srvsvc_NetConnCtr1_new,
    3064             : };
    3065             : 
    3066           0 : static PyObject *py_import_srvsvc_NetConnCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetConnCtr *in)
    3067             : {
    3068             :         PyObject *ret;
    3069             : 
    3070           0 :         switch (level) {
    3071           0 :                 case 0:
    3072           0 :                         if (in->ctr0 == NULL) {
    3073           0 :                                 ret = Py_None;
    3074           0 :                                 Py_INCREF(ret);
    3075             :                         } else {
    3076           0 :                                 ret = pytalloc_reference_ex(&srvsvc_NetConnCtr0_Type, in->ctr0, in->ctr0);
    3077             :                         }
    3078           0 :                         return ret;
    3079             : 
    3080           0 :                 case 1:
    3081           0 :                         if (in->ctr1 == NULL) {
    3082           0 :                                 ret = Py_None;
    3083           0 :                                 Py_INCREF(ret);
    3084             :                         } else {
    3085           0 :                                 ret = pytalloc_reference_ex(&srvsvc_NetConnCtr1_Type, in->ctr1, in->ctr1);
    3086             :                         }
    3087           0 :                         return ret;
    3088             : 
    3089           0 :                 default:
    3090           0 :                         ret = Py_None;
    3091           0 :                         Py_INCREF(ret);
    3092           0 :                         return ret;
    3093             : 
    3094             :         }
    3095             :         PyErr_SetString(PyExc_TypeError, "unknown union level");
    3096             :         return NULL;
    3097             : }
    3098             : 
    3099           0 : static union srvsvc_NetConnCtr *py_export_srvsvc_NetConnCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in)
    3100             : {
    3101           0 :         union srvsvc_NetConnCtr *ret = talloc_zero(mem_ctx, union srvsvc_NetConnCtr);
    3102           0 :         switch (level) {
    3103           0 :                 case 0:
    3104           0 :                         if (in == NULL) {
    3105           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr0");
    3106           0 :                                 talloc_free(ret); return NULL;
    3107             :                         }
    3108           0 :                         if (in == Py_None) {
    3109           0 :                                 ret->ctr0 = NULL;
    3110             :                         } else {
    3111           0 :                                 ret->ctr0 = NULL;
    3112           0 :                                 PY_CHECK_TYPE(&srvsvc_NetConnCtr0_Type, in, talloc_free(ret); return NULL;);
    3113           0 :                                 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    3114           0 :                                         PyErr_NoMemory();
    3115           0 :                                         talloc_free(ret); return NULL;
    3116             :                                 }
    3117           0 :                                 ret->ctr0 = (struct srvsvc_NetConnCtr0 *)pytalloc_get_ptr(in);
    3118             :                         }
    3119           0 :                         break;
    3120             : 
    3121           0 :                 case 1:
    3122           0 :                         if (in == NULL) {
    3123           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr1");
    3124           0 :                                 talloc_free(ret); return NULL;
    3125             :                         }
    3126           0 :                         if (in == Py_None) {
    3127           0 :                                 ret->ctr1 = NULL;
    3128             :                         } else {
    3129           0 :                                 ret->ctr1 = NULL;
    3130           0 :                                 PY_CHECK_TYPE(&srvsvc_NetConnCtr1_Type, in, talloc_free(ret); return NULL;);
    3131           0 :                                 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    3132           0 :                                         PyErr_NoMemory();
    3133           0 :                                         talloc_free(ret); return NULL;
    3134             :                                 }
    3135           0 :                                 ret->ctr1 = (struct srvsvc_NetConnCtr1 *)pytalloc_get_ptr(in);
    3136             :                         }
    3137           0 :                         break;
    3138             : 
    3139           0 :                 default:
    3140           0 :                         break;
    3141             : 
    3142             :         }
    3143             : 
    3144           0 :         return ret;
    3145             : }
    3146             : 
    3147           0 : static PyObject *py_srvsvc_NetConnCtr_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3148             : {
    3149           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    3150           0 :         PyObject *mem_ctx_obj = NULL;
    3151           0 :         TALLOC_CTX *mem_ctx = NULL;
    3152           0 :         int level = 0;
    3153           0 :         PyObject *in_obj = NULL;
    3154           0 :         union srvsvc_NetConnCtr *in = NULL;
    3155             : 
    3156           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
    3157             :                 discard_const_p(char *, kwnames),
    3158             :                 &mem_ctx_obj,
    3159             :                 &level,
    3160             :                 &in_obj)) {
    3161           0 :                 return NULL;
    3162             :         }
    3163           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    3164           0 :         if (mem_ctx == NULL) {
    3165           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    3166           0 :                 return NULL;
    3167             :         }
    3168           0 :         in = (union srvsvc_NetConnCtr *)pytalloc_get_ptr(in_obj);
    3169           0 :         if (in == NULL) {
    3170           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union srvsvc_NetConnCtr!");
    3171           0 :                 return NULL;
    3172             :         }
    3173             : 
    3174           0 :         return py_import_srvsvc_NetConnCtr(mem_ctx, level, in);
    3175             : }
    3176             : 
    3177           0 : static PyObject *py_srvsvc_NetConnCtr_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3178             : {
    3179           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    3180           0 :         PyObject *mem_ctx_obj = NULL;
    3181           0 :         TALLOC_CTX *mem_ctx = NULL;
    3182           0 :         int level = 0;
    3183           0 :         PyObject *in = NULL;
    3184           0 :         union srvsvc_NetConnCtr *out = NULL;
    3185             : 
    3186           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
    3187             :                 discard_const_p(char *, kwnames),
    3188             :                 &mem_ctx_obj,
    3189             :                 &level,
    3190             :                 &in)) {
    3191           0 :                 return NULL;
    3192             :         }
    3193           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    3194           0 :         if (mem_ctx == NULL) {
    3195           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    3196           0 :                 return NULL;
    3197             :         }
    3198             : 
    3199           0 :         out = py_export_srvsvc_NetConnCtr(mem_ctx, level, in);
    3200           0 :         if (out == NULL) {
    3201           0 :                 return NULL;
    3202             :         }
    3203             : 
    3204           0 :         return pytalloc_GenericObject_reference(out);
    3205             : }
    3206             : 
    3207             : static PyMethodDef py_srvsvc_NetConnCtr_methods[] = {
    3208             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_srvsvc_NetConnCtr_import),
    3209             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    3210             :                 "T.__import__(mem_ctx, level, in) => ret." },
    3211             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_srvsvc_NetConnCtr_export),
    3212             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    3213             :                 "T.__export__(mem_ctx, level, in) => ret." },
    3214             :         { NULL, NULL, 0, NULL }
    3215             : };
    3216             : 
    3217           0 : static PyObject *py_srvsvc_NetConnCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3218             : {
    3219           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
    3220           0 :         return NULL;
    3221             : }
    3222             : 
    3223             : 
    3224             : static PyTypeObject srvsvc_NetConnCtr_Type = {
    3225             :         PyVarObject_HEAD_INIT(NULL, 0)
    3226             :         .tp_name = "srvsvc.NetConnCtr",
    3227             :         .tp_getset = NULL,
    3228             :         .tp_methods = py_srvsvc_NetConnCtr_methods,
    3229             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3230             :         .tp_new = py_srvsvc_NetConnCtr_new,
    3231             : };
    3232             : 
    3233             : 
    3234           0 : static PyObject *py_srvsvc_NetConnInfoCtr_get_level(PyObject *obj, void *closure)
    3235             : {
    3236           0 :         struct srvsvc_NetConnInfoCtr *object = (struct srvsvc_NetConnInfoCtr *)pytalloc_get_ptr(obj);
    3237             :         PyObject *py_level;
    3238           0 :         py_level = PyLong_FromUnsignedLongLong((uint32_t)object->level);
    3239           0 :         return py_level;
    3240             : }
    3241             : 
    3242           0 : static int py_srvsvc_NetConnInfoCtr_set_level(PyObject *py_obj, PyObject *value, void *closure)
    3243             : {
    3244           0 :         struct srvsvc_NetConnInfoCtr *object = (struct srvsvc_NetConnInfoCtr *)pytalloc_get_ptr(py_obj);
    3245           0 :         if (value == NULL) {
    3246           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->level");
    3247           0 :                 return -1;
    3248             :         }
    3249             :         {
    3250           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level));
    3251           0 :                 if (PyLong_Check(value)) {
    3252             :                         unsigned long long test_var;
    3253           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3254           0 :                         if (PyErr_Occurred() != NULL) {
    3255           0 :                                 return -1;
    3256             :                         }
    3257           0 :                         if (test_var > uint_max) {
    3258           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3259             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3260           0 :                                 return -1;
    3261             :                         }
    3262           0 :                         object->level = test_var;
    3263             :                 } else {
    3264           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3265             :                           PyLong_Type.tp_name);
    3266           0 :                         return -1;
    3267             :                 }
    3268             :         }
    3269           0 :         return 0;
    3270             : }
    3271             : 
    3272           0 : static PyObject *py_srvsvc_NetConnInfoCtr_get_ctr(PyObject *obj, void *closure)
    3273             : {
    3274           0 :         struct srvsvc_NetConnInfoCtr *object = (struct srvsvc_NetConnInfoCtr *)pytalloc_get_ptr(obj);
    3275             :         PyObject *py_ctr;
    3276           0 :         py_ctr = pyrpc_import_union(&srvsvc_NetConnCtr_Type, pytalloc_get_mem_ctx(obj), object->level, &object->ctr, "union srvsvc_NetConnCtr");
    3277           0 :         if (py_ctr == NULL) {
    3278           0 :                 return NULL;
    3279             :         }
    3280           0 :         return py_ctr;
    3281             : }
    3282             : 
    3283           0 : static int py_srvsvc_NetConnInfoCtr_set_ctr(PyObject *py_obj, PyObject *value, void *closure)
    3284             : {
    3285           0 :         struct srvsvc_NetConnInfoCtr *object = (struct srvsvc_NetConnInfoCtr *)pytalloc_get_ptr(py_obj);
    3286           0 :         if (value == NULL) {
    3287           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ctr");
    3288           0 :                 return -1;
    3289             :         }
    3290             :         {
    3291             :                 union srvsvc_NetConnCtr *ctr_switch_0;
    3292           0 :                 ctr_switch_0 = (union srvsvc_NetConnCtr *)pyrpc_export_union(&srvsvc_NetConnCtr_Type, pytalloc_get_mem_ctx(py_obj), object->level, value, "union srvsvc_NetConnCtr");
    3293           0 :                 if (ctr_switch_0 == NULL) {
    3294           0 :                         return -1;
    3295             :                 }
    3296           0 :                 object->ctr = *ctr_switch_0;
    3297             :         }
    3298           0 :         return 0;
    3299             : }
    3300             : 
    3301             : static PyGetSetDef py_srvsvc_NetConnInfoCtr_getsetters[] = {
    3302             :         {
    3303             :                 .name = discard_const_p(char, "level"),
    3304             :                 .get = py_srvsvc_NetConnInfoCtr_get_level,
    3305             :                 .set = py_srvsvc_NetConnInfoCtr_set_level,
    3306             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3307             :         },
    3308             :         {
    3309             :                 .name = discard_const_p(char, "ctr"),
    3310             :                 .get = py_srvsvc_NetConnInfoCtr_get_ctr,
    3311             :                 .set = py_srvsvc_NetConnInfoCtr_set_ctr,
    3312             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetConnCtr")
    3313             :         },
    3314             :         { .name = NULL }
    3315             : };
    3316             : 
    3317           0 : static PyObject *py_srvsvc_NetConnInfoCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3318             : {
    3319           0 :         return pytalloc_new(struct srvsvc_NetConnInfoCtr, type);
    3320             : }
    3321             : 
    3322             : 
    3323             : static PyTypeObject srvsvc_NetConnInfoCtr_Type = {
    3324             :         PyVarObject_HEAD_INIT(NULL, 0)
    3325             :         .tp_name = "srvsvc.NetConnInfoCtr",
    3326             :         .tp_getset = py_srvsvc_NetConnInfoCtr_getsetters,
    3327             :         .tp_methods = NULL,
    3328             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3329             :         .tp_new = py_srvsvc_NetConnInfoCtr_new,
    3330             : };
    3331             : 
    3332             : 
    3333           0 : static PyObject *py_srvsvc_NetFileInfo2_get_fid(PyObject *obj, void *closure)
    3334             : {
    3335           0 :         struct srvsvc_NetFileInfo2 *object = (struct srvsvc_NetFileInfo2 *)pytalloc_get_ptr(obj);
    3336             :         PyObject *py_fid;
    3337           0 :         py_fid = PyLong_FromUnsignedLongLong((uint32_t)object->fid);
    3338           0 :         return py_fid;
    3339             : }
    3340             : 
    3341           0 : static int py_srvsvc_NetFileInfo2_set_fid(PyObject *py_obj, PyObject *value, void *closure)
    3342             : {
    3343           0 :         struct srvsvc_NetFileInfo2 *object = (struct srvsvc_NetFileInfo2 *)pytalloc_get_ptr(py_obj);
    3344           0 :         if (value == NULL) {
    3345           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->fid");
    3346           0 :                 return -1;
    3347             :         }
    3348             :         {
    3349           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->fid));
    3350           0 :                 if (PyLong_Check(value)) {
    3351             :                         unsigned long long test_var;
    3352           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3353           0 :                         if (PyErr_Occurred() != NULL) {
    3354           0 :                                 return -1;
    3355             :                         }
    3356           0 :                         if (test_var > uint_max) {
    3357           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3358             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3359           0 :                                 return -1;
    3360             :                         }
    3361           0 :                         object->fid = test_var;
    3362             :                 } else {
    3363           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3364             :                           PyLong_Type.tp_name);
    3365           0 :                         return -1;
    3366             :                 }
    3367             :         }
    3368           0 :         return 0;
    3369             : }
    3370             : 
    3371             : static PyGetSetDef py_srvsvc_NetFileInfo2_getsetters[] = {
    3372             :         {
    3373             :                 .name = discard_const_p(char, "fid"),
    3374             :                 .get = py_srvsvc_NetFileInfo2_get_fid,
    3375             :                 .set = py_srvsvc_NetFileInfo2_set_fid,
    3376             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3377             :         },
    3378             :         { .name = NULL }
    3379             : };
    3380             : 
    3381           0 : static PyObject *py_srvsvc_NetFileInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3382             : {
    3383           0 :         return pytalloc_new(struct srvsvc_NetFileInfo2, type);
    3384             : }
    3385             : 
    3386             : 
    3387             : static PyTypeObject srvsvc_NetFileInfo2_Type = {
    3388             :         PyVarObject_HEAD_INIT(NULL, 0)
    3389             :         .tp_name = "srvsvc.NetFileInfo2",
    3390             :         .tp_getset = py_srvsvc_NetFileInfo2_getsetters,
    3391             :         .tp_methods = NULL,
    3392             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3393             :         .tp_new = py_srvsvc_NetFileInfo2_new,
    3394             : };
    3395             : 
    3396             : 
    3397           0 : static PyObject *py_srvsvc_NetFileCtr2_get_count(PyObject *obj, void *closure)
    3398             : {
    3399           0 :         struct srvsvc_NetFileCtr2 *object = (struct srvsvc_NetFileCtr2 *)pytalloc_get_ptr(obj);
    3400             :         PyObject *py_count;
    3401           0 :         py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
    3402           0 :         return py_count;
    3403             : }
    3404             : 
    3405           0 : static int py_srvsvc_NetFileCtr2_set_count(PyObject *py_obj, PyObject *value, void *closure)
    3406             : {
    3407           0 :         struct srvsvc_NetFileCtr2 *object = (struct srvsvc_NetFileCtr2 *)pytalloc_get_ptr(py_obj);
    3408           0 :         if (value == NULL) {
    3409           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
    3410           0 :                 return -1;
    3411             :         }
    3412             :         {
    3413           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
    3414           0 :                 if (PyLong_Check(value)) {
    3415             :                         unsigned long long test_var;
    3416           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3417           0 :                         if (PyErr_Occurred() != NULL) {
    3418           0 :                                 return -1;
    3419             :                         }
    3420           0 :                         if (test_var > uint_max) {
    3421           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3422             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3423           0 :                                 return -1;
    3424             :                         }
    3425           0 :                         object->count = test_var;
    3426             :                 } else {
    3427           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3428             :                           PyLong_Type.tp_name);
    3429           0 :                         return -1;
    3430             :                 }
    3431             :         }
    3432           0 :         return 0;
    3433             : }
    3434             : 
    3435           0 : static PyObject *py_srvsvc_NetFileCtr2_get_array(PyObject *obj, void *closure)
    3436             : {
    3437           0 :         struct srvsvc_NetFileCtr2 *object = (struct srvsvc_NetFileCtr2 *)pytalloc_get_ptr(obj);
    3438             :         PyObject *py_array;
    3439           0 :         if (object->array == NULL) {
    3440           0 :                 Py_RETURN_NONE;
    3441             :         }
    3442           0 :         if (object->array == NULL) {
    3443           0 :                 py_array = Py_None;
    3444           0 :                 Py_INCREF(py_array);
    3445             :         } else {
    3446           0 :                 py_array = PyList_New(object->count);
    3447           0 :                 if (py_array == NULL) {
    3448           0 :                         return NULL;
    3449             :                 }
    3450             :                 {
    3451             :                         int array_cntr_1;
    3452           0 :                         for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
    3453             :                                 PyObject *py_array_1;
    3454           0 :                                 py_array_1 = pytalloc_reference_ex(&srvsvc_NetFileInfo2_Type, object->array, &object->array[array_cntr_1]);
    3455           0 :                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
    3456             :                         }
    3457             :                 }
    3458             :         }
    3459           0 :         return py_array;
    3460             : }
    3461             : 
    3462           0 : static int py_srvsvc_NetFileCtr2_set_array(PyObject *py_obj, PyObject *value, void *closure)
    3463             : {
    3464           0 :         struct srvsvc_NetFileCtr2 *object = (struct srvsvc_NetFileCtr2 *)pytalloc_get_ptr(py_obj);
    3465           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
    3466           0 :         if (value == NULL) {
    3467           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
    3468           0 :                 return -1;
    3469             :         }
    3470           0 :         if (value == Py_None) {
    3471           0 :                 object->array = NULL;
    3472             :         } else {
    3473           0 :                 object->array = NULL;
    3474           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    3475             :                 {
    3476             :                         int array_cntr_1;
    3477           0 :                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
    3478           0 :                         if (!object->array) { return -1;; }
    3479           0 :                         talloc_set_name_const(object->array, "ARRAY: object->array");
    3480           0 :                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
    3481           0 :                                 if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
    3482           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
    3483           0 :                                         return -1;
    3484             :                                 }
    3485           0 :                                 PY_CHECK_TYPE(&srvsvc_NetFileInfo2_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
    3486           0 :                                 if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
    3487           0 :                                         PyErr_NoMemory();
    3488           0 :                                         return -1;
    3489             :                                 }
    3490           0 :                                 object->array[array_cntr_1] = *(struct srvsvc_NetFileInfo2 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
    3491             :                         }
    3492             :                 }
    3493             :         }
    3494           0 :         return 0;
    3495             : }
    3496             : 
    3497             : static PyGetSetDef py_srvsvc_NetFileCtr2_getsetters[] = {
    3498             :         {
    3499             :                 .name = discard_const_p(char, "count"),
    3500             :                 .get = py_srvsvc_NetFileCtr2_get_count,
    3501             :                 .set = py_srvsvc_NetFileCtr2_set_count,
    3502             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3503             :         },
    3504             :         {
    3505             :                 .name = discard_const_p(char, "array"),
    3506             :                 .get = py_srvsvc_NetFileCtr2_get_array,
    3507             :                 .set = py_srvsvc_NetFileCtr2_set_array,
    3508             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetFileInfo2")
    3509             :         },
    3510             :         { .name = NULL }
    3511             : };
    3512             : 
    3513           0 : static PyObject *py_srvsvc_NetFileCtr2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3514             : {
    3515           0 :         return pytalloc_new(struct srvsvc_NetFileCtr2, type);
    3516             : }
    3517             : 
    3518             : 
    3519             : static PyTypeObject srvsvc_NetFileCtr2_Type = {
    3520             :         PyVarObject_HEAD_INIT(NULL, 0)
    3521             :         .tp_name = "srvsvc.NetFileCtr2",
    3522             :         .tp_getset = py_srvsvc_NetFileCtr2_getsetters,
    3523             :         .tp_methods = NULL,
    3524             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3525             :         .tp_new = py_srvsvc_NetFileCtr2_new,
    3526             : };
    3527             : 
    3528             : 
    3529           0 : static PyObject *py_srvsvc_NetFileInfo3_get_fid(PyObject *obj, void *closure)
    3530             : {
    3531           0 :         struct srvsvc_NetFileInfo3 *object = (struct srvsvc_NetFileInfo3 *)pytalloc_get_ptr(obj);
    3532             :         PyObject *py_fid;
    3533           0 :         py_fid = PyLong_FromUnsignedLongLong((uint32_t)object->fid);
    3534           0 :         return py_fid;
    3535             : }
    3536             : 
    3537           0 : static int py_srvsvc_NetFileInfo3_set_fid(PyObject *py_obj, PyObject *value, void *closure)
    3538             : {
    3539           0 :         struct srvsvc_NetFileInfo3 *object = (struct srvsvc_NetFileInfo3 *)pytalloc_get_ptr(py_obj);
    3540           0 :         if (value == NULL) {
    3541           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->fid");
    3542           0 :                 return -1;
    3543             :         }
    3544             :         {
    3545           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->fid));
    3546           0 :                 if (PyLong_Check(value)) {
    3547             :                         unsigned long long test_var;
    3548           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3549           0 :                         if (PyErr_Occurred() != NULL) {
    3550           0 :                                 return -1;
    3551             :                         }
    3552           0 :                         if (test_var > uint_max) {
    3553           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3554             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3555           0 :                                 return -1;
    3556             :                         }
    3557           0 :                         object->fid = test_var;
    3558             :                 } else {
    3559           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3560             :                           PyLong_Type.tp_name);
    3561           0 :                         return -1;
    3562             :                 }
    3563             :         }
    3564           0 :         return 0;
    3565             : }
    3566             : 
    3567           0 : static PyObject *py_srvsvc_NetFileInfo3_get_permissions(PyObject *obj, void *closure)
    3568             : {
    3569           0 :         struct srvsvc_NetFileInfo3 *object = (struct srvsvc_NetFileInfo3 *)pytalloc_get_ptr(obj);
    3570             :         PyObject *py_permissions;
    3571           0 :         py_permissions = PyLong_FromUnsignedLongLong((uint32_t)object->permissions);
    3572           0 :         return py_permissions;
    3573             : }
    3574             : 
    3575           0 : static int py_srvsvc_NetFileInfo3_set_permissions(PyObject *py_obj, PyObject *value, void *closure)
    3576             : {
    3577           0 :         struct srvsvc_NetFileInfo3 *object = (struct srvsvc_NetFileInfo3 *)pytalloc_get_ptr(py_obj);
    3578           0 :         if (value == NULL) {
    3579           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->permissions");
    3580           0 :                 return -1;
    3581             :         }
    3582             :         {
    3583           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->permissions));
    3584           0 :                 if (PyLong_Check(value)) {
    3585             :                         unsigned long long test_var;
    3586           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3587           0 :                         if (PyErr_Occurred() != NULL) {
    3588           0 :                                 return -1;
    3589             :                         }
    3590           0 :                         if (test_var > uint_max) {
    3591           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3592             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3593           0 :                                 return -1;
    3594             :                         }
    3595           0 :                         object->permissions = test_var;
    3596             :                 } else {
    3597           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3598             :                           PyLong_Type.tp_name);
    3599           0 :                         return -1;
    3600             :                 }
    3601             :         }
    3602           0 :         return 0;
    3603             : }
    3604             : 
    3605           0 : static PyObject *py_srvsvc_NetFileInfo3_get_num_locks(PyObject *obj, void *closure)
    3606             : {
    3607           0 :         struct srvsvc_NetFileInfo3 *object = (struct srvsvc_NetFileInfo3 *)pytalloc_get_ptr(obj);
    3608             :         PyObject *py_num_locks;
    3609           0 :         py_num_locks = PyLong_FromUnsignedLongLong((uint32_t)object->num_locks);
    3610           0 :         return py_num_locks;
    3611             : }
    3612             : 
    3613           0 : static int py_srvsvc_NetFileInfo3_set_num_locks(PyObject *py_obj, PyObject *value, void *closure)
    3614             : {
    3615           0 :         struct srvsvc_NetFileInfo3 *object = (struct srvsvc_NetFileInfo3 *)pytalloc_get_ptr(py_obj);
    3616           0 :         if (value == NULL) {
    3617           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_locks");
    3618           0 :                 return -1;
    3619             :         }
    3620             :         {
    3621           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_locks));
    3622           0 :                 if (PyLong_Check(value)) {
    3623             :                         unsigned long long test_var;
    3624           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3625           0 :                         if (PyErr_Occurred() != NULL) {
    3626           0 :                                 return -1;
    3627             :                         }
    3628           0 :                         if (test_var > uint_max) {
    3629           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3630             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3631           0 :                                 return -1;
    3632             :                         }
    3633           0 :                         object->num_locks = test_var;
    3634             :                 } else {
    3635           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3636             :                           PyLong_Type.tp_name);
    3637           0 :                         return -1;
    3638             :                 }
    3639             :         }
    3640           0 :         return 0;
    3641             : }
    3642             : 
    3643           0 : static PyObject *py_srvsvc_NetFileInfo3_get_path(PyObject *obj, void *closure)
    3644             : {
    3645           0 :         struct srvsvc_NetFileInfo3 *object = (struct srvsvc_NetFileInfo3 *)pytalloc_get_ptr(obj);
    3646             :         PyObject *py_path;
    3647           0 :         if (object->path == NULL) {
    3648           0 :                 Py_RETURN_NONE;
    3649             :         }
    3650           0 :         if (object->path == NULL) {
    3651           0 :                 py_path = Py_None;
    3652           0 :                 Py_INCREF(py_path);
    3653             :         } else {
    3654           0 :                 if (object->path == NULL) {
    3655           0 :                         py_path = Py_None;
    3656           0 :                         Py_INCREF(py_path);
    3657             :                 } else {
    3658           0 :                         py_path = PyUnicode_Decode(object->path, strlen(object->path), "utf-8", "ignore");
    3659             :                 }
    3660             :         }
    3661           0 :         return py_path;
    3662             : }
    3663             : 
    3664           0 : static int py_srvsvc_NetFileInfo3_set_path(PyObject *py_obj, PyObject *value, void *closure)
    3665             : {
    3666           0 :         struct srvsvc_NetFileInfo3 *object = (struct srvsvc_NetFileInfo3 *)pytalloc_get_ptr(py_obj);
    3667           0 :         if (value == NULL) {
    3668           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->path");
    3669           0 :                 return -1;
    3670             :         }
    3671           0 :         if (value == Py_None) {
    3672           0 :                 object->path = NULL;
    3673             :         } else {
    3674           0 :                 object->path = NULL;
    3675             :                 {
    3676             :                         const char *test_str;
    3677             :                         const char *talloc_str;
    3678           0 :                         PyObject *unicode = NULL;
    3679           0 :                         if (PyUnicode_Check(value)) {
    3680           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    3681           0 :                                 if (unicode == NULL) {
    3682           0 :                                         PyErr_NoMemory();
    3683           0 :                                         return -1;
    3684             :                                 }
    3685           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    3686           0 :                         } else if (PyBytes_Check(value)) {
    3687           0 :                                 test_str = PyBytes_AS_STRING(value);
    3688             :                         } else {
    3689           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    3690           0 :                                 return -1;
    3691             :                         }
    3692           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    3693           0 :                         if (unicode != NULL) {
    3694           0 :                                 Py_DECREF(unicode);
    3695             :                         }
    3696           0 :                         if (talloc_str == NULL) {
    3697           0 :                                 PyErr_NoMemory();
    3698           0 :                                 return -1;
    3699             :                         }
    3700           0 :                         object->path = talloc_str;
    3701             :                 }
    3702             :         }
    3703           0 :         return 0;
    3704             : }
    3705             : 
    3706           0 : static PyObject *py_srvsvc_NetFileInfo3_get_user(PyObject *obj, void *closure)
    3707             : {
    3708           0 :         struct srvsvc_NetFileInfo3 *object = (struct srvsvc_NetFileInfo3 *)pytalloc_get_ptr(obj);
    3709             :         PyObject *py_user;
    3710           0 :         if (object->user == NULL) {
    3711           0 :                 Py_RETURN_NONE;
    3712             :         }
    3713           0 :         if (object->user == NULL) {
    3714           0 :                 py_user = Py_None;
    3715           0 :                 Py_INCREF(py_user);
    3716             :         } else {
    3717           0 :                 if (object->user == NULL) {
    3718           0 :                         py_user = Py_None;
    3719           0 :                         Py_INCREF(py_user);
    3720             :                 } else {
    3721           0 :                         py_user = PyUnicode_Decode(object->user, strlen(object->user), "utf-8", "ignore");
    3722             :                 }
    3723             :         }
    3724           0 :         return py_user;
    3725             : }
    3726             : 
    3727           0 : static int py_srvsvc_NetFileInfo3_set_user(PyObject *py_obj, PyObject *value, void *closure)
    3728             : {
    3729           0 :         struct srvsvc_NetFileInfo3 *object = (struct srvsvc_NetFileInfo3 *)pytalloc_get_ptr(py_obj);
    3730           0 :         if (value == NULL) {
    3731           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user");
    3732           0 :                 return -1;
    3733             :         }
    3734           0 :         if (value == Py_None) {
    3735           0 :                 object->user = NULL;
    3736             :         } else {
    3737           0 :                 object->user = NULL;
    3738             :                 {
    3739             :                         const char *test_str;
    3740             :                         const char *talloc_str;
    3741           0 :                         PyObject *unicode = NULL;
    3742           0 :                         if (PyUnicode_Check(value)) {
    3743           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    3744           0 :                                 if (unicode == NULL) {
    3745           0 :                                         PyErr_NoMemory();
    3746           0 :                                         return -1;
    3747             :                                 }
    3748           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    3749           0 :                         } else if (PyBytes_Check(value)) {
    3750           0 :                                 test_str = PyBytes_AS_STRING(value);
    3751             :                         } else {
    3752           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    3753           0 :                                 return -1;
    3754             :                         }
    3755           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    3756           0 :                         if (unicode != NULL) {
    3757           0 :                                 Py_DECREF(unicode);
    3758             :                         }
    3759           0 :                         if (talloc_str == NULL) {
    3760           0 :                                 PyErr_NoMemory();
    3761           0 :                                 return -1;
    3762             :                         }
    3763           0 :                         object->user = talloc_str;
    3764             :                 }
    3765             :         }
    3766           0 :         return 0;
    3767             : }
    3768             : 
    3769             : static PyGetSetDef py_srvsvc_NetFileInfo3_getsetters[] = {
    3770             :         {
    3771             :                 .name = discard_const_p(char, "fid"),
    3772             :                 .get = py_srvsvc_NetFileInfo3_get_fid,
    3773             :                 .set = py_srvsvc_NetFileInfo3_set_fid,
    3774             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3775             :         },
    3776             :         {
    3777             :                 .name = discard_const_p(char, "permissions"),
    3778             :                 .get = py_srvsvc_NetFileInfo3_get_permissions,
    3779             :                 .set = py_srvsvc_NetFileInfo3_set_permissions,
    3780             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3781             :         },
    3782             :         {
    3783             :                 .name = discard_const_p(char, "num_locks"),
    3784             :                 .get = py_srvsvc_NetFileInfo3_get_num_locks,
    3785             :                 .set = py_srvsvc_NetFileInfo3_set_num_locks,
    3786             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3787             :         },
    3788             :         {
    3789             :                 .name = discard_const_p(char, "path"),
    3790             :                 .get = py_srvsvc_NetFileInfo3_get_path,
    3791             :                 .set = py_srvsvc_NetFileInfo3_set_path,
    3792             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    3793             :         },
    3794             :         {
    3795             :                 .name = discard_const_p(char, "user"),
    3796             :                 .get = py_srvsvc_NetFileInfo3_get_user,
    3797             :                 .set = py_srvsvc_NetFileInfo3_set_user,
    3798             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    3799             :         },
    3800             :         { .name = NULL }
    3801             : };
    3802             : 
    3803           0 : static PyObject *py_srvsvc_NetFileInfo3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3804             : {
    3805           0 :         return pytalloc_new(struct srvsvc_NetFileInfo3, type);
    3806             : }
    3807             : 
    3808             : 
    3809             : static PyTypeObject srvsvc_NetFileInfo3_Type = {
    3810             :         PyVarObject_HEAD_INIT(NULL, 0)
    3811             :         .tp_name = "srvsvc.NetFileInfo3",
    3812             :         .tp_getset = py_srvsvc_NetFileInfo3_getsetters,
    3813             :         .tp_methods = NULL,
    3814             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3815             :         .tp_new = py_srvsvc_NetFileInfo3_new,
    3816             : };
    3817             : 
    3818             : 
    3819           0 : static PyObject *py_srvsvc_NetFileCtr3_get_count(PyObject *obj, void *closure)
    3820             : {
    3821           0 :         struct srvsvc_NetFileCtr3 *object = (struct srvsvc_NetFileCtr3 *)pytalloc_get_ptr(obj);
    3822             :         PyObject *py_count;
    3823           0 :         py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
    3824           0 :         return py_count;
    3825             : }
    3826             : 
    3827           0 : static int py_srvsvc_NetFileCtr3_set_count(PyObject *py_obj, PyObject *value, void *closure)
    3828             : {
    3829           0 :         struct srvsvc_NetFileCtr3 *object = (struct srvsvc_NetFileCtr3 *)pytalloc_get_ptr(py_obj);
    3830           0 :         if (value == NULL) {
    3831           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
    3832           0 :                 return -1;
    3833             :         }
    3834             :         {
    3835           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
    3836           0 :                 if (PyLong_Check(value)) {
    3837             :                         unsigned long long test_var;
    3838           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    3839           0 :                         if (PyErr_Occurred() != NULL) {
    3840           0 :                                 return -1;
    3841             :                         }
    3842           0 :                         if (test_var > uint_max) {
    3843           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    3844             :                                   PyLong_Type.tp_name, uint_max, test_var);
    3845           0 :                                 return -1;
    3846             :                         }
    3847           0 :                         object->count = test_var;
    3848             :                 } else {
    3849           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    3850             :                           PyLong_Type.tp_name);
    3851           0 :                         return -1;
    3852             :                 }
    3853             :         }
    3854           0 :         return 0;
    3855             : }
    3856             : 
    3857           0 : static PyObject *py_srvsvc_NetFileCtr3_get_array(PyObject *obj, void *closure)
    3858             : {
    3859           0 :         struct srvsvc_NetFileCtr3 *object = (struct srvsvc_NetFileCtr3 *)pytalloc_get_ptr(obj);
    3860             :         PyObject *py_array;
    3861           0 :         if (object->array == NULL) {
    3862           0 :                 Py_RETURN_NONE;
    3863             :         }
    3864           0 :         if (object->array == NULL) {
    3865           0 :                 py_array = Py_None;
    3866           0 :                 Py_INCREF(py_array);
    3867             :         } else {
    3868           0 :                 py_array = PyList_New(object->count);
    3869           0 :                 if (py_array == NULL) {
    3870           0 :                         return NULL;
    3871             :                 }
    3872             :                 {
    3873             :                         int array_cntr_1;
    3874           0 :                         for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
    3875             :                                 PyObject *py_array_1;
    3876           0 :                                 py_array_1 = pytalloc_reference_ex(&srvsvc_NetFileInfo3_Type, object->array, &object->array[array_cntr_1]);
    3877           0 :                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
    3878             :                         }
    3879             :                 }
    3880             :         }
    3881           0 :         return py_array;
    3882             : }
    3883             : 
    3884           0 : static int py_srvsvc_NetFileCtr3_set_array(PyObject *py_obj, PyObject *value, void *closure)
    3885             : {
    3886           0 :         struct srvsvc_NetFileCtr3 *object = (struct srvsvc_NetFileCtr3 *)pytalloc_get_ptr(py_obj);
    3887           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
    3888           0 :         if (value == NULL) {
    3889           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
    3890           0 :                 return -1;
    3891             :         }
    3892           0 :         if (value == Py_None) {
    3893           0 :                 object->array = NULL;
    3894             :         } else {
    3895           0 :                 object->array = NULL;
    3896           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    3897             :                 {
    3898             :                         int array_cntr_1;
    3899           0 :                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
    3900           0 :                         if (!object->array) { return -1;; }
    3901           0 :                         talloc_set_name_const(object->array, "ARRAY: object->array");
    3902           0 :                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
    3903           0 :                                 if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
    3904           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
    3905           0 :                                         return -1;
    3906             :                                 }
    3907           0 :                                 PY_CHECK_TYPE(&srvsvc_NetFileInfo3_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
    3908           0 :                                 if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
    3909           0 :                                         PyErr_NoMemory();
    3910           0 :                                         return -1;
    3911             :                                 }
    3912           0 :                                 object->array[array_cntr_1] = *(struct srvsvc_NetFileInfo3 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
    3913             :                         }
    3914             :                 }
    3915             :         }
    3916           0 :         return 0;
    3917             : }
    3918             : 
    3919             : static PyGetSetDef py_srvsvc_NetFileCtr3_getsetters[] = {
    3920             :         {
    3921             :                 .name = discard_const_p(char, "count"),
    3922             :                 .get = py_srvsvc_NetFileCtr3_get_count,
    3923             :                 .set = py_srvsvc_NetFileCtr3_set_count,
    3924             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    3925             :         },
    3926             :         {
    3927             :                 .name = discard_const_p(char, "array"),
    3928             :                 .get = py_srvsvc_NetFileCtr3_get_array,
    3929             :                 .set = py_srvsvc_NetFileCtr3_set_array,
    3930             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetFileInfo3")
    3931             :         },
    3932             :         { .name = NULL }
    3933             : };
    3934             : 
    3935           0 : static PyObject *py_srvsvc_NetFileCtr3_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    3936             : {
    3937           0 :         return pytalloc_new(struct srvsvc_NetFileCtr3, type);
    3938             : }
    3939             : 
    3940             : 
    3941             : static PyTypeObject srvsvc_NetFileCtr3_Type = {
    3942             :         PyVarObject_HEAD_INIT(NULL, 0)
    3943             :         .tp_name = "srvsvc.NetFileCtr3",
    3944             :         .tp_getset = py_srvsvc_NetFileCtr3_getsetters,
    3945             :         .tp_methods = NULL,
    3946             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    3947             :         .tp_new = py_srvsvc_NetFileCtr3_new,
    3948             : };
    3949             : 
    3950           0 : static PyObject *py_import_srvsvc_NetFileInfo(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetFileInfo *in)
    3951             : {
    3952             :         PyObject *ret;
    3953             : 
    3954           0 :         switch (level) {
    3955           0 :                 case 2:
    3956           0 :                         if (in->info2 == NULL) {
    3957           0 :                                 ret = Py_None;
    3958           0 :                                 Py_INCREF(ret);
    3959             :                         } else {
    3960           0 :                                 ret = pytalloc_reference_ex(&srvsvc_NetFileInfo2_Type, in->info2, in->info2);
    3961             :                         }
    3962           0 :                         return ret;
    3963             : 
    3964           0 :                 case 3:
    3965           0 :                         if (in->info3 == NULL) {
    3966           0 :                                 ret = Py_None;
    3967           0 :                                 Py_INCREF(ret);
    3968             :                         } else {
    3969           0 :                                 ret = pytalloc_reference_ex(&srvsvc_NetFileInfo3_Type, in->info3, in->info3);
    3970             :                         }
    3971           0 :                         return ret;
    3972             : 
    3973           0 :                 default:
    3974           0 :                         ret = Py_None;
    3975           0 :                         Py_INCREF(ret);
    3976           0 :                         return ret;
    3977             : 
    3978             :         }
    3979             :         PyErr_SetString(PyExc_TypeError, "unknown union level");
    3980             :         return NULL;
    3981             : }
    3982             : 
    3983           0 : static union srvsvc_NetFileInfo *py_export_srvsvc_NetFileInfo(TALLOC_CTX *mem_ctx, int level, PyObject *in)
    3984             : {
    3985           0 :         union srvsvc_NetFileInfo *ret = talloc_zero(mem_ctx, union srvsvc_NetFileInfo);
    3986           0 :         switch (level) {
    3987           0 :                 case 2:
    3988           0 :                         if (in == NULL) {
    3989           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info2");
    3990           0 :                                 talloc_free(ret); return NULL;
    3991             :                         }
    3992           0 :                         if (in == Py_None) {
    3993           0 :                                 ret->info2 = NULL;
    3994             :                         } else {
    3995           0 :                                 ret->info2 = NULL;
    3996           0 :                                 PY_CHECK_TYPE(&srvsvc_NetFileInfo2_Type, in, talloc_free(ret); return NULL;);
    3997           0 :                                 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    3998           0 :                                         PyErr_NoMemory();
    3999           0 :                                         talloc_free(ret); return NULL;
    4000             :                                 }
    4001           0 :                                 ret->info2 = (struct srvsvc_NetFileInfo2 *)pytalloc_get_ptr(in);
    4002             :                         }
    4003           0 :                         break;
    4004             : 
    4005           0 :                 case 3:
    4006           0 :                         if (in == NULL) {
    4007           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->info3");
    4008           0 :                                 talloc_free(ret); return NULL;
    4009             :                         }
    4010           0 :                         if (in == Py_None) {
    4011           0 :                                 ret->info3 = NULL;
    4012             :                         } else {
    4013           0 :                                 ret->info3 = NULL;
    4014           0 :                                 PY_CHECK_TYPE(&srvsvc_NetFileInfo3_Type, in, talloc_free(ret); return NULL;);
    4015           0 :                                 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    4016           0 :                                         PyErr_NoMemory();
    4017           0 :                                         talloc_free(ret); return NULL;
    4018             :                                 }
    4019           0 :                                 ret->info3 = (struct srvsvc_NetFileInfo3 *)pytalloc_get_ptr(in);
    4020             :                         }
    4021           0 :                         break;
    4022             : 
    4023           0 :                 default:
    4024           0 :                         break;
    4025             : 
    4026             :         }
    4027             : 
    4028           0 :         return ret;
    4029             : }
    4030             : 
    4031           0 : static PyObject *py_srvsvc_NetFileInfo_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4032             : {
    4033           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    4034           0 :         PyObject *mem_ctx_obj = NULL;
    4035           0 :         TALLOC_CTX *mem_ctx = NULL;
    4036           0 :         int level = 0;
    4037           0 :         PyObject *in_obj = NULL;
    4038           0 :         union srvsvc_NetFileInfo *in = NULL;
    4039             : 
    4040           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
    4041             :                 discard_const_p(char *, kwnames),
    4042             :                 &mem_ctx_obj,
    4043             :                 &level,
    4044             :                 &in_obj)) {
    4045           0 :                 return NULL;
    4046             :         }
    4047           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    4048           0 :         if (mem_ctx == NULL) {
    4049           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    4050           0 :                 return NULL;
    4051             :         }
    4052           0 :         in = (union srvsvc_NetFileInfo *)pytalloc_get_ptr(in_obj);
    4053           0 :         if (in == NULL) {
    4054           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union srvsvc_NetFileInfo!");
    4055           0 :                 return NULL;
    4056             :         }
    4057             : 
    4058           0 :         return py_import_srvsvc_NetFileInfo(mem_ctx, level, in);
    4059             : }
    4060             : 
    4061           0 : static PyObject *py_srvsvc_NetFileInfo_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4062             : {
    4063           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    4064           0 :         PyObject *mem_ctx_obj = NULL;
    4065           0 :         TALLOC_CTX *mem_ctx = NULL;
    4066           0 :         int level = 0;
    4067           0 :         PyObject *in = NULL;
    4068           0 :         union srvsvc_NetFileInfo *out = NULL;
    4069             : 
    4070           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
    4071             :                 discard_const_p(char *, kwnames),
    4072             :                 &mem_ctx_obj,
    4073             :                 &level,
    4074             :                 &in)) {
    4075           0 :                 return NULL;
    4076             :         }
    4077           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    4078           0 :         if (mem_ctx == NULL) {
    4079           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    4080           0 :                 return NULL;
    4081             :         }
    4082             : 
    4083           0 :         out = py_export_srvsvc_NetFileInfo(mem_ctx, level, in);
    4084           0 :         if (out == NULL) {
    4085           0 :                 return NULL;
    4086             :         }
    4087             : 
    4088           0 :         return pytalloc_GenericObject_reference(out);
    4089             : }
    4090             : 
    4091             : static PyMethodDef py_srvsvc_NetFileInfo_methods[] = {
    4092             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_srvsvc_NetFileInfo_import),
    4093             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    4094             :                 "T.__import__(mem_ctx, level, in) => ret." },
    4095             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_srvsvc_NetFileInfo_export),
    4096             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    4097             :                 "T.__export__(mem_ctx, level, in) => ret." },
    4098             :         { NULL, NULL, 0, NULL }
    4099             : };
    4100             : 
    4101           0 : static PyObject *py_srvsvc_NetFileInfo_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4102             : {
    4103           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
    4104           0 :         return NULL;
    4105             : }
    4106             : 
    4107             : 
    4108             : static PyTypeObject srvsvc_NetFileInfo_Type = {
    4109             :         PyVarObject_HEAD_INIT(NULL, 0)
    4110             :         .tp_name = "srvsvc.NetFileInfo",
    4111             :         .tp_getset = NULL,
    4112             :         .tp_methods = py_srvsvc_NetFileInfo_methods,
    4113             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4114             :         .tp_new = py_srvsvc_NetFileInfo_new,
    4115             : };
    4116             : 
    4117           0 : static PyObject *py_import_srvsvc_NetFileCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetFileCtr *in)
    4118             : {
    4119             :         PyObject *ret;
    4120             : 
    4121           0 :         switch (level) {
    4122           0 :                 case 2:
    4123           0 :                         if (in->ctr2 == NULL) {
    4124           0 :                                 ret = Py_None;
    4125           0 :                                 Py_INCREF(ret);
    4126             :                         } else {
    4127           0 :                                 ret = pytalloc_reference_ex(&srvsvc_NetFileCtr2_Type, in->ctr2, in->ctr2);
    4128             :                         }
    4129           0 :                         return ret;
    4130             : 
    4131           0 :                 case 3:
    4132           0 :                         if (in->ctr3 == NULL) {
    4133           0 :                                 ret = Py_None;
    4134           0 :                                 Py_INCREF(ret);
    4135             :                         } else {
    4136           0 :                                 ret = pytalloc_reference_ex(&srvsvc_NetFileCtr3_Type, in->ctr3, in->ctr3);
    4137             :                         }
    4138           0 :                         return ret;
    4139             : 
    4140           0 :                 default:
    4141           0 :                         ret = Py_None;
    4142           0 :                         Py_INCREF(ret);
    4143           0 :                         return ret;
    4144             : 
    4145             :         }
    4146             :         PyErr_SetString(PyExc_TypeError, "unknown union level");
    4147             :         return NULL;
    4148             : }
    4149             : 
    4150           0 : static union srvsvc_NetFileCtr *py_export_srvsvc_NetFileCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in)
    4151             : {
    4152           0 :         union srvsvc_NetFileCtr *ret = talloc_zero(mem_ctx, union srvsvc_NetFileCtr);
    4153           0 :         switch (level) {
    4154           0 :                 case 2:
    4155           0 :                         if (in == NULL) {
    4156           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr2");
    4157           0 :                                 talloc_free(ret); return NULL;
    4158             :                         }
    4159           0 :                         if (in == Py_None) {
    4160           0 :                                 ret->ctr2 = NULL;
    4161             :                         } else {
    4162           0 :                                 ret->ctr2 = NULL;
    4163           0 :                                 PY_CHECK_TYPE(&srvsvc_NetFileCtr2_Type, in, talloc_free(ret); return NULL;);
    4164           0 :                                 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    4165           0 :                                         PyErr_NoMemory();
    4166           0 :                                         talloc_free(ret); return NULL;
    4167             :                                 }
    4168           0 :                                 ret->ctr2 = (struct srvsvc_NetFileCtr2 *)pytalloc_get_ptr(in);
    4169             :                         }
    4170           0 :                         break;
    4171             : 
    4172           0 :                 case 3:
    4173           0 :                         if (in == NULL) {
    4174           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr3");
    4175           0 :                                 talloc_free(ret); return NULL;
    4176             :                         }
    4177           0 :                         if (in == Py_None) {
    4178           0 :                                 ret->ctr3 = NULL;
    4179             :                         } else {
    4180           0 :                                 ret->ctr3 = NULL;
    4181           0 :                                 PY_CHECK_TYPE(&srvsvc_NetFileCtr3_Type, in, talloc_free(ret); return NULL;);
    4182           0 :                                 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    4183           0 :                                         PyErr_NoMemory();
    4184           0 :                                         talloc_free(ret); return NULL;
    4185             :                                 }
    4186           0 :                                 ret->ctr3 = (struct srvsvc_NetFileCtr3 *)pytalloc_get_ptr(in);
    4187             :                         }
    4188           0 :                         break;
    4189             : 
    4190           0 :                 default:
    4191           0 :                         break;
    4192             : 
    4193             :         }
    4194             : 
    4195           0 :         return ret;
    4196             : }
    4197             : 
    4198           0 : static PyObject *py_srvsvc_NetFileCtr_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4199             : {
    4200           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    4201           0 :         PyObject *mem_ctx_obj = NULL;
    4202           0 :         TALLOC_CTX *mem_ctx = NULL;
    4203           0 :         int level = 0;
    4204           0 :         PyObject *in_obj = NULL;
    4205           0 :         union srvsvc_NetFileCtr *in = NULL;
    4206             : 
    4207           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
    4208             :                 discard_const_p(char *, kwnames),
    4209             :                 &mem_ctx_obj,
    4210             :                 &level,
    4211             :                 &in_obj)) {
    4212           0 :                 return NULL;
    4213             :         }
    4214           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    4215           0 :         if (mem_ctx == NULL) {
    4216           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    4217           0 :                 return NULL;
    4218             :         }
    4219           0 :         in = (union srvsvc_NetFileCtr *)pytalloc_get_ptr(in_obj);
    4220           0 :         if (in == NULL) {
    4221           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union srvsvc_NetFileCtr!");
    4222           0 :                 return NULL;
    4223             :         }
    4224             : 
    4225           0 :         return py_import_srvsvc_NetFileCtr(mem_ctx, level, in);
    4226             : }
    4227             : 
    4228           0 : static PyObject *py_srvsvc_NetFileCtr_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4229             : {
    4230           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    4231           0 :         PyObject *mem_ctx_obj = NULL;
    4232           0 :         TALLOC_CTX *mem_ctx = NULL;
    4233           0 :         int level = 0;
    4234           0 :         PyObject *in = NULL;
    4235           0 :         union srvsvc_NetFileCtr *out = NULL;
    4236             : 
    4237           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
    4238             :                 discard_const_p(char *, kwnames),
    4239             :                 &mem_ctx_obj,
    4240             :                 &level,
    4241             :                 &in)) {
    4242           0 :                 return NULL;
    4243             :         }
    4244           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    4245           0 :         if (mem_ctx == NULL) {
    4246           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    4247           0 :                 return NULL;
    4248             :         }
    4249             : 
    4250           0 :         out = py_export_srvsvc_NetFileCtr(mem_ctx, level, in);
    4251           0 :         if (out == NULL) {
    4252           0 :                 return NULL;
    4253             :         }
    4254             : 
    4255           0 :         return pytalloc_GenericObject_reference(out);
    4256             : }
    4257             : 
    4258             : static PyMethodDef py_srvsvc_NetFileCtr_methods[] = {
    4259             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_srvsvc_NetFileCtr_import),
    4260             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    4261             :                 "T.__import__(mem_ctx, level, in) => ret." },
    4262             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_srvsvc_NetFileCtr_export),
    4263             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    4264             :                 "T.__export__(mem_ctx, level, in) => ret." },
    4265             :         { NULL, NULL, 0, NULL }
    4266             : };
    4267             : 
    4268           0 : static PyObject *py_srvsvc_NetFileCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4269             : {
    4270           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
    4271           0 :         return NULL;
    4272             : }
    4273             : 
    4274             : 
    4275             : static PyTypeObject srvsvc_NetFileCtr_Type = {
    4276             :         PyVarObject_HEAD_INIT(NULL, 0)
    4277             :         .tp_name = "srvsvc.NetFileCtr",
    4278             :         .tp_getset = NULL,
    4279             :         .tp_methods = py_srvsvc_NetFileCtr_methods,
    4280             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4281             :         .tp_new = py_srvsvc_NetFileCtr_new,
    4282             : };
    4283             : 
    4284             : 
    4285           0 : static PyObject *py_srvsvc_NetFileInfoCtr_get_level(PyObject *obj, void *closure)
    4286             : {
    4287           0 :         struct srvsvc_NetFileInfoCtr *object = (struct srvsvc_NetFileInfoCtr *)pytalloc_get_ptr(obj);
    4288             :         PyObject *py_level;
    4289           0 :         py_level = PyLong_FromUnsignedLongLong((uint32_t)object->level);
    4290           0 :         return py_level;
    4291             : }
    4292             : 
    4293           0 : static int py_srvsvc_NetFileInfoCtr_set_level(PyObject *py_obj, PyObject *value, void *closure)
    4294             : {
    4295           0 :         struct srvsvc_NetFileInfoCtr *object = (struct srvsvc_NetFileInfoCtr *)pytalloc_get_ptr(py_obj);
    4296           0 :         if (value == NULL) {
    4297           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->level");
    4298           0 :                 return -1;
    4299             :         }
    4300             :         {
    4301           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level));
    4302           0 :                 if (PyLong_Check(value)) {
    4303             :                         unsigned long long test_var;
    4304           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4305           0 :                         if (PyErr_Occurred() != NULL) {
    4306           0 :                                 return -1;
    4307             :                         }
    4308           0 :                         if (test_var > uint_max) {
    4309           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4310             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4311           0 :                                 return -1;
    4312             :                         }
    4313           0 :                         object->level = test_var;
    4314             :                 } else {
    4315           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4316             :                           PyLong_Type.tp_name);
    4317           0 :                         return -1;
    4318             :                 }
    4319             :         }
    4320           0 :         return 0;
    4321             : }
    4322             : 
    4323           0 : static PyObject *py_srvsvc_NetFileInfoCtr_get_ctr(PyObject *obj, void *closure)
    4324             : {
    4325           0 :         struct srvsvc_NetFileInfoCtr *object = (struct srvsvc_NetFileInfoCtr *)pytalloc_get_ptr(obj);
    4326             :         PyObject *py_ctr;
    4327           0 :         py_ctr = pyrpc_import_union(&srvsvc_NetFileCtr_Type, pytalloc_get_mem_ctx(obj), object->level, &object->ctr, "union srvsvc_NetFileCtr");
    4328           0 :         if (py_ctr == NULL) {
    4329           0 :                 return NULL;
    4330             :         }
    4331           0 :         return py_ctr;
    4332             : }
    4333             : 
    4334           0 : static int py_srvsvc_NetFileInfoCtr_set_ctr(PyObject *py_obj, PyObject *value, void *closure)
    4335             : {
    4336           0 :         struct srvsvc_NetFileInfoCtr *object = (struct srvsvc_NetFileInfoCtr *)pytalloc_get_ptr(py_obj);
    4337           0 :         if (value == NULL) {
    4338           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ctr");
    4339           0 :                 return -1;
    4340             :         }
    4341             :         {
    4342             :                 union srvsvc_NetFileCtr *ctr_switch_0;
    4343           0 :                 ctr_switch_0 = (union srvsvc_NetFileCtr *)pyrpc_export_union(&srvsvc_NetFileCtr_Type, pytalloc_get_mem_ctx(py_obj), object->level, value, "union srvsvc_NetFileCtr");
    4344           0 :                 if (ctr_switch_0 == NULL) {
    4345           0 :                         return -1;
    4346             :                 }
    4347           0 :                 object->ctr = *ctr_switch_0;
    4348             :         }
    4349           0 :         return 0;
    4350             : }
    4351             : 
    4352             : static PyGetSetDef py_srvsvc_NetFileInfoCtr_getsetters[] = {
    4353             :         {
    4354             :                 .name = discard_const_p(char, "level"),
    4355             :                 .get = py_srvsvc_NetFileInfoCtr_get_level,
    4356             :                 .set = py_srvsvc_NetFileInfoCtr_set_level,
    4357             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4358             :         },
    4359             :         {
    4360             :                 .name = discard_const_p(char, "ctr"),
    4361             :                 .get = py_srvsvc_NetFileInfoCtr_get_ctr,
    4362             :                 .set = py_srvsvc_NetFileInfoCtr_set_ctr,
    4363             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetFileCtr")
    4364             :         },
    4365             :         { .name = NULL }
    4366             : };
    4367             : 
    4368           0 : static PyObject *py_srvsvc_NetFileInfoCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4369             : {
    4370           0 :         return pytalloc_new(struct srvsvc_NetFileInfoCtr, type);
    4371             : }
    4372             : 
    4373             : 
    4374             : static PyTypeObject srvsvc_NetFileInfoCtr_Type = {
    4375             :         PyVarObject_HEAD_INIT(NULL, 0)
    4376             :         .tp_name = "srvsvc.NetFileInfoCtr",
    4377             :         .tp_getset = py_srvsvc_NetFileInfoCtr_getsetters,
    4378             :         .tp_methods = NULL,
    4379             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4380             :         .tp_new = py_srvsvc_NetFileInfoCtr_new,
    4381             : };
    4382             : 
    4383             : 
    4384           0 : static PyObject *py_srvsvc_NetSessInfo0_get_client(PyObject *obj, void *closure)
    4385             : {
    4386           0 :         struct srvsvc_NetSessInfo0 *object = (struct srvsvc_NetSessInfo0 *)pytalloc_get_ptr(obj);
    4387             :         PyObject *py_client;
    4388           0 :         if (object->client == NULL) {
    4389           0 :                 Py_RETURN_NONE;
    4390             :         }
    4391           0 :         if (object->client == NULL) {
    4392           0 :                 py_client = Py_None;
    4393           0 :                 Py_INCREF(py_client);
    4394             :         } else {
    4395           0 :                 if (object->client == NULL) {
    4396           0 :                         py_client = Py_None;
    4397           0 :                         Py_INCREF(py_client);
    4398             :                 } else {
    4399           0 :                         py_client = PyUnicode_Decode(object->client, strlen(object->client), "utf-8", "ignore");
    4400             :                 }
    4401             :         }
    4402           0 :         return py_client;
    4403             : }
    4404             : 
    4405           0 : static int py_srvsvc_NetSessInfo0_set_client(PyObject *py_obj, PyObject *value, void *closure)
    4406             : {
    4407           0 :         struct srvsvc_NetSessInfo0 *object = (struct srvsvc_NetSessInfo0 *)pytalloc_get_ptr(py_obj);
    4408           0 :         if (value == NULL) {
    4409           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->client");
    4410           0 :                 return -1;
    4411             :         }
    4412           0 :         if (value == Py_None) {
    4413           0 :                 object->client = NULL;
    4414             :         } else {
    4415           0 :                 object->client = NULL;
    4416             :                 {
    4417             :                         const char *test_str;
    4418             :                         const char *talloc_str;
    4419           0 :                         PyObject *unicode = NULL;
    4420           0 :                         if (PyUnicode_Check(value)) {
    4421           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    4422           0 :                                 if (unicode == NULL) {
    4423           0 :                                         PyErr_NoMemory();
    4424           0 :                                         return -1;
    4425             :                                 }
    4426           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    4427           0 :                         } else if (PyBytes_Check(value)) {
    4428           0 :                                 test_str = PyBytes_AS_STRING(value);
    4429             :                         } else {
    4430           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    4431           0 :                                 return -1;
    4432             :                         }
    4433           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    4434           0 :                         if (unicode != NULL) {
    4435           0 :                                 Py_DECREF(unicode);
    4436             :                         }
    4437           0 :                         if (talloc_str == NULL) {
    4438           0 :                                 PyErr_NoMemory();
    4439           0 :                                 return -1;
    4440             :                         }
    4441           0 :                         object->client = talloc_str;
    4442             :                 }
    4443             :         }
    4444           0 :         return 0;
    4445             : }
    4446             : 
    4447             : static PyGetSetDef py_srvsvc_NetSessInfo0_getsetters[] = {
    4448             :         {
    4449             :                 .name = discard_const_p(char, "client"),
    4450             :                 .get = py_srvsvc_NetSessInfo0_get_client,
    4451             :                 .set = py_srvsvc_NetSessInfo0_set_client,
    4452             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4453             :         },
    4454             :         { .name = NULL }
    4455             : };
    4456             : 
    4457           0 : static PyObject *py_srvsvc_NetSessInfo0_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4458             : {
    4459           0 :         return pytalloc_new(struct srvsvc_NetSessInfo0, type);
    4460             : }
    4461             : 
    4462             : 
    4463             : static PyTypeObject srvsvc_NetSessInfo0_Type = {
    4464             :         PyVarObject_HEAD_INIT(NULL, 0)
    4465             :         .tp_name = "srvsvc.NetSessInfo0",
    4466             :         .tp_getset = py_srvsvc_NetSessInfo0_getsetters,
    4467             :         .tp_methods = NULL,
    4468             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4469             :         .tp_new = py_srvsvc_NetSessInfo0_new,
    4470             : };
    4471             : 
    4472             : 
    4473           0 : static PyObject *py_srvsvc_NetSessCtr0_get_count(PyObject *obj, void *closure)
    4474             : {
    4475           0 :         struct srvsvc_NetSessCtr0 *object = (struct srvsvc_NetSessCtr0 *)pytalloc_get_ptr(obj);
    4476             :         PyObject *py_count;
    4477           0 :         py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
    4478           0 :         return py_count;
    4479             : }
    4480             : 
    4481           0 : static int py_srvsvc_NetSessCtr0_set_count(PyObject *py_obj, PyObject *value, void *closure)
    4482             : {
    4483           0 :         struct srvsvc_NetSessCtr0 *object = (struct srvsvc_NetSessCtr0 *)pytalloc_get_ptr(py_obj);
    4484           0 :         if (value == NULL) {
    4485           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
    4486           0 :                 return -1;
    4487             :         }
    4488             :         {
    4489           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
    4490           0 :                 if (PyLong_Check(value)) {
    4491             :                         unsigned long long test_var;
    4492           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4493           0 :                         if (PyErr_Occurred() != NULL) {
    4494           0 :                                 return -1;
    4495             :                         }
    4496           0 :                         if (test_var > uint_max) {
    4497           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4498             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4499           0 :                                 return -1;
    4500             :                         }
    4501           0 :                         object->count = test_var;
    4502             :                 } else {
    4503           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4504             :                           PyLong_Type.tp_name);
    4505           0 :                         return -1;
    4506             :                 }
    4507             :         }
    4508           0 :         return 0;
    4509             : }
    4510             : 
    4511           0 : static PyObject *py_srvsvc_NetSessCtr0_get_array(PyObject *obj, void *closure)
    4512             : {
    4513           0 :         struct srvsvc_NetSessCtr0 *object = (struct srvsvc_NetSessCtr0 *)pytalloc_get_ptr(obj);
    4514             :         PyObject *py_array;
    4515           0 :         if (object->array == NULL) {
    4516           0 :                 Py_RETURN_NONE;
    4517             :         }
    4518           0 :         if (object->array == NULL) {
    4519           0 :                 py_array = Py_None;
    4520           0 :                 Py_INCREF(py_array);
    4521             :         } else {
    4522           0 :                 py_array = PyList_New(object->count);
    4523           0 :                 if (py_array == NULL) {
    4524           0 :                         return NULL;
    4525             :                 }
    4526             :                 {
    4527             :                         int array_cntr_1;
    4528           0 :                         for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
    4529             :                                 PyObject *py_array_1;
    4530           0 :                                 py_array_1 = pytalloc_reference_ex(&srvsvc_NetSessInfo0_Type, object->array, &object->array[array_cntr_1]);
    4531           0 :                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
    4532             :                         }
    4533             :                 }
    4534             :         }
    4535           0 :         return py_array;
    4536             : }
    4537             : 
    4538           0 : static int py_srvsvc_NetSessCtr0_set_array(PyObject *py_obj, PyObject *value, void *closure)
    4539             : {
    4540           0 :         struct srvsvc_NetSessCtr0 *object = (struct srvsvc_NetSessCtr0 *)pytalloc_get_ptr(py_obj);
    4541           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
    4542           0 :         if (value == NULL) {
    4543           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
    4544           0 :                 return -1;
    4545             :         }
    4546           0 :         if (value == Py_None) {
    4547           0 :                 object->array = NULL;
    4548             :         } else {
    4549           0 :                 object->array = NULL;
    4550           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    4551             :                 {
    4552             :                         int array_cntr_1;
    4553           0 :                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
    4554           0 :                         if (!object->array) { return -1;; }
    4555           0 :                         talloc_set_name_const(object->array, "ARRAY: object->array");
    4556           0 :                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
    4557           0 :                                 if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
    4558           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
    4559           0 :                                         return -1;
    4560             :                                 }
    4561           0 :                                 PY_CHECK_TYPE(&srvsvc_NetSessInfo0_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
    4562           0 :                                 if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
    4563           0 :                                         PyErr_NoMemory();
    4564           0 :                                         return -1;
    4565             :                                 }
    4566           0 :                                 object->array[array_cntr_1] = *(struct srvsvc_NetSessInfo0 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
    4567             :                         }
    4568             :                 }
    4569             :         }
    4570           0 :         return 0;
    4571             : }
    4572             : 
    4573             : static PyGetSetDef py_srvsvc_NetSessCtr0_getsetters[] = {
    4574             :         {
    4575             :                 .name = discard_const_p(char, "count"),
    4576             :                 .get = py_srvsvc_NetSessCtr0_get_count,
    4577             :                 .set = py_srvsvc_NetSessCtr0_set_count,
    4578             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4579             :         },
    4580             :         {
    4581             :                 .name = discard_const_p(char, "array"),
    4582             :                 .get = py_srvsvc_NetSessCtr0_get_array,
    4583             :                 .set = py_srvsvc_NetSessCtr0_set_array,
    4584             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetSessInfo0")
    4585             :         },
    4586             :         { .name = NULL }
    4587             : };
    4588             : 
    4589           0 : static PyObject *py_srvsvc_NetSessCtr0_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4590             : {
    4591           0 :         return pytalloc_new(struct srvsvc_NetSessCtr0, type);
    4592             : }
    4593             : 
    4594             : 
    4595             : static PyTypeObject srvsvc_NetSessCtr0_Type = {
    4596             :         PyVarObject_HEAD_INIT(NULL, 0)
    4597             :         .tp_name = "srvsvc.NetSessCtr0",
    4598             :         .tp_getset = py_srvsvc_NetSessCtr0_getsetters,
    4599             :         .tp_methods = NULL,
    4600             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4601             :         .tp_new = py_srvsvc_NetSessCtr0_new,
    4602             : };
    4603             : 
    4604             : 
    4605           0 : static PyObject *py_srvsvc_NetSessInfo1_get_client(PyObject *obj, void *closure)
    4606             : {
    4607           0 :         struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(obj);
    4608             :         PyObject *py_client;
    4609           0 :         if (object->client == NULL) {
    4610           0 :                 Py_RETURN_NONE;
    4611             :         }
    4612           0 :         if (object->client == NULL) {
    4613           0 :                 py_client = Py_None;
    4614           0 :                 Py_INCREF(py_client);
    4615             :         } else {
    4616           0 :                 if (object->client == NULL) {
    4617           0 :                         py_client = Py_None;
    4618           0 :                         Py_INCREF(py_client);
    4619             :                 } else {
    4620           0 :                         py_client = PyUnicode_Decode(object->client, strlen(object->client), "utf-8", "ignore");
    4621             :                 }
    4622             :         }
    4623           0 :         return py_client;
    4624             : }
    4625             : 
    4626           0 : static int py_srvsvc_NetSessInfo1_set_client(PyObject *py_obj, PyObject *value, void *closure)
    4627             : {
    4628           0 :         struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(py_obj);
    4629           0 :         if (value == NULL) {
    4630           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->client");
    4631           0 :                 return -1;
    4632             :         }
    4633           0 :         if (value == Py_None) {
    4634           0 :                 object->client = NULL;
    4635             :         } else {
    4636           0 :                 object->client = NULL;
    4637             :                 {
    4638             :                         const char *test_str;
    4639             :                         const char *talloc_str;
    4640           0 :                         PyObject *unicode = NULL;
    4641           0 :                         if (PyUnicode_Check(value)) {
    4642           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    4643           0 :                                 if (unicode == NULL) {
    4644           0 :                                         PyErr_NoMemory();
    4645           0 :                                         return -1;
    4646             :                                 }
    4647           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    4648           0 :                         } else if (PyBytes_Check(value)) {
    4649           0 :                                 test_str = PyBytes_AS_STRING(value);
    4650             :                         } else {
    4651           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    4652           0 :                                 return -1;
    4653             :                         }
    4654           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    4655           0 :                         if (unicode != NULL) {
    4656           0 :                                 Py_DECREF(unicode);
    4657             :                         }
    4658           0 :                         if (talloc_str == NULL) {
    4659           0 :                                 PyErr_NoMemory();
    4660           0 :                                 return -1;
    4661             :                         }
    4662           0 :                         object->client = talloc_str;
    4663             :                 }
    4664             :         }
    4665           0 :         return 0;
    4666             : }
    4667             : 
    4668           0 : static PyObject *py_srvsvc_NetSessInfo1_get_user(PyObject *obj, void *closure)
    4669             : {
    4670           0 :         struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(obj);
    4671             :         PyObject *py_user;
    4672           0 :         if (object->user == NULL) {
    4673           0 :                 Py_RETURN_NONE;
    4674             :         }
    4675           0 :         if (object->user == NULL) {
    4676           0 :                 py_user = Py_None;
    4677           0 :                 Py_INCREF(py_user);
    4678             :         } else {
    4679           0 :                 if (object->user == NULL) {
    4680           0 :                         py_user = Py_None;
    4681           0 :                         Py_INCREF(py_user);
    4682             :                 } else {
    4683           0 :                         py_user = PyUnicode_Decode(object->user, strlen(object->user), "utf-8", "ignore");
    4684             :                 }
    4685             :         }
    4686           0 :         return py_user;
    4687             : }
    4688             : 
    4689           0 : static int py_srvsvc_NetSessInfo1_set_user(PyObject *py_obj, PyObject *value, void *closure)
    4690             : {
    4691           0 :         struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(py_obj);
    4692           0 :         if (value == NULL) {
    4693           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user");
    4694           0 :                 return -1;
    4695             :         }
    4696           0 :         if (value == Py_None) {
    4697           0 :                 object->user = NULL;
    4698             :         } else {
    4699           0 :                 object->user = NULL;
    4700             :                 {
    4701             :                         const char *test_str;
    4702             :                         const char *talloc_str;
    4703           0 :                         PyObject *unicode = NULL;
    4704           0 :                         if (PyUnicode_Check(value)) {
    4705           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    4706           0 :                                 if (unicode == NULL) {
    4707           0 :                                         PyErr_NoMemory();
    4708           0 :                                         return -1;
    4709             :                                 }
    4710           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    4711           0 :                         } else if (PyBytes_Check(value)) {
    4712           0 :                                 test_str = PyBytes_AS_STRING(value);
    4713             :                         } else {
    4714           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    4715           0 :                                 return -1;
    4716             :                         }
    4717           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    4718           0 :                         if (unicode != NULL) {
    4719           0 :                                 Py_DECREF(unicode);
    4720             :                         }
    4721           0 :                         if (talloc_str == NULL) {
    4722           0 :                                 PyErr_NoMemory();
    4723           0 :                                 return -1;
    4724             :                         }
    4725           0 :                         object->user = talloc_str;
    4726             :                 }
    4727             :         }
    4728           0 :         return 0;
    4729             : }
    4730             : 
    4731           0 : static PyObject *py_srvsvc_NetSessInfo1_get_num_open(PyObject *obj, void *closure)
    4732             : {
    4733           0 :         struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(obj);
    4734             :         PyObject *py_num_open;
    4735           0 :         py_num_open = PyLong_FromUnsignedLongLong((uint32_t)object->num_open);
    4736           0 :         return py_num_open;
    4737             : }
    4738             : 
    4739           0 : static int py_srvsvc_NetSessInfo1_set_num_open(PyObject *py_obj, PyObject *value, void *closure)
    4740             : {
    4741           0 :         struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(py_obj);
    4742           0 :         if (value == NULL) {
    4743           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_open");
    4744           0 :                 return -1;
    4745             :         }
    4746             :         {
    4747           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_open));
    4748           0 :                 if (PyLong_Check(value)) {
    4749             :                         unsigned long long test_var;
    4750           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4751           0 :                         if (PyErr_Occurred() != NULL) {
    4752           0 :                                 return -1;
    4753             :                         }
    4754           0 :                         if (test_var > uint_max) {
    4755           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4756             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4757           0 :                                 return -1;
    4758             :                         }
    4759           0 :                         object->num_open = test_var;
    4760             :                 } else {
    4761           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4762             :                           PyLong_Type.tp_name);
    4763           0 :                         return -1;
    4764             :                 }
    4765             :         }
    4766           0 :         return 0;
    4767             : }
    4768             : 
    4769           0 : static PyObject *py_srvsvc_NetSessInfo1_get_time(PyObject *obj, void *closure)
    4770             : {
    4771           0 :         struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(obj);
    4772             :         PyObject *py_time;
    4773           0 :         py_time = PyLong_FromUnsignedLongLong((uint32_t)object->time);
    4774           0 :         return py_time;
    4775             : }
    4776             : 
    4777           0 : static int py_srvsvc_NetSessInfo1_set_time(PyObject *py_obj, PyObject *value, void *closure)
    4778             : {
    4779           0 :         struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(py_obj);
    4780           0 :         if (value == NULL) {
    4781           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->time");
    4782           0 :                 return -1;
    4783             :         }
    4784             :         {
    4785           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time));
    4786           0 :                 if (PyLong_Check(value)) {
    4787             :                         unsigned long long test_var;
    4788           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4789           0 :                         if (PyErr_Occurred() != NULL) {
    4790           0 :                                 return -1;
    4791             :                         }
    4792           0 :                         if (test_var > uint_max) {
    4793           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4794             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4795           0 :                                 return -1;
    4796             :                         }
    4797           0 :                         object->time = test_var;
    4798             :                 } else {
    4799           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4800             :                           PyLong_Type.tp_name);
    4801           0 :                         return -1;
    4802             :                 }
    4803             :         }
    4804           0 :         return 0;
    4805             : }
    4806             : 
    4807           0 : static PyObject *py_srvsvc_NetSessInfo1_get_idle_time(PyObject *obj, void *closure)
    4808             : {
    4809           0 :         struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(obj);
    4810             :         PyObject *py_idle_time;
    4811           0 :         py_idle_time = PyLong_FromUnsignedLongLong((uint32_t)object->idle_time);
    4812           0 :         return py_idle_time;
    4813             : }
    4814             : 
    4815           0 : static int py_srvsvc_NetSessInfo1_set_idle_time(PyObject *py_obj, PyObject *value, void *closure)
    4816             : {
    4817           0 :         struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(py_obj);
    4818           0 :         if (value == NULL) {
    4819           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->idle_time");
    4820           0 :                 return -1;
    4821             :         }
    4822             :         {
    4823           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->idle_time));
    4824           0 :                 if (PyLong_Check(value)) {
    4825             :                         unsigned long long test_var;
    4826           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4827           0 :                         if (PyErr_Occurred() != NULL) {
    4828           0 :                                 return -1;
    4829             :                         }
    4830           0 :                         if (test_var > uint_max) {
    4831           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4832             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4833           0 :                                 return -1;
    4834             :                         }
    4835           0 :                         object->idle_time = test_var;
    4836             :                 } else {
    4837           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4838             :                           PyLong_Type.tp_name);
    4839           0 :                         return -1;
    4840             :                 }
    4841             :         }
    4842           0 :         return 0;
    4843             : }
    4844             : 
    4845           0 : static PyObject *py_srvsvc_NetSessInfo1_get_user_flags(PyObject *obj, void *closure)
    4846             : {
    4847           0 :         struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(obj);
    4848             :         PyObject *py_user_flags;
    4849           0 :         py_user_flags = PyLong_FromUnsignedLongLong((uint32_t)object->user_flags);
    4850           0 :         return py_user_flags;
    4851             : }
    4852             : 
    4853           0 : static int py_srvsvc_NetSessInfo1_set_user_flags(PyObject *py_obj, PyObject *value, void *closure)
    4854             : {
    4855           0 :         struct srvsvc_NetSessInfo1 *object = (struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(py_obj);
    4856           0 :         if (value == NULL) {
    4857           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_flags");
    4858           0 :                 return -1;
    4859             :         }
    4860             :         {
    4861           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->user_flags));
    4862           0 :                 if (PyLong_Check(value)) {
    4863             :                         unsigned long long test_var;
    4864           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4865           0 :                         if (PyErr_Occurred() != NULL) {
    4866           0 :                                 return -1;
    4867             :                         }
    4868           0 :                         if (test_var > uint_max) {
    4869           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4870             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4871           0 :                                 return -1;
    4872             :                         }
    4873           0 :                         object->user_flags = test_var;
    4874             :                 } else {
    4875           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4876             :                           PyLong_Type.tp_name);
    4877           0 :                         return -1;
    4878             :                 }
    4879             :         }
    4880           0 :         return 0;
    4881             : }
    4882             : 
    4883             : static PyGetSetDef py_srvsvc_NetSessInfo1_getsetters[] = {
    4884             :         {
    4885             :                 .name = discard_const_p(char, "client"),
    4886             :                 .get = py_srvsvc_NetSessInfo1_get_client,
    4887             :                 .set = py_srvsvc_NetSessInfo1_set_client,
    4888             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4889             :         },
    4890             :         {
    4891             :                 .name = discard_const_p(char, "user"),
    4892             :                 .get = py_srvsvc_NetSessInfo1_get_user,
    4893             :                 .set = py_srvsvc_NetSessInfo1_set_user,
    4894             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    4895             :         },
    4896             :         {
    4897             :                 .name = discard_const_p(char, "num_open"),
    4898             :                 .get = py_srvsvc_NetSessInfo1_get_num_open,
    4899             :                 .set = py_srvsvc_NetSessInfo1_set_num_open,
    4900             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4901             :         },
    4902             :         {
    4903             :                 .name = discard_const_p(char, "time"),
    4904             :                 .get = py_srvsvc_NetSessInfo1_get_time,
    4905             :                 .set = py_srvsvc_NetSessInfo1_set_time,
    4906             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4907             :         },
    4908             :         {
    4909             :                 .name = discard_const_p(char, "idle_time"),
    4910             :                 .get = py_srvsvc_NetSessInfo1_get_idle_time,
    4911             :                 .set = py_srvsvc_NetSessInfo1_set_idle_time,
    4912             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4913             :         },
    4914             :         {
    4915             :                 .name = discard_const_p(char, "user_flags"),
    4916             :                 .get = py_srvsvc_NetSessInfo1_get_user_flags,
    4917             :                 .set = py_srvsvc_NetSessInfo1_set_user_flags,
    4918             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    4919             :         },
    4920             :         { .name = NULL }
    4921             : };
    4922             : 
    4923           0 : static PyObject *py_srvsvc_NetSessInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    4924             : {
    4925           0 :         return pytalloc_new(struct srvsvc_NetSessInfo1, type);
    4926             : }
    4927             : 
    4928             : 
    4929             : static PyTypeObject srvsvc_NetSessInfo1_Type = {
    4930             :         PyVarObject_HEAD_INIT(NULL, 0)
    4931             :         .tp_name = "srvsvc.NetSessInfo1",
    4932             :         .tp_getset = py_srvsvc_NetSessInfo1_getsetters,
    4933             :         .tp_methods = NULL,
    4934             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    4935             :         .tp_new = py_srvsvc_NetSessInfo1_new,
    4936             : };
    4937             : 
    4938             : 
    4939           0 : static PyObject *py_srvsvc_NetSessCtr1_get_count(PyObject *obj, void *closure)
    4940             : {
    4941           0 :         struct srvsvc_NetSessCtr1 *object = (struct srvsvc_NetSessCtr1 *)pytalloc_get_ptr(obj);
    4942             :         PyObject *py_count;
    4943           0 :         py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
    4944           0 :         return py_count;
    4945             : }
    4946             : 
    4947           0 : static int py_srvsvc_NetSessCtr1_set_count(PyObject *py_obj, PyObject *value, void *closure)
    4948             : {
    4949           0 :         struct srvsvc_NetSessCtr1 *object = (struct srvsvc_NetSessCtr1 *)pytalloc_get_ptr(py_obj);
    4950           0 :         if (value == NULL) {
    4951           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
    4952           0 :                 return -1;
    4953             :         }
    4954             :         {
    4955           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
    4956           0 :                 if (PyLong_Check(value)) {
    4957             :                         unsigned long long test_var;
    4958           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    4959           0 :                         if (PyErr_Occurred() != NULL) {
    4960           0 :                                 return -1;
    4961             :                         }
    4962           0 :                         if (test_var > uint_max) {
    4963           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    4964             :                                   PyLong_Type.tp_name, uint_max, test_var);
    4965           0 :                                 return -1;
    4966             :                         }
    4967           0 :                         object->count = test_var;
    4968             :                 } else {
    4969           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    4970             :                           PyLong_Type.tp_name);
    4971           0 :                         return -1;
    4972             :                 }
    4973             :         }
    4974           0 :         return 0;
    4975             : }
    4976             : 
    4977           0 : static PyObject *py_srvsvc_NetSessCtr1_get_array(PyObject *obj, void *closure)
    4978             : {
    4979           0 :         struct srvsvc_NetSessCtr1 *object = (struct srvsvc_NetSessCtr1 *)pytalloc_get_ptr(obj);
    4980             :         PyObject *py_array;
    4981           0 :         if (object->array == NULL) {
    4982           0 :                 Py_RETURN_NONE;
    4983             :         }
    4984           0 :         if (object->array == NULL) {
    4985           0 :                 py_array = Py_None;
    4986           0 :                 Py_INCREF(py_array);
    4987             :         } else {
    4988           0 :                 py_array = PyList_New(object->count);
    4989           0 :                 if (py_array == NULL) {
    4990           0 :                         return NULL;
    4991             :                 }
    4992             :                 {
    4993             :                         int array_cntr_1;
    4994           0 :                         for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
    4995             :                                 PyObject *py_array_1;
    4996           0 :                                 py_array_1 = pytalloc_reference_ex(&srvsvc_NetSessInfo1_Type, object->array, &object->array[array_cntr_1]);
    4997           0 :                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
    4998             :                         }
    4999             :                 }
    5000             :         }
    5001           0 :         return py_array;
    5002             : }
    5003             : 
    5004           0 : static int py_srvsvc_NetSessCtr1_set_array(PyObject *py_obj, PyObject *value, void *closure)
    5005             : {
    5006           0 :         struct srvsvc_NetSessCtr1 *object = (struct srvsvc_NetSessCtr1 *)pytalloc_get_ptr(py_obj);
    5007           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
    5008           0 :         if (value == NULL) {
    5009           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
    5010           0 :                 return -1;
    5011             :         }
    5012           0 :         if (value == Py_None) {
    5013           0 :                 object->array = NULL;
    5014             :         } else {
    5015           0 :                 object->array = NULL;
    5016           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    5017             :                 {
    5018             :                         int array_cntr_1;
    5019           0 :                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
    5020           0 :                         if (!object->array) { return -1;; }
    5021           0 :                         talloc_set_name_const(object->array, "ARRAY: object->array");
    5022           0 :                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
    5023           0 :                                 if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
    5024           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
    5025           0 :                                         return -1;
    5026             :                                 }
    5027           0 :                                 PY_CHECK_TYPE(&srvsvc_NetSessInfo1_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
    5028           0 :                                 if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
    5029           0 :                                         PyErr_NoMemory();
    5030           0 :                                         return -1;
    5031             :                                 }
    5032           0 :                                 object->array[array_cntr_1] = *(struct srvsvc_NetSessInfo1 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
    5033             :                         }
    5034             :                 }
    5035             :         }
    5036           0 :         return 0;
    5037             : }
    5038             : 
    5039             : static PyGetSetDef py_srvsvc_NetSessCtr1_getsetters[] = {
    5040             :         {
    5041             :                 .name = discard_const_p(char, "count"),
    5042             :                 .get = py_srvsvc_NetSessCtr1_get_count,
    5043             :                 .set = py_srvsvc_NetSessCtr1_set_count,
    5044             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    5045             :         },
    5046             :         {
    5047             :                 .name = discard_const_p(char, "array"),
    5048             :                 .get = py_srvsvc_NetSessCtr1_get_array,
    5049             :                 .set = py_srvsvc_NetSessCtr1_set_array,
    5050             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetSessInfo1")
    5051             :         },
    5052             :         { .name = NULL }
    5053             : };
    5054             : 
    5055           0 : static PyObject *py_srvsvc_NetSessCtr1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5056             : {
    5057           0 :         return pytalloc_new(struct srvsvc_NetSessCtr1, type);
    5058             : }
    5059             : 
    5060             : 
    5061             : static PyTypeObject srvsvc_NetSessCtr1_Type = {
    5062             :         PyVarObject_HEAD_INIT(NULL, 0)
    5063             :         .tp_name = "srvsvc.NetSessCtr1",
    5064             :         .tp_getset = py_srvsvc_NetSessCtr1_getsetters,
    5065             :         .tp_methods = NULL,
    5066             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5067             :         .tp_new = py_srvsvc_NetSessCtr1_new,
    5068             : };
    5069             : 
    5070             : 
    5071           0 : static PyObject *py_srvsvc_NetSessInfo2_get_client(PyObject *obj, void *closure)
    5072             : {
    5073           0 :         struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(obj);
    5074             :         PyObject *py_client;
    5075           0 :         if (object->client == NULL) {
    5076           0 :                 Py_RETURN_NONE;
    5077             :         }
    5078           0 :         if (object->client == NULL) {
    5079           0 :                 py_client = Py_None;
    5080           0 :                 Py_INCREF(py_client);
    5081             :         } else {
    5082           0 :                 if (object->client == NULL) {
    5083           0 :                         py_client = Py_None;
    5084           0 :                         Py_INCREF(py_client);
    5085             :                 } else {
    5086           0 :                         py_client = PyUnicode_Decode(object->client, strlen(object->client), "utf-8", "ignore");
    5087             :                 }
    5088             :         }
    5089           0 :         return py_client;
    5090             : }
    5091             : 
    5092           0 : static int py_srvsvc_NetSessInfo2_set_client(PyObject *py_obj, PyObject *value, void *closure)
    5093             : {
    5094           0 :         struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(py_obj);
    5095           0 :         if (value == NULL) {
    5096           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->client");
    5097           0 :                 return -1;
    5098             :         }
    5099           0 :         if (value == Py_None) {
    5100           0 :                 object->client = NULL;
    5101             :         } else {
    5102           0 :                 object->client = NULL;
    5103             :                 {
    5104             :                         const char *test_str;
    5105             :                         const char *talloc_str;
    5106           0 :                         PyObject *unicode = NULL;
    5107           0 :                         if (PyUnicode_Check(value)) {
    5108           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    5109           0 :                                 if (unicode == NULL) {
    5110           0 :                                         PyErr_NoMemory();
    5111           0 :                                         return -1;
    5112             :                                 }
    5113           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    5114           0 :                         } else if (PyBytes_Check(value)) {
    5115           0 :                                 test_str = PyBytes_AS_STRING(value);
    5116             :                         } else {
    5117           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    5118           0 :                                 return -1;
    5119             :                         }
    5120           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    5121           0 :                         if (unicode != NULL) {
    5122           0 :                                 Py_DECREF(unicode);
    5123             :                         }
    5124           0 :                         if (talloc_str == NULL) {
    5125           0 :                                 PyErr_NoMemory();
    5126           0 :                                 return -1;
    5127             :                         }
    5128           0 :                         object->client = talloc_str;
    5129             :                 }
    5130             :         }
    5131           0 :         return 0;
    5132             : }
    5133             : 
    5134           0 : static PyObject *py_srvsvc_NetSessInfo2_get_user(PyObject *obj, void *closure)
    5135             : {
    5136           0 :         struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(obj);
    5137             :         PyObject *py_user;
    5138           0 :         if (object->user == NULL) {
    5139           0 :                 Py_RETURN_NONE;
    5140             :         }
    5141           0 :         if (object->user == NULL) {
    5142           0 :                 py_user = Py_None;
    5143           0 :                 Py_INCREF(py_user);
    5144             :         } else {
    5145           0 :                 if (object->user == NULL) {
    5146           0 :                         py_user = Py_None;
    5147           0 :                         Py_INCREF(py_user);
    5148             :                 } else {
    5149           0 :                         py_user = PyUnicode_Decode(object->user, strlen(object->user), "utf-8", "ignore");
    5150             :                 }
    5151             :         }
    5152           0 :         return py_user;
    5153             : }
    5154             : 
    5155           0 : static int py_srvsvc_NetSessInfo2_set_user(PyObject *py_obj, PyObject *value, void *closure)
    5156             : {
    5157           0 :         struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(py_obj);
    5158           0 :         if (value == NULL) {
    5159           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user");
    5160           0 :                 return -1;
    5161             :         }
    5162           0 :         if (value == Py_None) {
    5163           0 :                 object->user = NULL;
    5164             :         } else {
    5165           0 :                 object->user = NULL;
    5166             :                 {
    5167             :                         const char *test_str;
    5168             :                         const char *talloc_str;
    5169           0 :                         PyObject *unicode = NULL;
    5170           0 :                         if (PyUnicode_Check(value)) {
    5171           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    5172           0 :                                 if (unicode == NULL) {
    5173           0 :                                         PyErr_NoMemory();
    5174           0 :                                         return -1;
    5175             :                                 }
    5176           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    5177           0 :                         } else if (PyBytes_Check(value)) {
    5178           0 :                                 test_str = PyBytes_AS_STRING(value);
    5179             :                         } else {
    5180           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    5181           0 :                                 return -1;
    5182             :                         }
    5183           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    5184           0 :                         if (unicode != NULL) {
    5185           0 :                                 Py_DECREF(unicode);
    5186             :                         }
    5187           0 :                         if (talloc_str == NULL) {
    5188           0 :                                 PyErr_NoMemory();
    5189           0 :                                 return -1;
    5190             :                         }
    5191           0 :                         object->user = talloc_str;
    5192             :                 }
    5193             :         }
    5194           0 :         return 0;
    5195             : }
    5196             : 
    5197           0 : static PyObject *py_srvsvc_NetSessInfo2_get_num_open(PyObject *obj, void *closure)
    5198             : {
    5199           0 :         struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(obj);
    5200             :         PyObject *py_num_open;
    5201           0 :         py_num_open = PyLong_FromUnsignedLongLong((uint32_t)object->num_open);
    5202           0 :         return py_num_open;
    5203             : }
    5204             : 
    5205           0 : static int py_srvsvc_NetSessInfo2_set_num_open(PyObject *py_obj, PyObject *value, void *closure)
    5206             : {
    5207           0 :         struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(py_obj);
    5208           0 :         if (value == NULL) {
    5209           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_open");
    5210           0 :                 return -1;
    5211             :         }
    5212             :         {
    5213           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_open));
    5214           0 :                 if (PyLong_Check(value)) {
    5215             :                         unsigned long long test_var;
    5216           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5217           0 :                         if (PyErr_Occurred() != NULL) {
    5218           0 :                                 return -1;
    5219             :                         }
    5220           0 :                         if (test_var > uint_max) {
    5221           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5222             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5223           0 :                                 return -1;
    5224             :                         }
    5225           0 :                         object->num_open = test_var;
    5226             :                 } else {
    5227           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5228             :                           PyLong_Type.tp_name);
    5229           0 :                         return -1;
    5230             :                 }
    5231             :         }
    5232           0 :         return 0;
    5233             : }
    5234             : 
    5235           0 : static PyObject *py_srvsvc_NetSessInfo2_get_time(PyObject *obj, void *closure)
    5236             : {
    5237           0 :         struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(obj);
    5238             :         PyObject *py_time;
    5239           0 :         py_time = PyLong_FromUnsignedLongLong((uint32_t)object->time);
    5240           0 :         return py_time;
    5241             : }
    5242             : 
    5243           0 : static int py_srvsvc_NetSessInfo2_set_time(PyObject *py_obj, PyObject *value, void *closure)
    5244             : {
    5245           0 :         struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(py_obj);
    5246           0 :         if (value == NULL) {
    5247           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->time");
    5248           0 :                 return -1;
    5249             :         }
    5250             :         {
    5251           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time));
    5252           0 :                 if (PyLong_Check(value)) {
    5253             :                         unsigned long long test_var;
    5254           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5255           0 :                         if (PyErr_Occurred() != NULL) {
    5256           0 :                                 return -1;
    5257             :                         }
    5258           0 :                         if (test_var > uint_max) {
    5259           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5260             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5261           0 :                                 return -1;
    5262             :                         }
    5263           0 :                         object->time = test_var;
    5264             :                 } else {
    5265           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5266             :                           PyLong_Type.tp_name);
    5267           0 :                         return -1;
    5268             :                 }
    5269             :         }
    5270           0 :         return 0;
    5271             : }
    5272             : 
    5273           0 : static PyObject *py_srvsvc_NetSessInfo2_get_idle_time(PyObject *obj, void *closure)
    5274             : {
    5275           0 :         struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(obj);
    5276             :         PyObject *py_idle_time;
    5277           0 :         py_idle_time = PyLong_FromUnsignedLongLong((uint32_t)object->idle_time);
    5278           0 :         return py_idle_time;
    5279             : }
    5280             : 
    5281           0 : static int py_srvsvc_NetSessInfo2_set_idle_time(PyObject *py_obj, PyObject *value, void *closure)
    5282             : {
    5283           0 :         struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(py_obj);
    5284           0 :         if (value == NULL) {
    5285           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->idle_time");
    5286           0 :                 return -1;
    5287             :         }
    5288             :         {
    5289           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->idle_time));
    5290           0 :                 if (PyLong_Check(value)) {
    5291             :                         unsigned long long test_var;
    5292           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5293           0 :                         if (PyErr_Occurred() != NULL) {
    5294           0 :                                 return -1;
    5295             :                         }
    5296           0 :                         if (test_var > uint_max) {
    5297           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5298             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5299           0 :                                 return -1;
    5300             :                         }
    5301           0 :                         object->idle_time = test_var;
    5302             :                 } else {
    5303           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5304             :                           PyLong_Type.tp_name);
    5305           0 :                         return -1;
    5306             :                 }
    5307             :         }
    5308           0 :         return 0;
    5309             : }
    5310             : 
    5311           0 : static PyObject *py_srvsvc_NetSessInfo2_get_user_flags(PyObject *obj, void *closure)
    5312             : {
    5313           0 :         struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(obj);
    5314             :         PyObject *py_user_flags;
    5315           0 :         py_user_flags = PyLong_FromUnsignedLongLong((uint32_t)object->user_flags);
    5316           0 :         return py_user_flags;
    5317             : }
    5318             : 
    5319           0 : static int py_srvsvc_NetSessInfo2_set_user_flags(PyObject *py_obj, PyObject *value, void *closure)
    5320             : {
    5321           0 :         struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(py_obj);
    5322           0 :         if (value == NULL) {
    5323           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_flags");
    5324           0 :                 return -1;
    5325             :         }
    5326             :         {
    5327           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->user_flags));
    5328           0 :                 if (PyLong_Check(value)) {
    5329             :                         unsigned long long test_var;
    5330           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5331           0 :                         if (PyErr_Occurred() != NULL) {
    5332           0 :                                 return -1;
    5333             :                         }
    5334           0 :                         if (test_var > uint_max) {
    5335           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5336             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5337           0 :                                 return -1;
    5338             :                         }
    5339           0 :                         object->user_flags = test_var;
    5340             :                 } else {
    5341           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5342             :                           PyLong_Type.tp_name);
    5343           0 :                         return -1;
    5344             :                 }
    5345             :         }
    5346           0 :         return 0;
    5347             : }
    5348             : 
    5349           0 : static PyObject *py_srvsvc_NetSessInfo2_get_client_type(PyObject *obj, void *closure)
    5350             : {
    5351           0 :         struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(obj);
    5352             :         PyObject *py_client_type;
    5353           0 :         if (object->client_type == NULL) {
    5354           0 :                 Py_RETURN_NONE;
    5355             :         }
    5356           0 :         if (object->client_type == NULL) {
    5357           0 :                 py_client_type = Py_None;
    5358           0 :                 Py_INCREF(py_client_type);
    5359             :         } else {
    5360           0 :                 if (object->client_type == NULL) {
    5361           0 :                         py_client_type = Py_None;
    5362           0 :                         Py_INCREF(py_client_type);
    5363             :                 } else {
    5364           0 :                         py_client_type = PyUnicode_Decode(object->client_type, strlen(object->client_type), "utf-8", "ignore");
    5365             :                 }
    5366             :         }
    5367           0 :         return py_client_type;
    5368             : }
    5369             : 
    5370           0 : static int py_srvsvc_NetSessInfo2_set_client_type(PyObject *py_obj, PyObject *value, void *closure)
    5371             : {
    5372           0 :         struct srvsvc_NetSessInfo2 *object = (struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(py_obj);
    5373           0 :         if (value == NULL) {
    5374           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->client_type");
    5375           0 :                 return -1;
    5376             :         }
    5377           0 :         if (value == Py_None) {
    5378           0 :                 object->client_type = NULL;
    5379             :         } else {
    5380           0 :                 object->client_type = NULL;
    5381             :                 {
    5382             :                         const char *test_str;
    5383             :                         const char *talloc_str;
    5384           0 :                         PyObject *unicode = NULL;
    5385           0 :                         if (PyUnicode_Check(value)) {
    5386           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    5387           0 :                                 if (unicode == NULL) {
    5388           0 :                                         PyErr_NoMemory();
    5389           0 :                                         return -1;
    5390             :                                 }
    5391           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    5392           0 :                         } else if (PyBytes_Check(value)) {
    5393           0 :                                 test_str = PyBytes_AS_STRING(value);
    5394             :                         } else {
    5395           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    5396           0 :                                 return -1;
    5397             :                         }
    5398           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    5399           0 :                         if (unicode != NULL) {
    5400           0 :                                 Py_DECREF(unicode);
    5401             :                         }
    5402           0 :                         if (talloc_str == NULL) {
    5403           0 :                                 PyErr_NoMemory();
    5404           0 :                                 return -1;
    5405             :                         }
    5406           0 :                         object->client_type = talloc_str;
    5407             :                 }
    5408             :         }
    5409           0 :         return 0;
    5410             : }
    5411             : 
    5412             : static PyGetSetDef py_srvsvc_NetSessInfo2_getsetters[] = {
    5413             :         {
    5414             :                 .name = discard_const_p(char, "client"),
    5415             :                 .get = py_srvsvc_NetSessInfo2_get_client,
    5416             :                 .set = py_srvsvc_NetSessInfo2_set_client,
    5417             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    5418             :         },
    5419             :         {
    5420             :                 .name = discard_const_p(char, "user"),
    5421             :                 .get = py_srvsvc_NetSessInfo2_get_user,
    5422             :                 .set = py_srvsvc_NetSessInfo2_set_user,
    5423             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    5424             :         },
    5425             :         {
    5426             :                 .name = discard_const_p(char, "num_open"),
    5427             :                 .get = py_srvsvc_NetSessInfo2_get_num_open,
    5428             :                 .set = py_srvsvc_NetSessInfo2_set_num_open,
    5429             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    5430             :         },
    5431             :         {
    5432             :                 .name = discard_const_p(char, "time"),
    5433             :                 .get = py_srvsvc_NetSessInfo2_get_time,
    5434             :                 .set = py_srvsvc_NetSessInfo2_set_time,
    5435             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    5436             :         },
    5437             :         {
    5438             :                 .name = discard_const_p(char, "idle_time"),
    5439             :                 .get = py_srvsvc_NetSessInfo2_get_idle_time,
    5440             :                 .set = py_srvsvc_NetSessInfo2_set_idle_time,
    5441             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    5442             :         },
    5443             :         {
    5444             :                 .name = discard_const_p(char, "user_flags"),
    5445             :                 .get = py_srvsvc_NetSessInfo2_get_user_flags,
    5446             :                 .set = py_srvsvc_NetSessInfo2_set_user_flags,
    5447             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    5448             :         },
    5449             :         {
    5450             :                 .name = discard_const_p(char, "client_type"),
    5451             :                 .get = py_srvsvc_NetSessInfo2_get_client_type,
    5452             :                 .set = py_srvsvc_NetSessInfo2_set_client_type,
    5453             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    5454             :         },
    5455             :         { .name = NULL }
    5456             : };
    5457             : 
    5458           0 : static PyObject *py_srvsvc_NetSessInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5459             : {
    5460           0 :         return pytalloc_new(struct srvsvc_NetSessInfo2, type);
    5461             : }
    5462             : 
    5463             : 
    5464             : static PyTypeObject srvsvc_NetSessInfo2_Type = {
    5465             :         PyVarObject_HEAD_INIT(NULL, 0)
    5466             :         .tp_name = "srvsvc.NetSessInfo2",
    5467             :         .tp_getset = py_srvsvc_NetSessInfo2_getsetters,
    5468             :         .tp_methods = NULL,
    5469             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5470             :         .tp_new = py_srvsvc_NetSessInfo2_new,
    5471             : };
    5472             : 
    5473             : 
    5474           0 : static PyObject *py_srvsvc_NetSessCtr2_get_count(PyObject *obj, void *closure)
    5475             : {
    5476           0 :         struct srvsvc_NetSessCtr2 *object = (struct srvsvc_NetSessCtr2 *)pytalloc_get_ptr(obj);
    5477             :         PyObject *py_count;
    5478           0 :         py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
    5479           0 :         return py_count;
    5480             : }
    5481             : 
    5482           0 : static int py_srvsvc_NetSessCtr2_set_count(PyObject *py_obj, PyObject *value, void *closure)
    5483             : {
    5484           0 :         struct srvsvc_NetSessCtr2 *object = (struct srvsvc_NetSessCtr2 *)pytalloc_get_ptr(py_obj);
    5485           0 :         if (value == NULL) {
    5486           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
    5487           0 :                 return -1;
    5488             :         }
    5489             :         {
    5490           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
    5491           0 :                 if (PyLong_Check(value)) {
    5492             :                         unsigned long long test_var;
    5493           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5494           0 :                         if (PyErr_Occurred() != NULL) {
    5495           0 :                                 return -1;
    5496             :                         }
    5497           0 :                         if (test_var > uint_max) {
    5498           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5499             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5500           0 :                                 return -1;
    5501             :                         }
    5502           0 :                         object->count = test_var;
    5503             :                 } else {
    5504           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5505             :                           PyLong_Type.tp_name);
    5506           0 :                         return -1;
    5507             :                 }
    5508             :         }
    5509           0 :         return 0;
    5510             : }
    5511             : 
    5512           0 : static PyObject *py_srvsvc_NetSessCtr2_get_array(PyObject *obj, void *closure)
    5513             : {
    5514           0 :         struct srvsvc_NetSessCtr2 *object = (struct srvsvc_NetSessCtr2 *)pytalloc_get_ptr(obj);
    5515             :         PyObject *py_array;
    5516           0 :         if (object->array == NULL) {
    5517           0 :                 Py_RETURN_NONE;
    5518             :         }
    5519           0 :         if (object->array == NULL) {
    5520           0 :                 py_array = Py_None;
    5521           0 :                 Py_INCREF(py_array);
    5522             :         } else {
    5523           0 :                 py_array = PyList_New(object->count);
    5524           0 :                 if (py_array == NULL) {
    5525           0 :                         return NULL;
    5526             :                 }
    5527             :                 {
    5528             :                         int array_cntr_1;
    5529           0 :                         for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
    5530             :                                 PyObject *py_array_1;
    5531           0 :                                 py_array_1 = pytalloc_reference_ex(&srvsvc_NetSessInfo2_Type, object->array, &object->array[array_cntr_1]);
    5532           0 :                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
    5533             :                         }
    5534             :                 }
    5535             :         }
    5536           0 :         return py_array;
    5537             : }
    5538             : 
    5539           0 : static int py_srvsvc_NetSessCtr2_set_array(PyObject *py_obj, PyObject *value, void *closure)
    5540             : {
    5541           0 :         struct srvsvc_NetSessCtr2 *object = (struct srvsvc_NetSessCtr2 *)pytalloc_get_ptr(py_obj);
    5542           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
    5543           0 :         if (value == NULL) {
    5544           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
    5545           0 :                 return -1;
    5546             :         }
    5547           0 :         if (value == Py_None) {
    5548           0 :                 object->array = NULL;
    5549             :         } else {
    5550           0 :                 object->array = NULL;
    5551           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    5552             :                 {
    5553             :                         int array_cntr_1;
    5554           0 :                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
    5555           0 :                         if (!object->array) { return -1;; }
    5556           0 :                         talloc_set_name_const(object->array, "ARRAY: object->array");
    5557           0 :                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
    5558           0 :                                 if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
    5559           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
    5560           0 :                                         return -1;
    5561             :                                 }
    5562           0 :                                 PY_CHECK_TYPE(&srvsvc_NetSessInfo2_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
    5563           0 :                                 if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
    5564           0 :                                         PyErr_NoMemory();
    5565           0 :                                         return -1;
    5566             :                                 }
    5567           0 :                                 object->array[array_cntr_1] = *(struct srvsvc_NetSessInfo2 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
    5568             :                         }
    5569             :                 }
    5570             :         }
    5571           0 :         return 0;
    5572             : }
    5573             : 
    5574             : static PyGetSetDef py_srvsvc_NetSessCtr2_getsetters[] = {
    5575             :         {
    5576             :                 .name = discard_const_p(char, "count"),
    5577             :                 .get = py_srvsvc_NetSessCtr2_get_count,
    5578             :                 .set = py_srvsvc_NetSessCtr2_set_count,
    5579             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    5580             :         },
    5581             :         {
    5582             :                 .name = discard_const_p(char, "array"),
    5583             :                 .get = py_srvsvc_NetSessCtr2_get_array,
    5584             :                 .set = py_srvsvc_NetSessCtr2_set_array,
    5585             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetSessInfo2")
    5586             :         },
    5587             :         { .name = NULL }
    5588             : };
    5589             : 
    5590           0 : static PyObject *py_srvsvc_NetSessCtr2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5591             : {
    5592           0 :         return pytalloc_new(struct srvsvc_NetSessCtr2, type);
    5593             : }
    5594             : 
    5595             : 
    5596             : static PyTypeObject srvsvc_NetSessCtr2_Type = {
    5597             :         PyVarObject_HEAD_INIT(NULL, 0)
    5598             :         .tp_name = "srvsvc.NetSessCtr2",
    5599             :         .tp_getset = py_srvsvc_NetSessCtr2_getsetters,
    5600             :         .tp_methods = NULL,
    5601             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5602             :         .tp_new = py_srvsvc_NetSessCtr2_new,
    5603             : };
    5604             : 
    5605             : 
    5606           0 : static PyObject *py_srvsvc_NetSessInfo10_get_client(PyObject *obj, void *closure)
    5607             : {
    5608           0 :         struct srvsvc_NetSessInfo10 *object = (struct srvsvc_NetSessInfo10 *)pytalloc_get_ptr(obj);
    5609             :         PyObject *py_client;
    5610           0 :         if (object->client == NULL) {
    5611           0 :                 Py_RETURN_NONE;
    5612             :         }
    5613           0 :         if (object->client == NULL) {
    5614           0 :                 py_client = Py_None;
    5615           0 :                 Py_INCREF(py_client);
    5616             :         } else {
    5617           0 :                 if (object->client == NULL) {
    5618           0 :                         py_client = Py_None;
    5619           0 :                         Py_INCREF(py_client);
    5620             :                 } else {
    5621           0 :                         py_client = PyUnicode_Decode(object->client, strlen(object->client), "utf-8", "ignore");
    5622             :                 }
    5623             :         }
    5624           0 :         return py_client;
    5625             : }
    5626             : 
    5627           0 : static int py_srvsvc_NetSessInfo10_set_client(PyObject *py_obj, PyObject *value, void *closure)
    5628             : {
    5629           0 :         struct srvsvc_NetSessInfo10 *object = (struct srvsvc_NetSessInfo10 *)pytalloc_get_ptr(py_obj);
    5630           0 :         if (value == NULL) {
    5631           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->client");
    5632           0 :                 return -1;
    5633             :         }
    5634           0 :         if (value == Py_None) {
    5635           0 :                 object->client = NULL;
    5636             :         } else {
    5637           0 :                 object->client = NULL;
    5638             :                 {
    5639             :                         const char *test_str;
    5640             :                         const char *talloc_str;
    5641           0 :                         PyObject *unicode = NULL;
    5642           0 :                         if (PyUnicode_Check(value)) {
    5643           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    5644           0 :                                 if (unicode == NULL) {
    5645           0 :                                         PyErr_NoMemory();
    5646           0 :                                         return -1;
    5647             :                                 }
    5648           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    5649           0 :                         } else if (PyBytes_Check(value)) {
    5650           0 :                                 test_str = PyBytes_AS_STRING(value);
    5651             :                         } else {
    5652           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    5653           0 :                                 return -1;
    5654             :                         }
    5655           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    5656           0 :                         if (unicode != NULL) {
    5657           0 :                                 Py_DECREF(unicode);
    5658             :                         }
    5659           0 :                         if (talloc_str == NULL) {
    5660           0 :                                 PyErr_NoMemory();
    5661           0 :                                 return -1;
    5662             :                         }
    5663           0 :                         object->client = talloc_str;
    5664             :                 }
    5665             :         }
    5666           0 :         return 0;
    5667             : }
    5668             : 
    5669           0 : static PyObject *py_srvsvc_NetSessInfo10_get_user(PyObject *obj, void *closure)
    5670             : {
    5671           0 :         struct srvsvc_NetSessInfo10 *object = (struct srvsvc_NetSessInfo10 *)pytalloc_get_ptr(obj);
    5672             :         PyObject *py_user;
    5673           0 :         if (object->user == NULL) {
    5674           0 :                 Py_RETURN_NONE;
    5675             :         }
    5676           0 :         if (object->user == NULL) {
    5677           0 :                 py_user = Py_None;
    5678           0 :                 Py_INCREF(py_user);
    5679             :         } else {
    5680           0 :                 if (object->user == NULL) {
    5681           0 :                         py_user = Py_None;
    5682           0 :                         Py_INCREF(py_user);
    5683             :                 } else {
    5684           0 :                         py_user = PyUnicode_Decode(object->user, strlen(object->user), "utf-8", "ignore");
    5685             :                 }
    5686             :         }
    5687           0 :         return py_user;
    5688             : }
    5689             : 
    5690           0 : static int py_srvsvc_NetSessInfo10_set_user(PyObject *py_obj, PyObject *value, void *closure)
    5691             : {
    5692           0 :         struct srvsvc_NetSessInfo10 *object = (struct srvsvc_NetSessInfo10 *)pytalloc_get_ptr(py_obj);
    5693           0 :         if (value == NULL) {
    5694           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user");
    5695           0 :                 return -1;
    5696             :         }
    5697           0 :         if (value == Py_None) {
    5698           0 :                 object->user = NULL;
    5699             :         } else {
    5700           0 :                 object->user = NULL;
    5701             :                 {
    5702             :                         const char *test_str;
    5703             :                         const char *talloc_str;
    5704           0 :                         PyObject *unicode = NULL;
    5705           0 :                         if (PyUnicode_Check(value)) {
    5706           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    5707           0 :                                 if (unicode == NULL) {
    5708           0 :                                         PyErr_NoMemory();
    5709           0 :                                         return -1;
    5710             :                                 }
    5711           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    5712           0 :                         } else if (PyBytes_Check(value)) {
    5713           0 :                                 test_str = PyBytes_AS_STRING(value);
    5714             :                         } else {
    5715           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    5716           0 :                                 return -1;
    5717             :                         }
    5718           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    5719           0 :                         if (unicode != NULL) {
    5720           0 :                                 Py_DECREF(unicode);
    5721             :                         }
    5722           0 :                         if (talloc_str == NULL) {
    5723           0 :                                 PyErr_NoMemory();
    5724           0 :                                 return -1;
    5725             :                         }
    5726           0 :                         object->user = talloc_str;
    5727             :                 }
    5728             :         }
    5729           0 :         return 0;
    5730             : }
    5731             : 
    5732           0 : static PyObject *py_srvsvc_NetSessInfo10_get_time(PyObject *obj, void *closure)
    5733             : {
    5734           0 :         struct srvsvc_NetSessInfo10 *object = (struct srvsvc_NetSessInfo10 *)pytalloc_get_ptr(obj);
    5735             :         PyObject *py_time;
    5736           0 :         py_time = PyLong_FromUnsignedLongLong((uint32_t)object->time);
    5737           0 :         return py_time;
    5738             : }
    5739             : 
    5740           0 : static int py_srvsvc_NetSessInfo10_set_time(PyObject *py_obj, PyObject *value, void *closure)
    5741             : {
    5742           0 :         struct srvsvc_NetSessInfo10 *object = (struct srvsvc_NetSessInfo10 *)pytalloc_get_ptr(py_obj);
    5743           0 :         if (value == NULL) {
    5744           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->time");
    5745           0 :                 return -1;
    5746             :         }
    5747             :         {
    5748           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time));
    5749           0 :                 if (PyLong_Check(value)) {
    5750             :                         unsigned long long test_var;
    5751           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5752           0 :                         if (PyErr_Occurred() != NULL) {
    5753           0 :                                 return -1;
    5754             :                         }
    5755           0 :                         if (test_var > uint_max) {
    5756           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5757             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5758           0 :                                 return -1;
    5759             :                         }
    5760           0 :                         object->time = test_var;
    5761             :                 } else {
    5762           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5763             :                           PyLong_Type.tp_name);
    5764           0 :                         return -1;
    5765             :                 }
    5766             :         }
    5767           0 :         return 0;
    5768             : }
    5769             : 
    5770           0 : static PyObject *py_srvsvc_NetSessInfo10_get_idle_time(PyObject *obj, void *closure)
    5771             : {
    5772           0 :         struct srvsvc_NetSessInfo10 *object = (struct srvsvc_NetSessInfo10 *)pytalloc_get_ptr(obj);
    5773             :         PyObject *py_idle_time;
    5774           0 :         py_idle_time = PyLong_FromUnsignedLongLong((uint32_t)object->idle_time);
    5775           0 :         return py_idle_time;
    5776             : }
    5777             : 
    5778           0 : static int py_srvsvc_NetSessInfo10_set_idle_time(PyObject *py_obj, PyObject *value, void *closure)
    5779             : {
    5780           0 :         struct srvsvc_NetSessInfo10 *object = (struct srvsvc_NetSessInfo10 *)pytalloc_get_ptr(py_obj);
    5781           0 :         if (value == NULL) {
    5782           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->idle_time");
    5783           0 :                 return -1;
    5784             :         }
    5785             :         {
    5786           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->idle_time));
    5787           0 :                 if (PyLong_Check(value)) {
    5788             :                         unsigned long long test_var;
    5789           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5790           0 :                         if (PyErr_Occurred() != NULL) {
    5791           0 :                                 return -1;
    5792             :                         }
    5793           0 :                         if (test_var > uint_max) {
    5794           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5795             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5796           0 :                                 return -1;
    5797             :                         }
    5798           0 :                         object->idle_time = test_var;
    5799             :                 } else {
    5800           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5801             :                           PyLong_Type.tp_name);
    5802           0 :                         return -1;
    5803             :                 }
    5804             :         }
    5805           0 :         return 0;
    5806             : }
    5807             : 
    5808             : static PyGetSetDef py_srvsvc_NetSessInfo10_getsetters[] = {
    5809             :         {
    5810             :                 .name = discard_const_p(char, "client"),
    5811             :                 .get = py_srvsvc_NetSessInfo10_get_client,
    5812             :                 .set = py_srvsvc_NetSessInfo10_set_client,
    5813             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    5814             :         },
    5815             :         {
    5816             :                 .name = discard_const_p(char, "user"),
    5817             :                 .get = py_srvsvc_NetSessInfo10_get_user,
    5818             :                 .set = py_srvsvc_NetSessInfo10_set_user,
    5819             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    5820             :         },
    5821             :         {
    5822             :                 .name = discard_const_p(char, "time"),
    5823             :                 .get = py_srvsvc_NetSessInfo10_get_time,
    5824             :                 .set = py_srvsvc_NetSessInfo10_set_time,
    5825             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    5826             :         },
    5827             :         {
    5828             :                 .name = discard_const_p(char, "idle_time"),
    5829             :                 .get = py_srvsvc_NetSessInfo10_get_idle_time,
    5830             :                 .set = py_srvsvc_NetSessInfo10_set_idle_time,
    5831             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    5832             :         },
    5833             :         { .name = NULL }
    5834             : };
    5835             : 
    5836           0 : static PyObject *py_srvsvc_NetSessInfo10_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5837             : {
    5838           0 :         return pytalloc_new(struct srvsvc_NetSessInfo10, type);
    5839             : }
    5840             : 
    5841             : 
    5842             : static PyTypeObject srvsvc_NetSessInfo10_Type = {
    5843             :         PyVarObject_HEAD_INIT(NULL, 0)
    5844             :         .tp_name = "srvsvc.NetSessInfo10",
    5845             :         .tp_getset = py_srvsvc_NetSessInfo10_getsetters,
    5846             :         .tp_methods = NULL,
    5847             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5848             :         .tp_new = py_srvsvc_NetSessInfo10_new,
    5849             : };
    5850             : 
    5851             : 
    5852           0 : static PyObject *py_srvsvc_NetSessCtr10_get_count(PyObject *obj, void *closure)
    5853             : {
    5854           0 :         struct srvsvc_NetSessCtr10 *object = (struct srvsvc_NetSessCtr10 *)pytalloc_get_ptr(obj);
    5855             :         PyObject *py_count;
    5856           0 :         py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
    5857           0 :         return py_count;
    5858             : }
    5859             : 
    5860           0 : static int py_srvsvc_NetSessCtr10_set_count(PyObject *py_obj, PyObject *value, void *closure)
    5861             : {
    5862           0 :         struct srvsvc_NetSessCtr10 *object = (struct srvsvc_NetSessCtr10 *)pytalloc_get_ptr(py_obj);
    5863           0 :         if (value == NULL) {
    5864           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
    5865           0 :                 return -1;
    5866             :         }
    5867             :         {
    5868           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
    5869           0 :                 if (PyLong_Check(value)) {
    5870             :                         unsigned long long test_var;
    5871           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    5872           0 :                         if (PyErr_Occurred() != NULL) {
    5873           0 :                                 return -1;
    5874             :                         }
    5875           0 :                         if (test_var > uint_max) {
    5876           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    5877             :                                   PyLong_Type.tp_name, uint_max, test_var);
    5878           0 :                                 return -1;
    5879             :                         }
    5880           0 :                         object->count = test_var;
    5881             :                 } else {
    5882           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    5883             :                           PyLong_Type.tp_name);
    5884           0 :                         return -1;
    5885             :                 }
    5886             :         }
    5887           0 :         return 0;
    5888             : }
    5889             : 
    5890           0 : static PyObject *py_srvsvc_NetSessCtr10_get_array(PyObject *obj, void *closure)
    5891             : {
    5892           0 :         struct srvsvc_NetSessCtr10 *object = (struct srvsvc_NetSessCtr10 *)pytalloc_get_ptr(obj);
    5893             :         PyObject *py_array;
    5894           0 :         if (object->array == NULL) {
    5895           0 :                 Py_RETURN_NONE;
    5896             :         }
    5897           0 :         if (object->array == NULL) {
    5898           0 :                 py_array = Py_None;
    5899           0 :                 Py_INCREF(py_array);
    5900             :         } else {
    5901           0 :                 py_array = PyList_New(object->count);
    5902           0 :                 if (py_array == NULL) {
    5903           0 :                         return NULL;
    5904             :                 }
    5905             :                 {
    5906             :                         int array_cntr_1;
    5907           0 :                         for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
    5908             :                                 PyObject *py_array_1;
    5909           0 :                                 py_array_1 = pytalloc_reference_ex(&srvsvc_NetSessInfo10_Type, object->array, &object->array[array_cntr_1]);
    5910           0 :                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
    5911             :                         }
    5912             :                 }
    5913             :         }
    5914           0 :         return py_array;
    5915             : }
    5916             : 
    5917           0 : static int py_srvsvc_NetSessCtr10_set_array(PyObject *py_obj, PyObject *value, void *closure)
    5918             : {
    5919           0 :         struct srvsvc_NetSessCtr10 *object = (struct srvsvc_NetSessCtr10 *)pytalloc_get_ptr(py_obj);
    5920           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
    5921           0 :         if (value == NULL) {
    5922           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
    5923           0 :                 return -1;
    5924             :         }
    5925           0 :         if (value == Py_None) {
    5926           0 :                 object->array = NULL;
    5927             :         } else {
    5928           0 :                 object->array = NULL;
    5929           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    5930             :                 {
    5931             :                         int array_cntr_1;
    5932           0 :                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
    5933           0 :                         if (!object->array) { return -1;; }
    5934           0 :                         talloc_set_name_const(object->array, "ARRAY: object->array");
    5935           0 :                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
    5936           0 :                                 if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
    5937           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
    5938           0 :                                         return -1;
    5939             :                                 }
    5940           0 :                                 PY_CHECK_TYPE(&srvsvc_NetSessInfo10_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
    5941           0 :                                 if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
    5942           0 :                                         PyErr_NoMemory();
    5943           0 :                                         return -1;
    5944             :                                 }
    5945           0 :                                 object->array[array_cntr_1] = *(struct srvsvc_NetSessInfo10 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
    5946             :                         }
    5947             :                 }
    5948             :         }
    5949           0 :         return 0;
    5950             : }
    5951             : 
    5952             : static PyGetSetDef py_srvsvc_NetSessCtr10_getsetters[] = {
    5953             :         {
    5954             :                 .name = discard_const_p(char, "count"),
    5955             :                 .get = py_srvsvc_NetSessCtr10_get_count,
    5956             :                 .set = py_srvsvc_NetSessCtr10_set_count,
    5957             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    5958             :         },
    5959             :         {
    5960             :                 .name = discard_const_p(char, "array"),
    5961             :                 .get = py_srvsvc_NetSessCtr10_get_array,
    5962             :                 .set = py_srvsvc_NetSessCtr10_set_array,
    5963             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetSessInfo10")
    5964             :         },
    5965             :         { .name = NULL }
    5966             : };
    5967             : 
    5968           0 : static PyObject *py_srvsvc_NetSessCtr10_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    5969             : {
    5970           0 :         return pytalloc_new(struct srvsvc_NetSessCtr10, type);
    5971             : }
    5972             : 
    5973             : 
    5974             : static PyTypeObject srvsvc_NetSessCtr10_Type = {
    5975             :         PyVarObject_HEAD_INIT(NULL, 0)
    5976             :         .tp_name = "srvsvc.NetSessCtr10",
    5977             :         .tp_getset = py_srvsvc_NetSessCtr10_getsetters,
    5978             :         .tp_methods = NULL,
    5979             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    5980             :         .tp_new = py_srvsvc_NetSessCtr10_new,
    5981             : };
    5982             : 
    5983             : 
    5984           0 : static PyObject *py_srvsvc_NetSessInfo502_get_client(PyObject *obj, void *closure)
    5985             : {
    5986           0 :         struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(obj);
    5987             :         PyObject *py_client;
    5988           0 :         if (object->client == NULL) {
    5989           0 :                 Py_RETURN_NONE;
    5990             :         }
    5991           0 :         if (object->client == NULL) {
    5992           0 :                 py_client = Py_None;
    5993           0 :                 Py_INCREF(py_client);
    5994             :         } else {
    5995           0 :                 if (object->client == NULL) {
    5996           0 :                         py_client = Py_None;
    5997           0 :                         Py_INCREF(py_client);
    5998             :                 } else {
    5999           0 :                         py_client = PyUnicode_Decode(object->client, strlen(object->client), "utf-8", "ignore");
    6000             :                 }
    6001             :         }
    6002           0 :         return py_client;
    6003             : }
    6004             : 
    6005           0 : static int py_srvsvc_NetSessInfo502_set_client(PyObject *py_obj, PyObject *value, void *closure)
    6006             : {
    6007           0 :         struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(py_obj);
    6008           0 :         if (value == NULL) {
    6009           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->client");
    6010           0 :                 return -1;
    6011             :         }
    6012           0 :         if (value == Py_None) {
    6013           0 :                 object->client = NULL;
    6014             :         } else {
    6015           0 :                 object->client = NULL;
    6016             :                 {
    6017             :                         const char *test_str;
    6018             :                         const char *talloc_str;
    6019           0 :                         PyObject *unicode = NULL;
    6020           0 :                         if (PyUnicode_Check(value)) {
    6021           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    6022           0 :                                 if (unicode == NULL) {
    6023           0 :                                         PyErr_NoMemory();
    6024           0 :                                         return -1;
    6025             :                                 }
    6026           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    6027           0 :                         } else if (PyBytes_Check(value)) {
    6028           0 :                                 test_str = PyBytes_AS_STRING(value);
    6029             :                         } else {
    6030           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    6031           0 :                                 return -1;
    6032             :                         }
    6033           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    6034           0 :                         if (unicode != NULL) {
    6035           0 :                                 Py_DECREF(unicode);
    6036             :                         }
    6037           0 :                         if (talloc_str == NULL) {
    6038           0 :                                 PyErr_NoMemory();
    6039           0 :                                 return -1;
    6040             :                         }
    6041           0 :                         object->client = talloc_str;
    6042             :                 }
    6043             :         }
    6044           0 :         return 0;
    6045             : }
    6046             : 
    6047           0 : static PyObject *py_srvsvc_NetSessInfo502_get_user(PyObject *obj, void *closure)
    6048             : {
    6049           0 :         struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(obj);
    6050             :         PyObject *py_user;
    6051           0 :         if (object->user == NULL) {
    6052           0 :                 Py_RETURN_NONE;
    6053             :         }
    6054           0 :         if (object->user == NULL) {
    6055           0 :                 py_user = Py_None;
    6056           0 :                 Py_INCREF(py_user);
    6057             :         } else {
    6058           0 :                 if (object->user == NULL) {
    6059           0 :                         py_user = Py_None;
    6060           0 :                         Py_INCREF(py_user);
    6061             :                 } else {
    6062           0 :                         py_user = PyUnicode_Decode(object->user, strlen(object->user), "utf-8", "ignore");
    6063             :                 }
    6064             :         }
    6065           0 :         return py_user;
    6066             : }
    6067             : 
    6068           0 : static int py_srvsvc_NetSessInfo502_set_user(PyObject *py_obj, PyObject *value, void *closure)
    6069             : {
    6070           0 :         struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(py_obj);
    6071           0 :         if (value == NULL) {
    6072           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user");
    6073           0 :                 return -1;
    6074             :         }
    6075           0 :         if (value == Py_None) {
    6076           0 :                 object->user = NULL;
    6077             :         } else {
    6078           0 :                 object->user = NULL;
    6079             :                 {
    6080             :                         const char *test_str;
    6081             :                         const char *talloc_str;
    6082           0 :                         PyObject *unicode = NULL;
    6083           0 :                         if (PyUnicode_Check(value)) {
    6084           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    6085           0 :                                 if (unicode == NULL) {
    6086           0 :                                         PyErr_NoMemory();
    6087           0 :                                         return -1;
    6088             :                                 }
    6089           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    6090           0 :                         } else if (PyBytes_Check(value)) {
    6091           0 :                                 test_str = PyBytes_AS_STRING(value);
    6092             :                         } else {
    6093           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    6094           0 :                                 return -1;
    6095             :                         }
    6096           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    6097           0 :                         if (unicode != NULL) {
    6098           0 :                                 Py_DECREF(unicode);
    6099             :                         }
    6100           0 :                         if (talloc_str == NULL) {
    6101           0 :                                 PyErr_NoMemory();
    6102           0 :                                 return -1;
    6103             :                         }
    6104           0 :                         object->user = talloc_str;
    6105             :                 }
    6106             :         }
    6107           0 :         return 0;
    6108             : }
    6109             : 
    6110           0 : static PyObject *py_srvsvc_NetSessInfo502_get_num_open(PyObject *obj, void *closure)
    6111             : {
    6112           0 :         struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(obj);
    6113             :         PyObject *py_num_open;
    6114           0 :         py_num_open = PyLong_FromUnsignedLongLong((uint32_t)object->num_open);
    6115           0 :         return py_num_open;
    6116             : }
    6117             : 
    6118           0 : static int py_srvsvc_NetSessInfo502_set_num_open(PyObject *py_obj, PyObject *value, void *closure)
    6119             : {
    6120           0 :         struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(py_obj);
    6121           0 :         if (value == NULL) {
    6122           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->num_open");
    6123           0 :                 return -1;
    6124             :         }
    6125             :         {
    6126           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->num_open));
    6127           0 :                 if (PyLong_Check(value)) {
    6128             :                         unsigned long long test_var;
    6129           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6130           0 :                         if (PyErr_Occurred() != NULL) {
    6131           0 :                                 return -1;
    6132             :                         }
    6133           0 :                         if (test_var > uint_max) {
    6134           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    6135             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6136           0 :                                 return -1;
    6137             :                         }
    6138           0 :                         object->num_open = test_var;
    6139             :                 } else {
    6140           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    6141             :                           PyLong_Type.tp_name);
    6142           0 :                         return -1;
    6143             :                 }
    6144             :         }
    6145           0 :         return 0;
    6146             : }
    6147             : 
    6148           0 : static PyObject *py_srvsvc_NetSessInfo502_get_time(PyObject *obj, void *closure)
    6149             : {
    6150           0 :         struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(obj);
    6151             :         PyObject *py_time;
    6152           0 :         py_time = PyLong_FromUnsignedLongLong((uint32_t)object->time);
    6153           0 :         return py_time;
    6154             : }
    6155             : 
    6156           0 : static int py_srvsvc_NetSessInfo502_set_time(PyObject *py_obj, PyObject *value, void *closure)
    6157             : {
    6158           0 :         struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(py_obj);
    6159           0 :         if (value == NULL) {
    6160           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->time");
    6161           0 :                 return -1;
    6162             :         }
    6163             :         {
    6164           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->time));
    6165           0 :                 if (PyLong_Check(value)) {
    6166             :                         unsigned long long test_var;
    6167           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6168           0 :                         if (PyErr_Occurred() != NULL) {
    6169           0 :                                 return -1;
    6170             :                         }
    6171           0 :                         if (test_var > uint_max) {
    6172           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    6173             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6174           0 :                                 return -1;
    6175             :                         }
    6176           0 :                         object->time = test_var;
    6177             :                 } else {
    6178           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    6179             :                           PyLong_Type.tp_name);
    6180           0 :                         return -1;
    6181             :                 }
    6182             :         }
    6183           0 :         return 0;
    6184             : }
    6185             : 
    6186           0 : static PyObject *py_srvsvc_NetSessInfo502_get_idle_time(PyObject *obj, void *closure)
    6187             : {
    6188           0 :         struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(obj);
    6189             :         PyObject *py_idle_time;
    6190           0 :         py_idle_time = PyLong_FromUnsignedLongLong((uint32_t)object->idle_time);
    6191           0 :         return py_idle_time;
    6192             : }
    6193             : 
    6194           0 : static int py_srvsvc_NetSessInfo502_set_idle_time(PyObject *py_obj, PyObject *value, void *closure)
    6195             : {
    6196           0 :         struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(py_obj);
    6197           0 :         if (value == NULL) {
    6198           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->idle_time");
    6199           0 :                 return -1;
    6200             :         }
    6201             :         {
    6202           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->idle_time));
    6203           0 :                 if (PyLong_Check(value)) {
    6204             :                         unsigned long long test_var;
    6205           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6206           0 :                         if (PyErr_Occurred() != NULL) {
    6207           0 :                                 return -1;
    6208             :                         }
    6209           0 :                         if (test_var > uint_max) {
    6210           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    6211             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6212           0 :                                 return -1;
    6213             :                         }
    6214           0 :                         object->idle_time = test_var;
    6215             :                 } else {
    6216           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    6217             :                           PyLong_Type.tp_name);
    6218           0 :                         return -1;
    6219             :                 }
    6220             :         }
    6221           0 :         return 0;
    6222             : }
    6223             : 
    6224           0 : static PyObject *py_srvsvc_NetSessInfo502_get_user_flags(PyObject *obj, void *closure)
    6225             : {
    6226           0 :         struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(obj);
    6227             :         PyObject *py_user_flags;
    6228           0 :         py_user_flags = PyLong_FromUnsignedLongLong((uint32_t)object->user_flags);
    6229           0 :         return py_user_flags;
    6230             : }
    6231             : 
    6232           0 : static int py_srvsvc_NetSessInfo502_set_user_flags(PyObject *py_obj, PyObject *value, void *closure)
    6233             : {
    6234           0 :         struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(py_obj);
    6235           0 :         if (value == NULL) {
    6236           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->user_flags");
    6237           0 :                 return -1;
    6238             :         }
    6239             :         {
    6240           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->user_flags));
    6241           0 :                 if (PyLong_Check(value)) {
    6242             :                         unsigned long long test_var;
    6243           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6244           0 :                         if (PyErr_Occurred() != NULL) {
    6245           0 :                                 return -1;
    6246             :                         }
    6247           0 :                         if (test_var > uint_max) {
    6248           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    6249             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6250           0 :                                 return -1;
    6251             :                         }
    6252           0 :                         object->user_flags = test_var;
    6253             :                 } else {
    6254           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    6255             :                           PyLong_Type.tp_name);
    6256           0 :                         return -1;
    6257             :                 }
    6258             :         }
    6259           0 :         return 0;
    6260             : }
    6261             : 
    6262           0 : static PyObject *py_srvsvc_NetSessInfo502_get_client_type(PyObject *obj, void *closure)
    6263             : {
    6264           0 :         struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(obj);
    6265             :         PyObject *py_client_type;
    6266           0 :         if (object->client_type == NULL) {
    6267           0 :                 Py_RETURN_NONE;
    6268             :         }
    6269           0 :         if (object->client_type == NULL) {
    6270           0 :                 py_client_type = Py_None;
    6271           0 :                 Py_INCREF(py_client_type);
    6272             :         } else {
    6273           0 :                 if (object->client_type == NULL) {
    6274           0 :                         py_client_type = Py_None;
    6275           0 :                         Py_INCREF(py_client_type);
    6276             :                 } else {
    6277           0 :                         py_client_type = PyUnicode_Decode(object->client_type, strlen(object->client_type), "utf-8", "ignore");
    6278             :                 }
    6279             :         }
    6280           0 :         return py_client_type;
    6281             : }
    6282             : 
    6283           0 : static int py_srvsvc_NetSessInfo502_set_client_type(PyObject *py_obj, PyObject *value, void *closure)
    6284             : {
    6285           0 :         struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(py_obj);
    6286           0 :         if (value == NULL) {
    6287           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->client_type");
    6288           0 :                 return -1;
    6289             :         }
    6290           0 :         if (value == Py_None) {
    6291           0 :                 object->client_type = NULL;
    6292             :         } else {
    6293           0 :                 object->client_type = NULL;
    6294             :                 {
    6295             :                         const char *test_str;
    6296             :                         const char *talloc_str;
    6297           0 :                         PyObject *unicode = NULL;
    6298           0 :                         if (PyUnicode_Check(value)) {
    6299           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    6300           0 :                                 if (unicode == NULL) {
    6301           0 :                                         PyErr_NoMemory();
    6302           0 :                                         return -1;
    6303             :                                 }
    6304           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    6305           0 :                         } else if (PyBytes_Check(value)) {
    6306           0 :                                 test_str = PyBytes_AS_STRING(value);
    6307             :                         } else {
    6308           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    6309           0 :                                 return -1;
    6310             :                         }
    6311           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    6312           0 :                         if (unicode != NULL) {
    6313           0 :                                 Py_DECREF(unicode);
    6314             :                         }
    6315           0 :                         if (talloc_str == NULL) {
    6316           0 :                                 PyErr_NoMemory();
    6317           0 :                                 return -1;
    6318             :                         }
    6319           0 :                         object->client_type = talloc_str;
    6320             :                 }
    6321             :         }
    6322           0 :         return 0;
    6323             : }
    6324             : 
    6325           0 : static PyObject *py_srvsvc_NetSessInfo502_get_transport(PyObject *obj, void *closure)
    6326             : {
    6327           0 :         struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(obj);
    6328             :         PyObject *py_transport;
    6329           0 :         if (object->transport == NULL) {
    6330           0 :                 Py_RETURN_NONE;
    6331             :         }
    6332           0 :         if (object->transport == NULL) {
    6333           0 :                 py_transport = Py_None;
    6334           0 :                 Py_INCREF(py_transport);
    6335             :         } else {
    6336           0 :                 if (object->transport == NULL) {
    6337           0 :                         py_transport = Py_None;
    6338           0 :                         Py_INCREF(py_transport);
    6339             :                 } else {
    6340           0 :                         py_transport = PyUnicode_Decode(object->transport, strlen(object->transport), "utf-8", "ignore");
    6341             :                 }
    6342             :         }
    6343           0 :         return py_transport;
    6344             : }
    6345             : 
    6346           0 : static int py_srvsvc_NetSessInfo502_set_transport(PyObject *py_obj, PyObject *value, void *closure)
    6347             : {
    6348           0 :         struct srvsvc_NetSessInfo502 *object = (struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(py_obj);
    6349           0 :         if (value == NULL) {
    6350           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->transport");
    6351           0 :                 return -1;
    6352             :         }
    6353           0 :         if (value == Py_None) {
    6354           0 :                 object->transport = NULL;
    6355             :         } else {
    6356           0 :                 object->transport = NULL;
    6357             :                 {
    6358             :                         const char *test_str;
    6359             :                         const char *talloc_str;
    6360           0 :                         PyObject *unicode = NULL;
    6361           0 :                         if (PyUnicode_Check(value)) {
    6362           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    6363           0 :                                 if (unicode == NULL) {
    6364           0 :                                         PyErr_NoMemory();
    6365           0 :                                         return -1;
    6366             :                                 }
    6367           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    6368           0 :                         } else if (PyBytes_Check(value)) {
    6369           0 :                                 test_str = PyBytes_AS_STRING(value);
    6370             :                         } else {
    6371           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    6372           0 :                                 return -1;
    6373             :                         }
    6374           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    6375           0 :                         if (unicode != NULL) {
    6376           0 :                                 Py_DECREF(unicode);
    6377             :                         }
    6378           0 :                         if (talloc_str == NULL) {
    6379           0 :                                 PyErr_NoMemory();
    6380           0 :                                 return -1;
    6381             :                         }
    6382           0 :                         object->transport = talloc_str;
    6383             :                 }
    6384             :         }
    6385           0 :         return 0;
    6386             : }
    6387             : 
    6388             : static PyGetSetDef py_srvsvc_NetSessInfo502_getsetters[] = {
    6389             :         {
    6390             :                 .name = discard_const_p(char, "client"),
    6391             :                 .get = py_srvsvc_NetSessInfo502_get_client,
    6392             :                 .set = py_srvsvc_NetSessInfo502_set_client,
    6393             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    6394             :         },
    6395             :         {
    6396             :                 .name = discard_const_p(char, "user"),
    6397             :                 .get = py_srvsvc_NetSessInfo502_get_user,
    6398             :                 .set = py_srvsvc_NetSessInfo502_set_user,
    6399             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    6400             :         },
    6401             :         {
    6402             :                 .name = discard_const_p(char, "num_open"),
    6403             :                 .get = py_srvsvc_NetSessInfo502_get_num_open,
    6404             :                 .set = py_srvsvc_NetSessInfo502_set_num_open,
    6405             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    6406             :         },
    6407             :         {
    6408             :                 .name = discard_const_p(char, "time"),
    6409             :                 .get = py_srvsvc_NetSessInfo502_get_time,
    6410             :                 .set = py_srvsvc_NetSessInfo502_set_time,
    6411             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    6412             :         },
    6413             :         {
    6414             :                 .name = discard_const_p(char, "idle_time"),
    6415             :                 .get = py_srvsvc_NetSessInfo502_get_idle_time,
    6416             :                 .set = py_srvsvc_NetSessInfo502_set_idle_time,
    6417             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    6418             :         },
    6419             :         {
    6420             :                 .name = discard_const_p(char, "user_flags"),
    6421             :                 .get = py_srvsvc_NetSessInfo502_get_user_flags,
    6422             :                 .set = py_srvsvc_NetSessInfo502_set_user_flags,
    6423             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    6424             :         },
    6425             :         {
    6426             :                 .name = discard_const_p(char, "client_type"),
    6427             :                 .get = py_srvsvc_NetSessInfo502_get_client_type,
    6428             :                 .set = py_srvsvc_NetSessInfo502_set_client_type,
    6429             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    6430             :         },
    6431             :         {
    6432             :                 .name = discard_const_p(char, "transport"),
    6433             :                 .get = py_srvsvc_NetSessInfo502_get_transport,
    6434             :                 .set = py_srvsvc_NetSessInfo502_set_transport,
    6435             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    6436             :         },
    6437             :         { .name = NULL }
    6438             : };
    6439             : 
    6440           0 : static PyObject *py_srvsvc_NetSessInfo502_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    6441             : {
    6442           0 :         return pytalloc_new(struct srvsvc_NetSessInfo502, type);
    6443             : }
    6444             : 
    6445             : 
    6446             : static PyTypeObject srvsvc_NetSessInfo502_Type = {
    6447             :         PyVarObject_HEAD_INIT(NULL, 0)
    6448             :         .tp_name = "srvsvc.NetSessInfo502",
    6449             :         .tp_getset = py_srvsvc_NetSessInfo502_getsetters,
    6450             :         .tp_methods = NULL,
    6451             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    6452             :         .tp_new = py_srvsvc_NetSessInfo502_new,
    6453             : };
    6454             : 
    6455             : 
    6456           0 : static PyObject *py_srvsvc_NetSessCtr502_get_count(PyObject *obj, void *closure)
    6457             : {
    6458           0 :         struct srvsvc_NetSessCtr502 *object = (struct srvsvc_NetSessCtr502 *)pytalloc_get_ptr(obj);
    6459             :         PyObject *py_count;
    6460           0 :         py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
    6461           0 :         return py_count;
    6462             : }
    6463             : 
    6464           0 : static int py_srvsvc_NetSessCtr502_set_count(PyObject *py_obj, PyObject *value, void *closure)
    6465             : {
    6466           0 :         struct srvsvc_NetSessCtr502 *object = (struct srvsvc_NetSessCtr502 *)pytalloc_get_ptr(py_obj);
    6467           0 :         if (value == NULL) {
    6468           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
    6469           0 :                 return -1;
    6470             :         }
    6471             :         {
    6472           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
    6473           0 :                 if (PyLong_Check(value)) {
    6474             :                         unsigned long long test_var;
    6475           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6476           0 :                         if (PyErr_Occurred() != NULL) {
    6477           0 :                                 return -1;
    6478             :                         }
    6479           0 :                         if (test_var > uint_max) {
    6480           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    6481             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6482           0 :                                 return -1;
    6483             :                         }
    6484           0 :                         object->count = test_var;
    6485             :                 } else {
    6486           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    6487             :                           PyLong_Type.tp_name);
    6488           0 :                         return -1;
    6489             :                 }
    6490             :         }
    6491           0 :         return 0;
    6492             : }
    6493             : 
    6494           0 : static PyObject *py_srvsvc_NetSessCtr502_get_array(PyObject *obj, void *closure)
    6495             : {
    6496           0 :         struct srvsvc_NetSessCtr502 *object = (struct srvsvc_NetSessCtr502 *)pytalloc_get_ptr(obj);
    6497             :         PyObject *py_array;
    6498           0 :         if (object->array == NULL) {
    6499           0 :                 Py_RETURN_NONE;
    6500             :         }
    6501           0 :         if (object->array == NULL) {
    6502           0 :                 py_array = Py_None;
    6503           0 :                 Py_INCREF(py_array);
    6504             :         } else {
    6505           0 :                 py_array = PyList_New(object->count);
    6506           0 :                 if (py_array == NULL) {
    6507           0 :                         return NULL;
    6508             :                 }
    6509             :                 {
    6510             :                         int array_cntr_1;
    6511           0 :                         for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
    6512             :                                 PyObject *py_array_1;
    6513           0 :                                 py_array_1 = pytalloc_reference_ex(&srvsvc_NetSessInfo502_Type, object->array, &object->array[array_cntr_1]);
    6514           0 :                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
    6515             :                         }
    6516             :                 }
    6517             :         }
    6518           0 :         return py_array;
    6519             : }
    6520             : 
    6521           0 : static int py_srvsvc_NetSessCtr502_set_array(PyObject *py_obj, PyObject *value, void *closure)
    6522             : {
    6523           0 :         struct srvsvc_NetSessCtr502 *object = (struct srvsvc_NetSessCtr502 *)pytalloc_get_ptr(py_obj);
    6524           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
    6525           0 :         if (value == NULL) {
    6526           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
    6527           0 :                 return -1;
    6528             :         }
    6529           0 :         if (value == Py_None) {
    6530           0 :                 object->array = NULL;
    6531             :         } else {
    6532           0 :                 object->array = NULL;
    6533           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    6534             :                 {
    6535             :                         int array_cntr_1;
    6536           0 :                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
    6537           0 :                         if (!object->array) { return -1;; }
    6538           0 :                         talloc_set_name_const(object->array, "ARRAY: object->array");
    6539           0 :                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
    6540           0 :                                 if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
    6541           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
    6542           0 :                                         return -1;
    6543             :                                 }
    6544           0 :                                 PY_CHECK_TYPE(&srvsvc_NetSessInfo502_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
    6545           0 :                                 if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
    6546           0 :                                         PyErr_NoMemory();
    6547           0 :                                         return -1;
    6548             :                                 }
    6549           0 :                                 object->array[array_cntr_1] = *(struct srvsvc_NetSessInfo502 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
    6550             :                         }
    6551             :                 }
    6552             :         }
    6553           0 :         return 0;
    6554             : }
    6555             : 
    6556             : static PyGetSetDef py_srvsvc_NetSessCtr502_getsetters[] = {
    6557             :         {
    6558             :                 .name = discard_const_p(char, "count"),
    6559             :                 .get = py_srvsvc_NetSessCtr502_get_count,
    6560             :                 .set = py_srvsvc_NetSessCtr502_set_count,
    6561             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    6562             :         },
    6563             :         {
    6564             :                 .name = discard_const_p(char, "array"),
    6565             :                 .get = py_srvsvc_NetSessCtr502_get_array,
    6566             :                 .set = py_srvsvc_NetSessCtr502_set_array,
    6567             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetSessInfo502")
    6568             :         },
    6569             :         { .name = NULL }
    6570             : };
    6571             : 
    6572           0 : static PyObject *py_srvsvc_NetSessCtr502_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    6573             : {
    6574           0 :         return pytalloc_new(struct srvsvc_NetSessCtr502, type);
    6575             : }
    6576             : 
    6577             : 
    6578             : static PyTypeObject srvsvc_NetSessCtr502_Type = {
    6579             :         PyVarObject_HEAD_INIT(NULL, 0)
    6580             :         .tp_name = "srvsvc.NetSessCtr502",
    6581             :         .tp_getset = py_srvsvc_NetSessCtr502_getsetters,
    6582             :         .tp_methods = NULL,
    6583             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    6584             :         .tp_new = py_srvsvc_NetSessCtr502_new,
    6585             : };
    6586             : 
    6587           0 : static PyObject *py_import_srvsvc_NetSessCtr(TALLOC_CTX *mem_ctx, int level, union srvsvc_NetSessCtr *in)
    6588             : {
    6589             :         PyObject *ret;
    6590             : 
    6591           0 :         switch (level) {
    6592           0 :                 case 0:
    6593           0 :                         if (in->ctr0 == NULL) {
    6594           0 :                                 ret = Py_None;
    6595           0 :                                 Py_INCREF(ret);
    6596             :                         } else {
    6597           0 :                                 ret = pytalloc_reference_ex(&srvsvc_NetSessCtr0_Type, in->ctr0, in->ctr0);
    6598             :                         }
    6599           0 :                         return ret;
    6600             : 
    6601           0 :                 case 1:
    6602           0 :                         if (in->ctr1 == NULL) {
    6603           0 :                                 ret = Py_None;
    6604           0 :                                 Py_INCREF(ret);
    6605             :                         } else {
    6606           0 :                                 ret = pytalloc_reference_ex(&srvsvc_NetSessCtr1_Type, in->ctr1, in->ctr1);
    6607             :                         }
    6608           0 :                         return ret;
    6609             : 
    6610           0 :                 case 2:
    6611           0 :                         if (in->ctr2 == NULL) {
    6612           0 :                                 ret = Py_None;
    6613           0 :                                 Py_INCREF(ret);
    6614             :                         } else {
    6615           0 :                                 ret = pytalloc_reference_ex(&srvsvc_NetSessCtr2_Type, in->ctr2, in->ctr2);
    6616             :                         }
    6617           0 :                         return ret;
    6618             : 
    6619           0 :                 case 10:
    6620           0 :                         if (in->ctr10 == NULL) {
    6621           0 :                                 ret = Py_None;
    6622           0 :                                 Py_INCREF(ret);
    6623             :                         } else {
    6624           0 :                                 ret = pytalloc_reference_ex(&srvsvc_NetSessCtr10_Type, in->ctr10, in->ctr10);
    6625             :                         }
    6626           0 :                         return ret;
    6627             : 
    6628           0 :                 case 502:
    6629           0 :                         if (in->ctr502 == NULL) {
    6630           0 :                                 ret = Py_None;
    6631           0 :                                 Py_INCREF(ret);
    6632             :                         } else {
    6633           0 :                                 ret = pytalloc_reference_ex(&srvsvc_NetSessCtr502_Type, in->ctr502, in->ctr502);
    6634             :                         }
    6635           0 :                         return ret;
    6636             : 
    6637           0 :                 default:
    6638           0 :                         ret = Py_None;
    6639           0 :                         Py_INCREF(ret);
    6640           0 :                         return ret;
    6641             : 
    6642             :         }
    6643             :         PyErr_SetString(PyExc_TypeError, "unknown union level");
    6644             :         return NULL;
    6645             : }
    6646             : 
    6647           0 : static union srvsvc_NetSessCtr *py_export_srvsvc_NetSessCtr(TALLOC_CTX *mem_ctx, int level, PyObject *in)
    6648             : {
    6649           0 :         union srvsvc_NetSessCtr *ret = talloc_zero(mem_ctx, union srvsvc_NetSessCtr);
    6650           0 :         switch (level) {
    6651           0 :                 case 0:
    6652           0 :                         if (in == NULL) {
    6653           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr0");
    6654           0 :                                 talloc_free(ret); return NULL;
    6655             :                         }
    6656           0 :                         if (in == Py_None) {
    6657           0 :                                 ret->ctr0 = NULL;
    6658             :                         } else {
    6659           0 :                                 ret->ctr0 = NULL;
    6660           0 :                                 PY_CHECK_TYPE(&srvsvc_NetSessCtr0_Type, in, talloc_free(ret); return NULL;);
    6661           0 :                                 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    6662           0 :                                         PyErr_NoMemory();
    6663           0 :                                         talloc_free(ret); return NULL;
    6664             :                                 }
    6665           0 :                                 ret->ctr0 = (struct srvsvc_NetSessCtr0 *)pytalloc_get_ptr(in);
    6666             :                         }
    6667           0 :                         break;
    6668             : 
    6669           0 :                 case 1:
    6670           0 :                         if (in == NULL) {
    6671           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr1");
    6672           0 :                                 talloc_free(ret); return NULL;
    6673             :                         }
    6674           0 :                         if (in == Py_None) {
    6675           0 :                                 ret->ctr1 = NULL;
    6676             :                         } else {
    6677           0 :                                 ret->ctr1 = NULL;
    6678           0 :                                 PY_CHECK_TYPE(&srvsvc_NetSessCtr1_Type, in, talloc_free(ret); return NULL;);
    6679           0 :                                 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    6680           0 :                                         PyErr_NoMemory();
    6681           0 :                                         talloc_free(ret); return NULL;
    6682             :                                 }
    6683           0 :                                 ret->ctr1 = (struct srvsvc_NetSessCtr1 *)pytalloc_get_ptr(in);
    6684             :                         }
    6685           0 :                         break;
    6686             : 
    6687           0 :                 case 2:
    6688           0 :                         if (in == NULL) {
    6689           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr2");
    6690           0 :                                 talloc_free(ret); return NULL;
    6691             :                         }
    6692           0 :                         if (in == Py_None) {
    6693           0 :                                 ret->ctr2 = NULL;
    6694             :                         } else {
    6695           0 :                                 ret->ctr2 = NULL;
    6696           0 :                                 PY_CHECK_TYPE(&srvsvc_NetSessCtr2_Type, in, talloc_free(ret); return NULL;);
    6697           0 :                                 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    6698           0 :                                         PyErr_NoMemory();
    6699           0 :                                         talloc_free(ret); return NULL;
    6700             :                                 }
    6701           0 :                                 ret->ctr2 = (struct srvsvc_NetSessCtr2 *)pytalloc_get_ptr(in);
    6702             :                         }
    6703           0 :                         break;
    6704             : 
    6705           0 :                 case 10:
    6706           0 :                         if (in == NULL) {
    6707           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr10");
    6708           0 :                                 talloc_free(ret); return NULL;
    6709             :                         }
    6710           0 :                         if (in == Py_None) {
    6711           0 :                                 ret->ctr10 = NULL;
    6712             :                         } else {
    6713           0 :                                 ret->ctr10 = NULL;
    6714           0 :                                 PY_CHECK_TYPE(&srvsvc_NetSessCtr10_Type, in, talloc_free(ret); return NULL;);
    6715           0 :                                 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    6716           0 :                                         PyErr_NoMemory();
    6717           0 :                                         talloc_free(ret); return NULL;
    6718             :                                 }
    6719           0 :                                 ret->ctr10 = (struct srvsvc_NetSessCtr10 *)pytalloc_get_ptr(in);
    6720             :                         }
    6721           0 :                         break;
    6722             : 
    6723           0 :                 case 502:
    6724           0 :                         if (in == NULL) {
    6725           0 :                                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct ret->ctr502");
    6726           0 :                                 talloc_free(ret); return NULL;
    6727             :                         }
    6728           0 :                         if (in == Py_None) {
    6729           0 :                                 ret->ctr502 = NULL;
    6730             :                         } else {
    6731           0 :                                 ret->ctr502 = NULL;
    6732           0 :                                 PY_CHECK_TYPE(&srvsvc_NetSessCtr502_Type, in, talloc_free(ret); return NULL;);
    6733           0 :                                 if (talloc_reference(mem_ctx, pytalloc_get_mem_ctx(in)) == NULL) {
    6734           0 :                                         PyErr_NoMemory();
    6735           0 :                                         talloc_free(ret); return NULL;
    6736             :                                 }
    6737           0 :                                 ret->ctr502 = (struct srvsvc_NetSessCtr502 *)pytalloc_get_ptr(in);
    6738             :                         }
    6739           0 :                         break;
    6740             : 
    6741           0 :                 default:
    6742           0 :                         break;
    6743             : 
    6744             :         }
    6745             : 
    6746           0 :         return ret;
    6747             : }
    6748             : 
    6749           0 : static PyObject *py_srvsvc_NetSessCtr_import(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    6750             : {
    6751           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    6752           0 :         PyObject *mem_ctx_obj = NULL;
    6753           0 :         TALLOC_CTX *mem_ctx = NULL;
    6754           0 :         int level = 0;
    6755           0 :         PyObject *in_obj = NULL;
    6756           0 :         union srvsvc_NetSessCtr *in = NULL;
    6757             : 
    6758           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:import",
    6759             :                 discard_const_p(char *, kwnames),
    6760             :                 &mem_ctx_obj,
    6761             :                 &level,
    6762             :                 &in_obj)) {
    6763           0 :                 return NULL;
    6764             :         }
    6765           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    6766           0 :         if (mem_ctx == NULL) {
    6767           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    6768           0 :                 return NULL;
    6769             :         }
    6770           0 :         in = (union srvsvc_NetSessCtr *)pytalloc_get_ptr(in_obj);
    6771           0 :         if (in == NULL) {
    6772           0 :                 PyErr_Format(PyExc_TypeError, "in needs to be a pointer to union srvsvc_NetSessCtr!");
    6773           0 :                 return NULL;
    6774             :         }
    6775             : 
    6776           0 :         return py_import_srvsvc_NetSessCtr(mem_ctx, level, in);
    6777             : }
    6778             : 
    6779           0 : static PyObject *py_srvsvc_NetSessCtr_export(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    6780             : {
    6781           0 :         const char * const kwnames[] = { "mem_ctx", "level", "in", NULL };
    6782           0 :         PyObject *mem_ctx_obj = NULL;
    6783           0 :         TALLOC_CTX *mem_ctx = NULL;
    6784           0 :         int level = 0;
    6785           0 :         PyObject *in = NULL;
    6786           0 :         union srvsvc_NetSessCtr *out = NULL;
    6787             : 
    6788           0 :         if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OiO:export",
    6789             :                 discard_const_p(char *, kwnames),
    6790             :                 &mem_ctx_obj,
    6791             :                 &level,
    6792             :                 &in)) {
    6793           0 :                 return NULL;
    6794             :         }
    6795           0 :         mem_ctx = pytalloc_get_ptr(mem_ctx_obj);
    6796           0 :         if (mem_ctx == NULL) {
    6797           0 :                 PyErr_SetString(PyExc_TypeError, "mem_ctx is NULL)!");
    6798           0 :                 return NULL;
    6799             :         }
    6800             : 
    6801           0 :         out = py_export_srvsvc_NetSessCtr(mem_ctx, level, in);
    6802           0 :         if (out == NULL) {
    6803           0 :                 return NULL;
    6804             :         }
    6805             : 
    6806           0 :         return pytalloc_GenericObject_reference(out);
    6807             : }
    6808             : 
    6809             : static PyMethodDef py_srvsvc_NetSessCtr_methods[] = {
    6810             :         { "__import__", PY_DISCARD_FUNC_SIG(PyCFunction,py_srvsvc_NetSessCtr_import),
    6811             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    6812             :                 "T.__import__(mem_ctx, level, in) => ret." },
    6813             :         { "__export__", PY_DISCARD_FUNC_SIG(PyCFunction,py_srvsvc_NetSessCtr_export),
    6814             :                 METH_VARARGS|METH_KEYWORDS|METH_CLASS,
    6815             :                 "T.__export__(mem_ctx, level, in) => ret." },
    6816             :         { NULL, NULL, 0, NULL }
    6817             : };
    6818             : 
    6819           0 : static PyObject *py_srvsvc_NetSessCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    6820             : {
    6821           0 :         PyErr_Format(PyExc_TypeError, "New %s Objects are not supported", type->tp_name);
    6822           0 :         return NULL;
    6823             : }
    6824             : 
    6825             : 
    6826             : static PyTypeObject srvsvc_NetSessCtr_Type = {
    6827             :         PyVarObject_HEAD_INIT(NULL, 0)
    6828             :         .tp_name = "srvsvc.NetSessCtr",
    6829             :         .tp_getset = NULL,
    6830             :         .tp_methods = py_srvsvc_NetSessCtr_methods,
    6831             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    6832             :         .tp_new = py_srvsvc_NetSessCtr_new,
    6833             : };
    6834             : 
    6835             : 
    6836           0 : static PyObject *py_srvsvc_NetSessInfoCtr_get_level(PyObject *obj, void *closure)
    6837             : {
    6838           0 :         struct srvsvc_NetSessInfoCtr *object = (struct srvsvc_NetSessInfoCtr *)pytalloc_get_ptr(obj);
    6839             :         PyObject *py_level;
    6840           0 :         py_level = PyLong_FromUnsignedLongLong((uint32_t)object->level);
    6841           0 :         return py_level;
    6842             : }
    6843             : 
    6844           0 : static int py_srvsvc_NetSessInfoCtr_set_level(PyObject *py_obj, PyObject *value, void *closure)
    6845             : {
    6846           0 :         struct srvsvc_NetSessInfoCtr *object = (struct srvsvc_NetSessInfoCtr *)pytalloc_get_ptr(py_obj);
    6847           0 :         if (value == NULL) {
    6848           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->level");
    6849           0 :                 return -1;
    6850             :         }
    6851             :         {
    6852           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->level));
    6853           0 :                 if (PyLong_Check(value)) {
    6854             :                         unsigned long long test_var;
    6855           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    6856           0 :                         if (PyErr_Occurred() != NULL) {
    6857           0 :                                 return -1;
    6858             :                         }
    6859           0 :                         if (test_var > uint_max) {
    6860           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    6861             :                                   PyLong_Type.tp_name, uint_max, test_var);
    6862           0 :                                 return -1;
    6863             :                         }
    6864           0 :                         object->level = test_var;
    6865             :                 } else {
    6866           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    6867             :                           PyLong_Type.tp_name);
    6868           0 :                         return -1;
    6869             :                 }
    6870             :         }
    6871           0 :         return 0;
    6872             : }
    6873             : 
    6874           0 : static PyObject *py_srvsvc_NetSessInfoCtr_get_ctr(PyObject *obj, void *closure)
    6875             : {
    6876           0 :         struct srvsvc_NetSessInfoCtr *object = (struct srvsvc_NetSessInfoCtr *)pytalloc_get_ptr(obj);
    6877             :         PyObject *py_ctr;
    6878           0 :         py_ctr = pyrpc_import_union(&srvsvc_NetSessCtr_Type, pytalloc_get_mem_ctx(obj), object->level, &object->ctr, "union srvsvc_NetSessCtr");
    6879           0 :         if (py_ctr == NULL) {
    6880           0 :                 return NULL;
    6881             :         }
    6882           0 :         return py_ctr;
    6883             : }
    6884             : 
    6885           0 : static int py_srvsvc_NetSessInfoCtr_set_ctr(PyObject *py_obj, PyObject *value, void *closure)
    6886             : {
    6887           0 :         struct srvsvc_NetSessInfoCtr *object = (struct srvsvc_NetSessInfoCtr *)pytalloc_get_ptr(py_obj);
    6888           0 :         if (value == NULL) {
    6889           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->ctr");
    6890           0 :                 return -1;
    6891             :         }
    6892             :         {
    6893             :                 union srvsvc_NetSessCtr *ctr_switch_0;
    6894           0 :                 ctr_switch_0 = (union srvsvc_NetSessCtr *)pyrpc_export_union(&srvsvc_NetSessCtr_Type, pytalloc_get_mem_ctx(py_obj), object->level, value, "union srvsvc_NetSessCtr");
    6895           0 :                 if (ctr_switch_0 == NULL) {
    6896           0 :                         return -1;
    6897             :                 }
    6898           0 :                 object->ctr = *ctr_switch_0;
    6899             :         }
    6900           0 :         return 0;
    6901             : }
    6902             : 
    6903             : static PyGetSetDef py_srvsvc_NetSessInfoCtr_getsetters[] = {
    6904             :         {
    6905             :                 .name = discard_const_p(char, "level"),
    6906             :                 .get = py_srvsvc_NetSessInfoCtr_get_level,
    6907             :                 .set = py_srvsvc_NetSessInfoCtr_set_level,
    6908             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    6909             :         },
    6910             :         {
    6911             :                 .name = discard_const_p(char, "ctr"),
    6912             :                 .get = py_srvsvc_NetSessInfoCtr_get_ctr,
    6913             :                 .set = py_srvsvc_NetSessInfoCtr_set_ctr,
    6914             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetSessCtr")
    6915             :         },
    6916             :         { .name = NULL }
    6917             : };
    6918             : 
    6919           0 : static PyObject *py_srvsvc_NetSessInfoCtr_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    6920             : {
    6921           0 :         return pytalloc_new(struct srvsvc_NetSessInfoCtr, type);
    6922             : }
    6923             : 
    6924             : 
    6925             : static PyTypeObject srvsvc_NetSessInfoCtr_Type = {
    6926             :         PyVarObject_HEAD_INIT(NULL, 0)
    6927             :         .tp_name = "srvsvc.NetSessInfoCtr",
    6928             :         .tp_getset = py_srvsvc_NetSessInfoCtr_getsetters,
    6929             :         .tp_methods = NULL,
    6930             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    6931             :         .tp_new = py_srvsvc_NetSessInfoCtr_new,
    6932             : };
    6933             : 
    6934             : 
    6935           0 : static PyObject *py_srvsvc_NetShareInfo0_get_name(PyObject *obj, void *closure)
    6936             : {
    6937           0 :         struct srvsvc_NetShareInfo0 *object = (struct srvsvc_NetShareInfo0 *)pytalloc_get_ptr(obj);
    6938             :         PyObject *py_name;
    6939           0 :         if (object->name == NULL) {
    6940           0 :                 Py_RETURN_NONE;
    6941             :         }
    6942           0 :         if (object->name == NULL) {
    6943           0 :                 py_name = Py_None;
    6944           0 :                 Py_INCREF(py_name);
    6945             :         } else {
    6946           0 :                 if (object->name == NULL) {
    6947           0 :                         py_name = Py_None;
    6948           0 :                         Py_INCREF(py_name);
    6949             :                 } else {
    6950           0 :                         py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
    6951             :                 }
    6952             :         }
    6953           0 :         return py_name;
    6954             : }
    6955             : 
    6956           0 : static int py_srvsvc_NetShareInfo0_set_name(PyObject *py_obj, PyObject *value, void *closure)
    6957             : {
    6958           0 :         struct srvsvc_NetShareInfo0 *object = (struct srvsvc_NetShareInfo0 *)pytalloc_get_ptr(py_obj);
    6959           0 :         if (value == NULL) {
    6960           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
    6961           0 :                 return -1;
    6962             :         }
    6963           0 :         if (value == Py_None) {
    6964           0 :                 object->name = NULL;
    6965             :         } else {
    6966           0 :                 object->name = NULL;
    6967             :                 {
    6968             :                         const char *test_str;
    6969             :                         const char *talloc_str;
    6970           0 :                         PyObject *unicode = NULL;
    6971           0 :                         if (PyUnicode_Check(value)) {
    6972           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    6973           0 :                                 if (unicode == NULL) {
    6974           0 :                                         PyErr_NoMemory();
    6975           0 :                                         return -1;
    6976             :                                 }
    6977           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    6978           0 :                         } else if (PyBytes_Check(value)) {
    6979           0 :                                 test_str = PyBytes_AS_STRING(value);
    6980             :                         } else {
    6981           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    6982           0 :                                 return -1;
    6983             :                         }
    6984           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    6985           0 :                         if (unicode != NULL) {
    6986           0 :                                 Py_DECREF(unicode);
    6987             :                         }
    6988           0 :                         if (talloc_str == NULL) {
    6989           0 :                                 PyErr_NoMemory();
    6990           0 :                                 return -1;
    6991             :                         }
    6992           0 :                         object->name = talloc_str;
    6993             :                 }
    6994             :         }
    6995           0 :         return 0;
    6996             : }
    6997             : 
    6998             : static PyGetSetDef py_srvsvc_NetShareInfo0_getsetters[] = {
    6999             :         {
    7000             :                 .name = discard_const_p(char, "name"),
    7001             :                 .get = py_srvsvc_NetShareInfo0_get_name,
    7002             :                 .set = py_srvsvc_NetShareInfo0_set_name,
    7003             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    7004             :         },
    7005             :         { .name = NULL }
    7006             : };
    7007             : 
    7008           0 : static PyObject *py_srvsvc_NetShareInfo0_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    7009             : {
    7010           0 :         return pytalloc_new(struct srvsvc_NetShareInfo0, type);
    7011             : }
    7012             : 
    7013             : 
    7014             : static PyTypeObject srvsvc_NetShareInfo0_Type = {
    7015             :         PyVarObject_HEAD_INIT(NULL, 0)
    7016             :         .tp_name = "srvsvc.NetShareInfo0",
    7017             :         .tp_getset = py_srvsvc_NetShareInfo0_getsetters,
    7018             :         .tp_methods = NULL,
    7019             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    7020             :         .tp_new = py_srvsvc_NetShareInfo0_new,
    7021             : };
    7022             : 
    7023             : 
    7024           0 : static PyObject *py_srvsvc_NetShareCtr0_get_count(PyObject *obj, void *closure)
    7025             : {
    7026           0 :         struct srvsvc_NetShareCtr0 *object = (struct srvsvc_NetShareCtr0 *)pytalloc_get_ptr(obj);
    7027             :         PyObject *py_count;
    7028           0 :         py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
    7029           0 :         return py_count;
    7030             : }
    7031             : 
    7032           0 : static int py_srvsvc_NetShareCtr0_set_count(PyObject *py_obj, PyObject *value, void *closure)
    7033             : {
    7034           0 :         struct srvsvc_NetShareCtr0 *object = (struct srvsvc_NetShareCtr0 *)pytalloc_get_ptr(py_obj);
    7035           0 :         if (value == NULL) {
    7036           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
    7037           0 :                 return -1;
    7038             :         }
    7039             :         {
    7040           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
    7041           0 :                 if (PyLong_Check(value)) {
    7042             :                         unsigned long long test_var;
    7043           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7044           0 :                         if (PyErr_Occurred() != NULL) {
    7045           0 :                                 return -1;
    7046             :                         }
    7047           0 :                         if (test_var > uint_max) {
    7048           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7049             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7050           0 :                                 return -1;
    7051             :                         }
    7052           0 :                         object->count = test_var;
    7053             :                 } else {
    7054           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7055             :                           PyLong_Type.tp_name);
    7056           0 :                         return -1;
    7057             :                 }
    7058             :         }
    7059           0 :         return 0;
    7060             : }
    7061             : 
    7062           0 : static PyObject *py_srvsvc_NetShareCtr0_get_array(PyObject *obj, void *closure)
    7063             : {
    7064           0 :         struct srvsvc_NetShareCtr0 *object = (struct srvsvc_NetShareCtr0 *)pytalloc_get_ptr(obj);
    7065             :         PyObject *py_array;
    7066           0 :         if (object->array == NULL) {
    7067           0 :                 Py_RETURN_NONE;
    7068             :         }
    7069           0 :         if (object->array == NULL) {
    7070           0 :                 py_array = Py_None;
    7071           0 :                 Py_INCREF(py_array);
    7072             :         } else {
    7073           0 :                 py_array = PyList_New(object->count);
    7074           0 :                 if (py_array == NULL) {
    7075           0 :                         return NULL;
    7076             :                 }
    7077             :                 {
    7078             :                         int array_cntr_1;
    7079           0 :                         for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
    7080             :                                 PyObject *py_array_1;
    7081           0 :                                 py_array_1 = pytalloc_reference_ex(&srvsvc_NetShareInfo0_Type, object->array, &object->array[array_cntr_1]);
    7082           0 :                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
    7083             :                         }
    7084             :                 }
    7085             :         }
    7086           0 :         return py_array;
    7087             : }
    7088             : 
    7089           0 : static int py_srvsvc_NetShareCtr0_set_array(PyObject *py_obj, PyObject *value, void *closure)
    7090             : {
    7091           0 :         struct srvsvc_NetShareCtr0 *object = (struct srvsvc_NetShareCtr0 *)pytalloc_get_ptr(py_obj);
    7092           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
    7093           0 :         if (value == NULL) {
    7094           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
    7095           0 :                 return -1;
    7096             :         }
    7097           0 :         if (value == Py_None) {
    7098           0 :                 object->array = NULL;
    7099             :         } else {
    7100           0 :                 object->array = NULL;
    7101           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    7102             :                 {
    7103             :                         int array_cntr_1;
    7104           0 :                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
    7105           0 :                         if (!object->array) { return -1;; }
    7106           0 :                         talloc_set_name_const(object->array, "ARRAY: object->array");
    7107           0 :                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
    7108           0 :                                 if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
    7109           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
    7110           0 :                                         return -1;
    7111             :                                 }
    7112           0 :                                 PY_CHECK_TYPE(&srvsvc_NetShareInfo0_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
    7113           0 :                                 if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
    7114           0 :                                         PyErr_NoMemory();
    7115           0 :                                         return -1;
    7116             :                                 }
    7117           0 :                                 object->array[array_cntr_1] = *(struct srvsvc_NetShareInfo0 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
    7118             :                         }
    7119             :                 }
    7120             :         }
    7121           0 :         return 0;
    7122             : }
    7123             : 
    7124             : static PyGetSetDef py_srvsvc_NetShareCtr0_getsetters[] = {
    7125             :         {
    7126             :                 .name = discard_const_p(char, "count"),
    7127             :                 .get = py_srvsvc_NetShareCtr0_get_count,
    7128             :                 .set = py_srvsvc_NetShareCtr0_set_count,
    7129             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    7130             :         },
    7131             :         {
    7132             :                 .name = discard_const_p(char, "array"),
    7133             :                 .get = py_srvsvc_NetShareCtr0_get_array,
    7134             :                 .set = py_srvsvc_NetShareCtr0_set_array,
    7135             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetShareInfo0")
    7136             :         },
    7137             :         { .name = NULL }
    7138             : };
    7139             : 
    7140           0 : static PyObject *py_srvsvc_NetShareCtr0_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    7141             : {
    7142           0 :         return pytalloc_new(struct srvsvc_NetShareCtr0, type);
    7143             : }
    7144             : 
    7145             : 
    7146             : static PyTypeObject srvsvc_NetShareCtr0_Type = {
    7147             :         PyVarObject_HEAD_INIT(NULL, 0)
    7148             :         .tp_name = "srvsvc.NetShareCtr0",
    7149             :         .tp_getset = py_srvsvc_NetShareCtr0_getsetters,
    7150             :         .tp_methods = NULL,
    7151             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    7152             :         .tp_new = py_srvsvc_NetShareCtr0_new,
    7153             : };
    7154             : 
    7155             : 
    7156           0 : static PyObject *py_srvsvc_NetShareInfo1_get_name(PyObject *obj, void *closure)
    7157             : {
    7158           0 :         struct srvsvc_NetShareInfo1 *object = (struct srvsvc_NetShareInfo1 *)pytalloc_get_ptr(obj);
    7159             :         PyObject *py_name;
    7160           0 :         if (object->name == NULL) {
    7161           0 :                 Py_RETURN_NONE;
    7162             :         }
    7163           0 :         if (object->name == NULL) {
    7164           0 :                 py_name = Py_None;
    7165           0 :                 Py_INCREF(py_name);
    7166             :         } else {
    7167           0 :                 if (object->name == NULL) {
    7168           0 :                         py_name = Py_None;
    7169           0 :                         Py_INCREF(py_name);
    7170             :                 } else {
    7171           0 :                         py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
    7172             :                 }
    7173             :         }
    7174           0 :         return py_name;
    7175             : }
    7176             : 
    7177           0 : static int py_srvsvc_NetShareInfo1_set_name(PyObject *py_obj, PyObject *value, void *closure)
    7178             : {
    7179           0 :         struct srvsvc_NetShareInfo1 *object = (struct srvsvc_NetShareInfo1 *)pytalloc_get_ptr(py_obj);
    7180           0 :         if (value == NULL) {
    7181           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
    7182           0 :                 return -1;
    7183             :         }
    7184           0 :         if (value == Py_None) {
    7185           0 :                 object->name = NULL;
    7186             :         } else {
    7187           0 :                 object->name = NULL;
    7188             :                 {
    7189             :                         const char *test_str;
    7190             :                         const char *talloc_str;
    7191           0 :                         PyObject *unicode = NULL;
    7192           0 :                         if (PyUnicode_Check(value)) {
    7193           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7194           0 :                                 if (unicode == NULL) {
    7195           0 :                                         PyErr_NoMemory();
    7196           0 :                                         return -1;
    7197             :                                 }
    7198           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    7199           0 :                         } else if (PyBytes_Check(value)) {
    7200           0 :                                 test_str = PyBytes_AS_STRING(value);
    7201             :                         } else {
    7202           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7203           0 :                                 return -1;
    7204             :                         }
    7205           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7206           0 :                         if (unicode != NULL) {
    7207           0 :                                 Py_DECREF(unicode);
    7208             :                         }
    7209           0 :                         if (talloc_str == NULL) {
    7210           0 :                                 PyErr_NoMemory();
    7211           0 :                                 return -1;
    7212             :                         }
    7213           0 :                         object->name = talloc_str;
    7214             :                 }
    7215             :         }
    7216           0 :         return 0;
    7217             : }
    7218             : 
    7219           0 : static PyObject *py_srvsvc_NetShareInfo1_get_type(PyObject *obj, void *closure)
    7220             : {
    7221           0 :         struct srvsvc_NetShareInfo1 *object = (struct srvsvc_NetShareInfo1 *)pytalloc_get_ptr(obj);
    7222             :         PyObject *py_type;
    7223           0 :         py_type = PyLong_FromUnsignedLongLong((uint32_t)object->type);
    7224           0 :         return py_type;
    7225             : }
    7226             : 
    7227           0 : static int py_srvsvc_NetShareInfo1_set_type(PyObject *py_obj, PyObject *value, void *closure)
    7228             : {
    7229           0 :         struct srvsvc_NetShareInfo1 *object = (struct srvsvc_NetShareInfo1 *)pytalloc_get_ptr(py_obj);
    7230           0 :         if (value == NULL) {
    7231           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
    7232           0 :                 return -1;
    7233             :         }
    7234             :         {
    7235           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
    7236           0 :                 if (PyLong_Check(value)) {
    7237             :                         unsigned long long test_var;
    7238           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7239           0 :                         if (PyErr_Occurred() != NULL) {
    7240           0 :                                 return -1;
    7241             :                         }
    7242           0 :                         if (test_var > uint_max) {
    7243           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7244             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7245           0 :                                 return -1;
    7246             :                         }
    7247           0 :                         object->type = test_var;
    7248             :                 } else {
    7249           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7250             :                           PyLong_Type.tp_name);
    7251           0 :                         return -1;
    7252             :                 }
    7253             :         }
    7254           0 :         return 0;
    7255             : }
    7256             : 
    7257           0 : static PyObject *py_srvsvc_NetShareInfo1_get_comment(PyObject *obj, void *closure)
    7258             : {
    7259           0 :         struct srvsvc_NetShareInfo1 *object = (struct srvsvc_NetShareInfo1 *)pytalloc_get_ptr(obj);
    7260             :         PyObject *py_comment;
    7261           0 :         if (object->comment == NULL) {
    7262           0 :                 Py_RETURN_NONE;
    7263             :         }
    7264           0 :         if (object->comment == NULL) {
    7265           0 :                 py_comment = Py_None;
    7266           0 :                 Py_INCREF(py_comment);
    7267             :         } else {
    7268           0 :                 if (object->comment == NULL) {
    7269           0 :                         py_comment = Py_None;
    7270           0 :                         Py_INCREF(py_comment);
    7271             :                 } else {
    7272           0 :                         py_comment = PyUnicode_Decode(object->comment, strlen(object->comment), "utf-8", "ignore");
    7273             :                 }
    7274             :         }
    7275           0 :         return py_comment;
    7276             : }
    7277             : 
    7278           0 : static int py_srvsvc_NetShareInfo1_set_comment(PyObject *py_obj, PyObject *value, void *closure)
    7279             : {
    7280           0 :         struct srvsvc_NetShareInfo1 *object = (struct srvsvc_NetShareInfo1 *)pytalloc_get_ptr(py_obj);
    7281           0 :         if (value == NULL) {
    7282           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->comment");
    7283           0 :                 return -1;
    7284             :         }
    7285           0 :         if (value == Py_None) {
    7286           0 :                 object->comment = NULL;
    7287             :         } else {
    7288           0 :                 object->comment = NULL;
    7289             :                 {
    7290             :                         const char *test_str;
    7291             :                         const char *talloc_str;
    7292           0 :                         PyObject *unicode = NULL;
    7293           0 :                         if (PyUnicode_Check(value)) {
    7294           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7295           0 :                                 if (unicode == NULL) {
    7296           0 :                                         PyErr_NoMemory();
    7297           0 :                                         return -1;
    7298             :                                 }
    7299           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    7300           0 :                         } else if (PyBytes_Check(value)) {
    7301           0 :                                 test_str = PyBytes_AS_STRING(value);
    7302             :                         } else {
    7303           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7304           0 :                                 return -1;
    7305             :                         }
    7306           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7307           0 :                         if (unicode != NULL) {
    7308           0 :                                 Py_DECREF(unicode);
    7309             :                         }
    7310           0 :                         if (talloc_str == NULL) {
    7311           0 :                                 PyErr_NoMemory();
    7312           0 :                                 return -1;
    7313             :                         }
    7314           0 :                         object->comment = talloc_str;
    7315             :                 }
    7316             :         }
    7317           0 :         return 0;
    7318             : }
    7319             : 
    7320             : static PyGetSetDef py_srvsvc_NetShareInfo1_getsetters[] = {
    7321             :         {
    7322             :                 .name = discard_const_p(char, "name"),
    7323             :                 .get = py_srvsvc_NetShareInfo1_get_name,
    7324             :                 .set = py_srvsvc_NetShareInfo1_set_name,
    7325             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    7326             :         },
    7327             :         {
    7328             :                 .name = discard_const_p(char, "type"),
    7329             :                 .get = py_srvsvc_NetShareInfo1_get_type,
    7330             :                 .set = py_srvsvc_NetShareInfo1_set_type,
    7331             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_ShareType")
    7332             :         },
    7333             :         {
    7334             :                 .name = discard_const_p(char, "comment"),
    7335             :                 .get = py_srvsvc_NetShareInfo1_get_comment,
    7336             :                 .set = py_srvsvc_NetShareInfo1_set_comment,
    7337             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    7338             :         },
    7339             :         { .name = NULL }
    7340             : };
    7341             : 
    7342           0 : static PyObject *py_srvsvc_NetShareInfo1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    7343             : {
    7344           0 :         return pytalloc_new(struct srvsvc_NetShareInfo1, type);
    7345             : }
    7346             : 
    7347             : 
    7348             : static PyTypeObject srvsvc_NetShareInfo1_Type = {
    7349             :         PyVarObject_HEAD_INIT(NULL, 0)
    7350             :         .tp_name = "srvsvc.NetShareInfo1",
    7351             :         .tp_getset = py_srvsvc_NetShareInfo1_getsetters,
    7352             :         .tp_methods = NULL,
    7353             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    7354             :         .tp_new = py_srvsvc_NetShareInfo1_new,
    7355             : };
    7356             : 
    7357             : 
    7358           0 : static PyObject *py_srvsvc_NetShareCtr1_get_count(PyObject *obj, void *closure)
    7359             : {
    7360           0 :         struct srvsvc_NetShareCtr1 *object = (struct srvsvc_NetShareCtr1 *)pytalloc_get_ptr(obj);
    7361             :         PyObject *py_count;
    7362           0 :         py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
    7363           0 :         return py_count;
    7364             : }
    7365             : 
    7366           0 : static int py_srvsvc_NetShareCtr1_set_count(PyObject *py_obj, PyObject *value, void *closure)
    7367             : {
    7368           0 :         struct srvsvc_NetShareCtr1 *object = (struct srvsvc_NetShareCtr1 *)pytalloc_get_ptr(py_obj);
    7369           0 :         if (value == NULL) {
    7370           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
    7371           0 :                 return -1;
    7372             :         }
    7373             :         {
    7374           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
    7375           0 :                 if (PyLong_Check(value)) {
    7376             :                         unsigned long long test_var;
    7377           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7378           0 :                         if (PyErr_Occurred() != NULL) {
    7379           0 :                                 return -1;
    7380             :                         }
    7381           0 :                         if (test_var > uint_max) {
    7382           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7383             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7384           0 :                                 return -1;
    7385             :                         }
    7386           0 :                         object->count = test_var;
    7387             :                 } else {
    7388           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7389             :                           PyLong_Type.tp_name);
    7390           0 :                         return -1;
    7391             :                 }
    7392             :         }
    7393           0 :         return 0;
    7394             : }
    7395             : 
    7396           0 : static PyObject *py_srvsvc_NetShareCtr1_get_array(PyObject *obj, void *closure)
    7397             : {
    7398           0 :         struct srvsvc_NetShareCtr1 *object = (struct srvsvc_NetShareCtr1 *)pytalloc_get_ptr(obj);
    7399             :         PyObject *py_array;
    7400           0 :         if (object->array == NULL) {
    7401           0 :                 Py_RETURN_NONE;
    7402             :         }
    7403           0 :         if (object->array == NULL) {
    7404           0 :                 py_array = Py_None;
    7405           0 :                 Py_INCREF(py_array);
    7406             :         } else {
    7407           0 :                 py_array = PyList_New(object->count);
    7408           0 :                 if (py_array == NULL) {
    7409           0 :                         return NULL;
    7410             :                 }
    7411             :                 {
    7412             :                         int array_cntr_1;
    7413           0 :                         for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
    7414             :                                 PyObject *py_array_1;
    7415           0 :                                 py_array_1 = pytalloc_reference_ex(&srvsvc_NetShareInfo1_Type, object->array, &object->array[array_cntr_1]);
    7416           0 :                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
    7417             :                         }
    7418             :                 }
    7419             :         }
    7420           0 :         return py_array;
    7421             : }
    7422             : 
    7423           0 : static int py_srvsvc_NetShareCtr1_set_array(PyObject *py_obj, PyObject *value, void *closure)
    7424             : {
    7425           0 :         struct srvsvc_NetShareCtr1 *object = (struct srvsvc_NetShareCtr1 *)pytalloc_get_ptr(py_obj);
    7426           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
    7427           0 :         if (value == NULL) {
    7428           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
    7429           0 :                 return -1;
    7430             :         }
    7431           0 :         if (value == Py_None) {
    7432           0 :                 object->array = NULL;
    7433             :         } else {
    7434           0 :                 object->array = NULL;
    7435           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    7436             :                 {
    7437             :                         int array_cntr_1;
    7438           0 :                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
    7439           0 :                         if (!object->array) { return -1;; }
    7440           0 :                         talloc_set_name_const(object->array, "ARRAY: object->array");
    7441           0 :                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
    7442           0 :                                 if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
    7443           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
    7444           0 :                                         return -1;
    7445             :                                 }
    7446           0 :                                 PY_CHECK_TYPE(&srvsvc_NetShareInfo1_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
    7447           0 :                                 if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
    7448           0 :                                         PyErr_NoMemory();
    7449           0 :                                         return -1;
    7450             :                                 }
    7451           0 :                                 object->array[array_cntr_1] = *(struct srvsvc_NetShareInfo1 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
    7452             :                         }
    7453             :                 }
    7454             :         }
    7455           0 :         return 0;
    7456             : }
    7457             : 
    7458             : static PyGetSetDef py_srvsvc_NetShareCtr1_getsetters[] = {
    7459             :         {
    7460             :                 .name = discard_const_p(char, "count"),
    7461             :                 .get = py_srvsvc_NetShareCtr1_get_count,
    7462             :                 .set = py_srvsvc_NetShareCtr1_set_count,
    7463             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    7464             :         },
    7465             :         {
    7466             :                 .name = discard_const_p(char, "array"),
    7467             :                 .get = py_srvsvc_NetShareCtr1_get_array,
    7468             :                 .set = py_srvsvc_NetShareCtr1_set_array,
    7469             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetShareInfo1")
    7470             :         },
    7471             :         { .name = NULL }
    7472             : };
    7473             : 
    7474           0 : static PyObject *py_srvsvc_NetShareCtr1_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    7475             : {
    7476           0 :         return pytalloc_new(struct srvsvc_NetShareCtr1, type);
    7477             : }
    7478             : 
    7479             : 
    7480             : static PyTypeObject srvsvc_NetShareCtr1_Type = {
    7481             :         PyVarObject_HEAD_INIT(NULL, 0)
    7482             :         .tp_name = "srvsvc.NetShareCtr1",
    7483             :         .tp_getset = py_srvsvc_NetShareCtr1_getsetters,
    7484             :         .tp_methods = NULL,
    7485             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    7486             :         .tp_new = py_srvsvc_NetShareCtr1_new,
    7487             : };
    7488             : 
    7489             : 
    7490           0 : static PyObject *py_srvsvc_NetShareInfo2_get_name(PyObject *obj, void *closure)
    7491             : {
    7492           0 :         struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(obj);
    7493             :         PyObject *py_name;
    7494           0 :         if (object->name == NULL) {
    7495           0 :                 Py_RETURN_NONE;
    7496             :         }
    7497           0 :         if (object->name == NULL) {
    7498           0 :                 py_name = Py_None;
    7499           0 :                 Py_INCREF(py_name);
    7500             :         } else {
    7501           0 :                 if (object->name == NULL) {
    7502           0 :                         py_name = Py_None;
    7503           0 :                         Py_INCREF(py_name);
    7504             :                 } else {
    7505           0 :                         py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
    7506             :                 }
    7507             :         }
    7508           0 :         return py_name;
    7509             : }
    7510             : 
    7511           0 : static int py_srvsvc_NetShareInfo2_set_name(PyObject *py_obj, PyObject *value, void *closure)
    7512             : {
    7513           0 :         struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(py_obj);
    7514           0 :         if (value == NULL) {
    7515           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
    7516           0 :                 return -1;
    7517             :         }
    7518           0 :         if (value == Py_None) {
    7519           0 :                 object->name = NULL;
    7520             :         } else {
    7521           0 :                 object->name = NULL;
    7522             :                 {
    7523             :                         const char *test_str;
    7524             :                         const char *talloc_str;
    7525           0 :                         PyObject *unicode = NULL;
    7526           0 :                         if (PyUnicode_Check(value)) {
    7527           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7528           0 :                                 if (unicode == NULL) {
    7529           0 :                                         PyErr_NoMemory();
    7530           0 :                                         return -1;
    7531             :                                 }
    7532           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    7533           0 :                         } else if (PyBytes_Check(value)) {
    7534           0 :                                 test_str = PyBytes_AS_STRING(value);
    7535             :                         } else {
    7536           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7537           0 :                                 return -1;
    7538             :                         }
    7539           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7540           0 :                         if (unicode != NULL) {
    7541           0 :                                 Py_DECREF(unicode);
    7542             :                         }
    7543           0 :                         if (talloc_str == NULL) {
    7544           0 :                                 PyErr_NoMemory();
    7545           0 :                                 return -1;
    7546             :                         }
    7547           0 :                         object->name = talloc_str;
    7548             :                 }
    7549             :         }
    7550           0 :         return 0;
    7551             : }
    7552             : 
    7553           0 : static PyObject *py_srvsvc_NetShareInfo2_get_type(PyObject *obj, void *closure)
    7554             : {
    7555           0 :         struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(obj);
    7556             :         PyObject *py_type;
    7557           0 :         py_type = PyLong_FromUnsignedLongLong((uint32_t)object->type);
    7558           0 :         return py_type;
    7559             : }
    7560             : 
    7561           0 : static int py_srvsvc_NetShareInfo2_set_type(PyObject *py_obj, PyObject *value, void *closure)
    7562             : {
    7563           0 :         struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(py_obj);
    7564           0 :         if (value == NULL) {
    7565           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
    7566           0 :                 return -1;
    7567             :         }
    7568             :         {
    7569           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
    7570           0 :                 if (PyLong_Check(value)) {
    7571             :                         unsigned long long test_var;
    7572           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7573           0 :                         if (PyErr_Occurred() != NULL) {
    7574           0 :                                 return -1;
    7575             :                         }
    7576           0 :                         if (test_var > uint_max) {
    7577           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7578             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7579           0 :                                 return -1;
    7580             :                         }
    7581           0 :                         object->type = test_var;
    7582             :                 } else {
    7583           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7584             :                           PyLong_Type.tp_name);
    7585           0 :                         return -1;
    7586             :                 }
    7587             :         }
    7588           0 :         return 0;
    7589             : }
    7590             : 
    7591           0 : static PyObject *py_srvsvc_NetShareInfo2_get_comment(PyObject *obj, void *closure)
    7592             : {
    7593           0 :         struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(obj);
    7594             :         PyObject *py_comment;
    7595           0 :         if (object->comment == NULL) {
    7596           0 :                 Py_RETURN_NONE;
    7597             :         }
    7598           0 :         if (object->comment == NULL) {
    7599           0 :                 py_comment = Py_None;
    7600           0 :                 Py_INCREF(py_comment);
    7601             :         } else {
    7602           0 :                 if (object->comment == NULL) {
    7603           0 :                         py_comment = Py_None;
    7604           0 :                         Py_INCREF(py_comment);
    7605             :                 } else {
    7606           0 :                         py_comment = PyUnicode_Decode(object->comment, strlen(object->comment), "utf-8", "ignore");
    7607             :                 }
    7608             :         }
    7609           0 :         return py_comment;
    7610             : }
    7611             : 
    7612           0 : static int py_srvsvc_NetShareInfo2_set_comment(PyObject *py_obj, PyObject *value, void *closure)
    7613             : {
    7614           0 :         struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(py_obj);
    7615           0 :         if (value == NULL) {
    7616           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->comment");
    7617           0 :                 return -1;
    7618             :         }
    7619           0 :         if (value == Py_None) {
    7620           0 :                 object->comment = NULL;
    7621             :         } else {
    7622           0 :                 object->comment = NULL;
    7623             :                 {
    7624             :                         const char *test_str;
    7625             :                         const char *talloc_str;
    7626           0 :                         PyObject *unicode = NULL;
    7627           0 :                         if (PyUnicode_Check(value)) {
    7628           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7629           0 :                                 if (unicode == NULL) {
    7630           0 :                                         PyErr_NoMemory();
    7631           0 :                                         return -1;
    7632             :                                 }
    7633           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    7634           0 :                         } else if (PyBytes_Check(value)) {
    7635           0 :                                 test_str = PyBytes_AS_STRING(value);
    7636             :                         } else {
    7637           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7638           0 :                                 return -1;
    7639             :                         }
    7640           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7641           0 :                         if (unicode != NULL) {
    7642           0 :                                 Py_DECREF(unicode);
    7643             :                         }
    7644           0 :                         if (talloc_str == NULL) {
    7645           0 :                                 PyErr_NoMemory();
    7646           0 :                                 return -1;
    7647             :                         }
    7648           0 :                         object->comment = talloc_str;
    7649             :                 }
    7650             :         }
    7651           0 :         return 0;
    7652             : }
    7653             : 
    7654           0 : static PyObject *py_srvsvc_NetShareInfo2_get_permissions(PyObject *obj, void *closure)
    7655             : {
    7656           0 :         struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(obj);
    7657             :         PyObject *py_permissions;
    7658           0 :         py_permissions = PyLong_FromUnsignedLongLong((uint32_t)object->permissions);
    7659           0 :         return py_permissions;
    7660             : }
    7661             : 
    7662           0 : static int py_srvsvc_NetShareInfo2_set_permissions(PyObject *py_obj, PyObject *value, void *closure)
    7663             : {
    7664           0 :         struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(py_obj);
    7665           0 :         if (value == NULL) {
    7666           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->permissions");
    7667           0 :                 return -1;
    7668             :         }
    7669             :         {
    7670           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->permissions));
    7671           0 :                 if (PyLong_Check(value)) {
    7672             :                         unsigned long long test_var;
    7673           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7674           0 :                         if (PyErr_Occurred() != NULL) {
    7675           0 :                                 return -1;
    7676             :                         }
    7677           0 :                         if (test_var > uint_max) {
    7678           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7679             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7680           0 :                                 return -1;
    7681             :                         }
    7682           0 :                         object->permissions = test_var;
    7683             :                 } else {
    7684           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7685             :                           PyLong_Type.tp_name);
    7686           0 :                         return -1;
    7687             :                 }
    7688             :         }
    7689           0 :         return 0;
    7690             : }
    7691             : 
    7692           0 : static PyObject *py_srvsvc_NetShareInfo2_get_max_users(PyObject *obj, void *closure)
    7693             : {
    7694           0 :         struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(obj);
    7695             :         PyObject *py_max_users;
    7696           0 :         py_max_users = PyLong_FromUnsignedLongLong((uint32_t)object->max_users);
    7697           0 :         return py_max_users;
    7698             : }
    7699             : 
    7700           0 : static int py_srvsvc_NetShareInfo2_set_max_users(PyObject *py_obj, PyObject *value, void *closure)
    7701             : {
    7702           0 :         struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(py_obj);
    7703           0 :         if (value == NULL) {
    7704           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_users");
    7705           0 :                 return -1;
    7706             :         }
    7707             :         {
    7708           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_users));
    7709           0 :                 if (PyLong_Check(value)) {
    7710             :                         unsigned long long test_var;
    7711           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7712           0 :                         if (PyErr_Occurred() != NULL) {
    7713           0 :                                 return -1;
    7714             :                         }
    7715           0 :                         if (test_var > uint_max) {
    7716           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7717             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7718           0 :                                 return -1;
    7719             :                         }
    7720           0 :                         object->max_users = test_var;
    7721             :                 } else {
    7722           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7723             :                           PyLong_Type.tp_name);
    7724           0 :                         return -1;
    7725             :                 }
    7726             :         }
    7727           0 :         return 0;
    7728             : }
    7729             : 
    7730           0 : static PyObject *py_srvsvc_NetShareInfo2_get_current_users(PyObject *obj, void *closure)
    7731             : {
    7732           0 :         struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(obj);
    7733             :         PyObject *py_current_users;
    7734           0 :         py_current_users = PyLong_FromUnsignedLongLong((uint32_t)object->current_users);
    7735           0 :         return py_current_users;
    7736             : }
    7737             : 
    7738           0 : static int py_srvsvc_NetShareInfo2_set_current_users(PyObject *py_obj, PyObject *value, void *closure)
    7739             : {
    7740           0 :         struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(py_obj);
    7741           0 :         if (value == NULL) {
    7742           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->current_users");
    7743           0 :                 return -1;
    7744             :         }
    7745             :         {
    7746           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->current_users));
    7747           0 :                 if (PyLong_Check(value)) {
    7748             :                         unsigned long long test_var;
    7749           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7750           0 :                         if (PyErr_Occurred() != NULL) {
    7751           0 :                                 return -1;
    7752             :                         }
    7753           0 :                         if (test_var > uint_max) {
    7754           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7755             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7756           0 :                                 return -1;
    7757             :                         }
    7758           0 :                         object->current_users = test_var;
    7759             :                 } else {
    7760           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7761             :                           PyLong_Type.tp_name);
    7762           0 :                         return -1;
    7763             :                 }
    7764             :         }
    7765           0 :         return 0;
    7766             : }
    7767             : 
    7768           0 : static PyObject *py_srvsvc_NetShareInfo2_get_path(PyObject *obj, void *closure)
    7769             : {
    7770           0 :         struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(obj);
    7771             :         PyObject *py_path;
    7772           0 :         if (object->path == NULL) {
    7773           0 :                 Py_RETURN_NONE;
    7774             :         }
    7775           0 :         if (object->path == NULL) {
    7776           0 :                 py_path = Py_None;
    7777           0 :                 Py_INCREF(py_path);
    7778             :         } else {
    7779           0 :                 if (object->path == NULL) {
    7780           0 :                         py_path = Py_None;
    7781           0 :                         Py_INCREF(py_path);
    7782             :                 } else {
    7783           0 :                         py_path = PyUnicode_Decode(object->path, strlen(object->path), "utf-8", "ignore");
    7784             :                 }
    7785             :         }
    7786           0 :         return py_path;
    7787             : }
    7788             : 
    7789           0 : static int py_srvsvc_NetShareInfo2_set_path(PyObject *py_obj, PyObject *value, void *closure)
    7790             : {
    7791           0 :         struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(py_obj);
    7792           0 :         if (value == NULL) {
    7793           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->path");
    7794           0 :                 return -1;
    7795             :         }
    7796           0 :         if (value == Py_None) {
    7797           0 :                 object->path = NULL;
    7798             :         } else {
    7799           0 :                 object->path = NULL;
    7800             :                 {
    7801             :                         const char *test_str;
    7802             :                         const char *talloc_str;
    7803           0 :                         PyObject *unicode = NULL;
    7804           0 :                         if (PyUnicode_Check(value)) {
    7805           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7806           0 :                                 if (unicode == NULL) {
    7807           0 :                                         PyErr_NoMemory();
    7808           0 :                                         return -1;
    7809             :                                 }
    7810           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    7811           0 :                         } else if (PyBytes_Check(value)) {
    7812           0 :                                 test_str = PyBytes_AS_STRING(value);
    7813             :                         } else {
    7814           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7815           0 :                                 return -1;
    7816             :                         }
    7817           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7818           0 :                         if (unicode != NULL) {
    7819           0 :                                 Py_DECREF(unicode);
    7820             :                         }
    7821           0 :                         if (talloc_str == NULL) {
    7822           0 :                                 PyErr_NoMemory();
    7823           0 :                                 return -1;
    7824             :                         }
    7825           0 :                         object->path = talloc_str;
    7826             :                 }
    7827             :         }
    7828           0 :         return 0;
    7829             : }
    7830             : 
    7831           0 : static PyObject *py_srvsvc_NetShareInfo2_get_password(PyObject *obj, void *closure)
    7832             : {
    7833           0 :         struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(obj);
    7834             :         PyObject *py_password;
    7835           0 :         if (object->password == NULL) {
    7836           0 :                 Py_RETURN_NONE;
    7837             :         }
    7838           0 :         if (object->password == NULL) {
    7839           0 :                 py_password = Py_None;
    7840           0 :                 Py_INCREF(py_password);
    7841             :         } else {
    7842           0 :                 if (object->password == NULL) {
    7843           0 :                         py_password = Py_None;
    7844           0 :                         Py_INCREF(py_password);
    7845             :                 } else {
    7846           0 :                         py_password = PyUnicode_Decode(object->password, strlen(object->password), "utf-8", "ignore");
    7847             :                 }
    7848             :         }
    7849           0 :         return py_password;
    7850             : }
    7851             : 
    7852           0 : static int py_srvsvc_NetShareInfo2_set_password(PyObject *py_obj, PyObject *value, void *closure)
    7853             : {
    7854           0 :         struct srvsvc_NetShareInfo2 *object = (struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(py_obj);
    7855           0 :         if (value == NULL) {
    7856           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password");
    7857           0 :                 return -1;
    7858             :         }
    7859           0 :         if (value == Py_None) {
    7860           0 :                 object->password = NULL;
    7861             :         } else {
    7862           0 :                 object->password = NULL;
    7863             :                 {
    7864             :                         const char *test_str;
    7865             :                         const char *talloc_str;
    7866           0 :                         PyObject *unicode = NULL;
    7867           0 :                         if (PyUnicode_Check(value)) {
    7868           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    7869           0 :                                 if (unicode == NULL) {
    7870           0 :                                         PyErr_NoMemory();
    7871           0 :                                         return -1;
    7872             :                                 }
    7873           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    7874           0 :                         } else if (PyBytes_Check(value)) {
    7875           0 :                                 test_str = PyBytes_AS_STRING(value);
    7876             :                         } else {
    7877           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    7878           0 :                                 return -1;
    7879             :                         }
    7880           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    7881           0 :                         if (unicode != NULL) {
    7882           0 :                                 Py_DECREF(unicode);
    7883             :                         }
    7884           0 :                         if (talloc_str == NULL) {
    7885           0 :                                 PyErr_NoMemory();
    7886           0 :                                 return -1;
    7887             :                         }
    7888           0 :                         object->password = talloc_str;
    7889             :                 }
    7890             :         }
    7891           0 :         return 0;
    7892             : }
    7893             : 
    7894             : static PyGetSetDef py_srvsvc_NetShareInfo2_getsetters[] = {
    7895             :         {
    7896             :                 .name = discard_const_p(char, "name"),
    7897             :                 .get = py_srvsvc_NetShareInfo2_get_name,
    7898             :                 .set = py_srvsvc_NetShareInfo2_set_name,
    7899             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    7900             :         },
    7901             :         {
    7902             :                 .name = discard_const_p(char, "type"),
    7903             :                 .get = py_srvsvc_NetShareInfo2_get_type,
    7904             :                 .set = py_srvsvc_NetShareInfo2_set_type,
    7905             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_ShareType")
    7906             :         },
    7907             :         {
    7908             :                 .name = discard_const_p(char, "comment"),
    7909             :                 .get = py_srvsvc_NetShareInfo2_get_comment,
    7910             :                 .set = py_srvsvc_NetShareInfo2_set_comment,
    7911             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    7912             :         },
    7913             :         {
    7914             :                 .name = discard_const_p(char, "permissions"),
    7915             :                 .get = py_srvsvc_NetShareInfo2_get_permissions,
    7916             :                 .set = py_srvsvc_NetShareInfo2_set_permissions,
    7917             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    7918             :         },
    7919             :         {
    7920             :                 .name = discard_const_p(char, "max_users"),
    7921             :                 .get = py_srvsvc_NetShareInfo2_get_max_users,
    7922             :                 .set = py_srvsvc_NetShareInfo2_set_max_users,
    7923             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    7924             :         },
    7925             :         {
    7926             :                 .name = discard_const_p(char, "current_users"),
    7927             :                 .get = py_srvsvc_NetShareInfo2_get_current_users,
    7928             :                 .set = py_srvsvc_NetShareInfo2_set_current_users,
    7929             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    7930             :         },
    7931             :         {
    7932             :                 .name = discard_const_p(char, "path"),
    7933             :                 .get = py_srvsvc_NetShareInfo2_get_path,
    7934             :                 .set = py_srvsvc_NetShareInfo2_set_path,
    7935             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    7936             :         },
    7937             :         {
    7938             :                 .name = discard_const_p(char, "password"),
    7939             :                 .get = py_srvsvc_NetShareInfo2_get_password,
    7940             :                 .set = py_srvsvc_NetShareInfo2_set_password,
    7941             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    7942             :         },
    7943             :         { .name = NULL }
    7944             : };
    7945             : 
    7946           0 : static PyObject *py_srvsvc_NetShareInfo2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    7947             : {
    7948           0 :         return pytalloc_new(struct srvsvc_NetShareInfo2, type);
    7949             : }
    7950             : 
    7951             : 
    7952             : static PyTypeObject srvsvc_NetShareInfo2_Type = {
    7953             :         PyVarObject_HEAD_INIT(NULL, 0)
    7954             :         .tp_name = "srvsvc.NetShareInfo2",
    7955             :         .tp_getset = py_srvsvc_NetShareInfo2_getsetters,
    7956             :         .tp_methods = NULL,
    7957             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    7958             :         .tp_new = py_srvsvc_NetShareInfo2_new,
    7959             : };
    7960             : 
    7961             : 
    7962           0 : static PyObject *py_srvsvc_NetShareCtr2_get_count(PyObject *obj, void *closure)
    7963             : {
    7964           0 :         struct srvsvc_NetShareCtr2 *object = (struct srvsvc_NetShareCtr2 *)pytalloc_get_ptr(obj);
    7965             :         PyObject *py_count;
    7966           0 :         py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
    7967           0 :         return py_count;
    7968             : }
    7969             : 
    7970           0 : static int py_srvsvc_NetShareCtr2_set_count(PyObject *py_obj, PyObject *value, void *closure)
    7971             : {
    7972           0 :         struct srvsvc_NetShareCtr2 *object = (struct srvsvc_NetShareCtr2 *)pytalloc_get_ptr(py_obj);
    7973           0 :         if (value == NULL) {
    7974           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
    7975           0 :                 return -1;
    7976             :         }
    7977             :         {
    7978           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
    7979           0 :                 if (PyLong_Check(value)) {
    7980             :                         unsigned long long test_var;
    7981           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    7982           0 :                         if (PyErr_Occurred() != NULL) {
    7983           0 :                                 return -1;
    7984             :                         }
    7985           0 :                         if (test_var > uint_max) {
    7986           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    7987             :                                   PyLong_Type.tp_name, uint_max, test_var);
    7988           0 :                                 return -1;
    7989             :                         }
    7990           0 :                         object->count = test_var;
    7991             :                 } else {
    7992           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    7993             :                           PyLong_Type.tp_name);
    7994           0 :                         return -1;
    7995             :                 }
    7996             :         }
    7997           0 :         return 0;
    7998             : }
    7999             : 
    8000           0 : static PyObject *py_srvsvc_NetShareCtr2_get_array(PyObject *obj, void *closure)
    8001             : {
    8002           0 :         struct srvsvc_NetShareCtr2 *object = (struct srvsvc_NetShareCtr2 *)pytalloc_get_ptr(obj);
    8003             :         PyObject *py_array;
    8004           0 :         if (object->array == NULL) {
    8005           0 :                 Py_RETURN_NONE;
    8006             :         }
    8007           0 :         if (object->array == NULL) {
    8008           0 :                 py_array = Py_None;
    8009           0 :                 Py_INCREF(py_array);
    8010             :         } else {
    8011           0 :                 py_array = PyList_New(object->count);
    8012           0 :                 if (py_array == NULL) {
    8013           0 :                         return NULL;
    8014             :                 }
    8015             :                 {
    8016             :                         int array_cntr_1;
    8017           0 :                         for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
    8018             :                                 PyObject *py_array_1;
    8019           0 :                                 py_array_1 = pytalloc_reference_ex(&srvsvc_NetShareInfo2_Type, object->array, &object->array[array_cntr_1]);
    8020           0 :                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
    8021             :                         }
    8022             :                 }
    8023             :         }
    8024           0 :         return py_array;
    8025             : }
    8026             : 
    8027           0 : static int py_srvsvc_NetShareCtr2_set_array(PyObject *py_obj, PyObject *value, void *closure)
    8028             : {
    8029           0 :         struct srvsvc_NetShareCtr2 *object = (struct srvsvc_NetShareCtr2 *)pytalloc_get_ptr(py_obj);
    8030           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
    8031           0 :         if (value == NULL) {
    8032           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
    8033           0 :                 return -1;
    8034             :         }
    8035           0 :         if (value == Py_None) {
    8036           0 :                 object->array = NULL;
    8037             :         } else {
    8038           0 :                 object->array = NULL;
    8039           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    8040             :                 {
    8041             :                         int array_cntr_1;
    8042           0 :                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
    8043           0 :                         if (!object->array) { return -1;; }
    8044           0 :                         talloc_set_name_const(object->array, "ARRAY: object->array");
    8045           0 :                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
    8046           0 :                                 if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
    8047           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
    8048           0 :                                         return -1;
    8049             :                                 }
    8050           0 :                                 PY_CHECK_TYPE(&srvsvc_NetShareInfo2_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
    8051           0 :                                 if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
    8052           0 :                                         PyErr_NoMemory();
    8053           0 :                                         return -1;
    8054             :                                 }
    8055           0 :                                 object->array[array_cntr_1] = *(struct srvsvc_NetShareInfo2 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
    8056             :                         }
    8057             :                 }
    8058             :         }
    8059           0 :         return 0;
    8060             : }
    8061             : 
    8062             : static PyGetSetDef py_srvsvc_NetShareCtr2_getsetters[] = {
    8063             :         {
    8064             :                 .name = discard_const_p(char, "count"),
    8065             :                 .get = py_srvsvc_NetShareCtr2_get_count,
    8066             :                 .set = py_srvsvc_NetShareCtr2_set_count,
    8067             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    8068             :         },
    8069             :         {
    8070             :                 .name = discard_const_p(char, "array"),
    8071             :                 .get = py_srvsvc_NetShareCtr2_get_array,
    8072             :                 .set = py_srvsvc_NetShareCtr2_set_array,
    8073             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetShareInfo2")
    8074             :         },
    8075             :         { .name = NULL }
    8076             : };
    8077             : 
    8078           0 : static PyObject *py_srvsvc_NetShareCtr2_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    8079             : {
    8080           0 :         return pytalloc_new(struct srvsvc_NetShareCtr2, type);
    8081             : }
    8082             : 
    8083             : 
    8084             : static PyTypeObject srvsvc_NetShareCtr2_Type = {
    8085             :         PyVarObject_HEAD_INIT(NULL, 0)
    8086             :         .tp_name = "srvsvc.NetShareCtr2",
    8087             :         .tp_getset = py_srvsvc_NetShareCtr2_getsetters,
    8088             :         .tp_methods = NULL,
    8089             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    8090             :         .tp_new = py_srvsvc_NetShareCtr2_new,
    8091             : };
    8092             : 
    8093             : 
    8094           0 : static PyObject *py_srvsvc_NetShareInfo501_get_name(PyObject *obj, void *closure)
    8095             : {
    8096           0 :         struct srvsvc_NetShareInfo501 *object = (struct srvsvc_NetShareInfo501 *)pytalloc_get_ptr(obj);
    8097             :         PyObject *py_name;
    8098           0 :         if (object->name == NULL) {
    8099           0 :                 Py_RETURN_NONE;
    8100             :         }
    8101           0 :         if (object->name == NULL) {
    8102           0 :                 py_name = Py_None;
    8103           0 :                 Py_INCREF(py_name);
    8104             :         } else {
    8105           0 :                 if (object->name == NULL) {
    8106           0 :                         py_name = Py_None;
    8107           0 :                         Py_INCREF(py_name);
    8108             :                 } else {
    8109           0 :                         py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
    8110             :                 }
    8111             :         }
    8112           0 :         return py_name;
    8113             : }
    8114             : 
    8115           0 : static int py_srvsvc_NetShareInfo501_set_name(PyObject *py_obj, PyObject *value, void *closure)
    8116             : {
    8117           0 :         struct srvsvc_NetShareInfo501 *object = (struct srvsvc_NetShareInfo501 *)pytalloc_get_ptr(py_obj);
    8118           0 :         if (value == NULL) {
    8119           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
    8120           0 :                 return -1;
    8121             :         }
    8122           0 :         if (value == Py_None) {
    8123           0 :                 object->name = NULL;
    8124             :         } else {
    8125           0 :                 object->name = NULL;
    8126             :                 {
    8127             :                         const char *test_str;
    8128             :                         const char *talloc_str;
    8129           0 :                         PyObject *unicode = NULL;
    8130           0 :                         if (PyUnicode_Check(value)) {
    8131           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    8132           0 :                                 if (unicode == NULL) {
    8133           0 :                                         PyErr_NoMemory();
    8134           0 :                                         return -1;
    8135             :                                 }
    8136           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    8137           0 :                         } else if (PyBytes_Check(value)) {
    8138           0 :                                 test_str = PyBytes_AS_STRING(value);
    8139             :                         } else {
    8140           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    8141           0 :                                 return -1;
    8142             :                         }
    8143           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    8144           0 :                         if (unicode != NULL) {
    8145           0 :                                 Py_DECREF(unicode);
    8146             :                         }
    8147           0 :                         if (talloc_str == NULL) {
    8148           0 :                                 PyErr_NoMemory();
    8149           0 :                                 return -1;
    8150             :                         }
    8151           0 :                         object->name = talloc_str;
    8152             :                 }
    8153             :         }
    8154           0 :         return 0;
    8155             : }
    8156             : 
    8157           0 : static PyObject *py_srvsvc_NetShareInfo501_get_type(PyObject *obj, void *closure)
    8158             : {
    8159           0 :         struct srvsvc_NetShareInfo501 *object = (struct srvsvc_NetShareInfo501 *)pytalloc_get_ptr(obj);
    8160             :         PyObject *py_type;
    8161           0 :         py_type = PyLong_FromUnsignedLongLong((uint32_t)object->type);
    8162           0 :         return py_type;
    8163             : }
    8164             : 
    8165           0 : static int py_srvsvc_NetShareInfo501_set_type(PyObject *py_obj, PyObject *value, void *closure)
    8166             : {
    8167           0 :         struct srvsvc_NetShareInfo501 *object = (struct srvsvc_NetShareInfo501 *)pytalloc_get_ptr(py_obj);
    8168           0 :         if (value == NULL) {
    8169           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
    8170           0 :                 return -1;
    8171             :         }
    8172             :         {
    8173           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
    8174           0 :                 if (PyLong_Check(value)) {
    8175             :                         unsigned long long test_var;
    8176           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8177           0 :                         if (PyErr_Occurred() != NULL) {
    8178           0 :                                 return -1;
    8179             :                         }
    8180           0 :                         if (test_var > uint_max) {
    8181           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8182             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8183           0 :                                 return -1;
    8184             :                         }
    8185           0 :                         object->type = test_var;
    8186             :                 } else {
    8187           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8188             :                           PyLong_Type.tp_name);
    8189           0 :                         return -1;
    8190             :                 }
    8191             :         }
    8192           0 :         return 0;
    8193             : }
    8194             : 
    8195           0 : static PyObject *py_srvsvc_NetShareInfo501_get_comment(PyObject *obj, void *closure)
    8196             : {
    8197           0 :         struct srvsvc_NetShareInfo501 *object = (struct srvsvc_NetShareInfo501 *)pytalloc_get_ptr(obj);
    8198             :         PyObject *py_comment;
    8199           0 :         if (object->comment == NULL) {
    8200           0 :                 Py_RETURN_NONE;
    8201             :         }
    8202           0 :         if (object->comment == NULL) {
    8203           0 :                 py_comment = Py_None;
    8204           0 :                 Py_INCREF(py_comment);
    8205             :         } else {
    8206           0 :                 if (object->comment == NULL) {
    8207           0 :                         py_comment = Py_None;
    8208           0 :                         Py_INCREF(py_comment);
    8209             :                 } else {
    8210           0 :                         py_comment = PyUnicode_Decode(object->comment, strlen(object->comment), "utf-8", "ignore");
    8211             :                 }
    8212             :         }
    8213           0 :         return py_comment;
    8214             : }
    8215             : 
    8216           0 : static int py_srvsvc_NetShareInfo501_set_comment(PyObject *py_obj, PyObject *value, void *closure)
    8217             : {
    8218           0 :         struct srvsvc_NetShareInfo501 *object = (struct srvsvc_NetShareInfo501 *)pytalloc_get_ptr(py_obj);
    8219           0 :         if (value == NULL) {
    8220           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->comment");
    8221           0 :                 return -1;
    8222             :         }
    8223           0 :         if (value == Py_None) {
    8224           0 :                 object->comment = NULL;
    8225             :         } else {
    8226           0 :                 object->comment = NULL;
    8227             :                 {
    8228             :                         const char *test_str;
    8229             :                         const char *talloc_str;
    8230           0 :                         PyObject *unicode = NULL;
    8231           0 :                         if (PyUnicode_Check(value)) {
    8232           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    8233           0 :                                 if (unicode == NULL) {
    8234           0 :                                         PyErr_NoMemory();
    8235           0 :                                         return -1;
    8236             :                                 }
    8237           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    8238           0 :                         } else if (PyBytes_Check(value)) {
    8239           0 :                                 test_str = PyBytes_AS_STRING(value);
    8240             :                         } else {
    8241           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    8242           0 :                                 return -1;
    8243             :                         }
    8244           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    8245           0 :                         if (unicode != NULL) {
    8246           0 :                                 Py_DECREF(unicode);
    8247             :                         }
    8248           0 :                         if (talloc_str == NULL) {
    8249           0 :                                 PyErr_NoMemory();
    8250           0 :                                 return -1;
    8251             :                         }
    8252           0 :                         object->comment = talloc_str;
    8253             :                 }
    8254             :         }
    8255           0 :         return 0;
    8256             : }
    8257             : 
    8258           0 : static PyObject *py_srvsvc_NetShareInfo501_get_csc_policy(PyObject *obj, void *closure)
    8259             : {
    8260           0 :         struct srvsvc_NetShareInfo501 *object = (struct srvsvc_NetShareInfo501 *)pytalloc_get_ptr(obj);
    8261             :         PyObject *py_csc_policy;
    8262           0 :         py_csc_policy = PyLong_FromUnsignedLongLong((uint32_t)object->csc_policy);
    8263           0 :         return py_csc_policy;
    8264             : }
    8265             : 
    8266           0 : static int py_srvsvc_NetShareInfo501_set_csc_policy(PyObject *py_obj, PyObject *value, void *closure)
    8267             : {
    8268           0 :         struct srvsvc_NetShareInfo501 *object = (struct srvsvc_NetShareInfo501 *)pytalloc_get_ptr(py_obj);
    8269           0 :         if (value == NULL) {
    8270           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->csc_policy");
    8271           0 :                 return -1;
    8272             :         }
    8273             :         {
    8274           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->csc_policy));
    8275           0 :                 if (PyLong_Check(value)) {
    8276             :                         unsigned long long test_var;
    8277           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8278           0 :                         if (PyErr_Occurred() != NULL) {
    8279           0 :                                 return -1;
    8280             :                         }
    8281           0 :                         if (test_var > uint_max) {
    8282           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8283             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8284           0 :                                 return -1;
    8285             :                         }
    8286           0 :                         object->csc_policy = test_var;
    8287             :                 } else {
    8288           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8289             :                           PyLong_Type.tp_name);
    8290           0 :                         return -1;
    8291             :                 }
    8292             :         }
    8293           0 :         return 0;
    8294             : }
    8295             : 
    8296             : static PyGetSetDef py_srvsvc_NetShareInfo501_getsetters[] = {
    8297             :         {
    8298             :                 .name = discard_const_p(char, "name"),
    8299             :                 .get = py_srvsvc_NetShareInfo501_get_name,
    8300             :                 .set = py_srvsvc_NetShareInfo501_set_name,
    8301             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    8302             :         },
    8303             :         {
    8304             :                 .name = discard_const_p(char, "type"),
    8305             :                 .get = py_srvsvc_NetShareInfo501_get_type,
    8306             :                 .set = py_srvsvc_NetShareInfo501_set_type,
    8307             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_ShareType")
    8308             :         },
    8309             :         {
    8310             :                 .name = discard_const_p(char, "comment"),
    8311             :                 .get = py_srvsvc_NetShareInfo501_get_comment,
    8312             :                 .set = py_srvsvc_NetShareInfo501_set_comment,
    8313             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    8314             :         },
    8315             :         {
    8316             :                 .name = discard_const_p(char, "csc_policy"),
    8317             :                 .get = py_srvsvc_NetShareInfo501_get_csc_policy,
    8318             :                 .set = py_srvsvc_NetShareInfo501_set_csc_policy,
    8319             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    8320             :         },
    8321             :         { .name = NULL }
    8322             : };
    8323             : 
    8324           0 : static PyObject *py_srvsvc_NetShareInfo501_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    8325             : {
    8326           0 :         return pytalloc_new(struct srvsvc_NetShareInfo501, type);
    8327             : }
    8328             : 
    8329             : 
    8330             : static PyTypeObject srvsvc_NetShareInfo501_Type = {
    8331             :         PyVarObject_HEAD_INIT(NULL, 0)
    8332             :         .tp_name = "srvsvc.NetShareInfo501",
    8333             :         .tp_getset = py_srvsvc_NetShareInfo501_getsetters,
    8334             :         .tp_methods = NULL,
    8335             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    8336             :         .tp_new = py_srvsvc_NetShareInfo501_new,
    8337             : };
    8338             : 
    8339             : 
    8340           0 : static PyObject *py_srvsvc_NetShareCtr501_get_count(PyObject *obj, void *closure)
    8341             : {
    8342           0 :         struct srvsvc_NetShareCtr501 *object = (struct srvsvc_NetShareCtr501 *)pytalloc_get_ptr(obj);
    8343             :         PyObject *py_count;
    8344           0 :         py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
    8345           0 :         return py_count;
    8346             : }
    8347             : 
    8348           0 : static int py_srvsvc_NetShareCtr501_set_count(PyObject *py_obj, PyObject *value, void *closure)
    8349             : {
    8350           0 :         struct srvsvc_NetShareCtr501 *object = (struct srvsvc_NetShareCtr501 *)pytalloc_get_ptr(py_obj);
    8351           0 :         if (value == NULL) {
    8352           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
    8353           0 :                 return -1;
    8354             :         }
    8355             :         {
    8356           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
    8357           0 :                 if (PyLong_Check(value)) {
    8358             :                         unsigned long long test_var;
    8359           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8360           0 :                         if (PyErr_Occurred() != NULL) {
    8361           0 :                                 return -1;
    8362             :                         }
    8363           0 :                         if (test_var > uint_max) {
    8364           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8365             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8366           0 :                                 return -1;
    8367             :                         }
    8368           0 :                         object->count = test_var;
    8369             :                 } else {
    8370           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8371             :                           PyLong_Type.tp_name);
    8372           0 :                         return -1;
    8373             :                 }
    8374             :         }
    8375           0 :         return 0;
    8376             : }
    8377             : 
    8378           0 : static PyObject *py_srvsvc_NetShareCtr501_get_array(PyObject *obj, void *closure)
    8379             : {
    8380           0 :         struct srvsvc_NetShareCtr501 *object = (struct srvsvc_NetShareCtr501 *)pytalloc_get_ptr(obj);
    8381             :         PyObject *py_array;
    8382           0 :         if (object->array == NULL) {
    8383           0 :                 Py_RETURN_NONE;
    8384             :         }
    8385           0 :         if (object->array == NULL) {
    8386           0 :                 py_array = Py_None;
    8387           0 :                 Py_INCREF(py_array);
    8388             :         } else {
    8389           0 :                 py_array = PyList_New(object->count);
    8390           0 :                 if (py_array == NULL) {
    8391           0 :                         return NULL;
    8392             :                 }
    8393             :                 {
    8394             :                         int array_cntr_1;
    8395           0 :                         for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
    8396             :                                 PyObject *py_array_1;
    8397           0 :                                 py_array_1 = pytalloc_reference_ex(&srvsvc_NetShareInfo501_Type, object->array, &object->array[array_cntr_1]);
    8398           0 :                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
    8399             :                         }
    8400             :                 }
    8401             :         }
    8402           0 :         return py_array;
    8403             : }
    8404             : 
    8405           0 : static int py_srvsvc_NetShareCtr501_set_array(PyObject *py_obj, PyObject *value, void *closure)
    8406             : {
    8407           0 :         struct srvsvc_NetShareCtr501 *object = (struct srvsvc_NetShareCtr501 *)pytalloc_get_ptr(py_obj);
    8408           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
    8409           0 :         if (value == NULL) {
    8410           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
    8411           0 :                 return -1;
    8412             :         }
    8413           0 :         if (value == Py_None) {
    8414           0 :                 object->array = NULL;
    8415             :         } else {
    8416           0 :                 object->array = NULL;
    8417           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    8418             :                 {
    8419             :                         int array_cntr_1;
    8420           0 :                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
    8421           0 :                         if (!object->array) { return -1;; }
    8422           0 :                         talloc_set_name_const(object->array, "ARRAY: object->array");
    8423           0 :                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
    8424           0 :                                 if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
    8425           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
    8426           0 :                                         return -1;
    8427             :                                 }
    8428           0 :                                 PY_CHECK_TYPE(&srvsvc_NetShareInfo501_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
    8429           0 :                                 if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
    8430           0 :                                         PyErr_NoMemory();
    8431           0 :                                         return -1;
    8432             :                                 }
    8433           0 :                                 object->array[array_cntr_1] = *(struct srvsvc_NetShareInfo501 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
    8434             :                         }
    8435             :                 }
    8436             :         }
    8437           0 :         return 0;
    8438             : }
    8439             : 
    8440             : static PyGetSetDef py_srvsvc_NetShareCtr501_getsetters[] = {
    8441             :         {
    8442             :                 .name = discard_const_p(char, "count"),
    8443             :                 .get = py_srvsvc_NetShareCtr501_get_count,
    8444             :                 .set = py_srvsvc_NetShareCtr501_set_count,
    8445             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    8446             :         },
    8447             :         {
    8448             :                 .name = discard_const_p(char, "array"),
    8449             :                 .get = py_srvsvc_NetShareCtr501_get_array,
    8450             :                 .set = py_srvsvc_NetShareCtr501_set_array,
    8451             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetShareInfo501")
    8452             :         },
    8453             :         { .name = NULL }
    8454             : };
    8455             : 
    8456           0 : static PyObject *py_srvsvc_NetShareCtr501_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    8457             : {
    8458           0 :         return pytalloc_new(struct srvsvc_NetShareCtr501, type);
    8459             : }
    8460             : 
    8461             : 
    8462             : static PyTypeObject srvsvc_NetShareCtr501_Type = {
    8463             :         PyVarObject_HEAD_INIT(NULL, 0)
    8464             :         .tp_name = "srvsvc.NetShareCtr501",
    8465             :         .tp_getset = py_srvsvc_NetShareCtr501_getsetters,
    8466             :         .tp_methods = NULL,
    8467             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    8468             :         .tp_new = py_srvsvc_NetShareCtr501_new,
    8469             : };
    8470             : 
    8471             : 
    8472           0 : static PyObject *py_srvsvc_NetShareInfo502_get_name(PyObject *obj, void *closure)
    8473             : {
    8474           0 :         struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(obj);
    8475             :         PyObject *py_name;
    8476           0 :         if (object->name == NULL) {
    8477           0 :                 Py_RETURN_NONE;
    8478             :         }
    8479           0 :         if (object->name == NULL) {
    8480           0 :                 py_name = Py_None;
    8481           0 :                 Py_INCREF(py_name);
    8482             :         } else {
    8483           0 :                 if (object->name == NULL) {
    8484           0 :                         py_name = Py_None;
    8485           0 :                         Py_INCREF(py_name);
    8486             :                 } else {
    8487           0 :                         py_name = PyUnicode_Decode(object->name, strlen(object->name), "utf-8", "ignore");
    8488             :                 }
    8489             :         }
    8490           0 :         return py_name;
    8491             : }
    8492             : 
    8493           0 : static int py_srvsvc_NetShareInfo502_set_name(PyObject *py_obj, PyObject *value, void *closure)
    8494             : {
    8495           0 :         struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(py_obj);
    8496           0 :         if (value == NULL) {
    8497           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->name");
    8498           0 :                 return -1;
    8499             :         }
    8500           0 :         if (value == Py_None) {
    8501           0 :                 object->name = NULL;
    8502             :         } else {
    8503           0 :                 object->name = NULL;
    8504             :                 {
    8505             :                         const char *test_str;
    8506             :                         const char *talloc_str;
    8507           0 :                         PyObject *unicode = NULL;
    8508           0 :                         if (PyUnicode_Check(value)) {
    8509           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    8510           0 :                                 if (unicode == NULL) {
    8511           0 :                                         PyErr_NoMemory();
    8512           0 :                                         return -1;
    8513             :                                 }
    8514           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    8515           0 :                         } else if (PyBytes_Check(value)) {
    8516           0 :                                 test_str = PyBytes_AS_STRING(value);
    8517             :                         } else {
    8518           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    8519           0 :                                 return -1;
    8520             :                         }
    8521           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    8522           0 :                         if (unicode != NULL) {
    8523           0 :                                 Py_DECREF(unicode);
    8524             :                         }
    8525           0 :                         if (talloc_str == NULL) {
    8526           0 :                                 PyErr_NoMemory();
    8527           0 :                                 return -1;
    8528             :                         }
    8529           0 :                         object->name = talloc_str;
    8530             :                 }
    8531             :         }
    8532           0 :         return 0;
    8533             : }
    8534             : 
    8535           0 : static PyObject *py_srvsvc_NetShareInfo502_get_type(PyObject *obj, void *closure)
    8536             : {
    8537           0 :         struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(obj);
    8538             :         PyObject *py_type;
    8539           0 :         py_type = PyLong_FromUnsignedLongLong((uint32_t)object->type);
    8540           0 :         return py_type;
    8541             : }
    8542             : 
    8543           0 : static int py_srvsvc_NetShareInfo502_set_type(PyObject *py_obj, PyObject *value, void *closure)
    8544             : {
    8545           0 :         struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(py_obj);
    8546           0 :         if (value == NULL) {
    8547           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->type");
    8548           0 :                 return -1;
    8549             :         }
    8550             :         {
    8551           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->type));
    8552           0 :                 if (PyLong_Check(value)) {
    8553             :                         unsigned long long test_var;
    8554           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8555           0 :                         if (PyErr_Occurred() != NULL) {
    8556           0 :                                 return -1;
    8557             :                         }
    8558           0 :                         if (test_var > uint_max) {
    8559           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8560             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8561           0 :                                 return -1;
    8562             :                         }
    8563           0 :                         object->type = test_var;
    8564             :                 } else {
    8565           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8566             :                           PyLong_Type.tp_name);
    8567           0 :                         return -1;
    8568             :                 }
    8569             :         }
    8570           0 :         return 0;
    8571             : }
    8572             : 
    8573           0 : static PyObject *py_srvsvc_NetShareInfo502_get_comment(PyObject *obj, void *closure)
    8574             : {
    8575           0 :         struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(obj);
    8576             :         PyObject *py_comment;
    8577           0 :         if (object->comment == NULL) {
    8578           0 :                 Py_RETURN_NONE;
    8579             :         }
    8580           0 :         if (object->comment == NULL) {
    8581           0 :                 py_comment = Py_None;
    8582           0 :                 Py_INCREF(py_comment);
    8583             :         } else {
    8584           0 :                 if (object->comment == NULL) {
    8585           0 :                         py_comment = Py_None;
    8586           0 :                         Py_INCREF(py_comment);
    8587             :                 } else {
    8588           0 :                         py_comment = PyUnicode_Decode(object->comment, strlen(object->comment), "utf-8", "ignore");
    8589             :                 }
    8590             :         }
    8591           0 :         return py_comment;
    8592             : }
    8593             : 
    8594           0 : static int py_srvsvc_NetShareInfo502_set_comment(PyObject *py_obj, PyObject *value, void *closure)
    8595             : {
    8596           0 :         struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(py_obj);
    8597           0 :         if (value == NULL) {
    8598           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->comment");
    8599           0 :                 return -1;
    8600             :         }
    8601           0 :         if (value == Py_None) {
    8602           0 :                 object->comment = NULL;
    8603             :         } else {
    8604           0 :                 object->comment = NULL;
    8605             :                 {
    8606             :                         const char *test_str;
    8607             :                         const char *talloc_str;
    8608           0 :                         PyObject *unicode = NULL;
    8609           0 :                         if (PyUnicode_Check(value)) {
    8610           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    8611           0 :                                 if (unicode == NULL) {
    8612           0 :                                         PyErr_NoMemory();
    8613           0 :                                         return -1;
    8614             :                                 }
    8615           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    8616           0 :                         } else if (PyBytes_Check(value)) {
    8617           0 :                                 test_str = PyBytes_AS_STRING(value);
    8618             :                         } else {
    8619           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    8620           0 :                                 return -1;
    8621             :                         }
    8622           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    8623           0 :                         if (unicode != NULL) {
    8624           0 :                                 Py_DECREF(unicode);
    8625             :                         }
    8626           0 :                         if (talloc_str == NULL) {
    8627           0 :                                 PyErr_NoMemory();
    8628           0 :                                 return -1;
    8629             :                         }
    8630           0 :                         object->comment = talloc_str;
    8631             :                 }
    8632             :         }
    8633           0 :         return 0;
    8634             : }
    8635             : 
    8636           0 : static PyObject *py_srvsvc_NetShareInfo502_get_permissions(PyObject *obj, void *closure)
    8637             : {
    8638           0 :         struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(obj);
    8639             :         PyObject *py_permissions;
    8640           0 :         py_permissions = PyLong_FromUnsignedLongLong((uint32_t)object->permissions);
    8641           0 :         return py_permissions;
    8642             : }
    8643             : 
    8644           0 : static int py_srvsvc_NetShareInfo502_set_permissions(PyObject *py_obj, PyObject *value, void *closure)
    8645             : {
    8646           0 :         struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(py_obj);
    8647           0 :         if (value == NULL) {
    8648           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->permissions");
    8649           0 :                 return -1;
    8650             :         }
    8651             :         {
    8652           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->permissions));
    8653           0 :                 if (PyLong_Check(value)) {
    8654             :                         unsigned long long test_var;
    8655           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8656           0 :                         if (PyErr_Occurred() != NULL) {
    8657           0 :                                 return -1;
    8658             :                         }
    8659           0 :                         if (test_var > uint_max) {
    8660           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8661             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8662           0 :                                 return -1;
    8663             :                         }
    8664           0 :                         object->permissions = test_var;
    8665             :                 } else {
    8666           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8667             :                           PyLong_Type.tp_name);
    8668           0 :                         return -1;
    8669             :                 }
    8670             :         }
    8671           0 :         return 0;
    8672             : }
    8673             : 
    8674           0 : static PyObject *py_srvsvc_NetShareInfo502_get_max_users(PyObject *obj, void *closure)
    8675             : {
    8676           0 :         struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(obj);
    8677             :         PyObject *py_max_users;
    8678           0 :         py_max_users = PyLong_FromUnsignedLongLong((uint32_t)object->max_users);
    8679           0 :         return py_max_users;
    8680             : }
    8681             : 
    8682           0 : static int py_srvsvc_NetShareInfo502_set_max_users(PyObject *py_obj, PyObject *value, void *closure)
    8683             : {
    8684           0 :         struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(py_obj);
    8685           0 :         if (value == NULL) {
    8686           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->max_users");
    8687           0 :                 return -1;
    8688             :         }
    8689             :         {
    8690           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->max_users));
    8691           0 :                 if (PyLong_Check(value)) {
    8692             :                         unsigned long long test_var;
    8693           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8694           0 :                         if (PyErr_Occurred() != NULL) {
    8695           0 :                                 return -1;
    8696             :                         }
    8697           0 :                         if (test_var > uint_max) {
    8698           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8699             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8700           0 :                                 return -1;
    8701             :                         }
    8702           0 :                         object->max_users = test_var;
    8703             :                 } else {
    8704           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8705             :                           PyLong_Type.tp_name);
    8706           0 :                         return -1;
    8707             :                 }
    8708             :         }
    8709           0 :         return 0;
    8710             : }
    8711             : 
    8712           0 : static PyObject *py_srvsvc_NetShareInfo502_get_current_users(PyObject *obj, void *closure)
    8713             : {
    8714           0 :         struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(obj);
    8715             :         PyObject *py_current_users;
    8716           0 :         py_current_users = PyLong_FromUnsignedLongLong((uint32_t)object->current_users);
    8717           0 :         return py_current_users;
    8718             : }
    8719             : 
    8720           0 : static int py_srvsvc_NetShareInfo502_set_current_users(PyObject *py_obj, PyObject *value, void *closure)
    8721             : {
    8722           0 :         struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(py_obj);
    8723           0 :         if (value == NULL) {
    8724           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->current_users");
    8725           0 :                 return -1;
    8726             :         }
    8727             :         {
    8728           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->current_users));
    8729           0 :                 if (PyLong_Check(value)) {
    8730             :                         unsigned long long test_var;
    8731           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8732           0 :                         if (PyErr_Occurred() != NULL) {
    8733           0 :                                 return -1;
    8734             :                         }
    8735           0 :                         if (test_var > uint_max) {
    8736           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8737             :                                   PyLong_Type.tp_name, uint_max, test_var);
    8738           0 :                                 return -1;
    8739             :                         }
    8740           0 :                         object->current_users = test_var;
    8741             :                 } else {
    8742           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    8743             :                           PyLong_Type.tp_name);
    8744           0 :                         return -1;
    8745             :                 }
    8746             :         }
    8747           0 :         return 0;
    8748             : }
    8749             : 
    8750           0 : static PyObject *py_srvsvc_NetShareInfo502_get_path(PyObject *obj, void *closure)
    8751             : {
    8752           0 :         struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(obj);
    8753             :         PyObject *py_path;
    8754           0 :         if (object->path == NULL) {
    8755           0 :                 Py_RETURN_NONE;
    8756             :         }
    8757           0 :         if (object->path == NULL) {
    8758           0 :                 py_path = Py_None;
    8759           0 :                 Py_INCREF(py_path);
    8760             :         } else {
    8761           0 :                 if (object->path == NULL) {
    8762           0 :                         py_path = Py_None;
    8763           0 :                         Py_INCREF(py_path);
    8764             :                 } else {
    8765           0 :                         py_path = PyUnicode_Decode(object->path, strlen(object->path), "utf-8", "ignore");
    8766             :                 }
    8767             :         }
    8768           0 :         return py_path;
    8769             : }
    8770             : 
    8771           0 : static int py_srvsvc_NetShareInfo502_set_path(PyObject *py_obj, PyObject *value, void *closure)
    8772             : {
    8773           0 :         struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(py_obj);
    8774           0 :         if (value == NULL) {
    8775           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->path");
    8776           0 :                 return -1;
    8777             :         }
    8778           0 :         if (value == Py_None) {
    8779           0 :                 object->path = NULL;
    8780             :         } else {
    8781           0 :                 object->path = NULL;
    8782             :                 {
    8783             :                         const char *test_str;
    8784             :                         const char *talloc_str;
    8785           0 :                         PyObject *unicode = NULL;
    8786           0 :                         if (PyUnicode_Check(value)) {
    8787           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    8788           0 :                                 if (unicode == NULL) {
    8789           0 :                                         PyErr_NoMemory();
    8790           0 :                                         return -1;
    8791             :                                 }
    8792           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    8793           0 :                         } else if (PyBytes_Check(value)) {
    8794           0 :                                 test_str = PyBytes_AS_STRING(value);
    8795             :                         } else {
    8796           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    8797           0 :                                 return -1;
    8798             :                         }
    8799           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    8800           0 :                         if (unicode != NULL) {
    8801           0 :                                 Py_DECREF(unicode);
    8802             :                         }
    8803           0 :                         if (talloc_str == NULL) {
    8804           0 :                                 PyErr_NoMemory();
    8805           0 :                                 return -1;
    8806             :                         }
    8807           0 :                         object->path = talloc_str;
    8808             :                 }
    8809             :         }
    8810           0 :         return 0;
    8811             : }
    8812             : 
    8813           0 : static PyObject *py_srvsvc_NetShareInfo502_get_password(PyObject *obj, void *closure)
    8814             : {
    8815           0 :         struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(obj);
    8816             :         PyObject *py_password;
    8817           0 :         if (object->password == NULL) {
    8818           0 :                 Py_RETURN_NONE;
    8819             :         }
    8820           0 :         if (object->password == NULL) {
    8821           0 :                 py_password = Py_None;
    8822           0 :                 Py_INCREF(py_password);
    8823             :         } else {
    8824           0 :                 if (object->password == NULL) {
    8825           0 :                         py_password = Py_None;
    8826           0 :                         Py_INCREF(py_password);
    8827             :                 } else {
    8828           0 :                         py_password = PyUnicode_Decode(object->password, strlen(object->password), "utf-8", "ignore");
    8829             :                 }
    8830             :         }
    8831           0 :         return py_password;
    8832             : }
    8833             : 
    8834           0 : static int py_srvsvc_NetShareInfo502_set_password(PyObject *py_obj, PyObject *value, void *closure)
    8835             : {
    8836           0 :         struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(py_obj);
    8837           0 :         if (value == NULL) {
    8838           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->password");
    8839           0 :                 return -1;
    8840             :         }
    8841           0 :         if (value == Py_None) {
    8842           0 :                 object->password = NULL;
    8843             :         } else {
    8844           0 :                 object->password = NULL;
    8845             :                 {
    8846             :                         const char *test_str;
    8847             :                         const char *talloc_str;
    8848           0 :                         PyObject *unicode = NULL;
    8849           0 :                         if (PyUnicode_Check(value)) {
    8850           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    8851           0 :                                 if (unicode == NULL) {
    8852           0 :                                         PyErr_NoMemory();
    8853           0 :                                         return -1;
    8854             :                                 }
    8855           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    8856           0 :                         } else if (PyBytes_Check(value)) {
    8857           0 :                                 test_str = PyBytes_AS_STRING(value);
    8858             :                         } else {
    8859           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    8860           0 :                                 return -1;
    8861             :                         }
    8862           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    8863           0 :                         if (unicode != NULL) {
    8864           0 :                                 Py_DECREF(unicode);
    8865             :                         }
    8866           0 :                         if (talloc_str == NULL) {
    8867           0 :                                 PyErr_NoMemory();
    8868           0 :                                 return -1;
    8869             :                         }
    8870           0 :                         object->password = talloc_str;
    8871             :                 }
    8872             :         }
    8873           0 :         return 0;
    8874             : }
    8875             : 
    8876           0 : static PyObject *py_srvsvc_NetShareInfo502_get_sd_buf(PyObject *obj, void *closure)
    8877             : {
    8878           0 :         struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(obj);
    8879             :         PyObject *py_sd_buf;
    8880           0 :         py_sd_buf = pytalloc_reference_ex(sec_desc_buf_Type, pytalloc_get_mem_ctx(obj), &object->sd_buf);
    8881           0 :         return py_sd_buf;
    8882             : }
    8883             : 
    8884           0 : static int py_srvsvc_NetShareInfo502_set_sd_buf(PyObject *py_obj, PyObject *value, void *closure)
    8885             : {
    8886           0 :         struct srvsvc_NetShareInfo502 *object = (struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(py_obj);
    8887           0 :         if (value == NULL) {
    8888           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->sd_buf");
    8889           0 :                 return -1;
    8890             :         }
    8891           0 :         PY_CHECK_TYPE(sec_desc_buf_Type, value, return -1;);
    8892           0 :         if (talloc_reference(pytalloc_get_mem_ctx(py_obj), pytalloc_get_mem_ctx(value)) == NULL) {
    8893           0 :                 PyErr_NoMemory();
    8894           0 :                 return -1;
    8895             :         }
    8896           0 :         object->sd_buf = *(struct sec_desc_buf *)pytalloc_get_ptr(value);
    8897           0 :         return 0;
    8898             : }
    8899             : 
    8900             : static PyGetSetDef py_srvsvc_NetShareInfo502_getsetters[] = {
    8901             :         {
    8902             :                 .name = discard_const_p(char, "name"),
    8903             :                 .get = py_srvsvc_NetShareInfo502_get_name,
    8904             :                 .set = py_srvsvc_NetShareInfo502_set_name,
    8905             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    8906             :         },
    8907             :         {
    8908             :                 .name = discard_const_p(char, "type"),
    8909             :                 .get = py_srvsvc_NetShareInfo502_get_type,
    8910             :                 .set = py_srvsvc_NetShareInfo502_set_type,
    8911             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_ShareType")
    8912             :         },
    8913             :         {
    8914             :                 .name = discard_const_p(char, "comment"),
    8915             :                 .get = py_srvsvc_NetShareInfo502_get_comment,
    8916             :                 .set = py_srvsvc_NetShareInfo502_set_comment,
    8917             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    8918             :         },
    8919             :         {
    8920             :                 .name = discard_const_p(char, "permissions"),
    8921             :                 .get = py_srvsvc_NetShareInfo502_get_permissions,
    8922             :                 .set = py_srvsvc_NetShareInfo502_set_permissions,
    8923             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    8924             :         },
    8925             :         {
    8926             :                 .name = discard_const_p(char, "max_users"),
    8927             :                 .get = py_srvsvc_NetShareInfo502_get_max_users,
    8928             :                 .set = py_srvsvc_NetShareInfo502_set_max_users,
    8929             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    8930             :         },
    8931             :         {
    8932             :                 .name = discard_const_p(char, "current_users"),
    8933             :                 .get = py_srvsvc_NetShareInfo502_get_current_users,
    8934             :                 .set = py_srvsvc_NetShareInfo502_set_current_users,
    8935             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    8936             :         },
    8937             :         {
    8938             :                 .name = discard_const_p(char, "path"),
    8939             :                 .get = py_srvsvc_NetShareInfo502_get_path,
    8940             :                 .set = py_srvsvc_NetShareInfo502_set_path,
    8941             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    8942             :         },
    8943             :         {
    8944             :                 .name = discard_const_p(char, "password"),
    8945             :                 .get = py_srvsvc_NetShareInfo502_get_password,
    8946             :                 .set = py_srvsvc_NetShareInfo502_set_password,
    8947             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    8948             :         },
    8949             :         {
    8950             :                 .name = discard_const_p(char, "sd_buf"),
    8951             :                 .get = py_srvsvc_NetShareInfo502_get_sd_buf,
    8952             :                 .set = py_srvsvc_NetShareInfo502_set_sd_buf,
    8953             :                 .doc = discard_const_p(char, "PIDL-generated element of base type sec_desc_buf")
    8954             :         },
    8955             :         { .name = NULL }
    8956             : };
    8957             : 
    8958           0 : static PyObject *py_srvsvc_NetShareInfo502_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    8959             : {
    8960           0 :         return pytalloc_new(struct srvsvc_NetShareInfo502, type);
    8961             : }
    8962             : 
    8963             : 
    8964             : static PyTypeObject srvsvc_NetShareInfo502_Type = {
    8965             :         PyVarObject_HEAD_INIT(NULL, 0)
    8966             :         .tp_name = "srvsvc.NetShareInfo502",
    8967             :         .tp_getset = py_srvsvc_NetShareInfo502_getsetters,
    8968             :         .tp_methods = NULL,
    8969             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    8970             :         .tp_new = py_srvsvc_NetShareInfo502_new,
    8971             : };
    8972             : 
    8973             : 
    8974           0 : static PyObject *py_srvsvc_NetShareCtr502_get_count(PyObject *obj, void *closure)
    8975             : {
    8976           0 :         struct srvsvc_NetShareCtr502 *object = (struct srvsvc_NetShareCtr502 *)pytalloc_get_ptr(obj);
    8977             :         PyObject *py_count;
    8978           0 :         py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
    8979           0 :         return py_count;
    8980             : }
    8981             : 
    8982           0 : static int py_srvsvc_NetShareCtr502_set_count(PyObject *py_obj, PyObject *value, void *closure)
    8983             : {
    8984           0 :         struct srvsvc_NetShareCtr502 *object = (struct srvsvc_NetShareCtr502 *)pytalloc_get_ptr(py_obj);
    8985           0 :         if (value == NULL) {
    8986           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
    8987           0 :                 return -1;
    8988             :         }
    8989             :         {
    8990           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
    8991           0 :                 if (PyLong_Check(value)) {
    8992             :                         unsigned long long test_var;
    8993           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    8994           0 :                         if (PyErr_Occurred() != NULL) {
    8995           0 :                                 return -1;
    8996             :                         }
    8997           0 :                         if (test_var > uint_max) {
    8998           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    8999             :                                   PyLong_Type.tp_name, uint_max, test_var);
    9000           0 :                                 return -1;
    9001             :                         }
    9002           0 :                         object->count = test_var;
    9003             :                 } else {
    9004           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    9005             :                           PyLong_Type.tp_name);
    9006           0 :                         return -1;
    9007             :                 }
    9008             :         }
    9009           0 :         return 0;
    9010             : }
    9011             : 
    9012           0 : static PyObject *py_srvsvc_NetShareCtr502_get_array(PyObject *obj, void *closure)
    9013             : {
    9014           0 :         struct srvsvc_NetShareCtr502 *object = (struct srvsvc_NetShareCtr502 *)pytalloc_get_ptr(obj);
    9015             :         PyObject *py_array;
    9016           0 :         if (object->array == NULL) {
    9017           0 :                 Py_RETURN_NONE;
    9018             :         }
    9019           0 :         if (object->array == NULL) {
    9020           0 :                 py_array = Py_None;
    9021           0 :                 Py_INCREF(py_array);
    9022             :         } else {
    9023           0 :                 py_array = PyList_New(object->count);
    9024           0 :                 if (py_array == NULL) {
    9025           0 :                         return NULL;
    9026             :                 }
    9027             :                 {
    9028             :                         int array_cntr_1;
    9029           0 :                         for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
    9030             :                                 PyObject *py_array_1;
    9031           0 :                                 py_array_1 = pytalloc_reference_ex(&srvsvc_NetShareInfo502_Type, object->array, &object->array[array_cntr_1]);
    9032           0 :                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
    9033             :                         }
    9034             :                 }
    9035             :         }
    9036           0 :         return py_array;
    9037             : }
    9038             : 
    9039           0 : static int py_srvsvc_NetShareCtr502_set_array(PyObject *py_obj, PyObject *value, void *closure)
    9040             : {
    9041           0 :         struct srvsvc_NetShareCtr502 *object = (struct srvsvc_NetShareCtr502 *)pytalloc_get_ptr(py_obj);
    9042           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
    9043           0 :         if (value == NULL) {
    9044           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
    9045           0 :                 return -1;
    9046             :         }
    9047           0 :         if (value == Py_None) {
    9048           0 :                 object->array = NULL;
    9049             :         } else {
    9050           0 :                 object->array = NULL;
    9051           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    9052             :                 {
    9053             :                         int array_cntr_1;
    9054           0 :                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
    9055           0 :                         if (!object->array) { return -1;; }
    9056           0 :                         talloc_set_name_const(object->array, "ARRAY: object->array");
    9057           0 :                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
    9058           0 :                                 if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
    9059           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
    9060           0 :                                         return -1;
    9061             :                                 }
    9062           0 :                                 PY_CHECK_TYPE(&srvsvc_NetShareInfo502_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
    9063           0 :                                 if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
    9064           0 :                                         PyErr_NoMemory();
    9065           0 :                                         return -1;
    9066             :                                 }
    9067           0 :                                 object->array[array_cntr_1] = *(struct srvsvc_NetShareInfo502 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
    9068             :                         }
    9069             :                 }
    9070             :         }
    9071           0 :         return 0;
    9072             : }
    9073             : 
    9074             : static PyGetSetDef py_srvsvc_NetShareCtr502_getsetters[] = {
    9075             :         {
    9076             :                 .name = discard_const_p(char, "count"),
    9077             :                 .get = py_srvsvc_NetShareCtr502_get_count,
    9078             :                 .set = py_srvsvc_NetShareCtr502_set_count,
    9079             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    9080             :         },
    9081             :         {
    9082             :                 .name = discard_const_p(char, "array"),
    9083             :                 .get = py_srvsvc_NetShareCtr502_get_array,
    9084             :                 .set = py_srvsvc_NetShareCtr502_set_array,
    9085             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetShareInfo502")
    9086             :         },
    9087             :         { .name = NULL }
    9088             : };
    9089             : 
    9090           0 : static PyObject *py_srvsvc_NetShareCtr502_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    9091             : {
    9092           0 :         return pytalloc_new(struct srvsvc_NetShareCtr502, type);
    9093             : }
    9094             : 
    9095             : 
    9096             : static PyTypeObject srvsvc_NetShareCtr502_Type = {
    9097             :         PyVarObject_HEAD_INIT(NULL, 0)
    9098             :         .tp_name = "srvsvc.NetShareCtr502",
    9099             :         .tp_getset = py_srvsvc_NetShareCtr502_getsetters,
    9100             :         .tp_methods = NULL,
    9101             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    9102             :         .tp_new = py_srvsvc_NetShareCtr502_new,
    9103             : };
    9104             : 
    9105             : 
    9106           0 : static PyObject *py_srvsvc_NetShareInfo1004_get_comment(PyObject *obj, void *closure)
    9107             : {
    9108           0 :         struct srvsvc_NetShareInfo1004 *object = (struct srvsvc_NetShareInfo1004 *)pytalloc_get_ptr(obj);
    9109             :         PyObject *py_comment;
    9110           0 :         if (object->comment == NULL) {
    9111           0 :                 Py_RETURN_NONE;
    9112             :         }
    9113           0 :         if (object->comment == NULL) {
    9114           0 :                 py_comment = Py_None;
    9115           0 :                 Py_INCREF(py_comment);
    9116             :         } else {
    9117           0 :                 if (object->comment == NULL) {
    9118           0 :                         py_comment = Py_None;
    9119           0 :                         Py_INCREF(py_comment);
    9120             :                 } else {
    9121           0 :                         py_comment = PyUnicode_Decode(object->comment, strlen(object->comment), "utf-8", "ignore");
    9122             :                 }
    9123             :         }
    9124           0 :         return py_comment;
    9125             : }
    9126             : 
    9127           0 : static int py_srvsvc_NetShareInfo1004_set_comment(PyObject *py_obj, PyObject *value, void *closure)
    9128             : {
    9129           0 :         struct srvsvc_NetShareInfo1004 *object = (struct srvsvc_NetShareInfo1004 *)pytalloc_get_ptr(py_obj);
    9130           0 :         if (value == NULL) {
    9131           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->comment");
    9132           0 :                 return -1;
    9133             :         }
    9134           0 :         if (value == Py_None) {
    9135           0 :                 object->comment = NULL;
    9136             :         } else {
    9137           0 :                 object->comment = NULL;
    9138             :                 {
    9139             :                         const char *test_str;
    9140             :                         const char *talloc_str;
    9141           0 :                         PyObject *unicode = NULL;
    9142           0 :                         if (PyUnicode_Check(value)) {
    9143           0 :                                 unicode = PyUnicode_AsEncodedString(value, "utf-8", "ignore");
    9144           0 :                                 if (unicode == NULL) {
    9145           0 :                                         PyErr_NoMemory();
    9146           0 :                                         return -1;
    9147             :                                 }
    9148           0 :                                 test_str = PyBytes_AS_STRING(unicode);
    9149           0 :                         } else if (PyBytes_Check(value)) {
    9150           0 :                                 test_str = PyBytes_AS_STRING(value);
    9151             :                         } else {
    9152           0 :                                 PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(value)->tp_name);
    9153           0 :                                 return -1;
    9154             :                         }
    9155           0 :                         talloc_str = talloc_strdup(pytalloc_get_mem_ctx(py_obj), test_str);
    9156           0 :                         if (unicode != NULL) {
    9157           0 :                                 Py_DECREF(unicode);
    9158             :                         }
    9159           0 :                         if (talloc_str == NULL) {
    9160           0 :                                 PyErr_NoMemory();
    9161           0 :                                 return -1;
    9162             :                         }
    9163           0 :                         object->comment = talloc_str;
    9164             :                 }
    9165             :         }
    9166           0 :         return 0;
    9167             : }
    9168             : 
    9169             : static PyGetSetDef py_srvsvc_NetShareInfo1004_getsetters[] = {
    9170             :         {
    9171             :                 .name = discard_const_p(char, "comment"),
    9172             :                 .get = py_srvsvc_NetShareInfo1004_get_comment,
    9173             :                 .set = py_srvsvc_NetShareInfo1004_set_comment,
    9174             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint16")
    9175             :         },
    9176             :         { .name = NULL }
    9177             : };
    9178             : 
    9179           0 : static PyObject *py_srvsvc_NetShareInfo1004_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    9180             : {
    9181           0 :         return pytalloc_new(struct srvsvc_NetShareInfo1004, type);
    9182             : }
    9183             : 
    9184             : 
    9185             : static PyTypeObject srvsvc_NetShareInfo1004_Type = {
    9186             :         PyVarObject_HEAD_INIT(NULL, 0)
    9187             :         .tp_name = "srvsvc.NetShareInfo1004",
    9188             :         .tp_getset = py_srvsvc_NetShareInfo1004_getsetters,
    9189             :         .tp_methods = NULL,
    9190             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    9191             :         .tp_new = py_srvsvc_NetShareInfo1004_new,
    9192             : };
    9193             : 
    9194             : 
    9195           0 : static PyObject *py_srvsvc_NetShareCtr1004_get_count(PyObject *obj, void *closure)
    9196             : {
    9197           0 :         struct srvsvc_NetShareCtr1004 *object = (struct srvsvc_NetShareCtr1004 *)pytalloc_get_ptr(obj);
    9198             :         PyObject *py_count;
    9199           0 :         py_count = PyLong_FromUnsignedLongLong((uint32_t)object->count);
    9200           0 :         return py_count;
    9201             : }
    9202             : 
    9203           0 : static int py_srvsvc_NetShareCtr1004_set_count(PyObject *py_obj, PyObject *value, void *closure)
    9204             : {
    9205           0 :         struct srvsvc_NetShareCtr1004 *object = (struct srvsvc_NetShareCtr1004 *)pytalloc_get_ptr(py_obj);
    9206           0 :         if (value == NULL) {
    9207           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->count");
    9208           0 :                 return -1;
    9209             :         }
    9210             :         {
    9211           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->count));
    9212           0 :                 if (PyLong_Check(value)) {
    9213             :                         unsigned long long test_var;
    9214           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    9215           0 :                         if (PyErr_Occurred() != NULL) {
    9216           0 :                                 return -1;
    9217             :                         }
    9218           0 :                         if (test_var > uint_max) {
    9219           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    9220             :                                   PyLong_Type.tp_name, uint_max, test_var);
    9221           0 :                                 return -1;
    9222             :                         }
    9223           0 :                         object->count = test_var;
    9224             :                 } else {
    9225           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    9226             :                           PyLong_Type.tp_name);
    9227           0 :                         return -1;
    9228             :                 }
    9229             :         }
    9230           0 :         return 0;
    9231             : }
    9232             : 
    9233           0 : static PyObject *py_srvsvc_NetShareCtr1004_get_array(PyObject *obj, void *closure)
    9234             : {
    9235           0 :         struct srvsvc_NetShareCtr1004 *object = (struct srvsvc_NetShareCtr1004 *)pytalloc_get_ptr(obj);
    9236             :         PyObject *py_array;
    9237           0 :         if (object->array == NULL) {
    9238           0 :                 Py_RETURN_NONE;
    9239             :         }
    9240           0 :         if (object->array == NULL) {
    9241           0 :                 py_array = Py_None;
    9242           0 :                 Py_INCREF(py_array);
    9243             :         } else {
    9244           0 :                 py_array = PyList_New(object->count);
    9245           0 :                 if (py_array == NULL) {
    9246           0 :                         return NULL;
    9247             :                 }
    9248             :                 {
    9249             :                         int array_cntr_1;
    9250           0 :                         for (array_cntr_1 = 0; array_cntr_1 < (object->count); array_cntr_1++) {
    9251             :                                 PyObject *py_array_1;
    9252           0 :                                 py_array_1 = pytalloc_reference_ex(&srvsvc_NetShareInfo1004_Type, object->array, &object->array[array_cntr_1]);
    9253           0 :                                 PyList_SetItem(py_array, array_cntr_1, py_array_1);
    9254             :                         }
    9255             :                 }
    9256             :         }
    9257           0 :         return py_array;
    9258             : }
    9259             : 
    9260           0 : static int py_srvsvc_NetShareCtr1004_set_array(PyObject *py_obj, PyObject *value, void *closure)
    9261             : {
    9262           0 :         struct srvsvc_NetShareCtr1004 *object = (struct srvsvc_NetShareCtr1004 *)pytalloc_get_ptr(py_obj);
    9263           0 :         talloc_unlink(pytalloc_get_mem_ctx(py_obj), discard_const(object->array));
    9264           0 :         if (value == NULL) {
    9265           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array");
    9266           0 :                 return -1;
    9267             :         }
    9268           0 :         if (value == Py_None) {
    9269           0 :                 object->array = NULL;
    9270             :         } else {
    9271           0 :                 object->array = NULL;
    9272           0 :                 PY_CHECK_TYPE(&PyList_Type, value, return -1;);
    9273             :                 {
    9274             :                         int array_cntr_1;
    9275           0 :                         object->array = talloc_array_ptrtype(pytalloc_get_mem_ctx(py_obj), object->array, PyList_GET_SIZE(value));
    9276           0 :                         if (!object->array) { return -1;; }
    9277           0 :                         talloc_set_name_const(object->array, "ARRAY: object->array");
    9278           0 :                         for (array_cntr_1 = 0; array_cntr_1 < PyList_GET_SIZE(value); array_cntr_1++) {
    9279           0 :                                 if (PyList_GET_ITEM(value, array_cntr_1) == NULL) {
    9280           0 :                                         PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->array[array_cntr_1]");
    9281           0 :                                         return -1;
    9282             :                                 }
    9283           0 :                                 PY_CHECK_TYPE(&srvsvc_NetShareInfo1004_Type, PyList_GET_ITEM(value, array_cntr_1), return -1;);
    9284           0 :                                 if (talloc_reference(object->array, pytalloc_get_mem_ctx(PyList_GET_ITEM(value, array_cntr_1))) == NULL) {
    9285           0 :                                         PyErr_NoMemory();
    9286           0 :                                         return -1;
    9287             :                                 }
    9288           0 :                                 object->array[array_cntr_1] = *(struct srvsvc_NetShareInfo1004 *)pytalloc_get_ptr(PyList_GET_ITEM(value, array_cntr_1));
    9289             :                         }
    9290             :                 }
    9291             :         }
    9292           0 :         return 0;
    9293             : }
    9294             : 
    9295             : static PyGetSetDef py_srvsvc_NetShareCtr1004_getsetters[] = {
    9296             :         {
    9297             :                 .name = discard_const_p(char, "count"),
    9298             :                 .get = py_srvsvc_NetShareCtr1004_get_count,
    9299             :                 .set = py_srvsvc_NetShareCtr1004_set_count,
    9300             :                 .doc = discard_const_p(char, "PIDL-generated element of base type uint32")
    9301             :         },
    9302             :         {
    9303             :                 .name = discard_const_p(char, "array"),
    9304             :                 .get = py_srvsvc_NetShareCtr1004_get_array,
    9305             :                 .set = py_srvsvc_NetShareCtr1004_set_array,
    9306             :                 .doc = discard_const_p(char, "PIDL-generated element of base type srvsvc_NetShareInfo1004")
    9307             :         },
    9308             :         { .name = NULL }
    9309             : };
    9310             : 
    9311           0 : static PyObject *py_srvsvc_NetShareCtr1004_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
    9312             : {
    9313           0 :         return pytalloc_new(struct srvsvc_NetShareCtr1004, type);
    9314             : }
    9315             : 
    9316             : 
    9317             : static PyTypeObject srvsvc_NetShareCtr1004_Type = {
    9318             :         PyVarObject_HEAD_INIT(NULL, 0)
    9319             :         .tp_name = "srvsvc.NetShareCtr1004",
    9320             :         .tp_getset = py_srvsvc_NetShareCtr1004_getsetters,
    9321             :         .tp_methods = NULL,
    9322             :         .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
    9323             :         .tp_new = py_srvsvc_NetShareCtr1004_new,
    9324             : };
    9325             : 
    9326             : 
    9327           0 : static PyObject *py_srvsvc_NetShareInfo1005_get_dfs_flags(PyObject *obj, void *closure)
    9328             : {
    9329           0 :         struct srvsvc_NetShareInfo1005 *object = (struct srvsvc_NetShareInfo1005 *)pytalloc_get_ptr(obj);
    9330             :         PyObject *py_dfs_flags;
    9331           0 :         py_dfs_flags = PyLong_FromUnsignedLongLong((uint32_t)object->dfs_flags);
    9332           0 :         return py_dfs_flags;
    9333             : }
    9334             : 
    9335           0 : static int py_srvsvc_NetShareInfo1005_set_dfs_flags(PyObject *py_obj, PyObject *value, void *closure)
    9336             : {
    9337           0 :         struct srvsvc_NetShareInfo1005 *object = (struct srvsvc_NetShareInfo1005 *)pytalloc_get_ptr(py_obj);
    9338           0 :         if (value == NULL) {
    9339           0 :                 PyErr_Format(PyExc_AttributeError, "Cannot delete NDR object: struct object->dfs_flags");
    9340           0 :                 return -1;
    9341             :         }
    9342             :         {
    9343           0 :                 const unsigned long long uint_max = ndr_sizeof2uintmax(sizeof(object->dfs_flags));
    9344           0 :                 if (PyLong_Check(value)) {
    9345             :                         unsigned long long test_var;
    9346           0 :                         test_var = PyLong_AsUnsignedLongLong(value);
    9347           0 :                         if (PyErr_Occurred() != NULL) {
    9348           0 :                                 return -1;
    9349             :                         }
    9350           0 :                         if (test_var > uint_max) {
    9351           0 :                                 PyErr_Format(PyExc_OverflowError, "Expected type %s within range 0 - %llu, got %llu",\
    9352             :                                   PyLong_Type.tp_name, uint_max, test_var);
    9353           0 :                                 return -1;
    9354             :                         }
    9355           0 :                         object->dfs_flags = test_var;
    9356             :                 } else {
    9357           0 :                         PyErr_Format(PyExc_TypeError, "Expected type %s",\
    9358             :                           PyLong_Type.tp_name);
    9359           0 :                         return -1;
    9360             :                 }
    9361             :         }
    9362           0 :         return 0;
    9363             : }
    9364             : 
    9365             : static PyGetSetDef py_srvsvc_NetShareInfo1005_getsetters[] = {
    9366