LCOV - code coverage report
Current view: top level - bin/default/librpc/gen_ndr - py_lsa.c (source / functions) Hit Total Coverage
Test: coverage report for abartlet/fix-coverage dd10fb34 Lines: 2155 24817 8.7 %
Date: 2021-09-23 10:06:22 Functions: 131 1909 6.9 %

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